@progress/kendo-react-dropdowns 11.0.0-develop.3 → 11.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,189 +5,228 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as c from "react";
9
- import v from "prop-types";
10
- import N from "../common/DropDownBase.mjs";
11
- import { Keys as C, validatePackage as ie, svgIconPropType as oe, canUseDOM as z, classNames as I, uComboBox as w, IconWrap as ae, uDropDownsActionSheet as B, WatermarkOverlay as ne, createPropsContext as le, withIdHOC as re, withPropsContext as de, withUnstyledHOC as pe, withAdaptiveModeContext as he } from "@progress/kendo-react-common";
12
- import { FloatingLabel as ce } from "@progress/kendo-react-labels";
13
- import { getPlainDataDuplicates as ue, getFilteredData as S, areSame as k, getItemValue as M, isPresent as D, getItemIndexByText as K, suggestValue as ge, itemIndexStartsWith as H } from "../common/utils.mjs";
14
- import me from "../common/SearchBar.mjs";
15
- import ve from "../common/ListContainer.mjs";
16
- import fe from "../common/List.mjs";
17
- import be from "../common/ListFilter.mjs";
18
- import W from "../common/GroupStickyHeader.mjs";
19
- import { packageMetadata as xe } from "../package-metadata.mjs";
20
- import Ie from "../common/ClearButton.mjs";
21
- import { Button as q } from "@progress/kendo-react-buttons";
22
- import { caretAltDownIcon as ye, xIcon as Ce } from "@progress/kendo-svg-icons";
23
- import { comboArrowBtnAriaLabelExpand as G, messages as U, comboArrowBtnAriaLabelCollapse as j } from "../messages/index.mjs";
24
- import { provideLocalizationService as $ } from "@progress/kendo-react-intl";
25
- import { ActionSheet as Se, ActionSheetHeader as we, ActionSheetContent as De } from "@progress/kendo-react-layout";
26
- import Y from "../common/withCustomComponent.mjs";
27
- const ke = "Please enter a valid value!", F = class F extends c.Component {
8
+ import * as g from "react";
9
+ import m from "prop-types";
10
+ import _ from "../common/DropDownBase.mjs";
11
+ import { classNames as S, uComboBox as k, Keys as y, validatePackage as tt, svgIconPropType as et, canUseDOM as R, IconWrap as st, WatermarkOverlay as it, createPropsContext as ot, withIdHOC as at, withPropsContext as nt, withUnstyledHOC as lt, withAdaptiveModeContext as rt } from "@progress/kendo-react-common";
12
+ import { FloatingLabel as pt } from "@progress/kendo-react-labels";
13
+ import { getPlainDataDuplicates as dt, getFilteredData as C, areSame as F, getItemValue as D, isPresent as w, getItemIndexByText as A, suggestValue as ht, itemIndexStartsWith as z } from "../common/utils.mjs";
14
+ import ut from "../common/SearchBar.mjs";
15
+ import ct from "../common/ListContainer.mjs";
16
+ import gt from "../common/List.mjs";
17
+ import mt from "../common/ListFilter.mjs";
18
+ import K from "../common/GroupStickyHeader.mjs";
19
+ import { packageMetadata as vt } from "../package-metadata.mjs";
20
+ import ft from "../common/ClearButton.mjs";
21
+ import { Button as bt } from "@progress/kendo-react-buttons";
22
+ import { caretAltDownIcon as xt } from "@progress/kendo-svg-icons";
23
+ import { comboArrowBtnAriaLabelExpand as H, messages as W, comboArrowBtnAriaLabelCollapse as q } from "../messages/index.mjs";
24
+ import { provideLocalizationService as G } from "@progress/kendo-react-intl";
25
+ import { ActionSheetContent as It } from "@progress/kendo-react-layout";
26
+ import U from "../common/withCustomComponent.mjs";
27
+ import { AdaptiveMode as yt } from "../common/AdaptiveMode.mjs";
28
+ const Ct = "Please enter a valid value!", M = class M extends g.Component {
28
29
  constructor(s) {
29
- super(s), this.state = {}, this.base = new N(this), this._element = null, this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this.itemHeight = 0, this.duplicates = [], this.hasDuplicates = !1, this.showLicenseWatermark = !1, this.focus = () => {
30
+ super(s), this.state = {}, this.base = new _(this), this._element = null, this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this._skipFocus = !1, this.itemHeight = 0, this.duplicates = [], this.hasDuplicates = !1, this.showLicenseWatermark = !1, this.focus = () => {
30
31
  this._input && this._input.focus();
31
32
  }, this.checkForDuplicatePlainTextRecords = () => {
32
- const e = this.props.textField !== void 0, t = this.props.dataItemKey !== void 0;
33
- if (this.props.data && this.props.data.length > 0 && !e && !t) {
33
+ const t = this.props.textField !== void 0, e = this.props.dataItemKey !== void 0;
34
+ if (this.props.data && this.props.data.length > 0 && !t && !e) {
34
35
  const i = this.props.data;
35
- this.duplicates = ue(i), this.hasDuplicates = this.duplicates.length > 0;
36
+ this.duplicates = dt(i), this.hasDuplicates = this.duplicates.length > 0;
36
37
  }
37
- }, this.handleItemSelect = (e, t) => {
38
- const { virtual: i, dataItemKey: n } = this.props, r = S(this.props), a = i ? i.skip : 0, d = r[e - a], l = this.hasDuplicates || !k(d, this.value, n);
39
- this.triggerOnChange(d, t), this.state.text !== void 0 && (t.data.text = void 0), l && this.base.triggerPageChangeCornerItems(d, t);
38
+ }, this.handleItemSelect = (t, e) => {
39
+ const { virtual: i, dataItemKey: r } = this.props, l = C(this.props), a = i ? i.skip : 0, p = l[t - a], n = this.hasDuplicates || !F(p, this.value, r);
40
+ this.triggerOnChange(p, e), this.state.text !== void 0 && (e.data.text = void 0), n && this.base.triggerPageChangeCornerItems(p, e);
40
41
  }, this.onPopupOpened = () => {
41
42
  setTimeout(() => {
42
43
  this.mobileMode && this._adaptiveFilterInput && (this._skipBlur = !0, this._adaptiveFilterInput.focus(), this._skipBlur = !1);
43
44
  }, 300);
44
- }, this.componentRef = (e) => {
45
- this._element = e, this.base.wrapper = e;
46
- }, this.toggleBtnClick = (e) => {
47
- const { skipDisabledItems: t, textField: i } = this.props, n = S(this.props), r = this.getFocusedIndex(), a = this.getCurrentValueDisabledStatus(i, n, r), d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, l = this.base.initState();
48
- if (l.syntheticEvent = e, !t && i && a && this.clearValueOnToggleBtnClick(e), this.base.togglePopup(l), !d && this.mobileMode) {
45
+ }, this.componentRef = (t) => {
46
+ this._element = t, this.base.wrapper = t;
47
+ }, this.toggleBtnClick = (t) => {
48
+ this._skipFocus = !0;
49
+ const { skipDisabledItems: e, textField: i } = this.props, r = C(this.props), l = this.getFocusedIndex(), a = this.getCurrentValueDisabledStatus(i, r, l), p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, n = this.base.initState();
50
+ if (n.syntheticEvent = t, !e && i && a && this.clearValueOnToggleBtnClick(t), this.base.togglePopup(n), !p && this.mobileMode) {
49
51
  const o = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
50
- this.base.filterChanged(o, l);
52
+ this.base.filterChanged(o, n);
51
53
  }
52
- this.applyState(l);
53
- }, this.closeOpenedApplyStateNonMobileMode = (e, t) => {
54
- t && !this.mobileMode && this.base.togglePopup(e);
54
+ this.applyState(n), setTimeout(() => {
55
+ this._skipFocus = !1;
56
+ }, 300);
57
+ }, this.closeOpenedApplyStateNonMobileMode = (t, e) => {
58
+ e && !this.mobileMode && this.base.togglePopup(t);
55
59
  }, this.renderMobileListFilter = () => {
56
- const e = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, t = M(this.value, this.props.textField), i = D(e) ? e : t;
57
- return /* @__PURE__ */ c.createElement(
58
- be,
60
+ const t = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, e = D(this.value, this.props.textField), i = w(t) ? t : e;
61
+ return /* @__PURE__ */ g.createElement(
62
+ mt,
59
63
  {
60
64
  value: i,
61
- ref: (n) => {
62
- this._adaptiveFilterInput = n && n.element;
65
+ ref: (r) => {
66
+ this._adaptiveFilterInput = r && r.element;
63
67
  },
64
68
  onChange: this.handleMobileFilterChange,
65
69
  onKeyDown: this.onInputKeyDown,
66
70
  size: "large",
67
71
  rounded: this.props.rounded,
68
- fillMode: this.props.fillMode
72
+ fillMode: this.props.fillMode,
73
+ placeholder: this.props.placeholder
69
74
  }
70
75
  );
71
- }, this.handleMobileFilterChange = (e) => {
72
- const t = this.base.initState();
73
- t.syntheticEvent = e.syntheticEvent, t.data.text = e.target.value, this.base.filterChanged(e.target.value, t), this.applyState(t);
74
- }, this.onScroll = (e) => {
75
- const { vs: t, list: i } = this.base;
76
- t.scrollHandler(e);
77
- const { groupField: n } = this.props;
78
- let r = S(this.props);
79
- if (!n || !r.length)
76
+ }, this.listContainerContent = () => {
77
+ const { header: t, footer: e, size: i, groupStickyHeaderItemRender: r, groupField: l, list: a, groupMode: p, unstyled: n, virtual: o } = this.props, h = C(this.props), d = n && n.uComboBox;
78
+ let { group: v } = this.state;
79
+ return v === void 0 && l !== void 0 && (v = D(h[0], l)), /* @__PURE__ */ g.createElement(
80
+ "div",
81
+ {
82
+ className: S(
83
+ k.list({
84
+ c: d,
85
+ list: a,
86
+ size: "large",
87
+ tableSize: i,
88
+ virtual: o
89
+ })
90
+ )
91
+ },
92
+ t && /* @__PURE__ */ g.createElement("div", { className: S(k.listHeader({ c: d })) }, t),
93
+ !a && v && h.length !== 0 && /* @__PURE__ */ g.createElement(K, { group: v, groupMode: p, render: r }),
94
+ this.renderList(),
95
+ e && /* @__PURE__ */ g.createElement(
96
+ "div",
97
+ {
98
+ className: S(k.listFooter({ c: d }), this.props.footerClassName)
99
+ },
100
+ e
101
+ )
102
+ );
103
+ }, this.handleMobileFilterChange = (t) => {
104
+ const e = this.base.initState();
105
+ e.syntheticEvent = t.syntheticEvent, e.data.text = t.target.value, this.base.filterChanged(t.target.value, e), this.applyState(e);
106
+ }, this.onScroll = (t) => {
107
+ const { vs: e, list: i } = this.base;
108
+ e.scrollHandler(t);
109
+ const { groupField: r } = this.props;
110
+ let l = C(this.props);
111
+ if (!r || !l.length)
80
112
  return;
81
- const a = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : i ? i.children[0].offsetHeight : 0), l = e.target.scrollTop - t.skip * a;
82
- this.props.groupMode === "modern" && (r = this.base.getGroupedDataModernMode(r, n));
83
- let o = r[0][n];
84
- for (let u = 1; u < r.length && !(a * u > l); u++)
85
- r[u] && r[u][n] && (o = r[u][n]);
113
+ const a = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : i ? i.children[0].offsetHeight : 0), n = t.target.scrollTop - e.skip * a;
114
+ this.props.groupMode === "modern" && (l = this.base.getGroupedDataModernMode(l, r));
115
+ let o = l[0][r];
116
+ for (let h = 1; h < l.length && !(a * h > n); h++)
117
+ l[h] && l[h][r] && (o = l[h][r]);
86
118
  o !== this.state.group && (this.setState({
87
119
  group: o
88
120
  }), this.props.onGroupScroll && this.props.onGroupScroll.call(void 0, { group: o }));
89
- }, this.handleItemClick = (e, t) => {
90
- this.navigationIndex = e, this.base.handleItemClick(e, t), this._valueDuringOnChange = void 0;
91
- }, this.handleBlur = (e) => {
121
+ }, this.handleItemClick = (t, e) => {
122
+ this.navigationIndex = t, this.base.handleItemClick(t, e), this._valueDuringOnChange = void 0;
123
+ }, this.handleBlur = (t) => {
92
124
  if (this.state.focused && !this._skipBlur) {
93
- const t = this.base.initState(), { textField: i } = this.props, n = S(this.props), r = this.getFocusedIndex(), d = !(r === -1) && this.getCurrentValueDisabledStatus(i, n, r);
94
- t.data.focused = !1, t.events.push({ type: "onBlur" }), t.syntheticEvent = e, i && d && this.clearValueOnBlur(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, t);
125
+ const e = this.base.initState(), { textField: i } = this.props, r = C(this.props), l = this.getFocusedIndex(), p = !(l === -1) && this.getCurrentValueDisabledStatus(i, r, l);
126
+ e.data.focused = !1, e.events.push({ type: "onBlur" }), e.syntheticEvent = t, i && p && this.clearValueOnBlur(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, e);
95
127
  }
96
- }, this.onInputClick = (e) => {
97
- const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, i = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
98
- if (!t && this.mobileMode) {
99
- const n = this.base.initState();
100
- n.syntheticEvent = e, this.base.togglePopup(n), this.base.filterChanged(i, n), this.applyState(n);
128
+ }, this.onInputClick = (t) => {
129
+ const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, i = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
130
+ if (!e && this.mobileMode) {
131
+ const r = this.base.initState();
132
+ r.syntheticEvent = t, this.base.togglePopup(r), this.base.filterChanged(i, r), this.applyState(r);
101
133
  }
102
- }, this.onInputKeyDown = (e) => {
103
- const { skipDisabledItems: t, textField: i, dataItemKey: n, groupField: r } = this.props, a = S(this.props), d = this.value, l = Math.max(
134
+ }, this.onInputKeyDown = (t) => {
135
+ const { skipDisabledItems: e, textField: i, dataItemKey: r, groupField: l } = this.props, a = C(this.props), p = this.value, n = Math.max(
104
136
  0,
105
- a.findIndex((h) => k(h, d, n))
106
- ), o = e.keyCode, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = this.base.initState();
107
- if (p.syntheticEvent = e, !e.altKey && (o === C.up || o === C.down)) {
108
- if (e.preventDefault(), r !== "" && i)
109
- if (!this.props.skipDisabledItems && u)
110
- this.onNavigate(p, o);
137
+ a.findIndex((u) => F(u, p, r))
138
+ ), o = t.keyCode, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = this.base.initState();
139
+ if (d.syntheticEvent = t, !t.altKey && (o === y.up || o === y.down)) {
140
+ if (t.preventDefault(), l !== "" && i)
141
+ if (!this.props.skipDisabledItems && h)
142
+ this.onNavigate(d, o);
111
143
  else {
112
- let h = 0;
113
- if (o === C.down || o === C.right) {
114
- const g = a.slice(l + 1 < a.length ? l + 1 : l).find((f) => !f.disabled && f[i]);
115
- h = g && a.findIndex((f) => f[i] === g[i]);
116
- } else if (o === C.up || o === C.left) {
117
- let g;
118
- if (l === 0)
119
- g = a, h = a.findIndex((f) => !f.disabled && f[i]);
144
+ let u = 0;
145
+ if (o === y.down || o === y.right) {
146
+ const c = a.slice(n + 1 < a.length ? n + 1 : n).find((f) => !f.disabled && f[i]);
147
+ u = c && a.findIndex((f) => f[i] === c[i]);
148
+ } else if (o === y.up || o === y.left) {
149
+ let c;
150
+ if (n === 0)
151
+ c = a, u = a.findIndex((f) => !f.disabled && f[i]);
120
152
  else {
121
- g = a.slice(0, l);
122
- let f = g.pop();
153
+ c = a.slice(0, n);
154
+ let f = c.pop();
123
155
  for (; f && f.disabled; )
124
- f = g.pop();
125
- h = f && a.findIndex((E) => E[i] === f[i]);
156
+ f = c.pop();
157
+ u = f && a.findIndex((E) => E[i] === f[i]);
126
158
  }
127
159
  }
128
- if (h !== void 0) {
129
- const g = h - l;
130
- this.onNavigate(p, o, g);
131
- } else h === void 0 && a.findIndex((g) => g[i] === d[i]) === a.length - 1 && this.onNavigate(p, o);
160
+ if (u !== void 0) {
161
+ const c = u - n;
162
+ this.onNavigate(d, o, c);
163
+ } else u === void 0 && a.findIndex((c) => c[i] === p[i]) === a.length - 1 && this.onNavigate(d, o);
132
164
  }
133
- else if (!this.props.skipDisabledItems && u)
134
- this.onNavigate(p, o);
165
+ else if (!this.props.skipDisabledItems && h)
166
+ this.onNavigate(d, o);
135
167
  else {
136
- let h = null;
137
- if (o === C.down || o === C.right)
138
- h = a.slice(l + 1).find((g) => !g.disabled);
139
- else if (o === C.up || o === C.left) {
140
- const g = a.slice(0, l);
141
- for (h = g.pop(); h && h.disabled; )
142
- h = g.pop();
168
+ let u = null;
169
+ if (o === y.down || o === y.right)
170
+ u = a.slice(n + 1).find((c) => !c.disabled);
171
+ else if (o === y.up || o === y.left) {
172
+ const c = a.slice(0, n);
173
+ for (u = c.pop(); u && u.disabled; )
174
+ u = c.pop();
143
175
  }
144
- if (h) {
145
- const g = h.id - l - 1;
146
- this.onNavigate(p, o, g);
176
+ if (u) {
177
+ const c = u.id - n - 1;
178
+ this.onNavigate(d, o, c);
147
179
  } else
148
- this.onNavigate(p, o);
180
+ this.onNavigate(d, o);
149
181
  }
150
- this.applyState(p);
182
+ this.applyState(d);
151
183
  }
152
- const y = () => {
153
- e.preventDefault(), this.base.togglePopup(p), this.applyState(p);
154
- }, b = this.getFocusedIndex(), x = b === -1, m = !x && this.getCurrentValueDisabledStatus(i, a, b);
155
- u ? o === C.pageUp ? (e.preventDefault(), this.base.scrollPopupByPageSize(-1)) : o === C.pageDown ? (e.preventDefault(), this.base.scrollPopupByPageSize(1)) : e.altKey && o === C.up ? y() : o === C.enter ? (e.preventDefault(), (i && !x && e.currentTarget.value ? a[b][i] : void 0) ? !t && i && m ? this.clearValueOnEnterOrEsc(e) : m || this.applyValueOnEnter(e.currentTarget.value, p) : this.applyValueOnEnter(e.currentTarget.value, p)) : o === C.esc && (!t && i && m && this.clearValueOnEnterOrEsc(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, p)) : !u && o === C.esc ? this.clearValueOnEnterOrEsc(e) : e.altKey && o === C.down && y();
156
- }, this.inputOnChange = (e) => {
157
- const t = this.base.initState();
158
- t.syntheticEvent = e;
159
- const i = this.props.opened !== void 0 ? this.props.opened : this.state.opened, n = e.currentTarget, r = n.value;
184
+ const v = () => {
185
+ t.preventDefault(), this.base.togglePopup(d), this.applyState(d);
186
+ }, x = this.getFocusedIndex(), I = x === -1, b = !I && this.getCurrentValueDisabledStatus(i, a, x);
187
+ h ? o === y.pageUp ? (t.preventDefault(), this.base.scrollPopupByPageSize(-1)) : o === y.pageDown ? (t.preventDefault(), this.base.scrollPopupByPageSize(1)) : t.altKey && o === y.up ? v() : o === y.enter ? (t.preventDefault(), (i && !I && t.currentTarget.value ? a[x][i] : void 0) ? !e && i && b ? this.clearValueOnEnterOrEsc(t) : b || this.applyValueOnEnter(t.currentTarget.value, d) : this.applyValueOnEnter(t.currentTarget.value, d)) : o === y.esc && (!e && i && b && this.clearValueOnEnterOrEsc(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, d)) : !h && o === y.esc ? this.clearValueOnEnterOrEsc(t) : t.altKey && o === y.down && v();
188
+ }, this.inputOnChange = (t) => {
189
+ const e = this.base.initState();
190
+ e.syntheticEvent = t;
191
+ const i = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = t.currentTarget, l = r.value;
160
192
  if (this.props.suggest) {
161
- const a = n.selectionEnd === r.length;
162
- let d = this.props.filter !== void 0 ? this.props.filter : this.state.text;
163
- D(d) || (d = M(this.value, this.props.textField) || "");
164
- const l = d && d === r, o = d && d.length > r.length;
165
- l || o || !a ? this._suggested = "" : this.suggestValue(r);
193
+ const a = r.selectionEnd === l.length;
194
+ let p = this.props.filter !== void 0 ? this.props.filter : this.state.text;
195
+ w(p) || (p = D(this.value, this.props.textField) || "");
196
+ const n = p && p === l, o = p && p.length > l.length;
197
+ n || o || !a ? this._suggested = "" : this.suggestValue(l);
166
198
  }
167
- this.props.filter === void 0 && (t.data.text = r), this.state.focusedItem !== void 0 && (t.data.focusedItem = void 0), i || this.base.togglePopup(t), this.base.filterChanged(r, t), this.applyState(t), this.setState({ group: void 0 });
168
- }, this.clearButtonClick = (e) => {
169
- const t = this.base.initState();
170
- t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
171
- }, this.clearValueOnEnterOrEsc = (e) => {
172
- const t = this.base.initState();
173
- t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
174
- }, this.clearValueOnBlur = (e) => {
175
- const t = this.base.initState();
176
- t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
177
- }, this.clearValueOnToggleBtnClick = (e) => {
178
- const t = this.base.initState();
179
- t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
199
+ this.props.filter === void 0 && (e.data.text = l), this.state.focusedItem !== void 0 && (e.data.focusedItem = void 0), i || this.base.togglePopup(e), this.base.filterChanged(l, e), this.applyState(e), this.setState({ group: void 0 });
200
+ }, this.clearButtonClick = (t) => {
201
+ const e = this.base.initState();
202
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
203
+ }, this.clearValueOnEnterOrEsc = (t) => {
204
+ const e = this.base.initState();
205
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
206
+ }, this.clearValueOnBlur = (t) => {
207
+ const e = this.base.initState();
208
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
209
+ }, this.clearValueOnToggleBtnClick = (t) => {
210
+ const e = this.base.initState();
211
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
180
212
  }, this.setValidity = () => {
181
213
  this._input && this._input.setCustomValidity && this._input.setCustomValidity(
182
- this.validity.valid ? "" : this.props.validationMessage || ke
214
+ this.validity.valid ? "" : this.props.validationMessage || Ct
183
215
  );
184
- }, this.showLicenseWatermark = !ie(xe, { component: "ComboBox" });
216
+ }, this.handleFocus = (t) => {
217
+ if (this._skipFocus)
218
+ return;
219
+ const e = this.base.initState();
220
+ e.syntheticEvent = t, this.mobileMode && !this._skipFocus && (this._skipFocus = !0, this.base.togglePopup(e), this.applyState(e), setTimeout(() => {
221
+ this._skipFocus = !1;
222
+ }, 300)), this.base.handleFocus(t);
223
+ }, this.showLicenseWatermark = !tt(vt, { component: "ComboBox" });
185
224
  }
186
225
  get _inputId() {
187
226
  return this.props.id;
188
227
  }
189
228
  get document() {
190
- if (z)
229
+ if (R)
191
230
  return this.element && this.element.ownerDocument || document;
192
231
  }
193
232
  /** @hidden */
@@ -198,8 +237,8 @@ const ke = "Please enter a valid value!", F = class F extends c.Component {
198
237
  * The mobile mode of the ComboBox.
199
238
  */
200
239
  get mobileMode() {
201
- var e;
202
- return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((e = this.props._adaptiveMode) == null ? void 0 : e.medium) && this.props.adaptive);
240
+ var t;
241
+ return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((t = this.props._adaptiveMode) == null ? void 0 : t.medium) && this.props.adaptive);
203
242
  }
204
243
  /**
205
244
  * The value of the ComboBox.
@@ -218,8 +257,8 @@ const ke = "Please enter a valid value!", F = class F extends c.Component {
218
257
  * The index of the selected item.
219
258
  */
220
259
  get index() {
221
- const { dataItemKey: s } = this.props, e = S(this.props), t = this.value;
222
- return e.findIndex((i) => k(i, t, s));
260
+ const { dataItemKey: s } = this.props, t = C(this.props), e = this.value;
261
+ return t.findIndex((i) => F(i, e, s));
223
262
  }
224
263
  /**
225
264
  * Gets the `name` property of the ComboBox.
@@ -231,41 +270,41 @@ const ke = "Please enter a valid value!", F = class F extends c.Component {
231
270
  * Represents the validity state into which the component is set.
232
271
  */
233
272
  get validity() {
234
- const s = this.props.validationMessage !== void 0, e = !this.required || this.value !== null && this.value !== "" && this.value !== void 0, t = this.props.valid !== void 0 ? this.props.valid : e;
273
+ const s = this.props.validationMessage !== void 0, t = !this.required || this.value !== null && this.value !== "" && this.value !== void 0, e = this.props.valid !== void 0 ? this.props.valid : t;
235
274
  return {
236
275
  customError: s,
237
- valid: t,
276
+ valid: e,
238
277
  valueMissing: this.value === null
239
278
  };
240
279
  }
241
280
  get validityStyles() {
242
- return this.props.validityStyles !== void 0 ? this.props.validityStyles : F.defaultProps.validityStyles;
281
+ return this.props.validityStyles !== void 0 ? this.props.validityStyles : M.defaultProps.validityStyles;
243
282
  }
244
283
  /** @hidden */
245
284
  get required() {
246
- return this.props.required !== void 0 ? this.props.required : F.defaultProps.required;
285
+ return this.props.required !== void 0 ? this.props.required : M.defaultProps.required;
247
286
  }
248
287
  /** @hidden */
249
- componentDidUpdate(s, e) {
250
- var y;
251
- const { dataItemKey: t, virtual: i, groupField: n = "", textField: r } = this.props, a = S(this.props), d = s.virtual ? s.virtual.total : 0, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, o = s.opened !== void 0 ? s.opened : e.opened;
288
+ componentDidUpdate(s, t) {
289
+ var v;
290
+ const { dataItemKey: e, virtual: i, groupField: r = "", textField: l } = this.props, a = C(this.props), p = s.virtual ? s.virtual.total : 0, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, o = s.opened !== void 0 ? s.opened : t.opened;
252
291
  s.data !== a && this.checkForDuplicatePlainTextRecords();
253
- const u = !o && l, p = this.value;
254
- if (this._valueOnDidUpdate = p, this.base.didUpdate(), i && i.total !== d)
292
+ const h = !o && n, d = this.value;
293
+ if (this._valueOnDidUpdate = d, this.base.didUpdate(), i && i.total !== p)
255
294
  this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
256
295
  else {
257
- const b = s.value !== void 0 ? s.value : e.value;
258
- let x = this.hasDuplicates ? this.navigationIndex || 0 : a.findIndex((h) => k(h, p, t));
259
- this.props.groupMode === "modern" && r && p && (x = (y = this.base.getGroupedDataModernMode(a, n)) == null ? void 0 : y.map((h) => h[r]).indexOf(p[r]));
260
- const m = !k(b, p, t);
261
- u && i ? this.base.scrollToVirtualItem(i, x) : u && !i ? (this.onPopupOpened(), a && a.length !== 0 && this.base.resetGroupStickyHeader(a[0][n], this), this.base.scrollToItem(x)) : (this.hasDuplicates || l && o && p && m) && this.base.scrollToItem(x);
296
+ const x = s.value !== void 0 ? s.value : t.value;
297
+ let I = this.hasDuplicates ? this.navigationIndex || 0 : a.findIndex((u) => F(u, d, e));
298
+ this.props.groupMode === "modern" && l && d && (I = (v = this.base.getGroupedDataModernMode(a, r)) == null ? void 0 : v.map((u) => u[l]).indexOf(d[l]));
299
+ const b = !F(x, d, e);
300
+ h && i ? this.base.scrollToVirtualItem(i, I) : h && !i ? (this.onPopupOpened(), a && a.length !== 0 && this.base.resetGroupStickyHeader(a[0][r], this), this.base.scrollToItem(I)) : (this.hasDuplicates || n && o && d && b) && this.base.scrollToItem(I);
262
301
  }
263
- u && this._input && this._input.focus(), this.setValidity();
302
+ h && this._input && this._input.focus(), this.setValidity();
264
303
  }
265
304
  /** @hidden */
266
305
  componentDidMount() {
267
306
  var s;
268
- 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), this.checkForDuplicatePlainTextRecords();
307
+ this.observerResize = R && 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();
269
308
  }
270
309
  /** @hidden */
271
310
  componentWillUnmount() {
@@ -274,461 +313,386 @@ const ke = "Please enter a valid value!", F = class F extends c.Component {
274
313
  }
275
314
  /** @hidden */
276
315
  render() {
277
- const s = $(this).toLanguageString(
278
- G,
279
- U[G]
280
- ), e = $(this).toLanguageString(
281
- j,
282
- U[j]
316
+ const s = G(this).toLanguageString(
317
+ H,
318
+ W[H]
319
+ ), t = G(this).toLanguageString(
320
+ q,
321
+ W[q]
283
322
  ), {
284
- dir: t,
323
+ dir: e,
285
324
  disabled: i,
286
- clearButton: n = F.defaultProps.clearButton,
287
- label: r,
325
+ clearButton: r = M.defaultProps.clearButton,
326
+ label: l,
288
327
  textField: a,
289
- className: d,
290
- style: l,
328
+ className: p,
329
+ style: n,
291
330
  loading: o,
292
- iconClassName: u,
293
- virtual: p,
294
- size: y,
295
- rounded: b,
296
- fillMode: x,
297
- opened: m = this.state.opened,
298
- placeholder: h,
299
- svgIcon: g,
331
+ iconClassName: h,
332
+ virtual: d,
333
+ size: v,
334
+ rounded: x,
335
+ fillMode: I,
336
+ opened: b = this.state.opened,
337
+ placeholder: u,
338
+ svgIcon: c,
300
339
  unstyled: f
301
- } = this.props, E = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, J = M(this.value, a), T = D(O) ? O : J, Q = n && (!!T || D(this.value)), V = this.base.vs, A = this.props.id || this._inputId, L = this.mobileMode, _ = f && f.uComboBox;
302
- V.enabled = p !== void 0, p !== void 0 && (V.skip = p.skip, V.total = p.total, V.pageSize = p.pageSize);
303
- const [X, Z] = Y(this.props.prefix || c.Fragment), [ee, te] = Y(this.props.suffix || c.Fragment), R = /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
340
+ } = this.props, E = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, j = D(this.value, a), V = w(O) ? O : j, $ = r && (!!V || w(this.value)), B = this.base.vs, L = this.props.id || this._inputId, T = f && f.uComboBox;
341
+ B.enabled = d !== void 0, d !== void 0 && (B.skip = d.skip, B.total = d.total, B.pageSize = d.pageSize);
342
+ const [Y, J] = U(this.props.prefix || g.Fragment), [Q, X] = U(this.props.suffix || g.Fragment), N = /* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(
304
343
  "span",
305
344
  {
306
- className: I(
307
- w.wrapper({
308
- c: _,
309
- size: y,
310
- rounded: b,
311
- fillMode: x,
345
+ className: S(
346
+ k.wrapper({
347
+ c: T,
348
+ size: v,
349
+ rounded: x,
350
+ fillMode: I,
312
351
  disabled: i,
313
352
  invalid: !E,
314
353
  loading: o,
315
354
  required: this.required
316
355
  }),
317
- d
356
+ p
318
357
  ),
319
358
  ref: this.componentRef,
320
- style: r ? { ...l, width: void 0 } : l,
321
- dir: t
359
+ style: l ? { ...n, width: void 0 } : n,
360
+ dir: e,
361
+ onFocus: this.handleFocus
322
362
  },
323
- this.props.prefix && /* @__PURE__ */ c.createElement(X, { ...Z }),
324
- this.renderSearchBar(T || "", A, h),
325
- Q && !o && /* @__PURE__ */ c.createElement(Ie, { onClick: this.clearButtonClick, key: "clearbutton" }),
326
- o && /* @__PURE__ */ c.createElement(
327
- ae,
363
+ this.props.prefix && /* @__PURE__ */ g.createElement(Y, { ...J }),
364
+ this.renderSearchBar(V || "", L, u),
365
+ $ && !o && /* @__PURE__ */ g.createElement(ft, { onClick: this.clearButtonClick, key: "clearbutton" }),
366
+ o && /* @__PURE__ */ g.createElement(
367
+ st,
328
368
  {
329
- className: I(w.loadingIcon({ c: _ })),
369
+ className: S(k.loadingIcon({ c: T })),
330
370
  name: "loading",
331
371
  key: "loading"
332
372
  }
333
373
  ),
334
- this.props.suffix && /* @__PURE__ */ c.createElement(ee, { ...te }),
335
- /* @__PURE__ */ c.createElement(
336
- q,
374
+ this.props.suffix && /* @__PURE__ */ g.createElement(Q, { ...X }),
375
+ /* @__PURE__ */ g.createElement(
376
+ bt,
337
377
  {
338
378
  tabIndex: -1,
339
379
  type: "button",
340
- "aria-label": m ? e : s,
341
- icon: u ? void 0 : "caret-alt-down",
342
- svgIcon: g || ye,
343
- iconClass: u,
344
- size: y,
345
- fillMode: x,
380
+ "aria-label": b ? t : s,
381
+ icon: h ? void 0 : "caret-alt-down",
382
+ svgIcon: c || xt,
383
+ iconClass: h,
384
+ size: v,
385
+ fillMode: I,
346
386
  rounded: null,
347
387
  themeColor: "base",
348
- className: I(w.inputButton({ c: _ })),
388
+ className: S(k.inputButton({ c: T })),
349
389
  onClick: this.toggleBtnClick,
350
- onMouseDown: (se) => se.preventDefault()
390
+ onMouseDown: (Z) => Z.preventDefault()
351
391
  }
352
392
  ),
353
- !L && this.renderListContainer()
354
- ), L && this.renderAdaptiveListContainer());
355
- return r ? /* @__PURE__ */ c.createElement(
356
- ce,
393
+ !this.mobileMode && this.renderListContainer()
394
+ ), this.mobileMode && this.renderAdaptiveListContainer());
395
+ return l ? /* @__PURE__ */ g.createElement(
396
+ pt,
357
397
  {
358
- label: r,
359
- editorId: A,
360
- editorValue: T,
398
+ label: l,
399
+ editorId: L,
400
+ editorValue: V,
361
401
  editorValid: E,
362
402
  editorDisabled: i,
363
- style: { width: l ? l.width : void 0 },
364
- children: R,
403
+ style: { width: n ? n.width : void 0 },
404
+ children: N,
365
405
  unstyled: f
366
406
  }
367
- ) : R;
407
+ ) : N;
368
408
  }
369
409
  /** @hidden */
370
- onNavigate(s, e, t) {
371
- const { virtual: i = { skip: 0 } } = this.props, n = S(this.props), r = this.props.filter ? this.props.filter : this.state.text;
372
- let a = -1, d;
373
- const l = this.base.vs, o = this.value;
410
+ onNavigate(s, t, e) {
411
+ const { virtual: i = { skip: 0 } } = this.props, r = C(this.props), l = this.props.filter ? this.props.filter : this.state.text;
412
+ let a = -1, p;
413
+ const n = this.base.vs, o = this.value;
374
414
  this._suggested = "";
375
- const u = this.hasDuplicates && this.duplicates.indexOf(o) !== -1;
376
- if (a = this.getFocusedIndex(u), a !== -1 && !D(o))
415
+ const h = this.hasDuplicates && this.duplicates.indexOf(o) !== -1;
416
+ if (a = this.getFocusedIndex(h), a !== -1 && !w(o))
377
417
  this.handleItemSelect(a, s);
378
- else if (r === "")
418
+ else if (l === "")
379
419
  this.handleItemSelect(0, s);
380
420
  else {
381
- const p = i.skip + a;
382
- d = this.base.navigation.navigate({
383
- keyCode: e,
384
- current: p,
385
- max: (l.enabled ? l.total : n.length) - 1,
421
+ const d = i.skip + a;
422
+ p = this.base.navigation.navigate({
423
+ keyCode: t,
424
+ current: d,
425
+ max: (n.enabled ? n.total : r.length) - 1,
386
426
  min: 0,
387
- skipItems: t || void 0
388
- }), d !== void 0 && this.handleItemSelect(d, s);
427
+ skipItems: e || void 0
428
+ }), p !== void 0 && this.handleItemSelect(p, s);
389
429
  }
390
- this.navigationIndex = d;
430
+ this.navigationIndex = p;
391
431
  }
392
- getCurrentValueDisabledStatus(s, e, t) {
393
- return s && e && e[t] && e[t].disabled;
432
+ getCurrentValueDisabledStatus(s, t, e) {
433
+ return s && t && t[e] && t[e].disabled;
394
434
  }
395
- applyValueOnEnter(s, e) {
396
- const { textField: t, allowCustom: i } = this.props, n = S(this.props), r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = M(this.value, t) === s ? this.index : K(n, s, t), l = d !== -1;
435
+ applyValueOnEnter(s, t) {
436
+ const { textField: e, allowCustom: i } = this.props, r = C(this.props), l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = D(this.value, e) === s ? this.index : A(r, s, e), n = p !== -1;
397
437
  let o;
398
- if (this._suggested = "", l)
399
- o = n[d];
438
+ if (this._suggested = "", n)
439
+ o = r[p];
400
440
  else if (i)
401
- o = t !== void 0 ? { [t]: s } : s;
441
+ o = e !== void 0 ? { [e]: s } : s;
402
442
  else
403
- return this.selectFocusedItem(s, e);
404
- this.triggerOnChange(o, e), r && this.base.togglePopup(e), this.props.filter === void 0 && this.state.text !== void 0 && (e.data.text = void 0), this.applyState(e);
443
+ return this.selectFocusedItem(s, t);
444
+ this.triggerOnChange(o, t), l && this.base.togglePopup(t), this.props.filter === void 0 && this.state.text !== void 0 && (t.data.text = void 0), this.applyState(t);
405
445
  }
406
- applyValueOnRejectSuggestions(s, e) {
407
- const { textField: t, allowCustom: i } = this.props, n = S(this.props), r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = M(this.value, t);
408
- if (this._suggested = "", s === a || s === "" && !D(a))
409
- return this.closeOpenedApplyStateNonMobileMode(e, r), this.applyState(e);
410
- const d = K(n, s, t, !0), l = d !== -1;
446
+ applyValueOnRejectSuggestions(s, t) {
447
+ const { textField: e, allowCustom: i } = this.props, r = C(this.props), l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = D(this.value, e);
448
+ if (this._suggested = "", s === a || s === "" && !w(a))
449
+ return this.closeOpenedApplyStateNonMobileMode(t, l), this.applyState(t);
450
+ const p = A(r, s, e, !0), n = p !== -1;
411
451
  let o = null;
412
- l ? o = n[d] : i && (o = s ? t ? { [t]: s } : s : null), this.triggerOnChange(o, e), this.state.text !== void 0 && (e.data.text = void 0, this.base.filterChanged("", e)), this.closeOpenedApplyStateNonMobileMode(e, r), this.applyState(e);
452
+ n ? o = r[p] : i && (o = s ? e ? { [e]: s } : s : null), this.triggerOnChange(o, t), this.state.text !== void 0 && (t.data.text = void 0, this.base.filterChanged("", t)), this.closeOpenedApplyStateNonMobileMode(t, l), this.applyState(t);
413
453
  }
414
- selectFocusedItem(s, e) {
415
- const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: n = { skip: 0 }, focusedItemIndex: r = H } = this.props, a = S(this.props), d = n.skip, l = s === "" && d === 0 ? 0 : r(a, s, i);
416
- return l !== -1 ? this.handleItemSelect(l + d, e) : (this.triggerOnChange(null, e), this.state.text !== void 0 && (e.data.text = void 0)), t && this.base.togglePopup(e), this.applyState(e);
454
+ selectFocusedItem(s, t) {
455
+ const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: r = { skip: 0 }, focusedItemIndex: l = z } = this.props, a = C(this.props), p = r.skip, n = s === "" && p === 0 ? 0 : l(a, s, i);
456
+ return n !== -1 ? this.handleItemSelect(n + p, t) : (this.triggerOnChange(null, t), this.state.text !== void 0 && (t.data.text = void 0)), e && this.base.togglePopup(t), this.applyState(t);
417
457
  }
418
458
  renderAdaptiveListContainer() {
419
- const { windowWidth: s = 0 } = this.state, {
420
- header: e,
421
- footer: t,
422
- size: i,
423
- groupField: n,
424
- groupMode: r,
425
- list: a,
426
- virtual: d,
427
- adaptiveTitle: l,
428
- groupStickyHeaderItemRender: o,
429
- unstyled: u,
430
- _adaptiveMode: p
431
- } = this.props, y = S(this.props), b = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = this.base.getAdaptiveAnimation(), m = u && u.uComboBox, h = u && u.uDropDownsActionSheet;
432
- let { group: g } = this.state;
433
- g === void 0 && n !== void 0 && (g = M(y[0], n));
434
- const f = {
435
- navigatable: !1,
436
- navigatableElements: [],
437
- expand: b,
438
- animation: x,
439
- onClose: (E) => this.toggleBtnClick(E),
440
- className: I(
441
- B.wrapper({
442
- c: h
443
- }),
444
- "k-adaptive-actionsheet"
445
- ),
446
- animationStyles: s && p && s <= p.small ? { top: 0, width: "100%", height: "100%" } : void 0,
447
- position: s && p && s <= p.small ? "fullscreen" : void 0
459
+ const { windowWidth: s = 0 } = this.state, { groupField: t, adaptiveTitle: e = this.props.label, adaptiveSubtitle: i } = this.props, r = C(this.props), l = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
460
+ let { group: a } = this.state;
461
+ a === void 0 && t !== void 0 && (a = D(r[0], t));
462
+ const p = {
463
+ title: e || this.props.label,
464
+ subTitle: i,
465
+ expand: l,
466
+ onClose: (n) => this.toggleBtnClick(n),
467
+ windowWidth: s,
468
+ mobileFilter: this.renderMobileListFilter()
448
469
  };
449
- return /* @__PURE__ */ c.createElement(Se, { ...f }, /* @__PURE__ */ c.createElement(we, null, /* @__PURE__ */ c.createElement("div", { className: I(B.titleBar({ c: h })) }, /* @__PURE__ */ c.createElement("div", { className: I(B.title({ c: h })) }, /* @__PURE__ */ c.createElement("div", { className: I(B.header({ c: h })) }, l), /* @__PURE__ */ c.createElement("div", { className: I(B.subtitle({ c: h })) })), /* @__PURE__ */ c.createElement("div", { className: I(B.actions({ c: h })) }, /* @__PURE__ */ c.createElement(
450
- q,
451
- {
452
- tabIndex: 0,
453
- "aria-label": "Cancel",
454
- "aria-disabled": "false",
455
- type: "button",
456
- fillMode: "flat",
457
- themeColor: "base",
458
- size: "large",
459
- onClick: this.toggleBtnClick,
460
- icon: "x",
461
- svgIcon: Ce
462
- }
463
- ))), /* @__PURE__ */ c.createElement("div", { className: I(B.titleBarGroup({ c: h })) }, this.renderMobileListFilter())), /* @__PURE__ */ c.createElement(De, null, /* @__PURE__ */ c.createElement(
464
- "div",
465
- {
466
- className: I(
467
- w.listContainer({
468
- c: m
469
- })
470
- )
471
- },
472
- /* @__PURE__ */ c.createElement(
473
- "div",
474
- {
475
- className: I(
476
- w.list({
477
- c: m,
478
- list: a,
479
- size: "large",
480
- tableSize: i,
481
- virtual: d
482
- })
483
- )
484
- },
485
- e && /* @__PURE__ */ c.createElement("div", { className: I(w.listHeader({ c: m })) }, e),
486
- !a && g && y.length !== 0 && /* @__PURE__ */ c.createElement(
487
- W,
488
- {
489
- group: g,
490
- groupMode: r,
491
- render: o
492
- }
493
- ),
494
- this.renderList(),
495
- t && /* @__PURE__ */ c.createElement(
496
- "div",
497
- {
498
- className: I(
499
- w.listFooter({ c: m }),
500
- this.props.footerClassName
501
- )
502
- },
503
- t
504
- )
505
- )
506
- )));
470
+ return /* @__PURE__ */ g.createElement(yt, { ...p }, /* @__PURE__ */ g.createElement(It, null, /* @__PURE__ */ g.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
507
471
  }
508
472
  renderListContainer() {
509
473
  const s = this.base, {
510
- dir: e,
511
- header: t,
474
+ dir: t,
475
+ header: e,
512
476
  footer: i,
513
- groupField: n,
514
- groupMode: r,
477
+ groupField: r,
478
+ groupMode: l,
515
479
  size: a,
516
- list: d,
517
- virtual: l,
480
+ list: p,
481
+ virtual: n,
518
482
  groupStickyHeaderItemRender: o,
519
- unstyled: u
520
- } = this.props, p = S(this.props), y = this.props.opened !== void 0 ? this.props.opened : this.state.opened, b = s.getPopupSettings(), x = b.width !== void 0 ? b.width : s.popupWidth, m = u && u.uComboBox;
521
- let { group: h } = this.state;
522
- return h === void 0 && n !== void 0 && (h = M(p[0], n)), /* @__PURE__ */ c.createElement(
523
- ve,
483
+ unstyled: h
484
+ } = this.props, d = C(this.props), v = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = s.getPopupSettings(), I = x.width !== void 0 ? x.width : s.popupWidth, b = h && h.uComboBox;
485
+ let { group: u } = this.state;
486
+ return u === void 0 && r !== void 0 && (u = D(d[0], r)), /* @__PURE__ */ g.createElement(
487
+ ct,
524
488
  {
525
- width: x,
489
+ width: I,
526
490
  popupSettings: {
527
- ...b,
528
- anchor: b.anchor || this.element,
529
- show: y,
530
- popupClass: I(
531
- b.popupClass,
532
- w.listContainer({
533
- c: m,
491
+ ...x,
492
+ anchor: x.anchor || this.element,
493
+ show: v,
494
+ popupClass: S(
495
+ x.popupClass,
496
+ k.listContainer({
497
+ c: b,
534
498
  popup: !0
535
499
  })
536
500
  )
537
501
  },
538
- dir: e !== void 0 ? e : this.base.dirCalculated,
539
- itemsCount: [p.length]
502
+ dir: t !== void 0 ? t : this.base.dirCalculated,
503
+ itemsCount: [d.length]
540
504
  },
541
- /* @__PURE__ */ c.createElement(
505
+ /* @__PURE__ */ g.createElement(
542
506
  "div",
543
507
  {
544
- className: I(
545
- w.list({
546
- c: m,
547
- list: d,
508
+ className: S(
509
+ k.list({
510
+ c: b,
511
+ list: p,
548
512
  size: a,
549
513
  tableSize: a,
550
- virtual: l
514
+ virtual: n
551
515
  })
552
516
  )
553
517
  },
554
- t && /* @__PURE__ */ c.createElement("div", { className: I(w.listHeader({ c: m })) }, t),
555
- !d && h && p.length !== 0 && /* @__PURE__ */ c.createElement(W, { group: h, groupMode: r, render: o }),
518
+ e && /* @__PURE__ */ g.createElement("div", { className: S(k.listHeader({ c: b })) }, e),
519
+ !p && u && d.length !== 0 && /* @__PURE__ */ g.createElement(K, { group: u, groupMode: l, render: o }),
556
520
  this.renderList(),
557
- i && /* @__PURE__ */ c.createElement(
521
+ i && /* @__PURE__ */ g.createElement(
558
522
  "div",
559
523
  {
560
- className: I(
561
- w.listFooter({ c: m }),
524
+ className: S(
525
+ k.listFooter({ c: b }),
562
526
  this.props.footerClassName
563
527
  )
564
528
  },
565
529
  i
566
530
  )
567
531
  ),
568
- this.showLicenseWatermark && /* @__PURE__ */ c.createElement(ne, null)
532
+ this.showLicenseWatermark && /* @__PURE__ */ g.createElement(it, null)
569
533
  );
570
534
  }
571
535
  renderList() {
572
536
  const s = this.base, {
573
- textField: e,
574
- dataItemKey: t,
537
+ textField: t,
538
+ dataItemKey: e,
575
539
  listNoDataRender: i,
576
- itemRender: n,
577
- groupHeaderItemRender: r,
540
+ itemRender: r,
541
+ groupHeaderItemRender: l,
578
542
  virtual: a = { skip: 0, total: void 0 },
579
- unstyled: d
580
- } = this.props, l = S(this.props), o = s.getPopupSettings(), u = s.vs, p = a.skip, y = this.props.opened !== void 0 ? this.props.opened : this.state.opened, b = `translateY(${u.translate}px)`, x = y ? this.getFocusedIndex(this.hasDuplicates) : void 0, m = this.props.filter !== void 0 ? this.props.filter : this.state.text, h = M(this.value, e), g = D(m) && m !== h ? null : this.value, f = this.props.list || fe, E = d && d.uComboBox;
581
- return /* @__PURE__ */ c.createElement(
543
+ unstyled: p
544
+ } = this.props, n = C(this.props), o = s.getPopupSettings(), h = s.vs, d = a.skip, v = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = `translateY(${h.translate}px)`, I = v ? this.getFocusedIndex(this.hasDuplicates) : void 0, b = this.props.filter !== void 0 ? this.props.filter : this.state.text, u = D(this.value, t), c = w(b) && b !== u ? null : this.value, f = this.props.list || gt, E = p && p.uComboBox;
545
+ return /* @__PURE__ */ g.createElement(
582
546
  f,
583
547
  {
584
548
  id: s.listBoxId,
585
549
  virtual: !!a,
586
- show: y,
587
- data: l,
588
- focusedIndex: x,
589
- value: g,
590
- textField: e,
591
- valueField: t,
550
+ show: v,
551
+ data: n,
552
+ focusedIndex: I,
553
+ value: c,
554
+ textField: t,
555
+ valueField: e,
592
556
  groupField: this.props.groupField,
593
557
  groupMode: this.props.groupMode,
594
558
  isMultiColumn: this.props.isMultiColumn,
595
559
  optionsGuid: s.guid,
596
560
  hasDuplicates: this.hasDuplicates,
597
561
  listRef: (O) => {
598
- u.list = this.base.list = O, this.itemHeight = 0;
562
+ h.list = this.base.list = O, this.itemHeight = 0;
599
563
  },
600
564
  wrapperStyle: this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth > this.props._adaptiveMode.medium ? { maxHeight: o.height } : {},
601
- wrapperCssClass: I(
602
- w.listContent({
565
+ wrapperCssClass: S(
566
+ k.listContent({
603
567
  c: E,
604
568
  virtual: a
605
569
  })
606
570
  ),
607
- listStyle: u.enabled ? { transform: b } : void 0,
571
+ listStyle: h.enabled ? { transform: x } : void 0,
608
572
  key: "listkey",
609
- skip: p,
573
+ skip: d,
610
574
  onClick: this.handleItemClick,
611
- itemRender: n,
612
- groupHeaderItemRender: r,
575
+ itemRender: r,
576
+ groupHeaderItemRender: l,
613
577
  noDataRender: i,
614
578
  onMouseDown: (O) => O.preventDefault(),
615
579
  onScroll: this.onScroll,
616
- wrapperRef: u.scrollerRef,
580
+ wrapperRef: h.scrollerRef,
617
581
  scroller: this.base.renderScrollElement(),
618
582
  ariaSetSize: a.total
619
583
  }
620
584
  );
621
585
  }
622
- renderSearchBar(s, e, t) {
586
+ renderSearchBar(s, t, e) {
623
587
  const {
624
588
  tabIndex: i,
625
- disabled: n,
626
- title: r,
589
+ disabled: r,
590
+ title: l,
627
591
  ariaLabelledBy: a,
628
- ariaDescribedBy: d,
629
- dataItemKey: l,
592
+ ariaDescribedBy: p,
593
+ dataItemKey: n,
630
594
  virtual: o = { skip: 0 },
631
- accessKey: u,
632
- unstyled: p,
633
- inputAttributes: y
634
- } = this.props, b = S(this.props), x = this.props.opened !== void 0 ? this.props.opened : this.state.opened, m = this.value, h = Math.max(
595
+ accessKey: h,
596
+ unstyled: d,
597
+ inputAttributes: v
598
+ } = this.props, x = C(this.props), I = this.props.opened !== void 0 ? this.props.opened : this.state.opened, b = this.value, u = Math.max(
635
599
  0,
636
- b.findIndex((g) => k(g, m, l))
600
+ x.findIndex((c) => F(c, b, n))
637
601
  );
638
- return this._suggested && !k(this._valueOnDidUpdate, m, l) && (this._suggested = ""), /* @__PURE__ */ c.createElement(
639
- me,
602
+ return this._suggested && !F(this._valueOnDidUpdate, b, n) && (this._suggested = ""), /* @__PURE__ */ g.createElement(
603
+ ut,
640
604
  {
641
- id: e,
642
- readOnly: x && this.mobileMode,
643
- placeholder: t,
605
+ id: t,
606
+ readOnly: I && this.mobileMode,
607
+ placeholder: e,
644
608
  tabIndex: i,
645
- title: r,
609
+ title: l,
646
610
  value: s + this._suggested,
647
611
  suggestedText: this._suggested,
648
- ref: (g) => {
649
- this._input = g && g.input;
612
+ ref: (c) => {
613
+ this._input = c && c.input;
650
614
  },
651
615
  onClick: this.onInputClick,
652
616
  onKeyDown: this.onInputKeyDown,
653
617
  onChange: this.inputOnChange,
654
618
  onFocus: this.base.handleFocus,
655
619
  onBlur: this.handleBlur,
656
- disabled: n,
657
- expanded: x,
620
+ disabled: r,
621
+ expanded: I,
658
622
  owns: this.base.listBoxId,
659
- activedescendant: `option-${this.base.guid}-${h + o.skip}`,
623
+ activedescendant: `option-${this.base.guid}-${u + o.skip}`,
660
624
  role: "combobox",
661
625
  ariaLabelledBy: a,
662
626
  ariaLabel: this.props.ariaLabel,
663
- ariaDescribedBy: d,
627
+ ariaDescribedBy: p,
664
628
  ariaRequired: this.required,
665
629
  render: this.props.valueRender,
666
630
  ariaControls: this.base.listBoxId,
667
- unstyled: p,
668
- inputAttributes: y
631
+ unstyled: d,
632
+ inputAttributes: v
669
633
  }
670
634
  );
671
635
  }
672
636
  clearValue() {
673
637
  const s = this.base.initState();
674
638
  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);
675
- const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, t = this.mobileMode;
676
- e && !t && this.base.togglePopup(s), this.applyState(s);
639
+ const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, e = this.mobileMode;
640
+ t && !e && this.base.togglePopup(s), this.applyState(s);
677
641
  }
678
- triggerOnChange(s, e) {
679
- const t = this.value;
680
- !this.hasDuplicates && (!D(t) && !D(s) || k(t, s, this.props.dataItemKey)) || (this.props.value === void 0 && (e.data.value = s), this._valueDuringOnChange = s, e.events.push({ type: "onChange" }));
642
+ triggerOnChange(s, t) {
643
+ const e = this.value;
644
+ !this.hasDuplicates && (!w(e) && !w(s) || F(e, s, this.props.dataItemKey)) || (this.props.value === void 0 && (t.data.value = s), this._valueDuringOnChange = s, t.events.push({ type: "onChange" }));
681
645
  }
682
646
  getFocusedIndex(s) {
683
- const e = this.value, {
684
- textField: t,
647
+ const t = this.value, {
648
+ textField: e,
685
649
  dataItemKey: i,
686
- virtual: n = { skip: 0 },
687
- focusedItemIndex: r = H,
650
+ virtual: r = { skip: 0 },
651
+ focusedItemIndex: l = z,
688
652
  skipDisabledItems: a
689
- } = this.props, d = S(this.props), l = this.props.filter ? this.props.filter : this.state.text;
690
- return s && this.navigationIndex !== void 0 ? this.navigationIndex : D(e) && l === void 0 ? d.findIndex((o) => k(o, e, i)) : l ? r(d, l, t) : a && t && !l && n.skip === 0 ? d.findIndex((o) => !o.disabled && o[t]) : n.skip === 0 ? 0 : -1;
653
+ } = this.props, p = C(this.props), n = this.props.filter ? this.props.filter : this.state.text;
654
+ return s && this.navigationIndex !== void 0 ? this.navigationIndex : w(t) && n === void 0 ? p.findIndex((o) => F(o, t, i)) : n ? l(p, n, e) : a && e && !n && r.skip === 0 ? p.findIndex((o) => !o.disabled && o[e]) : r.skip === 0 ? 0 : -1;
691
655
  }
692
656
  suggestValue(s) {
693
- const { data: e, textField: t } = this.props;
694
- this._suggested = ge(s, e, t);
657
+ const { data: t, textField: e } = this.props;
658
+ this._suggested = ht(s, t, e);
695
659
  }
696
660
  applyState(s) {
697
661
  this.base.applyState(s), this._valueDuringOnChange = void 0;
698
662
  }
699
663
  calculateMedia(s) {
700
- for (const e of s)
701
- this.setState({ windowWidth: e.target.clientWidth });
664
+ for (const t of s)
665
+ this.setState({ windowWidth: t.target.clientWidth });
702
666
  }
703
667
  };
704
- F.displayName = "ComboBox", F.propTypes = {
705
- ...N.propTypes,
706
- size: v.oneOf([null, "small", "medium", "large"]),
707
- rounded: v.oneOf([null, "small", "medium", "large", "full"]),
708
- fillMode: v.oneOf([null, "solid", "flat", "outline"]),
709
- dataItemKey: v.string,
710
- groupField: v.string,
711
- groupMode: v.oneOf([void 0, "classic", "modern"]),
712
- isMultiColumn: v.bool,
713
- suggest: v.bool,
714
- placeholder: v.string,
715
- title: v.string,
716
- allowCustom: v.bool,
717
- clearButton: v.bool,
718
- iconClassName: v.string,
719
- svgIcon: oe,
720
- validationMessage: v.string,
721
- required: v.bool,
722
- id: v.string,
723
- ariaLabelledBy: v.string,
724
- ariaLabel: v.string,
725
- ariaDescribedBy: v.string,
726
- list: v.any,
727
- valueRender: v.func,
728
- skipDisabledItems: v.bool,
729
- inputAttributes: v.object
730
- }, F.defaultProps = {
731
- ...N.defaultProps,
668
+ M.displayName = "ComboBox", M.propTypes = {
669
+ ..._.propTypes,
670
+ size: m.oneOf([null, "small", "medium", "large"]),
671
+ rounded: m.oneOf([null, "small", "medium", "large", "full"]),
672
+ fillMode: m.oneOf([null, "solid", "flat", "outline"]),
673
+ dataItemKey: m.string,
674
+ groupField: m.string,
675
+ groupMode: m.oneOf([void 0, "classic", "modern"]),
676
+ isMultiColumn: m.bool,
677
+ suggest: m.bool,
678
+ placeholder: m.string,
679
+ title: m.string,
680
+ allowCustom: m.bool,
681
+ clearButton: m.bool,
682
+ iconClassName: m.string,
683
+ svgIcon: et,
684
+ validationMessage: m.string,
685
+ required: m.bool,
686
+ id: m.string,
687
+ ariaLabelledBy: m.string,
688
+ ariaLabel: m.string,
689
+ ariaDescribedBy: m.string,
690
+ list: m.any,
691
+ valueRender: m.func,
692
+ skipDisabledItems: m.bool,
693
+ inputAttributes: m.object
694
+ }, M.defaultProps = {
695
+ ..._.defaultProps,
732
696
  size: "medium",
733
697
  rounded: "medium",
734
698
  fillMode: "solid",
@@ -741,18 +705,18 @@ F.displayName = "ComboBox", F.propTypes = {
741
705
  prefix: void 0,
742
706
  suffix: void 0
743
707
  };
744
- let P = F;
745
- const Ee = le(), Me = re(
746
- de(
747
- Ee,
748
- pe(
749
- he(P)
708
+ let P = M;
709
+ const St = ot(), kt = at(
710
+ nt(
711
+ St,
712
+ lt(
713
+ rt(P)
750
714
  )
751
715
  )
752
716
  );
753
- Me.displayName = "KendoReactComboBox";
717
+ kt.displayName = "KendoReactComboBox";
754
718
  export {
755
- Me as ComboBox,
756
- Ee as ComboBoxPropsContext,
719
+ kt as ComboBox,
720
+ St as ComboBoxPropsContext,
757
721
  P as ComboBoxWithoutContext
758
722
  };