@progress/kendo-vue-dropdowns 8.4.0-develop.3 → 8.4.0-develop.4
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.
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +1 -1
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +1 -2
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +108 -105
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +2 -2
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +88 -88
- package/MultiSelect/TagList.js +1 -1
- package/MultiSelect/TagList.mjs +22 -24
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +2 -2
- package/common/SearchBar.js +1 -1
- package/common/SearchBar.mjs +3 -2
- package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -11
|
@@ -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
|
|
9
|
-
import { kendoThemeMaps as
|
|
10
|
-
import { Button as
|
|
8
|
+
import { defineComponent as $e, createVNode as n, h as T, ref as N, isVNode as Ce } from "vue";
|
|
9
|
+
import { kendoThemeMaps as xe, templateRendering as C, getListeners as x, getTemplate as Oe, Keys as m, canUseDOM as A, getRef as W, guid as G, classNames as B, noop as q, getTabIndex as we, setRef as U, Icon as Fe } from "@progress/kendo-vue-common";
|
|
10
|
+
import { Button as Y } from "@progress/kendo-vue-buttons";
|
|
11
11
|
import { ListContainer as De } from "../common/ListContainer.mjs";
|
|
12
12
|
import { ListFilter as Ve } from "../common/ListFilter.mjs";
|
|
13
13
|
import { ListDefaultItem as Me } from "../common/ListDefaultItem.mjs";
|
|
14
14
|
import { List as Te } from "../common/List.mjs";
|
|
15
15
|
import Be from "../common/DropDownBase.mjs";
|
|
16
|
-
import { GroupStickyHeader as
|
|
17
|
-
import { selectButton as
|
|
16
|
+
import { GroupStickyHeader as J } from "../common/GroupStickyHeader.mjs";
|
|
17
|
+
import { selectButton as Q, messages as Le } from "../messages/main.mjs";
|
|
18
18
|
import { provideLocalizationService as Re } from "@progress/kendo-vue-intl";
|
|
19
19
|
import { MOBILE_MEDIUM_DEVICE as Ne, MOBILE_SMALL_DEVICE as Ee } from "../common/constants.mjs";
|
|
20
20
|
import { ActionSheet as He } from "@progress/kendo-vue-layout";
|
|
21
|
-
import { getItemValue as F, areSame as I, isPresent as
|
|
21
|
+
import { getItemValue as F, areSame as I, isPresent as X, getFocusedItem as Ke, sameCharsOnly as Pe, shuffleData as _e, matchText as Z, preventDefaultNonInputs as ee } from "../common/utils.mjs";
|
|
22
22
|
import { xIcon as je, chevronDownIcon as ze } from "@progress/kendo-svg-icons";
|
|
23
23
|
const {
|
|
24
24
|
sizeMap: E,
|
|
25
25
|
roundedMap: Ae
|
|
26
|
-
} =
|
|
26
|
+
} = xe;
|
|
27
27
|
function We(e) {
|
|
28
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" &&
|
|
28
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ce(e);
|
|
29
29
|
}
|
|
30
|
-
const Ge = "Please select a value from the list!", dt = /* @__PURE__ */
|
|
30
|
+
const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ $e({
|
|
31
31
|
name: "KendoDropDownList",
|
|
32
32
|
model: {
|
|
33
33
|
event: "changemodel"
|
|
@@ -214,13 +214,15 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
214
214
|
},
|
|
215
215
|
isOpen: function() {
|
|
216
216
|
setTimeout(() => {
|
|
217
|
+
if (!A || typeof document == "undefined")
|
|
218
|
+
return;
|
|
217
219
|
const e = document.querySelector(".k-list-item");
|
|
218
220
|
this.itemHeight = this.base.getListItemHeight(e);
|
|
219
221
|
}, 100);
|
|
220
222
|
}
|
|
221
223
|
},
|
|
222
224
|
created() {
|
|
223
|
-
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 =
|
|
225
|
+
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 = G(), this.inputId = G();
|
|
224
226
|
},
|
|
225
227
|
setup() {
|
|
226
228
|
const e = N(null), t = N(null), s = N(null);
|
|
@@ -231,7 +233,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
231
233
|
};
|
|
232
234
|
},
|
|
233
235
|
mounted() {
|
|
234
|
-
this.observer =
|
|
236
|
+
this.observer = A && 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();
|
|
235
237
|
},
|
|
236
238
|
updated() {
|
|
237
239
|
var v;
|
|
@@ -241,15 +243,15 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
241
243
|
virtual: s,
|
|
242
244
|
groupField: l,
|
|
243
245
|
textField: o
|
|
244
|
-
} = this.$props, i = this.isOpen, d = this.prevOpened !== void 0 ? this.prevOpened : this.prevCurrentOpened, a = !d && i, r = this.$refs.list,
|
|
245
|
-
if (this.$refs.scroller, r && (this.base.vs.list = r.list, this.base.list = r.list),
|
|
246
|
+
} = this.$props, i = this.isOpen, d = this.prevOpened !== void 0 ? this.prevOpened : this.prevCurrentOpened, a = !d && i, r = this.$refs.list, c = this.$refs.filterInput, f = this.$refs.scrollElement;
|
|
247
|
+
if (this.$refs.scroller, r && (this.base.vs.list = r.list, this.base.list = r.list), f && (this.base.vs.scrollElement = f), c && (this.filterInput = c), r && e.length && this.base.vs.scrollerRef(r.$el), this.$props.popupSettings.animate || a && this.onPopupOpened(), s && this.virtualTotalHasChanged)
|
|
246
248
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset(), this.virtualTotalHasChanged = !1;
|
|
247
249
|
else {
|
|
248
250
|
const p = this.computedValue(), g = this.prevCurrentValue;
|
|
249
|
-
let
|
|
250
|
-
l && (
|
|
251
|
+
let h = e.findIndex((b) => I(b, p, t));
|
|
252
|
+
l && (h = (v = this.base.getGroupedDataModernMode(e, l)) == null ? void 0 : v.indexOf(p));
|
|
251
253
|
const k = !I(g, p, t);
|
|
252
|
-
a && s ? (this.base.scrollToVirtualItem(s,
|
|
254
|
+
a && s ? (this.base.scrollToVirtualItem(s, h), this.prevCurrentOpened = !0) : a && !s ? (e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][l], this), this.base.scrollToItem(h), this.prevCurrentOpened = !0) : i && d && p && k && !this._navigated ? this.base.scrollToItem(h) : i && d && 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());
|
|
253
255
|
}
|
|
254
256
|
this._navigated = !1, this.prevCurrentValue = this.computedValue(), this.setValidity();
|
|
255
257
|
},
|
|
@@ -297,7 +299,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
297
299
|
},
|
|
298
300
|
computedValue() {
|
|
299
301
|
let e;
|
|
300
|
-
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), !
|
|
302
|
+
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;
|
|
301
303
|
},
|
|
302
304
|
findByFieldValue(e, t) {
|
|
303
305
|
const s = this.dataItems.findIndex((l) => F(l, e) === t);
|
|
@@ -334,13 +336,13 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
334
336
|
total: 0,
|
|
335
337
|
pageSize: 0
|
|
336
338
|
}
|
|
337
|
-
} = this.$props, d = this.base.vs, a = this.computedValue(), r = s.findIndex((
|
|
339
|
+
} = this.$props, d = this.base.vs, a = this.computedValue(), r = s.findIndex((f) => I(f, a, o)), c = this.base.navigation.navigate({
|
|
338
340
|
current: i.skip + r,
|
|
339
341
|
max: (d.enabled ? i.total : s.length) - 1,
|
|
340
342
|
min: l !== void 0 ? -1 : 0,
|
|
341
343
|
keyCode: t
|
|
342
344
|
});
|
|
343
|
-
|
|
345
|
+
c !== void 0 && this.handleItemSelect(c, e), this.applyState(e);
|
|
344
346
|
},
|
|
345
347
|
search(e) {
|
|
346
348
|
clearTimeout(this.typingTimeout), this.$props.filterable || (this.typingTimeout = setTimeout(() => this.searchState.word = "", this.$props.delay), this.selectNext(e));
|
|
@@ -355,18 +357,18 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
355
357
|
itemIndex: D
|
|
356
358
|
}));
|
|
357
359
|
const o = this.searchState.word, i = this.searchState.last, d = Pe(o, i);
|
|
358
|
-
let a = l.length, r = Math.max(0, t.findIndex((b) => I(b, this.computedValue(), s))),
|
|
359
|
-
this.$props.defaultItem && (
|
|
360
|
+
let a = l.length, r = Math.max(0, t.findIndex((b) => I(b, this.computedValue(), s))), c;
|
|
361
|
+
this.$props.defaultItem && (c = {
|
|
360
362
|
item: this.$props.defaultItem,
|
|
361
363
|
itemIndex: -1
|
|
362
|
-
}, a += 1, r += 1), r += d ? 1 : 0, l = _e(l, r,
|
|
363
|
-
let
|
|
364
|
+
}, a += 1, r += 1), r += d ? 1 : 0, l = _e(l, r, c);
|
|
365
|
+
let f, v, p, g = 0;
|
|
364
366
|
const {
|
|
365
|
-
textField:
|
|
367
|
+
textField: h,
|
|
366
368
|
ignoreCase: k
|
|
367
369
|
} = this.$props;
|
|
368
370
|
for (; g < a; ) {
|
|
369
|
-
if (
|
|
371
|
+
if (f = F(l[g].item, h), v = d && Z(f, i, k), p = Z(f, o, k), v || p) {
|
|
370
372
|
g = l[g].itemIndex;
|
|
371
373
|
break;
|
|
372
374
|
}
|
|
@@ -389,15 +391,15 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
389
391
|
total: 0,
|
|
390
392
|
pageSize: 0
|
|
391
393
|
}
|
|
392
|
-
} = this.$props, d = this.isOpen, a = e.keyCode, r = a === m.home || a === m.end,
|
|
393
|
-
if (
|
|
394
|
+
} = this.$props, d = this.isOpen, a = e.keyCode, r = a === m.home || a === m.end, c = a === m.up || a === m.down, f = !d && (e.altKey && a === m.down || a === m.enter || a === m.space), v = d && (e.altKey && a === m.up || a === m.esc), p = s && (a === m.left || a === m.right), g = c || !l && (p || r), h = this.base.initState();
|
|
395
|
+
if (h.event = e, !o) {
|
|
394
396
|
if (r && this.base.vs.enabled)
|
|
395
|
-
a === m.home ? i.skip !== 0 ? (this.base.triggerOnPageChange(
|
|
397
|
+
a === m.home ? i.skip !== 0 ? (this.base.triggerOnPageChange(h, 0, i.pageSize), this._navigated = !0) : this.triggerOnChange(t[0], h) : i.skip < i.total - i.pageSize ? (this.base.triggerOnPageChange(h, i.total - i.pageSize, i.pageSize), this._navigated = !0) : this.triggerOnChange(t[t.length - 1], h);
|
|
396
398
|
else if (d && a === m.enter) {
|
|
397
399
|
const k = this.focusedIndex();
|
|
398
|
-
k !== void 0 && this.handleItemSelect(k,
|
|
399
|
-
} else
|
|
400
|
-
this.applyState(
|
|
400
|
+
k !== void 0 && this.handleItemSelect(k, h), this.base.togglePopup(h), e.preventDefault();
|
|
401
|
+
} else f || v ? (this.adaptiveState && this.handleWrapperClick(e), this.base.togglePopup(h), e.preventDefault()) : g && (this.onNavigate(h, a), e.preventDefault());
|
|
402
|
+
this.applyState(h);
|
|
401
403
|
}
|
|
402
404
|
},
|
|
403
405
|
handleItemClick(e, t) {
|
|
@@ -444,7 +446,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
444
446
|
});
|
|
445
447
|
},
|
|
446
448
|
focusedIndex() {
|
|
447
|
-
const e =
|
|
449
|
+
const e = X(this.$props.filter) ? this.$props.filter : this.currentText, {
|
|
448
450
|
dataItems: t = [],
|
|
449
451
|
virtual: s = {
|
|
450
452
|
skip: 0
|
|
@@ -452,7 +454,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
452
454
|
dataItemKey: l,
|
|
453
455
|
textField: o,
|
|
454
456
|
focusedItemIndex: i
|
|
455
|
-
} = this.$props, d = this.computedValue(), r = !(t.findIndex((
|
|
457
|
+
} = this.$props, d = this.computedValue(), r = !(t.findIndex((c) => I(c, d, l)) < 0 && !this.$props.defaultItem);
|
|
456
458
|
return !r && e && s.skip === 0 ? i ? i(t, e, o) : t.indexOf(Ke(t, e, o)) : !r && s.skip === 0 ? 0 : void 0;
|
|
457
459
|
},
|
|
458
460
|
focusElement(e) {
|
|
@@ -492,9 +494,9 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
492
494
|
} = this.$props, d;
|
|
493
495
|
if (!o || !i.length)
|
|
494
496
|
return;
|
|
495
|
-
const a = s && ((v = s.querySelector(".k-list-item")) == null ? void 0 : v.offsetHeight) || 0, r = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : a),
|
|
497
|
+
const a = s && ((v = s.querySelector(".k-list-item")) == null ? void 0 : v.offsetHeight) || 0, r = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : a), f = e.target.scrollTop - t.skip * r;
|
|
496
498
|
o && (i = this.base.getGroupedDataModernMode(i, o), d = i[0][o]);
|
|
497
|
-
for (let p = 1; p < i.length && !(r * p >
|
|
499
|
+
for (let p = 1; p < i.length && !(r * p > f); p++)
|
|
498
500
|
i[p] && i[p][o] && (d = i[p][o]);
|
|
499
501
|
d !== this.group && (l.data.group = d, this.applyState(l));
|
|
500
502
|
}
|
|
@@ -512,44 +514,44 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
512
514
|
rounded: d,
|
|
513
515
|
fillMode: a,
|
|
514
516
|
dataItemKey: r,
|
|
515
|
-
dataItems:
|
|
516
|
-
disabled:
|
|
517
|
+
dataItems: c = [],
|
|
518
|
+
disabled: f,
|
|
517
519
|
tabIndex: v,
|
|
518
520
|
loading: p,
|
|
519
521
|
icon: g,
|
|
520
|
-
svgIcon:
|
|
522
|
+
svgIcon: h,
|
|
521
523
|
iconClassName: k,
|
|
522
524
|
adaptiveTitle: b,
|
|
523
525
|
header: D,
|
|
524
526
|
footer: H,
|
|
525
|
-
groupStickyHeaderItemRender:
|
|
526
|
-
} = this.$props,
|
|
527
|
+
groupStickyHeaderItemRender: te
|
|
528
|
+
} = this.$props, O = this.isOpen, ie = F(this.computedValue(), this.$props.textField), se = !this.$props.validityStyles || this.validity().valid, S = this.base, w = S.vs, L = this.$props.id || this.inputId;
|
|
527
529
|
w.enabled = this.$props.virtual !== void 0;
|
|
528
530
|
const V = Object.assign({}, {
|
|
529
531
|
animate: !0,
|
|
530
532
|
height: "200px"
|
|
531
|
-
}, this.$props.popupSettings),
|
|
533
|
+
}, this.$props.popupSettings), ae = Re(this).toLanguageString(Q, Le[Q]), M = this.adaptiveState;
|
|
532
534
|
this.group === void 0 && this.$props.groupField !== void 0 && (this.group = F(this.$props.dataItems[0], this.$props.groupField));
|
|
533
|
-
const
|
|
535
|
+
const ne = C.call(this, this.$props.valueRender, x.call(this)), le = this.currentFocused, K = this.primitiveValue(), oe = c.findIndex((u) => I(u, K, r)), re = n("span", {
|
|
534
536
|
class: "k-input-inner",
|
|
535
537
|
id: this.dropDownListId
|
|
536
538
|
}, [n("span", {
|
|
537
539
|
class: "k-input-value-text"
|
|
538
|
-
}, [
|
|
539
|
-
let
|
|
540
|
+
}, [ie])]);
|
|
541
|
+
let de = Oe.call(this, {
|
|
540
542
|
h: T,
|
|
541
|
-
template:
|
|
542
|
-
defaultRendering:
|
|
543
|
+
template: ne,
|
|
544
|
+
defaultRendering: re,
|
|
543
545
|
additionalProps: {
|
|
544
546
|
value: this.computedValue(),
|
|
545
547
|
...this.$data
|
|
546
548
|
}
|
|
547
549
|
});
|
|
548
|
-
const
|
|
550
|
+
const ue = function(u) {
|
|
549
551
|
return n("select", {
|
|
550
552
|
name: this.$props.name,
|
|
551
553
|
id: L,
|
|
552
|
-
ref:
|
|
554
|
+
ref: U(this, "select"),
|
|
553
555
|
tabindex: -1,
|
|
554
556
|
"aria-hidden": !0,
|
|
555
557
|
title: this.$props.label,
|
|
@@ -562,7 +564,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
562
564
|
left: "50%"
|
|
563
565
|
}
|
|
564
566
|
}, [n("option", {
|
|
565
|
-
value: this.$props.valueMap ? this.$props.valueMap.call(void 0,
|
|
567
|
+
value: this.$props.valueMap ? this.$props.valueMap.call(void 0, u) : u
|
|
566
568
|
}, null)]);
|
|
567
569
|
}, pe = () => [n("div", {
|
|
568
570
|
class: "k-actionsheet-titlebar-group k-hbox"
|
|
@@ -574,7 +576,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
574
576
|
class: "k-actionsheet-subtitle k-text-center"
|
|
575
577
|
}, null)]), n("div", {
|
|
576
578
|
class: "k-actionsheet-actions"
|
|
577
|
-
}, [n(
|
|
579
|
+
}, [n(Y, {
|
|
578
580
|
tabIndex: 5,
|
|
579
581
|
"aria-label": "Cancel",
|
|
580
582
|
"aria-disabled": "false",
|
|
@@ -585,59 +587,59 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
585
587
|
svgIcon: je
|
|
586
588
|
}, null)])]), n("div", {
|
|
587
589
|
class: "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
588
|
-
}, [j.call(this)])],
|
|
589
|
-
const
|
|
590
|
+
}, [j.call(this)])], he = C.call(this, pe, x.call(this)), ce = () => {
|
|
591
|
+
const u = S.getTemplateDef.call(this, D, T), y = S.getTemplateDef.call(this, H, T), $ = C.call(this, te, x.call(this));
|
|
590
592
|
return n("div", {
|
|
591
593
|
class: "k-list-container"
|
|
592
|
-
}, [
|
|
594
|
+
}, [u && n("div", {
|
|
593
595
|
class: "k-list-header"
|
|
594
|
-
}, [
|
|
596
|
+
}, [u]), n("div", {
|
|
595
597
|
class: B("k-list", {
|
|
596
598
|
[`k-list-${E[i] || i}`]: M ? !1 : i,
|
|
597
599
|
"k-list-lg": !!M,
|
|
598
600
|
"k-virtual-list": w.enabled
|
|
599
601
|
})
|
|
600
|
-
}, [P.call(this), this.group &&
|
|
602
|
+
}, [P.call(this), this.group && c.length !== 0 && n(J, {
|
|
601
603
|
group: this.group,
|
|
602
|
-
render:
|
|
604
|
+
render: $
|
|
603
605
|
}, null), _.call(this), y && n("div", {
|
|
604
606
|
class: "k-list-footer"
|
|
605
607
|
}, [y])])]);
|
|
606
|
-
},
|
|
608
|
+
}, fe = C.call(this, ce, x.call(this)), me = function() {
|
|
607
609
|
return n(He, {
|
|
608
|
-
expand:
|
|
610
|
+
expand: O,
|
|
609
611
|
animation: !0,
|
|
610
612
|
animationStyles: this.animationStyles,
|
|
611
613
|
className: this.classNameAdaptive,
|
|
612
614
|
contentClassName: "!k-overflow-hidden",
|
|
613
|
-
header:
|
|
614
|
-
content:
|
|
615
|
+
header: he,
|
|
616
|
+
content: fe,
|
|
615
617
|
onClose: this.handleWrapperClick,
|
|
616
618
|
navigatableElements: ["input.k-input-inner", ".k-actionsheet-actions > button"]
|
|
617
619
|
}, null);
|
|
618
620
|
}, P = function() {
|
|
619
621
|
const {
|
|
620
|
-
textField:
|
|
622
|
+
textField: u,
|
|
621
623
|
defaultItem: y
|
|
622
624
|
} = this.$props;
|
|
623
625
|
return y !== void 0 && n(Me, {
|
|
624
626
|
defaultItem: y,
|
|
625
|
-
textField:
|
|
627
|
+
textField: u,
|
|
626
628
|
selected: I(this.computedValue(), y, r),
|
|
627
629
|
key: "defaultitemkey",
|
|
628
630
|
onDefaultitemclick: this.handleDefaultItemClick
|
|
629
631
|
}, null);
|
|
630
632
|
}, _ = function() {
|
|
631
|
-
let
|
|
633
|
+
let u;
|
|
632
634
|
const {
|
|
633
635
|
textField: y,
|
|
634
|
-
groupField:
|
|
636
|
+
groupField: $
|
|
635
637
|
} = this.$props;
|
|
636
638
|
let R = this.$props.dataItems || [];
|
|
637
|
-
const
|
|
638
|
-
return
|
|
639
|
+
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)), ke = o.skip, Se = `translateY(${w.translate}px)`;
|
|
640
|
+
return $ && (R = this.base.getGroupedDataModernMode(R, $)), n(Te, {
|
|
639
641
|
id: this.base.listBoxId,
|
|
640
|
-
show:
|
|
642
|
+
show: O,
|
|
641
643
|
dataItems: R.slice(),
|
|
642
644
|
focusedIndex: this.focusedIndex(),
|
|
643
645
|
value: this.computedValue(),
|
|
@@ -650,23 +652,23 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
650
652
|
},
|
|
651
653
|
wrapperCssClass: "k-list-content",
|
|
652
654
|
listStyle: w.enabled ? {
|
|
653
|
-
transform:
|
|
655
|
+
transform: Se
|
|
654
656
|
} : void 0,
|
|
655
657
|
key: "listkey",
|
|
656
|
-
skip:
|
|
658
|
+
skip: ke,
|
|
657
659
|
onListclick: this.handleItemClick,
|
|
658
|
-
itemRender:
|
|
659
|
-
groupHeaderItemRender:
|
|
660
|
-
noDataRender:
|
|
661
|
-
groupField:
|
|
660
|
+
itemRender: be,
|
|
661
|
+
groupHeaderItemRender: ye,
|
|
662
|
+
noDataRender: Ie,
|
|
663
|
+
groupField: $,
|
|
662
664
|
onScroll: this.onScroll
|
|
663
|
-
}, We(
|
|
664
|
-
default: () => [
|
|
665
|
+
}, We(u = ge.call(this)) ? u : {
|
|
666
|
+
default: () => [u]
|
|
665
667
|
});
|
|
666
668
|
}, j = function() {
|
|
667
|
-
const
|
|
669
|
+
const u = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
668
670
|
return this.$props.filterable && n(Ve, {
|
|
669
|
-
value:
|
|
671
|
+
value: u,
|
|
670
672
|
ref: "filterInput",
|
|
671
673
|
onChange: this.handleListFilterChange,
|
|
672
674
|
onKeydown: this.handleKeyDown,
|
|
@@ -676,16 +678,16 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
676
678
|
ariaControlsId: this.base.listBoxId,
|
|
677
679
|
ariaActivedescendantId: `option-${this.base.guid}-${this.focusedIndex()}`
|
|
678
680
|
}, null);
|
|
679
|
-
},
|
|
681
|
+
}, ge = function() {
|
|
680
682
|
return w.enabled && n("div", {
|
|
681
683
|
ref: "scrollElement",
|
|
682
684
|
key: "scrollElementKey"
|
|
683
685
|
}, null);
|
|
684
|
-
},
|
|
685
|
-
const
|
|
686
|
+
}, ve = function() {
|
|
687
|
+
const u = C.call(this, this.$props.groupStickyHeaderItemRender, x.call(this)), y = S.getTemplateDef.call(this, D), $ = S.getTemplateDef.call(this, H);
|
|
686
688
|
return n(De, {
|
|
687
689
|
ref: "container",
|
|
688
|
-
onMousedown:
|
|
690
|
+
onMousedown: ee,
|
|
689
691
|
dir: l !== void 0 ? l : S.dirCalculated,
|
|
690
692
|
width: this.popupWidth,
|
|
691
693
|
popupSettings: {
|
|
@@ -696,33 +698,34 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
696
698
|
}),
|
|
697
699
|
className: B("k-list-container", V.className),
|
|
698
700
|
anchor: this.anchor,
|
|
699
|
-
show:
|
|
701
|
+
show: O
|
|
700
702
|
},
|
|
701
703
|
onOpen: this.onPopupOpened,
|
|
702
704
|
onClose: this.onPopupClosed,
|
|
703
705
|
onBlur: this.handleBlur
|
|
704
706
|
}, {
|
|
705
|
-
default: () => [j.call(this), P.call(this), this.group &&
|
|
707
|
+
default: () => [j.call(this), P.call(this), this.group && c.length !== 0 && n(J, {
|
|
706
708
|
group: this.group,
|
|
707
|
-
render:
|
|
709
|
+
render: u
|
|
708
710
|
}, null), y && n("div", {
|
|
709
711
|
class: "k-list-header"
|
|
710
|
-
}, [y]), _.call(this),
|
|
712
|
+
}, [y]), _.call(this), $ && n("div", {
|
|
711
713
|
class: "k-list-footer"
|
|
712
|
-
}, [
|
|
714
|
+
}, [$])]
|
|
713
715
|
});
|
|
714
716
|
};
|
|
715
717
|
this.$props.virtual !== void 0 && (S.vs.skip = o.skip, S.vs.total = o.total, S.vs.pageSize = o.pageSize);
|
|
716
718
|
const z = [T(function() {
|
|
719
|
+
var u;
|
|
717
720
|
return n("span", {
|
|
718
|
-
ref:
|
|
721
|
+
ref: U(this, "kendoAnchor"),
|
|
719
722
|
class: B("k-dropdownlist k-picker", t, {
|
|
720
723
|
[`k-picker-${E[i] || i}`]: i,
|
|
721
724
|
[`k-rounded-${Ae[d] || d}`]: d,
|
|
722
725
|
[`k-picker-${a}`]: a,
|
|
723
|
-
"k-focus":
|
|
724
|
-
"k-disabled":
|
|
725
|
-
"k-invalid": !
|
|
726
|
+
"k-focus": le,
|
|
727
|
+
"k-disabled": f,
|
|
728
|
+
"k-invalid": !se,
|
|
726
729
|
"k-loading": p,
|
|
727
730
|
"k-required": this.required
|
|
728
731
|
}),
|
|
@@ -731,43 +734,43 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
731
734
|
width: void 0
|
|
732
735
|
} : e,
|
|
733
736
|
dir: l,
|
|
734
|
-
onMousedown:
|
|
737
|
+
onMousedown: O ? ee : q,
|
|
735
738
|
onFocusin: this.handleFocus,
|
|
736
739
|
onFocusout: this.handleBlur,
|
|
737
|
-
tabindex: we(v,
|
|
740
|
+
tabindex: (u = we(v, f)) != null ? u : 0,
|
|
738
741
|
accesskey: this.$props.accessKey,
|
|
739
742
|
onKeydown: this.handleKeyDown,
|
|
740
743
|
onKeypress: this.handleKeyPress,
|
|
741
744
|
role: "combobox",
|
|
742
|
-
onClick:
|
|
743
|
-
"aria-disabled":
|
|
744
|
-
"aria-haspopup":
|
|
745
|
-
"aria-expanded":
|
|
746
|
-
"aria-
|
|
747
|
-
"aria-activedescendant":
|
|
745
|
+
onClick: f ? q : this.handleWrapperClick,
|
|
746
|
+
"aria-disabled": f || void 0,
|
|
747
|
+
"aria-haspopup": !0,
|
|
748
|
+
"aria-expanded": O || !1,
|
|
749
|
+
"aria-owns": this.base.listBoxId,
|
|
750
|
+
"aria-activedescendant": O ? "option-" + this.base.guid + "-" + (oe + (o ? o.skip : 0)) : void 0,
|
|
748
751
|
"aria-label": this.$props.ariaLabel || this.$props.label,
|
|
749
752
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
750
|
-
"aria-
|
|
753
|
+
"aria-describedBy": this.dropDownListId,
|
|
751
754
|
title: this.$props.title
|
|
752
|
-
}, [
|
|
755
|
+
}, [de, p && n(Fe, {
|
|
753
756
|
name: "loading",
|
|
754
757
|
class: "k-input-loading-icon",
|
|
755
758
|
key: "loading"
|
|
756
|
-
}, null), n(
|
|
759
|
+
}, null), n(Y, {
|
|
757
760
|
type: "button",
|
|
758
761
|
tabIndex: -1,
|
|
759
762
|
size: i,
|
|
760
763
|
fillMode: a,
|
|
761
764
|
rounded: null,
|
|
762
|
-
ariaLabel:
|
|
765
|
+
ariaLabel: ae,
|
|
763
766
|
class: "k-input-button",
|
|
764
767
|
icon: g || "chevron-down",
|
|
765
|
-
svgIcon:
|
|
768
|
+
svgIcon: h || ze,
|
|
766
769
|
iconClass: k
|
|
767
|
-
}, null),
|
|
770
|
+
}, null), ue.call(this, K), !M && ve.call(this)]);
|
|
768
771
|
}.call(this), {
|
|
769
772
|
...this.$attrs
|
|
770
|
-
}), M &&
|
|
773
|
+
}), M && me.call(this)];
|
|
771
774
|
return s ? n("span", {
|
|
772
775
|
class: this.spanClassNames,
|
|
773
776
|
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"),ne=require("@progress/kendo-vue-popup"),ae=require("@progress/kendo-vue-intl"),O=require("@progress/kendo-vue-treeview"),b=require("../package-metadata.js"),k=require("../common/utils.js"),oe=require("./ListNoData.js"),c=require("../messages/main.js"),le=require("@progress/kendo-vue-labels"),T=require("../common/ListFilter.js"),B=require("@progress/kendo-vue-buttons"),w=require("@progress/kendo-svg-icons"),K=require("../common/constants.js"),re=require("@progress/kendo-vue-layout"),de=require("../common/DropDownBase.js");function L(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)),S=(e,i)=>{const{validationMessage:n,valid:a,required:o}=e;return{customError:n!==void 0,valid:!!(a!==void 0?a:!o||i),valueMissing:!i}},he=s.defineComponent({name:"KendoDropDownTree",model:{event:"changemodel"},emits:{open:e=>!0,close:e=>!0,focus:e=>!0,blur:e=>!0,change:e=>!0,filterchange:e=>!0,expandchange:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0},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,validator:function(e){return["small","medium","large"].includes(e)}},rounded:{type:String,validator:function(e){return["none","small","medium","large","full"].includes(e)}},fillMode:{type:String,validator:function(e){return["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:K.MOBILE_SMALL_DEVICE,medium:K.MOBILE_MEDIUM_DEVICE}}},created(){this.observer=null,t.validatePackage(b.packageMetadata),this.showLicenseWatermark=t.shouldShowValidationUI(b.packageMetadata),this.licenseMessage=t.getLicenseMessage(b.packageMetadata),this.base=new de(this),this.componentGuid=t.guid(),this.anchor=t.guid()},data(){return{showLicenseWatermark:!1,licenseMessage:void 0,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:a}=this.$props,o=S({validationMessage:e,valid:i,required:n},this.hasValue),d=!a||o.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 k.isPresent(this.computedValue)},currentValueText(){return this.hasValue?k.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:a,popupSettings:o,disabled:d,placeholder:r,label:l,name:u,selectField:R,subItemsField:$,validationMessage:q,valid:W,required:F,validityStyles:P,adaptiveTitle:A}=this.$props,g=t.getTabIndex(this.$props.tabIndex,d),x=ae.provideLocalizationService(this),z=S({validationMessage:q,valid:W,required:F},this.hasValue),I=this.adaptiveState,p=this.$props.dir,N=t.templateRendering.call(this,this.item,t.getListeners.call(this)),j=t.templateRendering.call(this,this.valueRender,t.getListeners.call(this)),_=t.templateRendering.call(this,this.$props.header,t.getListeners.call(this)),G=t.templateRendering.call(this,this.$props.footer,t.getListeners.call(this)),v=t.getTemplate.call(this,{h:s.h,template:_}),y=t.getTemplate.call(this,{h:s.h,template:G}),H=t.templateRendering.call(this,this.$props.listNoData,t.getListeners.call(this)),U=s.createVNode(oe.ListNoData,null,L(e=x.toLanguageString(c.nodata,c.messages[c.nodata]))?e:{default:()=>[e]}),M=t.getTemplate.call(this,{h:s.h,defaultRendering:U,template:H}),J=s.createVNode("span",{class:"k-input-value-text"},[this.currentValueText||r]),Q=t.getTemplate.call(this,{h:s.h,defaultRendering:J,template:j,additionalProps:{value:this.computedValue}}),X=()=>[s.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[s.createVNode("div",{class:"k-actionsheet-title"},[s.createVNode("div",{class:"k-text-center"},[A]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[r])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode(B.Button,{tabIndex:1,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onWrapperClick,icon:"x",svgIcon:w.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:V,onFocus:this.onFocus,onBlur:this.onBlur},null)])],Y=t.templateRendering.call(this,X,t.getListeners.call(this)),Z=()=>{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(O.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:g,dataItems:n,focusIdField:a,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):M,C&&s.createVNode("div",{class:"k-list-footer"},[C])]},ee=t.templateRendering.call(this,Z,t.getListeners.call(this)),te=function(){return s.createVNode(re.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,header:Y,content:ee,contentClassName:"!k-overflow-hidden",onClose:this.onWrapperClick,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},ie=!P||z.valid,{size:h,rounded:D,fillMode:V}=this.$props,se=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||void 0,"aria-label":l||this.$props.ariaLabel,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,"aria-required":F||void 0},[s.createVNode("span",{class:"k-input-inner"},[Q]),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:w.xIcon},null)]),s.createVNode(B.Button,{tabIndex:-1,type:"button","aria-label":"select",class:"k-input-button",size:h,fillMode:V,themeColor:"base",rounded:null,icon:"chevron-down",svgIcon:w.chevronDownIcon},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)]),this.showLicenseWatermark?s.createVNode(t.WatermarkOverlay,{message:this.licenseMessage},null):null,!I&&s.createVNode(ne.Popup,{style:{width:this.popupWidth,direction:p},ref:t.setRef(this,"popup"),class:t.classNames(o.className,{"k-rtl":p==="rtl"}),popupClass:t.classNames(o.popupClass,"k-dropdowntree-popup","popup-"+this.componentGuid),animate:o.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:o.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: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:a,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):M,y&&s.createVNode("div",{class:"k-list-footer"},[y])]})])},f=[s.h(se.call(this),{...this.$attrs}),I&&te.call(this)];return l?s.createVNode(le.FloatingLabel,{label:l,editorValue:this.currentValueText,editorPlaceholder:r,editorValid:ie,editorDisabled:d,editorId:i,focused:this.focused,dir:p},L(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,a=S({validationMessage:e,valid:i,required:n},this.hasValue);this.selectRef.setCustomValidity(a.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,a=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.isOpen)if(i===t.Keys.esc||n&&i===t.Keys.up)e.preventDefault(),this.closePopup(d);else if(a&&a.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&&o){const r=Array.from(a.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(o)})}this.switchFocus(t.noop)}else i===t.Keys.down&&this.switchFocus(()=>{this.focusElement(o||a)});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){var i;if(this.focused&&!this.skipFocusRef){this.focused=!1;const n={event:e,target:this},a={...n},o=e.relatedTarget||((i=e.event)==null?void 0:i.relatedTarget);!(o!=null&&o.closest(".popup-"+this.componentGuid))&&!this.adaptiveState&&(this.$emit("blur",a),this.closePopup(n))}},onWrapperMouseDown(){this.focused&&this.switchFocus(t.noop)},changeValue(e,i,n){const a={value:i,level:n?E(n):[],...e};this.$emit("changemodel",i),this.$emit("update:modelValue",i),this.$emit("change",a),this.currentValue=i},onChange(e){if(k.areSame(e.item,this.computedValue,this.dataItemKey)||!this.$el)return;const{item:i,itemHierarchicalIndex:n,event:a}=e,o={event:a,target:this};this.changeValue(o,i,n),this.closePopup(o)},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:a}=e,o={level:E(n),item:i,event:a,target:this};this.$emit("expandchange",o)},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"),ne=require("@progress/kendo-vue-popup"),ae=require("@progress/kendo-vue-intl"),O=require("@progress/kendo-vue-treeview"),b=require("../package-metadata.js"),k=require("../common/utils.js"),oe=require("./ListNoData.js"),c=require("../messages/main.js"),le=require("@progress/kendo-vue-labels"),T=require("../common/ListFilter.js"),B=require("@progress/kendo-vue-buttons"),w=require("@progress/kendo-svg-icons"),K=require("../common/constants.js"),re=require("@progress/kendo-vue-layout"),de=require("../common/DropDownBase.js");function L(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)),S=(e,i)=>{const{validationMessage:n,valid:a,required:o}=e;return{customError:n!==void 0,valid:!!(a!==void 0?a:!o||i),valueMissing:!i}},he=s.defineComponent({name:"KendoDropDownTree",model:{event:"changemodel"},emits:{open:e=>!0,close:e=>!0,focus:e=>!0,blur:e=>!0,change:e=>!0,filterchange:e=>!0,expandchange:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0},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,validator:function(e){return["small","medium","large"].includes(e)}},rounded:{type:String,validator:function(e){return["none","small","medium","large","full"].includes(e)}},fillMode:{type:String,validator:function(e){return["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:K.MOBILE_SMALL_DEVICE,medium:K.MOBILE_MEDIUM_DEVICE}}},created(){this.observer=null,t.validatePackage(b.packageMetadata),this.showLicenseWatermark=t.shouldShowValidationUI(b.packageMetadata),this.licenseMessage=t.getLicenseMessage(b.packageMetadata),this.base=new de(this),this.componentGuid=t.guid(),this.anchor=t.guid()},data(){return{showLicenseWatermark:!1,licenseMessage:void 0,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:a}=this.$props,o=S({validationMessage:e,valid:i,required:n},this.hasValue),d=!a||o.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 k.isPresent(this.computedValue)},currentValueText(){return this.hasValue?k.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:a,popupSettings:o,disabled:d,placeholder:r,label:l,name:u,selectField:R,subItemsField:$,validationMessage:q,valid:W,required:F,validityStyles:P,adaptiveTitle:A}=this.$props,g=t.getTabIndex(this.$props.tabIndex,d),x=ae.provideLocalizationService(this),z=S({validationMessage:q,valid:W,required:F},this.hasValue),I=this.adaptiveState,p=this.$props.dir,N=t.templateRendering.call(this,this.item,t.getListeners.call(this)),j=t.templateRendering.call(this,this.valueRender,t.getListeners.call(this)),_=t.templateRendering.call(this,this.$props.header,t.getListeners.call(this)),G=t.templateRendering.call(this,this.$props.footer,t.getListeners.call(this)),v=t.getTemplate.call(this,{h:s.h,template:_}),y=t.getTemplate.call(this,{h:s.h,template:G}),H=t.templateRendering.call(this,this.$props.listNoData,t.getListeners.call(this)),U=s.createVNode(oe.ListNoData,null,L(e=x.toLanguageString(c.nodata,c.messages[c.nodata]))?e:{default:()=>[e]}),M=t.getTemplate.call(this,{h:s.h,defaultRendering:U,template:H}),J=s.createVNode("span",{class:"k-input-value-text"},[this.currentValueText||r]),Q=t.getTemplate.call(this,{h:s.h,defaultRendering:J,template:j,additionalProps:{value:this.computedValue}}),X=()=>[s.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[s.createVNode("div",{class:"k-actionsheet-title"},[s.createVNode("div",{class:"k-text-center"},[A]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[r])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode(B.Button,{tabIndex:1,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onWrapperClick,icon:"x",svgIcon:w.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:V,onFocus:this.onFocus,onBlur:this.onBlur},null)])],Y=t.templateRendering.call(this,X,t.getListeners.call(this)),Z=()=>{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(O.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:g,dataItems:n,focusIdField:a,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):M,C&&s.createVNode("div",{class:"k-list-footer"},[C])]},ee=t.templateRendering.call(this,Z,t.getListeners.call(this)),te=function(){return s.createVNode(re.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,header:Y,content:ee,contentClassName:"!k-overflow-hidden",onClose:this.onWrapperClick,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},ie=!P||z.valid,{size:h,rounded:D,fillMode:V}=this.$props,se=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"},[Q]),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:w.xIcon},null)]),s.createVNode(B.Button,{tabIndex:-1,type:"button","aria-label":"select",class:"k-input-button",size:h,fillMode:V,themeColor:"base",rounded:null,icon:"chevron-down",svgIcon:w.chevronDownIcon},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)]),this.showLicenseWatermark?s.createVNode(t.WatermarkOverlay,{message:this.licenseMessage},null):null,!I&&s.createVNode(ne.Popup,{style:{width:this.popupWidth,direction:p},ref:t.setRef(this,"popup"),class:t.classNames(o.className,{"k-rtl":p==="rtl"}),popupClass:t.classNames(o.popupClass,"k-dropdowntree-popup","popup-"+this.componentGuid),animate:o.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:o.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: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:a,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):M,y&&s.createVNode("div",{class:"k-list-footer"},[y])]})])},f=[s.h(se.call(this),{...this.$attrs}),I&&te.call(this)];return l?s.createVNode(le.FloatingLabel,{label:l,editorValue:this.currentValueText,editorPlaceholder:r,editorValid:ie,editorDisabled:d,editorId:i,focused:this.focused,dir:p},L(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,a=S({validationMessage:e,valid:i,required:n},this.hasValue);this.selectRef.setCustomValidity(a.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,a=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.isOpen)if(i===t.Keys.esc||n&&i===t.Keys.up)e.preventDefault(),this.closePopup(d);else if(a&&a.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&&o){const r=Array.from(a.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(o)})}this.switchFocus(t.noop)}else i===t.Keys.down&&this.switchFocus(()=>{this.focusElement(o||a)});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){var i;if(this.focused&&!this.skipFocusRef){this.focused=!1;const n={event:e,target:this},a={...n},o=e.relatedTarget||((i=e.event)==null?void 0:i.relatedTarget);!(o!=null&&o.closest(".popup-"+this.componentGuid))&&!this.adaptiveState&&(this.$emit("blur",a),this.closePopup(n))}},onWrapperMouseDown(){this.focused&&this.switchFocus(t.noop)},changeValue(e,i,n){const a={value:i,level:n?E(n):[],...e};this.$emit("changemodel",i),this.$emit("update:modelValue",i),this.$emit("change",a),this.currentValue=i},onChange(e){if(k.areSame(e.item,this.computedValue,this.dataItemKey)||!this.$el)return;const{item:i,itemHierarchicalIndex:n,event:a}=e,o={event:a,target:this};this.changeValue(o,i,n),this.closePopup(o)},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:a}=e,o={level:E(n),item:i,event:a,target:this};this.$emit("expandchange",o)},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;
|
|
@@ -388,11 +388,11 @@ const {
|
|
|
388
388
|
role: "combobox",
|
|
389
389
|
"aria-haspopup": "tree",
|
|
390
390
|
"aria-expanded": this.isOpen,
|
|
391
|
-
"aria-disabled": d
|
|
391
|
+
"aria-disabled": d,
|
|
392
392
|
"aria-label": l || this.$props.ariaLabel,
|
|
393
393
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
394
394
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
395
|
-
"aria-required": D
|
|
395
|
+
"aria-required": D
|
|
396
396
|
}, [
|
|
397
397
|
i("span", {
|
|
398
398
|
class: "k-input-inner"
|