@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,29 +5,29 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as $e, ref as N, createVNode as n, h as M, isVNode as Ce } from "vue";
9
- import { guid as A, canUseDOM as xe, getRef as W, Keys as f, templateRendering as C, getListeners as x, getTemplate as Oe, classNames as B, setRef as G, noop as q, getTabIndex as we, Icon as Fe, kendoThemeMaps as De } from "@progress/kendo-vue-common";
8
+ import { defineComponent as Se, ref as N, createVNode as n, h as T, isVNode as $e } from "vue";
9
+ import { guid as A, canUseDOM as Ce, getRef as W, Keys as f, templateRendering as C, getListeners as x, getTemplate as xe, classNames as B, setRef as G, noop as q, getTabIndex as Oe, Icon as we, kendoThemeMaps as Fe } from "@progress/kendo-vue-common";
10
10
  import { Button as U } from "@progress/kendo-vue-buttons";
11
- import { ListContainer as Ve } from "../common/ListContainer.mjs";
12
- import { ListFilter as Te } from "../common/ListFilter.mjs";
11
+ import { ListContainer as De } from "../common/ListContainer.mjs";
12
+ import { ListFilter as Ve } from "../common/ListFilter.mjs";
13
13
  import { ListDefaultItem as Me } from "../common/ListDefaultItem.mjs";
14
- import { List as Be } from "../common/List.mjs";
15
- import Le from "../common/DropDownBase.mjs";
14
+ import { List as Te } from "../common/List.mjs";
15
+ import Be from "../common/DropDownBase.mjs";
16
16
  import { GroupStickyHeader as Y } from "../common/GroupStickyHeader.mjs";
17
- import { selectButton as J, messages as Re } from "../messages/main.mjs";
18
- import { provideLocalizationService as Ne } from "@progress/kendo-vue-intl";
19
- import { MOBILE_SMALL_DEVICE as Q, MOBILE_MEDIUM_DEVICE as Ee } from "../common/constants.mjs";
17
+ import { selectButton as J, messages as Le } from "../messages/main.mjs";
18
+ import { provideLocalizationService as Re } from "@progress/kendo-vue-intl";
19
+ import { MOBILE_SMALL_DEVICE as Ne, MOBILE_MEDIUM_DEVICE as Ee } from "../common/constants.mjs";
20
20
  import { ActionSheet as Ke } from "@progress/kendo-vue-layout";
21
- import { areSame as y, isPresent as X, getItemValue as F, sameCharsOnly as He, shuffleData as Pe, matchText as Z, getFocusedItem as _e, preventDefaultNonInputs as ee } from "../common/utils.mjs";
21
+ import { areSame as y, isPresent as Q, getItemValue as F, sameCharsOnly as He, shuffleData as Pe, matchText as X, getFocusedItem as _e, preventDefaultNonInputs as Z } from "../common/utils.mjs";
22
22
  import { xIcon as je, caretAltDownIcon as ze } from "@progress/kendo-svg-icons";
23
23
  const {
24
24
  sizeMap: E,
25
25
  roundedMap: Ae
26
- } = De;
26
+ } = Fe;
27
27
  function We(e) {
28
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ce(e);
28
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !$e(e);
29
29
  }
30
- const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
30
+ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
31
31
  name: "KendoDropDownList",
32
32
  model: {
33
33
  event: "changemodel"
@@ -175,6 +175,12 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
175
175
  inject: {
176
176
  kendoLocalizationService: {
177
177
  default: null
178
+ },
179
+ adaptiveModeBreakpoints: {
180
+ default: {
181
+ small: Ne,
182
+ medium: Ee
183
+ }
178
184
  }
179
185
  },
180
186
  data() {
@@ -217,7 +223,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
217
223
  }
218
224
  },
219
225
  created() {
220
- this.observer = null, this.valueDuringOnChange = void 0, this.currentText = void 0, this.currentValue = void 0, this.prevCurrentValue = this.computedValue(), this.currentFocused = void 0, this.currentOpened = void 0, this.base = new Le(this), this.anchor = A(), this.inputId = A();
226
+ this.observer = null, this.valueDuringOnChange = void 0, this.currentText = void 0, this.currentValue = void 0, this.prevCurrentValue = this.computedValue(), this.currentFocused = void 0, this.currentOpened = void 0, this.base = new Be(this), this.anchor = A(), this.inputId = A();
221
227
  },
222
228
  setup() {
223
229
  const e = N(null), t = N(null), s = N(null);
@@ -228,7 +234,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
228
234
  };
229
235
  },
230
236
  mounted() {
231
- this.observer = xe && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.select = W(this, "select"), this.base.wrapper = W(this, "kendoAnchor"), this.base.didMount(), this.setValidity();
237
+ this.observer = Ce && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.select = W(this, "select"), this.base.wrapper = W(this, "kendoAnchor"), this.base.didMount(), this.setValidity();
232
238
  },
233
239
  updated() {
234
240
  var I;
@@ -242,11 +248,11 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
242
248
  if (this.$refs.scroller, d && (this.base.vs.list = d.list, this.base.list = d.list), u && (this.base.vs.scrollElement = u), h && (this.filterInput = h), d && e.length && this.base.vs.scrollerRef(d.$el), this.$props.popupSettings.animate || a && this.onPopupOpened(), s && this.virtualTotalHasChanged)
243
249
  this.base.vs.calcScrollElementHeight(), this.base.vs.reset(), this.virtualTotalHasChanged = !1;
244
250
  else {
245
- const m = this.computedValue(), g = this.prevCurrentValue;
246
- let p = e.findIndex((v) => y(v, m, t));
247
- l && (p = (I = this.base.getGroupedDataModernMode(e, l)) == null ? void 0 : I.indexOf(m));
248
- const S = !y(g, m, t);
249
- a && s ? (this.base.scrollToVirtualItem(s, p), this.prevCurrentOpened = !0) : a && !s ? (e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][l], this), this.base.scrollToItem(p), this.prevCurrentOpened = !0) : i && r && m && S && !this._navigated ? this.base.scrollToItem(p) : i && r && this._navigated && (this._navigated && s && s.skip === 0 ? this.base.vs.reset() : this._navigated && s && s.skip === s.total - s.pageSize && this.base.vs.scrollToEnd());
251
+ const g = this.computedValue(), m = this.prevCurrentValue;
252
+ let p = e.findIndex((v) => y(v, g, t));
253
+ l && (p = (I = this.base.getGroupedDataModernMode(e, l)) == null ? void 0 : I.indexOf(g));
254
+ const k = !y(m, g, t);
255
+ a && s ? (this.base.scrollToVirtualItem(s, p), this.prevCurrentOpened = !0) : a && !s ? (e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][l], this), this.base.scrollToItem(p), this.prevCurrentOpened = !0) : i && r && g && k && !this._navigated ? this.base.scrollToItem(p) : i && r && this._navigated && (this._navigated && s && s.skip === 0 ? this.base.vs.reset() : this._navigated && s && s.skip === s.total - s.pageSize && this.base.vs.scrollToEnd());
250
256
  }
251
257
  this._navigated = !1, this.prevCurrentValue = this.computedValue(), this.setValidity();
252
258
  },
@@ -275,17 +281,17 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
275
281
  return this.$props.opened !== void 0 ? this.$props.opened : this.currentOpened;
276
282
  },
277
283
  animationStyles() {
278
- return this.windowWidth <= Q ? {
284
+ return this.windowWidth <= this.adaptiveModeBreakpoints.small ? {
279
285
  top: 0,
280
286
  width: "100%",
281
287
  height: "100%"
282
288
  } : void 0;
283
289
  },
284
- classNameAdaptiv() {
285
- return this.windowWidth <= Q ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom";
290
+ classNameAdaptive() {
291
+ return this.windowWidth <= this.adaptiveModeBreakpoints.small ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom";
286
292
  },
287
293
  adaptiveState() {
288
- return this.windowWidth <= Ee && this.$props.adaptive;
294
+ return this.windowWidth <= this.adaptiveModeBreakpoints.medium && this.$props.adaptive;
289
295
  }
290
296
  },
291
297
  methods: {
@@ -294,7 +300,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
294
300
  },
295
301
  computedValue() {
296
302
  let e;
297
- return this.valueDuringOnChange !== void 0 ? e = this.valueDuringOnChange : this.$props.value !== void 0 ? e = this.$props.value : this.$props.modelValue !== void 0 ? e = this.$props.modelValue : this.currentValue !== void 0 ? e = this.currentValue : this.$props.defaultValue !== void 0 && (e = this.$props.defaultValue), !X(e) && this.$props.defaultItem !== void 0 && (e = this.$props.defaultItem), this.valuePrimitive && this.findByFieldValue(this.valueField, e) || e;
303
+ return this.valueDuringOnChange !== void 0 ? e = this.valueDuringOnChange : this.$props.value !== void 0 ? e = this.$props.value : this.$props.modelValue !== void 0 ? e = this.$props.modelValue : this.currentValue !== void 0 ? e = this.currentValue : this.$props.defaultValue !== void 0 && (e = this.$props.defaultValue), !Q(e) && this.$props.defaultItem !== void 0 && (e = this.$props.defaultItem), this.valuePrimitive && this.findByFieldValue(this.valueField, e) || e;
298
304
  },
299
305
  findByFieldValue(e, t) {
300
306
  const s = this.dataItems.findIndex((l) => F(l, e) === t);
@@ -357,21 +363,21 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
357
363
  item: this.$props.defaultItem,
358
364
  itemIndex: -1
359
365
  }, a += 1, d += 1), d += r ? 1 : 0, l = Pe(l, d, h);
360
- let u, I, m, g = 0;
366
+ let u, I, g, m = 0;
361
367
  const {
362
368
  textField: p,
363
- ignoreCase: S
369
+ ignoreCase: k
364
370
  } = this.$props;
365
- for (; g < a; ) {
366
- if (u = F(l[g].item, p), I = r && Z(u, i, S), m = Z(u, o, S), I || m) {
367
- g = l[g].itemIndex;
371
+ for (; m < a; ) {
372
+ if (u = F(l[m].item, p), I = r && X(u, i, k), g = X(u, o, k), I || g) {
373
+ m = l[m].itemIndex;
368
374
  break;
369
375
  }
370
- g++;
376
+ m++;
371
377
  }
372
- if (g !== a) {
378
+ if (m !== a) {
373
379
  const v = this.base.initState();
374
- v.event = e, this.handleItemSelect(g, v), this.applyState(v), this.valueDuringOnChange = void 0;
380
+ v.event = e, this.handleItemSelect(m, v), this.applyState(v), this.valueDuringOnChange = void 0;
375
381
  }
376
382
  },
377
383
  handleKeyDown(e) {
@@ -386,14 +392,14 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
386
392
  total: 0,
387
393
  pageSize: 0
388
394
  }
389
- } = this.$props, r = this.isOpen, a = e.keyCode, d = a === f.home || a === f.end, h = a === f.up || a === f.down, u = !r && (e.altKey && a === f.down || a === f.enter || a === f.space), I = r && (e.altKey && a === f.up || a === f.esc), m = s && (a === f.left || a === f.right), g = h || !l && (m || d), p = this.base.initState();
395
+ } = this.$props, r = this.isOpen, a = e.keyCode, d = a === f.home || a === f.end, h = a === f.up || a === f.down, u = !r && (e.altKey && a === f.down || a === f.enter || a === f.space), I = r && (e.altKey && a === f.up || a === f.esc), g = s && (a === f.left || a === f.right), m = h || !l && (g || d), p = this.base.initState();
390
396
  if (p.event = e, !o) {
391
397
  if (d && this.base.vs.enabled)
392
398
  a === f.home ? i.skip !== 0 ? (this.base.triggerOnPageChange(p, 0, i.pageSize), this._navigated = !0) : this.triggerOnChange(t[0], p) : i.skip < i.total - i.pageSize ? (this.base.triggerOnPageChange(p, i.total - i.pageSize, i.pageSize), this._navigated = !0) : this.triggerOnChange(t[t.length - 1], p);
393
399
  else if (r && a === f.enter) {
394
- const S = this.focusedIndex();
395
- S !== void 0 && this.handleItemSelect(S, p), this.base.togglePopup(p), e.preventDefault();
396
- } else u || I ? (this.adaptiveState && this.handleWrapperClick(e), this.base.togglePopup(p), e.preventDefault()) : g && (this.onNavigate(p, a), e.preventDefault());
400
+ const k = this.focusedIndex();
401
+ k !== void 0 && this.handleItemSelect(k, p), this.base.togglePopup(p), e.preventDefault();
402
+ } else u || I ? (this.adaptiveState && this.handleWrapperClick(e), this.base.togglePopup(p), e.preventDefault()) : m && (this.onNavigate(p, a), e.preventDefault());
397
403
  this.applyState(p);
398
404
  }
399
405
  },
@@ -441,7 +447,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
441
447
  });
442
448
  },
443
449
  focusedIndex() {
444
- const e = X(this.$props.filter) ? this.$props.filter : this.currentText, {
450
+ const e = Q(this.$props.filter) ? this.$props.filter : this.currentText, {
445
451
  dataItems: t = [],
446
452
  virtual: s = {
447
453
  skip: 0
@@ -511,37 +517,37 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
511
517
  dataItems: h = [],
512
518
  disabled: u,
513
519
  tabIndex: I,
514
- loading: m,
515
- icon: g,
520
+ loading: g,
521
+ icon: m,
516
522
  svgIcon: p,
517
- iconClassName: S,
523
+ iconClassName: k,
518
524
  adaptiveTitle: v,
519
525
  header: D,
520
526
  footer: K,
521
- groupStickyHeaderItemRender: te
522
- } = this.$props, O = this.isOpen, ie = F(this.computedValue(), this.$props.textField), se = !this.$props.validityStyles || this.validity().valid, k = this.base, w = k.vs, L = this.$props.id || this.inputId;
527
+ groupStickyHeaderItemRender: ee
528
+ } = this.$props, O = this.isOpen, te = F(this.computedValue(), this.$props.textField), ie = !this.$props.validityStyles || this.validity().valid, S = this.base, w = S.vs, L = this.$props.id || this.inputId;
523
529
  w.enabled = this.$props.virtual !== void 0;
524
530
  const V = Object.assign({}, {
525
531
  animate: !0,
526
532
  height: "200px"
527
- }, this.$props.popupSettings), ae = Ne(this).toLanguageString(J, Re[J]), T = this.adaptiveState;
533
+ }, this.$props.popupSettings), se = Re(this).toLanguageString(J, Le[J]), M = this.adaptiveState;
528
534
  this.group === void 0 && this.$props.groupField !== void 0 && (this.group = F(this.$props.dataItems[0], this.$props.groupField));
529
- const ne = C.call(this, this.$props.valueRender, x.call(this)), le = this.currentFocused, H = this.primitiveValue(), oe = h.findIndex((c) => y(c, H, d)), re = n("span", {
535
+ const ae = C.call(this, this.$props.valueRender, x.call(this)), ne = this.currentFocused, H = this.primitiveValue(), le = h.findIndex((c) => y(c, H, d)), oe = n("span", {
530
536
  class: "k-input-inner",
531
537
  id: this.dropDownListId
532
538
  }, [n("span", {
533
539
  class: "k-input-value-text"
534
- }, [ie])]);
535
- let de = Oe.call(this, {
536
- h: M,
537
- template: ne,
538
- defaultRendering: re,
540
+ }, [te])]);
541
+ let re = xe.call(this, {
542
+ h: T,
543
+ template: ae,
544
+ defaultRendering: oe,
539
545
  additionalProps: {
540
546
  value: this.computedValue(),
541
547
  ...this.$data
542
548
  }
543
549
  });
544
- const ue = function(c) {
550
+ const de = function(c) {
545
551
  return n("select", {
546
552
  name: this.$props.name,
547
553
  id: L,
@@ -560,7 +566,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
560
566
  }, [n("option", {
561
567
  value: this.$props.valueMap ? this.$props.valueMap.call(void 0, c) : c
562
568
  }, null)]);
563
- }, pe = () => [n("div", {
569
+ }, ue = () => [n("div", {
564
570
  class: "k-actionsheet-titlebar-group k-hbox"
565
571
  }, [n("div", {
566
572
  class: "k-actionsheet-title"
@@ -581,16 +587,16 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
581
587
  svgIcon: je
582
588
  }, null)])]), n("div", {
583
589
  class: "k-actionsheet-titlebar-group k-actionsheet-filter"
584
- }, [j.call(this)])], he = C.call(this, pe, x.call(this)), ce = () => {
585
- const c = k.getTemplateDef.call(this, D, M), b = k.getTemplateDef.call(this, K, M), $ = C.call(this, te, x.call(this));
590
+ }, [j.call(this)])], pe = C.call(this, ue, x.call(this)), he = () => {
591
+ const c = S.getTemplateDef.call(this, D, T), b = S.getTemplateDef.call(this, K, T), $ = C.call(this, ee, x.call(this));
586
592
  return n("div", {
587
593
  class: "k-list-container"
588
594
  }, [c && n("div", {
589
595
  class: "k-list-header"
590
596
  }, [c]), n("div", {
591
597
  class: B("k-list", {
592
- [`k-list-${E[i] || i}`]: T ? !1 : i,
593
- "k-list-lg": !!T,
598
+ [`k-list-${E[i] || i}`]: M ? !1 : i,
599
+ "k-list-lg": !!M,
594
600
  "k-virtual-list": w.enabled
595
601
  })
596
602
  }, [P.call(this), this.group && h.length !== 0 && n(Y, {
@@ -599,15 +605,15 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
599
605
  }, null), _.call(this), b && n("div", {
600
606
  class: "k-list-footer"
601
607
  }, [b])])]);
602
- }, fe = C.call(this, ce, x.call(this)), ge = function() {
608
+ }, ce = C.call(this, he, x.call(this)), fe = function() {
603
609
  return n(Ke, {
604
610
  expand: O,
605
611
  animation: !0,
606
612
  animationStyles: this.animationStyles,
607
613
  className: this.classNameAdaptive,
608
614
  contentClassName: "!k-overflow-hidden",
609
- header: he,
610
- content: fe,
615
+ header: pe,
616
+ content: ce,
611
617
  onClose: this.handleWrapperClick,
612
618
  navigatableElements: ["input.k-input-inner", ".k-actionsheet-actions > button"]
613
619
  }, null);
@@ -630,8 +636,8 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
630
636
  groupField: $
631
637
  } = this.$props;
632
638
  let R = this.$props.dataItems || [];
633
- const be = C.call(this, this.$props.itemRender, x.call(this)), ye = C.call(this, this.$props.groupHeaderItemRender, x.call(this)), Ie = C.call(this, this.$props.listNoDataRender, x.call(this)), Se = o.skip, ke = `translateY(${w.translate}px)`;
634
- return $ && (R = this.base.getGroupedDataModernMode(R, $)), n(Be, {
639
+ const ve = C.call(this, this.$props.itemRender, x.call(this)), be = C.call(this, this.$props.groupHeaderItemRender, x.call(this)), ye = C.call(this, this.$props.listNoDataRender, x.call(this)), Ie = o.skip, ke = `translateY(${w.translate}px)`;
640
+ return $ && (R = this.base.getGroupedDataModernMode(R, $)), n(Te, {
635
641
  id: this.base.listBoxId,
636
642
  show: O,
637
643
  dataItems: R.slice(),
@@ -649,11 +655,11 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
649
655
  transform: ke
650
656
  } : void 0,
651
657
  key: "listkey",
652
- skip: Se,
658
+ skip: Ie,
653
659
  onListclick: this.handleItemClick,
654
- itemRender: be,
655
- groupHeaderItemRender: ye,
656
- noDataRender: Ie,
660
+ itemRender: ve,
661
+ groupHeaderItemRender: be,
662
+ noDataRender: ye,
657
663
  groupField: $,
658
664
  onScroll: this.onScroll
659
665
  }, We(c = me.call(this)) ? c : {
@@ -661,7 +667,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
661
667
  });
662
668
  }, j = function() {
663
669
  const c = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
664
- return this.$props.filterable && n(Te, {
670
+ return this.$props.filterable && n(Ve, {
665
671
  value: c,
666
672
  ref: "filterInput",
667
673
  onChange: this.handleListFilterChange,
@@ -677,12 +683,12 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
677
683
  ref: "scrollElement",
678
684
  key: "scrollElementKey"
679
685
  }, null);
680
- }, ve = function() {
681
- const c = C.call(this, this.$props.groupStickyHeaderItemRender, x.call(this)), b = k.getTemplateDef.call(this, D), $ = k.getTemplateDef.call(this, K);
682
- return n(Ve, {
686
+ }, ge = function() {
687
+ const c = C.call(this, this.$props.groupStickyHeaderItemRender, x.call(this)), b = S.getTemplateDef.call(this, D), $ = S.getTemplateDef.call(this, K);
688
+ return n(De, {
683
689
  ref: "container",
684
- onMousedown: ee,
685
- dir: l !== void 0 ? l : k.dirCalculated,
690
+ onMousedown: Z,
691
+ dir: l !== void 0 ? l : S.dirCalculated,
686
692
  width: this.popupWidth,
687
693
  popupSettings: {
688
694
  ...V,
@@ -708,18 +714,18 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
708
714
  }, [$])]
709
715
  });
710
716
  };
711
- this.$props.virtual !== void 0 && (k.vs.skip = o.skip, k.vs.total = o.total, k.vs.pageSize = o.pageSize);
712
- const z = [M(function() {
717
+ this.$props.virtual !== void 0 && (S.vs.skip = o.skip, S.vs.total = o.total, S.vs.pageSize = o.pageSize);
718
+ const z = [T(function() {
713
719
  return n("span", {
714
720
  ref: G(this, "kendoAnchor"),
715
721
  class: B("k-dropdownlist k-picker", t, {
716
722
  [`k-picker-${E[i] || i}`]: i,
717
723
  [`k-rounded-${Ae[r] || r}`]: r,
718
724
  [`k-picker-${a}`]: a,
719
- "k-focus": le,
725
+ "k-focus": ne,
720
726
  "k-disabled": u,
721
- "k-invalid": !se,
722
- "k-loading": m,
727
+ "k-invalid": !ie,
728
+ "k-loading": g,
723
729
  "k-required": this.required
724
730
  }),
725
731
  style: s ? {
@@ -727,10 +733,10 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
727
733
  width: void 0
728
734
  } : e,
729
735
  dir: l,
730
- onMousedown: O ? ee : q,
736
+ onMousedown: O ? Z : q,
731
737
  onFocusin: this.handleFocus,
732
738
  onFocusout: this.handleBlur,
733
- tabindex: we(I, u),
739
+ tabindex: Oe(I, u),
734
740
  accesskey: this.$props.accessKey,
735
741
  onKeydown: this.handleKeyDown,
736
742
  onKeypress: this.handleKeyPress,
@@ -740,12 +746,12 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
740
746
  "aria-haspopup": !0,
741
747
  "aria-expanded": O || !1,
742
748
  "aria-owns": this.base.listBoxId,
743
- "aria-activedescendant": O ? "option-" + this.base.guid + "-" + (oe + (o ? o.skip : 0)) : void 0,
749
+ "aria-activedescendant": O ? "option-" + this.base.guid + "-" + (le + (o ? o.skip : 0)) : void 0,
744
750
  "aria-label": this.$props.ariaLabel || this.$props.label,
745
751
  "aria-labelledby": this.$props.ariaLabelledBy,
746
752
  "aria-describedBy": this.dropDownListId,
747
753
  title: this.$props.title
748
- }, [de, m && n(Fe, {
754
+ }, [re, g && n(we, {
749
755
  name: "loading",
750
756
  class: "k-input-loading-icon",
751
757
  key: "loading"
@@ -755,15 +761,15 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
755
761
  size: i,
756
762
  fillMode: a,
757
763
  rounded: null,
758
- ariaLabel: ae,
764
+ ariaLabel: se,
759
765
  class: "k-input-button",
760
- icon: g || "caret-alt-down",
766
+ icon: m || "caret-alt-down",
761
767
  svgIcon: p || ze,
762
- iconClass: S
763
- }, null), ue.call(this, H), !T && ve.call(this)]);
768
+ iconClass: k
769
+ }, null), de.call(this, H), !M && ge.call(this)]);
764
770
  }.call(this), {
765
771
  ...this.$attrs
766
- }), T && ge.call(this)];
772
+ }), M && fe.call(this)];
767
773
  return s ? n("span", {
768
774
  class: this.spanClassNames,
769
775
  onFocusin: this.handleFocus,
@@ -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"),t=require("@progress/kendo-vue-common"),se=require("@progress/kendo-vue-popup"),ne=require("@progress/kendo-vue-intl"),O=require("@progress/kendo-vue-treeview"),oe=require("../package-metadata.js"),b=require("../common/utils.js"),ae=require("./ListNoData.js"),c=require("../messages/main.js"),le=require("@progress/kendo-vue-labels"),T=require("../common/ListFilter.js"),E=require("@progress/kendo-vue-buttons"),k=require("@progress/kendo-svg-icons"),w=require("../common/constants.js"),re=require("@progress/kendo-vue-layout"),de=require("../common/DropDownBase.js");function K(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!s.isVNode(e)}const{sizeMap:ue,roundedMap:ce}=t.kendoThemeMaps,pe="Please select a value from the list!",B=e=>e.split("_").map(i=>parseInt(i,10)),S=(e,i)=>{const{validationMessage:n,valid:o,required:a}=e;return{customError:n!==void 0,valid:!!(o!==void 0?o:!a||i),valueMissing:!i}},he=s.defineComponent({name:"KendoDropDownTree",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:{type:[Object,String,Number,Boolean],default:function(){}},modelValue:{type:[Object,String,Number,Boolean],default:function(){}},valueMap:Function,placeholder:String,dataItemKey:{type:String,required:!0},textField:{type:String,required:!0},selectField:{type:String,default:"selected"},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,ariaLabel:{type:String,default:void 0},ariaLabelledBy:String,ariaDescribedBy:String,filterable:Boolean,filter:String,loading:Boolean,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],header:[String,Function,Object],footer:[String,Function,Object],valueRender:[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,t.validatePackage(oe.packageMetadata),this.base=new de(this),this.componentGuid=t.guid(),this.anchor=t.guid()},data(){return{currentOpened:!1,focused:!1,filterState:"",currentValue:void 0,popupWidth:"200px",windowWidth:0,initialAdaptiveRenderingValues:void 0}},computed:{wrapperClass(){const{validationMessage:e,valid:i,required:n,validityStyles:o}=this.$props,a=S({validationMessage:e,valid:i,required:n},this.hasValue),d=!o||a.valid,{size:r,rounded:l,fillMode:u}=this.$props;return{"k-dropdowntree":!0,"k-picker":!0,[this.$props.className]:this.$props.className,[`k-picker-${ue[r]||r}`]:r,[`k-rounded-${ce[l]||l}`]:l,[`k-picker-${u}`]:u,"k-focus":this.focused,"k-invalid":!d,"k-loading":this.$props.loading,"k-required":n,"k-disabled":this.$props.disabled}},animationStyles(){return this.windowWidth<=w.MOBILE_SMALL_DEVICE?{top:0,width:"100%",height:"100%"}:void 0},classNameAdaptive(){return this.windowWidth<=w.MOBILE_SMALL_DEVICE?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"},adaptiveState(){return this.windowWidth<=w.MOBILE_MEDIUM_DEVICE&&this.$props.adaptive},isOpen(){return this.opened!==void 0?this.opened:this.currentOpened},computedValue(){return this.value!==void 0?this.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentValue},hasValue(){return b.isPresent(this.computedValue)},currentValueText(){return this.hasValue?b.getItemValue(this.computedValue,this.$props.textField):""}},watch:{isOpen:function(e){e&&this.value?this.initialAdaptiveRenderingValues=[...this.value]:this.initialAdaptiveRenderingValues=void 0}},mounted(){this.observer=t.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.elementRef=t.getRef(this,"kendoAnchor"),this.inputRef=t.getRef(this,"input"),this.selectRef=t.getRef(this,"select"),this.treeViewRef=t.getRef(this,"treeView"),this.skipFocusRef=!1,this.popupRef=t.getRef(this,"popup"),this.calculatePopupWidth()},updated(){this.inputRef=t.getRef(this,"input"),this.treeViewRef=t.getRef(this,"treeView"),this.popupRef&&this.isOpen&&this.hasValue&&this.popupRef.reposition(),this.setValidity(),this.calculatePopupWidth()},render(){let e;const i=this.$props.id||this.componentGuid,{dataItems:n,dataItemKey:o,popupSettings:a,disabled:d,placeholder:r,label:l,name:u,selectField:R,subItemsField:$,validationMessage:L,valid:q,required:F,validityStyles:P,adaptiveTitle:W}=this.$props,g=t.getTabIndex(this.$props.tabIndex,d),x=ne.provideLocalizationService(this),A=S({validationMessage:L,valid:q,required:F},this.hasValue),I=this.adaptiveState,p=this.$props.dir,N=t.templateRendering.call(this,this.item,t.getListeners.call(this)),z=t.templateRendering.call(this,this.valueRender,t.getListeners.call(this)),j=t.templateRendering.call(this,this.$props.header,t.getListeners.call(this)),_=t.templateRendering.call(this,this.$props.footer,t.getListeners.call(this)),v=t.getTemplate.call(this,{h:s.h,template:j}),y=t.getTemplate.call(this,{h:s.h,template:_}),G=t.templateRendering.call(this,this.$props.listNoData,t.getListeners.call(this)),H=s.createVNode(ae.ListNoData,null,K(e=x.toLanguageString(c.nodata,c.messages[c.nodata]))?e:{default:()=>[e]}),D=t.getTemplate.call(this,{h:s.h,defaultRendering:H,template:G}),U=s.createVNode("span",{class:"k-input-value-text"},[this.currentValueText||r]),J=t.getTemplate.call(this,{h:s.h,defaultRendering:U,template:z,additionalProps:{value:this.computedValue}}),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"},[W]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[r])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode(E.Button,{tabIndex:1,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onWrapperClick,icon:"x",svgIcon:k.xIcon},null)])]),s.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[this.$props.filterable&&s.createVNode(T.ListFilter,{tabIndex:0,value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:C,fillMode:V,onFocus:this.onFocus,onBlur:this.onBlur},null)])],X=t.templateRendering.call(this,Q,t.getListeners.call(this)),Y=()=>{const m=this.base.getTemplateDef.call(this,v,s.h),M=this.base.getTemplateDef.call(this,y,s.h);return[m&&s.createVNode("div",{class:"k-list-header"},[m]),n.length>0?s.createVNode(O.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:g,dataItems:n,focusIdField:o,textField:this.$props.textField,selectField:R,expandField:this.$props.expandField,childrenField:$,expandIcons:!0,onItemclick:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,size:"large",item:N},null):D,M&&s.createVNode("div",{class:"k-list-footer"},[M])]},Z=t.templateRendering.call(this,Y,t.getListeners.call(this)),ee=function(){return s.createVNode(re.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,header:X,content:Z,contentClassName:"!k-overflow-hidden",onClose:this.onWrapperClick,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},te=!P||A.valid,{size:h,rounded:C,fillMode:V}=this.$props,ie=function(){return s.createVNode("span",{class:this.wrapperClass,tabindex:g,accesskey:this.$props.accessKey,id:i,dir:p,ref:t.setRef(this,"kendoAnchor"),onKeydown:this.onWrapperKeyDown,onClick:this.onWrapperClick,onMousedown:this.onWrapperMouseDown,onFocusin:this.onFocus,onFocusout:this.onBlur,role:"combobox","aria-haspopup":"tree","aria-expanded":this.isOpen,"aria-disabled":d,"aria-label":l||this.$props.ariaLabel,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,"aria-required":F},[s.createVNode("span",{class:"k-input-inner"},[J]),this.$props.loading&&s.createVNode(t.Icon,{class:"k-input-loading-icon",name:"loading"},null),this.hasValue&&!d&&s.createVNode("span",{onClick:this.onClear,class:"k-clear-value",title:x.toLanguageString(c.clear,c.messages[c.clear]),role:"button",tabindex:-1,onMousedown:m=>m.preventDefault()},[s.createVNode(t.Icon,{name:"x",icon:k.xIcon},null)]),s.createVNode(E.Button,{tabIndex:-1,type:"button","aria-label":"select",class:"k-input-button",size:h,fillMode:V,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:k.caretAltDownIcon},null),s.createVNode("select",{name:u,ref:t.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,title:l,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,this.computedValue):this.computedValue},null)]),!I&&s.createVNode(se.Popup,{style:{width:this.popupWidth,direction:p},ref:t.setRef(this,"popup"),class:t.classNames(a.className,{"k-rtl":p==="rtl"}),popupClass:t.classNames(a.popupClass,"k-dropdowntree-popup","popup-"+this.componentGuid),animate:a.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:a.appendTo},{default:()=>[this.$props.filterable&&s.createVNode(T.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,onBlur:this.onBlur,size:h,rounded:C,fillMode:V},null),v&&s.createVNode("div",{class:"k-list-header"},[v]),n.length>0?s.createVNode(O.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:g,dataItems:n,focusIdField:o,textField:this.$props.textField,selectField:R,expandField:this.$props.expandField,childrenField:$,expandIcons:!0,onItemclick:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,size:h,item:N},null):D,y&&s.createVNode("div",{class:"k-list-footer"},[y])]})])},f=[s.h(ie.call(this),{...this.$attrs}),I&&ee.call(this)];return l?s.createVNode(le.FloatingLabel,{label:l,editorValue:this.currentValueText,editorPlaceholder:r,editorValid:te,editorDisabled:d,editorId:i,focused:this.focused,dir:p},K(f)?f:{default:()=>[f]}):f},methods:{calculateMedia(e){for(let i of e)this.windowWidth=i.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:i,required:n}=this.$props,o=S({validationMessage:e,valid:i,required:n},this.hasValue);this.selectRef.setCustomValidity(o.valid?"":this.validationMessage===void 0?pe:this.validationMessage)}},openPopup(e){if(!this.isOpen){const i={...e};this.$emit("open",i),this.currentOpened=!0}},closePopup(e){if(this.isOpen){const i={...e};this.$emit("close",i),this.currentOpened=!1}},onWrapperClick(e){if(this.onFilterChange({...e,target:{value:""}}),!e.defaultPrevented&&this.$el){this.focused=!0;const i={event:e,target:this};(this.isOpen?this.closePopup:this.openPopup)(i)}},switchFocus(e){this.skipFocusRef=!0,e(),window.setTimeout(()=>this.skipFocusRef=!1,0)},onWrapperKeyDown(e){const{keyCode:i,altKey:n}=e,o=this.treeViewRef&&this.treeViewRef.$el,a=this.inputRef&&this.inputRef.input;if(this.$props.disabled||e.defaultPrevented&&a===e.target)return;const d={event:e,target:this};if(this.isOpen)if(i===t.Keys.esc||n&&i===t.Keys.up)e.preventDefault(),this.closePopup(d);else if(o&&o.querySelector(".k-focus")&&(i===t.Keys.up||i===t.Keys.down||i===t.Keys.left||i===t.Keys.right||i===t.Keys.home||i===t.Keys.end)){if(i===t.Keys.up&&a){const r=Array.from(o.querySelectorAll(".k-treeview-item")),l=[...r].reverse().find(u=>!!(u&&u.querySelector(".k-focus")));if(l&&r.indexOf(l)===0)return this.switchFocus(()=>{this.focusElement(a)})}this.switchFocus(t.noop)}else i===t.Keys.down&&this.switchFocus(()=>{this.focusElement(a||o)});else n&&i===t.Keys.down&&(e.preventDefault(),this.openPopup(d))},onInputKeyDown(e){const{keyCode:i,altKey:n}=e;if(i===t.Keys.esc)this.onWrapperClick(e);else if(n||i!==t.Keys.up&&i!==t.Keys.down)return;e.preventDefault(),this.switchFocus(i===t.Keys.up?()=>{this.focusElement(this.elementRef)}:()=>{this.focusElement(this.treeViewRef&&this.treeViewRef.$el)})},focusElement(e){e&&this.switchFocus(()=>e.focus())},onPopupOpened(){if(!this.focused&&this.isOpen&&!this.currentOpened)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.$el)},onPopupClosed(){this.focused&&this.focusElement(this.elementRef)},onFocus(e){if(!this.focused&&!this.skipFocusRef){this.focused=!0;const i={event:e,target:this};this.$emit("focus",i)}},onBlur(e){if(this.focused&&!this.skipFocusRef){this.focused=!1;const i={event:e,target:this},n={...i};(!e.relatedTarget||!e.relatedTarget.closest(".popup-"+this.componentGuid))&&!this.adaptiveState&&(this.$emit("blur",n),this.closePopup(i))}},onWrapperMouseDown(){this.focused&&this.switchFocus(t.noop)},changeValue(e,i,n){const o={value:i,level:n?B(n):[],...e};this.$emit("changemodel",i),this.$emit("update:modelValue",i),this.$emit("change",o),this.currentValue=i},onChange(e){if(b.areSame(e.item,this.computedValue,this.dataItemKey)||!this.$el)return;const{item:i,itemHierarchicalIndex:n,event:o}=e,a={event:o,target:this};this.changeValue(a,i,n),this.closePopup(a)},onClear(e){const i={event:e,target:this};this.changeValue(i,null),this.closePopup(i),e.preventDefault()},onExpand(e){const{item:i,itemHierarchicalIndex:n,event:o}=e,a={level:B(n),item:i,event:o,target:this};this.$emit("expandchange",a)},onFilterChange(e){const n={filter:{field:this.$props.textField,operator:"contains",value:e.target.value},event:e,target:this};this.$emit("filterchange",n),this.$props.filter===void 0&&(this.filterState=e.target.value)}}});exports.DropDownTree=he;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),t=require("@progress/kendo-vue-common"),se=require("@progress/kendo-vue-popup"),ne=require("@progress/kendo-vue-intl"),M=require("@progress/kendo-vue-treeview"),oe=require("../package-metadata.js"),V=require("../common/utils.js"),ae=require("./ListNoData.js"),c=require("../messages/main.js"),le=require("@progress/kendo-vue-labels"),T=require("../common/ListFilter.js"),O=require("@progress/kendo-vue-buttons"),k=require("@progress/kendo-svg-icons"),B=require("../common/constants.js"),re=require("@progress/kendo-vue-layout"),de=require("../common/DropDownBase.js");function K(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!s.isVNode(e)}const{sizeMap:ue,roundedMap:ce}=t.kendoThemeMaps,pe="Please select a value from the list!",E=e=>e.split("_").map(i=>parseInt(i,10)),w=(e,i)=>{const{validationMessage:n,valid:o,required:a}=e;return{customError:n!==void 0,valid:!!(o!==void 0?o:!a||i),valueMissing:!i}},he=s.defineComponent({name:"KendoDropDownTree",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:{type:[Object,String,Number,Boolean],default:function(){}},modelValue:{type:[Object,String,Number,Boolean],default:function(){}},valueMap:Function,placeholder:String,dataItemKey:{type:String,required:!0},textField:{type:String,required:!0},selectField:{type:String,default:"selected"},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,ariaLabel:{type:String,default:void 0},ariaLabelledBy:String,ariaDescribedBy:String,filterable:Boolean,filter:String,loading:Boolean,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],header:[String,Function,Object],footer:[String,Function,Object],valueRender:[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:B.MOBILE_SMALL_DEVICE,medium:B.MOBILE_MEDIUM_DEVICE}}},created(){this.observer=null,t.validatePackage(oe.packageMetadata),this.base=new de(this),this.componentGuid=t.guid(),this.anchor=t.guid()},data(){return{currentOpened:!1,focused:!1,filterState:"",currentValue:void 0,popupWidth:"200px",windowWidth:0,initialAdaptiveRenderingValues:void 0}},computed:{wrapperClass(){const{validationMessage:e,valid:i,required:n,validityStyles:o}=this.$props,a=w({validationMessage:e,valid:i,required:n},this.hasValue),d=!o||a.valid,{size:r,rounded:l,fillMode:u}=this.$props;return{"k-dropdowntree":!0,"k-picker":!0,[this.$props.className]:this.$props.className,[`k-picker-${ue[r]||r}`]:r,[`k-rounded-${ce[l]||l}`]:l,[`k-picker-${u}`]:u,"k-focus":this.focused,"k-invalid":!d,"k-loading":this.$props.loading,"k-required":n,"k-disabled":this.$props.disabled}},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.currentOpened},computedValue(){return this.value!==void 0?this.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentValue},hasValue(){return V.isPresent(this.computedValue)},currentValueText(){return this.hasValue?V.getItemValue(this.computedValue,this.$props.textField):""}},watch:{isOpen:function(e){e&&this.value?this.initialAdaptiveRenderingValues=[...this.value]:this.initialAdaptiveRenderingValues=void 0}},mounted(){this.observer=t.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.elementRef=t.getRef(this,"kendoAnchor"),this.inputRef=t.getRef(this,"input"),this.selectRef=t.getRef(this,"select"),this.treeViewRef=t.getRef(this,"treeView"),this.skipFocusRef=!1,this.popupRef=t.getRef(this,"popup"),this.calculatePopupWidth()},updated(){this.inputRef=t.getRef(this,"input"),this.treeViewRef=t.getRef(this,"treeView"),this.popupRef&&this.isOpen&&this.hasValue&&this.popupRef.reposition(),this.setValidity(),this.calculatePopupWidth()},render(){let e;const i=this.$props.id||this.componentGuid,{dataItems:n,dataItemKey:o,popupSettings:a,disabled:d,placeholder:r,label:l,name:u,selectField:S,subItemsField:R,validationMessage:L,valid:q,required:$,validityStyles:P,adaptiveTitle:W}=this.$props,g=t.getTabIndex(this.$props.tabIndex,d),F=ne.provideLocalizationService(this),A=w({validationMessage:L,valid:q,required:$},this.hasValue),x=this.adaptiveState,p=this.$props.dir,I=t.templateRendering.call(this,this.item,t.getListeners.call(this)),z=t.templateRendering.call(this,this.valueRender,t.getListeners.call(this)),j=t.templateRendering.call(this,this.$props.header,t.getListeners.call(this)),_=t.templateRendering.call(this,this.$props.footer,t.getListeners.call(this)),v=t.getTemplate.call(this,{h:s.h,template:j}),y=t.getTemplate.call(this,{h:s.h,template:_}),G=t.templateRendering.call(this,this.$props.listNoData,t.getListeners.call(this)),H=s.createVNode(ae.ListNoData,null,K(e=F.toLanguageString(c.nodata,c.messages[c.nodata]))?e:{default:()=>[e]}),N=t.getTemplate.call(this,{h:s.h,defaultRendering:H,template:G}),U=s.createVNode("span",{class:"k-input-value-text"},[this.currentValueText||r]),J=t.getTemplate.call(this,{h:s.h,defaultRendering:U,template:z,additionalProps:{value:this.computedValue}}),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"},[W]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[r])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode(O.Button,{tabIndex:1,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onWrapperClick,icon:"x",svgIcon:k.xIcon},null)])]),s.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[this.$props.filterable&&s.createVNode(T.ListFilter,{tabIndex:0,value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:D,fillMode:b,onFocus:this.onFocus,onBlur:this.onBlur},null)])],X=t.templateRendering.call(this,Q,t.getListeners.call(this)),Y=()=>{const m=this.base.getTemplateDef.call(this,v,s.h),C=this.base.getTemplateDef.call(this,y,s.h);return[m&&s.createVNode("div",{class:"k-list-header"},[m]),n.length>0?s.createVNode(M.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:g,dataItems:n,focusIdField:o,textField:this.$props.textField,selectField:S,expandField:this.$props.expandField,childrenField:R,expandIcons:!0,onItemclick:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,size:"large",item:I},null):N,C&&s.createVNode("div",{class:"k-list-footer"},[C])]},Z=t.templateRendering.call(this,Y,t.getListeners.call(this)),ee=function(){return s.createVNode(re.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,header:X,content:Z,contentClassName:"!k-overflow-hidden",onClose:this.onWrapperClick,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},te=!P||A.valid,{size:h,rounded:D,fillMode:b}=this.$props,ie=function(){return s.createVNode("span",{class:this.wrapperClass,tabindex:g,accesskey:this.$props.accessKey,id:i,dir:p,ref:t.setRef(this,"kendoAnchor"),onKeydown:this.onWrapperKeyDown,onClick:this.onWrapperClick,onMousedown:this.onWrapperMouseDown,onFocusin:this.onFocus,onFocusout:this.onBlur,role:"combobox","aria-haspopup":"tree","aria-expanded":this.isOpen,"aria-disabled":d,"aria-label":l||this.$props.ariaLabel,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,"aria-required":$},[s.createVNode("span",{class:"k-input-inner"},[J]),this.$props.loading&&s.createVNode(t.Icon,{class:"k-input-loading-icon",name:"loading"},null),this.hasValue&&!d&&s.createVNode("span",{onClick:this.onClear,class:"k-clear-value",title:F.toLanguageString(c.clear,c.messages[c.clear]),role:"button",tabindex:-1,onMousedown:m=>m.preventDefault()},[s.createVNode(t.Icon,{name:"x",icon:k.xIcon},null)]),s.createVNode(O.Button,{tabIndex:-1,type:"button","aria-label":"select",class:"k-input-button",size:h,fillMode:b,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:k.caretAltDownIcon},null),s.createVNode("select",{name:u,ref:t.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,title:l,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,this.computedValue):this.computedValue},null)]),!x&&s.createVNode(se.Popup,{style:{width:this.popupWidth,direction:p},ref:t.setRef(this,"popup"),class:t.classNames(a.className,{"k-rtl":p==="rtl"}),popupClass:t.classNames(a.popupClass,"k-dropdowntree-popup","popup-"+this.componentGuid),animate:a.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:a.appendTo},{default:()=>[this.$props.filterable&&s.createVNode(T.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,onBlur:this.onBlur,size:h,rounded:D,fillMode:b},null),v&&s.createVNode("div",{class:"k-list-header"},[v]),n.length>0?s.createVNode(M.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:g,dataItems:n,focusIdField:o,textField:this.$props.textField,selectField:S,expandField:this.$props.expandField,childrenField:R,expandIcons:!0,onItemclick:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,size:h,item:I},null):N,y&&s.createVNode("div",{class:"k-list-footer"},[y])]})])},f=[s.h(ie.call(this),{...this.$attrs}),x&&ee.call(this)];return l?s.createVNode(le.FloatingLabel,{label:l,editorValue:this.currentValueText,editorPlaceholder:r,editorValid:te,editorDisabled:d,editorId:i,focused:this.focused,dir:p},K(f)?f:{default:()=>[f]}):f},methods:{calculateMedia(e){for(let i of e)this.windowWidth=i.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:i,required:n}=this.$props,o=w({validationMessage:e,valid:i,required:n},this.hasValue);this.selectRef.setCustomValidity(o.valid?"":this.validationMessage===void 0?pe:this.validationMessage)}},openPopup(e){if(!this.isOpen){const i={...e};this.$emit("open",i),this.currentOpened=!0}},closePopup(e){if(this.isOpen){const i={...e};this.$emit("close",i),this.currentOpened=!1}},onWrapperClick(e){if(this.onFilterChange({...e,target:{value:""}}),!e.defaultPrevented&&this.$el){this.focused=!0;const i={event:e,target:this};(this.isOpen?this.closePopup:this.openPopup)(i)}},switchFocus(e){this.skipFocusRef=!0,e(),window.setTimeout(()=>this.skipFocusRef=!1,0)},onWrapperKeyDown(e){const{keyCode:i,altKey:n}=e,o=this.treeViewRef&&this.treeViewRef.$el,a=this.inputRef&&this.inputRef.input;if(this.$props.disabled||e.defaultPrevented&&a===e.target)return;const d={event:e,target:this};if(this.isOpen)if(i===t.Keys.esc||n&&i===t.Keys.up)e.preventDefault(),this.closePopup(d);else if(o&&o.querySelector(".k-focus")&&(i===t.Keys.up||i===t.Keys.down||i===t.Keys.left||i===t.Keys.right||i===t.Keys.home||i===t.Keys.end)){if(i===t.Keys.up&&a){const r=Array.from(o.querySelectorAll(".k-treeview-item")),l=[...r].reverse().find(u=>!!(u&&u.querySelector(".k-focus")));if(l&&r.indexOf(l)===0)return this.switchFocus(()=>{this.focusElement(a)})}this.switchFocus(t.noop)}else i===t.Keys.down&&this.switchFocus(()=>{this.focusElement(a||o)});else n&&i===t.Keys.down&&(e.preventDefault(),this.openPopup(d))},onInputKeyDown(e){const{keyCode:i,altKey:n}=e;if(i===t.Keys.esc)this.onWrapperClick(e);else if(n||i!==t.Keys.up&&i!==t.Keys.down)return;e.preventDefault(),this.switchFocus(i===t.Keys.up?()=>{this.focusElement(this.elementRef)}:()=>{this.focusElement(this.treeViewRef&&this.treeViewRef.$el)})},focusElement(e){e&&this.switchFocus(()=>e.focus())},onPopupOpened(){if(!this.focused&&this.isOpen&&!this.currentOpened)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.$el)},onPopupClosed(){this.focused&&this.focusElement(this.elementRef)},onFocus(e){if(!this.focused&&!this.skipFocusRef){this.focused=!0;const i={event:e,target:this};this.$emit("focus",i)}},onBlur(e){if(this.focused&&!this.skipFocusRef){this.focused=!1;const i={event:e,target:this},n={...i};(!e.relatedTarget||!e.relatedTarget.closest(".popup-"+this.componentGuid))&&!this.adaptiveState&&(this.$emit("blur",n),this.closePopup(i))}},onWrapperMouseDown(){this.focused&&this.switchFocus(t.noop)},changeValue(e,i,n){const o={value:i,level:n?E(n):[],...e};this.$emit("changemodel",i),this.$emit("update:modelValue",i),this.$emit("change",o),this.currentValue=i},onChange(e){if(V.areSame(e.item,this.computedValue,this.dataItemKey)||!this.$el)return;const{item:i,itemHierarchicalIndex:n,event:o}=e,a={event:o,target:this};this.changeValue(a,i,n),this.closePopup(a)},onClear(e){const i={event:e,target:this};this.changeValue(i,null),this.closePopup(i),e.preventDefault()},onExpand(e){const{item:i,itemHierarchicalIndex:n,event:o}=e,a={level:E(n),item:i,event:o,target:this};this.$emit("expandchange",a)},onFilterChange(e){const n={filter:{field:this.$props.textField,operator:"contains",value:e.target.value},event:e,target:this};this.$emit("filterchange",n),this.$props.filter===void 0&&(this.filterState=e.target.value)}}});exports.DropDownTree=he;