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