@progress/kendo-vue-dropdowns 8.0.0-develop.4 → 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.
@@ -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 _, createVNode as o, ref as G, inject as $e, isVNode as Ce } from "vue";
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 $, 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";
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 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";
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 Re } from "../common/List.mjs";
17
- import { ClearButton as He } from "../common/ClearButton.mjs";
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: _e
27
- } = Fe;
28
- function Ge(e) {
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 = G(null), t = G(null), i = G(null), s = $e("kendoLocalizationService", {});
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 f;
233
+ var h;
234
234
  const {
235
235
  dataItems: e = [],
236
236
  dataItemKey: t,
237
237
  virtual: i,
238
238
  groupField: s,
239
- textField: a
240
- } = 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();
241
- 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)
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 m = this.prevCurrentValue;
245
- let y = e.findIndex((F) => I(F, d, t));
246
- s && (y = (f = this.base.getGroupedDataModernMode(e, s)) == null ? void 0 : f.indexOf(d));
247
- const D = !I(m, d, t);
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, y), this.prevCurrentOpened = !0;
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(y), this.prevCurrentOpened = !0;
252
- else if (l && n && d && D)
253
- this.base.scrollToItem(y);
254
- else if (l && !d && !this.isScrolling) {
255
- let F = 0;
256
- if (s && this.getFocusedIndex() !== -1 && e.length > 0) {
257
- const T = e[this.getFocusedIndex()][a], w = this.base.getGroupedDataModernMode(e, s), A = w.findIndex((k) => k[a] === T);
258
- F = w.slice(0, A).filter((k) => Object.keys(k).length === 1).length;
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(this.getFocusedIndex() + F);
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) => I(s, i, t));
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) => V(s, e) === t);
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" ? V(e, this.valueField) : e;
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: a
346
- } = this.$props, l = s ? s.skip : 0, n = i[e - l], r = !I(n, this.computedValue(), a);
347
- this.triggerOnChange(n, t), this.currentText !== void 0 && (t.data.currentText = void 0), r && this.base.triggerPageChangeCornerItems(n, t);
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
- } = this.$props, a = this.$props.filter ? this.$props.filter : this.currentText, l = this.getFocusedIndex(), n = this.base.vs, r = this.computedValue();
356
- if (this.suggested = "", l !== -1 && !v(r))
357
- this.handleItemSelect(l, e);
358
- else if (a === "")
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 u = s.skip + l;
362
- const g = this.base.navigation.navigate({
379
+ let c = s.skip + h, o = this.base.navigation.navigate({
363
380
  keyCode: t,
364
- current: u,
365
- max: (n.enabled ? n.total : i.length) - 1,
381
+ current: c,
382
+ max: (p.enabled ? p.total : l.length) - 1,
366
383
  min: 0
367
384
  });
368
- g !== void 0 && this.handleItemSelect(g, e);
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: a,
380
- valuePrimitive: l
381
- } = this.$props, n = this.isOpen, u = this.getSelectedItemText() === e ? this.index : ie(i, e, s), g = u !== -1;
382
- let d;
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
- d = i[u];
385
- else if (a)
386
- d = s !== void 0 && !l ? {
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(d, t), n && this.base.togglePopup(t), this.$props.filter === void 0 && this.currentText !== void 0 && (t.data.currentText = void 0), this.applyState(t);
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: a,
398
- valuePrimitive: l
399
- } = this.$props, n = this.isOpen, r = this.getSelectedItemText();
400
- if (this.suggested = "", e === r || e === "" && !v(r))
401
- return n && !this.adaptiveState && this.base.togglePopup(t), this.applyState(t);
402
- const u = ie(i, e, s, !0), g = u !== -1;
403
- let d = null;
404
- g ? d = i[u] : a && e && (s && !l ? d = {
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
- } : 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);
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: a,
412
- virtual: l = {
443
+ textField: n,
444
+ virtual: d = {
413
445
  skip: 0
414
446
  },
415
- focusedItemIndex: n = te
416
- } = this.$props, r = l.skip, u = e === "" && r === 0 ? 0 : n(s, e, a);
417
- 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);
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 === O.up || t === O.down)) {
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 a = () => {
472
+ const n = () => {
441
473
  e.preventDefault(), this.base.togglePopup(s), this.applyState(s);
442
474
  };
443
- 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);
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, a = s.value;
480
+ const i = this.isOpen, s = e.currentTarget, n = s.value;
449
481
  if (this.$props.suggest) {
450
- const l = s.selectionEnd === a.length;
451
- let n = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
452
- v(n) || (n = V(this.computedValue(), this.$props.textField) || "");
453
- const r = n && n === a, u = n && n.length > a.length;
454
- r || u || !l ? this.suggested = "" : this.suggestValue(a);
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 = 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);
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: a = {
499
+ virtual: n = {
468
500
  skip: 0
469
501
  },
470
- focusedItemIndex: l = te
471
- } = this.$props, n = this.$props.filter ? this.$props.filter : this.currentText;
472
- return v(e) && n === void 0 ? t.findIndex((r) => I(r, e, s)) : n ? l(t, n, i) : a.skip === 0 ? 0 : -1;
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 = De(e, t, i);
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 : I(e, t, this.$props.dataItemKey);
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
- !v(i) && !v(e) || this.compareValues(i, e) || (this.$props.value === void 0 && (this.currentValue = e), this.valueDuringOnChange = e, t.events.push({
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: a
550
+ groupField: n
512
551
  } = this.$props;
513
552
  let {
514
- dataItems: l = []
515
- } = this.$props, n;
516
- if (!a || !l.length)
553
+ dataItems: d = []
554
+ } = this.$props, a;
555
+ if (!n || !d.length)
517
556
  return;
518
- const r = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : i ? i.children[0].offsetHeight : 0), g = e.target.scrollTop - t.skip * r;
519
- a && (l = this.base.getGroupedDataModernMode(l, a), n = l[0][a]);
520
- for (let d = 1; d < l.length && !(r * d > g); d++)
521
- l[d] && l[d][a] && (n = l[d][a]);
522
- n !== this.group && (s.data.group = n, this.applyState(s));
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 v(e) && e !== "" ? String(e) : v(t) ? String(t) : "";
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 (v(i))
533
- 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);
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: a,
543
- className: l,
544
- style: n,
592
+ textField: n,
593
+ className: d,
594
+ style: a,
545
595
  loading: r,
546
- icon: u,
596
+ icon: p,
547
597
  svgIcon: g,
548
- iconClassName: d,
549
- virtual: f,
550
- size: m,
551
- fillMode: y,
552
- rounded: D,
553
- adaptiveTitle: F,
554
- header: T,
555
- footer: w,
556
- groupStickyHeaderItemRender: A,
557
- placeholder: k,
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), 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({}, {
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]), M = this.isOpen, R = this.adaptiveState;
564
- 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));
565
- const ue = (p) => {
566
- const c = this.base.initState();
567
- c.event = p;
568
- const h = p.event.target.value;
569
- c.data.text = h, this.base.filterChanged(h, c), this.applyState(c);
570
- }, pe = () => [o("div", {
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
- }, [o("div", {
622
+ }, [u("div", {
573
623
  class: "k-actionsheet-title"
574
- }, [o("div", {
624
+ }, [u("div", {
575
625
  class: "k-text-center"
576
- }, [F]), k && o("div", {
626
+ }, [f]), M && u("div", {
577
627
  class: "k-actionsheet-subtitle k-text-center"
578
- }, [k])]), o("div", {
628
+ }, [M])]), u("div", {
579
629
  class: "k-actionsheet-actions"
580
- }, [o(ee, {
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)])]), o("div", {
639
+ }, null)])]), u("div", {
590
640
  class: "k-actionsheet-titlebar-group k-actionsheet-filter"
591
- }, [me.call(this)])], ce = $.call(this, pe, C.call(this)), he = () => {
592
- const p = x.getTemplateDef.call(this, T, _), c = x.getTemplateDef.call(this, w, _), h = $.call(this, A, C.call(this)), b = this.$props.dataItems || [];
593
- return o("div", {
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
- }, [p && o("div", {
645
+ }, [m && u("div", {
596
646
  class: "k-list-header"
597
- }, [p]), o("div", {
598
- class: L("k-list", {
599
- [`k-list-${W[m] || m}`]: R ? !1 : m,
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": S.enabled
651
+ "k-virtual-list": C.enabled
602
652
  })
603
- }, [T && o("div", {
653
+ }, [I && u("div", {
604
654
  class: "k-list-header"
605
- }, [T]), this.group && b.length !== 0 && o(Q, {
655
+ }, [I]), this.group && $.length !== 0 && u(Q, {
606
656
  group: this.group,
607
- render: h
608
- }, null), Y.call(this), c && o("div", {
657
+ render: b
658
+ }, null), Y.call(this), v && u("div", {
609
659
  class: "k-list-footer"
610
- }, [c])])]);
611
- }, fe = $.call(this, he, C.call(this)), ge = function() {
612
- return o(Ke, {
613
- expand: M,
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 c = this.base.initState().data.text;
625
- return o(ze, {
674
+ const v = this.base.initState().data.text;
675
+ return u(ze, {
626
676
  adaptiveMode: !0,
627
- value: c,
677
+ value: v,
628
678
  ref: "filterInput",
629
- onChange: (h) => ue(h),
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 p;
686
+ let m;
637
687
  const {
638
- dataItemKey: c,
639
- groupField: h
688
+ dataItemKey: v,
689
+ groupField: b
640
690
  } = this.$props;
641
- let b = this.$props.dataItems || [];
642
- 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));
643
- f || (f = {
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 H = f.skip, Se = `translateY(${S.translate}px)`, Ie = M ? this.getFocusedIndex() : void 0, ke = v(P) && P !== q ? null : this.computedValue();
647
- return h && (b = this.base.getGroupedDataModernMode(b, h)), o(Re, {
648
- id: x.listBoxId,
649
- show: M,
650
- dataItems: b,
651
- focusedIndex: Ie,
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: a,
654
- valueField: c,
655
- optionsGuid: x.guid,
703
+ textField: n,
704
+ valueField: v,
705
+ optionsGuid: T.guid,
656
706
  ref: "list",
657
707
  wrapperStyle: {
658
- maxHeight: R ? void 0 : E.height
708
+ maxHeight: R ? void 0 : N.height
659
709
  },
660
- wrapperCssClass: L("k-list-content", {
710
+ wrapperCssClass: j("k-list-content", {
661
711
  "k-list-scroller": !this.$props.virtual
662
712
  }),
663
- listStyle: S.enabled ? {
713
+ listStyle: C.enabled ? {
664
714
  transform: Se
665
715
  } : void 0,
666
716
  key: "listkey",
667
- skip: H,
717
+ skip: L,
668
718
  onListclick: this.handleItemClick,
669
- itemRender: B,
670
- groupHeaderItemRender: N,
719
+ itemRender: D,
720
+ groupHeaderItemRender: A,
671
721
  noDataRender: z,
672
- groupField: h,
722
+ groupField: b,
673
723
  onScroll: this.onScroll
674
- }, Ge(p = ve.call(this)) ? p : {
675
- default: () => [p]
724
+ }, _e(m = ve.call(this)) ? m : {
725
+ default: () => [m]
676
726
  });
677
727
  }, ve = function() {
678
- return S.enabled && o("div", {
728
+ return C.enabled && u("div", {
679
729
  ref: "scrollElement",
680
730
  key: "scrollElementKey"
681
731
  }, null);
682
732
  }, be = function() {
683
- 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 || [];
684
- return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = V(b[0], this.$props.groupField)), o(Me, {
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: (B) => B.preventDefault(),
736
+ onMousedown: (D) => D.preventDefault(),
687
737
  width: this.popupWidth,
688
738
  popupSettings: {
689
- ...E,
739
+ ...N,
690
740
  anchor: this.anchor,
691
- show: M,
692
- popupClass: L(E.popupClass, "k-list", {
693
- [`k-list-${W[m] || m}`]: m,
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: L("k-list-container", E.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: () => [c && o("div", {
750
+ default: () => [v && u("div", {
701
751
  class: "k-list-header"
702
- }, [c]), this.group && b.length !== 0 && o(Q, {
752
+ }, [v]), this.group && $.length !== 0 && u(Q, {
703
753
  group: this.group,
704
- render: p
705
- }, null), Y.call(this), h && o("div", {
754
+ render: m
755
+ }, null), Y.call(this), b && u("div", {
706
756
  class: "k-list-footer"
707
- }, [h])]
757
+ }, [b])]
708
758
  });
709
- }, ye = function(p, c) {
759
+ }, Ie = function(m, v) {
710
760
  const {
711
- tabIndex: h,
712
- dataItems: b = [],
713
- dataItemKey: B
761
+ tabIndex: b,
762
+ dataItems: $ = [],
763
+ dataItemKey: D
714
764
  } = this.$props;
715
- f || (f = {
765
+ h || (h = {
716
766
  skip: 0
717
767
  });
718
- const N = this.computedValue(), z = Math.max(0, b.findIndex((H) => I(H, N, B)));
719
- return this.suggested && !I(this.valueOnDidUpdate, N, B) && (this.suggested = ""), o(we, {
720
- id: c,
721
- placeholder: k,
722
- tabIndex: h || void 0,
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: p + this.suggested,
774
+ value: m + this.suggested,
725
775
  suggestedText: this.suggested,
726
- ref: (H) => {
727
- this.inputRef = H;
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: M,
784
+ expanded: H,
735
785
  owns: this.base.listBoxId,
736
- activedescendant: this.base.guid + "-" + (z + f.skip),
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 = [_(function() {
743
- return o("span", {
744
- class: L("k-combobox k-input", {
745
- [`k-input-${W[m] || m}`]: m,
746
- [`k-rounded-${_e[D] || D}`]: D,
747
- [`k-input-${y}`]: y,
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
- }, l),
754
- ref: Te(this, "kendoAnchor"),
803
+ }, d),
804
+ ref: Fe(this, "kendoAnchor"),
755
805
  style: s ? {
756
- ...n,
806
+ ...a,
757
807
  width: void 0
758
- } : n,
808
+ } : a,
759
809
  dir: e
760
- }, [ye.call(this, U || "", K), re && !r && o(He, {
810
+ }, [Ie.call(this, U || "", K), re && !r && u(Re, {
761
811
  onClearclick: this.clearButtonClick,
762
812
  key: "clearbutton"
763
- }, null), r && o(Be, {
813
+ }, null), r && u(Be, {
764
814
  name: "loading",
765
815
  class: "k-input-loading-icon",
766
816
  key: "loading"
767
- }, null), o(ee, {
817
+ }, null), u(ee, {
768
818
  type: "button",
769
819
  tabIndex: -1,
770
820
  "aria-label": de,
771
- size: m,
772
- fillMode: y,
821
+ size: c,
822
+ fillMode: o,
773
823
  rounded: null,
774
824
  class: "k-input-button",
775
- icon: u || "caret-alt-down",
825
+ icon: p || "caret-alt-down",
776
826
  svgIcon: g || Ne,
777
- iconClass: d,
827
+ iconClass: l,
778
828
  onClick: this.toggleBtnClick,
779
- onMousedown: (p) => p.preventDefault()
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 ? o("span", {
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 ? o("label", {
838
+ }, [J, this.$props.label ? K ? u("label", {
789
839
  for: K,
790
840
  class: "k-floating-label"
791
- }, [this.$props.label]) : o("span", {
841
+ }, [this.$props.label]) : u("span", {
792
842
  class: "k-label"
793
843
  }, [this.$props.label]) : null]) : J;
794
844
  }