@progress/kendo-vue-dropdowns 9.3.0-develop.2 → 9.3.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 +2 -1
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +73 -73
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +2 -2
- package/MultiSelect/MultiSelect.d.ts +27 -1
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +447 -281
- package/MultiSelect/MultiSelectProps.d.ts +53 -0
- package/MultiSelect/TagList.d.ts +15 -1
- package/MultiSelect/TagList.js +1 -1
- package/MultiSelect/TagList.mjs +57 -40
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +2 -2
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +13 -13
- package/common/List.d.ts +3 -0
- package/common/List.js +1 -1
- package/common/List.mjs +61 -58
- package/common/ListItem.d.ts +7 -0
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +36 -29
- package/common/SearchBar.js +1 -1
- package/common/SearchBar.mjs +1 -1
- package/common/VirtualScroll.d.ts +1 -1
- package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/messages/main.d.ts +15 -0
- package/messages/main.js +1 -1
- package/messages/main.mjs +19 -13
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -5,36 +5,37 @@
|
|
|
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 { templateRendering as
|
|
10
|
-
import { ListContainer as
|
|
11
|
-
import { List as
|
|
12
|
-
import { TagList as
|
|
13
|
-
import { SearchBar as
|
|
14
|
-
import
|
|
15
|
-
import { GroupStickyHeader as
|
|
16
|
-
import { ClearButton as
|
|
17
|
-
import { ActiveDescendant as
|
|
18
|
-
import { getItemValue as
|
|
19
|
-
import { xIcon as
|
|
20
|
-
import { Button as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
8
|
+
import { defineComponent as Ve, h as q, createVNode as r, ref as ee, inject as we, isVNode as De, mergeProps as He } from "vue";
|
|
9
|
+
import { templateRendering as C, getListeners as F, Keys as h, canUseDOM as Be, getRef as te, guid as se, classNames as R, kendoThemeMaps as Re, setRef as Me } from "@progress/kendo-vue-common";
|
|
10
|
+
import { ListContainer as Le } from "../common/ListContainer.mjs";
|
|
11
|
+
import { List as Pe } from "../common/List.mjs";
|
|
12
|
+
import { TagList as Ee } from "./TagList.mjs";
|
|
13
|
+
import { SearchBar as Ne } from "../common/SearchBar.mjs";
|
|
14
|
+
import Ke from "../common/DropDownBase.mjs";
|
|
15
|
+
import { GroupStickyHeader as ie } from "../common/GroupStickyHeader.mjs";
|
|
16
|
+
import { ClearButton as ze } from "../common/ClearButton.mjs";
|
|
17
|
+
import { ActiveDescendant as K } from "../common/settings.mjs";
|
|
18
|
+
import { getItemValue as O, areSame as V, itemIndexStartsWith as _e, removeDataItems as z, isPresent as je, preventDefaultNonInputs as We, matchDataCollections as qe } from "../common/utils.mjs";
|
|
19
|
+
import { xIcon as Ge } from "@progress/kendo-svg-icons";
|
|
20
|
+
import { Button as G } from "@progress/kendo-vue-buttons";
|
|
21
|
+
import { Checkbox as Ue } from "@progress/kendo-vue-inputs";
|
|
22
|
+
import { MOBILE_MEDIUM_DEVICE as Ye, MOBILE_SMALL_DEVICE as Je } from "../common/constants.mjs";
|
|
23
|
+
import { ActionSheet as Qe } from "@progress/kendo-vue-layout";
|
|
24
|
+
import { ListFilter as Xe } from "../common/ListFilter.mjs";
|
|
25
|
+
import { provideLocalizationService as Ze } from "@progress/kendo-vue-intl";
|
|
26
|
+
import { itemsSelectedText as ne, messages as L, adaptiveModeFooterCancel as ae, adaptiveModeFooterApply as le, summaryTagText as oe, selectAllText as re } from "../messages/main.mjs";
|
|
26
27
|
const {
|
|
27
|
-
sizeMap:
|
|
28
|
-
roundedMap:
|
|
29
|
-
} =
|
|
30
|
-
function
|
|
31
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
28
|
+
sizeMap: U,
|
|
29
|
+
roundedMap: et
|
|
30
|
+
} = Re;
|
|
31
|
+
function _(e) {
|
|
32
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !De(e);
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
var
|
|
34
|
+
const tt = "Please enter a valid value!", de = (e) => e.preventDefault(), ce = (e, t, s) => !!e != !!t || e.text !== t.text ? !1 : e === t || qe(e.data, t.data, s), ue = (e) => e === x.CustomItem;
|
|
35
|
+
var x = /* @__PURE__ */ (function(e) {
|
|
35
36
|
return e[e.None = 0] = "None", e[e.ListItem = 1] = "ListItem", e[e.CustomItem = 2] = "CustomItem", e;
|
|
36
|
-
})(
|
|
37
|
-
const
|
|
37
|
+
})(x || {});
|
|
38
|
+
const kt = /* @__PURE__ */ Ve({
|
|
38
39
|
name: "KendoMultiSelect",
|
|
39
40
|
emits: {
|
|
40
41
|
changemodel: (e) => !0,
|
|
@@ -42,6 +43,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
42
43
|
filterchange: (e) => !0,
|
|
43
44
|
change: (e) => !0,
|
|
44
45
|
pagechange: (e) => !0,
|
|
46
|
+
selectallchange: (e) => !0,
|
|
45
47
|
focus: (e) => !0,
|
|
46
48
|
blur: (e) => !0,
|
|
47
49
|
open: (e) => !0,
|
|
@@ -170,10 +172,16 @@ const vt = /* @__PURE__ */ $e({
|
|
|
170
172
|
type: String,
|
|
171
173
|
default: void 0
|
|
172
174
|
},
|
|
173
|
-
inputAttributes: Object
|
|
175
|
+
inputAttributes: Object,
|
|
176
|
+
selectAll: Boolean,
|
|
177
|
+
checkboxes: Boolean,
|
|
178
|
+
summarizeAfter: {
|
|
179
|
+
type: Number,
|
|
180
|
+
default: 10
|
|
181
|
+
}
|
|
174
182
|
},
|
|
175
183
|
setup() {
|
|
176
|
-
const e =
|
|
184
|
+
const e = ee(null), t = ee(null), s = we("kendoLocalizationService", {});
|
|
177
185
|
return {
|
|
178
186
|
inputRef: e,
|
|
179
187
|
kendoAnchorRef: t,
|
|
@@ -182,7 +190,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
182
190
|
},
|
|
183
191
|
computed: {
|
|
184
192
|
spanClassNames() {
|
|
185
|
-
const e = !this.hasMounted || !this.$props.validityStyles || this.validity().valid, t = this.currentText ||
|
|
193
|
+
const e = !this.hasMounted || !this.$props.validityStyles || this.validity().valid, t = this.currentText || O(this.computedValue()[0], this.$props.textField);
|
|
186
194
|
return {
|
|
187
195
|
"k-floating-label-container": !0,
|
|
188
196
|
"k-focus": this.currentFocused,
|
|
@@ -209,7 +217,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
209
217
|
}
|
|
210
218
|
},
|
|
211
219
|
created() {
|
|
212
|
-
this.observer = null, this.valuesItemsDuringOnChange = null, this._tags = [], this._skipFocusEvent = !1, this.scrollToFocused = !1, this.base = new
|
|
220
|
+
this.observer = null, this.valuesItemsDuringOnChange = null, this._tags = [], this._skipFocusEvent = !1, this.scrollToFocused = !1, this.base = new Ke(this), this.anchor = se(), this.inputId = se();
|
|
213
221
|
},
|
|
214
222
|
inject: {
|
|
215
223
|
kendoLocalizationService: {
|
|
@@ -217,8 +225,8 @@ const vt = /* @__PURE__ */ $e({
|
|
|
217
225
|
},
|
|
218
226
|
adaptiveModeBreakpoints: {
|
|
219
227
|
default: {
|
|
220
|
-
small:
|
|
221
|
-
medium:
|
|
228
|
+
small: Je,
|
|
229
|
+
medium: Ye
|
|
222
230
|
}
|
|
223
231
|
}
|
|
224
232
|
},
|
|
@@ -231,18 +239,20 @@ const vt = /* @__PURE__ */ $e({
|
|
|
231
239
|
currentOpened: !1,
|
|
232
240
|
currentFocusedIndex: void 0,
|
|
233
241
|
currentFocusedTag: void 0,
|
|
242
|
+
currentSelectAllFocused: !1,
|
|
234
243
|
searchState: {
|
|
235
244
|
word: "",
|
|
236
245
|
last: ""
|
|
237
246
|
},
|
|
238
247
|
suggested: "",
|
|
239
|
-
activedescendant:
|
|
248
|
+
activedescendant: K.PopupList,
|
|
240
249
|
group: void 0,
|
|
241
250
|
isScrolling: !1,
|
|
242
251
|
itemHeight: 0,
|
|
243
252
|
windowWidth: 0,
|
|
244
253
|
popupWidth: void 0,
|
|
245
|
-
initialAdaptiveRenderingValues: void 0
|
|
254
|
+
initialAdaptiveRenderingValues: void 0,
|
|
255
|
+
stickyHeadersHeight: 0
|
|
246
256
|
};
|
|
247
257
|
},
|
|
248
258
|
watch: {
|
|
@@ -256,7 +266,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
256
266
|
e && t && e.total !== t.total && (this.virtualTotalHasChanged = !0);
|
|
257
267
|
},
|
|
258
268
|
isOpen: function(e) {
|
|
259
|
-
e ? this.initialAdaptiveRenderingValues = this.base.component.currentValue : this.initialAdaptiveRenderingValues = void 0, setTimeout(() => {
|
|
269
|
+
e ? (this.initialAdaptiveRenderingValues = this.base.component.currentValue, this.isScrolling = !1) : (this.initialAdaptiveRenderingValues = void 0, this.currentSelectAllFocused = !1), setTimeout(() => {
|
|
260
270
|
const t = document.querySelector(".k-list-item");
|
|
261
271
|
this.itemHeight = this.base.getListItemHeight(t);
|
|
262
272
|
}, 100);
|
|
@@ -268,24 +278,29 @@ const vt = /* @__PURE__ */ $e({
|
|
|
268
278
|
virtual: e,
|
|
269
279
|
groupField: t = "",
|
|
270
280
|
dataItems: s = []
|
|
271
|
-
} = this.$props, i = e ? e.skip : 0, n = this.isOpen,
|
|
281
|
+
} = this.$props, i = e ? e.skip : 0, n = this.isOpen, a = this.prevOpened !== void 0 ? this.prevOpened : this.prevCurrentOpened, o = !a && n, d = a && !n, c = Object.assign({}, {
|
|
272
282
|
animate: !0,
|
|
273
283
|
height: "200px"
|
|
274
|
-
}, this.$props.popupSettings),
|
|
275
|
-
if (
|
|
284
|
+
}, this.$props.popupSettings), l = this.$refs.list, f = this.$refs.scrollElement;
|
|
285
|
+
if (l && (this.base.vs.list = l.list, this.base.list = l.list), f && (this.base.vs.scrollElement = f), l && s.length && this.base.vs.scrollerRef(l.$el), n && this.stickyHeadersHeight === 0 && this.measureStickyHeadersHeight(), !c.animate && d && this.onPopupClosed(), !this.isScrolling)
|
|
276
286
|
if (e && this.virtualTotalHasChanged)
|
|
277
287
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset(), this.virtualTotalHasChanged = !1;
|
|
278
288
|
else {
|
|
279
289
|
let {
|
|
280
290
|
focusedItem: m,
|
|
281
|
-
focusedIndex:
|
|
291
|
+
focusedIndex: S
|
|
282
292
|
} = this.getFocusedState();
|
|
283
|
-
t !== "" && (
|
|
293
|
+
t !== "" && (S = (g = this.base.getGroupedDataModernMode(s, t)) == null ? void 0 : g.indexOf(m)), o && e ? (this.base.vs.container ? (this.base.scrollToVirtualItem(e, S - i), this.base.vs.translate > 0 && S - i < 0 && (this.base.vs.container.scrollTop = this.base.vs.translate)) : this.$nextTick(() => {
|
|
294
|
+
const T = this.$refs.list;
|
|
295
|
+
T && (this.base.vs.list = T.list, this.base.list = T.list, this.base.vs.scrollerRef(T.$el));
|
|
296
|
+
const w = this.$refs.scrollElement;
|
|
297
|
+
w && (this.base.vs.scrollElement = w), this.base.scrollToVirtualItem(e, S - i), this.base.vs.translate > 0 && S - i < 0 && (this.base.vs.container.scrollTop = this.base.vs.translate);
|
|
298
|
+
}), this.prevCurrentOpened = !0) : o && !e ? (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][t], this), this.base.scrollToItem(S), this.prevCurrentOpened = !0) : n && a && m && this.scrollToFocused && this.base.scrollToItem(S - i);
|
|
284
299
|
}
|
|
285
300
|
this.scrollToFocused = !1, this.searchBarRef(), this.setValidity();
|
|
286
301
|
},
|
|
287
302
|
mounted() {
|
|
288
|
-
this.observer =
|
|
303
|
+
this.observer = Be && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.input = this.inputRef.input, this.base.wrapper = te(this, "kendoAnchor"), this.element = te(this, "kendoAnchor"), this.base.didMount(), this.searchBarRef(), this.setValidity();
|
|
289
304
|
},
|
|
290
305
|
methods: {
|
|
291
306
|
clearFilter(e) {
|
|
@@ -297,12 +312,12 @@ const vt = /* @__PURE__ */ $e({
|
|
|
297
312
|
},
|
|
298
313
|
findByFieldValue(e, t) {
|
|
299
314
|
return t.map((i) => {
|
|
300
|
-
const n = this.dataItems.findIndex((
|
|
315
|
+
const n = this.dataItems.findIndex((a) => O(a, e) === i);
|
|
301
316
|
return this.dataItems[n] || i;
|
|
302
317
|
});
|
|
303
318
|
},
|
|
304
319
|
primitiveValue() {
|
|
305
|
-
const e = this.computedValue(), t = e.map((s) =>
|
|
320
|
+
const e = this.computedValue(), t = e.map((s) => O(s, this.valueField));
|
|
306
321
|
return this.valuePrimitive ? t : e;
|
|
307
322
|
},
|
|
308
323
|
validity() {
|
|
@@ -314,38 +329,53 @@ const vt = /* @__PURE__ */ $e({
|
|
|
314
329
|
};
|
|
315
330
|
},
|
|
316
331
|
handleItemSelect(e, t) {
|
|
332
|
+
this.currentSelectAllFocused && (t.data.currentSelectAllFocused = !1);
|
|
317
333
|
const {
|
|
318
334
|
dataItems: s = [],
|
|
319
335
|
dataItemKey: i,
|
|
320
336
|
virtual: n
|
|
321
|
-
} = this.$props,
|
|
322
|
-
|
|
323
|
-
|
|
337
|
+
} = this.$props, a = this.computedValue(), o = n ? n.skip : 0, d = s[e - o], c = a.findIndex((g) => V(g, d, i));
|
|
338
|
+
this._lastSelectedOrDeselectedItemIndex = s.findIndex((g) => V(g, d, i));
|
|
339
|
+
let l = [];
|
|
340
|
+
c !== -1 ? (l = a, l.splice(c, 1)) : l = [...a, d], (this.$props.filter !== void 0 ? this.$props.filter : this.currentText) && !this.adaptiveState && !this.$props.checkboxes && this.clearFilter(t), t.data.currentFocusedIndex = e, this.triggerOnChange(l, t), this.base.triggerPageChangeCornerItems(d, t);
|
|
324
341
|
},
|
|
325
342
|
onTagDelete(e, t) {
|
|
326
343
|
const s = this.isOpen, i = this.base.initState();
|
|
327
344
|
i.event = t, s && this.base.togglePopup(i), this.currentFocused || (i.data.currentFocused = !0);
|
|
328
345
|
const n = this.computedValue();
|
|
329
|
-
|
|
346
|
+
z(n, e, this.$props.dataItemKey), this.triggerOnChange(n, i), this.applyState(i);
|
|
330
347
|
},
|
|
331
348
|
onNavigate(e, t) {
|
|
332
349
|
const {
|
|
333
350
|
allowCustom: s,
|
|
334
|
-
dataItems: i = []
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
351
|
+
dataItems: i = [],
|
|
352
|
+
selectAll: n
|
|
353
|
+
} = this.$props, a = this.isOpen, o = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
|
|
354
|
+
focusedType: d,
|
|
355
|
+
focusedIndex: c
|
|
356
|
+
} = this.getFocusedState(), l = s && o, f = ue(d), g = this.base, m = g.vs;
|
|
357
|
+
if (this.currentSelectAllFocused) {
|
|
358
|
+
t === h.down && (e.data.currentSelectAllFocused = !1, l || (this.itemFocus(0, e), this.scrollToFocused = !0)), this.applyState(e);
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
if (n && a && c === -1 && !f) {
|
|
362
|
+
t === h.down && (e.data.currentSelectAllFocused = !0), this.applyState(e);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (n && a && t === h.up && c === 0 && !l) {
|
|
366
|
+
e.data.currentSelectAllFocused = !0, e.data.currentFocusedIndex = void 0, this.applyState(e);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (a && t === h.up && f)
|
|
370
|
+
n && (e.data.currentSelectAllFocused = !0), this.currentFocusedIndex !== void 0 && (e.data.currentFocusedIndex = void 0);
|
|
341
371
|
else {
|
|
342
|
-
const
|
|
372
|
+
const S = g.navigation.navigate({
|
|
343
373
|
keyCode: t,
|
|
344
|
-
current:
|
|
345
|
-
max: (
|
|
346
|
-
min:
|
|
374
|
+
current: c,
|
|
375
|
+
max: (m.enabled ? m.total : i.length) - 1,
|
|
376
|
+
min: l ? -1 : 0
|
|
347
377
|
});
|
|
348
|
-
|
|
378
|
+
S !== void 0 && (this.itemFocus(S, e), this.scrollToFocused = !0);
|
|
349
379
|
}
|
|
350
380
|
this.applyState(e);
|
|
351
381
|
},
|
|
@@ -354,68 +384,68 @@ const vt = /* @__PURE__ */ $e({
|
|
|
354
384
|
dataItems: s = [],
|
|
355
385
|
allowCustom: i,
|
|
356
386
|
virtual: n
|
|
357
|
-
} = this.$props,
|
|
387
|
+
} = this.$props, a = n ? n.skip : 0, o = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
|
|
358
388
|
focusedIndex: d
|
|
359
|
-
} = this.getFocusedState(), c = i &&
|
|
360
|
-
|
|
389
|
+
} = this.getFocusedState(), c = i && o, l = s[e - a];
|
|
390
|
+
l && d !== e ? this.currentFocusedIndex !== e && (t.data.currentFocusedIndex = e, t.data.activedescendant = K.PopupList) : c && e === -1 && this.currentFocusedIndex !== void 0 && (t.data.currentFocusedIndex = void 0), this.base.triggerPageChangeCornerItems(l, t);
|
|
361
391
|
},
|
|
362
392
|
searchBarRef() {
|
|
363
393
|
this.input && this.currentFocused && setTimeout(() => this.input.focus(), 0);
|
|
364
394
|
},
|
|
365
395
|
onChangeHandler(e) {
|
|
366
396
|
const t = this.base.initState(), s = e && (e.currentTarget && e.currentTarget.value || e.value), i = this.isOpen;
|
|
367
|
-
t.event = e, this.$props.filter === void 0 && (t.data.currentText = s), t.data.currentFocusedIndex = void 0, i
|
|
397
|
+
t.event = e, this.$props.filter === void 0 && (t.data.currentText = s), t.data.currentFocusedIndex = void 0, i ? this.scrollToFocused = !0 : this.base.togglePopup(t), this.base.filterChanged(s, t), this.$props.filterable && (t.data.group = void 0), this.applyState(t);
|
|
368
398
|
},
|
|
369
399
|
clearButtonClick(e) {
|
|
370
400
|
const t = this.isOpen, s = this.base.initState();
|
|
371
401
|
s.event = e, e.stopPropagation(), this.computedValue().length > 0 && this.triggerOnChange([], s), this.currentFocusedIndex !== void 0 && (s.data.currentFocusedIndex = void 0), t && this.base.togglePopup(s);
|
|
372
402
|
const i = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
373
|
-
|
|
403
|
+
je(i) && i !== "" && this.base.filterChanged("", s), this.currentText && (s.data.currentText = ""), this.applyState(s);
|
|
374
404
|
},
|
|
375
405
|
onInputKeyDown(e) {
|
|
376
406
|
this.isScrolling && (this.isScrolling = !1);
|
|
377
407
|
const t = e.keyCode, s = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, i = this.isOpen, {
|
|
378
408
|
focusedItem: n
|
|
379
|
-
} = this.getFocusedState(),
|
|
380
|
-
if (
|
|
381
|
-
return this.onTagsNavigate(e,
|
|
382
|
-
const
|
|
383
|
-
e.preventDefault(), this.base.togglePopup(
|
|
409
|
+
} = this.getFocusedState(), a = this.base.initState();
|
|
410
|
+
if (a.event = e, !s && this.computedValue().length > 0 && (t === h.left || t === h.right || t === h.home || t === h.end || t === h.delete || t === h.backspace))
|
|
411
|
+
return this.onTagsNavigate(e, a);
|
|
412
|
+
const o = () => {
|
|
413
|
+
e.preventDefault(), this.base.togglePopup(a), this.applyState(a);
|
|
384
414
|
};
|
|
385
|
-
i ? e.altKey && t ===
|
|
415
|
+
i ? e.altKey && t === h.up ? o() : t === h.up || t === h.down ? (e.preventDefault(), this.onNavigate(a, t)) : t === h.enter || t === h.space && this.currentSelectAllFocused ? (e.preventDefault(), this.currentSelectAllFocused ? this.toggleSelectAll(e) : this.$props.allowCustom && s && n === null ? this.customItemSelect(e) : this.selectFocusedItem(e)) : t === h.esc && (this.adaptiveState && this.handleWrapperClick(e), o()) : (e.altKey && t === h.down || t === h.space && this.$props.selectAll) && o();
|
|
386
416
|
},
|
|
387
417
|
onTagsNavigate(e, t) {
|
|
388
|
-
const s = e.keyCode, i = this.currentFocusedTag, n = this._tags,
|
|
389
|
-
let
|
|
390
|
-
const c =
|
|
391
|
-
if (s ===
|
|
392
|
-
c ?
|
|
393
|
-
else if (s ===
|
|
394
|
-
|
|
395
|
-
else if (s ===
|
|
418
|
+
const s = e.keyCode, i = this.currentFocusedTag, n = this._tags, a = this.$props.dataItemKey;
|
|
419
|
+
let o = i ? n.findIndex((l) => ce(l, i, a)) : -1, d;
|
|
420
|
+
const c = o !== -1;
|
|
421
|
+
if (s === h.left)
|
|
422
|
+
c ? o = Math.max(0, o - 1) : o = n.length - 1, d = n[o];
|
|
423
|
+
else if (s === h.right)
|
|
424
|
+
o === n.length - 1 ? d = void 0 : c && (o = Math.min(n.length - 1, o + 1), d = n[o]);
|
|
425
|
+
else if (s === h.home)
|
|
396
426
|
d = n[0];
|
|
397
|
-
else if (s ===
|
|
427
|
+
else if (s === h.end)
|
|
398
428
|
d = n[n.length - 1];
|
|
399
|
-
else if (s ===
|
|
429
|
+
else if (s === h.delete) {
|
|
400
430
|
if (c) {
|
|
401
|
-
const
|
|
402
|
-
|
|
431
|
+
const l = this.computedValue();
|
|
432
|
+
z(l, n[o].data, a), this.triggerOnChange(l, t);
|
|
403
433
|
}
|
|
404
|
-
} else if (s ===
|
|
405
|
-
const
|
|
434
|
+
} else if (s === h.backspace) {
|
|
435
|
+
const l = this.computedValue();
|
|
406
436
|
if (c)
|
|
407
|
-
|
|
437
|
+
z(l, n[o].data, a), this.triggerOnChange(l, t);
|
|
408
438
|
else if (!c && n.length) {
|
|
409
|
-
const
|
|
410
|
-
|
|
439
|
+
const f = n.pop();
|
|
440
|
+
z(l, f.data, a), this.triggerOnChange(l, t);
|
|
411
441
|
}
|
|
412
442
|
}
|
|
413
|
-
d !== i && (t.data.currentFocusedTag = d, t.data.activedescendant =
|
|
443
|
+
d !== i && (t.data.currentFocusedTag = d, t.data.activedescendant = K.TagsList), this.applyState(t);
|
|
414
444
|
},
|
|
415
445
|
triggerOnChange(e, t) {
|
|
416
446
|
this.$props.value === void 0 && (t.data.currentValue = [...e]), this.valuesItemsDuringOnChange = [], this.setItems(e, this.valuesItemsDuringOnChange), t.events.push({
|
|
417
447
|
type: "change"
|
|
418
|
-
});
|
|
448
|
+
}), this.base.repositionPopup();
|
|
419
449
|
},
|
|
420
450
|
selectFocusedItem(e) {
|
|
421
451
|
const {
|
|
@@ -429,52 +459,81 @@ const vt = /* @__PURE__ */ $e({
|
|
|
429
459
|
setItems(e, t) {
|
|
430
460
|
t.length = 0, t.push(...e);
|
|
431
461
|
},
|
|
462
|
+
shouldKeepNoFocusOnOpen(e, t) {
|
|
463
|
+
return this.$props.selectAll && t === void 0 && this.computedValue().length === 0 && !(this.$props.allowCustom && e);
|
|
464
|
+
},
|
|
432
465
|
getFocusedState() {
|
|
433
|
-
|
|
466
|
+
if (this.currentSelectAllFocused)
|
|
467
|
+
return {
|
|
468
|
+
focusedType: x.None,
|
|
469
|
+
focusedIndex: -1
|
|
470
|
+
};
|
|
471
|
+
const e = this.currentFocusedIndex, t = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
472
|
+
if (this.shouldKeepNoFocusOnOpen(t, e))
|
|
473
|
+
return {
|
|
474
|
+
focusedType: x.None,
|
|
475
|
+
focusedIndex: -1
|
|
476
|
+
};
|
|
477
|
+
const {
|
|
434
478
|
allowCustom: s,
|
|
435
479
|
dataItems: i = [],
|
|
436
480
|
dataItemKey: n,
|
|
437
|
-
virtual:
|
|
438
|
-
textField:
|
|
439
|
-
focusedItemIndex: d =
|
|
440
|
-
} = this.$props, c =
|
|
441
|
-
let
|
|
481
|
+
virtual: a,
|
|
482
|
+
textField: o,
|
|
483
|
+
focusedItemIndex: d = _e
|
|
484
|
+
} = this.$props, c = a && a.skip || 0;
|
|
485
|
+
let l;
|
|
442
486
|
if (e !== void 0)
|
|
443
487
|
return {
|
|
444
488
|
focusedIndex: e,
|
|
445
489
|
focusedItem: i[e - c],
|
|
446
|
-
focusedType:
|
|
490
|
+
focusedType: x.ListItem
|
|
447
491
|
};
|
|
448
|
-
const
|
|
492
|
+
const f = this.computedValue();
|
|
449
493
|
if (s && t)
|
|
450
494
|
return {
|
|
451
495
|
focusedItem: null,
|
|
452
496
|
focusedIndex: -1,
|
|
453
|
-
focusedType:
|
|
497
|
+
focusedType: x.CustomItem
|
|
454
498
|
};
|
|
455
499
|
if (t)
|
|
456
|
-
return
|
|
457
|
-
focusedItem: i[
|
|
458
|
-
focusedIndex:
|
|
459
|
-
focusedType:
|
|
500
|
+
return l = d(i, t, o), {
|
|
501
|
+
focusedItem: i[l],
|
|
502
|
+
focusedIndex: l + c,
|
|
503
|
+
focusedType: x.ListItem
|
|
460
504
|
};
|
|
461
|
-
if (
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
505
|
+
if (f.length) {
|
|
506
|
+
if (this.$props.selectAll) {
|
|
507
|
+
const m = f[f.length - 1], S = i.findIndex((T) => V(T, m, n));
|
|
508
|
+
return S !== -1 ? {
|
|
509
|
+
focusedIndex: S + c,
|
|
510
|
+
focusedItem: i[S],
|
|
511
|
+
focusedType: x.ListItem
|
|
512
|
+
} : c === 0 ? {
|
|
513
|
+
focusedItem: i[0],
|
|
514
|
+
focusedIndex: 0,
|
|
515
|
+
focusedType: x.ListItem
|
|
516
|
+
} : {
|
|
517
|
+
focusedType: x.None,
|
|
518
|
+
focusedIndex: -1
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
const g = f[f.length - 1];
|
|
522
|
+
return l = i.findIndex((m) => V(m, g, n)), i[l] !== void 0 ? {
|
|
523
|
+
focusedIndex: l + c,
|
|
524
|
+
focusedItem: i[l],
|
|
525
|
+
focusedType: x.ListItem
|
|
467
526
|
} : {
|
|
468
|
-
focusedType:
|
|
527
|
+
focusedType: x.None,
|
|
469
528
|
focusedIndex: -1
|
|
470
529
|
};
|
|
471
530
|
}
|
|
472
531
|
return c === 0 ? {
|
|
473
532
|
focusedItem: i[0],
|
|
474
533
|
focusedIndex: 0,
|
|
475
|
-
focusedType:
|
|
534
|
+
focusedType: x.ListItem
|
|
476
535
|
} : {
|
|
477
|
-
focusedType:
|
|
536
|
+
focusedType: x.None,
|
|
478
537
|
focusedIndex: -1
|
|
479
538
|
};
|
|
480
539
|
},
|
|
@@ -490,8 +549,8 @@ const vt = /* @__PURE__ */ $e({
|
|
|
490
549
|
[s]: t
|
|
491
550
|
} : t;
|
|
492
551
|
this.currentText !== void 0 && (i.data.currentText = ""), i.data.currentFocusedIndex = void 0, this.base.filterChanged("", i);
|
|
493
|
-
const
|
|
494
|
-
this.triggerOnChange(
|
|
552
|
+
const a = [...this.computedValue(), n];
|
|
553
|
+
this.triggerOnChange(a, i), this.base.togglePopup(i), this.applyState(i);
|
|
495
554
|
},
|
|
496
555
|
handleWrapperClick(e) {
|
|
497
556
|
const t = this.isOpen, s = this.input;
|
|
@@ -499,7 +558,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
499
558
|
const i = this.base.initState();
|
|
500
559
|
i.event = e, this.currentFocused || (i.events.push({
|
|
501
560
|
type: "focus"
|
|
502
|
-
}), i.data.currentFocused = !0), this.
|
|
561
|
+
}), i.data.currentFocused = !0), this.base.togglePopup(i), this.applyState(i);
|
|
503
562
|
},
|
|
504
563
|
onCancel(e) {
|
|
505
564
|
const t = this.base.initState();
|
|
@@ -511,7 +570,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
511
570
|
},
|
|
512
571
|
handleItemClick(e, t) {
|
|
513
572
|
const s = this.base.initState();
|
|
514
|
-
s.event = t, this.handleItemSelect(e, s), this.$props.autoClose && !this.adaptiveState && this.base.togglePopup(s), this.applyState(s);
|
|
573
|
+
s.event = t, this.handleItemSelect(e, s), this.$props.autoClose && !this.$props.checkboxes && !this.adaptiveState && this.base.togglePopup(s), this.applyState(s);
|
|
515
574
|
},
|
|
516
575
|
handleBlur(e) {
|
|
517
576
|
if (!this.currentFocused || this._skipFocusEvent)
|
|
@@ -520,7 +579,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
520
579
|
allowCustom: i,
|
|
521
580
|
filterable: n
|
|
522
581
|
} = this.$props;
|
|
523
|
-
s.event = e, s.data.currentFocused = !1, s.events.push({
|
|
582
|
+
s.event = e, s.data.currentFocused = !1, s.data.currentSelectAllFocused = !1, s.events.push({
|
|
524
583
|
type: "blur"
|
|
525
584
|
}), t && !this.adaptiveState && (this.currentOpened && (s.data.currentOpened = !1), s.events.push({
|
|
526
585
|
type: "close"
|
|
@@ -530,12 +589,21 @@ const vt = /* @__PURE__ */ $e({
|
|
|
530
589
|
this._skipFocusEvent || this.base.handleFocus(e);
|
|
531
590
|
},
|
|
532
591
|
onPopupOpened() {
|
|
533
|
-
this.input && this.currentFocused && this.focusElement(this.input);
|
|
592
|
+
this.input && this.currentFocused && this.focusElement(this.input), this.measureStickyHeadersHeight();
|
|
534
593
|
},
|
|
535
594
|
onPopupClosed() {
|
|
536
595
|
this.currentFocused && setTimeout(() => {
|
|
537
596
|
this.currentFocused && this.focusElement(this.input);
|
|
538
|
-
}, 0);
|
|
597
|
+
}, 0), this.stickyHeadersHeight = 0;
|
|
598
|
+
},
|
|
599
|
+
measureStickyHeadersHeight() {
|
|
600
|
+
let e = 0;
|
|
601
|
+
const t = document.getElementById(this.base.listBoxId), s = t == null ? void 0 : t.closest(".k-list");
|
|
602
|
+
if (s) {
|
|
603
|
+
const i = s.querySelector(".k-list-sticky-header"), n = s.querySelector(".k-list-group-sticky-header");
|
|
604
|
+
i && (e += i.offsetHeight), n && (e += n.offsetHeight);
|
|
605
|
+
}
|
|
606
|
+
this.stickyHeadersHeight = e;
|
|
539
607
|
},
|
|
540
608
|
focusElement(e) {
|
|
541
609
|
this._skipFocusEvent = !0, e.focus(), setTimeout(() => this._skipFocusEvent = !1, 30);
|
|
@@ -544,7 +612,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
544
612
|
this.base.applyState(e), this.valuesItemsDuringOnChange = null;
|
|
545
613
|
},
|
|
546
614
|
setValidity() {
|
|
547
|
-
this.input && this.input.setCustomValidity && this.input.setCustomValidity(this.validity().valid ? "" : this.$props.validationMessage ||
|
|
615
|
+
this.input && this.input.setCustomValidity && this.input.setCustomValidity(this.validity().valid ? "" : this.$props.validationMessage || tt);
|
|
548
616
|
},
|
|
549
617
|
focus() {
|
|
550
618
|
this.input && this.input.focus();
|
|
@@ -568,15 +636,61 @@ const vt = /* @__PURE__ */ $e({
|
|
|
568
636
|
groupField: n
|
|
569
637
|
} = this.$props;
|
|
570
638
|
let {
|
|
571
|
-
dataItems:
|
|
572
|
-
} = this.$props,
|
|
573
|
-
if (!n || !
|
|
639
|
+
dataItems: a = []
|
|
640
|
+
} = this.$props, o;
|
|
641
|
+
if (!n || !a.length)
|
|
574
642
|
return;
|
|
575
|
-
const d = s && ((g = s.querySelector(".k-list-item")) == null ? void 0 : g.offsetHeight) || 0, c = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : d),
|
|
576
|
-
n && (
|
|
577
|
-
for (let m = 1; m <
|
|
578
|
-
|
|
579
|
-
|
|
643
|
+
const d = s && ((g = s.querySelector(".k-list-item")) == null ? void 0 : g.offsetHeight) || 0, c = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : d), f = e.target.scrollTop - t.skip * c;
|
|
644
|
+
n && (a = this.base.getGroupedDataModernMode(a, n), a = this.base.getGroupedDataModernMode(a, n), o = a[0][n]);
|
|
645
|
+
for (let m = 1; m < a.length && !(c * m > f); m++)
|
|
646
|
+
a[m] && a[m][n] && (o = a[m][n]);
|
|
647
|
+
o !== this.group && (i.data.group = o, this.applyState(i));
|
|
648
|
+
},
|
|
649
|
+
getSelectableItems() {
|
|
650
|
+
return (this.$props.dataItems || []).filter((t) => !(t != null && t.disabled));
|
|
651
|
+
},
|
|
652
|
+
areAllSelectableItemsSelected() {
|
|
653
|
+
const e = this.getSelectableItems();
|
|
654
|
+
if (e.length === 0 || !e.every((n) => this.computedValue().some((a) => V(a, n, this.$props.dataItemKey))))
|
|
655
|
+
return !1;
|
|
656
|
+
const {
|
|
657
|
+
virtual: s,
|
|
658
|
+
dataItemKey: i
|
|
659
|
+
} = this.$props;
|
|
660
|
+
return !(s && s.total !== void 0 && (i ? this.computedValue().filter((a) => (a == null ? void 0 : a[i]) !== void 0).length : this.computedValue().length) < s.total);
|
|
661
|
+
},
|
|
662
|
+
areSomeSelectableItemsSelected() {
|
|
663
|
+
return this.computedValue().length > 0;
|
|
664
|
+
},
|
|
665
|
+
handleSelectAllItemClick(e) {
|
|
666
|
+
e.stopPropagation(), this.toggleSelectAll(e);
|
|
667
|
+
},
|
|
668
|
+
handleSelectAllItemKeyDown(e) {
|
|
669
|
+
e.keyCode !== h.enter && e.keyCode !== h.space || (e.preventDefault(), this.toggleSelectAll(e));
|
|
670
|
+
},
|
|
671
|
+
toggleSelectAll(e) {
|
|
672
|
+
if (this.$props.disabled)
|
|
673
|
+
return;
|
|
674
|
+
const t = this.areAllSelectableItemsSelected(), s = this.getSelectableItems();
|
|
675
|
+
if (s.length === 0)
|
|
676
|
+
return;
|
|
677
|
+
const i = {
|
|
678
|
+
event: e,
|
|
679
|
+
target: this,
|
|
680
|
+
allSelected: !t,
|
|
681
|
+
defaultPrevented: !1,
|
|
682
|
+
preventDefault() {
|
|
683
|
+
this.defaultPrevented = !0;
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
if (this.$emit("selectallchange", i), i.defaultPrevented)
|
|
687
|
+
return;
|
|
688
|
+
const n = this.base.initState();
|
|
689
|
+
n.data.currentFocusedIndex = void 0;
|
|
690
|
+
let a = [];
|
|
691
|
+
t ? a = this.computedValue().filter((o) => !s.some((d) => V(d, o, this.$props.dataItemKey))) : (a = [...this.computedValue()], s.forEach((o) => {
|
|
692
|
+
a.some((c) => V(c, o, this.$props.dataItemKey)) || a.push(o);
|
|
693
|
+
})), n.data.currentSelectAllFocused = !0, this.triggerOnChange(a, n), this.applyState(n);
|
|
580
694
|
}
|
|
581
695
|
},
|
|
582
696
|
render() {
|
|
@@ -586,178 +700,228 @@ const vt = /* @__PURE__ */ $e({
|
|
|
586
700
|
dir: s,
|
|
587
701
|
disabled: i,
|
|
588
702
|
tags: n,
|
|
589
|
-
textField:
|
|
590
|
-
dataItemKey:
|
|
703
|
+
textField: a,
|
|
704
|
+
dataItemKey: o,
|
|
591
705
|
virtual: d,
|
|
592
706
|
loading: c,
|
|
593
|
-
size:
|
|
594
|
-
fillMode:
|
|
707
|
+
size: l,
|
|
708
|
+
fillMode: f,
|
|
595
709
|
rounded: g,
|
|
596
710
|
tagsRounded: m,
|
|
597
|
-
removeTagIcon:
|
|
598
|
-
adaptiveTitle:
|
|
599
|
-
header:
|
|
600
|
-
footer:
|
|
601
|
-
inputAttributes:
|
|
602
|
-
groupStickyHeaderItemRender:
|
|
603
|
-
dataItems:
|
|
604
|
-
} = this.$props,
|
|
711
|
+
removeTagIcon: S,
|
|
712
|
+
adaptiveTitle: T,
|
|
713
|
+
header: w,
|
|
714
|
+
footer: Y,
|
|
715
|
+
inputAttributes: he,
|
|
716
|
+
groupStickyHeaderItemRender: pe,
|
|
717
|
+
dataItems: D = []
|
|
718
|
+
} = this.$props, fe = this.currentFocused, H = Object.assign({}, {
|
|
605
719
|
animate: !0,
|
|
606
720
|
height: "200px"
|
|
607
|
-
}, this.$props.popupSettings),
|
|
608
|
-
this.group === void 0 && this.$props.groupField !== void 0 && (this.group =
|
|
609
|
-
let
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
v.push({
|
|
617
|
-
text: x(u, o),
|
|
618
|
-
data: [u]
|
|
721
|
+
}, this.$props.popupSettings), P = this.currentFocusedTag, J = this.computedValue(), E = (this.$props.filter !== void 0 ? this.$props.filter : this.currentText) || "", ge = !c && !i && (!!E || J.length > 0), A = this.base.vs, j = this.$props.id || this.inputId, me = C.call(this, this.$props.tagRender, F.call(this)), N = this.isOpen, B = this.adaptiveState, M = Ze(this);
|
|
722
|
+
this.group === void 0 && this.$props.groupField !== void 0 && (this.group = O(this.$props.dataItems[0], this.$props.groupField)), A.enabled = d !== void 0, d !== void 0 && (A.skip = d.skip, A.total = d.total, A.pageSize = d.pageSize);
|
|
723
|
+
let I = [];
|
|
724
|
+
if (this.initialAdaptiveRenderingValues)
|
|
725
|
+
[...this.initialAdaptiveRenderingValues].forEach((p) => {
|
|
726
|
+
I.push({
|
|
727
|
+
text: O(p, a),
|
|
728
|
+
data: [p]
|
|
729
|
+
});
|
|
619
730
|
});
|
|
620
|
-
|
|
621
|
-
|
|
731
|
+
else if (n === void 0) {
|
|
732
|
+
const {
|
|
733
|
+
allowCustom: u,
|
|
734
|
+
selectAll: p,
|
|
735
|
+
dataItemKey: v
|
|
736
|
+
} = this.$props;
|
|
737
|
+
if (u && p && v) {
|
|
738
|
+
const b = this.computedValue(), y = b.filter((k) => k[v] !== void 0), $ = b.filter((k) => k[v] === void 0);
|
|
739
|
+
if (y.length > 0) {
|
|
740
|
+
const k = M.toLanguageString(ne, L[ne]).replace("{0}", y.length.toString());
|
|
741
|
+
I.push({
|
|
742
|
+
text: k,
|
|
743
|
+
data: [...y]
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
$.forEach((k) => {
|
|
747
|
+
I.push({
|
|
748
|
+
text: O(k, a),
|
|
749
|
+
data: [k]
|
|
750
|
+
});
|
|
751
|
+
});
|
|
752
|
+
} else
|
|
753
|
+
this.computedValue().forEach((b) => {
|
|
754
|
+
I.push({
|
|
755
|
+
text: O(b, a),
|
|
756
|
+
data: [b]
|
|
757
|
+
});
|
|
758
|
+
});
|
|
759
|
+
} else
|
|
760
|
+
I.push(...n);
|
|
761
|
+
I.length > 0 && this.setItems(I, this._tags);
|
|
762
|
+
const ve = !this.$props.validityStyles || this.validity().valid, Se = function(u) {
|
|
622
763
|
const p = this.activedescendant, {
|
|
623
|
-
placeholder:
|
|
764
|
+
placeholder: v
|
|
624
765
|
} = this.$props, {
|
|
625
|
-
focusedIndex:
|
|
626
|
-
} = this.getFocusedState(),
|
|
627
|
-
return
|
|
766
|
+
focusedIndex: b
|
|
767
|
+
} = this.getFocusedState(), y = I.length === 0 || J.length === 0 && !E ? v : void 0, $ = p === K.TagsList && P !== void 0 ? `tag-${this.base.guid}-${P.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${b}`;
|
|
768
|
+
return r(Ne, {
|
|
628
769
|
id: u,
|
|
629
|
-
size: Math.max((
|
|
770
|
+
size: Math.max((y || "").length, E.length, 1),
|
|
630
771
|
tabIndex: this.$props.tabIndex,
|
|
631
772
|
accessKey: this.$props.accessKey,
|
|
632
|
-
placeholder:
|
|
633
|
-
value:
|
|
773
|
+
placeholder: y,
|
|
774
|
+
value: B ? "" : E,
|
|
634
775
|
onChange: this.onChangeHandler,
|
|
635
776
|
onBlur: this.handleBlur,
|
|
636
777
|
onKeydown: this.onInputKeyDown,
|
|
637
|
-
ref: (
|
|
638
|
-
this.inputRef =
|
|
778
|
+
ref: (k) => {
|
|
779
|
+
this.inputRef = k;
|
|
639
780
|
},
|
|
640
781
|
disabled: i,
|
|
641
|
-
expanded:
|
|
782
|
+
expanded: N,
|
|
642
783
|
owns: this.base.listBoxId,
|
|
643
|
-
activedescendant:
|
|
644
|
-
|
|
784
|
+
activedescendant: $,
|
|
785
|
+
ariaDescribedBy: I.length > 0 ? `tagslist-${this.base.guid}${this.$props.ariaDescribedBy ? " " + this.$props.ariaDescribedBy : ""}` : this.$props.ariaDescribedBy,
|
|
645
786
|
"aria-labelledBy": this.$props.ariaLabelledBy,
|
|
646
787
|
"aria-label": this.$props.ariaLabel,
|
|
647
|
-
inputAttributes:
|
|
788
|
+
inputAttributes: he
|
|
648
789
|
}, null);
|
|
649
|
-
},
|
|
790
|
+
}, Ie = () => {
|
|
791
|
+
const {
|
|
792
|
+
checkboxes: u,
|
|
793
|
+
selectAll: p
|
|
794
|
+
} = this.$props;
|
|
795
|
+
if (!p)
|
|
796
|
+
return null;
|
|
797
|
+
const v = this.areAllSelectableItemsSelected(), b = !v && this.areSomeSelectableItemsSelected(), y = M.toLanguageString(re, L[re]), $ = this.currentSelectAllFocused;
|
|
798
|
+
return r("div", {
|
|
799
|
+
class: "k-list-sticky-header"
|
|
800
|
+
}, [r("div", He({
|
|
801
|
+
class: R("k-list-sticky-header-item", {
|
|
802
|
+
"k-selected": !u && v,
|
|
803
|
+
"k-focus": $
|
|
804
|
+
}),
|
|
805
|
+
"aria-label": y
|
|
806
|
+
}, !u && {
|
|
807
|
+
tabindex: 0,
|
|
808
|
+
"aria-selected": v
|
|
809
|
+
}, {
|
|
810
|
+
onClick: this.handleSelectAllItemClick,
|
|
811
|
+
onKeydown: this.handleSelectAllItemKeyDown
|
|
812
|
+
}), [u && r(Ue, {
|
|
813
|
+
checked: v,
|
|
814
|
+
value: b ? null : v,
|
|
815
|
+
tabIndex: -1
|
|
816
|
+
}, null), r("span", {
|
|
817
|
+
class: "k-list-item-text"
|
|
818
|
+
}, [y])])]);
|
|
819
|
+
}, Q = function() {
|
|
650
820
|
let u;
|
|
651
821
|
const {
|
|
652
822
|
groupField: p
|
|
653
|
-
} = this.$props,
|
|
654
|
-
focusedIndex:
|
|
655
|
-
} = this.getFocusedState(),
|
|
656
|
-
let
|
|
657
|
-
return p && (
|
|
823
|
+
} = this.$props, v = C.call(this, this.$props.itemRender, F.call(this)), b = C.call(this, this.$props.groupHeaderItemRender, F.call(this)), y = C.call(this, this.$props.listNoDataRender, F.call(this)), $ = d ? d.skip : 0, {
|
|
824
|
+
focusedIndex: k
|
|
825
|
+
} = this.getFocusedState(), W = `translateY(${A.translate}px)`;
|
|
826
|
+
let Z = D;
|
|
827
|
+
return p && (Z = this.base.getGroupedDataModernMode(D, p)), r(Pe, {
|
|
658
828
|
id: this.base.listBoxId,
|
|
659
|
-
show:
|
|
660
|
-
dataItems:
|
|
661
|
-
focusedIndex:
|
|
829
|
+
show: N,
|
|
830
|
+
dataItems: Z.slice(),
|
|
831
|
+
focusedIndex: k,
|
|
662
832
|
value: this.computedValue(),
|
|
663
|
-
textField:
|
|
664
|
-
valueField:
|
|
833
|
+
textField: a,
|
|
834
|
+
valueField: o,
|
|
665
835
|
optionsGuid: this.base.guid,
|
|
666
836
|
ref: "list",
|
|
667
837
|
wrapperStyle: {
|
|
668
|
-
maxHeight:
|
|
838
|
+
maxHeight: B ? void 0 : this.stickyHeadersHeight > 0 && H.height ? `calc(${H.height} - ${this.stickyHeadersHeight}px)` : H.height
|
|
669
839
|
},
|
|
670
840
|
wrapperCssClass: "k-list-content",
|
|
671
|
-
listStyle:
|
|
672
|
-
transform:
|
|
841
|
+
listStyle: A.enabled ? {
|
|
842
|
+
transform: W
|
|
673
843
|
} : void 0,
|
|
674
844
|
key: "listKey",
|
|
675
|
-
skip:
|
|
845
|
+
skip: $,
|
|
676
846
|
onListclick: this.handleItemClick,
|
|
677
|
-
itemRender:
|
|
678
|
-
groupHeaderItemRender:
|
|
679
|
-
noDataRender:
|
|
847
|
+
itemRender: v,
|
|
848
|
+
groupHeaderItemRender: b,
|
|
849
|
+
noDataRender: y,
|
|
680
850
|
groupField: p,
|
|
681
|
-
onScroll: this.onScroll
|
|
682
|
-
|
|
851
|
+
onScroll: this.onScroll,
|
|
852
|
+
showSelectionCheckbox: this.$props.checkboxes
|
|
853
|
+
}, _(u = be.call(this)) ? u : {
|
|
683
854
|
default: () => [u]
|
|
684
855
|
});
|
|
685
|
-
},
|
|
686
|
-
return
|
|
856
|
+
}, be = function() {
|
|
857
|
+
return A.enabled && r("div", {
|
|
687
858
|
ref: "scrollElement",
|
|
688
859
|
key: "scrollElementKey"
|
|
689
860
|
}, null);
|
|
690
|
-
},
|
|
861
|
+
}, ye = function() {
|
|
691
862
|
const u = this.base, {
|
|
692
863
|
allowCustom: p
|
|
693
|
-
} = this.$props,
|
|
694
|
-
focusedType:
|
|
695
|
-
} = this.getFocusedState(),
|
|
696
|
-
class: "k-list",
|
|
864
|
+
} = this.$props, v = C.call(this, this.$props.groupStickyHeaderItemRender, F.call(this)), b = u.getTemplateDef.call(this, w), y = u.getTemplateDef.call(this, Y), $ = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
|
|
865
|
+
focusedType: k
|
|
866
|
+
} = this.getFocusedState(), W = p && $ && r("div", {
|
|
867
|
+
class: R("k-list-custom-value", {
|
|
868
|
+
"k-focus": ue(k)
|
|
869
|
+
}),
|
|
697
870
|
key: "customitem",
|
|
698
|
-
onClick: this.customItemSelect
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
})
|
|
703
|
-
}, [V, l(Re, {
|
|
704
|
-
name: "plus",
|
|
705
|
-
icon: je,
|
|
706
|
-
style: {
|
|
707
|
-
float: "right"
|
|
708
|
-
}
|
|
709
|
-
}, null)])]);
|
|
710
|
-
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(F[0], this.$props.groupField)), l(De, {
|
|
871
|
+
onClick: this.customItemSelect,
|
|
872
|
+
onMousedown: de
|
|
873
|
+
}, [$]);
|
|
874
|
+
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = O(D[0], this.$props.groupField)), r(Le, {
|
|
711
875
|
ref: "container",
|
|
712
|
-
onMousedown:
|
|
876
|
+
onMousedown: de,
|
|
713
877
|
dir: s !== void 0 ? s : u.dirCalculated,
|
|
714
878
|
onBlur: this.handleBlur,
|
|
715
879
|
width: this.popupWidth,
|
|
716
880
|
popupSettings: {
|
|
717
|
-
...
|
|
881
|
+
...H,
|
|
718
882
|
anchor: this.anchor,
|
|
719
|
-
show:
|
|
883
|
+
show: N,
|
|
720
884
|
onOpen: this.onPopupOpened,
|
|
721
885
|
onClose: this.onPopupClosed,
|
|
722
|
-
popupClass: R(
|
|
723
|
-
[`k-list-${
|
|
886
|
+
popupClass: R(H.popupClass, "k-list", {
|
|
887
|
+
[`k-list-${U[l] || l}`]: l,
|
|
724
888
|
"k-virtual-list": this.base.vs.enabled
|
|
725
889
|
}),
|
|
726
|
-
className: R("k-list-container",
|
|
890
|
+
className: R("k-list-container", H.className)
|
|
727
891
|
},
|
|
728
|
-
itemsCount:
|
|
892
|
+
itemsCount: D.length
|
|
729
893
|
}, {
|
|
730
|
-
default: () => [
|
|
894
|
+
default: () => [b && r("div", {
|
|
731
895
|
class: "k-list-header"
|
|
732
|
-
}, [
|
|
896
|
+
}, [b]), Ie.call(this), this.group && D.length !== 0 && r(ie, {
|
|
733
897
|
group: this.group,
|
|
734
|
-
render:
|
|
735
|
-
}, null),
|
|
898
|
+
render: v
|
|
899
|
+
}, null), W, Q.call(this), y && r("div", {
|
|
736
900
|
class: "k-list-footer"
|
|
737
|
-
}, [
|
|
901
|
+
}, [y]), d && w]
|
|
738
902
|
});
|
|
739
|
-
},
|
|
903
|
+
}, ke = function() {
|
|
740
904
|
const u = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
741
|
-
return this.$props.filterable &&
|
|
905
|
+
return this.$props.filterable && r(Xe, {
|
|
742
906
|
value: u,
|
|
743
907
|
ref: "filterInput",
|
|
744
908
|
onChange: this.onChangeHandler,
|
|
745
909
|
onKeydown: this.onInputKeyDown,
|
|
746
|
-
size:
|
|
910
|
+
size: l,
|
|
747
911
|
rounded: g,
|
|
748
|
-
fillMode:
|
|
912
|
+
fillMode: f
|
|
749
913
|
}, null);
|
|
750
|
-
},
|
|
914
|
+
}, xe = () => [r("div", {
|
|
751
915
|
class: "k-actionsheet-titlebar-group k-hbox"
|
|
752
|
-
}, [
|
|
916
|
+
}, [r("div", {
|
|
753
917
|
class: "k-actionsheet-title"
|
|
754
|
-
}, [
|
|
918
|
+
}, [r("div", {
|
|
755
919
|
class: "k-text-center"
|
|
756
|
-
}, [
|
|
920
|
+
}, [T]), r("div", {
|
|
757
921
|
class: "k-actionsheet-subtitle k-text-center"
|
|
758
|
-
}, null)]),
|
|
922
|
+
}, null)]), r("div", {
|
|
759
923
|
class: "k-actionsheet-actions"
|
|
760
|
-
}, [
|
|
924
|
+
}, [r(G, {
|
|
761
925
|
tabIndex: 5,
|
|
762
926
|
"aria-label": "Cancel",
|
|
763
927
|
"aria-disabled": "false",
|
|
@@ -765,72 +929,72 @@ const vt = /* @__PURE__ */ $e({
|
|
|
765
929
|
fillMode: "flat",
|
|
766
930
|
onClick: this.onCancel,
|
|
767
931
|
icon: "x",
|
|
768
|
-
svgIcon:
|
|
769
|
-
}, null)])]),
|
|
932
|
+
svgIcon: Ge
|
|
933
|
+
}, null)])]), r("div", {
|
|
770
934
|
class: "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
771
|
-
}, [
|
|
772
|
-
const u =
|
|
773
|
-
return [
|
|
935
|
+
}, [ke.call(this)])], $e = C.call(this, xe, F.call(this)), Ce = () => {
|
|
936
|
+
const u = M.toLanguageString(ae, L[ae]), p = M.toLanguageString(le, L[le]);
|
|
937
|
+
return [r(G, {
|
|
774
938
|
size: "large",
|
|
775
939
|
"aria-label": u,
|
|
776
940
|
"aria-disabled": "false",
|
|
777
941
|
type: "button",
|
|
778
942
|
onClick: this.onCancel
|
|
779
|
-
},
|
|
943
|
+
}, _(u) ? u : {
|
|
780
944
|
default: () => [u]
|
|
781
|
-
}),
|
|
945
|
+
}), r(G, {
|
|
782
946
|
themeColor: "primary",
|
|
783
947
|
size: "large",
|
|
784
948
|
"aria-label": p,
|
|
785
949
|
"aria-disabled": "false",
|
|
786
950
|
type: "button",
|
|
787
951
|
onClick: this.handleWrapperClick
|
|
788
|
-
},
|
|
952
|
+
}, _(p) ? p : {
|
|
789
953
|
default: () => [p]
|
|
790
954
|
})];
|
|
791
|
-
},
|
|
792
|
-
const u = this.base.getTemplateDef.call(this,
|
|
793
|
-
return
|
|
955
|
+
}, Fe = C.call(this, Ce, F.call(this)), Te = () => {
|
|
956
|
+
const u = this.base.getTemplateDef.call(this, w, q), p = this.base.getTemplateDef.call(this, Y, q), v = C.call(this, pe, F.call(this));
|
|
957
|
+
return r("div", {
|
|
794
958
|
class: "k-list-container"
|
|
795
|
-
}, [u &&
|
|
959
|
+
}, [u && r("div", {
|
|
796
960
|
class: "k-list-header"
|
|
797
|
-
}, [u]),
|
|
961
|
+
}, [u]), r("div", {
|
|
798
962
|
class: R("k-list", {
|
|
799
|
-
[`k-list-${
|
|
800
|
-
"k-list-lg": !!
|
|
801
|
-
"k-virtual-list":
|
|
963
|
+
[`k-list-${U[l] || l}`]: B ? !1 : l,
|
|
964
|
+
"k-list-lg": !!B,
|
|
965
|
+
"k-virtual-list": A.enabled
|
|
802
966
|
})
|
|
803
|
-
}, [this.group &&
|
|
967
|
+
}, [this.group && D.length !== 0 && r(ie, {
|
|
804
968
|
group: this.group,
|
|
805
|
-
render:
|
|
806
|
-
}, null),
|
|
969
|
+
render: v
|
|
970
|
+
}, null), Q.call(this), p && r("div", {
|
|
807
971
|
class: "k-list-footer"
|
|
808
972
|
}, [p])])]);
|
|
809
|
-
},
|
|
810
|
-
return
|
|
811
|
-
expand:
|
|
973
|
+
}, Ae = C.call(this, Te, F.call(this)), Oe = function() {
|
|
974
|
+
return r(Qe, {
|
|
975
|
+
expand: N,
|
|
812
976
|
animation: !0,
|
|
813
977
|
animationStyles: this.animationStyles,
|
|
814
978
|
className: this.classNameAdaptive,
|
|
815
979
|
contentClassName: "!k-overflow-hidden",
|
|
816
980
|
footerClassName: "k-actions k-actions-stretched",
|
|
817
|
-
header:
|
|
818
|
-
content:
|
|
819
|
-
footer:
|
|
981
|
+
header: $e,
|
|
982
|
+
content: Ae,
|
|
983
|
+
footer: Fe,
|
|
820
984
|
onClose: this.onCancel,
|
|
821
985
|
navigatableElements: ["input.k-input-inner", ".k-actionsheet-actions > button"]
|
|
822
986
|
}, null);
|
|
823
|
-
},
|
|
987
|
+
}, X = [q(function() {
|
|
824
988
|
let u;
|
|
825
|
-
return
|
|
826
|
-
ref:
|
|
989
|
+
return r("span", {
|
|
990
|
+
ref: Me(this, "kendoAnchor"),
|
|
827
991
|
class: R("k-multiselect", "k-input", {
|
|
828
|
-
[`k-input-${
|
|
829
|
-
[`k-rounded-${
|
|
830
|
-
[`k-input-${
|
|
831
|
-
"k-focus":
|
|
992
|
+
[`k-input-${U[l] || l}`]: l,
|
|
993
|
+
[`k-rounded-${et[g] || g}`]: g,
|
|
994
|
+
[`k-input-${f}`]: f,
|
|
995
|
+
"k-focus": fe && !i,
|
|
832
996
|
"k-disabled": i,
|
|
833
|
-
"k-invalid": !
|
|
997
|
+
"k-invalid": !ve,
|
|
834
998
|
"k-loading": c,
|
|
835
999
|
"k-required": this.required
|
|
836
1000
|
}),
|
|
@@ -841,38 +1005,40 @@ const vt = /* @__PURE__ */ $e({
|
|
|
841
1005
|
dir: s,
|
|
842
1006
|
onFocusin: this.handleFocus,
|
|
843
1007
|
onClick: this.handleWrapperClick,
|
|
844
|
-
onMousedown:
|
|
845
|
-
}, [
|
|
846
|
-
removeTagIcon:
|
|
1008
|
+
onMousedown: We
|
|
1009
|
+
}, [r(Ee, {
|
|
1010
|
+
removeTagIcon: S,
|
|
847
1011
|
tagsRounded: m,
|
|
848
|
-
size:
|
|
849
|
-
fillMode:
|
|
850
|
-
tagRender:
|
|
1012
|
+
size: l,
|
|
1013
|
+
fillMode: f,
|
|
1014
|
+
tagRender: me,
|
|
851
1015
|
onTagdelete: this.onTagDelete,
|
|
852
|
-
dataItems:
|
|
1016
|
+
dataItems: I,
|
|
853
1017
|
guid: this.base.guid,
|
|
854
|
-
|
|
855
|
-
|
|
1018
|
+
summarizeAfter: this.$props.summarizeAfter,
|
|
1019
|
+
summaryText: this.$props.summarizeAfter && I.length > this.$props.summarizeAfter ? M.toLanguageString(oe, L[oe]).replace("{0}", (I.length - this.$props.summarizeAfter).toString()) : void 0,
|
|
1020
|
+
focused: P ? I.find((p) => ce(p, P, o)) : void 0
|
|
1021
|
+
}, _(u = Se.call(this, j)) ? u : {
|
|
856
1022
|
default: () => [u]
|
|
857
|
-
}),
|
|
1023
|
+
}), I.length > 0 && ge && r(ze, {
|
|
858
1024
|
onClearclick: this.clearButtonClick
|
|
859
|
-
}, null),
|
|
1025
|
+
}, null), r("span", {
|
|
860
1026
|
class: c ? "k-input-loading-icon k-icon k-i-loading" : void 0
|
|
861
|
-
}, null), !
|
|
1027
|
+
}, null), !B && ye.call(this)]);
|
|
862
1028
|
}.call(this), {
|
|
863
1029
|
...this.$attrs
|
|
864
|
-
}),
|
|
865
|
-
return t ?
|
|
1030
|
+
}), B && Oe.call(this)];
|
|
1031
|
+
return t ? r("span", {
|
|
866
1032
|
class: this.spanClassNames,
|
|
867
1033
|
dir: this.$props.dir
|
|
868
|
-
}, [
|
|
869
|
-
for:
|
|
1034
|
+
}, [X, this.$props.label ? j ? r("label", {
|
|
1035
|
+
for: j,
|
|
870
1036
|
class: "k-floating-label"
|
|
871
|
-
}, [this.$props.label]) :
|
|
1037
|
+
}, [this.$props.label]) : r("span", {
|
|
872
1038
|
class: "k-label"
|
|
873
|
-
}, [this.$props.label]) : null]) :
|
|
1039
|
+
}, [this.$props.label]) : null]) : X;
|
|
874
1040
|
}
|
|
875
1041
|
});
|
|
876
1042
|
export {
|
|
877
|
-
|
|
1043
|
+
kt as MultiSelect
|
|
878
1044
|
};
|