@progress/kendo-react-dropdowns 7.4.0-develop.1 → 7.4.0-develop.2

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.
@@ -6,33 +6,39 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as u from "react";
9
+ import * as h from "react";
10
10
  import f from "prop-types";
11
11
  import B from "../common/DropDownBase.mjs";
12
- import { Keys as x, validatePackage as ie, svgIconPropType as oe, canUseDOM as z, classNames as E, IconWrap as ae, createPropsContext as ne, withIdHOC as le, withPropsContext as re, kendoThemeMaps as de } from "@progress/kendo-react-common";
12
+ import { Keys as x, validatePackage as ie, svgIconPropType as oe, canUseDOM as K, classNames as D, IconWrap as ae, createPropsContext as ne, withIdHOC as le, withPropsContext as re, kendoThemeMaps as de } from "@progress/kendo-react-common";
13
13
  import { FloatingLabel as pe } from "@progress/kendo-react-labels";
14
- import { areSame as C, getItemValue as S, isPresent as k, getItemIndexByText as A, suggestValue as he, itemIndexStartsWith as K } from "../common/utils.mjs";
14
+ import { getPlainDataDuplicates as he, areSame as C, getItemValue as S, isPresent as k, getItemIndexByText as z, suggestValue as ce, itemIndexStartsWith as A } from "../common/utils.mjs";
15
15
  import ue from "../common/SearchBar.mjs";
16
- import ce from "../common/ListContainer.mjs";
17
- import ge from "../common/List.mjs";
18
- import me from "../common/ListFilter.mjs";
16
+ import ge from "../common/ListContainer.mjs";
17
+ import me from "../common/List.mjs";
18
+ import ve from "../common/ListFilter.mjs";
19
19
  import H from "../common/GroupStickyHeader.mjs";
20
- import { packageMetadata as ve } from "../package-metadata.mjs";
21
- import fe from "../common/ClearButton.mjs";
20
+ import { packageMetadata as fe } from "../package-metadata.mjs";
21
+ import be from "../common/ClearButton.mjs";
22
22
  import { Button as q } from "@progress/kendo-react-buttons";
23
- import { caretAltDownIcon as be, xIcon as xe } from "@progress/kendo-svg-icons";
23
+ import { caretAltDownIcon as xe, xIcon as Ie } from "@progress/kendo-svg-icons";
24
24
  import { comboArrowBtnAriaLabelExpand as W, messages as $, comboArrowBtnAriaLabelCollapse as G } from "../messages/index.mjs";
25
25
  import { provideLocalizationService as U } from "@progress/kendo-react-intl";
26
- import { ActionSheet as Ie, ActionSheetHeader as ye, ActionSheetContent as ke } from "@progress/kendo-react-layout";
27
- import { MOBILE_MEDIUM_DEVISE as D, MOBILE_SMALL_DEVISE as j } from "../common/constants.mjs";
26
+ import { ActionSheet as ye, ActionSheetHeader as ke, ActionSheetContent as Ce } from "@progress/kendo-react-layout";
27
+ import { MOBILE_MEDIUM_DEVISE as F, MOBILE_SMALL_DEVISE as j } from "../common/constants.mjs";
28
28
  import Y from "../common/withCustomComponent.mjs";
29
- const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w = class w extends u.Component {
29
+ const Se = "Please enter a valid value!", { sizeMap: M, roundedMap: we } = de, w = class w extends h.Component {
30
30
  constructor(s) {
31
- super(s), this.state = {}, this.base = new B(this), this._element = null, this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this.itemHeight = 0, this.focus = () => {
31
+ super(s), this.state = {}, this.base = new B(this), this._element = null, this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this.itemHeight = 0, this.duplicates = [], this.hasDuplicates = !1, this.focus = () => {
32
32
  this._input && this._input.focus();
33
+ }, this.checkForDuplicatePlainTextRecords = () => {
34
+ const e = this.props.textField !== void 0, t = this.props.dataItemKey !== void 0;
35
+ if (this.props.data && this.props.data.length > 0 && !e && !t) {
36
+ const a = this.props.data;
37
+ this.duplicates = he(a), this.hasDuplicates = this.duplicates.length > 0;
38
+ }
33
39
  }, this.handleItemSelect = (e, t) => {
34
- const { data: n = [], virtual: i, dataItemKey: l } = this.props, d = i ? i.skip : 0, a = n[e - d], r = !C(a, this.value, l);
35
- this.triggerOnChange(a, t), this.state.text !== void 0 && (t.data.text = void 0), r && this.base.triggerPageChangeCornerItems(a, t);
40
+ const { data: a = [], virtual: o, dataItemKey: n } = this.props, d = o ? o.skip : 0, l = a[e - d], r = this.hasDuplicates || !C(l, this.value, n);
41
+ this.triggerOnChange(l, t), this.state.text !== void 0 && (t.data.text = void 0), r && this.base.triggerPageChangeCornerItems(l, t);
36
42
  }, this.onPopupOpened = () => {
37
43
  setTimeout(() => {
38
44
  this.mobileMode && this._adaptiveFilterInput && (this._skipBlur = !0, this._adaptiveFilterInput.focus(), this._skipBlur = !1);
@@ -40,19 +46,19 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
40
46
  }, this.componentRef = (e) => {
41
47
  this._element = e, this.base.wrapper = e;
42
48
  }, this.toggleBtnClick = (e) => {
43
- const { data: t = [], skipDisabledItems: n, textField: i } = this.props, l = this.getFocusedIndex(), d = this.getCurrentValueDisabledStatus(i, t, l), a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = this.base.initState();
44
- if (r.syntheticEvent = e, !n && i && d && this.clearValueOnToggleBtnClick(e), this.base.togglePopup(r), !a && this.mobileMode) {
45
- const o = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
46
- this.base.filterChanged(o, r);
49
+ const { data: t = [], skipDisabledItems: a, textField: o } = this.props, n = this.getFocusedIndex(), d = this.getCurrentValueDisabledStatus(o, t, n), l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = this.base.initState();
50
+ if (r.syntheticEvent = e, !a && o && d && this.clearValueOnToggleBtnClick(e), this.base.togglePopup(r), !l && this.mobileMode) {
51
+ const i = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
52
+ this.base.filterChanged(i, r);
47
53
  }
48
54
  this.applyState(r);
49
55
  }, this.renderMobileListFilter = () => {
50
- const e = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, t = S(this.value, this.props.textField), n = k(e) ? e : t;
51
- return /* @__PURE__ */ u.createElement(
52
- me,
56
+ const e = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, t = S(this.value, this.props.textField), a = k(e) ? e : t;
57
+ return /* @__PURE__ */ h.createElement(
58
+ ve,
53
59
  {
54
- value: n,
55
- ref: (i) => this._adaptiveFilterInput = i && i.element,
60
+ value: a,
61
+ ref: (o) => this._adaptiveFilterInput = o && o.element,
56
62
  onChange: this.handleMobileFilterChange,
57
63
  onKeyDown: this.onInputKeyDown,
58
64
  size: this.props.size,
@@ -64,97 +70,97 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
64
70
  const t = this.base.initState();
65
71
  t.syntheticEvent = e.syntheticEvent, t.data.text = e.target.value, this.base.filterChanged(e.target.value, t), this.applyState(t);
66
72
  }, this.onScroll = (e) => {
67
- const { vs: t, list: n } = this.base;
73
+ const { vs: t, list: a } = this.base;
68
74
  t.scrollHandler(e);
69
- const { groupField: i } = this.props;
70
- let { data: l = [] } = this.props;
71
- if (!i || !l.length)
75
+ const { groupField: o } = this.props;
76
+ let { data: n = [] } = this.props;
77
+ if (!o || !n.length)
72
78
  return;
73
- const d = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : n ? n.children[0].offsetHeight : 0), r = e.target.scrollTop - t.skip * d;
74
- this.props.groupMode === "modern" && (l = this.base.getGroupedDataModernMode(l, i));
75
- let o = l[0][i];
76
- for (let h = 1; h < l.length && !(d * h > r); h++)
77
- l[h] && l[h][i] && (o = l[h][i]);
78
- o !== this.state.group && (this.setState({
79
- group: o
80
- }), this.props.onGroupScroll && this.props.onGroupScroll.call(void 0, { group: o }));
79
+ const d = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : a ? a.children[0].offsetHeight : 0), r = e.target.scrollTop - t.skip * d;
80
+ this.props.groupMode === "modern" && (n = this.base.getGroupedDataModernMode(n, o));
81
+ let i = n[0][o];
82
+ for (let c = 1; c < n.length && !(d * c > r); c++)
83
+ n[c] && n[c][o] && (i = n[c][o]);
84
+ i !== this.state.group && (this.setState({
85
+ group: i
86
+ }), this.props.onGroupScroll && this.props.onGroupScroll.call(void 0, { group: i }));
81
87
  }, this.handleItemClick = (e, t) => {
82
- this.base.handleItemClick(e, t), this._valueDuringOnChange = void 0;
88
+ this.navigationIndex = e, this.base.handleItemClick(e, t), this._valueDuringOnChange = void 0;
83
89
  }, this.handleBlur = (e) => {
84
90
  if (this.state.focused && !this._skipBlur) {
85
- const t = this.base.initState(), { textField: n, data: i = [] } = this.props, l = this.getFocusedIndex(), a = !(l === -1) && this.getCurrentValueDisabledStatus(n, i, l);
86
- t.data.focused = !1, t.events.push({ type: "onBlur" }), t.syntheticEvent = e, n && a && this.clearValueOnBlur(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, t);
91
+ const t = this.base.initState(), { textField: a, data: o = [] } = this.props, n = this.getFocusedIndex(), l = !(n === -1) && this.getCurrentValueDisabledStatus(a, o, n);
92
+ t.data.focused = !1, t.events.push({ type: "onBlur" }), t.syntheticEvent = e, a && l && this.clearValueOnBlur(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, t);
87
93
  }
88
94
  }, this.onInputClick = (e) => {
89
- const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, n = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
95
+ const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
90
96
  if (!t && this.mobileMode) {
91
- const i = this.base.initState();
92
- i.syntheticEvent = e, this.base.togglePopup(i), this.base.filterChanged(n, i), this.applyState(i);
97
+ const o = this.base.initState();
98
+ o.syntheticEvent = e, this.base.togglePopup(o), this.base.filterChanged(a, o), this.applyState(o);
93
99
  }
94
100
  }, this.onInputKeyDown = (e) => {
95
- const { data: t = [], skipDisabledItems: n, textField: i, dataItemKey: l, groupField: d } = this.props, a = this.value, r = Math.max(0, t.findIndex((c) => C(c, a, l))), o = e.keyCode, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = this.base.initState();
96
- if (p.syntheticEvent = e, !e.altKey && (o === x.up || o === x.down)) {
97
- if (e.preventDefault(), d !== "" && i)
98
- if (!this.props.skipDisabledItems && h)
99
- this.onNavigate(p, o);
101
+ const { data: t = [], skipDisabledItems: a, textField: o, dataItemKey: n, groupField: d } = this.props, l = this.value, r = Math.max(0, t.findIndex((u) => C(u, l, n))), i = e.keyCode, c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = this.base.initState();
102
+ if (p.syntheticEvent = e, !e.altKey && (i === x.up || i === x.down)) {
103
+ if (e.preventDefault(), d !== "" && o)
104
+ if (!this.props.skipDisabledItems && c)
105
+ this.onNavigate(p, i);
100
106
  else {
101
- let c = 0;
102
- if (o === x.down || o === x.right) {
103
- const m = t.slice(r + 1 < t.length ? r + 1 : r).find((b) => !b.disabled && b[i]);
104
- c = m && t.findIndex((b) => b[i] === m[i]);
105
- } else if (o === x.up || o === x.left) {
107
+ let u = 0;
108
+ if (i === x.down || i === x.right) {
109
+ const m = t.slice(r + 1 < t.length ? r + 1 : r).find((b) => !b.disabled && b[o]);
110
+ u = m && t.findIndex((b) => b[o] === m[o]);
111
+ } else if (i === x.up || i === x.left) {
106
112
  let m;
107
113
  if (r === 0)
108
- m = t, c = t.findIndex((b) => !b.disabled && b[i]);
114
+ m = t, u = t.findIndex((b) => !b.disabled && b[o]);
109
115
  else {
110
116
  m = t.slice(0, r);
111
117
  let b = m.pop();
112
118
  for (; b && b.disabled; )
113
119
  b = m.pop();
114
- c = b && t.findIndex((F) => F[i] === b[i]);
120
+ u = b && t.findIndex((V) => V[o] === b[o]);
115
121
  }
116
122
  }
117
- if (c !== void 0) {
118
- const m = c - r;
119
- this.onNavigate(p, o, m);
123
+ if (u !== void 0) {
124
+ const m = u - r;
125
+ this.onNavigate(p, i, m);
120
126
  } else
121
- c === void 0 && t.findIndex((m) => m[i] === a[i]) === t.length - 1 && this.onNavigate(p, o);
127
+ u === void 0 && t.findIndex((m) => m[o] === l[o]) === t.length - 1 && this.onNavigate(p, i);
122
128
  }
123
- else if (!this.props.skipDisabledItems && h)
124
- this.onNavigate(p, o);
129
+ else if (!this.props.skipDisabledItems && c)
130
+ this.onNavigate(p, i);
125
131
  else {
126
- let c = null;
127
- if (o === x.down || o === x.right)
128
- c = t.slice(r + 1).find((m) => !m.disabled);
129
- else if (o === x.up || o === x.left) {
132
+ let u = null;
133
+ if (i === x.down || i === x.right)
134
+ u = t.slice(r + 1).find((m) => !m.disabled);
135
+ else if (i === x.up || i === x.left) {
130
136
  const m = t.slice(0, r);
131
- for (c = m.pop(); c && c.disabled; )
132
- c = m.pop();
137
+ for (u = m.pop(); u && u.disabled; )
138
+ u = m.pop();
133
139
  }
134
- if (c) {
135
- const m = c.id - r - 1;
136
- this.onNavigate(p, o, m);
140
+ if (u) {
141
+ const m = u.id - r - 1;
142
+ this.onNavigate(p, i, m);
137
143
  } else
138
- this.onNavigate(p, o);
144
+ this.onNavigate(p, i);
139
145
  }
140
146
  this.applyState(p);
141
147
  }
142
148
  const g = () => {
143
149
  e.preventDefault(), this.base.togglePopup(p), this.applyState(p);
144
- }, I = this.getFocusedIndex(), v = I === -1, y = !v && this.getCurrentValueDisabledStatus(i, t, I);
145
- h ? o === x.pageUp ? this.base.scrollPopupByPageSize(-1) : o === x.pageDown ? this.base.scrollPopupByPageSize(1) : e.altKey && o === x.up ? g() : o === x.enter ? (e.preventDefault(), (i && !v && e.currentTarget.value ? t[I][i] : void 0) ? !n && i && y ? this.clearValueOnEnterOrEsc(e) : y || this.applyValueOnEnter(e.currentTarget.value, p) : this.applyValueOnEnter(e.currentTarget.value, p)) : o === x.esc && (!n && i && y && this.clearValueOnEnterOrEsc(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, p)) : !h && o === x.esc ? this.clearValueOnEnterOrEsc(e) : e.altKey && o === x.down && g();
150
+ }, I = this.getFocusedIndex(), v = I === -1, y = !v && this.getCurrentValueDisabledStatus(o, t, I);
151
+ c ? i === x.pageUp ? this.base.scrollPopupByPageSize(-1) : i === x.pageDown ? this.base.scrollPopupByPageSize(1) : e.altKey && i === x.up ? g() : i === x.enter ? (e.preventDefault(), (o && !v && e.currentTarget.value ? t[I][o] : void 0) ? !a && o && y ? this.clearValueOnEnterOrEsc(e) : y || this.applyValueOnEnter(e.currentTarget.value, p) : this.applyValueOnEnter(e.currentTarget.value, p)) : i === x.esc && (!a && o && y && this.clearValueOnEnterOrEsc(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, p)) : !c && i === x.esc ? this.clearValueOnEnterOrEsc(e) : e.altKey && i === x.down && g();
146
152
  }, this.inputOnChange = (e) => {
147
153
  const t = this.base.initState();
148
154
  t.syntheticEvent = e;
149
- const n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, i = e.currentTarget, l = i.value;
155
+ const a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, o = e.currentTarget, n = o.value;
150
156
  if (this.props.suggest) {
151
- const d = i.selectionEnd === l.length;
152
- let a = this.props.filter !== void 0 ? this.props.filter : this.state.text;
153
- k(a) || (a = S(this.value, this.props.textField) || "");
154
- const r = a && a === l, o = a && a.length > l.length;
155
- r || o || !d ? this._suggested = "" : this.suggestValue(l);
157
+ const d = o.selectionEnd === n.length;
158
+ let l = this.props.filter !== void 0 ? this.props.filter : this.state.text;
159
+ k(l) || (l = S(this.value, this.props.textField) || "");
160
+ const r = l && l === n, i = l && l.length > n.length;
161
+ r || i || !d ? this._suggested = "" : this.suggestValue(n);
156
162
  }
157
- this.props.filter === void 0 && (t.data.text = l), this.state.focusedItem !== void 0 && (t.data.focusedItem = void 0), n || this.base.togglePopup(t), this.base.filterChanged(l, t), this.applyState(t), this.setState({ group: void 0 });
163
+ this.props.filter === void 0 && (t.data.text = n), this.state.focusedItem !== void 0 && (t.data.focusedItem = void 0), a || this.base.togglePopup(t), this.base.filterChanged(n, t), this.applyState(t), this.setState({ group: void 0 });
158
164
  }, this.clearButtonClick = (e) => {
159
165
  const t = this.base.initState();
160
166
  t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
@@ -169,15 +175,15 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
169
175
  t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
170
176
  }, this.setValidity = () => {
171
177
  this._input && this._input.setCustomValidity && this._input.setCustomValidity(
172
- this.validity.valid ? "" : this.props.validationMessage || Ce
178
+ this.validity.valid ? "" : this.props.validationMessage || Se
173
179
  );
174
- }, ie(ve);
180
+ }, ie(fe);
175
181
  }
176
182
  get _inputId() {
177
183
  return this.props.id;
178
184
  }
179
185
  get document() {
180
- if (z)
186
+ if (K)
181
187
  return this.element && this.element.ownerDocument || document;
182
188
  }
183
189
  /** @hidden */
@@ -188,7 +194,7 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
188
194
  * The mobile mode of the ComboBox.
189
195
  */
190
196
  get mobileMode() {
191
- return !!(this.state.windowWidth && this.state.windowWidth <= D && this.props.adaptive);
197
+ return !!(this.state.windowWidth && this.state.windowWidth <= F && this.props.adaptive);
192
198
  }
193
199
  /**
194
200
  * The value of the ComboBox.
@@ -208,7 +214,7 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
208
214
  */
209
215
  get index() {
210
216
  const { data: s = [], dataItemKey: e } = this.props, t = this.value;
211
- return s.findIndex((n) => C(n, t, e));
217
+ return s.findIndex((a) => C(a, t, e));
212
218
  }
213
219
  /**
214
220
  * Gets the `name` property of the ComboBox.
@@ -237,22 +243,24 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
237
243
  /** @hidden */
238
244
  componentDidUpdate(s, e) {
239
245
  var g;
240
- const { dataItemKey: t, virtual: n, groupField: i = "", data: l = [], textField: d } = this.props, a = s.virtual ? s.virtual.total : 0, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, o = s.opened !== void 0 ? s.opened : e.opened, h = !o && r, p = this.value;
241
- if (this._valueOnDidUpdate = p, n && n.total !== a)
246
+ const { dataItemKey: t, virtual: a, groupField: o = "", data: n = [], textField: d } = this.props, l = s.virtual ? s.virtual.total : 0, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, i = s.opened !== void 0 ? s.opened : e.opened;
247
+ s.data !== n && this.checkForDuplicatePlainTextRecords();
248
+ const c = !i && r, p = this.value;
249
+ if (this._valueOnDidUpdate = p, a && a.total !== l)
242
250
  this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
243
251
  else {
244
252
  const I = s.value !== void 0 ? s.value : e.value;
245
- let v = l.findIndex((c) => C(c, p, t));
246
- this.props.groupMode === "modern" && d && p && (v = (g = this.base.getGroupedDataModernMode(l, i)) == null ? void 0 : g.map((c) => c[d]).indexOf(p[d]));
253
+ let v = this.hasDuplicates ? this.navigationIndex || 0 : n.findIndex((u) => C(u, p, t));
254
+ this.props.groupMode === "modern" && d && p && (v = (g = this.base.getGroupedDataModernMode(n, o)) == null ? void 0 : g.map((u) => u[d]).indexOf(p[d]));
247
255
  const y = !C(I, p, t);
248
- h && n ? this.base.scrollToVirtualItem(n, v) : h && !n ? (this.onPopupOpened(), l && l.length !== 0 && this.base.resetGroupStickyHeader(l[0][i], this), this.base.scrollToItem(v)) : r && o && p && y && this.base.scrollToItem(v);
256
+ c && a ? this.base.scrollToVirtualItem(a, v) : c && !a ? (this.onPopupOpened(), n && n.length !== 0 && this.base.resetGroupStickyHeader(n[0][o], this), this.base.scrollToItem(v)) : (this.hasDuplicates || r && i && p && y) && this.base.scrollToItem(v);
249
257
  }
250
- h && this._input && this._input.focus(), this.setValidity();
258
+ c && this._input && this._input.focus(), this.setValidity();
251
259
  }
252
260
  /** @hidden */
253
261
  componentDidMount() {
254
262
  var s;
255
- this.observerResize = z && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (s = this.document) != null && s.body && this.observerResize && this.observerResize.observe(this.document.body);
263
+ this.observerResize = K && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (s = this.document) != null && s.body && this.observerResize && this.observerResize.observe(this.document.body), this.checkForDuplicatePlainTextRecords();
256
264
  }
257
265
  /** @hidden */
258
266
  componentWillUnmount() {
@@ -266,57 +274,57 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
266
274
  $[G]
267
275
  ), {
268
276
  dir: t,
269
- disabled: n,
270
- clearButton: i = w.defaultProps.clearButton,
271
- label: l,
277
+ disabled: a,
278
+ clearButton: o = w.defaultProps.clearButton,
279
+ label: n,
272
280
  textField: d,
273
- adaptive: a,
281
+ adaptive: l,
274
282
  className: r,
275
- style: o,
276
- loading: h,
283
+ style: i,
284
+ loading: c,
277
285
  iconClassName: p,
278
286
  virtual: g,
279
287
  size: I,
280
288
  rounded: v,
281
289
  fillMode: y,
282
- opened: c = this.state.opened,
290
+ opened: u = this.state.opened,
283
291
  placeholder: m,
284
292
  svgIcon: b
285
- } = this.props, { windowWidth: F = 0 } = this.state, _ = !this.validityStyles || this.validity.valid, P = this.props.filter !== void 0 ? this.props.filter : this.state.text, J = S(this.value, d), O = k(P) ? P : J, Q = i && (!!O || k(this.value)), M = this.base.vs, N = this.props.id || this._inputId, L = F <= D && a;
286
- M.enabled = g !== void 0, g !== void 0 && (M.skip = g.skip, M.total = g.total, M.pageSize = g.pageSize);
287
- const [X, Z] = Y(this.props.prefix || u.Fragment), [ee, te] = Y(this.props.suffix || u.Fragment), R = /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(
293
+ } = this.props, { windowWidth: V = 0 } = this.state, _ = !this.validityStyles || this.validity.valid, P = this.props.filter !== void 0 ? this.props.filter : this.state.text, J = S(this.value, d), O = k(P) ? P : J, Q = o && (!!O || k(this.value)), E = this.base.vs, N = this.props.id || this._inputId, L = V <= F && l;
294
+ E.enabled = g !== void 0, g !== void 0 && (E.skip = g.skip, E.total = g.total, E.pageSize = g.pageSize);
295
+ const [X, Z] = Y(this.props.prefix || h.Fragment), [ee, te] = Y(this.props.suffix || h.Fragment), R = /* @__PURE__ */ h.createElement(h.Fragment, null, /* @__PURE__ */ h.createElement(
288
296
  "span",
289
297
  {
290
- className: E(
298
+ className: D(
291
299
  "k-combobox k-input",
292
300
  {
293
- [`k-input-${V[I] || I}`]: I,
294
- [`k-rounded-${Se[v] || v}`]: v,
301
+ [`k-input-${M[I] || I}`]: I,
302
+ [`k-rounded-${we[v] || v}`]: v,
295
303
  [`k-input-${y}`]: y,
296
304
  "k-invalid": !_,
297
- "k-loading": h,
305
+ "k-loading": c,
298
306
  "k-required": this.required,
299
- "k-disabled": n
307
+ "k-disabled": a
300
308
  },
301
309
  r
302
310
  ),
303
311
  ref: this.componentRef,
304
- style: l ? { ...o, width: void 0 } : o,
312
+ style: n ? { ...i, width: void 0 } : i,
305
313
  dir: t
306
314
  },
307
- this.props.prefix && /* @__PURE__ */ u.createElement(X, { ...Z }),
315
+ this.props.prefix && /* @__PURE__ */ h.createElement(X, { ...Z }),
308
316
  this.renderSearchBar(O || "", N, m),
309
- Q && !h && /* @__PURE__ */ u.createElement(fe, { onClick: this.clearButtonClick, key: "clearbutton" }),
310
- h && /* @__PURE__ */ u.createElement(ae, { className: "k-input-loading-icon", name: "loading", key: "loading" }),
311
- this.props.suffix && /* @__PURE__ */ u.createElement(ee, { ...te }),
312
- /* @__PURE__ */ u.createElement(
317
+ Q && !c && /* @__PURE__ */ h.createElement(be, { onClick: this.clearButtonClick, key: "clearbutton" }),
318
+ c && /* @__PURE__ */ h.createElement(ae, { className: "k-input-loading-icon", name: "loading", key: "loading" }),
319
+ this.props.suffix && /* @__PURE__ */ h.createElement(ee, { ...te }),
320
+ /* @__PURE__ */ h.createElement(
313
321
  q,
314
322
  {
315
323
  tabIndex: -1,
316
324
  type: "button",
317
- "aria-label": c ? e : s,
325
+ "aria-label": u ? e : s,
318
326
  icon: p ? void 0 : "caret-alt-down",
319
- svgIcon: b || be,
327
+ svgIcon: b || xe,
320
328
  iconClass: p,
321
329
  size: I,
322
330
  fillMode: y,
@@ -329,67 +337,72 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
329
337
  ),
330
338
  !L && this.renderListContainer()
331
339
  ), L && this.renderAdaptiveListContainer());
332
- return l ? /* @__PURE__ */ u.createElement(
340
+ return n ? /* @__PURE__ */ h.createElement(
333
341
  pe,
334
342
  {
335
- label: l,
343
+ label: n,
336
344
  editorId: N,
337
345
  editorValue: O,
338
346
  editorValid: _,
339
- editorDisabled: n,
340
- style: { width: o ? o.width : void 0 },
347
+ editorDisabled: a,
348
+ style: { width: i ? i.width : void 0 },
341
349
  children: R
342
350
  }
343
351
  ) : R;
344
352
  }
345
353
  /** @hidden */
346
354
  onNavigate(s, e, t) {
347
- const { data: n = [], virtual: i = { skip: 0 } } = this.props, l = this.props.filter ? this.props.filter : this.state.text, d = this.getFocusedIndex(), a = this.base.vs, r = this.value;
348
- if (this._suggested = "", d !== -1 && !k(r))
355
+ const { data: a = [], virtual: o = { skip: 0 } } = this.props, n = this.props.filter ? this.props.filter : this.state.text;
356
+ let d = -1, l;
357
+ const r = this.base.vs, i = this.value;
358
+ this._suggested = "";
359
+ const c = this.hasDuplicates && this.duplicates.indexOf(i) !== -1;
360
+ if (d = this.getFocusedIndex(c), d !== -1 && !k(i))
349
361
  this.handleItemSelect(d, s);
350
- else if (l === "")
362
+ else if (n === "")
351
363
  this.handleItemSelect(0, s);
352
364
  else {
353
- const o = i.skip + d, h = this.base.navigation.navigate({
365
+ const p = o.skip + d;
366
+ l = this.base.navigation.navigate({
354
367
  keyCode: e,
355
- current: o,
356
- max: (a.enabled ? a.total : n.length) - 1,
368
+ current: p,
369
+ max: (r.enabled ? r.total : a.length) - 1,
357
370
  min: 0,
358
371
  skipItems: t || void 0
359
- });
360
- h !== void 0 && this.handleItemSelect(h, s);
372
+ }), l !== void 0 && this.handleItemSelect(l, s);
361
373
  }
374
+ this.navigationIndex = l;
362
375
  }
363
376
  getCurrentValueDisabledStatus(s, e, t) {
364
377
  return s && e && e[t] && e[t].disabled;
365
378
  }
366
379
  applyValueOnEnter(s, e) {
367
- const { data: t = [], textField: n, allowCustom: i } = this.props, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = S(this.value, n) === s ? this.index : A(t, s, n), r = a !== -1;
368
- let o;
380
+ const { data: t = [], textField: a, allowCustom: o } = this.props, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, l = S(this.value, a) === s ? this.index : z(t, s, a), r = l !== -1;
381
+ let i;
369
382
  if (this._suggested = "", r)
370
- o = t[a];
371
- else if (i)
372
- o = n !== void 0 ? { [n]: s } : s;
383
+ i = t[l];
384
+ else if (o)
385
+ i = a !== void 0 ? { [a]: s } : s;
373
386
  else
374
387
  return this.selectFocusedItem(s, e);
375
- this.triggerOnChange(o, e), l && this.base.togglePopup(e), this.props.filter === void 0 && this.state.text !== void 0 && (e.data.text = void 0), this.applyState(e);
388
+ this.triggerOnChange(i, e), n && this.base.togglePopup(e), this.props.filter === void 0 && this.state.text !== void 0 && (e.data.text = void 0), this.applyState(e);
376
389
  }
377
390
  applyValueOnRejectSuggestions(s, e) {
378
- const { data: t = [], textField: n, allowCustom: i } = this.props, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = S(this.value, n), a = this.state.windowWidth && this.state.windowWidth <= D;
391
+ const { data: t = [], textField: a, allowCustom: o } = this.props, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = S(this.value, a), l = this.state.windowWidth && this.state.windowWidth <= F;
379
392
  if (this._suggested = "", s === d || s === "" && !k(d))
380
- return l && !a && this.base.togglePopup(e), this.applyState(e);
381
- const r = A(t, s, n, !0), o = r !== -1;
382
- let h = null;
383
- o ? h = t[r] : i && (h = s ? n ? { [n]: s } : s : null), this.triggerOnChange(h, e), this.state.text !== void 0 && (e.data.text = void 0, this.base.filterChanged("", e)), l && !a && this.base.togglePopup(e), this.applyState(e);
393
+ return n && !l && this.base.togglePopup(e), this.applyState(e);
394
+ const r = z(t, s, a, !0), i = r !== -1;
395
+ let c = null;
396
+ i ? c = t[r] : o && (c = s ? a ? { [a]: s } : s : null), this.triggerOnChange(c, e), this.state.text !== void 0 && (e.data.text = void 0, this.base.filterChanged("", e)), n && !l && this.base.togglePopup(e), this.applyState(e);
384
397
  }
385
398
  selectFocusedItem(s, e) {
386
- const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: n = [], textField: i, virtual: l = { skip: 0 }, focusedItemIndex: d = K } = this.props, a = l.skip, r = s === "" && a === 0 ? 0 : d(n, s, i);
387
- return r !== -1 ? this.handleItemSelect(r + a, e) : (this.triggerOnChange(null, e), this.state.text !== void 0 && (e.data.text = void 0)), t && this.base.togglePopup(e), this.applyState(e);
399
+ const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: a = [], textField: o, virtual: n = { skip: 0 }, focusedItemIndex: d = A } = this.props, l = n.skip, r = s === "" && l === 0 ? 0 : d(a, s, o);
400
+ return r !== -1 ? this.handleItemSelect(r + l, e) : (this.triggerOnChange(null, e), this.state.text !== void 0 && (e.data.text = void 0)), t && this.base.togglePopup(e), this.applyState(e);
388
401
  }
389
402
  renderAdaptiveListContainer() {
390
- const { windowWidth: s = 0 } = this.state, { header: e, footer: t, size: n, data: i = [], groupField: l, groupMode: d, list: a, virtual: r, adaptiveTitle: o, groupStickyHeaderItemRender: h } = this.props, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
403
+ const { windowWidth: s = 0 } = this.state, { header: e, footer: t, size: a, data: o = [], groupField: n, groupMode: d, list: l, virtual: r, adaptiveTitle: i, groupStickyHeaderItemRender: c } = this.props, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
391
404
  let { group: g } = this.state;
392
- g === void 0 && l !== void 0 && (g = S(i[0], l));
405
+ g === void 0 && n !== void 0 && (g = S(o[0], n));
393
406
  const I = {
394
407
  navigatable: !1,
395
408
  navigatableElements: [],
@@ -399,7 +412,7 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
399
412
  animationStyles: s <= j ? { top: 0, width: "100%", height: "100%" } : void 0,
400
413
  className: s <= j ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
401
414
  };
402
- return /* @__PURE__ */ u.createElement(Ie, { ...I }, /* @__PURE__ */ u.createElement(ye, { className: "k-text-center" }, /* @__PURE__ */ u.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ u.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ u.createElement("div", null, o)), /* @__PURE__ */ u.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ u.createElement(
415
+ return /* @__PURE__ */ h.createElement(ye, { ...I }, /* @__PURE__ */ h.createElement(ke, { className: "k-text-center" }, /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ h.createElement("div", null, i)), /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ h.createElement(
403
416
  q,
404
417
  {
405
418
  tabIndex: 0,
@@ -409,119 +422,120 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
409
422
  fillMode: "flat",
410
423
  onClick: this.toggleBtnClick,
411
424
  icon: "x",
412
- svgIcon: xe
425
+ svgIcon: Ie
413
426
  }
414
- ))), /* @__PURE__ */ u.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, this.renderMobileListFilter())), /* @__PURE__ */ u.createElement(ke, { className: "!k-overflow-hidden" }, /* @__PURE__ */ u.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ u.createElement("div", { className: E(
427
+ ))), /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, this.renderMobileListFilter())), /* @__PURE__ */ h.createElement(Ce, { className: "!k-overflow-hidden" }, /* @__PURE__ */ h.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ h.createElement("div", { className: D(
415
428
  {
416
- "k-list": !a,
429
+ "k-list": !l,
417
430
  "k-list-lg": !0,
418
431
  "k-virtual-list": r,
419
- "k-data-table": a,
420
- [`k-table-${V[n] || n}`]: a && n
432
+ "k-data-table": l,
433
+ [`k-table-${M[a] || a}`]: l && a
421
434
  }
422
- ) }, e && /* @__PURE__ */ u.createElement("div", { className: "k-table-header" }, e), !a && g && i.length !== 0 && /* @__PURE__ */ u.createElement(H, { group: g, groupMode: d, render: h }), this.renderList(), t && /* @__PURE__ */ u.createElement("div", { className: "k-list-footer" }, t)))));
435
+ ) }, e && /* @__PURE__ */ h.createElement("div", { className: "k-table-header" }, e), !l && g && o.length !== 0 && /* @__PURE__ */ h.createElement(H, { group: g, groupMode: d, render: c }), this.renderList(), t && /* @__PURE__ */ h.createElement("div", { className: "k-list-footer" }, t)))));
423
436
  }
424
437
  renderListContainer() {
425
- const s = this.base, { dir: e, header: t, footer: n, data: i = [], groupField: l, groupMode: d, size: a, list: r, virtual: o, groupStickyHeaderItemRender: h } = this.props, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = s.getPopupSettings(), I = g.width !== void 0 ? g.width : s.popupWidth;
438
+ const s = this.base, { dir: e, header: t, footer: a, data: o = [], groupField: n, groupMode: d, size: l, list: r, virtual: i, groupStickyHeaderItemRender: c } = this.props, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = s.getPopupSettings(), I = g.width !== void 0 ? g.width : s.popupWidth;
426
439
  let { group: v } = this.state;
427
- return v === void 0 && l !== void 0 && (v = S(i[0], l)), /* @__PURE__ */ u.createElement(
428
- ce,
440
+ return v === void 0 && n !== void 0 && (v = S(o[0], n)), /* @__PURE__ */ h.createElement(
441
+ ge,
429
442
  {
430
443
  width: I,
431
444
  popupSettings: {
432
445
  ...g,
433
446
  anchor: g.anchor || this.element,
434
447
  show: p,
435
- popupClass: E(
448
+ popupClass: D(
436
449
  g.popupClass,
437
450
  "k-list-container",
438
451
  "k-combobox-popup"
439
452
  )
440
453
  },
441
454
  dir: e !== void 0 ? e : this.base.dirCalculated,
442
- itemsCount: [i.length]
455
+ itemsCount: [o.length]
443
456
  },
444
- /* @__PURE__ */ u.createElement("div", { className: E(
457
+ /* @__PURE__ */ h.createElement("div", { className: D(
445
458
  {
446
459
  "k-list": !r,
447
- [`k-list-${V[a] || a}`]: !r && a,
448
- "k-virtual-list": o,
460
+ [`k-list-${M[l] || l}`]: !r && l,
461
+ "k-virtual-list": i,
449
462
  "k-data-table": r,
450
- [`k-table-${V[a] || a}`]: r && a
463
+ [`k-table-${M[l] || l}`]: r && l
451
464
  }
452
- ) }, t && /* @__PURE__ */ u.createElement("div", { className: "k-table-header" }, t), !r && v && i.length !== 0 && /* @__PURE__ */ u.createElement(H, { group: v, groupMode: d, render: h }), this.renderList(), n && /* @__PURE__ */ u.createElement("div", { className: E(
465
+ ) }, t && /* @__PURE__ */ h.createElement("div", { className: "k-table-header" }, t), !r && v && o.length !== 0 && /* @__PURE__ */ h.createElement(H, { group: v, groupMode: d, render: c }), this.renderList(), a && /* @__PURE__ */ h.createElement("div", { className: D(
453
466
  {
454
467
  "k-list-footer": !this.props.footerClassName
455
468
  },
456
469
  this.props.footerClassName
457
- ) }, n))
470
+ ) }, a))
458
471
  );
459
472
  }
460
473
  renderList() {
461
474
  const s = this.base, {
462
475
  textField: e,
463
476
  dataItemKey: t,
464
- listNoDataRender: n,
465
- itemRender: i,
466
- groupHeaderItemRender: l,
477
+ listNoDataRender: a,
478
+ itemRender: o,
479
+ groupHeaderItemRender: n,
467
480
  data: d = [],
468
- virtual: a = { skip: 0, total: void 0 }
469
- } = this.props, r = s.getPopupSettings(), o = s.vs, h = a.skip, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = `translateY(${o.translate}px)`, I = p ? this.getFocusedIndex() : void 0, v = this.props.filter !== void 0 ? this.props.filter : this.state.text, y = S(this.value, e), c = k(v) && v !== y ? null : this.value, m = this.props.list || ge;
470
- return /* @__PURE__ */ u.createElement(
481
+ virtual: l = { skip: 0, total: void 0 }
482
+ } = this.props, r = s.getPopupSettings(), i = s.vs, c = l.skip, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = `translateY(${i.translate}px)`, I = p ? this.getFocusedIndex(this.hasDuplicates) : void 0, v = this.props.filter !== void 0 ? this.props.filter : this.state.text, y = S(this.value, e), u = k(v) && v !== y ? null : this.value, m = this.props.list || me;
483
+ return /* @__PURE__ */ h.createElement(
471
484
  m,
472
485
  {
473
486
  id: s.listBoxId,
474
- virtual: !!a,
487
+ virtual: !!l,
475
488
  show: p,
476
489
  data: d,
477
490
  focusedIndex: I,
478
- value: c,
491
+ value: u,
479
492
  textField: e,
480
493
  valueField: t,
481
494
  groupField: this.props.groupField,
482
495
  groupMode: this.props.groupMode,
483
496
  isMultiColumn: this.props.isMultiColumn,
484
497
  optionsGuid: s.guid,
498
+ hasDuplicates: this.hasDuplicates,
485
499
  listRef: (b) => {
486
- o.list = this.base.list = b, this.itemHeight = 0;
500
+ i.list = this.base.list = b, this.itemHeight = 0;
487
501
  },
488
- wrapperStyle: this.state.windowWidth && this.state.windowWidth > D ? { maxHeight: r.height } : {},
489
- wrapperCssClass: E(
502
+ wrapperStyle: this.state.windowWidth && this.state.windowWidth > F ? { maxHeight: r.height } : {},
503
+ wrapperCssClass: D(
490
504
  "k-list-content",
491
505
  {
492
- "k-list-scroller": !a
506
+ "k-list-scroller": !l
493
507
  }
494
508
  ),
495
- listStyle: o.enabled ? { transform: g } : void 0,
509
+ listStyle: i.enabled ? { transform: g } : void 0,
496
510
  key: "listkey",
497
- skip: h,
511
+ skip: c,
498
512
  onClick: this.handleItemClick,
499
- itemRender: i,
500
- groupHeaderItemRender: l,
501
- noDataRender: n,
513
+ itemRender: o,
514
+ groupHeaderItemRender: n,
515
+ noDataRender: a,
502
516
  onMouseDown: (b) => b.preventDefault(),
503
517
  onScroll: this.onScroll,
504
- wrapperRef: o.scrollerRef,
518
+ wrapperRef: i.scrollerRef,
505
519
  scroller: this.base.renderScrollElement(),
506
- ariaSetSize: a.total
520
+ ariaSetSize: l.total
507
521
  }
508
522
  );
509
523
  }
510
524
  renderSearchBar(s, e, t) {
511
525
  const {
512
- tabIndex: n,
513
- disabled: i,
514
- data: l = [],
526
+ tabIndex: a,
527
+ disabled: o,
528
+ data: n = [],
515
529
  dataItemKey: d,
516
- virtual: a = { skip: 0 }
517
- } = this.props, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, o = this.value, h = Math.max(0, l.findIndex((p) => C(p, o, d)));
518
- return this._suggested && !C(this._valueOnDidUpdate, o, d) && (this._suggested = ""), /* @__PURE__ */ u.createElement(
530
+ virtual: l = { skip: 0 }
531
+ } = this.props, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, i = this.value, c = Math.max(0, n.findIndex((p) => C(p, i, d)));
532
+ return this._suggested && !C(this._valueOnDidUpdate, i, d) && (this._suggested = ""), /* @__PURE__ */ h.createElement(
519
533
  ue,
520
534
  {
521
535
  id: e,
522
536
  readOnly: r && this.mobileMode,
523
537
  placeholder: t,
524
- tabIndex: n,
538
+ tabIndex: a,
525
539
  title: this.props.title,
526
540
  accessKey: this.props.accessKey,
527
541
  value: s + this._suggested,
@@ -532,10 +546,10 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
532
546
  onChange: this.inputOnChange,
533
547
  onFocus: this.base.handleFocus,
534
548
  onBlur: this.handleBlur,
535
- disabled: i,
549
+ disabled: o,
536
550
  expanded: r,
537
551
  owns: this.base.listBoxId,
538
- activedescendant: `option-${this.base.guid}-${h + a.skip}`,
552
+ activedescendant: `option-${this.base.guid}-${c + l.skip}`,
539
553
  role: "combobox",
540
554
  ariaLabelledBy: this.props.ariaLabelledBy,
541
555
  ariaDescribedBy: this.props.ariaDescribedBy,
@@ -546,21 +560,21 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
546
560
  }
547
561
  clearValue() {
548
562
  const s = this.base.initState();
549
- this._suggested = "", this.base.filterChanged("", s), this.props.filter === void 0 && this.state.text !== void 0 && (s.data.text = void 0), this.triggerOnChange(null, s);
563
+ this._suggested = "", this.navigationIndex = void 0, this.base.filterChanged("", s), this.props.filter === void 0 && this.state.text !== void 0 && (s.data.text = void 0), this.triggerOnChange(null, s);
550
564
  const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, t = this.mobileMode;
551
565
  e && !t && this.base.togglePopup(s), this.applyState(s);
552
566
  }
553
567
  triggerOnChange(s, e) {
554
568
  const t = this.value;
555
- !k(t) && !k(s) || C(t, s, this.props.dataItemKey) || (this.props.value === void 0 && (e.data.value = s), this._valueDuringOnChange = s, e.events.push({ type: "onChange" }));
569
+ !this.hasDuplicates && (!k(t) && !k(s) || C(t, s, this.props.dataItemKey)) || (this.props.value === void 0 && (e.data.value = s), this._valueDuringOnChange = s, e.events.push({ type: "onChange" }));
556
570
  }
557
- getFocusedIndex() {
558
- const s = this.value, { data: e = [], textField: t, dataItemKey: n, virtual: i = { skip: 0 }, focusedItemIndex: l = K, skipDisabledItems: d } = this.props, a = this.props.filter ? this.props.filter : this.state.text;
559
- return k(s) && a === void 0 ? e.findIndex((r) => C(r, s, n)) : a ? l(e, a, t) : d && t && !a && i.skip === 0 ? e.findIndex((r) => !r.disabled && r[t]) : i.skip === 0 ? 0 : -1;
571
+ getFocusedIndex(s) {
572
+ const e = this.value, { data: t = [], textField: a, dataItemKey: o, virtual: n = { skip: 0 }, focusedItemIndex: d = A, skipDisabledItems: l } = this.props, r = this.props.filter ? this.props.filter : this.state.text;
573
+ return s && this.navigationIndex !== void 0 ? this.navigationIndex : k(e) && r === void 0 ? t.findIndex((i) => C(i, e, o)) : r ? d(t, r, a) : l && a && !r && n.skip === 0 ? t.findIndex((i) => !i.disabled && i[a]) : n.skip === 0 ? 0 : -1;
560
574
  }
561
575
  suggestValue(s) {
562
576
  const { data: e, textField: t } = this.props;
563
- this._suggested = he(s, e, t);
577
+ this._suggested = ce(s, e, t);
564
578
  }
565
579
  applyState(s) {
566
580
  this.base.applyState(s), this._valueDuringOnChange = void 0;
@@ -609,10 +623,10 @@ w.displayName = "ComboBox", w.propTypes = {
609
623
  suffix: void 0
610
624
  };
611
625
  let T = w;
612
- const we = ne(), Ee = le(re(we, T));
626
+ const De = ne(), Ee = le(re(De, T));
613
627
  Ee.displayName = "KendoReactComboBox";
614
628
  export {
615
629
  Ee as ComboBox,
616
- we as ComboBoxPropsContext,
630
+ De as ComboBoxPropsContext,
617
631
  T as ComboBoxWithoutContext
618
632
  };