@progress/kendo-vue-dropdowns 7.0.1 → 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.
@@ -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 Ie, h as z, createVNode as o, ref as _, inject as ke, isVNode as xe } from "vue";
9
- import Ce from "../common/DropDownBase.mjs";
10
- import { GroupStickyHeader as J } from "../common/GroupStickyHeader.mjs";
11
- import { templateRendering as $, getListeners as O, Keys as V, canUseDOM as $e, getRef as Q, guid as X, classNames as L, kendoThemeMaps as Oe, setRef as Ve, Icon as Fe } from "@progress/kendo-vue-common";
12
- import { Button as Z } from "@progress/kendo-vue-buttons";
13
- import { getItemValue as I, isPresent as b, areSame as k, suggestValue as Te, itemIndexStartsWith as ee, getItemIndexByText as te } from "../common/utils.mjs";
14
- import { SearchBar as Be } from "../common/SearchBar.mjs";
15
- import { ListContainer as De } from "../common/ListContainer.mjs";
16
- import { List as we } from "../common/List.mjs";
17
- import { ClearButton as Me } from "../common/ClearButton.mjs";
18
- import { provideLocalizationService as Re } from "@progress/kendo-vue-intl";
19
- import { expandButton as ie, messages as He } from "../messages/main.mjs";
20
- import { xIcon as Le, caretAltDownIcon as Ee } from "@progress/kendo-svg-icons";
21
- import { MOBILE_MEDIUM_DEVICE as Ne, MOBILE_SMALL_DEVICE as Ae } from "../common/constants.mjs";
22
- import { ActionSheet as je } from "@progress/kendo-vue-layout";
23
- import { ListFilter as Ke } from "../common/ListFilter.mjs";
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: G,
26
- roundedMap: Pe
27
- } = Oe;
28
- function ze(e) {
29
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
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 _e = "Please enter a valid value!", rt = /* @__PURE__ */ Ie({
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: Ae,
193
- medium: Ne
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 Ce(this), this.anchor = X(), this.inputId = X();
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 = _(null), t = _(null), s = _(null), i = ke("kendoLocalizationService", {});
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: s,
229
- kendoLocalizationService: i
228
+ kendoAnchorRef: i,
229
+ kendoLocalizationService: s
230
230
  };
231
231
  },
232
232
  mounted() {
233
- this.observer = $e && 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 = Q(this, "kendoAnchor"), this.element = Q(this, "kendoAnchor"), this.base.didMount(), this.setValidity();
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 g;
236
+ var f;
237
237
  const {
238
238
  dataItems: e = [],
239
239
  dataItemKey: t,
240
- virtual: s,
241
- groupField: i,
242
- textField: n
243
- } = this.$props, l = this.isOpen, a = this.prevOpened !== void 0 ? this.prevOpened : this.prevCurrentOpened, r = !a && l, d = this.$refs.list, u = this.$refs.scrollElement, h = this.computedValue();
244
- if (this.valueOnDidUpdate = h, d && (this.base.vs.list = d.list, this.base.list = d.list), u && (this.base.vs.scrollElement = u), d && e.length && this.base.vs.scrollerRef(d.$el), s && this.virtualTotalHasChanged)
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 S = e.findIndex((F) => k(F, h, t));
249
- i && (S = (g = this.base.getGroupedDataModernMode(e, i)) == null ? void 0 : g.indexOf(h));
250
- const D = !k(m, h, t);
251
- if (r && s)
252
- this.base.scrollToVirtualItem(s, S), this.prevCurrentOpened = !0;
253
- else if (r && !s)
254
- e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][i], this), this.base.scrollToItem(S), this.prevCurrentOpened = !0;
255
- else if (l && a && h && D)
256
- this.base.scrollToItem(S);
257
- else if (l && !h && !this.isScrolling) {
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 (i && this.getFocusedIndex() !== -1 && e.length > 0) {
260
- const T = e[this.getFocusedIndex()][n], w = this.base.getGroupedDataModernMode(e, i), A = w.findIndex((x) => x[n] === T);
261
- F = w.slice(0, A).filter((x) => Object.keys(x).length === 1).length;
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, s = this.computedValue();
291
- return e.findIndex((i) => k(i, s, t));
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 s = this.dataItems.findIndex((i) => I(i, e) === t);
330
- return this.dataItems[s];
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 ? I(e, this.valueField) : e;
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, s = this.$props.valid !== void 0 ? this.$props.valid : t;
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: s,
340
+ valid: i,
341
341
  valueMissing: this.computedValue() === null
342
342
  };
343
343
  },
344
344
  handleItemSelect(e, t) {
345
345
  const {
346
- dataItems: s = [],
347
- virtual: i,
348
- dataItemKey: n
349
- } = this.$props, l = i ? i.skip : 0, a = s[e - l], r = !k(a, this.computedValue(), n);
350
- this.triggerOnChange(a, t), this.currentText !== void 0 && (t.data.currentText = void 0), r && this.base.triggerPageChangeCornerItems(a, t);
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: s = [],
355
- virtual: i = {
354
+ dataItems: i = [],
355
+ virtual: s = {
356
356
  skip: 0
357
357
  }
358
- } = this.$props, n = this.$props.filter ? this.$props.filter : this.currentText, l = this.getFocusedIndex(), a = this.base.vs, r = this.computedValue();
359
- if (this.suggested = "", l !== -1 && !b(r))
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 (n === "")
361
+ else if (a === "")
362
362
  this.handleItemSelect(0, e);
363
363
  else {
364
- let d = i.skip + l;
365
- const u = this.base.navigation.navigate({
364
+ let u = s.skip + l;
365
+ const g = this.base.navigation.navigate({
366
366
  keyCode: t,
367
- current: d,
368
- max: (a.enabled ? a.total : s.length) - 1,
367
+ current: u,
368
+ max: (n.enabled ? n.total : i.length) - 1,
369
369
  min: 0
370
370
  });
371
- u !== void 0 && this.handleItemSelect(u, e);
371
+ g !== void 0 && this.handleItemSelect(g, e);
372
372
  }
373
373
  },
374
374
  toggleBtnClick(e) {
375
- const t = this.base.initState(), s = this.isOpen, i = this.adaptiveState;
376
- t.event = e, this.base.togglePopup(t), !s && i && this.base.filterChanged("", t), this.applyState(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: s = [],
381
- textField: i,
382
- allowCustom: n
383
- } = this.$props, l = this.isOpen, r = I(this.computedValue(), i) === e ? this.index : te(s, e, i), d = r !== -1;
384
- let u;
385
- if (this.suggested = "", d)
386
- u = s[r];
387
- else if (n)
388
- u = i !== void 0 ? {
389
- [i]: e
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(u, t), l && this.base.togglePopup(t), this.$props.filter === void 0 && this.currentText !== void 0 && (t.data.currentText = void 0), this.applyState(t);
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: s = [],
398
- textField: i,
399
- allowCustom: n
400
- } = this.$props, l = this.isOpen, a = I(this.computedValue(), i);
401
- if (this.suggested = "", e === a || e === "" && !b(a))
402
- return l && !this.adaptiveState && this.base.togglePopup(t), this.applyState(t);
403
- const r = te(s, e, i, !0), d = r !== -1;
404
- let u = null;
405
- d ? u = s[r] : n && (u = e ? i ? {
406
- [i]: e
407
- } : e : null), this.triggerOnChange(u, t), this.currentText !== void 0 && (t.data.currentText = void 0, this.base.filterChanged("", t)), l && !this.adaptiveState && this.base.togglePopup(t), this.applyState(t);
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 s = this.isOpen, {
411
- dataItems: i = [],
412
- textField: n,
412
+ const i = this.isOpen, {
413
+ dataItems: s = [],
414
+ textField: a,
413
415
  virtual: l = {
414
416
  skip: 0
415
417
  },
416
- focusedItemIndex: a = ee
417
- } = this.$props, r = l.skip, d = e === "" && r === 0 ? 0 : a(i, e, n);
418
- return d !== -1 ? this.handleItemSelect(d + r, t) : (this.triggerOnChange(null, t), this.currentText !== void 0 && (t.data.currentText = void 0)), s && this.base.togglePopup(t), this.applyState(t);
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, s = this.isOpen, i = this.base.initState();
437
- if (i.event = e, !e.altKey && (t === V.up || t === V.down)) {
438
- e.preventDefault(), this.onNavigate(i, t), this.applyState(i);
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 n = () => {
442
- e.preventDefault(), this.base.togglePopup(i), this.applyState(i);
443
+ const a = () => {
444
+ e.preventDefault(), this.base.togglePopup(s), this.applyState(s);
443
445
  };
444
- s ? e.altKey && t === V.up ? n() : t === V.enter ? (e.preventDefault(), this.applyValueOnEnter(e.currentTarget.value, i)) : t === V.esc && (this.adaptiveState && this.toggleBtnClick(e), n()) : e.altKey && t === V.down ? n() : t === V.esc && this.applyValueOnRejectSuggestions(e.currentTarget.value, i);
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 s = this.isOpen, i = e.currentTarget, n = i.value;
451
+ const i = this.isOpen, s = e.currentTarget, a = s.value;
450
452
  if (this.$props.suggest) {
451
- const l = i.selectionEnd === n.length;
452
- let a = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
453
- b(a) || (a = I(this.computedValue(), this.$props.textField) || "");
454
- const r = a && a === n, d = a && a.length > n.length;
455
- r || d || !l ? this.suggested = "" : this.suggestValue(n);
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 = n), this.currentFocusedItem !== void 0 && (t.data.focusedItem = void 0), s || this.base.togglePopup(t), this.base.filterChanged(n, t), this.$props.filterable && (t.data.group = void 0), this.applyState(t);
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: s,
467
- dataItemKey: i,
468
- virtual: n = {
468
+ textField: i,
469
+ dataItemKey: s,
470
+ virtual: a = {
469
471
  skip: 0
470
472
  },
471
- focusedItemIndex: l = ee
472
- } = this.$props, a = this.$props.filter ? this.$props.filter : this.currentText;
473
- return b(e) && a === void 0 ? t.findIndex((r) => k(r, e, i)) : a ? l(t, a, s) : n.skip === 0 ? 0 : -1;
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: s
480
+ textField: i
479
481
  } = this.$props;
480
- this.suggested = Te(e, t, s);
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 || _e);
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 s = this.computedValue();
487
- !b(s) && !b(e) || k(s, e, this.$props.dataItemKey) || (this.$props.value === void 0 && (this.currentValue = e), this.valueDuringOnChange = e, t.events.push({
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: s
510
+ list: i
506
511
  } = this.base;
507
512
  t.scrollHandler(e);
508
- const i = this.base.initState(), {
509
- groupField: n
513
+ const s = this.base.initState(), {
514
+ groupField: a
510
515
  } = this.$props;
511
516
  let {
512
517
  dataItems: l = []
513
- } = this.$props, a;
514
- if (!n || !l.length)
518
+ } = this.$props, n;
519
+ if (!a || !l.length)
515
520
  return;
516
- const r = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : s ? s.children[0].offsetHeight : 0), u = e.target.scrollTop - t.skip * r;
517
- n && (l = this.base.getGroupedDataModernMode(l, n), a = l[0][n]);
518
- for (let h = 1; h < l.length && !(r * h > u); h++)
519
- l[h] && l[h][n] && (a = l[h][n]);
520
- a !== this.group && (i.data.group = a, this.applyState(i));
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 b(e) && e !== "" ? String(e) : b(t) ? String(t) : "";
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: s,
531
- label: i,
532
- textField: n,
543
+ clearButton: i,
544
+ label: s,
545
+ textField: a,
533
546
  className: l,
534
- style: a,
547
+ style: n,
535
548
  loading: r,
536
- icon: d,
537
- svgIcon: u,
538
- iconClassName: h,
539
- virtual: g,
549
+ icon: u,
550
+ svgIcon: g,
551
+ iconClassName: d,
552
+ virtual: f,
540
553
  size: m,
541
- fillMode: S,
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: x,
548
- inputAttributes: se
560
+ placeholder: k,
561
+ inputAttributes: ne
549
562
  } = this.$props;
550
- const ne = this.currentFocused, ae = !this.$props.validityStyles || this.validity().valid, j = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, W = I(this.computedValue(), n), q = this.getInputText(j, W), le = s && (!!q || b(this.computedValue())), C = this.base, y = C.vs, K = this.$props.id || this.inputId, E = Object.assign({}, {
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), oe = Re(this).toLanguageString(ie, He[ie]), M = this.isOpen, R = this.adaptiveState;
554
- y.enabled = g !== void 0, g !== void 0 && (y.skip = g.skip, y.total = g.total, y.pageSize = g.pageSize), this.group === void 0 && this.$props.groupField !== void 0 && (this.group = I(this.$props.dataItems[0], this.$props.groupField));
555
- const re = (p) => {
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 f = p.event.target.value;
559
- c.data.text = f, this.base.filterChanged(f, c), this.applyState(c);
560
- }, de = () => [o("div", {
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]), x && o("div", {
579
+ }, [F]), k && o("div", {
567
580
  class: "k-actionsheet-subtitle k-text-center"
568
- }, [x])]), o("div", {
581
+ }, [k])]), o("div", {
569
582
  class: "k-actionsheet-actions"
570
- }, [o(Z, {
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: Le
591
+ svgIcon: Ee
579
592
  }, null)])]), o("div", {
580
593
  class: "k-actionsheet-titlebar-group k-actionsheet-filter"
581
- }, [fe.call(this)])], ue = $.call(this, de, O.call(this)), pe = () => {
582
- const p = C.getTemplateDef.call(this, T, z), c = C.getTemplateDef.call(this, w, z), f = $.call(this, A, O.call(this)), v = this.$props.dataItems || [];
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-${G[m] || m}`]: R ? !1 : m,
602
+ [`k-list-${W[m] || m}`]: R ? !1 : m,
590
603
  "k-list-lg": !!R,
591
- "k-virtual-list": y.enabled
604
+ "k-virtual-list": S.enabled
592
605
  })
593
606
  }, [T && o("div", {
594
607
  class: "k-list-header"
595
- }, [T]), this.group && v.length !== 0 && o(J, {
608
+ }, [T]), this.group && b.length !== 0 && o(Q, {
596
609
  group: this.group,
597
- render: f
598
- }, null), U.call(this), c && o("div", {
610
+ render: h
611
+ }, null), Y.call(this), c && o("div", {
599
612
  class: "k-list-footer"
600
613
  }, [c])])]);
601
- }, ce = $.call(this, pe, O.call(this)), he = function() {
602
- return o(je, {
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: ue,
609
- content: ce,
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
- }, fe = function() {
626
+ }, me = function() {
614
627
  const c = this.base.initState().data.text;
615
- return o(Ke, {
628
+ return o(ze, {
616
629
  adaptiveMode: !0,
617
630
  value: c,
618
631
  ref: "filterInput",
619
- onChange: (f) => re(f),
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
- }, U = function() {
638
+ }, Y = function() {
626
639
  let p;
627
640
  const {
628
641
  dataItemKey: c,
629
- groupField: f
642
+ groupField: h
630
643
  } = this.$props;
631
- let v = this.$props.dataItems || [];
632
- const B = $.call(this, this.$props.itemRender, O.call(this)), N = $.call(this, this.$props.groupHeaderItemRender, O.call(this)), P = $.call(this, this.$props.listNoDataRender, O.call(this));
633
- g || (g = {
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 = g.skip, be = `translateY(${y.translate}px)`, Se = M ? this.getFocusedIndex() : void 0, ye = b(j) && j !== W ? null : this.computedValue();
637
- return f && (v = this.base.getGroupedDataModernMode(v, f)), o(we, {
638
- id: C.listBoxId,
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: v,
641
- focusedIndex: Se,
642
- value: ye,
643
- textField: n,
653
+ dataItems: b,
654
+ focusedIndex: Ie,
655
+ value: ke,
656
+ textField: a,
644
657
  valueField: c,
645
- optionsGuid: C.guid,
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: y.enabled ? {
654
- transform: be
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: P,
662
- groupField: f,
674
+ noDataRender: z,
675
+ groupField: h,
663
676
  onScroll: this.onScroll
664
- }, ze(p = ge.call(this)) ? p : {
677
+ }, Ge(p = ve.call(this)) ? p : {
665
678
  default: () => [p]
666
679
  });
667
- }, ge = function() {
668
- return y.enabled && o("div", {
680
+ }, ve = function() {
681
+ return S.enabled && o("div", {
669
682
  ref: "scrollElement",
670
683
  key: "scrollElementKey"
671
684
  }, null);
672
- }, me = function() {
673
- const p = $.call(this, this.$props.groupStickyHeaderItemRender, O.call(this)), c = C.getTemplateDef.call(this, T), f = C.getTemplateDef.call(this, w), v = this.$props.dataItems || [];
674
- return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = I(v[0], this.$props.groupField)), o(De, {
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-${G[m] || m}`]: m,
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 && v.length !== 0 && o(J, {
705
+ }, [c]), this.group && b.length !== 0 && o(Q, {
693
706
  group: this.group,
694
707
  render: p
695
- }, null), U.call(this), f && o("div", {
708
+ }, null), Y.call(this), h && o("div", {
696
709
  class: "k-list-footer"
697
- }, [f])]
710
+ }, [h])]
698
711
  });
699
- }, ve = function(p, c) {
712
+ }, ye = function(p, c) {
700
713
  const {
701
- tabIndex: f,
702
- dataItems: v = [],
714
+ tabIndex: h,
715
+ dataItems: b = [],
703
716
  dataItemKey: B
704
717
  } = this.$props;
705
- g || (g = {
718
+ f || (f = {
706
719
  skip: 0
707
720
  });
708
- const N = this.computedValue(), P = Math.max(0, v.findIndex((H) => k(H, N, B)));
709
- return this.suggested && !k(this.valueOnDidUpdate, N, B) && (this.suggested = ""), o(Be, {
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: x,
712
- tabIndex: f || void 0,
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 + "-" + (P + g.skip),
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: se
743
+ inputAttributes: ne
731
744
  }, null);
732
- }, Y = [z(function() {
745
+ }, J = [_(function() {
733
746
  return o("span", {
734
747
  class: L("k-combobox k-input", {
735
- [`k-input-${G[m] || m}`]: m,
736
- [`k-rounded-${Pe[D] || D}`]: D,
737
- [`k-input-${S}`]: S,
738
- "k-invalid": !ae,
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": ne && !t
755
+ "k-focus": ae && !t
743
756
  }, l),
744
- ref: Ve(this, "kendoAnchor"),
745
- style: i ? {
746
- ...a,
757
+ ref: Te(this, "kendoAnchor"),
758
+ style: s ? {
759
+ ...n,
747
760
  width: void 0
748
- } : a,
761
+ } : n,
749
762
  dir: e
750
- }, [ve.call(this, q || "", K), le && !r && o(Me, {
763
+ }, [ye.call(this, U || "", K), re && !r && o(He, {
751
764
  onClearclick: this.clearButtonClick,
752
765
  key: "clearbutton"
753
- }, null), r && o(Fe, {
766
+ }, null), r && o(Be, {
754
767
  name: "loading",
755
768
  class: "k-input-loading-icon",
756
769
  key: "loading"
757
- }, null), o(Z, {
770
+ }, null), o(ee, {
758
771
  type: "button",
759
772
  tabIndex: -1,
760
- "aria-label": oe,
773
+ "aria-label": de,
761
774
  size: m,
762
- fillMode: S,
775
+ fillMode: y,
763
776
  rounded: null,
764
777
  class: "k-input-button",
765
- icon: d || "caret-alt-down",
766
- svgIcon: u || Ee,
767
- iconClass: h,
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 && me.call(this)]);
783
+ }, null), !R && be.call(this)]);
771
784
  }.call(this), {
772
785
  ...this.$attrs
773
- }), R && he.call(this)];
774
- return i ? o("span", {
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
- }, [Y, this.$props.label ? K ? o("label", {
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]) : Y;
796
+ }, [this.$props.label]) : null]) : J;
784
797
  }
785
798
  });
786
799
  export {
787
- rt as ComboBox
800
+ ut as ComboBox
788
801
  };