@progress/kendo-vue-dropdowns 8.0.0-develop.3 → 8.0.0-develop.5
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 +60 -59
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +268 -218
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +91 -90
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +35 -34
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +117 -104
- package/common/List.js +1 -1
- package/common/List.mjs +127 -79
- package/common/ListGroupItem.js +1 -1
- package/common/ListGroupItem.mjs +36 -21
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +65 -19
- package/common/ListItemIcon.js +8 -0
- package/common/ListItemIcon.mjs +34 -0
- package/common/utils.js +1 -1
- package/common/utils.mjs +53 -54
- package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/index.d.mts +37 -0
- package/index.d.ts +37 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
package/ComboBox/ComboBox.mjs
CHANGED
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as xe, h as
|
|
8
|
+
import { defineComponent as xe, h as G, createVNode as u, ref as _, inject as $e, isVNode as Ce } from "vue";
|
|
9
9
|
import Oe from "../common/DropDownBase.mjs";
|
|
10
10
|
import { GroupStickyHeader as Q } from "../common/GroupStickyHeader.mjs";
|
|
11
|
-
import { templateRendering as
|
|
11
|
+
import { templateRendering as F, getListeners as B, Keys as k, canUseDOM as Ve, getRef as X, guid as Z, classNames as j, kendoThemeMaps as Te, setRef as Fe, Icon as Be } from "@progress/kendo-vue-common";
|
|
12
12
|
import { Button as ee } from "@progress/kendo-vue-buttons";
|
|
13
|
-
import { isPresent as
|
|
14
|
-
import { SearchBar as
|
|
13
|
+
import { isPresent as S, getItemValue as y, areSame as O, suggestValue as we, itemIndexStartsWith as te, getItemIndexByText as ie } from "../common/utils.mjs";
|
|
14
|
+
import { SearchBar as De } from "../common/SearchBar.mjs";
|
|
15
15
|
import { ListContainer as Me } from "../common/ListContainer.mjs";
|
|
16
|
-
import { List as
|
|
17
|
-
import { ClearButton as
|
|
16
|
+
import { List as He } from "../common/List.mjs";
|
|
17
|
+
import { ClearButton as Re } from "../common/ClearButton.mjs";
|
|
18
18
|
import { provideLocalizationService as Le } from "@progress/kendo-vue-intl";
|
|
19
19
|
import { expandButton as se, messages as je } from "../messages/main.mjs";
|
|
20
20
|
import { xIcon as Ee, caretAltDownIcon as Ne } from "@progress/kendo-svg-icons";
|
|
@@ -23,9 +23,9 @@ import { ActionSheet as Ke } from "@progress/kendo-vue-layout";
|
|
|
23
23
|
import { ListFilter as ze } from "../common/ListFilter.mjs";
|
|
24
24
|
const {
|
|
25
25
|
sizeMap: W,
|
|
26
|
-
roundedMap:
|
|
27
|
-
} =
|
|
28
|
-
function
|
|
26
|
+
roundedMap: Ge
|
|
27
|
+
} = Te;
|
|
28
|
+
function _e(e) {
|
|
29
29
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ce(e);
|
|
30
30
|
}
|
|
31
31
|
const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
@@ -218,7 +218,7 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
218
218
|
this.observer = null, this.valueDuringOnChange = void 0, this.currentText = void 0, this.currentValue = void 0, this.currentFocused = void 0, this.currentOpened = void 0, this.prevCurrentValue = this.computedValue(), this.base = new Oe(this), this.anchor = Z(), this.inputId = Z();
|
|
219
219
|
},
|
|
220
220
|
setup() {
|
|
221
|
-
const e =
|
|
221
|
+
const e = _(null), t = _(null), i = _(null), s = $e("kendoLocalizationService", {});
|
|
222
222
|
return {
|
|
223
223
|
inputRef: e,
|
|
224
224
|
elementRef: t,
|
|
@@ -230,34 +230,41 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
230
230
|
this.observer = Ve && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.input = this.inputRef.input, this.base.wrapper = X(this, "kendoAnchor"), this.element = X(this, "kendoAnchor"), this.base.didMount(), this.setValidity();
|
|
231
231
|
},
|
|
232
232
|
updated() {
|
|
233
|
-
var
|
|
233
|
+
var h;
|
|
234
234
|
const {
|
|
235
235
|
dataItems: e = [],
|
|
236
236
|
dataItemKey: t,
|
|
237
237
|
virtual: i,
|
|
238
238
|
groupField: s,
|
|
239
|
-
textField:
|
|
240
|
-
} = this.$props,
|
|
241
|
-
if (this.valueOnDidUpdate =
|
|
239
|
+
textField: n
|
|
240
|
+
} = this.$props, d = this.isOpen, a = this.prevOpened !== void 0 ? this.prevOpened : this.prevCurrentOpened, r = !a && d, p = this.$refs.list, g = this.$refs.scrollElement, l = this.computedValue();
|
|
241
|
+
if (this.valueOnDidUpdate = l, p && (this.base.vs.list = p.list, this.base.list = p.list), g && (this.base.vs.scrollElement = g), p && e.length && this.base.vs.scrollerRef(p.$el), i && this.virtualTotalHasChanged)
|
|
242
242
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset(), this.virtualTotalHasChanged = !1;
|
|
243
243
|
else {
|
|
244
|
-
const
|
|
245
|
-
let
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
const c = this.prevCurrentValue;
|
|
245
|
+
let o = e.findIndex((f) => O(f, l, t));
|
|
246
|
+
if (o === -1 && !t && n && l) {
|
|
247
|
+
const f = y(l, n);
|
|
248
|
+
o = e.findIndex((I) => y(I, n) === f);
|
|
249
|
+
}
|
|
250
|
+
if (s && o !== -1) {
|
|
251
|
+
const f = this.base.getGroupedDataModernMode(e, s), I = y(l, n);
|
|
252
|
+
o = (h = f == null ? void 0 : f.findIndex((V) => y(V, n) === I)) != null ? h : o;
|
|
253
|
+
}
|
|
254
|
+
const x = !O(c, l, t);
|
|
248
255
|
if (r && i)
|
|
249
|
-
this.base.scrollToVirtualItem(i,
|
|
256
|
+
this.base.scrollToVirtualItem(i, o), this.prevCurrentOpened = !0;
|
|
250
257
|
else if (r && !i)
|
|
251
|
-
e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][s], this), this.base.scrollToItem(
|
|
252
|
-
else if (
|
|
253
|
-
this.base.scrollToItem(
|
|
254
|
-
else if (
|
|
255
|
-
let
|
|
256
|
-
if (s &&
|
|
257
|
-
const
|
|
258
|
-
|
|
258
|
+
e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][s], this), this.base.scrollToItem(o), this.prevCurrentOpened = !0;
|
|
259
|
+
else if (d && a && l && x)
|
|
260
|
+
this.base.scrollToItem(o);
|
|
261
|
+
else if (d && !l && !this.isScrolling) {
|
|
262
|
+
let f = this.getFocusedIndex();
|
|
263
|
+
if (s && f !== -1 && e.length > 0) {
|
|
264
|
+
const I = e[f][n];
|
|
265
|
+
f = this.base.getGroupedDataModernMode(e, s).findIndex((w) => w[n] === I);
|
|
259
266
|
}
|
|
260
|
-
this.base.scrollToItem(
|
|
267
|
+
this.base.scrollToItem(f);
|
|
261
268
|
}
|
|
262
269
|
}
|
|
263
270
|
r && this.input && this.input.focus(), this.prevCurrentValue = this.computedValue(), this.setValidity();
|
|
@@ -285,7 +292,7 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
285
292
|
dataItems: e = [],
|
|
286
293
|
dataItemKey: t
|
|
287
294
|
} = this.$props, i = this.computedValue();
|
|
288
|
-
return e.findIndex((s) =>
|
|
295
|
+
return e.findIndex((s) => O(s, i, t));
|
|
289
296
|
},
|
|
290
297
|
spanClassNames() {
|
|
291
298
|
const e = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
@@ -323,12 +330,12 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
323
330
|
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), this.valuePrimitive && this.findByFieldValue(this.valueField, e) || e;
|
|
324
331
|
},
|
|
325
332
|
findByFieldValue(e, t) {
|
|
326
|
-
const i = this.dataItems.findIndex((s) =>
|
|
333
|
+
const i = this.dataItems.findIndex((s) => y(s, e) === t);
|
|
327
334
|
return this.dataItems[i];
|
|
328
335
|
},
|
|
329
336
|
primitiveValue() {
|
|
330
337
|
const e = this.computedValue();
|
|
331
|
-
return this.valuePrimitive && e && typeof e == "object" ?
|
|
338
|
+
return this.valuePrimitive && e && typeof e == "object" ? y(e, this.valueField) : e;
|
|
332
339
|
},
|
|
333
340
|
validity() {
|
|
334
341
|
const e = this.$props.validationMessage !== void 0, t = !this.$props.required || this.computedValue() !== null && this.computedValue() !== "" && this.computedValue() !== void 0, i = this.$props.valid !== void 0 ? this.$props.valid : t;
|
|
@@ -342,30 +349,55 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
342
349
|
const {
|
|
343
350
|
dataItems: i = [],
|
|
344
351
|
virtual: s,
|
|
345
|
-
dataItemKey:
|
|
346
|
-
} = this.$props,
|
|
347
|
-
this.triggerOnChange(
|
|
352
|
+
dataItemKey: n
|
|
353
|
+
} = this.$props, d = s ? s.skip : 0, a = i[e - d], r = !O(a, this.computedValue(), n);
|
|
354
|
+
this.triggerOnChange(a, t), this.currentText !== void 0 && (t.data.currentText = void 0), r && this.base.triggerPageChangeCornerItems(a, t);
|
|
348
355
|
},
|
|
349
356
|
onNavigate(e, t) {
|
|
350
357
|
const {
|
|
351
358
|
dataItems: i = [],
|
|
352
359
|
virtual: s = {
|
|
353
360
|
skip: 0
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
361
|
+
},
|
|
362
|
+
groupField: n,
|
|
363
|
+
textField: d
|
|
364
|
+
} = this.$props, a = this.$props.filter ? this.$props.filter : this.currentText;
|
|
365
|
+
let r = this.getFocusedIndex();
|
|
366
|
+
const p = this.base.vs, g = this.computedValue();
|
|
367
|
+
this.suggested = "";
|
|
368
|
+
const l = n ? this.base.getGroupedDataModernMode(i, n) : i;
|
|
369
|
+
let h = r;
|
|
370
|
+
if (n && r !== -1 && r < i.length) {
|
|
371
|
+
const c = i[r];
|
|
372
|
+
c && (h = l.findIndex((o) => o[d] === c[d]));
|
|
373
|
+
}
|
|
374
|
+
if (r !== -1 && !S(g))
|
|
375
|
+
this.handleItemSelect(r, e);
|
|
376
|
+
else if (a === "" && !S(g))
|
|
359
377
|
this.handleItemSelect(0, e);
|
|
360
378
|
else {
|
|
361
|
-
let
|
|
362
|
-
const g = this.base.navigation.navigate({
|
|
379
|
+
let c = s.skip + h, o = this.base.navigation.navigate({
|
|
363
380
|
keyCode: t,
|
|
364
|
-
current:
|
|
365
|
-
max: (
|
|
381
|
+
current: c,
|
|
382
|
+
max: (p.enabled ? p.total : l.length) - 1,
|
|
366
383
|
min: 0
|
|
367
384
|
});
|
|
368
|
-
|
|
385
|
+
if (o !== void 0 && n) {
|
|
386
|
+
const x = t === k.down || t === k.right || t === k.pageDown || t === k.end ? 1 : -1;
|
|
387
|
+
let f = 0;
|
|
388
|
+
for (; f < l.length; ) {
|
|
389
|
+
const I = l[o - s.skip];
|
|
390
|
+
if (I && Object.keys(I).length === 1 && I[n] !== void 0) {
|
|
391
|
+
if (o += x, o < 0 || o >= l.length)
|
|
392
|
+
return;
|
|
393
|
+
} else {
|
|
394
|
+
const V = l[o - s.skip], w = i.findIndex((M) => M[d] === V[d]);
|
|
395
|
+
w !== -1 && this.handleItemSelect(w + s.skip, e);
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
f++;
|
|
399
|
+
}
|
|
400
|
+
} else o !== void 0 && this.handleItemSelect(o, e);
|
|
369
401
|
}
|
|
370
402
|
},
|
|
371
403
|
toggleBtnClick(e) {
|
|
@@ -376,45 +408,45 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
376
408
|
const {
|
|
377
409
|
dataItems: i = [],
|
|
378
410
|
textField: s,
|
|
379
|
-
allowCustom:
|
|
380
|
-
valuePrimitive:
|
|
381
|
-
} = this.$props,
|
|
382
|
-
let
|
|
411
|
+
allowCustom: n,
|
|
412
|
+
valuePrimitive: d
|
|
413
|
+
} = this.$props, a = this.isOpen, p = this.getSelectedItemText() === e ? this.index : ie(i, e, s), g = p !== -1;
|
|
414
|
+
let l;
|
|
383
415
|
if (this.suggested = "", g)
|
|
384
|
-
|
|
385
|
-
else if (
|
|
386
|
-
|
|
416
|
+
l = i[p];
|
|
417
|
+
else if (n)
|
|
418
|
+
l = s !== void 0 && !d ? {
|
|
387
419
|
[s]: e
|
|
388
420
|
} : e;
|
|
389
421
|
else
|
|
390
422
|
return this.selectFocusedItem(e, t);
|
|
391
|
-
this.triggerOnChange(
|
|
423
|
+
this.triggerOnChange(l, t), a && this.base.togglePopup(t), this.$props.filter === void 0 && this.currentText !== void 0 && (t.data.currentText = void 0), this.applyState(t);
|
|
392
424
|
},
|
|
393
425
|
applyValueOnRejectSuggestions(e, t) {
|
|
394
426
|
const {
|
|
395
427
|
dataItems: i = [],
|
|
396
428
|
textField: s,
|
|
397
|
-
allowCustom:
|
|
398
|
-
valuePrimitive:
|
|
399
|
-
} = this.$props,
|
|
400
|
-
if (this.suggested = "", e === r || e === "" && !
|
|
401
|
-
return
|
|
402
|
-
const
|
|
403
|
-
let
|
|
404
|
-
g ?
|
|
429
|
+
allowCustom: n,
|
|
430
|
+
valuePrimitive: d
|
|
431
|
+
} = this.$props, a = this.isOpen, r = this.getSelectedItemText();
|
|
432
|
+
if (this.suggested = "", e === r || e === "" && !S(r))
|
|
433
|
+
return a && !this.adaptiveState && this.base.togglePopup(t), this.applyState(t);
|
|
434
|
+
const p = ie(i, e, s, !0), g = p !== -1;
|
|
435
|
+
let l = null;
|
|
436
|
+
g ? l = i[p] : n && e && (s && !d ? l = {
|
|
405
437
|
[s]: e
|
|
406
|
-
} :
|
|
438
|
+
} : l = e), this.triggerOnChange(l, t), this.currentText !== void 0 && (t.data.currentText = void 0, this.base.filterChanged("", t)), a && !this.adaptiveState && this.base.togglePopup(t), this.applyState(t);
|
|
407
439
|
},
|
|
408
440
|
selectFocusedItem(e, t) {
|
|
409
441
|
const i = this.isOpen, {
|
|
410
442
|
dataItems: s = [],
|
|
411
|
-
textField:
|
|
412
|
-
virtual:
|
|
443
|
+
textField: n,
|
|
444
|
+
virtual: d = {
|
|
413
445
|
skip: 0
|
|
414
446
|
},
|
|
415
|
-
focusedItemIndex:
|
|
416
|
-
} = this.$props, r =
|
|
417
|
-
return
|
|
447
|
+
focusedItemIndex: a = te
|
|
448
|
+
} = this.$props, r = d.skip, p = e === "" && r === 0 ? 0 : a(s, e, n);
|
|
449
|
+
return p !== -1 ? this.handleItemSelect(p + r, t) : (this.triggerOnChange(null, t), this.currentText !== void 0 && (t.data.currentText = void 0)), i && this.base.togglePopup(t), this.applyState(t);
|
|
418
450
|
},
|
|
419
451
|
handleItemClick(e, t) {
|
|
420
452
|
this.base.handleItemClick(e, t), this.valueDuringOnChange = void 0;
|
|
@@ -433,27 +465,27 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
433
465
|
onInputKeyDown(e) {
|
|
434
466
|
this.isScrolling && (this.isScrolling = !1);
|
|
435
467
|
const t = e.keyCode, i = this.isOpen, s = this.base.initState();
|
|
436
|
-
if (s.event = e, !e.altKey && (t ===
|
|
468
|
+
if (s.event = e, !e.altKey && (t === k.up || t === k.down)) {
|
|
437
469
|
e.preventDefault(), this.onNavigate(s, t), this.applyState(s);
|
|
438
470
|
return;
|
|
439
471
|
}
|
|
440
|
-
const
|
|
472
|
+
const n = () => {
|
|
441
473
|
e.preventDefault(), this.base.togglePopup(s), this.applyState(s);
|
|
442
474
|
};
|
|
443
|
-
i ? e.altKey && t ===
|
|
475
|
+
i ? e.altKey && t === k.up ? n() : t === k.enter ? (e.preventDefault(), this.applyValueOnEnter(e.currentTarget.value, s)) : t === k.esc && (this.adaptiveState && this.toggleBtnClick(e), n()) : e.altKey && t === k.down ? n() : t === k.esc && this.applyValueOnRejectSuggestions(e.currentTarget.value, s);
|
|
444
476
|
},
|
|
445
477
|
inputOnChange(e) {
|
|
446
478
|
const t = this.base.initState();
|
|
447
479
|
t.event = e;
|
|
448
|
-
const i = this.isOpen, s = e.currentTarget,
|
|
480
|
+
const i = this.isOpen, s = e.currentTarget, n = s.value;
|
|
449
481
|
if (this.$props.suggest) {
|
|
450
|
-
const
|
|
451
|
-
let
|
|
452
|
-
|
|
453
|
-
const r =
|
|
454
|
-
r ||
|
|
482
|
+
const d = s.selectionEnd === n.length;
|
|
483
|
+
let a = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
484
|
+
S(a) || (a = y(this.computedValue(), this.$props.textField) || "");
|
|
485
|
+
const r = a && a === n, p = a && a.length > n.length;
|
|
486
|
+
r || p || !d ? this.suggested = "" : this.suggestValue(n);
|
|
455
487
|
}
|
|
456
|
-
this.$props.filter === void 0 && (t.data.currentText =
|
|
488
|
+
this.$props.filter === void 0 && (t.data.currentText = n), this.currentFocusedItem !== void 0 && (t.data.focusedItem = void 0), i || this.base.togglePopup(t), this.base.filterChanged(n, t), this.$props.filterable && (t.data.group = void 0), this.applyState(t);
|
|
457
489
|
},
|
|
458
490
|
clearButtonClick(e) {
|
|
459
491
|
const t = this.base.initState();
|
|
@@ -464,29 +496,36 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
464
496
|
dataItems: t = [],
|
|
465
497
|
textField: i,
|
|
466
498
|
dataItemKey: s,
|
|
467
|
-
virtual:
|
|
499
|
+
virtual: n = {
|
|
468
500
|
skip: 0
|
|
469
501
|
},
|
|
470
|
-
focusedItemIndex:
|
|
471
|
-
} = this.$props,
|
|
472
|
-
|
|
502
|
+
focusedItemIndex: d = te
|
|
503
|
+
} = this.$props, a = this.$props.filter ? this.$props.filter : this.currentText;
|
|
504
|
+
if (S(e) && a === void 0) {
|
|
505
|
+
let r = t.findIndex((p) => O(p, e, s));
|
|
506
|
+
if (r === -1 && !s && i) {
|
|
507
|
+
const p = y(e, i);
|
|
508
|
+
r = t.findIndex((g) => y(g, i) === p);
|
|
509
|
+
}
|
|
510
|
+
return r;
|
|
511
|
+
} else return a ? d(t, a, i) : n.skip === 0 ? 0 : -1;
|
|
473
512
|
},
|
|
474
513
|
suggestValue(e) {
|
|
475
514
|
const {
|
|
476
515
|
dataItems: t,
|
|
477
516
|
textField: i
|
|
478
517
|
} = this.$props;
|
|
479
|
-
this.suggested =
|
|
518
|
+
this.suggested = we(e, t, i);
|
|
480
519
|
},
|
|
481
520
|
setValidity() {
|
|
482
521
|
this.input && this.input.setCustomValidity && this.input.setCustomValidity(this.validity().valid ? "" : this.$props.validationMessage || We);
|
|
483
522
|
},
|
|
484
523
|
compareValues(e, t) {
|
|
485
|
-
return this.$props.valuePrimitive && (typeof e != "object" || e === null) && (typeof t != "object" || t === null) ? e === t :
|
|
524
|
+
return this.$props.valuePrimitive && (typeof e != "object" || e === null) && (typeof t != "object" || t === null) ? e === t : O(e, t, this.$props.dataItemKey);
|
|
486
525
|
},
|
|
487
526
|
triggerOnChange(e, t) {
|
|
488
527
|
const i = this.computedValue();
|
|
489
|
-
!
|
|
528
|
+
!S(i) && !S(e) || this.compareValues(i, e) || (this.$props.value === void 0 && (this.currentValue = e), this.valueDuringOnChange = e, t.events.push({
|
|
490
529
|
type: "change"
|
|
491
530
|
}));
|
|
492
531
|
},
|
|
@@ -508,29 +547,40 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
508
547
|
} = this.base;
|
|
509
548
|
t.scrollHandler(e);
|
|
510
549
|
const s = this.base.initState(), {
|
|
511
|
-
groupField:
|
|
550
|
+
groupField: n
|
|
512
551
|
} = this.$props;
|
|
513
552
|
let {
|
|
514
|
-
dataItems:
|
|
515
|
-
} = this.$props,
|
|
516
|
-
if (!
|
|
553
|
+
dataItems: d = []
|
|
554
|
+
} = this.$props, a;
|
|
555
|
+
if (!n || !d.length)
|
|
517
556
|
return;
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
557
|
+
const p = e.target.scrollTop - t.skip * (t.itemHeight || 0);
|
|
558
|
+
if (n) {
|
|
559
|
+
d = this.base.getGroupedDataModernMode(d, n), a = d[0][n];
|
|
560
|
+
let g = 0, l = 0, h = 0;
|
|
561
|
+
if (i && !t.enabled) {
|
|
562
|
+
const c = i.querySelector(".k-list-item"), o = i.querySelector(".k-list-group-item");
|
|
563
|
+
l = (c == null ? void 0 : c.offsetHeight) || 0, h = (o == null ? void 0 : o.offsetHeight) || l;
|
|
564
|
+
} else
|
|
565
|
+
l = t.itemHeight || 0, h = l;
|
|
566
|
+
for (let c = 0; c < d.length; c++) {
|
|
567
|
+
const o = d[c], x = o && Object.keys(o).length === 1 && o[n] !== void 0, f = x ? h : l;
|
|
568
|
+
if (x && g <= p && (a = o[n]), g += f, g > p)
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
a !== this.group && (s.data.group = a, this.applyState(s));
|
|
523
573
|
},
|
|
524
574
|
getInputText(e, t) {
|
|
525
|
-
return
|
|
575
|
+
return S(e) && e !== "" ? String(e) : S(t) ? String(t) : "";
|
|
526
576
|
},
|
|
527
577
|
getSelectedItemText() {
|
|
528
578
|
const {
|
|
529
579
|
textField: e,
|
|
530
580
|
valuePrimitive: t
|
|
531
581
|
} = this.$props, i = this.computedValue();
|
|
532
|
-
if (
|
|
533
|
-
return t ? i && typeof i == "object" ?
|
|
582
|
+
if (S(i))
|
|
583
|
+
return t ? i && typeof i == "object" ? y(i, e) : typeof i == "string" ? i !== "" ? i : void 0 : typeof i == "number" || typeof i == "boolean" ? String(i) : void 0 : y(i, e);
|
|
534
584
|
}
|
|
535
585
|
},
|
|
536
586
|
render() {
|
|
@@ -539,45 +589,45 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
539
589
|
disabled: t,
|
|
540
590
|
clearButton: i,
|
|
541
591
|
label: s,
|
|
542
|
-
textField:
|
|
543
|
-
className:
|
|
544
|
-
style:
|
|
592
|
+
textField: n,
|
|
593
|
+
className: d,
|
|
594
|
+
style: a,
|
|
545
595
|
loading: r,
|
|
546
|
-
icon:
|
|
596
|
+
icon: p,
|
|
547
597
|
svgIcon: g,
|
|
548
|
-
iconClassName:
|
|
549
|
-
virtual:
|
|
550
|
-
size:
|
|
551
|
-
fillMode:
|
|
552
|
-
rounded:
|
|
553
|
-
adaptiveTitle:
|
|
554
|
-
header:
|
|
555
|
-
footer:
|
|
556
|
-
groupStickyHeaderItemRender:
|
|
557
|
-
placeholder:
|
|
598
|
+
iconClassName: l,
|
|
599
|
+
virtual: h,
|
|
600
|
+
size: c,
|
|
601
|
+
fillMode: o,
|
|
602
|
+
rounded: x,
|
|
603
|
+
adaptiveTitle: f,
|
|
604
|
+
header: I,
|
|
605
|
+
footer: V,
|
|
606
|
+
groupStickyHeaderItemRender: w,
|
|
607
|
+
placeholder: M,
|
|
558
608
|
inputAttributes: ne
|
|
559
609
|
} = this.$props;
|
|
560
|
-
const ae = this.currentFocused, le = !this.$props.validityStyles || this.validity().valid, P = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, q = this.getSelectedItemText(), U = this.getInputText(P, q),
|
|
610
|
+
const ae = this.currentFocused, le = !this.$props.validityStyles || this.validity().valid, P = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, q = this.getSelectedItemText(), U = this.getInputText(P, q), E = this.computedValue(), oe = this.$props.valuePrimitive ? !!this.findByFieldValue(this.valueField, E) || this.$props.allowCustom && S(E) && E !== "" : S(E), re = i && (!!U || oe), T = this.base, C = T.vs, K = this.$props.id || this.inputId, N = Object.assign({}, {
|
|
561
611
|
animate: !0,
|
|
562
612
|
height: "200px"
|
|
563
|
-
}, this.$props.popupSettings), de = Le(this).toLanguageString(se, je[se]),
|
|
564
|
-
|
|
565
|
-
const ue = (
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
-
}, pe = () => [
|
|
613
|
+
}, this.$props.popupSettings), de = Le(this).toLanguageString(se, je[se]), H = this.isOpen, R = this.adaptiveState;
|
|
614
|
+
C.enabled = h !== void 0, h !== void 0 && (C.skip = h.skip, C.total = h.total, C.pageSize = h.pageSize), this.group === void 0 && this.$props.groupField !== void 0 && (this.group = y(this.$props.dataItems[0], this.$props.groupField));
|
|
615
|
+
const ue = (m) => {
|
|
616
|
+
const v = this.base.initState();
|
|
617
|
+
v.event = m;
|
|
618
|
+
const b = m.event.target.value;
|
|
619
|
+
v.data.text = b, this.base.filterChanged(b, v), this.applyState(v);
|
|
620
|
+
}, pe = () => [u("div", {
|
|
571
621
|
class: "k-actionsheet-titlebar-group k-hbox"
|
|
572
|
-
}, [
|
|
622
|
+
}, [u("div", {
|
|
573
623
|
class: "k-actionsheet-title"
|
|
574
|
-
}, [
|
|
624
|
+
}, [u("div", {
|
|
575
625
|
class: "k-text-center"
|
|
576
|
-
}, [
|
|
626
|
+
}, [f]), M && u("div", {
|
|
577
627
|
class: "k-actionsheet-subtitle k-text-center"
|
|
578
|
-
}, [
|
|
628
|
+
}, [M])]), u("div", {
|
|
579
629
|
class: "k-actionsheet-actions"
|
|
580
|
-
}, [
|
|
630
|
+
}, [u(ee, {
|
|
581
631
|
tabIndex: 5,
|
|
582
632
|
"aria-label": "Cancel",
|
|
583
633
|
"aria-disabled": "false",
|
|
@@ -586,31 +636,31 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
586
636
|
onClick: this.toggleBtnClick,
|
|
587
637
|
icon: "x",
|
|
588
638
|
svgIcon: Ee
|
|
589
|
-
}, null)])]),
|
|
639
|
+
}, null)])]), u("div", {
|
|
590
640
|
class: "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
591
|
-
}, [me.call(this)])], ce =
|
|
592
|
-
const
|
|
593
|
-
return
|
|
641
|
+
}, [me.call(this)])], ce = F.call(this, pe, B.call(this)), he = () => {
|
|
642
|
+
const m = T.getTemplateDef.call(this, I, G), v = T.getTemplateDef.call(this, V, G), b = F.call(this, w, B.call(this)), $ = this.$props.dataItems || [];
|
|
643
|
+
return u("div", {
|
|
594
644
|
class: "k-list-container"
|
|
595
|
-
}, [
|
|
645
|
+
}, [m && u("div", {
|
|
596
646
|
class: "k-list-header"
|
|
597
|
-
}, [
|
|
598
|
-
class:
|
|
599
|
-
[`k-list-${W[
|
|
647
|
+
}, [m]), u("div", {
|
|
648
|
+
class: j("k-list", {
|
|
649
|
+
[`k-list-${W[c] || c}`]: R ? !1 : c,
|
|
600
650
|
"k-list-lg": !!R,
|
|
601
|
-
"k-virtual-list":
|
|
651
|
+
"k-virtual-list": C.enabled
|
|
602
652
|
})
|
|
603
|
-
}, [
|
|
653
|
+
}, [I && u("div", {
|
|
604
654
|
class: "k-list-header"
|
|
605
|
-
}, [
|
|
655
|
+
}, [I]), this.group && $.length !== 0 && u(Q, {
|
|
606
656
|
group: this.group,
|
|
607
|
-
render:
|
|
608
|
-
}, null), Y.call(this),
|
|
657
|
+
render: b
|
|
658
|
+
}, null), Y.call(this), v && u("div", {
|
|
609
659
|
class: "k-list-footer"
|
|
610
|
-
}, [
|
|
611
|
-
}, fe =
|
|
612
|
-
return
|
|
613
|
-
expand:
|
|
660
|
+
}, [v])])]);
|
|
661
|
+
}, fe = F.call(this, he, B.call(this)), ge = function() {
|
|
662
|
+
return u(Ke, {
|
|
663
|
+
expand: H,
|
|
614
664
|
animation: !0,
|
|
615
665
|
animationStyles: this.animationStyles,
|
|
616
666
|
className: this.classNameAdaptive,
|
|
@@ -621,174 +671,174 @@ const We = "Please enter a valid value!", ut = /* @__PURE__ */ xe({
|
|
|
621
671
|
navigatableElements: ["input.k-input-inner", ".k-actionsheet-actions > button"]
|
|
622
672
|
}, null);
|
|
623
673
|
}, me = function() {
|
|
624
|
-
const
|
|
625
|
-
return
|
|
674
|
+
const v = this.base.initState().data.text;
|
|
675
|
+
return u(ze, {
|
|
626
676
|
adaptiveMode: !0,
|
|
627
|
-
value:
|
|
677
|
+
value: v,
|
|
628
678
|
ref: "filterInput",
|
|
629
|
-
onChange: (
|
|
679
|
+
onChange: (b) => ue(b),
|
|
630
680
|
onKeydown: this.onInputKeyDown,
|
|
631
681
|
size: this.$props.size,
|
|
632
682
|
rounded: this.$props.rounded,
|
|
633
683
|
fillMode: this.$props.fillMode
|
|
634
684
|
}, null);
|
|
635
685
|
}, Y = function() {
|
|
636
|
-
let
|
|
686
|
+
let m;
|
|
637
687
|
const {
|
|
638
|
-
dataItemKey:
|
|
639
|
-
groupField:
|
|
688
|
+
dataItemKey: v,
|
|
689
|
+
groupField: b
|
|
640
690
|
} = this.$props;
|
|
641
|
-
let
|
|
642
|
-
const
|
|
643
|
-
|
|
691
|
+
let $ = this.$props.dataItems || [];
|
|
692
|
+
const D = F.call(this, this.$props.itemRender, B.call(this)), A = F.call(this, this.$props.groupHeaderItemRender, B.call(this)), z = F.call(this, this.$props.listNoDataRender, B.call(this));
|
|
693
|
+
h || (h = {
|
|
644
694
|
skip: 0
|
|
645
695
|
});
|
|
646
|
-
const
|
|
647
|
-
return
|
|
648
|
-
id:
|
|
649
|
-
show:
|
|
650
|
-
dataItems:
|
|
651
|
-
focusedIndex:
|
|
696
|
+
const L = h.skip, Se = `translateY(${C.translate}px)`, ye = H ? this.getFocusedIndex() : void 0, ke = S(P) && P !== q ? null : this.computedValue();
|
|
697
|
+
return b && ($ = this.base.getGroupedDataModernMode($, b)), u(He, {
|
|
698
|
+
id: T.listBoxId,
|
|
699
|
+
show: H,
|
|
700
|
+
dataItems: $,
|
|
701
|
+
focusedIndex: ye,
|
|
652
702
|
value: ke,
|
|
653
|
-
textField:
|
|
654
|
-
valueField:
|
|
655
|
-
optionsGuid:
|
|
703
|
+
textField: n,
|
|
704
|
+
valueField: v,
|
|
705
|
+
optionsGuid: T.guid,
|
|
656
706
|
ref: "list",
|
|
657
707
|
wrapperStyle: {
|
|
658
|
-
maxHeight: R ? void 0 :
|
|
708
|
+
maxHeight: R ? void 0 : N.height
|
|
659
709
|
},
|
|
660
|
-
wrapperCssClass:
|
|
710
|
+
wrapperCssClass: j("k-list-content", {
|
|
661
711
|
"k-list-scroller": !this.$props.virtual
|
|
662
712
|
}),
|
|
663
|
-
listStyle:
|
|
713
|
+
listStyle: C.enabled ? {
|
|
664
714
|
transform: Se
|
|
665
715
|
} : void 0,
|
|
666
716
|
key: "listkey",
|
|
667
|
-
skip:
|
|
717
|
+
skip: L,
|
|
668
718
|
onListclick: this.handleItemClick,
|
|
669
|
-
itemRender:
|
|
670
|
-
groupHeaderItemRender:
|
|
719
|
+
itemRender: D,
|
|
720
|
+
groupHeaderItemRender: A,
|
|
671
721
|
noDataRender: z,
|
|
672
|
-
groupField:
|
|
722
|
+
groupField: b,
|
|
673
723
|
onScroll: this.onScroll
|
|
674
|
-
},
|
|
675
|
-
default: () => [
|
|
724
|
+
}, _e(m = ve.call(this)) ? m : {
|
|
725
|
+
default: () => [m]
|
|
676
726
|
});
|
|
677
727
|
}, ve = function() {
|
|
678
|
-
return
|
|
728
|
+
return C.enabled && u("div", {
|
|
679
729
|
ref: "scrollElement",
|
|
680
730
|
key: "scrollElementKey"
|
|
681
731
|
}, null);
|
|
682
732
|
}, be = function() {
|
|
683
|
-
const
|
|
684
|
-
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group =
|
|
733
|
+
const m = F.call(this, this.$props.groupStickyHeaderItemRender, B.call(this)), v = T.getTemplateDef.call(this, I), b = T.getTemplateDef.call(this, V), $ = this.$props.dataItems || [];
|
|
734
|
+
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = y($[0], this.$props.groupField)), u(Me, {
|
|
685
735
|
ref: "container",
|
|
686
|
-
onMousedown: (
|
|
736
|
+
onMousedown: (D) => D.preventDefault(),
|
|
687
737
|
width: this.popupWidth,
|
|
688
738
|
popupSettings: {
|
|
689
|
-
...
|
|
739
|
+
...N,
|
|
690
740
|
anchor: this.anchor,
|
|
691
|
-
show:
|
|
692
|
-
popupClass:
|
|
693
|
-
[`k-list-${W[
|
|
741
|
+
show: H,
|
|
742
|
+
popupClass: j(N.popupClass, "k-list", {
|
|
743
|
+
[`k-list-${W[c] || c}`]: c,
|
|
694
744
|
"k-virtual-list": this.base.vs.enabled
|
|
695
745
|
}),
|
|
696
|
-
className:
|
|
746
|
+
className: j("k-list-container", N.className)
|
|
697
747
|
},
|
|
698
748
|
dir: e !== void 0 ? e : this.base.dirCalculated
|
|
699
749
|
}, {
|
|
700
|
-
default: () => [
|
|
750
|
+
default: () => [v && u("div", {
|
|
701
751
|
class: "k-list-header"
|
|
702
|
-
}, [
|
|
752
|
+
}, [v]), this.group && $.length !== 0 && u(Q, {
|
|
703
753
|
group: this.group,
|
|
704
|
-
render:
|
|
705
|
-
}, null), Y.call(this),
|
|
754
|
+
render: m
|
|
755
|
+
}, null), Y.call(this), b && u("div", {
|
|
706
756
|
class: "k-list-footer"
|
|
707
|
-
}, [
|
|
757
|
+
}, [b])]
|
|
708
758
|
});
|
|
709
|
-
},
|
|
759
|
+
}, Ie = function(m, v) {
|
|
710
760
|
const {
|
|
711
|
-
tabIndex:
|
|
712
|
-
dataItems:
|
|
713
|
-
dataItemKey:
|
|
761
|
+
tabIndex: b,
|
|
762
|
+
dataItems: $ = [],
|
|
763
|
+
dataItemKey: D
|
|
714
764
|
} = this.$props;
|
|
715
|
-
|
|
765
|
+
h || (h = {
|
|
716
766
|
skip: 0
|
|
717
767
|
});
|
|
718
|
-
const
|
|
719
|
-
return this.suggested && !
|
|
720
|
-
id:
|
|
721
|
-
placeholder:
|
|
722
|
-
tabIndex:
|
|
768
|
+
const A = this.computedValue(), z = Math.max(0, $.findIndex((L) => O(L, A, D)));
|
|
769
|
+
return this.suggested && !O(this.valueOnDidUpdate, A, D) && (this.suggested = ""), u(De, {
|
|
770
|
+
id: v,
|
|
771
|
+
placeholder: M,
|
|
772
|
+
tabIndex: b || void 0,
|
|
723
773
|
accessKey: this.$props.accessKey,
|
|
724
|
-
value:
|
|
774
|
+
value: m + this.suggested,
|
|
725
775
|
suggestedText: this.suggested,
|
|
726
|
-
ref: (
|
|
727
|
-
this.inputRef =
|
|
776
|
+
ref: (L) => {
|
|
777
|
+
this.inputRef = L;
|
|
728
778
|
},
|
|
729
779
|
onKeydown: this.onInputKeyDown,
|
|
730
780
|
onChange: this.inputOnChange,
|
|
731
781
|
onFocus: this.base.handleFocus,
|
|
732
782
|
onBlur: this.handleBlur,
|
|
733
783
|
disabled: t,
|
|
734
|
-
expanded:
|
|
784
|
+
expanded: H,
|
|
735
785
|
owns: this.base.listBoxId,
|
|
736
|
-
activedescendant: this.base.guid + "-" + (z +
|
|
786
|
+
activedescendant: this.base.guid + "-" + (z + h.skip),
|
|
737
787
|
ariaLabelledBy: this.$props.ariaLabelledBy,
|
|
738
788
|
ariaDescribedBy: this.$props.ariaDescribedBy,
|
|
739
789
|
ariaLabel: this.$props.ariaLabel,
|
|
740
790
|
inputAttributes: ne
|
|
741
791
|
}, null);
|
|
742
|
-
}, J = [
|
|
743
|
-
return
|
|
744
|
-
class:
|
|
745
|
-
[`k-input-${W[
|
|
746
|
-
[`k-rounded-${
|
|
747
|
-
[`k-input-${
|
|
792
|
+
}, J = [G(function() {
|
|
793
|
+
return u("span", {
|
|
794
|
+
class: j("k-combobox k-input", {
|
|
795
|
+
[`k-input-${W[c] || c}`]: c,
|
|
796
|
+
[`k-rounded-${Ge[x] || x}`]: x,
|
|
797
|
+
[`k-input-${o}`]: o,
|
|
748
798
|
"k-invalid": !le,
|
|
749
799
|
"k-loading": r,
|
|
750
800
|
"k-required": this.required,
|
|
751
801
|
"k-disabled": t,
|
|
752
802
|
"k-focus": ae && !t
|
|
753
|
-
},
|
|
754
|
-
ref:
|
|
803
|
+
}, d),
|
|
804
|
+
ref: Fe(this, "kendoAnchor"),
|
|
755
805
|
style: s ? {
|
|
756
|
-
...
|
|
806
|
+
...a,
|
|
757
807
|
width: void 0
|
|
758
|
-
} :
|
|
808
|
+
} : a,
|
|
759
809
|
dir: e
|
|
760
|
-
}, [
|
|
810
|
+
}, [Ie.call(this, U || "", K), re && !r && u(Re, {
|
|
761
811
|
onClearclick: this.clearButtonClick,
|
|
762
812
|
key: "clearbutton"
|
|
763
|
-
}, null), r &&
|
|
813
|
+
}, null), r && u(Be, {
|
|
764
814
|
name: "loading",
|
|
765
815
|
class: "k-input-loading-icon",
|
|
766
816
|
key: "loading"
|
|
767
|
-
}, null),
|
|
817
|
+
}, null), u(ee, {
|
|
768
818
|
type: "button",
|
|
769
819
|
tabIndex: -1,
|
|
770
820
|
"aria-label": de,
|
|
771
|
-
size:
|
|
772
|
-
fillMode:
|
|
821
|
+
size: c,
|
|
822
|
+
fillMode: o,
|
|
773
823
|
rounded: null,
|
|
774
824
|
class: "k-input-button",
|
|
775
|
-
icon:
|
|
825
|
+
icon: p || "caret-alt-down",
|
|
776
826
|
svgIcon: g || Ne,
|
|
777
|
-
iconClass:
|
|
827
|
+
iconClass: l,
|
|
778
828
|
onClick: this.toggleBtnClick,
|
|
779
|
-
onMousedown: (
|
|
829
|
+
onMousedown: (m) => m.preventDefault()
|
|
780
830
|
}, null), !R && be.call(this)]);
|
|
781
831
|
}.call(this), {
|
|
782
832
|
...this.$attrs
|
|
783
833
|
}), R && ge.call(this)];
|
|
784
|
-
return s ?
|
|
834
|
+
return s ? u("span", {
|
|
785
835
|
class: this.spanClassNames,
|
|
786
836
|
onFocusin: this.handleFocus,
|
|
787
837
|
dir: this.$props.dir
|
|
788
|
-
}, [J, this.$props.label ? K ?
|
|
838
|
+
}, [J, this.$props.label ? K ? u("label", {
|
|
789
839
|
for: K,
|
|
790
840
|
class: "k-floating-label"
|
|
791
|
-
}, [this.$props.label]) :
|
|
841
|
+
}, [this.$props.label]) : u("span", {
|
|
792
842
|
class: "k-label"
|
|
793
843
|
}, [this.$props.label]) : null]) : J;
|
|
794
844
|
}
|