UNPKG

@progress/kendo-vue-data-tools

Version:
62 lines (61 loc) 1.68 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as m, createVNode as s } from "vue"; import { DropDownList as c } from "@progress/kendo-vue-dropdowns"; import { provideLocalizationService as d } from "@progress/kendo-vue-intl"; import { filterEnumFilterDropdownAriaLabel as r, messages as n } from "../../messages/main.mjs"; const v = /* @__PURE__ */ m({ name: "KendoEnumFilter", props: { filter: { type: Object, required: !0 }, dataItems: Array, defaultItem: Object, ariaLabel: String, onFilterchange: Function }, inject: { kendoLocalizationService: { default: null } }, render() { const t = d(this), { filter: o, dataItems: i = [], defaultItem: l, ariaLabel: u = t.toLanguageString(r, n[r]) } = this.$props, a = i.map((e) => ({ ...e, text: t.toLanguageString(e.text, n[e.text] || e.text) })); return s(c, { value: a.find((e) => e.value === o.value) || null, onChange: this.onChange, defaultItem: l, dataItems: a, textField: "text", ariaLabel: u }, null); }, methods: { onChange(t) { this.$emit("filterchange", { nextFilter: { ...this.$props.filter, value: t.value.value } }); } } }); export { v as EnumFilter };