@progress/kendo-vue-dropdowns 6.1.0-develop.5 → 6.1.0-develop.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,36 +5,36 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as Fe, ref as Q, inject as Te, h as _, createVNode as r, isVNode as Oe } from "vue";
9
- import { guid as X, canUseDOM as Ve, getRef as Z, Keys as f, templateRendering as b, getListeners as I, classNames as R, setRef as we, kendoThemeMaps as Re, Icon as De } from "@progress/kendo-vue-common";
10
- import { ListContainer as Be } from "../common/ListContainer.mjs";
11
- import { List as Me } from "../common/List.mjs";
12
- import { TagList as Ae } from "./TagList.mjs";
13
- import { SearchBar as Le } from "../common/SearchBar.mjs";
14
- import He from "../common/DropDownBase.mjs";
8
+ import { defineComponent as $e, ref as Q, inject as Fe, h as _, createVNode as r, isVNode as Te } from "vue";
9
+ import { guid as X, canUseDOM as Oe, getRef as Z, Keys as f, templateRendering as b, getListeners as I, classNames as R, setRef as Ve, kendoThemeMaps as we, Icon as Re } from "@progress/kendo-vue-common";
10
+ import { ListContainer as De } from "../common/ListContainer.mjs";
11
+ import { List as Be } from "../common/List.mjs";
12
+ import { TagList as Me } from "./TagList.mjs";
13
+ import { SearchBar as Ae } from "../common/SearchBar.mjs";
14
+ import Le from "../common/DropDownBase.mjs";
15
15
  import { GroupStickyHeader as ee } from "../common/GroupStickyHeader.mjs";
16
- import { ClearButton as Ee } from "../common/ClearButton.mjs";
16
+ import { ClearButton as He } from "../common/ClearButton.mjs";
17
17
  import { ActiveDescendant as L } from "../common/settings.mjs";
18
- import { getItemValue as x, areSame as te, removeDataItems as H, isPresent as Pe, matchDataCollections as Ne, itemIndexStartsWith as Ke, preventDefaultNonInputs as _e } from "../common/utils.mjs";
19
- import { xIcon as je, plusIcon as ze } from "@progress/kendo-svg-icons";
18
+ import { getItemValue as x, areSame as te, removeDataItems as H, isPresent as Ee, matchDataCollections as Pe, itemIndexStartsWith as Ne, preventDefaultNonInputs as Ke } from "../common/utils.mjs";
19
+ import { xIcon as _e, plusIcon as je } from "@progress/kendo-svg-icons";
20
20
  import { Button as j } from "@progress/kendo-vue-buttons";
21
- import { MOBILE_SMALL_DEVICE as se, MOBILE_MEDIUM_DEVICE as We } from "../common/constants.mjs";
21
+ import { MOBILE_SMALL_DEVICE as ze, MOBILE_MEDIUM_DEVICE as We } from "../common/constants.mjs";
22
22
  import { ActionSheet as Ge } from "@progress/kendo-vue-layout";
23
23
  import { ListFilter as qe } from "../common/ListFilter.mjs";
24
24
  import { provideLocalizationService as Ue } from "@progress/kendo-vue-intl";
25
- import { adaptiveModeFooterCancel as ie, messages as ne, adaptiveModeFooterApply as ae } from "../messages/main.mjs";
25
+ import { adaptiveModeFooterCancel as se, messages as ie, adaptiveModeFooterApply as ne } from "../messages/main.mjs";
26
26
  const {
27
27
  sizeMap: z,
28
28
  roundedMap: Ye
29
- } = Re;
29
+ } = we;
30
30
  function E(e) {
31
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Oe(e);
31
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Te(e);
32
32
  }
33
- const Je = "Please enter a valid value!", Qe = (e) => e.preventDefault(), oe = (e, t, s) => !!e != !!t || e.text !== t.text ? !1 : e === t || Ne(e.data, t.data, s), le = (e) => e === S.CustomItem;
33
+ const Je = "Please enter a valid value!", Qe = (e) => e.preventDefault(), ae = (e, t, s) => !!e != !!t || e.text !== t.text ? !1 : e === t || Pe(e.data, t.data, s), oe = (e) => e === S.CustomItem;
34
34
  var S = /* @__PURE__ */ function(e) {
35
35
  return e[e.None = 0] = "None", e[e.ListItem = 1] = "ListItem", e[e.CustomItem = 2] = "CustomItem", e;
36
36
  }(S || {});
37
- const vt = /* @__PURE__ */ Fe({
37
+ const vt = /* @__PURE__ */ $e({
38
38
  name: "KendoMultiSelect",
39
39
  emits: {
40
40
  changemodel: null,
@@ -177,7 +177,7 @@ const vt = /* @__PURE__ */ Fe({
177
177
  inputAttributes: Object
178
178
  },
179
179
  setup() {
180
- const e = Q(null), t = Q(null), s = Te("kendoLocalizationService", {});
180
+ const e = Q(null), t = Q(null), s = Fe("kendoLocalizationService", {});
181
181
  return {
182
182
  inputRef: e,
183
183
  kendoAnchorRef: t,
@@ -199,25 +199,31 @@ const vt = /* @__PURE__ */ Fe({
199
199
  return this.$props.opened !== void 0 ? this.$props.opened : this.currentOpened;
200
200
  },
201
201
  animationStyles() {
202
- return this.windowWidth <= se ? {
202
+ return this.windowWidth <= this.adaptiveModeBreakpoints.small ? {
203
203
  top: 0,
204
204
  width: "100%",
205
205
  height: "100%"
206
206
  } : void 0;
207
207
  },
208
208
  classNameAdaptive() {
209
- return this.windowWidth <= se ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom";
209
+ return this.windowWidth <= this.adaptiveModeBreakpoints.small ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom";
210
210
  },
211
211
  adaptiveState() {
212
- return this.windowWidth <= We && this.$props.adaptive;
212
+ return this.windowWidth <= this.adaptiveModeBreakpoints.medium && this.$props.adaptive;
213
213
  }
214
214
  },
215
215
  created() {
216
- this.observer = null, this.valuesItemsDuringOnChange = null, this._tags = [], this._skipFocusEvent = !1, this.scrollToFocused = !1, this.base = new He(this), this.anchor = X(), this.inputId = X();
216
+ this.observer = null, this.valuesItemsDuringOnChange = null, this._tags = [], this._skipFocusEvent = !1, this.scrollToFocused = !1, this.base = new Le(this), this.anchor = X(), this.inputId = X();
217
217
  },
218
218
  inject: {
219
219
  kendoLocalizationService: {
220
220
  default: null
221
+ },
222
+ adaptiveModeBreakpoints: {
223
+ default: {
224
+ small: ze,
225
+ medium: We
226
+ }
221
227
  }
222
228
  },
223
229
  data() {
@@ -283,7 +289,7 @@ const vt = /* @__PURE__ */ Fe({
283
289
  this.scrollToFocused = !1, this.searchBarRef(), this.setValidity();
284
290
  },
285
291
  mounted() {
286
- this.observer = Ve && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.input = this.inputRef.input, this.base.wrapper = Z(this, "kendoAnchor"), this.element = Z(this, "kendoAnchor"), this.base.didMount(), this.searchBarRef(), this.setValidity();
292
+ this.observer = Oe && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.input = this.inputRef.input, this.base.wrapper = Z(this, "kendoAnchor"), this.element = Z(this, "kendoAnchor"), this.base.didMount(), this.searchBarRef(), this.setValidity();
287
293
  },
288
294
  methods: {
289
295
  clearFilter(e) {
@@ -333,7 +339,7 @@ const vt = /* @__PURE__ */ Fe({
333
339
  } = this.$props, n = this.isOpen, o = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
334
340
  focusedType: l,
335
341
  focusedIndex: d
336
- } = this.getFocusedState(), c = s && o, a = le(l), p = this.base, g = p.vs;
342
+ } = this.getFocusedState(), c = s && o, a = oe(l), p = this.base, g = p.vs;
337
343
  if (n && t === f.up && a)
338
344
  this.currentFocusedIndex !== void 0 && (e.data.currentFocusedIndex = void 0);
339
345
  else {
@@ -368,7 +374,7 @@ const vt = /* @__PURE__ */ Fe({
368
374
  const t = this.isOpen, s = this.base.initState();
369
375
  s.event = e, e.stopPropagation(), this.computedValue().length > 0 && this.triggerOnChange([], s), this.currentFocusedIndex !== void 0 && (s.data.currentFocusedIndex = void 0), t && this.base.togglePopup(s);
370
376
  const i = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
371
- Pe(i) && i !== "" && this.base.filterChanged("", s), this.currentText && (s.data.currentText = ""), this.applyState(s);
377
+ Ee(i) && i !== "" && this.base.filterChanged("", s), this.currentText && (s.data.currentText = ""), this.applyState(s);
372
378
  },
373
379
  onInputKeyDown(e) {
374
380
  this.isScrolling && (this.isScrolling = !1);
@@ -384,7 +390,7 @@ const vt = /* @__PURE__ */ Fe({
384
390
  },
385
391
  onTagsNavigate(e, t) {
386
392
  const s = e.keyCode, i = this.currentFocusedTag, n = this._tags, o = this.$props.dataItemKey;
387
- let l = i ? n.findIndex((a) => oe(a, i, o)) : -1, d;
393
+ let l = i ? n.findIndex((a) => ae(a, i, o)) : -1, d;
388
394
  const c = l !== -1;
389
395
  if (s === f.left)
390
396
  c ? l = Math.max(0, l - 1) : l = n.length - 1, d = n[l];
@@ -434,7 +440,7 @@ const vt = /* @__PURE__ */ Fe({
434
440
  dataItemKey: n,
435
441
  virtual: o,
436
442
  textField: l,
437
- focusedItemIndex: d = Ke
443
+ focusedItemIndex: d = Ne
438
444
  } = this.$props, c = o && o.skip || 0;
439
445
  let a;
440
446
  if (e !== void 0)
@@ -592,16 +598,16 @@ const vt = /* @__PURE__ */ Fe({
592
598
  rounded: g,
593
599
  tagsRounded: m,
594
600
  removeTagIcon: $,
595
- adaptiveTitle: re,
601
+ adaptiveTitle: le,
596
602
  header: P,
597
603
  footer: W,
598
- inputAttributes: de,
599
- groupStickyHeaderItemRender: ue,
604
+ inputAttributes: re,
605
+ groupStickyHeaderItemRender: de,
600
606
  dataItems: F = []
601
- } = this.$props, ce = this.currentFocused, D = Object.assign({}, {
607
+ } = this.$props, ue = this.currentFocused, D = Object.assign({}, {
602
608
  animate: !0,
603
609
  height: "200px"
604
- }, this.$props.popupSettings), B = this.currentFocusedTag, G = this.computedValue(), M = (this.$props.filter !== void 0 ? this.$props.filter : this.currentText) || "", pe = !c && (!!M || G.length > 0), y = this.base.vs, N = this.$props.id || this.inputId, he = b.call(this, this.$props.tagRender, I.call(this)), A = this.isOpen, T = this.adaptiveState, q = Ue(this);
610
+ }, this.$props.popupSettings), B = this.currentFocusedTag, G = this.computedValue(), M = (this.$props.filter !== void 0 ? this.$props.filter : this.currentText) || "", ce = !c && (!!M || G.length > 0), y = this.base.vs, N = this.$props.id || this.inputId, pe = b.call(this, this.$props.tagRender, I.call(this)), A = this.isOpen, T = this.adaptiveState, q = Ue(this);
605
611
  this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(this.$props.dataItems[0], this.$props.groupField)), y.enabled = d !== void 0, d !== void 0 && (y.skip = d.skip, y.total = d.total, y.pageSize = d.pageSize);
606
612
  let v = [];
607
613
  this.initialAdaptiveRenderingValues ? [...this.initialAdaptiveRenderingValues].forEach((h) => {
@@ -615,13 +621,13 @@ const vt = /* @__PURE__ */ Fe({
615
621
  data: [u]
616
622
  });
617
623
  }) : v.push(...n), v.length > 0 && this.setItems(v, this._tags);
618
- const fe = !this.$props.validityStyles || this.validity().valid, ge = function(u) {
624
+ const he = !this.$props.validityStyles || this.validity().valid, fe = function(u) {
619
625
  const h = this.activedescendant, {
620
626
  placeholder: k
621
627
  } = this.$props, {
622
628
  focusedIndex: O
623
629
  } = this.getFocusedState(), C = v.length === 0 || G.length === 0 && !M ? k : void 0, V = h === L.TagsList && B !== void 0 ? `tag-${this.base.guid}-${B.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${O}`;
624
- return r(Le, {
630
+ return r(Ae, {
625
631
  id: u,
626
632
  size: Math.max((C || "").length, M.length, 1),
627
633
  tabIndex: this.$props.tabIndex,
@@ -641,7 +647,7 @@ const vt = /* @__PURE__ */ Fe({
641
647
  "aria-describedBy": `tagslist-${this.base.guid}${this.$props.ariaDescribedBy ? " " + this.$props.ariaDescribedBy : ""}`,
642
648
  "aria-labelledBy": this.$props.ariaLabelledBy,
643
649
  "aria-label": this.$props.ariaLabel,
644
- inputAttributes: de
650
+ inputAttributes: re
645
651
  }, null);
646
652
  }, U = function() {
647
653
  let u;
@@ -651,7 +657,7 @@ const vt = /* @__PURE__ */ Fe({
651
657
  focusedIndex: w
652
658
  } = this.getFocusedState(), K = `translateY(${y.translate}px)`;
653
659
  let J = F;
654
- return h && (J = this.base.getGroupedDataModernMode(F, h)), r(Me, {
660
+ return h && (J = this.base.getGroupedDataModernMode(F, h)), r(Be, {
655
661
  id: this.base.listBoxId,
656
662
  show: A,
657
663
  dataItems: J.slice(),
@@ -676,15 +682,15 @@ const vt = /* @__PURE__ */ Fe({
676
682
  noDataRender: C,
677
683
  groupField: h,
678
684
  onScroll: this.onScroll
679
- }, E(u = me.call(this)) ? u : {
685
+ }, E(u = ge.call(this)) ? u : {
680
686
  default: () => [u]
681
687
  });
682
- }, me = function() {
688
+ }, ge = function() {
683
689
  return y.enabled && r("div", {
684
690
  ref: "scrollElement",
685
691
  key: "scrollElementKey"
686
692
  }, null);
687
- }, ve = function() {
693
+ }, me = function() {
688
694
  const u = this.base, {
689
695
  allowCustom: h
690
696
  } = this.$props, k = b.call(this, this.$props.groupStickyHeaderItemRender, I.call(this)), O = u.getTemplateDef.call(this, P), C = u.getTemplateDef.call(this, W), V = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
@@ -695,16 +701,16 @@ const vt = /* @__PURE__ */ Fe({
695
701
  onClick: this.customItemSelect
696
702
  }, [r("div", {
697
703
  class: R("k-item k-custom-item", {
698
- "k-focus": le(w)
704
+ "k-focus": oe(w)
699
705
  })
700
- }, [V, r(De, {
706
+ }, [V, r(Re, {
701
707
  name: "plus",
702
- icon: ze,
708
+ icon: je,
703
709
  style: {
704
710
  float: "right"
705
711
  }
706
712
  }, null)])]);
707
- return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(F[0], this.$props.groupField)), r(Be, {
713
+ return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(F[0], this.$props.groupField)), r(De, {
708
714
  ref: "container",
709
715
  onMousedown: Qe,
710
716
  dir: s !== void 0 ? s : u.dirCalculated,
@@ -733,7 +739,7 @@ const vt = /* @__PURE__ */ Fe({
733
739
  class: "k-list-footer"
734
740
  }, [C]), d && P]
735
741
  });
736
- }, be = function() {
742
+ }, ve = function() {
737
743
  const u = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
738
744
  return this.$props.filterable && r(qe, {
739
745
  value: u,
@@ -744,13 +750,13 @@ const vt = /* @__PURE__ */ Fe({
744
750
  rounded: g,
745
751
  fillMode: p
746
752
  }, null);
747
- }, Ie = () => [r("div", {
753
+ }, be = () => [r("div", {
748
754
  class: "k-actionsheet-titlebar-group k-hbox"
749
755
  }, [r("div", {
750
756
  class: "k-actionsheet-title"
751
757
  }, [r("div", {
752
758
  class: "k-text-center"
753
- }, [re]), r("div", {
759
+ }, [le]), r("div", {
754
760
  class: "k-actionsheet-subtitle k-text-center"
755
761
  }, null)]), r("div", {
756
762
  class: "k-actionsheet-actions"
@@ -762,11 +768,11 @@ const vt = /* @__PURE__ */ Fe({
762
768
  fillMode: "flat",
763
769
  onClick: this.onCancel,
764
770
  icon: "x",
765
- svgIcon: je
771
+ svgIcon: _e
766
772
  }, null)])]), r("div", {
767
773
  class: "k-actionsheet-titlebar-group k-actionsheet-filter"
768
- }, [be.call(this)])], Se = b.call(this, Ie, I.call(this)), ye = () => {
769
- const u = q.toLanguageString(ie, ne[ie]), h = q.toLanguageString(ae, ne[ae]);
774
+ }, [ve.call(this)])], Ie = b.call(this, be, I.call(this)), Se = () => {
775
+ const u = q.toLanguageString(se, ie[se]), h = q.toLanguageString(ne, ie[ne]);
770
776
  return [r(j, {
771
777
  size: "large",
772
778
  "aria-label": u,
@@ -785,8 +791,8 @@ const vt = /* @__PURE__ */ Fe({
785
791
  }, E(h) ? h : {
786
792
  default: () => [h]
787
793
  })];
788
- }, ke = b.call(this, ye, I.call(this)), Ce = () => {
789
- const u = this.base.getTemplateDef.call(this, P, _), h = this.base.getTemplateDef.call(this, W, _), k = b.call(this, ue, I.call(this));
794
+ }, ye = b.call(this, Se, I.call(this)), ke = () => {
795
+ const u = this.base.getTemplateDef.call(this, P, _), h = this.base.getTemplateDef.call(this, W, _), k = b.call(this, de, I.call(this));
790
796
  return r("div", {
791
797
  class: "k-list-container"
792
798
  }, [u && r("div", {
@@ -803,7 +809,7 @@ const vt = /* @__PURE__ */ Fe({
803
809
  }, null), U.call(this), h && r("div", {
804
810
  class: "k-list-footer"
805
811
  }, [h])])]);
806
- }, xe = b.call(this, Ce, I.call(this)), $e = function() {
812
+ }, Ce = b.call(this, ke, I.call(this)), xe = function() {
807
813
  return r(Ge, {
808
814
  expand: A,
809
815
  animation: !0,
@@ -811,23 +817,23 @@ const vt = /* @__PURE__ */ Fe({
811
817
  className: this.classNameAdaptive,
812
818
  contentClassName: "!k-overflow-hidden",
813
819
  footerClassName: "k-actions k-actions-stretched",
814
- header: Se,
815
- content: xe,
816
- footer: ke,
820
+ header: Ie,
821
+ content: Ce,
822
+ footer: ye,
817
823
  onClose: this.onCancel,
818
824
  navigatableElements: ["input.k-input-inner", ".k-actionsheet-actions > button"]
819
825
  }, null);
820
826
  }, Y = [_(function() {
821
827
  let u;
822
828
  return r("span", {
823
- ref: we(this, "kendoAnchor"),
829
+ ref: Ve(this, "kendoAnchor"),
824
830
  class: R("k-multiselect", "k-input", {
825
831
  [`k-input-${z[a] || a}`]: a,
826
832
  [`k-rounded-${Ye[g] || g}`]: g,
827
833
  [`k-input-${p}`]: p,
828
- "k-focus": ce && !i,
834
+ "k-focus": ue && !i,
829
835
  "k-disabled": i,
830
- "k-invalid": !fe,
836
+ "k-invalid": !he,
831
837
  "k-loading": c,
832
838
  "k-required": this.required
833
839
  }),
@@ -838,27 +844,27 @@ const vt = /* @__PURE__ */ Fe({
838
844
  dir: s,
839
845
  onFocusin: this.handleFocus,
840
846
  onClick: this.handleWrapperClick,
841
- onMousedown: _e
842
- }, [r(Ae, {
847
+ onMousedown: Ke
848
+ }, [r(Me, {
843
849
  removeTagIcon: $,
844
850
  tagsRounded: m,
845
851
  size: a,
846
852
  fillMode: p,
847
- tagRender: he,
853
+ tagRender: pe,
848
854
  onTagdelete: this.onTagDelete,
849
855
  dataItems: v,
850
856
  guid: this.base.guid,
851
- focused: B ? v.find((h) => oe(h, B, l)) : void 0
852
- }, E(u = ge.call(this, N)) ? u : {
857
+ focused: B ? v.find((h) => ae(h, B, l)) : void 0
858
+ }, E(u = fe.call(this, N)) ? u : {
853
859
  default: () => [u]
854
- }), v.length > 0 && pe && r(Ee, {
860
+ }), v.length > 0 && ce && r(He, {
855
861
  onClearclick: this.clearButtonClick
856
862
  }, null), r("span", {
857
863
  class: c ? "k-input-loading-icon k-icon k-i-loading" : void 0
858
- }, null), !T && ve.call(this)]);
864
+ }, null), !T && me.call(this)]);
859
865
  }.call(this), {
860
866
  ...this.$attrs
861
- }), T && $e.call(this)];
867
+ }), T && xe.call(this)];
862
868
  return t ? r("span", {
863
869
  class: this.spanClassNames,
864
870
  dir: this.$props.dir
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),i=require("@progress/kendo-vue-common"),ae=require("@progress/kendo-vue-popup"),ne=require("@progress/kendo-vue-intl"),L=require("@progress/kendo-vue-treeview"),oe=require("../package-metadata.js"),y=require("../common/utils.js"),le=require("../DropDownTree/ListNoData.js"),p=require("../messages/main.js"),re=require("@progress/kendo-vue-labels"),x=require("@progress/kendo-vue-buttons"),de=require("../MultiSelect/TagList.js"),ce=require("../common/ClearButton.js"),B=require("../common/ListFilter.js"),he=require("./utils.js"),$=require("../common/constants.js"),ue=require("@progress/kendo-vue-layout"),pe=require("@progress/kendo-svg-icons"),fe=require("../common/DropDownBase.js");function F(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!s.isVNode(e)}const ge="Please select a value from the list!",{sizeMap:A,roundedMap:me}=i.kendoThemeMaps,ve=e=>e.split("_").map(t=>parseInt(t,10)),q=(e,t)=>{const{validationMessage:a,valid:n,required:o}=e;return{customError:a!==void 0,valid:!!(n!==void 0?n:!o||t),valueMissing:!t}},ye=s.defineComponent({name:"KendoMultiSelectTree",model:{event:"changemodel"},emits:{open:null,close:null,focus:null,blur:null,change:null,filterchange:null,expandchange:null,changemodel:null,"update:modelValue":null},props:{opened:{type:Boolean,default:void 0},disabled:Boolean,dir:String,tabIndex:Number,accessKey:String,dataItems:{type:Array,default:function(){return[]}},value:Array,modelValue:Array,valueMap:Function,placeholder:String,dataItemKey:{type:String,required:!0},textField:{type:String,required:!0},checkField:{type:String,default:"checkField"},checkIndeterminateField:{type:String,default:"checkIndeterminateField"},expandField:String,subItemsField:{type:String,default:"items"},className:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:Boolean,name:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String,filterable:Boolean,filter:String,loading:Boolean,tags:Array,popupSettings:{type:Object,default:function(){return{animate:!0,height:"200px",anchor:""}}},size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},rounded:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large","full"].includes(e)}},fillMode:{type:String,default:"solid",validator:function(e){return[null,"flat","outline","solid"].includes(e)}},item:[String,Function,Object],tag:[String,Function,Object],header:[String,Function,Object],footer:[String,Function,Object],listNoData:[String,Function,Object],adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0}},inject:{kendoLocalizationService:{default:null}},created(){this.observer=null,i.validatePackage(oe.packageMetadata),this.base=new fe(this),this.componentGuid=i.guid(),this.anchor=i.guid()},data(){return{focusedTagState:void 0,openState:!1,focusedState:!1,filterState:"",currentValue:[],popupWidth:"200px",windowWidth:0,initialAdaptiveRenderingValues:void 0}},computed:{animationStyles(){return this.windowWidth<=$.MOBILE_SMALL_DEVICE?{top:0,width:"100%",height:"100%"}:void 0},classNameAdaptive(){return this.windowWidth<=$.MOBILE_SMALL_DEVICE?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"},adaptiveState(){return this.windowWidth<=$.MOBILE_MEDIUM_DEVICE&&this.$props.adaptive},isOpen(){return this.opened!==void 0?this.opened:this.openState},computedValue(){return this.value!==void 0?this.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentValue},hasValue(){return!!this.computedValue.length},tagsToRenderRef(){if(this.initialAdaptiveRenderingValues===void 0)return this.tags===void 0?this.computedValue.map(e=>({text:y.getItemValue(e,this.$props.textField),data:[e]})):[...this.tags];{const e=this.initialAdaptiveRenderingValues;return e.length>0&&e.map(t=>({text:y.getItemValue(t,this.$props.textField),data:[t]}))}}},watch:{isOpen:function(e){e&&this.value?this.initialAdaptiveRenderingValues=[...this.value]:this.initialAdaptiveRenderingValues=void 0}},mounted(){this.observer=i.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.elementRef=i.getRef(this,"kendoAnchor"),this.inputRef=i.getRef(this,"input"),this.selectRef=i.getRef(this,"select"),this.treeViewRef=i.getRef(this,"treeView"),this.skipFocusRef=!1,this.popupRef=i.getRef(this,"popup"),this.calculatePopupWidth()},updated(){this.inputRef=i.getRef(this,"input"),this.treeViewRef=i.getRef(this,"treeView"),this.popupRef&&this.isOpen&&this.hasValue&&this.popupRef.reposition(),this.setValidity(),this.calculatePopupWidth()},render(){let e;const t=this.$props.id||this.componentGuid,{dataItems:a,dataItemKey:n,popupSettings:o={},disabled:d,placeholder:l,label:r,name:c,checkField:g,checkIndeterminateField:V,subItemsField:C,validationMessage:O,valid:P,value:K,required:R,validityStyles:W,adaptiveTitle:z}=this.$props,b=i.getTabIndex(this.$props.tabIndex,d),w=ne.provideLocalizationService(this),j=q({validationMessage:O,valid:P,required:R},this.hasValue),k=this.$props.dir,N=this.adaptiveState,M=i.templateRendering.call(this,this.item,i.getListeners.call(this)),_=i.templateRendering.call(this,this.tag,i.getListeners.call(this)),G=i.templateRendering.call(this,this.$props.header,i.getListeners.call(this)),H=i.templateRendering.call(this,this.$props.footer,i.getListeners.call(this)),I=i.getTemplate.call(this,{h:s.h,template:G}),T=i.getTemplate.call(this,{h:s.h,template:H}),U=i.templateRendering.call(this,this.$props.listNoData,i.getListeners.call(this)),J=s.createVNode(le.ListNoData,null,F(e=w.toLanguageString(p.nodata,p.messages[p.nodata]))?e:{default:()=>[e]}),E=i.getTemplate.call(this,{h:s.h,defaultRendering:J,template:U}),D=!W||j.valid,{size:h,rounded:m,fillMode:v}=this.$props,Q=()=>[s.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[s.createVNode("div",{class:"k-actionsheet-title"},[s.createVNode("div",{class:"k-text-center"},[z]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[l])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode(x.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onCancel,icon:"x",svgIcon:pe.xIcon},null)])]),s.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[this.$props.filterable&&s.createVNode(B.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:i.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null)])],X=i.templateRendering.call(this,Q,i.getListeners.call(this)),Y=()=>{const u=w.toLanguageString(p.adaptiveModeFooterCancel,p.messages[p.adaptiveModeFooterCancel]),f=w.toLanguageString(p.adaptiveModeFooterApply,p.messages[p.adaptiveModeFooterApply]);return[s.createVNode(x.Button,{size:"large","aria-label":u,"aria-disabled":"false",type:"button",onClick:this.onCancel},F(u)?u:{default:()=>[u]}),s.createVNode(x.Button,{themeColor:"primary",size:"large","aria-label":f,"aria-disabled":"false",type:"button",onClick:this.closePopup},F(f)?f:{default:()=>[f]})]},Z=i.templateRendering.call(this,Y,i.getListeners.call(this)),ee=()=>{const u=this.base.getTemplateDef.call(this,I,s.h),f=this.base.getTemplateDef.call(this,T,s.h);return[u&&s.createVNode("div",{class:"k-list-header"},[u]),a.length>0?s.createVNode(L.TreeView,{ref:i.setRef(this,"treeView"),tabIndex:b,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:V,expandField:this.$props.expandField,childrenField:C,expandIcons:!0,onItemclick:this.onChange,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:"large",item:M},null):E,f&&s.createVNode("div",{class:"k-list-footer"},[f])]},te=i.templateRendering.call(this,ee,i.getListeners.call(this)),ie=function(){return s.createVNode(ue.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,footerClassName:"k-actions k-actions-stretched",contentClassName:"!k-overflow-hidden",header:X,content:te,footer:Z,onClose:this.onCancel,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},se=function(){return s.createVNode("span",{ref:i.setRef(this,"kendoAnchor"),class:i.classNames("k-multiselecttree k-input",this.$props.className,{[`k-input-${A[h]||h}`]:h,[`k-rounded-${me[m]||m}`]:m,[`k-input-${v}`]:v,"k-focus":this.focusedState&&!d,"k-invalid":!D,"k-disabled":d,"k-loading":this.$props.loading,"k-required":R}),tabindex:b,accesskey:this.$props.accessKey,id:t,dir:k,onKeydown:this.onWrapperKeyDown,onMousedown:this.onWrapperMouseDown,onFocusin:this.onFocus,onFocusout:this.onBlur,role:"combobox","aria-haspopup":"tree","aria-expanded":this.isOpen,"aria-disabled":d,"aria-label":r,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaLabelledBy?this.$props.ariaLabelledBy:"tagslist-"+t,"aria-required":this.$props.required,onClick:this.onWrapperClick},[this.tagsToRenderRef.length>0&&s.createVNode(de.TagList,{id:"tagslist-"+t,class:i.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${A[h]||h}`]:h,"k-readonly":this.hasValue}),tagRender:_,onTagdelete:this.onTagDelete,dataItems:this.tagsToRenderRef,guid:t,focused:this.focusedTagState?this.tagsToRenderRef.find(u=>this.focusedTagState&&y.matchTags(u,this.focusedTagState,n)):void 0,tagsRounded:m,size:h,fillMode:v},null),s.createVNode("span",{class:"k-input-inner",role:"combobox",tabindex:b,"aria-expanded":this.isOpen,"aria-describedby":"tagslist-"+t,"aria-label":this.$props.ariaLabelledBy},[this.tagsToRenderRef.length===0&&s.createVNode("span",{class:"k-input-value-text"},[l])]),this.$props.loading&&s.createVNode(i.Icon,{class:"k-input-loading-icon",name:"loading"},null),this.hasValue&&!d&&s.createVNode(ce.ClearButton,{onClearclick:this.onClear},null),s.createVNode("select",{name:c,ref:i.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,required:R,title:r,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},[s.createVNode("option",{value:this.$props.valueMap?this.$props.valueMap.call(void 0,K):K},null)]),!N&&s.createVNode(ae.Popup,{style:{width:this.popupWidth,direction:k},popupClass:i.classNames(o.popupClass,"k-multiselecttree-popup","popup-"+this.componentGuid),class:i.classNames(o.className,{"k-rtl":k==="rtl"}),animate:o.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:o.appendTo,ref:i.setRef(this,"popup")},{default:()=>[this.$props.filterable&&s.createVNode(B.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:i.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null),I&&s.createVNode("div",{class:"k-list-header"},[I]),a.length>0?s.createVNode(L.TreeView,{ref:i.setRef(this,"treeView"),tabIndex:b,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:V,expandField:this.$props.expandField,childrenField:C,expandIcons:!0,onItemclick:this.onChange,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:h,item:M},null):E,T&&s.createVNode("div",{class:"k-list-footer"},[T])]})])},S=[s.h(se.call(this),{...this.$attrs}),N&&ie.call(this)];return r?s.createVNode(re.FloatingLabel,{label:r,editorValue:this.hasValue,editorPlaceholder:l,editorValid:D,editorDisabled:d,editorId:t,dir:k},F(S)?S:{default:()=>[S]}):S},methods:{clearFilter(e){this.onFilterChange(e,"")},onCancel(e){const t={event:e,target:this},a={items:[],operation:"toggle",value:this.initialAdaptiveRenderingValues,...t};this.$emit("change",a),this.closePopup(e)},calculateMedia(e){for(let t of e)this.windowWidth=t.target.clientWidth},calculatePopupWidth(){this.elementRef&&(this.popupWidth=this.popupSettings.width!==void 0?this.popupSettings.width:this.elementRef.offsetWidth+"px")},focus(){this.$el&&this.$el.focus()},setValidity(){if(this.selectRef&&this.selectRef.setCustomValidity){const{validationMessage:e,valid:t,required:a}=this.$props,n=q({validationMessage:e,valid:t,required:a},this.hasValue);this.selectRef.setCustomValidity(n.valid?"":this.validationMessage===void 0?ge:this.validationMessage)}},changeValue(e,t,a){const n={dataItemKey:this.dataItemKey,checkField:this.checkField,checkIndeterminateField:this.checkIndeterminateField,expandField:this.expandField,subItemsField:this.subItemsField},o=he.getMultiSelectTreeValue(this.dataItems,{...n,items:t,operation:a,value:this.computedValue}),d={items:t,operation:a,value:o,...e};this.$emit("changemodel",o),this.$emit("update:modelValue",o),this.$emit("change",d)},onChange(e){if(y.areSame(e.item,this.computedValue,this.dataItemKey))return;const{item:t,event:a}=e,n={event:a,target:this};this.changeValue(n,[t],"toggle")},openPopup(e){if(!this.isOpen){const t={...e};this.$emit("open",t),this.opened===void 0&&(this.openState=!0)}},closePopup(e){if(this.$props.filterable&&this.clearFilter(e),this.isOpen){const t={...e};this.$emit("close",t),this.opened===void 0&&(this.openState=!1)}},switchFocus(e){this.skipFocusRef=!0,e(),window.setTimeout(()=>this.skipFocusRef=!1,0)},focusElement(e){e&&this.switchFocus(()=>e.focus())},onPopupOpened(){if(!this.focusedState&&this.isOpen)this.closePopup({target:this});else if(this.$props.filterable){const e=this.inputRef&&this.inputRef.input;this.focusElement(e)}else this.focusElement(this.treeViewRef&&this.treeViewRef.input)},onPopupClosed(){this.focusedState&&this.focusElement(this.elementRef)},onFocus(e){if(!this.focusedState&&!this.skipFocusRef){this.focusedState=!0;const t={event:e,target:this};this.$emit("focus",t)}},onBlur(e){if(this.focusedState&&!this.skipFocusRef&&!this.adaptiveState){this.focusedTagState=void 0,this.focusedState=!1;const t={event:e,target:this},a={...t};(!e.relatedTarget||!e.relatedTarget.closest(".popup-"+this.componentGuid))&&(this.$emit("blur",a),this.closePopup(t))}},onWrapperMouseDown(){this.focusedState&&this.switchFocus(i.noop)},onWrapperClick(e){if(!this.$props.disabled&&!e.defaultPrevented){this.focusedState=!0;const t={event:e,target:this};this.isOpen||this.openPopup(t)}},onWrapperKeyDown(e){const{keyCode:t,altKey:a}=e,n=this.treeViewRef&&this.treeViewRef.$el,o=this.inputRef&&this.inputRef.input;if(this.$props.disabled||e.defaultPrevented&&o===e.target)return;const d={event:e,target:this};if(this.computedValue&&this.computedValue.length>0&&(t===i.Keys.left||t===i.Keys.right||t===i.Keys.home||t===i.Keys.end||t===i.Keys.delete||t===i.Keys.backspace)){const l=this.tagsToRenderRef;let r=this.focusedTagState?l.findIndex(V=>y.matchTags(V,this.focusedTagState,this.dataItemKey)):-1,c;const g=r!==-1;t===i.Keys.left?(g?r=Math.max(0,r-1):r=l.length-1,c=l[r]):t===i.Keys.right?g?(r=Math.min(l.length-1,r+1),c=l[r]):c=l[0]:t===i.Keys.home?c=l[0]:t===i.Keys.end?c=l[l.length-1]:(t===i.Keys.delete||t===i.Keys.backspace)&&g&&this.changeValue(d,l[r].data,"delete"),c!==this.focusedTagState&&(this.focusedTagState=c)}if(this.isOpen)if(t===i.Keys.esc||a&&t===i.Keys.up)e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),this.closePopup(d);else if(n&&n.querySelector(".k-focus")&&(t===i.Keys.up||t===i.Keys.down||t===i.Keys.left||t===i.Keys.right||t===i.Keys.home||t===i.Keys.end)){if(t===i.Keys.up){const l=Array.from(n.querySelectorAll(".k-treeview-item")),r=[...l].reverse().find(c=>!!(c&&c.querySelector(".k-focus")));if(r&&l.indexOf(r)===0)return this.switchFocus(()=>{this.focusElement(o||this.elementRef)})}this.switchFocus(i.noop)}else t===i.Keys.down&&this.switchFocus(()=>{this.focusElement(o||n)});else a&&t===i.Keys.down&&(e.preventDefault(),this.openPopup(d))},onInputKeyDown(e){const{keyCode:t,altKey:a}=e;(t===i.Keys.esc||a&&t===i.Keys.up)&&(e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),t===i.Keys.esc&&this.adaptiveState?this.onCancel(e):this.closePopup(e)),!(a||t!==i.Keys.up&&t!==i.Keys.down)&&(e.preventDefault(),this.switchFocus(t===i.Keys.up?()=>{this.focusElement(this.elementRef)}:()=>{this.focusElement(this.treeViewRef&&this.treeViewRef.$el)}))},onClear(e){const t={event:e,target:this};this.changeValue(t,[],"clear"),this.closePopup(t),this.filterState="",e.preventDefault()},onTagDelete(e,t){if(this.closePopup({target:this}),!this.focusedState){const a=this.inputRef&&this.inputRef.input;this.focusElement(a)}this.changeValue({event:t,target:this},e,"delete")},onExpand(e){const{item:t,itemHierarchicalIndex:a,event:n}=e,o={level:ve(a),item:t,event:n,target:this};this.$emit("expandchange",o)},onFilterChange(e,t){const a=t?"":e.target.value,o={filter:{field:this.$props.textField,operator:"contains",value:a},event:e,target:this};this.$emit("filterchange",o),this.$props.filter===void 0&&(this.filterState=a)}}});exports.MultiSelectTree=ye;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),i=require("@progress/kendo-vue-common"),ae=require("@progress/kendo-vue-popup"),ne=require("@progress/kendo-vue-intl"),D=require("@progress/kendo-vue-treeview"),oe=require("../package-metadata.js"),y=require("../common/utils.js"),le=require("../DropDownTree/ListNoData.js"),p=require("../messages/main.js"),de=require("@progress/kendo-vue-labels"),$=require("@progress/kendo-vue-buttons"),re=require("../MultiSelect/TagList.js"),ce=require("../common/ClearButton.js"),E=require("../common/ListFilter.js"),he=require("./utils.js"),L=require("../common/constants.js"),ue=require("@progress/kendo-vue-layout"),pe=require("@progress/kendo-svg-icons"),fe=require("../common/DropDownBase.js");function F(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!s.isVNode(e)}const ge="Please select a value from the list!",{sizeMap:q,roundedMap:me}=i.kendoThemeMaps,ve=e=>e.split("_").map(t=>parseInt(t,10)),A=(e,t)=>{const{validationMessage:a,valid:n,required:o}=e;return{customError:a!==void 0,valid:!!(n!==void 0?n:!o||t),valueMissing:!t}},ye=s.defineComponent({name:"KendoMultiSelectTree",model:{event:"changemodel"},emits:{open:null,close:null,focus:null,blur:null,change:null,filterchange:null,expandchange:null,changemodel:null,"update:modelValue":null},props:{opened:{type:Boolean,default:void 0},disabled:Boolean,dir:String,tabIndex:Number,accessKey:String,dataItems:{type:Array,default:function(){return[]}},value:Array,modelValue:Array,valueMap:Function,placeholder:String,dataItemKey:{type:String,required:!0},textField:{type:String,required:!0},checkField:{type:String,default:"checkField"},checkIndeterminateField:{type:String,default:"checkIndeterminateField"},expandField:String,subItemsField:{type:String,default:"items"},className:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:Boolean,name:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String,filterable:Boolean,filter:String,loading:Boolean,tags:Array,popupSettings:{type:Object,default:function(){return{animate:!0,height:"200px",anchor:""}}},size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},rounded:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large","full"].includes(e)}},fillMode:{type:String,default:"solid",validator:function(e){return[null,"flat","outline","solid"].includes(e)}},item:[String,Function,Object],tag:[String,Function,Object],header:[String,Function,Object],footer:[String,Function,Object],listNoData:[String,Function,Object],adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0}},inject:{kendoLocalizationService:{default:null},adaptiveModeBreakpoints:{default:{small:L.MOBILE_SMALL_DEVICE,medium:L.MOBILE_MEDIUM_DEVICE}}},created(){this.observer=null,i.validatePackage(oe.packageMetadata),this.base=new fe(this),this.componentGuid=i.guid(),this.anchor=i.guid()},data(){return{focusedTagState:void 0,openState:!1,focusedState:!1,filterState:"",currentValue:[],popupWidth:"200px",windowWidth:0,initialAdaptiveRenderingValues:void 0}},computed:{animationStyles(){return this.windowWidth<=this.adaptiveModeBreakpoints.small?{top:0,width:"100%",height:"100%"}:void 0},classNameAdaptive(){return this.windowWidth<=this.adaptiveModeBreakpoints.small?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"},adaptiveState(){return this.windowWidth<=this.adaptiveModeBreakpoints.medium&&this.$props.adaptive},isOpen(){return this.opened!==void 0?this.opened:this.openState},computedValue(){return this.value!==void 0?this.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentValue},hasValue(){return!!this.computedValue.length},tagsToRenderRef(){if(this.initialAdaptiveRenderingValues===void 0)return this.tags===void 0?this.computedValue.map(e=>({text:y.getItemValue(e,this.$props.textField),data:[e]})):[...this.tags];{const e=this.initialAdaptiveRenderingValues;return e.length>0&&e.map(t=>({text:y.getItemValue(t,this.$props.textField),data:[t]}))}}},watch:{isOpen:function(e){e&&this.value?this.initialAdaptiveRenderingValues=[...this.value]:this.initialAdaptiveRenderingValues=void 0}},mounted(){this.observer=i.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.elementRef=i.getRef(this,"kendoAnchor"),this.inputRef=i.getRef(this,"input"),this.selectRef=i.getRef(this,"select"),this.treeViewRef=i.getRef(this,"treeView"),this.skipFocusRef=!1,this.popupRef=i.getRef(this,"popup"),this.calculatePopupWidth()},updated(){this.inputRef=i.getRef(this,"input"),this.treeViewRef=i.getRef(this,"treeView"),this.popupRef&&this.isOpen&&this.hasValue&&this.popupRef.reposition(),this.setValidity(),this.calculatePopupWidth()},render(){let e;const t=this.$props.id||this.componentGuid,{dataItems:a,dataItemKey:n,popupSettings:o={},disabled:r,placeholder:l,label:d,name:c,checkField:g,checkIndeterminateField:k,subItemsField:I,validationMessage:O,valid:P,value:C,required:R,validityStyles:W,adaptiveTitle:z}=this.$props,b=i.getTabIndex(this.$props.tabIndex,r),w=ne.provideLocalizationService(this),j=A({validationMessage:O,valid:P,required:R},this.hasValue),V=this.$props.dir,K=this.adaptiveState,N=i.templateRendering.call(this,this.item,i.getListeners.call(this)),_=i.templateRendering.call(this,this.tag,i.getListeners.call(this)),G=i.templateRendering.call(this,this.$props.header,i.getListeners.call(this)),H=i.templateRendering.call(this,this.$props.footer,i.getListeners.call(this)),T=i.getTemplate.call(this,{h:s.h,template:G}),x=i.getTemplate.call(this,{h:s.h,template:H}),U=i.templateRendering.call(this,this.$props.listNoData,i.getListeners.call(this)),J=s.createVNode(le.ListNoData,null,F(e=w.toLanguageString(p.nodata,p.messages[p.nodata]))?e:{default:()=>[e]}),M=i.getTemplate.call(this,{h:s.h,defaultRendering:J,template:U}),B=!W||j.valid,{size:h,rounded:m,fillMode:v}=this.$props,Q=()=>[s.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[s.createVNode("div",{class:"k-actionsheet-title"},[s.createVNode("div",{class:"k-text-center"},[z]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[l])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode($.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onCancel,icon:"x",svgIcon:pe.xIcon},null)])]),s.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[this.$props.filterable&&s.createVNode(E.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:i.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null)])],X=i.templateRendering.call(this,Q,i.getListeners.call(this)),Y=()=>{const u=w.toLanguageString(p.adaptiveModeFooterCancel,p.messages[p.adaptiveModeFooterCancel]),f=w.toLanguageString(p.adaptiveModeFooterApply,p.messages[p.adaptiveModeFooterApply]);return[s.createVNode($.Button,{size:"large","aria-label":u,"aria-disabled":"false",type:"button",onClick:this.onCancel},F(u)?u:{default:()=>[u]}),s.createVNode($.Button,{themeColor:"primary",size:"large","aria-label":f,"aria-disabled":"false",type:"button",onClick:this.closePopup},F(f)?f:{default:()=>[f]})]},Z=i.templateRendering.call(this,Y,i.getListeners.call(this)),ee=()=>{const u=this.base.getTemplateDef.call(this,T,s.h),f=this.base.getTemplateDef.call(this,x,s.h);return[u&&s.createVNode("div",{class:"k-list-header"},[u]),a.length>0?s.createVNode(D.TreeView,{ref:i.setRef(this,"treeView"),tabIndex:b,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:k,expandField:this.$props.expandField,childrenField:I,expandIcons:!0,onItemclick:this.onChange,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:"large",item:N},null):M,f&&s.createVNode("div",{class:"k-list-footer"},[f])]},te=i.templateRendering.call(this,ee,i.getListeners.call(this)),ie=function(){return s.createVNode(ue.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,footerClassName:"k-actions k-actions-stretched",contentClassName:"!k-overflow-hidden",header:X,content:te,footer:Z,onClose:this.onCancel,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},se=function(){return s.createVNode("span",{ref:i.setRef(this,"kendoAnchor"),class:i.classNames("k-multiselecttree k-input",this.$props.className,{[`k-input-${q[h]||h}`]:h,[`k-rounded-${me[m]||m}`]:m,[`k-input-${v}`]:v,"k-focus":this.focusedState&&!r,"k-invalid":!B,"k-disabled":r,"k-loading":this.$props.loading,"k-required":R}),tabindex:b,accesskey:this.$props.accessKey,id:t,dir:V,onKeydown:this.onWrapperKeyDown,onMousedown:this.onWrapperMouseDown,onFocusin:this.onFocus,onFocusout:this.onBlur,role:"combobox","aria-haspopup":"tree","aria-expanded":this.isOpen,"aria-disabled":r,"aria-label":d,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaLabelledBy?this.$props.ariaLabelledBy:"tagslist-"+t,"aria-required":this.$props.required,onClick:this.onWrapperClick},[this.tagsToRenderRef.length>0&&s.createVNode(re.TagList,{id:"tagslist-"+t,class:i.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${q[h]||h}`]:h,"k-readonly":this.hasValue}),tagRender:_,onTagdelete:this.onTagDelete,dataItems:this.tagsToRenderRef,guid:t,focused:this.focusedTagState?this.tagsToRenderRef.find(u=>this.focusedTagState&&y.matchTags(u,this.focusedTagState,n)):void 0,tagsRounded:m,size:h,fillMode:v},null),s.createVNode("span",{class:"k-input-inner",role:"combobox",tabindex:b,"aria-expanded":this.isOpen,"aria-describedby":"tagslist-"+t,"aria-label":this.$props.ariaLabelledBy},[this.tagsToRenderRef.length===0&&s.createVNode("span",{class:"k-input-value-text"},[l])]),this.$props.loading&&s.createVNode(i.Icon,{class:"k-input-loading-icon",name:"loading"},null),this.hasValue&&!r&&s.createVNode(ce.ClearButton,{onClearclick:this.onClear},null),s.createVNode("select",{name:c,ref:i.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,required:R,title:d,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},[s.createVNode("option",{value:this.$props.valueMap?this.$props.valueMap.call(void 0,C):C},null)]),!K&&s.createVNode(ae.Popup,{style:{width:this.popupWidth,direction:V},popupClass:i.classNames(o.popupClass,"k-multiselecttree-popup","popup-"+this.componentGuid),class:i.classNames(o.className,{"k-rtl":V==="rtl"}),animate:o.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:o.appendTo,ref:i.setRef(this,"popup")},{default:()=>[this.$props.filterable&&s.createVNode(E.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:i.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null),T&&s.createVNode("div",{class:"k-list-header"},[T]),a.length>0?s.createVNode(D.TreeView,{ref:i.setRef(this,"treeView"),tabIndex:b,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:k,expandField:this.$props.expandField,childrenField:I,expandIcons:!0,onItemclick:this.onChange,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:h,item:N},null):M,x&&s.createVNode("div",{class:"k-list-footer"},[x])]})])},S=[s.h(se.call(this),{...this.$attrs}),K&&ie.call(this)];return d?s.createVNode(de.FloatingLabel,{label:d,editorValue:this.hasValue,editorPlaceholder:l,editorValid:B,editorDisabled:r,editorId:t,dir:V},F(S)?S:{default:()=>[S]}):S},methods:{clearFilter(e){this.onFilterChange(e,"")},onCancel(e){const t={event:e,target:this},a={items:[],operation:"toggle",value:this.initialAdaptiveRenderingValues,...t};this.$emit("change",a),this.closePopup(e)},calculateMedia(e){for(let t of e)this.windowWidth=t.target.clientWidth},calculatePopupWidth(){this.elementRef&&(this.popupWidth=this.popupSettings.width!==void 0?this.popupSettings.width:this.elementRef.offsetWidth+"px")},focus(){this.$el&&this.$el.focus()},setValidity(){if(this.selectRef&&this.selectRef.setCustomValidity){const{validationMessage:e,valid:t,required:a}=this.$props,n=A({validationMessage:e,valid:t,required:a},this.hasValue);this.selectRef.setCustomValidity(n.valid?"":this.validationMessage===void 0?ge:this.validationMessage)}},changeValue(e,t,a){const n={dataItemKey:this.dataItemKey,checkField:this.checkField,checkIndeterminateField:this.checkIndeterminateField,expandField:this.expandField,subItemsField:this.subItemsField},o=he.getMultiSelectTreeValue(this.dataItems,{...n,items:t,operation:a,value:this.computedValue}),r={items:t,operation:a,value:o,...e};this.$emit("changemodel",o),this.$emit("update:modelValue",o),this.$emit("change",r)},onChange(e){if(y.areSame(e.item,this.computedValue,this.dataItemKey))return;const{item:t,event:a}=e,n={event:a,target:this};this.changeValue(n,[t],"toggle")},openPopup(e){if(!this.isOpen){const t={...e};this.$emit("open",t),this.opened===void 0&&(this.openState=!0)}},closePopup(e){if(this.$props.filterable&&this.clearFilter(e),this.isOpen){const t={...e};this.$emit("close",t),this.opened===void 0&&(this.openState=!1)}},switchFocus(e){this.skipFocusRef=!0,e(),window.setTimeout(()=>this.skipFocusRef=!1,0)},focusElement(e){e&&this.switchFocus(()=>e.focus())},onPopupOpened(){if(!this.focusedState&&this.isOpen)this.closePopup({target:this});else if(this.$props.filterable){const e=this.inputRef&&this.inputRef.input;this.focusElement(e)}else this.focusElement(this.treeViewRef&&this.treeViewRef.input)},onPopupClosed(){this.focusedState&&this.focusElement(this.elementRef)},onFocus(e){if(!this.focusedState&&!this.skipFocusRef){this.focusedState=!0;const t={event:e,target:this};this.$emit("focus",t)}},onBlur(e){if(this.focusedState&&!this.skipFocusRef&&!this.adaptiveState){this.focusedTagState=void 0,this.focusedState=!1;const t={event:e,target:this},a={...t};(!e.relatedTarget||!e.relatedTarget.closest(".popup-"+this.componentGuid))&&(this.$emit("blur",a),this.closePopup(t))}},onWrapperMouseDown(){this.focusedState&&this.switchFocus(i.noop)},onWrapperClick(e){if(!this.$props.disabled&&!e.defaultPrevented){this.focusedState=!0;const t={event:e,target:this};this.isOpen||this.openPopup(t)}},onWrapperKeyDown(e){const{keyCode:t,altKey:a}=e,n=this.treeViewRef&&this.treeViewRef.$el,o=this.inputRef&&this.inputRef.input;if(this.$props.disabled||e.defaultPrevented&&o===e.target)return;const r={event:e,target:this};if(this.computedValue&&this.computedValue.length>0&&(t===i.Keys.left||t===i.Keys.right||t===i.Keys.home||t===i.Keys.end||t===i.Keys.delete||t===i.Keys.backspace)){const l=this.tagsToRenderRef;let d=this.focusedTagState?l.findIndex(k=>y.matchTags(k,this.focusedTagState,this.dataItemKey)):-1,c;const g=d!==-1;t===i.Keys.left?(g?d=Math.max(0,d-1):d=l.length-1,c=l[d]):t===i.Keys.right?g?(d=Math.min(l.length-1,d+1),c=l[d]):c=l[0]:t===i.Keys.home?c=l[0]:t===i.Keys.end?c=l[l.length-1]:(t===i.Keys.delete||t===i.Keys.backspace)&&g&&this.changeValue(r,l[d].data,"delete"),c!==this.focusedTagState&&(this.focusedTagState=c)}if(this.isOpen)if(t===i.Keys.esc||a&&t===i.Keys.up)e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),this.closePopup(r);else if(n&&n.querySelector(".k-focus")&&(t===i.Keys.up||t===i.Keys.down||t===i.Keys.left||t===i.Keys.right||t===i.Keys.home||t===i.Keys.end)){if(t===i.Keys.up){const l=Array.from(n.querySelectorAll(".k-treeview-item")),d=[...l].reverse().find(c=>!!(c&&c.querySelector(".k-focus")));if(d&&l.indexOf(d)===0)return this.switchFocus(()=>{this.focusElement(o||this.elementRef)})}this.switchFocus(i.noop)}else t===i.Keys.down&&this.switchFocus(()=>{this.focusElement(o||n)});else a&&t===i.Keys.down&&(e.preventDefault(),this.openPopup(r))},onInputKeyDown(e){const{keyCode:t,altKey:a}=e;(t===i.Keys.esc||a&&t===i.Keys.up)&&(e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),t===i.Keys.esc&&this.adaptiveState?this.onCancel(e):this.closePopup(e)),!(a||t!==i.Keys.up&&t!==i.Keys.down)&&(e.preventDefault(),this.switchFocus(t===i.Keys.up?()=>{this.focusElement(this.elementRef)}:()=>{this.focusElement(this.treeViewRef&&this.treeViewRef.$el)}))},onClear(e){const t={event:e,target:this};this.changeValue(t,[],"clear"),this.closePopup(t),this.filterState="",e.preventDefault()},onTagDelete(e,t){if(this.closePopup({target:this}),!this.focusedState){const a=this.inputRef&&this.inputRef.input;this.focusElement(a)}this.changeValue({event:t,target:this},e,"delete")},onExpand(e){const{item:t,itemHierarchicalIndex:a,event:n}=e,o={level:ve(a),item:t,event:n,target:this};this.$emit("expandchange",o)},onFilterChange(e,t){const a=t?"":e.target.value,o={filter:{field:this.$props.textField,operator:"contains",value:a},event:e,target:this};this.$emit("filterchange",o),this.$props.filter===void 0&&(this.filterState=a)}}});exports.MultiSelectTree=ye;