@progress/kendo-react-dropdowns 6.1.1 → 7.0.0-develop.10

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.
Files changed (177) hide show
  1. package/{dist/es/AutoComplete → AutoComplete}/AutoComplete.d.ts +12 -8
  2. package/{dist/npm/AutoComplete → AutoComplete}/AutoCompleteProps.d.ts +4 -1
  3. package/{dist/es/ComboBox → ComboBox}/ComboBox.d.ts +12 -8
  4. package/{dist/es/ComboBox → ComboBox}/ComboBoxProps.d.ts +4 -1
  5. package/{dist/es/DropDownList → DropDownList}/DropDownList.d.ts +9 -5
  6. package/{dist/es/DropDownList → DropDownList}/DropDownListProps.d.ts +4 -1
  7. package/{dist/es/DropDownTree → DropDownTree}/DropDownTree.d.ts +4 -0
  8. package/{dist/npm/DropDownTree → DropDownTree}/DropDownTreeProps.d.ts +4 -1
  9. package/DropDownTree/ListNoData.d.ts +10 -0
  10. package/DropDownTree/useDropdownWidth.d.ts +9 -0
  11. package/LICENSE.md +1 -1
  12. package/{dist/es/MultiColumnComboBox → MultiColumnComboBox}/MultiColumnComboBox.d.ts +4 -0
  13. package/{dist/npm/MultiSelect → MultiSelect}/MultiSelect.d.ts +9 -5
  14. package/{dist/es/MultiSelect → MultiSelect}/MultiSelectProps.d.ts +4 -1
  15. package/{dist/npm/MultiSelect → MultiSelect}/TagList.d.ts +5 -1
  16. package/{dist/es/MultiSelectTree → MultiSelectTree}/MultiSelectTree.d.ts +4 -0
  17. package/{dist/es/MultiSelectTree → MultiSelectTree}/MultiSelectTreeProps.d.ts +5 -1
  18. package/{dist/npm/MultiSelectTree → MultiSelectTree}/utils.d.ts +5 -1
  19. package/{dist/npm/common → common}/AdaptiveMode.d.ts +5 -1
  20. package/common/ClearButton.d.ts +18 -0
  21. package/{dist/npm/common → common}/DropDownBase.d.ts +5 -1
  22. package/{dist/es/common → common}/GroupStickyHeader.d.ts +5 -1
  23. package/{dist/es/common → common}/List.d.ts +8 -3
  24. package/common/ListContainer.d.ts +22 -0
  25. package/common/ListDefaultItem.d.ts +20 -0
  26. package/{dist/npm/common → common}/ListFilter.d.ts +4 -0
  27. package/{dist/npm/common → common}/ListGroupItem.d.ts +5 -1
  28. package/{dist/npm/common → common}/ListItem.d.ts +5 -1
  29. package/common/MultiColumnList.d.ts +9 -0
  30. package/common/Navigation.d.ts +17 -0
  31. package/{dist/es/common → common}/SearchBar.d.ts +5 -1
  32. package/{dist/npm/common → common}/VirtualScroll.d.ts +4 -1
  33. package/common/constants.d.ts +8 -0
  34. package/{dist/es/common → common}/events.d.ts +4 -1
  35. package/{dist/npm/common → common}/filterDescriptor.d.ts +4 -0
  36. package/{dist/es/common → common}/settings.d.ts +5 -2
  37. package/{dist/npm/common → common}/utils.d.ts +4 -0
  38. package/dist/cdn/js/kendo-react-dropdowns.js +5 -1
  39. package/index.d.ts +29 -0
  40. package/index.js +5 -0
  41. package/index.mjs +4397 -0
  42. package/{dist/npm/messages → messages}/index.d.ts +4 -0
  43. package/package-metadata.d.ts +9 -0
  44. package/package.json +34 -62
  45. package/about.md +0 -3
  46. package/dist/es/AutoComplete/AutoComplete.js +0 -652
  47. package/dist/es/AutoComplete/AutoCompleteProps.d.ts +0 -243
  48. package/dist/es/AutoComplete/AutoCompleteProps.js +0 -2
  49. package/dist/es/ComboBox/ComboBox.js +0 -915
  50. package/dist/es/ComboBox/ComboBoxProps.js +0 -2
  51. package/dist/es/DropDownList/DropDownList.js +0 -887
  52. package/dist/es/DropDownList/DropDownListProps.js +0 -2
  53. package/dist/es/DropDownTree/DropDownTree.js +0 -540
  54. package/dist/es/DropDownTree/DropDownTreeProps.d.ts +0 -294
  55. package/dist/es/DropDownTree/DropDownTreeProps.js +0 -2
  56. package/dist/es/DropDownTree/ListNoData.d.ts +0 -6
  57. package/dist/es/DropDownTree/ListNoData.js +0 -8
  58. package/dist/es/DropDownTree/useDropdownWidth.d.ts +0 -5
  59. package/dist/es/DropDownTree/useDropdownWidth.js +0 -13
  60. package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +0 -213
  61. package/dist/es/MultiSelect/MultiSelect.d.ts +0 -256
  62. package/dist/es/MultiSelect/MultiSelect.js +0 -1110
  63. package/dist/es/MultiSelect/MultiSelectProps.js +0 -2
  64. package/dist/es/MultiSelect/TagList.d.ts +0 -38
  65. package/dist/es/MultiSelect/TagList.js +0 -39
  66. package/dist/es/MultiSelectTree/MultiSelectTree.js +0 -619
  67. package/dist/es/MultiSelectTree/MultiSelectTreeProps.js +0 -2
  68. package/dist/es/MultiSelectTree/utils.d.ts +0 -17
  69. package/dist/es/MultiSelectTree/utils.js +0 -191
  70. package/dist/es/common/AdaptiveMode.d.ts +0 -21
  71. package/dist/es/common/AdaptiveMode.js +0 -45
  72. package/dist/es/common/ClearButton.d.ts +0 -14
  73. package/dist/es/common/ClearButton.js +0 -39
  74. package/dist/es/common/DropDownBase.d.ts +0 -175
  75. package/dist/es/common/DropDownBase.js +0 -297
  76. package/dist/es/common/GroupStickyHeader.js +0 -34
  77. package/dist/es/common/List.js +0 -75
  78. package/dist/es/common/ListContainer.d.ts +0 -18
  79. package/dist/es/common/ListContainer.js +0 -43
  80. package/dist/es/common/ListDefaultItem.d.ts +0 -16
  81. package/dist/es/common/ListDefaultItem.js +0 -36
  82. package/dist/es/common/ListFilter.d.ts +0 -19
  83. package/dist/es/common/ListFilter.js +0 -37
  84. package/dist/es/common/ListGroupItem.d.ts +0 -33
  85. package/dist/es/common/ListGroupItem.js +0 -33
  86. package/dist/es/common/ListItem.d.ts +0 -61
  87. package/dist/es/common/ListItem.js +0 -44
  88. package/dist/es/common/MultiColumnList.d.ts +0 -6
  89. package/dist/es/common/MultiColumnList.js +0 -22
  90. package/dist/es/common/Navigation.d.ts +0 -13
  91. package/dist/es/common/Navigation.js +0 -34
  92. package/dist/es/common/SearchBar.js +0 -62
  93. package/dist/es/common/VirtualScroll.d.ts +0 -42
  94. package/dist/es/common/VirtualScroll.js +0 -161
  95. package/dist/es/common/constants.d.ts +0 -4
  96. package/dist/es/common/constants.js +0 -4
  97. package/dist/es/common/events.js +0 -1
  98. package/dist/es/common/filterDescriptor.d.ts +0 -41
  99. package/dist/es/common/filterDescriptor.js +0 -2
  100. package/dist/es/common/settings.js +0 -8
  101. package/dist/es/common/utils.d.ts +0 -62
  102. package/dist/es/common/utils.js +0 -194
  103. package/dist/es/main.d.ts +0 -25
  104. package/dist/es/main.js +0 -19
  105. package/dist/es/messages/index.d.ts +0 -40
  106. package/dist/es/messages/index.js +0 -41
  107. package/dist/es/package-metadata.d.ts +0 -5
  108. package/dist/es/package-metadata.js +0 -11
  109. package/dist/npm/AutoComplete/AutoComplete.d.ts +0 -230
  110. package/dist/npm/AutoComplete/AutoComplete.js +0 -655
  111. package/dist/npm/AutoComplete/AutoCompleteProps.js +0 -3
  112. package/dist/npm/ComboBox/ComboBox.d.ts +0 -248
  113. package/dist/npm/ComboBox/ComboBox.js +0 -918
  114. package/dist/npm/ComboBox/ComboBoxProps.d.ts +0 -313
  115. package/dist/npm/ComboBox/ComboBoxProps.js +0 -3
  116. package/dist/npm/DropDownList/DropDownList.d.ts +0 -258
  117. package/dist/npm/DropDownList/DropDownList.js +0 -890
  118. package/dist/npm/DropDownList/DropDownListProps.d.ts +0 -326
  119. package/dist/npm/DropDownList/DropDownListProps.js +0 -3
  120. package/dist/npm/DropDownTree/DropDownTree.d.ts +0 -70
  121. package/dist/npm/DropDownTree/DropDownTree.js +0 -543
  122. package/dist/npm/DropDownTree/DropDownTreeProps.js +0 -3
  123. package/dist/npm/DropDownTree/ListNoData.d.ts +0 -6
  124. package/dist/npm/DropDownTree/ListNoData.js +0 -12
  125. package/dist/npm/DropDownTree/useDropdownWidth.d.ts +0 -5
  126. package/dist/npm/DropDownTree/useDropdownWidth.js +0 -17
  127. package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.d.ts +0 -287
  128. package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +0 -216
  129. package/dist/npm/MultiSelect/MultiSelect.js +0 -1113
  130. package/dist/npm/MultiSelect/MultiSelectProps.d.ts +0 -314
  131. package/dist/npm/MultiSelect/MultiSelectProps.js +0 -3
  132. package/dist/npm/MultiSelect/TagList.js +0 -41
  133. package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +0 -81
  134. package/dist/npm/MultiSelectTree/MultiSelectTree.js +0 -622
  135. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -320
  136. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.js +0 -3
  137. package/dist/npm/MultiSelectTree/utils.js +0 -196
  138. package/dist/npm/common/AdaptiveMode.js +0 -49
  139. package/dist/npm/common/ClearButton.d.ts +0 -14
  140. package/dist/npm/common/ClearButton.js +0 -41
  141. package/dist/npm/common/DropDownBase.js +0 -299
  142. package/dist/npm/common/GroupStickyHeader.d.ts +0 -24
  143. package/dist/npm/common/GroupStickyHeader.js +0 -36
  144. package/dist/npm/common/List.d.ts +0 -45
  145. package/dist/npm/common/List.js +0 -77
  146. package/dist/npm/common/ListContainer.d.ts +0 -18
  147. package/dist/npm/common/ListContainer.js +0 -45
  148. package/dist/npm/common/ListDefaultItem.d.ts +0 -16
  149. package/dist/npm/common/ListDefaultItem.js +0 -38
  150. package/dist/npm/common/ListFilter.js +0 -39
  151. package/dist/npm/common/ListGroupItem.js +0 -35
  152. package/dist/npm/common/ListItem.js +0 -46
  153. package/dist/npm/common/MultiColumnList.d.ts +0 -6
  154. package/dist/npm/common/MultiColumnList.js +0 -26
  155. package/dist/npm/common/Navigation.d.ts +0 -13
  156. package/dist/npm/common/Navigation.js +0 -37
  157. package/dist/npm/common/SearchBar.d.ts +0 -43
  158. package/dist/npm/common/SearchBar.js +0 -64
  159. package/dist/npm/common/VirtualScroll.js +0 -163
  160. package/dist/npm/common/constants.d.ts +0 -4
  161. package/dist/npm/common/constants.js +0 -7
  162. package/dist/npm/common/events.d.ts +0 -73
  163. package/dist/npm/common/events.js +0 -2
  164. package/dist/npm/common/filterDescriptor.js +0 -3
  165. package/dist/npm/common/settings.d.ts +0 -114
  166. package/dist/npm/common/settings.js +0 -11
  167. package/dist/npm/common/utils.js +0 -211
  168. package/dist/npm/main.d.ts +0 -25
  169. package/dist/npm/main.js +0 -62
  170. package/dist/npm/messages/index.js +0 -44
  171. package/dist/npm/package-metadata.d.ts +0 -5
  172. package/dist/npm/package-metadata.js +0 -14
  173. package/dist/systemjs/kendo-react-dropdowns.js +0 -1
  174. package/e2e-next/combobox.basic.ts +0 -24
  175. package/e2e-next/dropdownlist.basic.tests.ts +0 -24
  176. package/e2e-next/dropdowntree.basic.tests.ts +0 -24
  177. package/e2e-next/multicolumncombobox.basic.tests.ts +0 -24
package/index.mjs ADDED
@@ -0,0 +1,4397 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as o from "react";
6
+ import * as l from "prop-types";
7
+ import { IconWrap as ke, classNames as B, Keys as f, guid as Fe, svgIconPropType as gs, createPropsContext as Ke, withPropsContext as wt, validatePackage as qe, canUseDOM as Me, getTabIndex as $t, kendoThemeMaps as $e, getActiveElement as Ss, usePropsContext as Gt, getScrollbarWidth as ws, getter as kt, setScrollbarWidth as Es, useRtl as fs, noop as De, mapTree as Ds, extendDataItem as Ts } from "@progress/kendo-react-common";
8
+ import { FloatingLabel as Ge } from "@progress/kendo-react-labels";
9
+ import { searchIcon as Fs, caretAltDownIcon as Ut, xIcon as at, plusIcon as Ms } from "@progress/kendo-svg-icons";
10
+ import { Popup as jt, PopupPropsContext as Ns } from "@progress/kendo-react-popup";
11
+ import { TextBox as Os, InputPrefix as Ps } from "@progress/kendo-react-inputs";
12
+ import { provideLocalizationService as Ae, registerForLocalization as ms, useLocalization as vs } from "@progress/kendo-react-intl";
13
+ import { Button as Te, Chip as _s } from "@progress/kendo-react-buttons";
14
+ import { ActionSheet as Yt, ActionSheetHeader as Jt, ActionSheetContent as lt, ActionSheetFooter as Rs } from "@progress/kendo-react-layout";
15
+ import { TreeView as Ct } from "@progress/kendo-react-treeview";
16
+ class Et extends o.Component {
17
+ render() {
18
+ const {
19
+ children: t,
20
+ width: e,
21
+ dir: s,
22
+ itemsCount: n,
23
+ popupSettings: a
24
+ } = this.props;
25
+ return /* @__PURE__ */ o.createElement(
26
+ jt,
27
+ {
28
+ style: { width: e, direction: s },
29
+ contentKey: n && n.join(),
30
+ ...a
31
+ },
32
+ t
33
+ );
34
+ }
35
+ }
36
+ const Qt = o.forwardRef((i, t) => {
37
+ const e = o.useRef(null);
38
+ return o.useImperativeHandle(
39
+ t,
40
+ () => e.current
41
+ ), /* @__PURE__ */ o.createElement("div", { className: "k-list-filter" }, /* @__PURE__ */ o.createElement(
42
+ Os,
43
+ {
44
+ ...i,
45
+ ref: e,
46
+ value: i.value || "",
47
+ onChange: i.onChange,
48
+ onKeyDown: i.onKeyDown,
49
+ tabIndex: i.tabIndex,
50
+ onClick: (s) => s.stopPropagation(),
51
+ size: i.size,
52
+ fillMode: i.fillMode,
53
+ rounded: i.rounded,
54
+ prefix: () => /* @__PURE__ */ o.createElement(Ps, null, /* @__PURE__ */ o.createElement(ke, { name: "search", icon: Fs }))
55
+ }
56
+ ));
57
+ });
58
+ Qt.propTypes = {
59
+ value: l.oneOfType([l.string, l.number, l.array]),
60
+ tabIndex: l.number,
61
+ onChange: l.func,
62
+ onKeyDown: l.func,
63
+ size: l.oneOf([null, "small", "medium", "large"]),
64
+ rounded: l.oneOf([null, "small", "medium", "large", "full"]),
65
+ fillMode: l.oneOf([null, "solid", "flat", "outline"])
66
+ };
67
+ Qt.displayName = "KendoReactListFilter";
68
+ const Be = Qt;
69
+ class We extends o.Component {
70
+ render() {
71
+ const {
72
+ group: t,
73
+ groupMode: e,
74
+ render: s
75
+ } = this.props, n = /* @__PURE__ */ o.createElement("div", { className: "k-list-group-sticky-header" }, e === "classic" ? t : /* @__PURE__ */ o.createElement("div", { className: "k-list-header-text" }, t));
76
+ return s !== void 0 ? s.call(void 0, n, this.props) : n;
77
+ }
78
+ }
79
+ const G = (i) => i != null, Bs = (i, t) => {
80
+ for (let e = 0; e < i.length; e++)
81
+ if (i.charAt(e) !== t)
82
+ return !1;
83
+ return !0;
84
+ }, Vs = (i, t, e) => {
85
+ let s = i;
86
+ return e && (s = [e].concat(s)), s.slice(t).concat(s.slice(0, t));
87
+ }, os = (i, t, e) => {
88
+ if (!G(i))
89
+ return !1;
90
+ let s = String(i);
91
+ return e && (s = s.toLowerCase()), s.indexOf(t) === 0;
92
+ }, Ks = (i, t, e, s, n) => {
93
+ const a = i.offsetHeight, p = t.children.item(e), c = p.offsetTop + (n ? s - i.scrollTop : 0), d = p.offsetHeight;
94
+ if (n) {
95
+ let r = 0;
96
+ c + d > a ? r = c + d - a : c < 0 && (r = c), r !== 0 ? i.scrollTop += r : i.scrollTop === 0 && s !== 0 && (i.scrollTop = s);
97
+ } else
98
+ c + d > a + i.scrollTop ? i.scrollTop = c + d - a : c < i.scrollTop && (i.scrollTop -= i.scrollTop - c);
99
+ }, Ve = (i, t, e) => {
100
+ let s = -1;
101
+ if (t) {
102
+ t = t.toLowerCase();
103
+ for (let n = 0; n < i.length; n++) {
104
+ const a = (V(i[n], e) || "") + "";
105
+ if (a && a.toLowerCase().startsWith(t)) {
106
+ s = n;
107
+ break;
108
+ }
109
+ }
110
+ }
111
+ return s;
112
+ }, Kt = (i, t, e, s = !1) => {
113
+ const n = (a) => s ? a : a.toLowerCase();
114
+ return i.findIndex((a) => e ? n(V(a, e)) === n(t) : n(t) === n(a.toString()));
115
+ }, V = (i, t) => {
116
+ if (t && G(i)) {
117
+ const e = t.split(".");
118
+ let s = i;
119
+ return e.forEach((n) => {
120
+ s = s ? s[n] : void 0;
121
+ }), s;
122
+ }
123
+ return i;
124
+ }, Ls = (i = [], t = [], e) => {
125
+ if (i === t)
126
+ return !0;
127
+ if (i.length !== t.length)
128
+ return !1;
129
+ for (let s = 0; s < i.length; s++)
130
+ if (!R(i[s], t[s], e))
131
+ return !1;
132
+ return !0;
133
+ }, vt = (i, t, e) => {
134
+ t.forEach((s) => {
135
+ const n = i.findIndex((a) => R(a, s, e));
136
+ n !== -1 && i.splice(n, 1);
137
+ });
138
+ }, R = (i, t, e) => i === t || G(i) === G(t) && V(i, e) === V(t, e), as = (i, t, e) => {
139
+ if (t) {
140
+ const s = Kt(i, t, e, !0);
141
+ return s !== -1 ? i[s] : i[Ve(i, t, e)];
142
+ }
143
+ return i[0];
144
+ }, zs = (i, t = [], e) => {
145
+ let s = "";
146
+ if (i) {
147
+ const n = t[Ve(t, i, e)];
148
+ if (n) {
149
+ const a = V(n, e);
150
+ i.toLowerCase() !== a.toLowerCase() && (s = a.substring(i.length));
151
+ }
152
+ }
153
+ return s;
154
+ }, Hs = (i) => {
155
+ i.target.nodeName !== "INPUT" && i.preventDefault();
156
+ }, xt = (i, t, e) => !!i != !!t || i.text !== t.text ? !1 : i === t || Ls(i.data, t.data, e), As = (i) => i.preventDefault();
157
+ class Ws extends o.Component {
158
+ render() {
159
+ const {
160
+ selected: t,
161
+ defaultItem: e,
162
+ textField: s
163
+ } = this.props;
164
+ return /* @__PURE__ */ o.createElement(
165
+ "div",
166
+ {
167
+ onClick: this.props.onClick,
168
+ onMouseDown: As,
169
+ style: { position: "unset" },
170
+ className: B("k-list-optionlabel", {
171
+ "k-selected": t
172
+ })
173
+ },
174
+ V(e, s) || ""
175
+ );
176
+ }
177
+ }
178
+ class qs extends o.Component {
179
+ constructor() {
180
+ super(...arguments), this.handleClick = (t) => this.props.onClick(this.props.index, t);
181
+ }
182
+ render() {
183
+ const {
184
+ selected: t,
185
+ group: e,
186
+ dataItem: s,
187
+ virtual: n,
188
+ groupMode: a,
189
+ disabled: p,
190
+ render: c
191
+ } = this.props, d = /* @__PURE__ */ o.createElement(
192
+ "li",
193
+ {
194
+ id: this.props.id,
195
+ role: "option",
196
+ "aria-selected": t,
197
+ "aria-disabled": p ? !0 : void 0,
198
+ className: B("k-list-item", {
199
+ "k-selected": t,
200
+ "k-focus": this.props.focused,
201
+ "k-first": !!e && a === "classic",
202
+ "k-disabled": p
203
+ }),
204
+ onClick: this.handleClick,
205
+ style: { position: n ? "relative" : "unset" }
206
+ },
207
+ /* @__PURE__ */ o.createElement("span", { className: "k-list-item-text" }, V(s, this.props.textField).toString()),
208
+ e !== void 0 && a === "classic" ? /* @__PURE__ */ o.createElement("div", { className: "k-list-item-group-label" }, e) : null
209
+ );
210
+ return c !== void 0 ? c.call(void 0, d, this.props) : d;
211
+ }
212
+ }
213
+ class $s extends o.Component {
214
+ render() {
215
+ const {
216
+ group: t,
217
+ virtual: e,
218
+ render: s,
219
+ isMultiColumn: n = !1
220
+ } = this.props, a = /* @__PURE__ */ o.createElement(
221
+ "li",
222
+ {
223
+ id: this.props.id,
224
+ role: "group",
225
+ className: n ? "k-table-group-row" : "k-list-group-item",
226
+ style: n ? { boxSizing: "inherit" } : { position: e ? "relative" : "unset" }
227
+ },
228
+ /* @__PURE__ */ o.createElement("span", { className: s ? void 0 : n ? "k-table-th" : "k-list-item-text" }, t)
229
+ );
230
+ return s !== void 0 ? s.call(void 0, a, this.props) : a;
231
+ }
232
+ }
233
+ const fe = "dropdowns.nodata", it = "dropdowns.clear", Lt = "dropdowns.comboArrowBtnAriaLabelExpand", zt = "dropdowns.comboArrowBtnAriaLabelCollapse", Ht = "dropdowns.dropDownListArrowBtnAriaLabel", nt = "dropdowns.apply", ot = "dropdowns.cancel", le = {
234
+ [it]: "clear",
235
+ [fe]: "NO DATA FOUND.",
236
+ [Lt]: "expand combobox",
237
+ [zt]: "collapse combobox",
238
+ [Ht]: "select",
239
+ [nt]: "Apply",
240
+ [ot]: "Cancel"
241
+ };
242
+ class Ue extends o.Component {
243
+ renderItems() {
244
+ const {
245
+ textField: t,
246
+ valueField: e,
247
+ groupField: s,
248
+ groupMode: n,
249
+ isMultiColumn: a,
250
+ optionsGuid: p,
251
+ skip: c = 0,
252
+ virtual: d,
253
+ focusedIndex: r,
254
+ highlightSelected: h = !0,
255
+ value: u,
256
+ data: g,
257
+ itemRender: m,
258
+ groupHeaderItemRender: v
259
+ } = this.props, b = Array.isArray(u);
260
+ let w = 0;
261
+ return g.map((S, D) => {
262
+ const N = c + D, O = c + D + w, _ = S.disabled ? !1 : h && (!b && R(S, u, e) || b && u.findIndex((E) => R(E, S, e)) !== -1);
263
+ let C, F, x;
264
+ return D > 0 && s !== void 0 && (F = V(S, s), x = V(g[D - 1], s), F && x && F !== x && (C = F)), C !== void 0 && n === "modern" && (w += 1), [
265
+ C !== void 0 && n === "modern" && /* @__PURE__ */ o.createElement(
266
+ $s,
267
+ {
268
+ id: `option-${p}-${O}`,
269
+ virtual: d,
270
+ key: N + "-group-item",
271
+ group: C,
272
+ isMultiColumn: a,
273
+ render: v
274
+ }
275
+ ),
276
+ /* @__PURE__ */ o.createElement(
277
+ qs,
278
+ {
279
+ id: `option-${p}-${C !== void 0 && n === "modern" ? O + 1 : O}`,
280
+ virtual: d,
281
+ dataItem: S,
282
+ groupMode: n,
283
+ selected: _,
284
+ focused: r === D,
285
+ index: N,
286
+ key: N,
287
+ onClick: this.props.onClick,
288
+ textField: t,
289
+ group: C,
290
+ render: m,
291
+ disabled: S.disabled
292
+ }
293
+ )
294
+ ];
295
+ });
296
+ }
297
+ renderNoValueElement(t) {
298
+ const e = this.props.noDataRender, s = /* @__PURE__ */ o.createElement("div", { className: "k-nodata" }, /* @__PURE__ */ o.createElement("div", null, t.toLanguageString(fe, le[fe])));
299
+ return e ? e.call(void 0, s) : s;
300
+ }
301
+ render() {
302
+ const t = Ae(this), {
303
+ id: e,
304
+ show: s,
305
+ wrapperCssClass: n,
306
+ wrapperStyle: a,
307
+ listStyle: p,
308
+ listRef: c,
309
+ wrapperRef: d,
310
+ listClassName: r = "k-list-ul",
311
+ ariaSetSize: h
312
+ } = this.props, u = this.renderItems();
313
+ return u.length ? /* @__PURE__ */ o.createElement(
314
+ "div",
315
+ {
316
+ className: n,
317
+ style: a,
318
+ ref: d,
319
+ onMouseDown: this.props.onMouseDown,
320
+ onBlur: this.props.onBlur,
321
+ onScroll: this.props.onScroll,
322
+ unselectable: "on"
323
+ },
324
+ /* @__PURE__ */ o.createElement(
325
+ "ul",
326
+ {
327
+ id: e,
328
+ role: "listbox",
329
+ "aria-hidden": s ? void 0 : !0,
330
+ "aria-setsize": h,
331
+ className: r,
332
+ ref: c,
333
+ style: p
334
+ },
335
+ u
336
+ ),
337
+ this.props.scroller && /* @__PURE__ */ o.createElement("div", { className: "k-height-container" }, this.props.scroller)
338
+ ) : this.renderNoValueElement(t);
339
+ }
340
+ }
341
+ ms(Ue);
342
+ const Gs = 1533915;
343
+ class Us {
344
+ constructor() {
345
+ this.container = null, this.scrollElement = null, this.list = null, this.containerHeight = 0, this.skip = 0, this.total = 0, this.enabled = !1, this.pageSize = 0, this.itemHeight = 0, this.PageChange = null, this.prevScrollPos = 0, this.listTranslate = 0, this.scrollSyncing = !1, this.scrollerRef = (t) => {
346
+ const e = this;
347
+ e.container = t, t && (t.setAttribute("unselectable", "on"), window.setTimeout(e.calcScrollElementHeight.bind(e), 0));
348
+ }, this.calcScrollElementHeight = () => {
349
+ this.scrollSyncing = !0;
350
+ let t = !1;
351
+ this.itemHeight = this.list ? this.list.children[0].offsetHeight : this.itemHeight, this.containerHeight = Math.min(Gs, this.itemHeight * this.total);
352
+ const e = this.containerHeight;
353
+ return this.scrollElement && (t = this.scrollElement.style.height !== e + "px", t && (this.scrollElement.style.height = e + "px")), this.scrollSyncing = !1, t;
354
+ }, this.scrollHandler = this.scrollHandler.bind(this);
355
+ }
356
+ get translate() {
357
+ return this.listTranslate;
358
+ }
359
+ changePage(t, e) {
360
+ const s = Math.min(Math.max(0, t), this.total - this.pageSize);
361
+ s !== this.skip && this.PageChange && this.PageChange({ skip: s, take: this.pageSize }, e);
362
+ }
363
+ translateTo(t) {
364
+ this.listTranslate = t, this.list && (this.list.style.transform = "translateY(" + t + "px)");
365
+ }
366
+ reset() {
367
+ this.container && (this.calcScrollElementHeight(), this.container.scrollTop = 0, this.translateTo(0));
368
+ }
369
+ scrollToEnd() {
370
+ this.container && this.list && (this.calcScrollElementHeight(), this.container.scrollTop = this.container.scrollHeight - this.container.offsetHeight, this.translateTo(this.container.scrollHeight));
371
+ }
372
+ localScrollUp(t) {
373
+ const e = this.itemHeight, s = this.container.scrollTop;
374
+ let n = this.listTranslate, a, p = s - n;
375
+ if (!(p > e)) {
376
+ for (a = 0; a < this.skip && !(n + e + p <= s); a++)
377
+ n -= e;
378
+ if (n = this.validateTranslate(n), this.skip - a <= 0 && n >= s) {
379
+ this.translateTo(0), this.changePage(0, t), this.container.scrollTop = 0;
380
+ return;
381
+ }
382
+ n !== this.listTranslate && (this.translateTo(n), this.changePage(this.skip - a, t));
383
+ }
384
+ }
385
+ localScrollDown(t) {
386
+ const e = this.itemHeight;
387
+ let s = this.container.scrollTop, n = this.listTranslate;
388
+ const a = this.list.children.length;
389
+ let p;
390
+ for (p = 0; p < a && !(n + e >= s); p++)
391
+ n += e;
392
+ n = this.validateTranslate(n), p >= a && this.skip + p >= this.total ? (this.translateTo(n), this.changePage(this.total - 1, t)) : n !== this.listTranslate && (this.translateTo(n), this.changePage(this.skip + p, t));
393
+ }
394
+ scrollNonStrict(t) {
395
+ const e = this.total * this.prevScrollPos / this.containerHeight, s = Math.min(Math.floor(e), this.total - 1);
396
+ let n = this.containerHeight * e / this.total;
397
+ n = this.validateTranslate(n), this.translateTo(n), this.changePage(s, t);
398
+ }
399
+ scrollHandler(t) {
400
+ const e = this.container ? this.container.scrollTop : 0, s = this.prevScrollPos;
401
+ this.prevScrollPos = e, !(!this.enabled || !this.list || !this.container || this.scrollSyncing) && (e - s <= 0 && e > this.listTranslate - this.list.scrollHeight / 10 ? this.localScrollUp(t) : e - s > 0 && e < this.listTranslate + this.list.scrollHeight * 2 / 3 ? this.localScrollDown(t) : this.scrollNonStrict(t));
402
+ }
403
+ validateTranslate(t) {
404
+ return t = Math.max(0, t), t = Math.min(this.containerHeight, t), t;
405
+ }
406
+ }
407
+ class js {
408
+ navigate(t) {
409
+ const e = t.keyCode;
410
+ if (e === f.up || e === f.left)
411
+ return this.next({ current: t.current, min: t.min, max: t.max, step: t.skipItems ? t.skipItems : -1 });
412
+ if (e === f.down || e === f.right)
413
+ return this.next({ current: t.current, min: t.min, max: t.max, step: t.skipItems ? t.skipItems : 1 });
414
+ if (e === f.home)
415
+ return 0;
416
+ if (e === f.end)
417
+ return t.max;
418
+ }
419
+ next(t) {
420
+ return G(t.current) ? Math.min(t.max, Math.max(t.current + t.step, t.min)) : t.min;
421
+ }
422
+ }
423
+ const Xt = class {
424
+ constructor(i) {
425
+ this.wrapper = null, this.list = null, this.vs = new Us(), this.navigation = new js(), this.handleItemClick = (t, e) => {
426
+ const s = this.initState();
427
+ s.syntheticEvent = e, e.stopPropagation(), this.component.handleItemSelect(t, s), this.togglePopup(s), this.applyState(s);
428
+ }, this.handleFocus = (t) => {
429
+ if (!this.component.state.focused) {
430
+ const e = this.initState();
431
+ e.data.focused = !0, e.events.push({ type: "onFocus" }), e.syntheticEvent = t, this.applyState(e);
432
+ }
433
+ }, this.filterChanged = (t, e) => {
434
+ const { textField: s, filterable: n } = this.component.props;
435
+ n && e.events.push({
436
+ type: "onFilterChange",
437
+ filter: {
438
+ field: s,
439
+ operator: "contains",
440
+ ignoreCase: !0,
441
+ value: t
442
+ }
443
+ });
444
+ }, this.togglePopup = (t) => {
445
+ const e = this.component.props, s = e.opened !== void 0 ? e.opened : this.component.state.opened;
446
+ e.opened === void 0 && (t.data.opened = !s), s ? t.events.push({ type: "onClose" }) : (t.events.push({ type: "onOpen" }), this.calculatePopupWidth());
447
+ }, this.pageChange = (t, e) => {
448
+ const s = this.initState();
449
+ s.syntheticEvent = e, this.triggerOnPageChange(s, t.skip, t.take), this.applyState(s);
450
+ }, this.scrollToVirtualItem = (t, e) => {
451
+ const s = this.vs;
452
+ if (s.enabled = !1, t.skip === 0)
453
+ s.reset();
454
+ else if (t.skip + t.pageSize === t.total)
455
+ s.scrollToEnd();
456
+ else {
457
+ let n = s.translate;
458
+ n === 0 && (s.calcScrollElementHeight(), n = s.itemHeight * t.skip, s.translateTo(n - s.itemHeight)), s.container && (s.container.scrollTop = n), this.scrollToItem(e, !0);
459
+ }
460
+ window.setTimeout(() => s.enabled = !0, 10);
461
+ }, this.scrollPopupByPageSize = (t) => {
462
+ var p, c, d, r, h, u;
463
+ const e = this.vs, s = (c = (p = this.list) == null ? void 0 : p.parentElement) == null ? void 0 : c.scrollTop, n = e.enabled && e.itemHeight ? e.itemHeight : this.list ? this.list.children[0].offsetHeight : 0, a = (r = (d = this.list) == null ? void 0 : d.parentElement) == null ? void 0 : r.offsetHeight;
464
+ s !== void 0 && a !== void 0 && ((u = (h = this.list) == null ? void 0 : h.parentElement) == null || u.scroll({ top: s + t * Math.floor(a / n) * n }));
465
+ }, this.renderScrollElement = () => {
466
+ const t = this.vs;
467
+ return t.enabled && /* @__PURE__ */ o.createElement(
468
+ "div",
469
+ {
470
+ ref: (e) => t.scrollElement = e,
471
+ key: "scrollElementKey"
472
+ }
473
+ );
474
+ }, this.resetGroupStickyHeader = (t, e) => {
475
+ t !== e.state.group && e.setState({ ...e.state, group: t });
476
+ }, this.listBoxId = Fe(), this.guid = Fe(), this.component = i, this.vs.PageChange = this.pageChange;
477
+ }
478
+ didMount() {
479
+ const i = this.component.props, t = i.popupSettings || {}, e = i.style || {}, s = t.width;
480
+ let n = i.opened === !0;
481
+ s === void 0 && this.calculatePopupWidth(), i.dir === void 0 && e.direction === void 0 && (this.calculateDir(), n = !0), n && this.component.forceUpdate();
482
+ }
483
+ calculateDir() {
484
+ const i = this.component.element;
485
+ i && i.ownerDocument && i.ownerDocument.defaultView && (this.dirCalculated = i.ownerDocument.defaultView.getComputedStyle(i).direction || void 0);
486
+ }
487
+ calculatePopupWidth() {
488
+ this.wrapper && (this.popupWidth = this.wrapper.offsetWidth + "px");
489
+ }
490
+ scrollToItem(i, t, e) {
491
+ const s = this.list || this.vs.list;
492
+ if (!s && !e && setTimeout(() => {
493
+ this.scrollToItem(i, t, !0);
494
+ }, 10), s && i >= 0) {
495
+ const n = this.vs, a = n.container || s.parentNode, p = t !== void 0 ? t : n.enabled;
496
+ Ks(a, s, i, n.translate, p);
497
+ }
498
+ }
499
+ initState() {
500
+ return {
501
+ data: {},
502
+ events: [],
503
+ syntheticEvent: void 0
504
+ };
505
+ }
506
+ applyState(i) {
507
+ Object.keys(i.data).length > 0 && this.component.setState(i.data);
508
+ const t = {
509
+ syntheticEvent: i.syntheticEvent,
510
+ nativeEvent: i.syntheticEvent ? i.syntheticEvent.nativeEvent : void 0,
511
+ target: this.component,
512
+ value: this.component.value
513
+ };
514
+ i.events.forEach((e) => {
515
+ const s = e.type;
516
+ delete e.type;
517
+ const n = s && this.component.props[s];
518
+ n && n.call(void 0, {
519
+ ...t,
520
+ ...e
521
+ });
522
+ });
523
+ }
524
+ triggerOnPageChange(i, t, e) {
525
+ const s = this.component.props.virtual;
526
+ if (s) {
527
+ const n = Math.min(Math.max(0, t), Math.max(0, s.total - e));
528
+ n !== s.skip && i.events.push({
529
+ type: "onPageChange",
530
+ page: { skip: n, take: e }
531
+ });
532
+ }
533
+ }
534
+ triggerPageChangeCornerItems(i, t) {
535
+ const e = this.component.props, { data: s = [], dataItemKey: n, virtual: a } = e, p = e.opened !== void 0 ? e.opened : this.component.state.opened;
536
+ i && a && this.vs.enabled && (a.skip > 0 && R(i, s[0], n) ? this.triggerOnPageChange(t, a.skip - 1, a.pageSize) : !p && a.skip + a.pageSize < a.total && R(i, s[s.length - 1], n) && this.triggerOnPageChange(t, a.skip + 1, a.pageSize));
537
+ }
538
+ getPopupSettings() {
539
+ return Object.assign({}, Xt.defaultProps.popupSettings, this.component.props.popupSettings);
540
+ }
541
+ getGroupedDataModernMode(i, t) {
542
+ let e = [];
543
+ return i.forEach((s, n) => {
544
+ i[n - 1] && s[t] !== i[n - 1][t] && e.push({ [t]: s[t] }), e.push(i[n]);
545
+ }), e;
546
+ }
547
+ };
548
+ let ie = Xt;
549
+ ie.basicPropTypes = {
550
+ opened: l.bool,
551
+ disabled: l.bool,
552
+ dir: l.string,
553
+ tabIndex: l.number,
554
+ accessKey: l.string,
555
+ data: l.array,
556
+ textField: l.string,
557
+ className: l.string,
558
+ label: l.string,
559
+ loading: l.bool,
560
+ popupSettings: l.shape({
561
+ animate: l.oneOfType([l.bool, l.shape({
562
+ openDuration: l.number,
563
+ closeDuration: l.number
564
+ })]),
565
+ popupClass: l.string,
566
+ className: l.string,
567
+ appendTo: l.any,
568
+ width: l.oneOfType([l.string, l.number]),
569
+ height: l.oneOfType([l.string, l.number])
570
+ }),
571
+ onOpen: l.func,
572
+ onClose: l.func,
573
+ onFocus: l.func,
574
+ onBlur: l.func,
575
+ onChange: l.func,
576
+ itemRender: l.func,
577
+ listNoDataRender: l.func,
578
+ focusedItemIndex: l.func,
579
+ header: l.node,
580
+ footer: l.node
581
+ };
582
+ ie.propTypes = {
583
+ ...Xt.basicPropTypes,
584
+ value: l.any,
585
+ defaultValue: l.any,
586
+ filterable: l.bool,
587
+ filter: l.string,
588
+ virtual: l.shape({
589
+ pageSize: l.number.isRequired,
590
+ skip: l.number.isRequired,
591
+ total: l.number.isRequired
592
+ }),
593
+ onFilterChange: l.func,
594
+ onPageChange: l.func
595
+ };
596
+ ie.defaultProps = {
597
+ popupSettings: {
598
+ height: "200px"
599
+ },
600
+ required: !1,
601
+ validityStyles: !0
602
+ };
603
+ const je = {
604
+ name: "@progress/kendo-react-dropdowns",
605
+ productName: "KendoReact",
606
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
607
+ publishDate: 1701439314,
608
+ version: "",
609
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
610
+ }, St = 500, Se = 768, Ys = "Please select a value from the list!", { sizeMap: Vt, roundedMap: Js } = $e, At = class extends o.Component {
611
+ constructor(i) {
612
+ super(i), this.state = {}, this._element = null, this.base = new ie(this), this.searchState = { word: "", last: "" }, this._select = null, this._skipFocusEvent = !1, this._filterInput = null, this._navigated = !1, this._lastKeypressIsFilter = !1, this._inputId = Fe(), this.itemHeight = 0, this.focus = () => {
613
+ this.base.wrapper && this.base.wrapper.focus();
614
+ }, this.handleItemSelect = (t, e) => {
615
+ const { data: s = [], virtual: n, dataItemKey: a, defaultItem: p } = this.props, c = n ? n.skip : 0, d = t === -1 && p !== void 0 ? p : s[t - c], r = !R(d, this.value, a);
616
+ this.triggerOnChange(d, e), r && this.base.triggerPageChangeCornerItems(d, e);
617
+ }, this.componentRef = (t) => {
618
+ this._element = t, this.base.wrapper = t;
619
+ }, this.dummySelect = (t) => /* @__PURE__ */ o.createElement(
620
+ "select",
621
+ {
622
+ name: this.props.name,
623
+ ref: (e) => {
624
+ this._select = e;
625
+ },
626
+ tabIndex: -1,
627
+ "aria-hidden": !0,
628
+ title: this.props.label,
629
+ style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
630
+ },
631
+ /* @__PURE__ */ o.createElement(
632
+ "option",
633
+ {
634
+ value: this.props.valueMap ? this.props.valueMap.call(void 0, t) : t
635
+ }
636
+ )
637
+ ), this.renderListContainer = () => {
638
+ const { header: t, footer: e, dir: s, data: n = [], size: a, groupField: p, groupStickyHeaderItemRender: c, list: d } = this.props, r = this.base, h = r.getPopupSettings(), u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = h.width !== void 0 ? h.width : r.popupWidth, m = {
639
+ dir: s !== void 0 ? s : r.dirCalculated,
640
+ width: g,
641
+ popupSettings: {
642
+ popupClass: B(
643
+ h.popupClass,
644
+ "k-list-container",
645
+ "k-dropdownlist-popup"
646
+ ),
647
+ className: h.className,
648
+ animate: h.animate,
649
+ anchor: this.element,
650
+ show: u,
651
+ onOpen: this.onPopupOpened,
652
+ onClose: this.onPopupClosed,
653
+ appendTo: h.appendTo
654
+ },
655
+ itemsCount: [n.length]
656
+ };
657
+ let { group: v } = this.state;
658
+ return v === void 0 && p !== void 0 && (v = V(n[0], p)), /* @__PURE__ */ o.createElement(Et, { ...m }, this.renderListFilter(), t && /* @__PURE__ */ o.createElement("div", { className: "k-list-header" }, t), /* @__PURE__ */ o.createElement(
659
+ "div",
660
+ {
661
+ className: B(
662
+ "k-list",
663
+ {
664
+ [`k-list-${Vt[a] || a}`]: a,
665
+ "k-virtual-list": this.base.vs.enabled
666
+ }
667
+ )
668
+ },
669
+ this.renderDefaultItem(),
670
+ !d && v && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: v, groupMode: "modern", render: c }),
671
+ this.renderList()
672
+ ), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e));
673
+ }, this.renderList = () => {
674
+ const {
675
+ data: t = [],
676
+ textField: e,
677
+ dataItemKey: s,
678
+ virtual: n = { skip: 0, total: void 0 },
679
+ groupHeaderItemRender: a,
680
+ listNoDataRender: p,
681
+ itemRender: c
682
+ } = this.props, d = this.base.vs, r = n.skip, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = this.base.getPopupSettings(), g = `translateY(${d.translate}px)`;
683
+ return /* @__PURE__ */ o.createElement(
684
+ Ue,
685
+ {
686
+ id: this.base.listBoxId,
687
+ show: h,
688
+ data: t.slice(),
689
+ focusedIndex: this.getFocusedIndex(),
690
+ value: this.value,
691
+ textField: e,
692
+ valueField: s,
693
+ optionsGuid: this.base.guid,
694
+ groupField: this.props.groupField,
695
+ groupMode: "modern",
696
+ listRef: (m) => d.list = this.base.list = m,
697
+ wrapperStyle: { maxHeight: u.height },
698
+ wrapperCssClass: "k-list-content",
699
+ listStyle: d.enabled ? { transform: g } : void 0,
700
+ key: "listkey",
701
+ skip: r,
702
+ onClick: this.handleItemClick,
703
+ itemRender: c,
704
+ groupHeaderItemRender: a,
705
+ noDataRender: p,
706
+ onScroll: this.onScroll,
707
+ wrapperRef: d.scrollerRef,
708
+ scroller: this.base.renderScrollElement(),
709
+ ariaSetSize: n.total
710
+ }
711
+ );
712
+ }, this.onScroll = (t) => {
713
+ const { vs: e, list: s } = this.base;
714
+ e.scrollHandler(t);
715
+ const { groupField: n } = this.props;
716
+ let { data: a = [] } = this.props;
717
+ if (!(!n || !a.length) && n) {
718
+ const p = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : s ? s.children[0].offsetHeight : 0), d = t.target.scrollTop - e.skip * p;
719
+ a = this.base.getGroupedDataModernMode(a, n);
720
+ let r = a[0][n];
721
+ for (let h = 1; h < a.length && !(p * h > d); h++)
722
+ a[h] && a[h][n] && (r = a[h][n]);
723
+ r !== this.state.group && this.setState({
724
+ group: r
725
+ });
726
+ }
727
+ }, this.renderListFilter = () => {
728
+ const t = this.props.filter !== void 0 ? this.props.filter : this.state.text;
729
+ return this.props.filterable && /* @__PURE__ */ o.createElement(
730
+ Be,
731
+ {
732
+ value: t,
733
+ ref: (e) => this._filterInput = e && e.element,
734
+ onChange: this.handleListFilterChange,
735
+ onKeyDown: this.handleKeyDown,
736
+ size: this.props.size,
737
+ rounded: this.props.rounded,
738
+ fillMode: this.props.fillMode
739
+ }
740
+ );
741
+ }, this.renderDefaultItem = () => {
742
+ const { textField: t, defaultItem: e, dataItemKey: s } = this.props;
743
+ return e !== void 0 && /* @__PURE__ */ o.createElement(
744
+ Ws,
745
+ {
746
+ defaultItem: e,
747
+ textField: t,
748
+ selected: R(this.value, e, s),
749
+ key: "defaultitemkey",
750
+ onClick: this.handleDefaultItemClick
751
+ }
752
+ );
753
+ }, this.search = (t) => {
754
+ clearTimeout(this._typingTimeout), this.props.filterable || (this._typingTimeout = window.setTimeout(() => this.searchState.word = "", this.props.delay), this.selectNext(t));
755
+ }, this.selectNext = (t) => {
756
+ const { data: e = [], dataItemKey: s } = this.props;
757
+ let n = e.map((S, D) => ({ item: S, itemIndex: D }));
758
+ const a = this.searchState.word, p = this.searchState.last, c = Bs(a, p);
759
+ let d = n.length, r = Math.max(0, e.findIndex((S) => R(S, this.value, s))), h;
760
+ this.props.defaultItem && (h = { item: this.props.defaultItem, itemIndex: -1 }, d += 1, r += 1), r += c ? 1 : 0, n = Vs(n, r, h);
761
+ let u, g, m, v = 0;
762
+ const { textField: b, ignoreCase: w } = this.props;
763
+ for (; v < d; v++)
764
+ if (u = V(n[v].item, b), g = c && os(u, p, w), m = os(u, a, w), g || m) {
765
+ v = n[v].itemIndex;
766
+ break;
767
+ }
768
+ if (v !== d) {
769
+ const S = this.base.initState();
770
+ S.syntheticEvent = t, this.handleItemSelect(v, S), this.applyState(S), this._valueDuringOnChange = void 0;
771
+ }
772
+ }, this.handleKeyDown = (t) => {
773
+ t && t.target instanceof Element && t.target.nodeName === "INPUT" && t.stopPropagation && t.stopPropagation();
774
+ const {
775
+ data: e = [],
776
+ filterable: s,
777
+ disabled: n,
778
+ defaultItem: a,
779
+ leftRightKeysNavigation: p = !0,
780
+ virtual: c = { skip: 0, total: 0, pageSize: 0 },
781
+ dataItemKey: d,
782
+ groupField: r = "",
783
+ textField: h,
784
+ skipDisabledItems: u = !0
785
+ } = this.props, g = this.value, m = e.findIndex((F) => R(F, g, d)), v = this.props.opened !== void 0 ? this.props.opened : this.state.opened, b = t.keyCode, w = b === f.home || b === f.end, S = b === f.up || b === f.down, D = !v && (t.altKey && b === f.down || b === f.enter || b === f.space), N = v && (t.altKey && b === f.up || b === f.esc), O = p && (b === f.left || b === f.right), _ = S || O && !s || w, C = this.base.initState();
786
+ if (C.syntheticEvent = t, !n) {
787
+ if (w && this.base.vs.enabled)
788
+ b === f.home ? c.skip !== 0 ? (this.base.triggerOnPageChange(C, 0, c.pageSize), this._navigated = !0) : this.triggerOnChange(e[0], C) : c.skip < c.total - c.pageSize ? (this.base.triggerOnPageChange(C, c.total - c.pageSize, c.pageSize), this._navigated = !0) : this.triggerOnChange(e[e.length - 1], C);
789
+ else if (v && b === f.pageUp)
790
+ this.base.scrollPopupByPageSize(-1);
791
+ else if (v && b === f.pageDown)
792
+ this.base.scrollPopupByPageSize(1);
793
+ else if (v && b === f.enter) {
794
+ const F = this.getFocusedIndex();
795
+ this.haveFocusedItemAndDataNotEmpty(e, F) ? (this.triggerOnChange(null, C), this.applyState(C)) : this.handleItemSelect(F, C), this.base.togglePopup(C), t.preventDefault();
796
+ } else if (D || N)
797
+ N && this.resetValueIfDisabledItem(), this.base.togglePopup(C), t.preventDefault();
798
+ else if (_) {
799
+ if (this._lastKeypressIsFilter = !1, r !== "" && h)
800
+ if (!u && v)
801
+ this.onNavigate(C, b);
802
+ else {
803
+ let F;
804
+ if (b === f.down || b === f.right) {
805
+ const x = e.slice(m + 1).find((E) => !E.disabled && E[h]);
806
+ F = x && e.findIndex((E) => E[h] === x[h]);
807
+ } else if (b === f.up || b === f.left) {
808
+ let x;
809
+ if (m === 0 && a)
810
+ F = -1;
811
+ else if (m === -1)
812
+ x = e, F = e.findIndex((E) => !E.disabled && E[h]);
813
+ else {
814
+ x = e.slice(0, m);
815
+ let E = x.pop();
816
+ for (; E && E.disabled; )
817
+ E = x.pop();
818
+ F = E && e.findIndex((M) => M[h] === E[h]);
819
+ }
820
+ }
821
+ if (F !== void 0) {
822
+ const x = F - m;
823
+ this.onNavigate(C, b, x);
824
+ } else
825
+ F === void 0 && e.findIndex((x) => x[h] === g[h]) === e.length - 1 && this.onNavigate(C, b);
826
+ }
827
+ else if (!u && v || w)
828
+ this.onNavigate(C, b);
829
+ else if (h) {
830
+ let F;
831
+ if (b === f.down || b === f.right) {
832
+ const x = e.slice(m + 1).find((E) => !E.disabled && E[h]);
833
+ F = x && e.findIndex((E) => E[h] === x[h]);
834
+ } else if (b === f.up || b === f.left) {
835
+ let x;
836
+ if (m === 0 && a)
837
+ F = -1;
838
+ else if (m === -1)
839
+ x = e, F = e.find((E) => !E.disabled && E[h]);
840
+ else {
841
+ x = e.slice(0, m);
842
+ let E = x.pop();
843
+ for (; E && E.disabled; )
844
+ E = x.pop();
845
+ F = E && e.findIndex((M) => M[h] === E[h]);
846
+ }
847
+ }
848
+ if (F !== void 0) {
849
+ const x = F - m;
850
+ this.onNavigate(C, b, x);
851
+ } else
852
+ F === void 0 && e.findIndex((x) => x[h] === g[h]) === e.length - 1 && this.onNavigate(C, b);
853
+ } else
854
+ this.onNavigate(C, b);
855
+ t.preventDefault();
856
+ }
857
+ this.applyState(C);
858
+ }
859
+ }, this.handleItemClick = (t, e) => {
860
+ this.base.handleItemClick(t, e), this._valueDuringOnChange = void 0;
861
+ }, this.handleFocus = (t) => {
862
+ this._skipFocusEvent || this.base.handleFocus(t);
863
+ }, this.handleBlur = (t) => {
864
+ if (this._skipFocusEvent || !this.state.focused)
865
+ return;
866
+ const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { adaptive: s } = this.props, { windowWidth: n = 0 } = this.state, a = n <= Se && s, p = this.base.initState();
867
+ p.syntheticEvent = t, p.data.focused = !1, p.events.push({ type: "onBlur" }), e && this.resetValueIfDisabledItem(), e && !a && this.base.togglePopup(p), this.applyState(p);
868
+ }, this.handleDefaultItemClick = (t) => {
869
+ const e = this.base.initState();
870
+ e.syntheticEvent = t, this.base.togglePopup(e), this.triggerOnChange(this.props.defaultItem, e), this.applyState(e);
871
+ }, this.handleWrapperClick = (t) => {
872
+ if (t.isPropagationStopped())
873
+ return;
874
+ const e = this.base.initState();
875
+ e.syntheticEvent = t, this.state.focused || (e.data.focused = !0), this.resetValueIfDisabledItem(), this.base.togglePopup(e), this.applyState(e);
876
+ }, this.handleKeyPress = (t) => {
877
+ if (this.props.filterable || t.which === 0 || t.keyCode === f.enter)
878
+ return;
879
+ let e = String.fromCharCode(t.charCode || t.keyCode);
880
+ this.props.ignoreCase && (e = e.toLowerCase()), e === " " && t.preventDefault(), this.searchState = {
881
+ word: this.searchState.word + e,
882
+ last: this.searchState.last + e
883
+ }, this.search(t);
884
+ }, this.handleListFilterChange = (t) => {
885
+ const e = this.base.initState();
886
+ e.syntheticEvent = t.syntheticEvent, this.props.filter === void 0 && (e.data.text = t.target.value), this.base.filterChanged(t.target.value, e), this._lastKeypressIsFilter = !0, this.applyState(e), this.setState({ group: void 0 });
887
+ }, this.onPopupOpened = () => {
888
+ this._filterInput && this.focusElement(this._filterInput), this.props.adaptive && setTimeout(() => {
889
+ this._filterInput && this.focusElement(this._filterInput);
890
+ }, 300);
891
+ }, this.onPopupClosed = () => {
892
+ this.state.focused && window.setTimeout(
893
+ () => {
894
+ this.state.focused && this.base.wrapper && this.focusElement(this.base.wrapper);
895
+ }
896
+ );
897
+ }, this.setValidity = () => {
898
+ this._select && this._select.setCustomValidity && this._select.setCustomValidity(
899
+ this.validity.valid ? "" : this.props.validationMessage || Ys
900
+ );
901
+ }, qe(je);
902
+ }
903
+ get document() {
904
+ if (Me)
905
+ return this.element && this.element.ownerDocument || document;
906
+ }
907
+ /**
908
+ * @hidden
909
+ */
910
+ get element() {
911
+ return this._element;
912
+ }
913
+ /**
914
+ * The value of the DropDownList.
915
+ */
916
+ get value() {
917
+ let i;
918
+ return this._valueDuringOnChange !== void 0 ? i = this._valueDuringOnChange : this.props.value !== void 0 ? i = this.props.value : this.state.value !== void 0 ? i = this.state.value : this.props.defaultValue !== void 0 && (i = this.props.defaultValue), !G(i) && this.props.defaultItem !== void 0 && (i = this.props.defaultItem), i;
919
+ }
920
+ /**
921
+ * The index of the selected item.
922
+ */
923
+ get index() {
924
+ const { data: i = [], dataItemKey: t } = this.props, e = this.value;
925
+ return i.findIndex((s) => R(s, e, t));
926
+ }
927
+ /**
928
+ * Gets the `name` property of the DropDownList.
929
+ */
930
+ get name() {
931
+ return this.props.name;
932
+ }
933
+ /**
934
+ * Represents the validity state into which the DropDownList is set.
935
+ */
936
+ get validity() {
937
+ const i = 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;
938
+ return {
939
+ customError: i,
940
+ valid: e,
941
+ valueMissing: this.value === null
942
+ };
943
+ }
944
+ get validityStyles() {
945
+ return this.props.validityStyles !== void 0 ? this.props.validityStyles : At.defaultProps.validityStyles;
946
+ }
947
+ /**
948
+ * @hidden
949
+ */
950
+ get required() {
951
+ return this.props.required !== void 0 ? this.props.required : At.defaultProps.required;
952
+ }
953
+ /**
954
+ * @hidden
955
+ */
956
+ componentDidUpdate(i, t) {
957
+ var u;
958
+ const { dataItemKey: e, virtual: s, groupField: n = "", textField: a } = this.props;
959
+ let { data: p = [] } = this.props;
960
+ const c = i.virtual ? i.virtual.total : 0, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = i.opened !== void 0 ? i.opened : t.opened, h = !r && d;
961
+ if (this.base.getPopupSettings().animate || h && this.onPopupOpened(), s && s.total !== c)
962
+ this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
963
+ else {
964
+ const g = this.value, m = i.value !== void 0 ? i.value : t.value;
965
+ let v = p.findIndex((w) => R(w, g, e));
966
+ n !== "" && g && a && (v = (u = this.base.getGroupedDataModernMode(p, n)) == null ? void 0 : u.map((w) => w[a]).indexOf(g[a]));
967
+ const b = !R(m, g, e);
968
+ h && s ? this.base.scrollToVirtualItem(s, v) : h && !s ? (this.onPopupOpened(), p && p.length !== 0 && this.base.resetGroupStickyHeader(p[0][n], this), this.base.scrollToItem(v)) : d && r && g && b && !this._navigated ? this.base.scrollToItem(v) : d && r && this._navigated && (this._navigated && s && s.skip === 0 ? this.base.vs.reset() : this._navigated && s && s.skip === s.total - s.pageSize && this.base.vs.scrollToEnd());
969
+ }
970
+ this._navigated = !1, this.setValidity();
971
+ }
972
+ /**
973
+ * @hidden
974
+ */
975
+ componentDidMount() {
976
+ var i;
977
+ this.observerResize = Me && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (i = this.document) != null && i.body && this.observerResize && this.observerResize.observe(this.document.body);
978
+ }
979
+ /** @hidden */
980
+ componentWillUnmount() {
981
+ var i;
982
+ (i = this.document) != null && i.body && this.observerResize && this.observerResize.disconnect();
983
+ }
984
+ /**
985
+ * @hidden
986
+ */
987
+ render() {
988
+ const i = Ae(this).toLanguageString(Ht, le[Ht]), { style: t, className: e, label: s, dir: n, virtual: a, size: p, rounded: c, fillMode: d, adaptive: r } = this.props, { windowWidth: h = 0 } = this.state, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = this.value, m = V(g, this.props.textField), v = !this.validityStyles || this.validity.valid, b = this.base, w = b.vs, S = h <= Se && r;
989
+ w.enabled = a !== void 0, a !== void 0 && (b.vs.skip = a.skip, b.vs.total = a.total, b.vs.pageSize = a.pageSize);
990
+ const {
991
+ dataItemKey: D,
992
+ data: N = [],
993
+ disabled: O,
994
+ tabIndex: _,
995
+ loading: C,
996
+ iconClassName: F,
997
+ valueRender: x
998
+ } = this.props, { focused: E } = this.state, M = N.findIndex((Y) => R(Y, g, D)), K = /* @__PURE__ */ o.createElement("span", { id: this._inputId, className: "k-input-inner" }, /* @__PURE__ */ o.createElement("span", { className: "k-input-value-text" }, m)), U = x !== void 0 ? x.call(void 0, K, g) : K, j = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
999
+ "span",
1000
+ {
1001
+ ref: this.componentRef,
1002
+ className: B(
1003
+ "k-dropdownlist k-picker",
1004
+ e,
1005
+ {
1006
+ [`k-picker-${Vt[p] || p}`]: p,
1007
+ [`k-rounded-${Js[c] || c}`]: c,
1008
+ [`k-picker-${d}`]: d,
1009
+ "k-focus": E,
1010
+ "k-disabled": O,
1011
+ "k-invalid": !v,
1012
+ "k-loading": C,
1013
+ "k-required": this.required
1014
+ }
1015
+ ),
1016
+ style: s ? { ...t, width: void 0 } : t,
1017
+ dir: n,
1018
+ onMouseDown: u ? (Y) => {
1019
+ Y.target.nodeName !== "INPUT" && (this.focusElement(this.base.wrapper), Y.preventDefault());
1020
+ } : void 0,
1021
+ onFocus: this.handleFocus,
1022
+ onBlur: this.handleBlur,
1023
+ tabIndex: $t(_, O),
1024
+ accessKey: this.props.accessKey,
1025
+ onKeyDown: this.handleKeyDown,
1026
+ onKeyPress: this.handleKeyPress,
1027
+ onClick: O ? void 0 : this.handleWrapperClick,
1028
+ role: "combobox",
1029
+ "aria-required": this.required,
1030
+ "aria-disabled": O || void 0,
1031
+ "aria-haspopup": "listbox",
1032
+ "aria-expanded": u || !1,
1033
+ "aria-owns": this.base.listBoxId,
1034
+ "aria-activedescendant": u ? "option-" + this.base.guid + "-" + (M + (a ? a.skip : 0)) : void 0,
1035
+ "aria-label": this.props.ariaLabel || this.props.label,
1036
+ "aria-labelledby": this.props.ariaLabelledBy,
1037
+ "aria-describedby": this.props.ariaDescribedBy || this._inputId,
1038
+ id: this.props.id,
1039
+ title: this.props.title
1040
+ },
1041
+ U,
1042
+ C && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
1043
+ /* @__PURE__ */ o.createElement(
1044
+ Te,
1045
+ {
1046
+ tabIndex: -1,
1047
+ type: "button",
1048
+ "aria-label": i,
1049
+ "aria-hidden": !0,
1050
+ size: p,
1051
+ fillMode: d,
1052
+ iconClass: F,
1053
+ className: "k-input-button",
1054
+ rounded: null,
1055
+ themeColor: "base",
1056
+ icon: F ? void 0 : "caret-alt-down",
1057
+ svgIcon: F ? this.props.svgIcon : Ut,
1058
+ onMouseDown: (Y) => this.state.focused && Y.preventDefault()
1059
+ }
1060
+ ),
1061
+ this.dummySelect(g),
1062
+ !S && this.renderListContainer()
1063
+ ), S && this.renderAdaptiveListContainer());
1064
+ return s ? /* @__PURE__ */ o.createElement(
1065
+ Ge,
1066
+ {
1067
+ label: s,
1068
+ editorValue: m,
1069
+ editorValid: v,
1070
+ editorDisabled: this.props.disabled,
1071
+ style: { width: t ? t.width : void 0 },
1072
+ children: j
1073
+ }
1074
+ ) : j;
1075
+ }
1076
+ /**
1077
+ * @hidden
1078
+ */
1079
+ onNavigate(i, t, e) {
1080
+ const {
1081
+ data: s = [],
1082
+ defaultItem: n,
1083
+ dataItemKey: a,
1084
+ virtual: p = { skip: 0, total: 0, pageSize: 0 }
1085
+ } = this.props, c = this.base.vs, d = this.value, r = s.findIndex((u) => R(u, d, a)), h = this.base.navigation.navigate({
1086
+ current: p.skip + r,
1087
+ max: (c.enabled ? p.total : s.length) - 1,
1088
+ min: n !== void 0 ? -1 : 0,
1089
+ keyCode: t,
1090
+ skipItems: e || void 0
1091
+ });
1092
+ h !== void 0 && this.handleItemSelect(h, i), this.applyState(i);
1093
+ }
1094
+ renderAdaptiveListContainer() {
1095
+ const { windowWidth: i = 0 } = this.state, { header: t, footer: e, size: s, adaptiveTitle: n, groupField: a, groupStickyHeaderItemRender: p, list: c, data: d = [] } = this.props, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = {
1096
+ navigatable: !1,
1097
+ navigatableElements: [],
1098
+ expand: r,
1099
+ animation: !0,
1100
+ onClose: (g) => this.handleWrapperClick(g),
1101
+ animationStyles: i <= St ? { top: 0, width: "100%", height: "100%" } : void 0,
1102
+ className: i <= St ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
1103
+ };
1104
+ let { group: u } = this.state;
1105
+ return u === void 0 && a !== void 0 && (u = V(d[0], a)), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Yt, { ...h }, /* @__PURE__ */ o.createElement(Jt, { className: "k-text-center" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ o.createElement("div", null, n)), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ o.createElement(
1106
+ Te,
1107
+ {
1108
+ tabIndex: 0,
1109
+ "aria-label": "Cancel",
1110
+ "aria-disabled": "false",
1111
+ type: "button",
1112
+ fillMode: "flat",
1113
+ onClick: this.handleWrapperClick,
1114
+ icon: "x",
1115
+ svgIcon: at
1116
+ }
1117
+ ))), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, this.renderListFilter())), /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, t && /* @__PURE__ */ o.createElement("div", { className: "k-list-header" }, t), /* @__PURE__ */ o.createElement(
1118
+ "div",
1119
+ {
1120
+ className: B(
1121
+ "k-list",
1122
+ {
1123
+ [`k-list-${Vt[s] || s}`]: s,
1124
+ "k-virtual-list": this.base.vs.enabled
1125
+ }
1126
+ )
1127
+ },
1128
+ this.renderDefaultItem(),
1129
+ !c && u && d.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: u, groupMode: "modern", render: p }),
1130
+ this.renderList()
1131
+ ), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e))));
1132
+ }
1133
+ getFocusedIndex() {
1134
+ const i = this.value, {
1135
+ data: t = [],
1136
+ textField: e,
1137
+ dataItemKey: s,
1138
+ virtual: n = { skip: 0 },
1139
+ focusedItemIndex: a = Ve,
1140
+ filterable: p,
1141
+ skipDisabledItems: c = !0
1142
+ } = this.props, d = this.props.filter ? this.props.filter : this.state.text;
1143
+ return c && e && !d && !i ? t.findIndex((r) => !r.disabled && r[e]) : G(i) && d === void 0 || p && d === "" ? t.findIndex((r) => R(r, i, s)) : d ? this._lastKeypressIsFilter ? a(t, d, e) : t.findIndex((r) => R(r, i, s)) : n.skip === 0 ? 0 : -1;
1144
+ }
1145
+ focusElement(i) {
1146
+ this._skipFocusEvent = !0, i.focus(), window.setTimeout(() => this._skipFocusEvent = !1, 30);
1147
+ }
1148
+ triggerOnChange(i, t) {
1149
+ R(this.value, i, this.props.dataItemKey) || (this.props.value === void 0 && (t.data.value = i), this._valueDuringOnChange = i, t.events.push({ type: "onChange" }));
1150
+ }
1151
+ applyState(i) {
1152
+ this.base.applyState(i), this._valueDuringOnChange = void 0;
1153
+ }
1154
+ calculateMedia(i) {
1155
+ for (let t of i)
1156
+ this.setState({ windowWidth: t.target.clientWidth });
1157
+ }
1158
+ resetValueIfDisabledItem() {
1159
+ const { data: i = [] } = this.props, t = this.base.initState(), e = this.getFocusedIndex();
1160
+ this.haveFocusedItemAndDataNotEmpty(i, e) && (this.triggerOnChange(null, t), this.applyState(t));
1161
+ }
1162
+ haveFocusedItemAndDataNotEmpty(i, t) {
1163
+ return t !== void 0 && t !== -1 && i && i.length > 0 && i[t].disabled;
1164
+ }
1165
+ };
1166
+ let Dt = At;
1167
+ Dt.displayName = "DropDownList";
1168
+ Dt.propTypes = {
1169
+ delay: l.number,
1170
+ ignoreCase: l.bool,
1171
+ iconClassName: l.string,
1172
+ svgIcon: gs,
1173
+ defaultItem: l.any,
1174
+ valueRender: l.func,
1175
+ valueMap: l.func,
1176
+ validationMessage: l.string,
1177
+ required: l.bool,
1178
+ id: l.string,
1179
+ ariaLabelledBy: l.string,
1180
+ ariaDescribedBy: l.string,
1181
+ ariaLabel: l.string,
1182
+ leftRightKeysNavigation: l.bool,
1183
+ title: l.string,
1184
+ groupField: l.string,
1185
+ list: l.any,
1186
+ skipDisabledItems: l.bool,
1187
+ ...ie.propTypes
1188
+ };
1189
+ Dt.defaultProps = {
1190
+ delay: 500,
1191
+ tabIndex: 0,
1192
+ ignoreCase: !0,
1193
+ ...ie.defaultProps,
1194
+ required: !1,
1195
+ size: "medium",
1196
+ rounded: "medium",
1197
+ fillMode: "solid",
1198
+ groupMode: "modern"
1199
+ };
1200
+ const Qs = Ke(), Xs = wt(
1201
+ Qs,
1202
+ Dt
1203
+ );
1204
+ Xs.displayName = "KendoReactDropDownList";
1205
+ class Zt extends o.Component {
1206
+ constructor() {
1207
+ super(...arguments), this._input = null;
1208
+ }
1209
+ /**
1210
+ * @hidden
1211
+ */
1212
+ get input() {
1213
+ return this._input;
1214
+ }
1215
+ componentDidUpdate(t) {
1216
+ const e = t.value, s = t.suggestedText, { value: n, suggestedText: a, focused: p } = this.props, c = this.input, d = e !== n || a !== s, r = d && e.startsWith(n) && !(s && a && s.endsWith(a)), h = Ss(document);
1217
+ p && c && h !== c && c.focus(), a && d && !r && c && c.setSelectionRange(n.length - a.length, n.length);
1218
+ }
1219
+ render() {
1220
+ const { expanded: t = !1, disabled: e, role: s = "listbox", render: n } = this.props, a = /* @__PURE__ */ o.createElement(
1221
+ "input",
1222
+ {
1223
+ autoComplete: "off",
1224
+ id: this.props.id,
1225
+ type: "text",
1226
+ key: "searchbar",
1227
+ size: this.props.size,
1228
+ placeholder: this.props.placeholder,
1229
+ className: "k-input-inner",
1230
+ tabIndex: this.props.tabIndex,
1231
+ accessKey: this.props.accessKey,
1232
+ role: s,
1233
+ name: this.props.name,
1234
+ value: this.props.value,
1235
+ onChange: this.props.onChange,
1236
+ ref: (p) => this._input = p,
1237
+ onKeyDown: this.props.onKeyDown,
1238
+ onFocus: this.props.onFocus,
1239
+ onBlur: this.props.onBlur,
1240
+ onClick: this.props.onClick,
1241
+ "aria-disabled": e || void 0,
1242
+ disabled: e || void 0,
1243
+ readOnly: this.props.readOnly || void 0,
1244
+ title: this.props.title,
1245
+ "aria-haspopup": "listbox",
1246
+ "aria-expanded": t,
1247
+ "aria-owns": this.props.owns,
1248
+ "aria-activedescendant": t ? this.props.activedescendant : void 0,
1249
+ "aria-describedby": this.props.ariaDescribedBy,
1250
+ "aria-labelledby": this.props.ariaLabelledBy,
1251
+ "aria-required": this.props.ariaRequired
1252
+ }
1253
+ );
1254
+ return n ? n.call(void 0, a) : a;
1255
+ }
1256
+ }
1257
+ class rt extends o.Component {
1258
+ constructor() {
1259
+ super(...arguments), this.onMouseDown = (t) => t.preventDefault();
1260
+ }
1261
+ render() {
1262
+ const t = Ae(this).toLanguageString(it, le[it]);
1263
+ return /* @__PURE__ */ o.createElement(
1264
+ "span",
1265
+ {
1266
+ className: "k-clear-value",
1267
+ role: "button",
1268
+ onClick: this.props.onClick,
1269
+ onMouseDown: this.onMouseDown,
1270
+ tabIndex: -1,
1271
+ title: t,
1272
+ key: "clearbutton"
1273
+ },
1274
+ /* @__PURE__ */ o.createElement(ke, { name: "x", icon: at })
1275
+ );
1276
+ }
1277
+ }
1278
+ ms(rt);
1279
+ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e, It = class extends o.Component {
1280
+ constructor(i) {
1281
+ super(i), this.state = {}, this.base = new ie(this), this._element = null, this._inputId = Fe(), this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this.itemHeight = 0, this.focus = () => {
1282
+ this._input && this._input.focus();
1283
+ }, this.handleItemSelect = (t, e) => {
1284
+ const { data: s = [], virtual: n, dataItemKey: a } = this.props, p = n ? n.skip : 0, c = s[t - p], d = !R(c, this.value, a);
1285
+ this.triggerOnChange(c, e), this.state.text !== void 0 && (e.data.text = void 0), d && this.base.triggerPageChangeCornerItems(c, e);
1286
+ }, this.onPopupOpened = () => {
1287
+ setTimeout(() => {
1288
+ this.mobileMode && this._adaptiveFilterInput && (this._skipBlur = !0, this._adaptiveFilterInput.focus(), this._skipBlur = !1);
1289
+ }, 300);
1290
+ }, this.componentRef = (t) => {
1291
+ this._element = t, this.base.wrapper = t;
1292
+ }, this.toggleBtnClick = (t) => {
1293
+ const { data: e = [], skipDisabledItems: s, textField: n } = this.props, a = this.getFocusedIndex(), p = this.getCurrentValueDisabledStatus(n, e, a), c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = this.base.initState();
1294
+ if (d.syntheticEvent = t, !s && n && p && this.clearValueOnToggleBtnClick(t), this.base.togglePopup(d), !c && this.mobileMode) {
1295
+ const r = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
1296
+ this.base.filterChanged(r, d);
1297
+ }
1298
+ this.applyState(d);
1299
+ }, this.renderMobileListFilter = () => {
1300
+ const t = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, e = V(this.value, this.props.textField), s = G(t) ? t : e;
1301
+ return /* @__PURE__ */ o.createElement(
1302
+ Be,
1303
+ {
1304
+ value: s,
1305
+ ref: (n) => this._adaptiveFilterInput = n && n.element,
1306
+ onChange: this.handleMobileFilterChange,
1307
+ onKeyDown: this.onInputKeyDown,
1308
+ size: this.props.size,
1309
+ rounded: this.props.rounded,
1310
+ fillMode: this.props.fillMode
1311
+ }
1312
+ );
1313
+ }, this.handleMobileFilterChange = (t) => {
1314
+ const e = this.base.initState();
1315
+ e.syntheticEvent = t.syntheticEvent, e.data.text = t.target.value, this.base.filterChanged(t.target.value, e), this.applyState(e);
1316
+ }, this.onScroll = (t) => {
1317
+ const { vs: e, list: s } = this.base;
1318
+ e.scrollHandler(t);
1319
+ const { groupField: n } = this.props;
1320
+ let { data: a = [] } = this.props;
1321
+ if (!n || !a.length)
1322
+ return;
1323
+ const p = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : s ? s.children[0].offsetHeight : 0), d = t.target.scrollTop - e.skip * p;
1324
+ this.props.groupMode === "modern" && (a = this.base.getGroupedDataModernMode(a, n));
1325
+ let r = a[0][n];
1326
+ for (let h = 1; h < a.length && !(p * h > d); h++)
1327
+ a[h] && a[h][n] && (r = a[h][n]);
1328
+ r !== this.state.group && (this.setState({
1329
+ group: r
1330
+ }), this.props.onGroupScroll && this.props.onGroupScroll.call(void 0, { group: r }));
1331
+ }, this.handleItemClick = (t, e) => {
1332
+ this.base.handleItemClick(t, e), this._valueDuringOnChange = void 0;
1333
+ }, this.handleBlur = (t) => {
1334
+ if (this.state.focused && !this._skipBlur) {
1335
+ const e = this.base.initState(), { textField: s, data: n = [] } = this.props, a = this.getFocusedIndex(), c = !(a === -1) && this.getCurrentValueDisabledStatus(s, n, a);
1336
+ e.data.focused = !1, e.events.push({ type: "onBlur" }), e.syntheticEvent = t, s && c && this.clearValueOnBlur(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, e);
1337
+ }
1338
+ }, this.onInputClick = (t) => {
1339
+ const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, s = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
1340
+ if (!e && this.mobileMode) {
1341
+ const n = this.base.initState();
1342
+ n.syntheticEvent = t, this.base.togglePopup(n), this.base.filterChanged(s, n), this.applyState(n);
1343
+ }
1344
+ }, this.onInputKeyDown = (t) => {
1345
+ const { data: e = [], skipDisabledItems: s, textField: n, dataItemKey: a, groupField: p } = this.props, c = this.value, d = Math.max(0, e.findIndex((w) => R(w, c, a))), r = t.keyCode, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = this.base.initState();
1346
+ if (u.syntheticEvent = t, !t.altKey && (r === f.up || r === f.down)) {
1347
+ if (t.preventDefault(), p !== "" && n)
1348
+ if (!this.props.skipDisabledItems && h)
1349
+ this.onNavigate(u, r);
1350
+ else {
1351
+ let w = 0;
1352
+ if (r === f.down || r === f.right) {
1353
+ const S = e.slice(d + 1).find((D) => !D.disabled && D[n]);
1354
+ w = S && e.findIndex((D) => D[n] === S[n]);
1355
+ } else if (r === f.up || r === f.left) {
1356
+ let S;
1357
+ if (d === 0)
1358
+ S = e, w = e.findIndex((D) => !D.disabled && D[n]);
1359
+ else {
1360
+ S = e.slice(0, d);
1361
+ let D = S.pop();
1362
+ for (; D && D.disabled; )
1363
+ D = S.pop();
1364
+ w = D && e.findIndex((N) => N[n] === D[n]);
1365
+ }
1366
+ }
1367
+ if (w !== void 0) {
1368
+ const S = w - d;
1369
+ this.onNavigate(u, r, S);
1370
+ } else
1371
+ w === void 0 && e.findIndex((S) => S[n] === c[n]) === e.length - 1 && this.onNavigate(u, r);
1372
+ }
1373
+ else if (!this.props.skipDisabledItems && h)
1374
+ this.onNavigate(u, r);
1375
+ else {
1376
+ let w = null;
1377
+ if (r === f.down || r === f.right)
1378
+ w = e.slice(d + 1).find((S) => !S.disabled);
1379
+ else if (r === f.up || r === f.left) {
1380
+ const S = e.slice(0, d);
1381
+ for (w = S.pop(); w && w.disabled; )
1382
+ w = S.pop();
1383
+ }
1384
+ if (w) {
1385
+ const S = w.id - d - 1;
1386
+ this.onNavigate(u, r, S);
1387
+ } else
1388
+ this.onNavigate(u, r);
1389
+ }
1390
+ this.applyState(u);
1391
+ }
1392
+ const g = () => {
1393
+ t.preventDefault(), this.base.togglePopup(u), this.applyState(u);
1394
+ }, m = this.getFocusedIndex(), v = m === -1, b = !v && this.getCurrentValueDisabledStatus(n, e, m);
1395
+ h ? r === f.pageUp ? this.base.scrollPopupByPageSize(-1) : r === f.pageDown ? this.base.scrollPopupByPageSize(1) : t.altKey && r === f.up ? g() : r === f.enter ? (t.preventDefault(), (n && !v && t.currentTarget.value ? e[m][n] : void 0) ? !s && n && b ? this.clearValueOnEnterOrEsc(t) : b || this.applyValueOnEnter(t.currentTarget.value, u) : this.applyValueOnEnter(t.currentTarget.value, u)) : r === f.esc && (!s && n && b && this.clearValueOnEnterOrEsc(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, u)) : !h && r === f.esc ? this.clearValueOnEnterOrEsc(t) : t.altKey && r === f.down && g();
1396
+ }, this.inputOnChange = (t) => {
1397
+ const e = this.base.initState();
1398
+ e.syntheticEvent = t;
1399
+ const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, n = t.currentTarget, a = n.value;
1400
+ if (this.props.suggest) {
1401
+ const p = n.selectionEnd === a.length;
1402
+ let c = this.props.filter !== void 0 ? this.props.filter : this.state.text;
1403
+ G(c) || (c = V(this.value, this.props.textField) || "");
1404
+ const d = c && c === a, r = c && c.length > a.length;
1405
+ d || r || !p ? this._suggested = "" : this.suggestValue(a);
1406
+ }
1407
+ this.props.filter === void 0 && (e.data.text = a), this.state.focusedItem !== void 0 && (e.data.focusedItem = void 0), s || this.base.togglePopup(e), this.base.filterChanged(a, e), this.applyState(e), this.setState({ group: void 0 });
1408
+ }, this.clearButtonClick = (t) => {
1409
+ const e = this.base.initState();
1410
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
1411
+ }, this.clearValueOnEnterOrEsc = (t) => {
1412
+ const e = this.base.initState();
1413
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
1414
+ }, this.clearValueOnBlur = (t) => {
1415
+ const e = this.base.initState();
1416
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
1417
+ }, this.clearValueOnToggleBtnClick = (t) => {
1418
+ const e = this.base.initState();
1419
+ e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
1420
+ }, this.setValidity = () => {
1421
+ this._input && this._input.setCustomValidity && this._input.setCustomValidity(
1422
+ this.validity.valid ? "" : this.props.validationMessage || Zs
1423
+ );
1424
+ }, qe(je);
1425
+ }
1426
+ get document() {
1427
+ if (Me)
1428
+ return this.element && this.element.ownerDocument || document;
1429
+ }
1430
+ /** @hidden */
1431
+ get element() {
1432
+ return this._element;
1433
+ }
1434
+ /**
1435
+ * The mobile mode of the ComboBox.
1436
+ */
1437
+ get mobileMode() {
1438
+ return !!(this.state.windowWidth && this.state.windowWidth <= Se && this.props.adaptive);
1439
+ }
1440
+ /**
1441
+ * The value of the ComboBox.
1442
+ */
1443
+ get value() {
1444
+ if (this._valueDuringOnChange !== void 0)
1445
+ return this._valueDuringOnChange;
1446
+ if (this.props.value !== void 0)
1447
+ return this.props.value;
1448
+ if (this.state.value !== void 0)
1449
+ return this.state.value;
1450
+ if (this.props.defaultValue !== void 0)
1451
+ return this.props.defaultValue;
1452
+ }
1453
+ /**
1454
+ * The index of the selected item.
1455
+ */
1456
+ get index() {
1457
+ const { data: i = [], dataItemKey: t } = this.props, e = this.value;
1458
+ return i.findIndex((s) => R(s, e, t));
1459
+ }
1460
+ /**
1461
+ * Gets the `name` property of the ComboBox.
1462
+ */
1463
+ get name() {
1464
+ return this.props.name;
1465
+ }
1466
+ /**
1467
+ * Represents the validity state into which the component is set.
1468
+ */
1469
+ get validity() {
1470
+ const i = 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;
1471
+ return {
1472
+ customError: i,
1473
+ valid: e,
1474
+ valueMissing: this.value === null
1475
+ };
1476
+ }
1477
+ get validityStyles() {
1478
+ return this.props.validityStyles !== void 0 ? this.props.validityStyles : It.defaultProps.validityStyles;
1479
+ }
1480
+ /** @hidden */
1481
+ get required() {
1482
+ return this.props.required !== void 0 ? this.props.required : It.defaultProps.required;
1483
+ }
1484
+ /** @hidden */
1485
+ componentDidUpdate(i, t) {
1486
+ var g;
1487
+ const { dataItemKey: e, virtual: s, groupField: n = "", data: a = [], textField: p } = this.props, c = i.virtual ? i.virtual.total : 0, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = i.opened !== void 0 ? i.opened : t.opened, h = !r && d, u = this.value;
1488
+ if (this._valueOnDidUpdate = u, s && s.total !== c)
1489
+ this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
1490
+ else {
1491
+ const m = i.value !== void 0 ? i.value : t.value;
1492
+ let v = a.findIndex((w) => R(w, u, e));
1493
+ this.props.groupMode === "modern" && p && u && (v = (g = this.base.getGroupedDataModernMode(a, n)) == null ? void 0 : g.map((w) => w[p]).indexOf(u[p]));
1494
+ const b = !R(m, u, e);
1495
+ h && s ? this.base.scrollToVirtualItem(s, v) : h && !s ? (this.onPopupOpened(), a && a.length !== 0 && this.base.resetGroupStickyHeader(a[0][n], this), this.base.scrollToItem(v)) : d && r && u && b && this.base.scrollToItem(v);
1496
+ }
1497
+ h && this._input && this._input.focus(), this.setValidity();
1498
+ }
1499
+ /** @hidden */
1500
+ componentDidMount() {
1501
+ var i;
1502
+ this.observerResize = Me && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (i = this.document) != null && i.body && this.observerResize && this.observerResize.observe(this.document.body);
1503
+ }
1504
+ /** @hidden */
1505
+ componentWillUnmount() {
1506
+ var i;
1507
+ (i = this.document) != null && i.body && this.observerResize && this.observerResize.disconnect();
1508
+ }
1509
+ /** @hidden */
1510
+ render() {
1511
+ const i = Ae(this).toLanguageString(Lt, le[Lt]), t = Ae(this).toLanguageString(
1512
+ zt,
1513
+ le[zt]
1514
+ ), {
1515
+ dir: e,
1516
+ disabled: s,
1517
+ clearButton: n = It.defaultProps.clearButton,
1518
+ label: a,
1519
+ textField: p,
1520
+ adaptive: c,
1521
+ className: d,
1522
+ style: r,
1523
+ loading: h,
1524
+ iconClassName: u,
1525
+ virtual: g,
1526
+ size: m,
1527
+ rounded: v,
1528
+ fillMode: b,
1529
+ opened: w = this.state.opened,
1530
+ placeholder: S
1531
+ } = this.props, { windowWidth: D = 0 } = this.state, N = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, _ = V(this.value, p), C = G(O) ? O : _, F = n && (!!C || G(this.value)), E = this.base.vs, M = this.props.id || this._inputId, K = D <= Se && c;
1532
+ E.enabled = g !== void 0, g !== void 0 && (E.skip = g.skip, E.total = g.total, E.pageSize = g.pageSize);
1533
+ const U = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1534
+ "span",
1535
+ {
1536
+ className: B(
1537
+ "k-combobox k-input",
1538
+ {
1539
+ [`k-input-${bt[m] || m}`]: m,
1540
+ [`k-rounded-${ei[v] || v}`]: v,
1541
+ [`k-input-${b}`]: b,
1542
+ "k-invalid": !N,
1543
+ "k-loading": h,
1544
+ "k-required": this.required,
1545
+ "k-disabled": s
1546
+ },
1547
+ d
1548
+ ),
1549
+ ref: this.componentRef,
1550
+ style: a ? { ...r, width: void 0 } : r,
1551
+ dir: e
1552
+ },
1553
+ this.renderSearchBar(C || "", M, S),
1554
+ F && !h && /* @__PURE__ */ o.createElement(rt, { onClick: this.clearButtonClick, key: "clearbutton" }),
1555
+ h && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading", key: "loading" }),
1556
+ /* @__PURE__ */ o.createElement(
1557
+ Te,
1558
+ {
1559
+ tabIndex: -1,
1560
+ type: "button",
1561
+ "aria-label": w ? t : i,
1562
+ icon: u ? void 0 : "caret-alt-down",
1563
+ svgIcon: u ? this.props.svgIcon : Ut,
1564
+ iconClass: u,
1565
+ size: m,
1566
+ fillMode: b,
1567
+ rounded: null,
1568
+ themeColor: "base",
1569
+ className: "k-input-button",
1570
+ onClick: this.toggleBtnClick,
1571
+ onMouseDown: (j) => j.preventDefault()
1572
+ }
1573
+ ),
1574
+ !K && this.renderListContainer()
1575
+ ), K && this.renderAdaptiveListContainer());
1576
+ return a ? /* @__PURE__ */ o.createElement(
1577
+ Ge,
1578
+ {
1579
+ label: a,
1580
+ editorId: M,
1581
+ editorValue: C,
1582
+ editorValid: N,
1583
+ editorDisabled: s,
1584
+ style: { width: r ? r.width : void 0 },
1585
+ children: U
1586
+ }
1587
+ ) : U;
1588
+ }
1589
+ /** @hidden */
1590
+ onNavigate(i, t, e) {
1591
+ const { data: s = [], virtual: n = { skip: 0 } } = this.props, a = this.props.filter ? this.props.filter : this.state.text, p = this.getFocusedIndex(), c = this.base.vs, d = this.value;
1592
+ if (this._suggested = "", p !== -1 && !G(d))
1593
+ this.handleItemSelect(p, i);
1594
+ else if (a === "")
1595
+ this.handleItemSelect(0, i);
1596
+ else {
1597
+ let r = n.skip + p;
1598
+ const h = this.base.navigation.navigate({
1599
+ keyCode: t,
1600
+ current: r,
1601
+ max: (c.enabled ? c.total : s.length) - 1,
1602
+ min: 0,
1603
+ skipItems: e || void 0
1604
+ });
1605
+ h !== void 0 && this.handleItemSelect(h, i);
1606
+ }
1607
+ }
1608
+ getCurrentValueDisabledStatus(i, t, e) {
1609
+ return i && t && t[e] && t[e].disabled;
1610
+ }
1611
+ applyValueOnEnter(i, t) {
1612
+ const { data: e = [], textField: s, allowCustom: n } = this.props, a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, c = V(this.value, s) === i ? this.index : Kt(e, i, s), d = c !== -1;
1613
+ let r;
1614
+ if (this._suggested = "", d)
1615
+ r = e[c];
1616
+ else if (n)
1617
+ r = s !== void 0 ? { [s]: i } : i;
1618
+ else
1619
+ return this.selectFocusedItem(i, t);
1620
+ this.triggerOnChange(r, t), a && this.base.togglePopup(t), this.props.filter === void 0 && this.state.text !== void 0 && (t.data.text = void 0), this.applyState(t);
1621
+ }
1622
+ applyValueOnRejectSuggestions(i, t) {
1623
+ const { data: e = [], textField: s, allowCustom: n } = this.props, a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = V(this.value, s), c = this.state.windowWidth && this.state.windowWidth <= Se;
1624
+ if (this._suggested = "", i === p || i === "" && !G(p))
1625
+ return a && !c && this.base.togglePopup(t), this.applyState(t);
1626
+ const d = Kt(e, i, s, !0), r = d !== -1;
1627
+ let h = null;
1628
+ r ? h = e[d] : n && (h = i ? s ? { [s]: i } : i : null), this.triggerOnChange(h, t), this.state.text !== void 0 && (t.data.text = void 0, this.base.filterChanged("", t)), a && !c && this.base.togglePopup(t), this.applyState(t);
1629
+ }
1630
+ selectFocusedItem(i, t) {
1631
+ const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: s = [], textField: n, virtual: a = { skip: 0 }, focusedItemIndex: p = Ve } = this.props, c = a.skip, d = i === "" && c === 0 ? 0 : p(s, i, n);
1632
+ return d !== -1 ? this.handleItemSelect(d + c, t) : (this.triggerOnChange(null, t), this.state.text !== void 0 && (t.data.text = void 0)), e && this.base.togglePopup(t), this.applyState(t);
1633
+ }
1634
+ renderAdaptiveListContainer() {
1635
+ const { windowWidth: i = 0 } = this.state, { header: t, footer: e, size: s, data: n = [], groupField: a, groupMode: p, list: c, virtual: d, adaptiveTitle: r, groupStickyHeaderItemRender: h } = this.props, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
1636
+ let { group: g } = this.state;
1637
+ g === void 0 && a !== void 0 && (g = V(n[0], a));
1638
+ const m = {
1639
+ navigatable: !1,
1640
+ navigatableElements: [],
1641
+ expand: u,
1642
+ animation: !0,
1643
+ onClose: (v) => this.toggleBtnClick(v),
1644
+ animationStyles: i <= St ? { top: 0, width: "100%", height: "100%" } : void 0,
1645
+ className: i <= St ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
1646
+ };
1647
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Yt, { ...m }, /* @__PURE__ */ o.createElement(Jt, { className: "k-text-center" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ o.createElement("div", null, r)), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ o.createElement(
1648
+ Te,
1649
+ {
1650
+ tabIndex: 0,
1651
+ "aria-label": "Cancel",
1652
+ "aria-disabled": "false",
1653
+ type: "button",
1654
+ fillMode: "flat",
1655
+ onClick: this.toggleBtnClick,
1656
+ icon: "x",
1657
+ svgIcon: at
1658
+ }
1659
+ ))), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, this.renderMobileListFilter())), /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ o.createElement("div", { className: B(
1660
+ {
1661
+ ["k-list"]: !c,
1662
+ ["k-list-lg"]: !0,
1663
+ ["k-virtual-list"]: d,
1664
+ ["k-data-table"]: c,
1665
+ [`k-table-${bt[s] || s}`]: c && s
1666
+ }
1667
+ ) }, t && /* @__PURE__ */ o.createElement("div", { className: "k-table-header" }, t), !c && g && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: g, groupMode: p, render: h }), this.renderList(), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e))))));
1668
+ }
1669
+ renderListContainer() {
1670
+ const i = this.base, { dir: t, header: e, footer: s, data: n = [], groupField: a, groupMode: p, size: c, list: d, virtual: r, groupStickyHeaderItemRender: h } = this.props, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = i.getPopupSettings(), m = g.width !== void 0 ? g.width : i.popupWidth;
1671
+ let { group: v } = this.state;
1672
+ return v === void 0 && a !== void 0 && (v = V(n[0], a)), /* @__PURE__ */ o.createElement(
1673
+ Et,
1674
+ {
1675
+ width: m,
1676
+ popupSettings: {
1677
+ animate: g.animate,
1678
+ anchor: this.element,
1679
+ show: u,
1680
+ popupClass: B(
1681
+ g.popupClass,
1682
+ "k-list-container",
1683
+ "k-combobox-popup"
1684
+ ),
1685
+ className: g.className,
1686
+ appendTo: g.appendTo
1687
+ },
1688
+ dir: t !== void 0 ? t : this.base.dirCalculated,
1689
+ itemsCount: [n.length]
1690
+ },
1691
+ /* @__PURE__ */ o.createElement("div", { className: B(
1692
+ {
1693
+ ["k-list"]: !d,
1694
+ [`k-list-${bt[c] || c}`]: !d && c,
1695
+ ["k-virtual-list"]: r,
1696
+ ["k-data-table"]: d,
1697
+ [`k-table-${bt[c] || c}`]: d && c
1698
+ }
1699
+ ) }, e && /* @__PURE__ */ o.createElement("div", { className: "k-table-header" }, e), !d && v && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: v, groupMode: p, render: h }), this.renderList(), s && /* @__PURE__ */ o.createElement("div", { className: B(
1700
+ {
1701
+ ["k-list-footer"]: !this.props.footerClassName
1702
+ },
1703
+ this.props.footerClassName
1704
+ ) }, s))
1705
+ );
1706
+ }
1707
+ renderList() {
1708
+ const i = this.base, {
1709
+ textField: t,
1710
+ dataItemKey: e,
1711
+ listNoDataRender: s,
1712
+ itemRender: n,
1713
+ groupHeaderItemRender: a,
1714
+ data: p = [],
1715
+ virtual: c = { skip: 0, total: void 0 }
1716
+ } = this.props, d = i.getPopupSettings(), r = i.vs, h = c.skip, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = `translateY(${r.translate}px)`, m = u ? this.getFocusedIndex() : void 0, v = this.props.filter !== void 0 ? this.props.filter : this.state.text, b = V(this.value, t), w = G(v) && v !== b ? null : this.value, S = this.props.list || Ue;
1717
+ return /* @__PURE__ */ o.createElement(
1718
+ S,
1719
+ {
1720
+ id: i.listBoxId,
1721
+ virtual: !!c,
1722
+ show: u,
1723
+ data: p,
1724
+ focusedIndex: m,
1725
+ value: w,
1726
+ textField: t,
1727
+ valueField: e,
1728
+ groupField: this.props.groupField,
1729
+ groupMode: this.props.groupMode,
1730
+ isMultiColumn: this.props.isMultiColumn,
1731
+ optionsGuid: i.guid,
1732
+ listRef: (D) => {
1733
+ r.list = this.base.list = D, this.itemHeight = 0;
1734
+ },
1735
+ wrapperStyle: this.state.windowWidth && this.state.windowWidth > Se ? { maxHeight: d.height } : {},
1736
+ wrapperCssClass: B(
1737
+ "k-list-content",
1738
+ {
1739
+ ["k-list-scroller"]: !c
1740
+ }
1741
+ ),
1742
+ listStyle: r.enabled ? { transform: g } : void 0,
1743
+ key: "listkey",
1744
+ skip: h,
1745
+ onClick: this.handleItemClick,
1746
+ itemRender: n,
1747
+ groupHeaderItemRender: a,
1748
+ noDataRender: s,
1749
+ onMouseDown: (D) => D.preventDefault(),
1750
+ onScroll: this.onScroll,
1751
+ wrapperRef: r.scrollerRef,
1752
+ scroller: this.base.renderScrollElement(),
1753
+ ariaSetSize: c.total
1754
+ }
1755
+ );
1756
+ }
1757
+ renderSearchBar(i, t, e) {
1758
+ const {
1759
+ tabIndex: s,
1760
+ disabled: n,
1761
+ data: a = [],
1762
+ dataItemKey: p,
1763
+ virtual: c = { skip: 0 }
1764
+ } = this.props, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = this.value, h = Math.max(0, a.findIndex((u) => R(u, r, p)));
1765
+ return this._suggested && !R(this._valueOnDidUpdate, r, p) && (this._suggested = ""), /* @__PURE__ */ o.createElement(
1766
+ Zt,
1767
+ {
1768
+ id: t,
1769
+ readOnly: d && this.mobileMode,
1770
+ placeholder: e,
1771
+ tabIndex: s,
1772
+ title: this.props.title,
1773
+ accessKey: this.props.accessKey,
1774
+ value: i + this._suggested,
1775
+ suggestedText: this._suggested,
1776
+ ref: (u) => this._input = u && u.input,
1777
+ onClick: this.onInputClick,
1778
+ onKeyDown: this.onInputKeyDown,
1779
+ onChange: this.inputOnChange,
1780
+ onFocus: this.base.handleFocus,
1781
+ onBlur: this.handleBlur,
1782
+ disabled: n,
1783
+ expanded: d,
1784
+ owns: this.base.listBoxId,
1785
+ activedescendant: `option-${this.base.guid}-${h + c.skip}`,
1786
+ role: "combobox",
1787
+ ariaLabelledBy: this.props.ariaLabelledBy,
1788
+ ariaDescribedBy: this.props.ariaDescribedBy,
1789
+ ariaRequired: this.required,
1790
+ render: this.props.valueRender
1791
+ }
1792
+ );
1793
+ }
1794
+ clearValue() {
1795
+ const i = this.base.initState();
1796
+ this._suggested = "", this.base.filterChanged("", i), this.props.filter === void 0 && this.state.text !== void 0 && (i.data.text = void 0), this.triggerOnChange(null, i);
1797
+ const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, e = this.mobileMode;
1798
+ t && !e && this.base.togglePopup(i), this.applyState(i);
1799
+ }
1800
+ triggerOnChange(i, t) {
1801
+ const e = this.value;
1802
+ !G(e) && !G(i) || R(e, i, this.props.dataItemKey) || (this.props.value === void 0 && (t.data.value = i), this._valueDuringOnChange = i, t.events.push({ type: "onChange" }));
1803
+ }
1804
+ getFocusedIndex() {
1805
+ const i = this.value, { data: t = [], textField: e, dataItemKey: s, virtual: n = { skip: 0 }, focusedItemIndex: a = Ve, skipDisabledItems: p } = this.props, c = this.props.filter ? this.props.filter : this.state.text;
1806
+ return G(i) && c === void 0 ? t.findIndex((d) => R(d, i, s)) : c ? a(t, c, e) : p && e && !c && n.skip === 0 ? t.findIndex((d) => !d.disabled && d[e]) : n.skip === 0 ? 0 : -1;
1807
+ }
1808
+ suggestValue(i) {
1809
+ const { data: t, textField: e } = this.props;
1810
+ this._suggested = zs(i, t, e);
1811
+ }
1812
+ applyState(i) {
1813
+ this.base.applyState(i), this._valueDuringOnChange = void 0;
1814
+ }
1815
+ calculateMedia(i) {
1816
+ for (let t of i)
1817
+ this.setState({ windowWidth: t.target.clientWidth });
1818
+ }
1819
+ };
1820
+ let dt = It;
1821
+ dt.displayName = "ComboBox";
1822
+ dt.propTypes = {
1823
+ ...ie.propTypes,
1824
+ size: l.oneOf([null, "small", "medium", "large"]),
1825
+ rounded: l.oneOf([null, "small", "medium", "large", "full"]),
1826
+ fillMode: l.oneOf([null, "solid", "flat", "outline"]),
1827
+ dataItemKey: l.string,
1828
+ groupField: l.string,
1829
+ groupMode: l.oneOf([void 0, "classic", "modern"]),
1830
+ isMultiColumn: l.bool,
1831
+ suggest: l.bool,
1832
+ placeholder: l.string,
1833
+ title: l.string,
1834
+ allowCustom: l.bool,
1835
+ clearButton: l.bool,
1836
+ iconClassName: l.string,
1837
+ svgIcon: gs,
1838
+ validationMessage: l.string,
1839
+ required: l.bool,
1840
+ id: l.string,
1841
+ ariaLabelledBy: l.string,
1842
+ ariaDescribedBy: l.string,
1843
+ list: l.any,
1844
+ valueRender: l.func,
1845
+ skipDisabledItems: l.bool
1846
+ };
1847
+ dt.defaultProps = {
1848
+ ...ie.defaultProps,
1849
+ size: "medium",
1850
+ rounded: "medium",
1851
+ fillMode: "solid",
1852
+ allowCustom: !1,
1853
+ clearButton: !0,
1854
+ required: !1,
1855
+ groupMode: "modern",
1856
+ isMultiColumn: !1,
1857
+ skipDisabledItems: !0
1858
+ };
1859
+ const ti = Ke(), bs = wt(ti, dt);
1860
+ bs.displayName = "KendoReactComboBox";
1861
+ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e, Wt = class extends o.Component {
1862
+ constructor(i) {
1863
+ super(i), this.state = {}, this.base = new ie(this), this._element = null, this._inputId = Fe(), this._suggested = "", this._input = null, this._isScrolling = !1, this.itemHeight = 0, this.focus = () => {
1864
+ this._input && this._input.focus();
1865
+ }, this.handleItemSelect = (t, e) => {
1866
+ const { data: s = [] } = this.props, n = V(s[t], this.props.textField);
1867
+ this.triggerOnChange(n, e);
1868
+ }, this.itemFocus = (t, e) => {
1869
+ const { data: s = [], textField: n } = this.props, a = s[t];
1870
+ R(this.state.focusedItem, a, n) || (e.data.focusedItem = a);
1871
+ }, this.togglePopup = (t) => {
1872
+ this.base.togglePopup(t);
1873
+ }, this.setValidity = () => {
1874
+ this._input && this._input.setCustomValidity && this._input.setCustomValidity(
1875
+ this.validity.valid ? "" : this.props.validationMessage || si
1876
+ );
1877
+ }, this.onScroll = (t) => {
1878
+ this._isScrolling = !0;
1879
+ const { list: e } = this.base, { groupField: s } = this.props;
1880
+ let { data: n = [] } = this.props;
1881
+ if (!s || !n.length)
1882
+ return;
1883
+ const a = this.itemHeight || (e ? e.children[0].offsetHeight : 0), c = t.target.scrollTop;
1884
+ s && (n = this.base.getGroupedDataModernMode(n, s));
1885
+ let d = n[0][s];
1886
+ for (let r = 1; r < n.length && !(a * r > c); r++)
1887
+ n[r] && n[r][s] && (d = n[r][s]);
1888
+ d !== this.state.group && this.setState({
1889
+ group: d
1890
+ });
1891
+ }, this.handleItemClick = (t, e) => {
1892
+ this.base.handleItemClick(t, e), this._valueDuringOnChange = void 0;
1893
+ }, this.onChangeHandler = (t) => {
1894
+ const s = this.base.initState(), n = t.currentTarget, a = n.value, p = n.selectionEnd === a.length;
1895
+ s.syntheticEvent = t;
1896
+ const c = this._suggested, d = this.value, r = d && d.substring(0, d.length - c.length), h = r && r === a, u = r && r.length > a.length, { suggest: g } = this.props, m = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
1897
+ if (g !== void 0 && g !== !1) {
1898
+ h || u || !p ? this._suggested = "" : this.suggestValue(a);
1899
+ const v = a + this._suggested, b = { userInput: a, value: this._suggested };
1900
+ this.triggerOnChange(v, s, { suggestion: b });
1901
+ } else
1902
+ this._suggested = "", this.triggerOnChange(a, s);
1903
+ (!m && a || m && !a) && this.togglePopup(s), s.data.focusedItem = void 0, this.applyState(s), this.setState({ group: void 0 });
1904
+ }, this.clearButtonClick = (t) => {
1905
+ const s = this.base.initState(), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
1906
+ s.syntheticEvent = t;
1907
+ const a = "";
1908
+ this._suggested = "", this.triggerOnChange(a, s), this.state.focusedItem !== void 0 && (s.data.focusedItem = void 0), n && this.togglePopup(s), this.applyState(s);
1909
+ }, this.onInputKeyDown = (t) => {
1910
+ const { data: e = [], skipDisabledItems: s, groupField: n, textField: a } = this.props;
1911
+ this._isScrolling && (this._isScrolling = !1);
1912
+ const p = this.focusedIndex(), c = e[p], d = t.keyCode, r = t.altKey, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = this.base.initState();
1913
+ u.syntheticEvent = t;
1914
+ const g = () => {
1915
+ h && t.preventDefault();
1916
+ };
1917
+ if (r && d === f.down)
1918
+ this.setState({
1919
+ opened: !0
1920
+ });
1921
+ else if (r && d === f.up)
1922
+ this.setState({
1923
+ opened: !1
1924
+ });
1925
+ else if (h && d === f.pageUp)
1926
+ this.base.scrollPopupByPageSize(-1);
1927
+ else if (h && d === f.pageDown)
1928
+ this.base.scrollPopupByPageSize(1);
1929
+ else if (h && (d === f.enter || d === f.esc))
1930
+ g(), s === !1 && c && c.disabled ? (h && this.togglePopup(u), this.applyState(u)) : this.applyInputValue(t.currentTarget.value, u, t.keyCode);
1931
+ else if (!h && d === f.esc) {
1932
+ const m = "";
1933
+ this._suggested = "", this.triggerOnChange(m, u), this.state.focusedItem !== void 0 && (u.data.focusedItem = void 0), this.applyState(u);
1934
+ } else if (d === f.up || d === f.down) {
1935
+ if (n !== "" && a)
1936
+ if (!this.props.skipDisabledItems && h)
1937
+ this.onNavigate(u, d);
1938
+ else {
1939
+ let m = 0;
1940
+ if (d === f.down || d === f.right) {
1941
+ const v = e.slice(p + 1).find((b) => !b.disabled && b[a]);
1942
+ m = v && e.findIndex((b) => b[a] === v[a]);
1943
+ } else if (d === f.up || d === f.left) {
1944
+ let v;
1945
+ if (p === -1)
1946
+ v = e, m = e.findIndex((b) => !b.disabled && b[a]);
1947
+ else {
1948
+ v = e.slice(0, p);
1949
+ let b = v.pop();
1950
+ for (; b && b.disabled; )
1951
+ b = v.pop();
1952
+ m = b && e.findIndex((w) => w[a] === b[a]);
1953
+ }
1954
+ }
1955
+ if (m !== void 0) {
1956
+ const v = m - p;
1957
+ this.onNavigate(u, d, v);
1958
+ } else
1959
+ m === void 0 && e.findIndex((v) => v[a]) === e.length - 1 && this.onNavigate(u, d);
1960
+ }
1961
+ else if (!this.props.skipDisabledItems && h)
1962
+ this.onNavigate(u, d);
1963
+ else {
1964
+ let m = null;
1965
+ if (d === f.down || d === f.right)
1966
+ m = e.slice(p + 1).find((v) => !v.disabled);
1967
+ else if (d === f.up || d === f.left) {
1968
+ const v = e.slice(0, p);
1969
+ for (m = v.pop(); m && m.disabled; )
1970
+ m = v.pop();
1971
+ }
1972
+ if (m) {
1973
+ const v = m.id - p - 1;
1974
+ this.onNavigate(u, d, v);
1975
+ } else
1976
+ this.onNavigate(u, d);
1977
+ }
1978
+ this.applyState(u), g();
1979
+ }
1980
+ }, this.handleBlur = (t) => {
1981
+ if (this.state.focused) {
1982
+ const e = this.base.initState();
1983
+ e.data.focused = !1, e.events.push({ type: "onBlur" }), e.syntheticEvent = t, this.applyInputValue(t.currentTarget.value, e);
1984
+ }
1985
+ }, qe(je);
1986
+ }
1987
+ /**
1988
+ * @hidden
1989
+ */
1990
+ get element() {
1991
+ return this._element;
1992
+ }
1993
+ /**
1994
+ * The value of the AutoComplete.
1995
+ */
1996
+ get value() {
1997
+ return this._valueDuringOnChange !== void 0 ? this._valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value !== void 0 ? this.state.value : this.props.defaultValue !== void 0 ? this.props.defaultValue : "";
1998
+ }
1999
+ /**
2000
+ * Gets the `name` property of the AutoComplete.
2001
+ */
2002
+ get name() {
2003
+ return this.props.name;
2004
+ }
2005
+ /**
2006
+ * Represents the validity state into which the AutoComplete is set.
2007
+ */
2008
+ get validity() {
2009
+ const i = this.props.validationMessage !== void 0, t = !this.required || this.value !== "", e = this.props.valid !== void 0 ? this.props.valid : t;
2010
+ return {
2011
+ customError: i,
2012
+ valid: e,
2013
+ valueMissing: this.value === null
2014
+ };
2015
+ }
2016
+ /**
2017
+ * @hidden
2018
+ */
2019
+ get validityStyles() {
2020
+ return this.props.validityStyles !== void 0 ? this.props.validityStyles : Wt.defaultProps.validityStyles;
2021
+ }
2022
+ /**
2023
+ * @hidden
2024
+ */
2025
+ get required() {
2026
+ return this.props.required !== void 0 ? this.props.required : Wt.defaultProps.required;
2027
+ }
2028
+ /**
2029
+ * @hidden
2030
+ */
2031
+ componentDidUpdate(i, t) {
2032
+ var g;
2033
+ const { groupField: e = "", data: s = [] } = this.props, { data: n = [] } = i, a = this.focusedIndex(), p = s[a], c = n !== s, d = p !== void 0 && t.focusedItem !== p, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = i.opened !== void 0 ? i.opened : t.opened, u = !h && r;
2034
+ if (e === "")
2035
+ (r && (d || c) || u) && this.base.scrollToItem(a);
2036
+ else if (!this._isScrolling) {
2037
+ let m = (g = this.base.getGroupedDataModernMode(s, e)) == null ? void 0 : g.indexOf(p);
2038
+ u && (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][e], this), this.base.scrollToItem(m)), r && h && d && this.base.scrollToItem(m);
2039
+ }
2040
+ this.setValidity();
2041
+ }
2042
+ /**
2043
+ * @hidden
2044
+ */
2045
+ componentDidMount() {
2046
+ this.base.didMount(), this.setValidity();
2047
+ }
2048
+ /**
2049
+ * @hidden
2050
+ */
2051
+ render() {
2052
+ const { dir: i, disabled: t, label: e, className: s, style: n, loading: a, suggest: p, size: c, rounded: d, fillMode: r } = this.props, h = !this.validityStyles || this.validity.valid, u = this.base, g = this.value, m = this.props.clearButton !== !1 && !a && !!g, v = this.props.id || this._inputId;
2053
+ typeof p == "string" && (this._suggested = p);
2054
+ const b = /* @__PURE__ */ o.createElement(
2055
+ "span",
2056
+ {
2057
+ className: B(
2058
+ "k-autocomplete k-input",
2059
+ s,
2060
+ {
2061
+ [`k-input-${ls[c] || c}`]: c,
2062
+ [`k-rounded-${ii[d] || d}`]: d,
2063
+ [`k-input-${r}`]: r,
2064
+ "k-invalid": !h,
2065
+ "k-loading": a,
2066
+ "k-required": this.required,
2067
+ "k-disabled": t
2068
+ }
2069
+ ),
2070
+ ref: (w) => {
2071
+ this._element = w, u.wrapper = w;
2072
+ },
2073
+ style: e ? { ...n, width: void 0 } : n,
2074
+ dir: i
2075
+ },
2076
+ this.renderSearchBar(g || "", v),
2077
+ a && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
2078
+ m && !a && /* @__PURE__ */ o.createElement(rt, { onClick: this.clearButtonClick, key: "clearbutton" }),
2079
+ this.renderListContainer()
2080
+ );
2081
+ return e ? /* @__PURE__ */ o.createElement(
2082
+ Ge,
2083
+ {
2084
+ label: e,
2085
+ editorId: v,
2086
+ editorValue: g,
2087
+ editorValid: h,
2088
+ editorDisabled: t,
2089
+ style: { width: n ? n.width : void 0 },
2090
+ children: b
2091
+ }
2092
+ ) : b;
2093
+ }
2094
+ /**
2095
+ * @hidden
2096
+ */
2097
+ onNavigate(i, t, e) {
2098
+ const s = this.value, { data: n = [], textField: a, focusedItemIndex: p } = this.props, c = this.state.focusedItem !== void 0 ? n.findIndex((r) => R(r, this.state.focusedItem, a)) : p ? p(n, s, a) : n.indexOf(as(n, s, a)), d = this.base.navigation.navigate({
2099
+ keyCode: t,
2100
+ current: c,
2101
+ max: n.length - 1,
2102
+ min: 0,
2103
+ skipItems: e || void 0
2104
+ });
2105
+ d !== void 0 && this.itemFocus(d, i), this.applyState(i);
2106
+ }
2107
+ /**
2108
+ * @hidden
2109
+ */
2110
+ applyInputValue(i, t, e) {
2111
+ const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: n = [], textField: a } = this.props, p = this.focusedIndex(), c = n[p];
2112
+ if (this._suggested = "", s && e === f.enter && c && !c.disabled) {
2113
+ const d = V(n[this.focusedIndex(i)], a);
2114
+ this.triggerOnChange(d, t);
2115
+ }
2116
+ s && this.togglePopup(t), this.applyState(t);
2117
+ }
2118
+ renderSearchBar(i, t) {
2119
+ const e = this.base, { placeholder: s, tabIndex: n, disabled: a, readonly: p } = this.props, { focused: c } = this.state, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
2120
+ return /* @__PURE__ */ o.createElement(
2121
+ Zt,
2122
+ {
2123
+ id: t,
2124
+ placeholder: s,
2125
+ tabIndex: n,
2126
+ accessKey: this.props.accessKey,
2127
+ value: i,
2128
+ suggestedText: this._suggested,
2129
+ focused: c,
2130
+ name: this.props.name,
2131
+ ref: (r) => this._input = r && r.input,
2132
+ onKeyDown: this.onInputKeyDown,
2133
+ onChange: this.onChangeHandler,
2134
+ onFocus: e.handleFocus,
2135
+ onBlur: this.handleBlur,
2136
+ disabled: a,
2137
+ readOnly: p,
2138
+ expanded: d,
2139
+ owns: e.listBoxId,
2140
+ activedescendant: "option-" + e.guid + "-" + this.focusedIndex(),
2141
+ role: "combobox",
2142
+ ariaLabelledBy: this.props.ariaLabelledBy,
2143
+ ariaDescribedBy: this.props.ariaDescribedBy,
2144
+ ariaRequired: this.required,
2145
+ render: this.props.valueRender
2146
+ }
2147
+ );
2148
+ }
2149
+ renderListContainer() {
2150
+ const i = this.base, {
2151
+ dir: t,
2152
+ header: e,
2153
+ footer: s,
2154
+ data: n = [],
2155
+ size: a,
2156
+ groupField: p,
2157
+ list: c,
2158
+ groupStickyHeaderItemRender: d
2159
+ } = this.props, r = i.getPopupSettings(), h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = r.width !== void 0 ? r.width : i.popupWidth;
2160
+ let { group: g } = this.state;
2161
+ return g === void 0 && p !== void 0 && (g = V(n[0], p)), /* @__PURE__ */ o.createElement(
2162
+ Et,
2163
+ {
2164
+ width: u,
2165
+ popupSettings: {
2166
+ animate: r.animate,
2167
+ anchor: this.element,
2168
+ show: h,
2169
+ popupClass: B(
2170
+ r.popupClass,
2171
+ "k-list-container",
2172
+ "k-autocomplete-popup"
2173
+ ),
2174
+ className: r.className,
2175
+ appendTo: r.appendTo
2176
+ },
2177
+ dir: t !== void 0 ? t : this.base.dirCalculated,
2178
+ itemsCount: [n.length]
2179
+ },
2180
+ e && /* @__PURE__ */ o.createElement("div", { className: "k-list-header" }, e),
2181
+ /* @__PURE__ */ o.createElement(
2182
+ "div",
2183
+ {
2184
+ className: B(
2185
+ "k-list",
2186
+ {
2187
+ [`k-list-${ls[a] || a}`]: a
2188
+ }
2189
+ )
2190
+ },
2191
+ !c && g && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: g, groupMode: "modern", render: d }),
2192
+ this.renderList()
2193
+ ),
2194
+ s && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, s)
2195
+ );
2196
+ }
2197
+ renderList() {
2198
+ const i = this.base, t = i.getPopupSettings(), {
2199
+ textField: e,
2200
+ data: s = [],
2201
+ listNoDataRender: n,
2202
+ itemRender: a,
2203
+ groupHeaderItemRender: p
2204
+ } = this.props, c = this.value, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
2205
+ return /* @__PURE__ */ o.createElement(
2206
+ Ue,
2207
+ {
2208
+ id: i.listBoxId,
2209
+ show: d,
2210
+ data: s.slice(),
2211
+ focusedIndex: this.focusedIndex(),
2212
+ value: c,
2213
+ textField: e,
2214
+ valueField: e,
2215
+ highlightSelected: !1,
2216
+ optionsGuid: i.guid,
2217
+ groupField: this.props.groupField,
2218
+ groupMode: "modern",
2219
+ listRef: (r) => i.list = r,
2220
+ wrapperStyle: { maxHeight: t.height },
2221
+ wrapperCssClass: "k-list-content",
2222
+ onClick: this.handleItemClick,
2223
+ itemRender: a,
2224
+ groupHeaderItemRender: p,
2225
+ noDataRender: n,
2226
+ onMouseDown: (r) => r.preventDefault(),
2227
+ onScroll: this.onScroll
2228
+ }
2229
+ );
2230
+ }
2231
+ triggerOnChange(i, t, e) {
2232
+ this.value === i && !e || (t.data.value = i, this._valueDuringOnChange = i, t.events.push({ type: "onChange", ...e || {} }));
2233
+ }
2234
+ applyState(i) {
2235
+ this.base.applyState(i), this._valueDuringOnChange = void 0;
2236
+ }
2237
+ suggestValue(i) {
2238
+ if (this._suggested = "", i) {
2239
+ const { data: t = [], textField: e } = this.props, s = t[Ve(t, i, e)];
2240
+ if (s) {
2241
+ const n = V(s, e);
2242
+ i.toLowerCase() !== n.toLowerCase() && (this._suggested = n.substring(i.length));
2243
+ }
2244
+ }
2245
+ }
2246
+ focusedIndex(i) {
2247
+ const { data: t = [], textField: e, focusedItemIndex: s, skipDisabledItems: n } = this.props, a = i !== void 0 ? i : this.value;
2248
+ if (this.state.focusedItem !== void 0)
2249
+ return t.findIndex((p) => R(p, this.state.focusedItem, e));
2250
+ if (s)
2251
+ return s(t, a, e);
2252
+ {
2253
+ const p = t.indexOf(as(t, a, e));
2254
+ return n && e && p === -1 ? t.findIndex((c) => !c.disabled && c[e]) : Math.max(0, p);
2255
+ }
2256
+ }
2257
+ };
2258
+ let Tt = Wt;
2259
+ Tt.displayName = "AutoComplete";
2260
+ Tt.propTypes = {
2261
+ ...ie.basicPropTypes,
2262
+ size: l.oneOf([null, "small", "medium", "large"]),
2263
+ rounded: l.oneOf([null, "small", "medium", "large", "full"]),
2264
+ fillMode: l.oneOf([null, "solid", "flat", "outline"]),
2265
+ groupField: l.string,
2266
+ suggest: l.oneOfType([l.bool, l.string]),
2267
+ placeholder: l.string,
2268
+ value: l.string,
2269
+ defaultValue: l.string,
2270
+ validationMessage: l.string,
2271
+ required: l.bool,
2272
+ readonly: l.bool,
2273
+ clearButton: l.bool,
2274
+ valueRender: l.func,
2275
+ id: l.string,
2276
+ ariaLabelledBy: l.string,
2277
+ ariaDescribedBy: l.string,
2278
+ list: l.any,
2279
+ skipDisabledItems: l.bool
2280
+ };
2281
+ Tt.defaultProps = {
2282
+ ...ie.defaultProps,
2283
+ size: "medium",
2284
+ rounded: "medium",
2285
+ fillMode: "solid",
2286
+ skipDisabledItems: !0
2287
+ };
2288
+ const ni = Ke(), oi = wt(ni, Tt);
2289
+ oi.displayName = "KendoReactAutoComplete";
2290
+ const ai = (i) => i.syntheticEvent.preventDefault(), li = (i) => i.syntheticEvent.stopPropagation();
2291
+ class ys extends o.Component {
2292
+ render() {
2293
+ const { data: t, guid: e, focused: s, tagRender: n, tag: a, onTagDelete: p, size: c } = this.props;
2294
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, t.map((d, r) => {
2295
+ const h = a ? /* @__PURE__ */ o.createElement(
2296
+ a,
2297
+ {
2298
+ key: d.text + r,
2299
+ tagData: d,
2300
+ guid: e,
2301
+ focusedTag: s,
2302
+ onTagDelete: p
2303
+ }
2304
+ ) : /* @__PURE__ */ o.createElement(
2305
+ _s,
2306
+ {
2307
+ id: `tag-${e}-${d.text.replace(/\s+/g, "-")}`,
2308
+ "aria-selected": !0,
2309
+ role: "option",
2310
+ "aria-setsize": t.length,
2311
+ key: d.text + r,
2312
+ text: d.text,
2313
+ removable: !0,
2314
+ onRemove: (u) => p.call(void 0, d.data, u.syntheticEvent),
2315
+ onMouseDown: ai,
2316
+ onClick: li,
2317
+ className: d === s ? "k-focus" : void 0,
2318
+ size: c
2319
+ }
2320
+ );
2321
+ return n ? n(d, h) : h;
2322
+ }), this.props.children);
2323
+ }
2324
+ }
2325
+ var st = /* @__PURE__ */ ((i) => (i[i.PopupList = 0] = "PopupList", i[i.TagsList = 1] = "TagsList", i))(st || {});
2326
+ const rs = 500, es = (i) => {
2327
+ const {
2328
+ footer: t,
2329
+ children: e,
2330
+ windowWidth: s = 0,
2331
+ navigatable: n,
2332
+ navigatableElements: a,
2333
+ expand: p,
2334
+ animation: c,
2335
+ onClose: d,
2336
+ adaptiveTitle: r,
2337
+ mobileFilter: h
2338
+ } = i, u = {
2339
+ navigatable: n || !1,
2340
+ navigatableElements: a || [],
2341
+ expand: p,
2342
+ animation: c !== !1,
2343
+ onClose: d,
2344
+ animationStyles: s <= rs ? { top: 0, width: "100%", height: "100%" } : void 0,
2345
+ className: s <= rs ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
2346
+ };
2347
+ return /* @__PURE__ */ o.createElement(Yt, { ...u }, /* @__PURE__ */ o.createElement(Jt, { className: "k-text-center" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ o.createElement("div", null, r)), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ o.createElement(
2348
+ Te,
2349
+ {
2350
+ tabIndex: 0,
2351
+ "aria-label": "Cancel",
2352
+ "aria-disabled": "false",
2353
+ type: "button",
2354
+ fillMode: "flat",
2355
+ icon: "x",
2356
+ svgIcon: at,
2357
+ onClick: d
2358
+ }
2359
+ ))), h && /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, h)), e, t && /* @__PURE__ */ o.createElement(Rs, { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ o.createElement(
2360
+ Te,
2361
+ {
2362
+ size: "large",
2363
+ tabIndex: 0,
2364
+ "aria-label": t.cancelText,
2365
+ "aria-disabled": "false",
2366
+ type: "button",
2367
+ onClick: t.onCancel
2368
+ },
2369
+ t.cancelText
2370
+ ), /* @__PURE__ */ o.createElement(
2371
+ Te,
2372
+ {
2373
+ tabIndex: 0,
2374
+ themeColor: "primary",
2375
+ size: "large",
2376
+ "aria-label": t.applyText,
2377
+ "aria-disabled": "false",
2378
+ type: "button",
2379
+ onClick: t.onApply
2380
+ },
2381
+ t.applyText
2382
+ )));
2383
+ }, { sizeMap: yt, roundedMap: ri } = $e, di = "Please enter a valid value!", ds = (i) => i.preventDefault(), cs = (i) => i === 2, qt = class extends o.Component {
2384
+ constructor(i) {
2385
+ super(i), this.state = {
2386
+ activedescendant: st.PopupList,
2387
+ currentValue: []
2388
+ }, this._element = null, this._valueItemsDuringOnChange = null, this._inputId = Fe(), this.base = new ie(this), this._tags = [], this._input = null, this._adaptiveInput = null, this._skipFocusEvent = !1, this._lastSelectedOrDeslectedItemIndex = null, this.itemHeight = 0, this.scrollToFocused = !1, this.localization = null, this.focus = () => {
2389
+ this._input && this._input.focus();
2390
+ }, this.handleItemSelect = (t, e) => {
2391
+ const { data: s = [], dataItemKey: n, virtual: a } = this.props, p = a ? a.skip : 0, c = s[t - p], d = this.value.findIndex((u) => R(u, c, n));
2392
+ this._lastSelectedOrDeslectedItemIndex = s.findIndex((u) => R(u, c, n));
2393
+ let r = [];
2394
+ d !== -1 ? (r = this.value, r.splice(d, 1)) : r = [...this.value, c], (this.props.filter !== void 0 ? this.props.filter : this.state.text) && !this.mobileMode && (this.state.text && (e.data.text = ""), this.base.filterChanged("", e)), this._adaptiveInput && this._adaptiveInput.blur(), this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.triggerOnChange(r, e), this.base.triggerPageChangeCornerItems(c, e);
2395
+ }, this.onTagDelete = (t, e) => {
2396
+ const s = this.base.initState();
2397
+ s.syntheticEvent = e, this.opened && this.base.togglePopup(s), !this.state.focused && !this.mobileMode && (s.data.focused = !0, this.focus());
2398
+ const n = this.value;
2399
+ vt(n, t, this.props.dataItemKey), this.triggerOnChange(n, s), this.applyState(s);
2400
+ }, this.itemFocus = (t, e) => {
2401
+ const { data: s = [], allowCustom: n, virtual: a } = this.props, p = a ? a.skip : 0, c = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedIndex: d } = this.getFocusedState(), r = n && c, h = s[t - p];
2402
+ h && d !== t ? this.state.focusedIndex !== t && (e.data.focusedIndex = t, e.data.activedescendant = st.PopupList) : r && t === -1 && this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.base.triggerPageChangeCornerItems(h, e);
2403
+ }, this.componentRef = (t) => {
2404
+ this._element = t, this.base.wrapper = t;
2405
+ }, this.searchbarRef = (t) => {
2406
+ const e = this._input = t && t.input;
2407
+ e && this.state.focused && window.setTimeout(() => e.focus(), 0);
2408
+ }, this.onChangeHandler = (t) => {
2409
+ const e = this.base.initState(), s = t.target.value;
2410
+ e.syntheticEvent = t, this.props.filter === void 0 && (e.data.text = s), e.data.focusedIndex = void 0, this.opened || (this.base.togglePopup(e), this.setState({ currentValue: this.value })), this.base.filterChanged(s, e), this.applyState(e), this.setState({ group: void 0 });
2411
+ }, this.clearButtonClick = (t) => {
2412
+ const e = this.base.initState();
2413
+ e.syntheticEvent = t, t.stopPropagation(), this.value.length > 0 && this.triggerOnChange([], e), this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.opened && this.base.togglePopup(e);
2414
+ const s = this.props.filter !== void 0 ? this.props.filter : this.state.text;
2415
+ G(s) && s !== "" && this.base.filterChanged("", e), this.state.text && (e.data.text = ""), this._lastSelectedOrDeslectedItemIndex = null, this.applyState(e);
2416
+ }, this.onInputKeyDown = (t) => {
2417
+ const { data: e = [], textField: s, groupField: n } = this.props, a = t.keyCode, p = this.props.filter !== void 0 ? this.props.filter : this.state.text, c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { focusedItem: d, focusedIndex: r } = this.getFocusedState(), h = this.base.initState();
2418
+ if (h.syntheticEvent = t, !p && this.value.length > 0 && (a === f.left || a === f.right || a === f.home || a === f.end || a === f.delete || a === f.backspace) && !t.shiftKey)
2419
+ return this.onTagsNavigate(t, h);
2420
+ const u = () => {
2421
+ t.preventDefault(), this.base.togglePopup(h), this.applyState(h);
2422
+ };
2423
+ if (this.opened)
2424
+ if (a === f.pageUp)
2425
+ this.base.scrollPopupByPageSize(-1);
2426
+ else if (a === f.pageDown)
2427
+ this.base.scrollPopupByPageSize(1);
2428
+ else if ((t.ctrlKey || t.metaKey) && t.code === "KeyA") {
2429
+ const m = (this.state.value && this.state.value.length) === e.length ? [] : e;
2430
+ this.updateStateOnKeyboardNavigation(m, h);
2431
+ } else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode === f.end) {
2432
+ const g = e.slice(this.getFocusedState().focusedIndex);
2433
+ this.itemFocus(e.length - 1, h), this.updateStateOnKeyboardNavigation(g, h);
2434
+ } else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode === f.home) {
2435
+ const g = e.slice(0, this.getFocusedState().focusedIndex + 1);
2436
+ this.itemFocus(0, h), this.updateStateOnKeyboardNavigation(g, h);
2437
+ } else if (t.shiftKey && t.keyCode === f.up) {
2438
+ let g;
2439
+ const m = this.getLastSelectedOrDeselectedIndex(1, r);
2440
+ m === null ? g = r !== 0 ? e.slice(r - 1, r) : [e[r]] : m === r ? g = [e[m - 1]] : r >= 0 && (g = m > r ? e.slice(r - 1, m) : e.slice(m - 1, r)), g && g.length > 0 && (r >= 1 && this.itemFocus(r - 1, h), this.updateStateOnKeyboardNavigation(g, h));
2441
+ } else if (t.shiftKey && t.keyCode === f.down) {
2442
+ let g;
2443
+ const m = this.getLastSelectedOrDeselectedIndex(0, r);
2444
+ m === null ? g = r !== e.length - 1 ? e.slice(r, r + 1) : [e[r]] : m === r ? g = e.slice(r, r + 2) : r >= 0 && (g = m > r ? e.slice(r + 1, m + 1) : e.slice(m, r + 2)), g && g.length >= 1 && (this.itemFocus(r + 1, h), this.updateStateOnKeyboardNavigation(g, h));
2445
+ } else if (t.altKey && a === f.up)
2446
+ u();
2447
+ else if (a === f.up || a === f.down) {
2448
+ if (n !== "" && s)
2449
+ if (!this.props.skipDisabledItems && c)
2450
+ this.onNavigate(h, a);
2451
+ else {
2452
+ let g = 0;
2453
+ if (a === f.down || a === f.right) {
2454
+ const m = e.slice(r + 1).find((v) => !v.disabled && v[s]);
2455
+ g = m && e.findIndex((v) => v[s] === m[s]);
2456
+ } else if (a === f.up || a === f.left) {
2457
+ let m;
2458
+ if (r === -1)
2459
+ m = e, g = e.findIndex((v) => !v.disabled && v[s]);
2460
+ else {
2461
+ m = e.slice(0, r);
2462
+ let v = m.pop();
2463
+ for (; v && v.disabled; )
2464
+ v = m.pop();
2465
+ g = v && e.findIndex((b) => b[s] === v[s]);
2466
+ }
2467
+ }
2468
+ if (g) {
2469
+ const m = g - r;
2470
+ this.onNavigate(h, a, m);
2471
+ } else
2472
+ g !== void 0 && this.onNavigate(h, a);
2473
+ }
2474
+ else if (!this.props.skipDisabledItems && c)
2475
+ this.onNavigate(h, a);
2476
+ else {
2477
+ let g = null;
2478
+ if (a === f.down || a === f.right)
2479
+ g = e.slice(r + 1).find((m) => !m.disabled);
2480
+ else if (a === f.up || a === f.left) {
2481
+ const m = e.slice(0, r);
2482
+ for (g = m.pop(); g && g.disabled; )
2483
+ g = m.pop();
2484
+ }
2485
+ if (g) {
2486
+ const m = g.id - r - 1;
2487
+ this.onNavigate(h, a, m);
2488
+ } else
2489
+ this.onNavigate(h, a);
2490
+ }
2491
+ this.applyState(h), t.preventDefault();
2492
+ } else
2493
+ a === f.enter ? (t.preventDefault(), this.props.allowCustom && p && d === null ? this.customItemSelect(t) : d && d.disabled ? u() : this.selectFocusedItem(t)) : a === f.esc && u();
2494
+ else
2495
+ t.altKey && a === f.down && u();
2496
+ }, this.listContainerContent = () => {
2497
+ const { header: t, footer: e, allowCustom: s, size: n, data: a = [], groupStickyHeaderItemRender: p, groupField: c, list: d } = this.props, r = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: h } = this.getFocusedState(), u = s && r && /* @__PURE__ */ o.createElement(
2498
+ "div",
2499
+ {
2500
+ className: B("k-list", {
2501
+ [`k-list-${yt[n] || n}`]: n
2502
+ }),
2503
+ key: "customitem",
2504
+ onClick: this.customItemSelect,
2505
+ onMouseDown: ds
2506
+ },
2507
+ /* @__PURE__ */ o.createElement(
2508
+ "div",
2509
+ {
2510
+ className: B("k-list-item k-custom-item", { "k-focus": cs(h) }),
2511
+ style: { fontStyle: "italic" }
2512
+ },
2513
+ r,
2514
+ /* @__PURE__ */ o.createElement(ke, { name: "plus", icon: Ms, style: { position: "absolute", right: "0.5em" } })
2515
+ )
2516
+ );
2517
+ let { group: g } = this.state;
2518
+ return g === void 0 && c !== void 0 && (g = V(a[0], c)), /* @__PURE__ */ o.createElement(o.Fragment, null, t && /* @__PURE__ */ o.createElement("div", { className: "k-list-header" }, t), u, /* @__PURE__ */ o.createElement(
2519
+ "div",
2520
+ {
2521
+ className: B(
2522
+ "k-list",
2523
+ {
2524
+ [`k-list-${this.mobileMode ? "lg" : yt[n] || n}`]: n,
2525
+ "k-virtual-list": this.base.vs.enabled
2526
+ }
2527
+ )
2528
+ },
2529
+ !d && g && a.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: g, groupMode: "modern", render: p }),
2530
+ this.renderList()
2531
+ ), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e));
2532
+ }, this.renderListContainer = () => {
2533
+ const t = this.base, { dir: e, data: s = [] } = this.props, n = this.base.getPopupSettings(), a = n.width !== void 0 ? n.width : t.popupWidth, p = {
2534
+ dir: e !== void 0 ? e : t.dirCalculated,
2535
+ width: a,
2536
+ popupSettings: {
2537
+ popupClass: B(
2538
+ n.popupClass,
2539
+ "k-list-container",
2540
+ "k-multiselect-popup"
2541
+ ),
2542
+ className: n.className,
2543
+ animate: n.animate,
2544
+ anchor: this.element,
2545
+ show: this.opened,
2546
+ onOpen: this.onPopupOpened,
2547
+ onClose: this.onPopupClosed,
2548
+ appendTo: n.appendTo
2549
+ },
2550
+ itemsCount: [s.length, this.value.length]
2551
+ };
2552
+ return /* @__PURE__ */ o.createElement(Et, { ...p }, this.listContainerContent());
2553
+ }, this.renderAdaptiveListContainer = () => {
2554
+ const { adaptiveTitle: t, filterable: e, filter: s } = this.props, { windowWidth: n = 0 } = this.state, a = s !== void 0 ? s : this.state.text;
2555
+ this.localization = Ae(this);
2556
+ const p = e ? /* @__PURE__ */ o.createElement(
2557
+ Be,
2558
+ {
2559
+ value: a,
2560
+ ref: (d) => this._adaptiveInput = d && d.element,
2561
+ onChange: this.onChangeHandler,
2562
+ onKeyDown: this.onInputKeyDown,
2563
+ size: this.props.size,
2564
+ rounded: this.props.rounded,
2565
+ fillMode: this.props.fillMode
2566
+ }
2567
+ ) : null, c = {
2568
+ adaptiveTitle: t,
2569
+ expand: this.opened,
2570
+ onClose: (d) => this.onCancel(d),
2571
+ windowWidth: n,
2572
+ mobileFilter: p,
2573
+ footer: {
2574
+ cancelText: this.localization.toLanguageString(ot, le[ot]),
2575
+ onCancel: this.onCancel,
2576
+ applyText: this.localization.toLanguageString(nt, le[nt]),
2577
+ onApply: this.closePopup
2578
+ }
2579
+ };
2580
+ return /* @__PURE__ */ o.createElement(es, { ...c }, /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
2581
+ }, this.closePopup = (t) => {
2582
+ const e = this.base.initState();
2583
+ e.syntheticEvent = t, t.stopPropagation(), this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.opened && this.base.togglePopup(e), e.events.push({ type: "onClose" });
2584
+ const s = this.props.filter !== void 0 ? this.props.filter : this.state.text;
2585
+ G(s) && s !== "" && this.base.filterChanged("", e), this.state.text && (e.data.text = ""), this.applyState(e);
2586
+ }, this.onCancel = (t) => {
2587
+ const e = this.base.initState();
2588
+ e.syntheticEvent = t, t.stopPropagation(), this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.opened && this.base.togglePopup(e), e.events.push({ type: "onCancel" });
2589
+ const s = this.props.filter !== void 0 ? this.props.filter : this.state.text;
2590
+ G(s) && s !== "" && this.base.filterChanged("", e), this.state.text && (e.data.text = ""), this.applyState(e);
2591
+ }, this.renderList = () => {
2592
+ const {
2593
+ data: t = [],
2594
+ textField: e,
2595
+ listNoDataRender: s,
2596
+ itemRender: n,
2597
+ groupHeaderItemRender: a,
2598
+ dataItemKey: p,
2599
+ virtual: c = { skip: 0, total: void 0 }
2600
+ } = this.props, d = this.base.vs, { focusedIndex: r } = this.getFocusedState(), h = this.base.getPopupSettings(), u = `translateY(${d.translate}px)`;
2601
+ return /* @__PURE__ */ o.createElement(
2602
+ Ue,
2603
+ {
2604
+ id: this.base.listBoxId,
2605
+ show: this.opened,
2606
+ data: t.slice(),
2607
+ focusedIndex: r - c.skip,
2608
+ value: this.value,
2609
+ textField: e,
2610
+ valueField: p,
2611
+ optionsGuid: this.base.guid,
2612
+ groupField: this.props.groupField,
2613
+ groupMode: "modern",
2614
+ listRef: (g) => {
2615
+ d.list = this.base.list = g;
2616
+ },
2617
+ wrapperStyle: this.mobileMode ? {} : { maxHeight: h.height },
2618
+ wrapperCssClass: "k-list-content",
2619
+ listStyle: d.enabled ? { transform: u } : void 0,
2620
+ key: "listKey",
2621
+ skip: c.skip,
2622
+ onClick: this.handleItemClick,
2623
+ itemRender: n,
2624
+ groupHeaderItemRender: a,
2625
+ noDataRender: s,
2626
+ onMouseDown: ds,
2627
+ onBlur: this.handleBlur,
2628
+ onScroll: this.onScroll,
2629
+ wrapperRef: d.scrollerRef,
2630
+ scroller: this.base.renderScrollElement(),
2631
+ ariaSetSize: c.total
2632
+ }
2633
+ );
2634
+ }, this.onScroll = (t) => {
2635
+ const { vs: e, list: s } = this.base;
2636
+ e.scrollHandler(t);
2637
+ const { groupField: n } = this.props;
2638
+ let { data: a = [] } = this.props;
2639
+ if (!(!n || !a.length) && n) {
2640
+ const p = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : s ? s.children[0].offsetHeight : 0), d = t.target.scrollTop - e.skip * p;
2641
+ a = this.base.getGroupedDataModernMode(a, n);
2642
+ let r = a[0][n];
2643
+ for (let h = 1; h < a.length && !(p * h > d); h++)
2644
+ a[h] && a[h][n] && (r = a[h][n]);
2645
+ r !== this.state.group && this.setState({
2646
+ group: r
2647
+ });
2648
+ }
2649
+ }, this.customItemSelect = (t) => {
2650
+ const e = this.props.filter !== void 0 ? this.props.filter : this.state.text, { textField: s } = this.props;
2651
+ if (!e)
2652
+ return;
2653
+ const n = this.base.initState();
2654
+ n.syntheticEvent = t;
2655
+ const a = s ? { [s]: e } : e;
2656
+ this.state.text !== void 0 && (n.data.text = ""), n.data.focusedIndex = void 0, this.base.filterChanged("", n);
2657
+ const p = [...this.value, a];
2658
+ this.triggerOnChange(p, n), this.base.togglePopup(n), this.applyState(n);
2659
+ }, this.handleWrapperClick = (t) => {
2660
+ const e = this._input;
2661
+ !this.opened && e && this.focusElement(e);
2662
+ const s = this.base.initState();
2663
+ s.syntheticEvent = t, !this.state.focused && !this.mobileMode && (s.events.push({ type: "onFocus" }), s.data.focused = !0), this.mobileMode && (this.setState({ currentValue: this.tagsToRender }), this.mobileMode && window.setTimeout(() => this._adaptiveInput && this._adaptiveInput.focus(), 300)), this.base.togglePopup(s), this.applyState(s);
2664
+ }, this.handleItemClick = (t, e) => {
2665
+ const s = this.base.initState();
2666
+ s.syntheticEvent = e, this.handleItemSelect(t, s), this.props.autoClose && !this.mobileMode && this.base.togglePopup(s), e.stopPropagation(), this.applyState(s);
2667
+ }, this.handleBlur = (t) => {
2668
+ if (!this.state.focused || this._skipFocusEvent)
2669
+ return;
2670
+ const e = this.base.initState(), { allowCustom: s, filterable: n } = this.props;
2671
+ e.syntheticEvent = t, e.data.focused = !1, e.events.push({ type: "onBlur" }), this.opened && !this.mobileMode && (this.state.opened && (e.data.opened = !1), e.events.push({ type: "onClose" })), !s && !n && this.state.text && (e.data.text = ""), this.applyState(e);
2672
+ }, this.handleFocus = (t) => {
2673
+ this._skipFocusEvent || this.base.handleFocus(t);
2674
+ }, this.onPopupOpened = () => {
2675
+ this._input && this.state.focused && !this.mobileMode && this.focusElement(this._input);
2676
+ }, this.onPopupClosed = () => {
2677
+ this.state.focused && window.setTimeout(() => {
2678
+ this.state.focused && this.focusElement(this._input);
2679
+ }, 0);
2680
+ }, this.setValidity = () => {
2681
+ this._input && this._input.setCustomValidity && this._input.setCustomValidity(
2682
+ this.validity.valid ? "" : this.props.validationMessage || di
2683
+ );
2684
+ }, qe(je);
2685
+ }
2686
+ get document() {
2687
+ if (Me)
2688
+ return this.element && this.element.ownerDocument || document;
2689
+ }
2690
+ /** @hidden */
2691
+ get element() {
2692
+ return this._element;
2693
+ }
2694
+ /** @hidden */
2695
+ get opened() {
2696
+ return !!(this.props.opened !== void 0 ? this.props.opened : this.state.opened);
2697
+ }
2698
+ /** @hidden */
2699
+ get tagsToRender() {
2700
+ const { tags: i, textField: t } = this.props;
2701
+ let e = [];
2702
+ return i === void 0 ? this.value.forEach((s) => {
2703
+ e.push({ text: V(s, t), data: [s] });
2704
+ }) : e.push(...i), e;
2705
+ }
2706
+ /**
2707
+ * The mobile mode of the ComboBox.
2708
+ */
2709
+ get mobileMode() {
2710
+ return !!(this.state.windowWidth && this.state.windowWidth <= Se && this.props.adaptive);
2711
+ }
2712
+ /**
2713
+ * Represents the value of the MultiSelect.
2714
+ */
2715
+ get value() {
2716
+ const i = [];
2717
+ return this._valueItemsDuringOnChange ? i.push(...this._valueItemsDuringOnChange) : this.props.value ? i.push(...this.props.value) : this.state.value ? i.push(...this.state.value) : this.props.defaultValue && i.push(...this.props.defaultValue), i;
2718
+ }
2719
+ /**
2720
+ * Gets the `name` property of the MultiSelect.
2721
+ */
2722
+ get name() {
2723
+ return this.props.name;
2724
+ }
2725
+ /**
2726
+ * Represents the validity state into which the MultiSelect is set.
2727
+ */
2728
+ get validity() {
2729
+ const i = this.props.validationMessage !== void 0, t = !this.required || this.value !== null && this.value.length > 0 && this.value !== void 0, e = this.props.valid !== void 0 ? this.props.valid : t;
2730
+ return {
2731
+ customError: i,
2732
+ valid: e,
2733
+ valueMissing: this.value === null
2734
+ };
2735
+ }
2736
+ /** @hidden */
2737
+ get required() {
2738
+ return this.props.required !== void 0 ? this.props.required : qt.defaultProps.required;
2739
+ }
2740
+ get validityStyles() {
2741
+ return this.props.validityStyles !== void 0 ? this.props.validityStyles : qt.defaultProps.validityStyles;
2742
+ }
2743
+ /** @hidden */
2744
+ componentDidUpdate(i, t) {
2745
+ var u;
2746
+ const { virtual: e, groupField: s = "", data: n = [] } = this.props, a = e ? e.skip : 0, p = i.virtual ? i.virtual.total : 0, c = i.opened !== void 0 ? i.opened : t.opened, d = !c && this.opened, r = c && !this.opened;
2747
+ if (!this.base.getPopupSettings().animate && r && this.onPopupClosed(), e && e.total !== p)
2748
+ this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
2749
+ else {
2750
+ let { focusedItem: g, focusedIndex: m } = this.getFocusedState();
2751
+ s !== "" && (m = (u = this.base.getGroupedDataModernMode(n, s)) == null ? void 0 : u.indexOf(g)), d && e ? this.base.scrollToVirtualItem(e, m - a) : d && !e ? (n && n.length !== 0 && this.base.resetGroupStickyHeader(n[0][s], this), this.base.scrollToItem(m)) : this.opened && c && g && this.scrollToFocused && this.base.scrollToItem(m - a);
2752
+ }
2753
+ this.scrollToFocused = !1, this.setValidity();
2754
+ }
2755
+ /** @hidden */
2756
+ componentDidMount() {
2757
+ var i;
2758
+ this.observerResize = Me && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (i = this.document) != null && i.body && this.observerResize && this.observerResize.observe(this.document.body);
2759
+ }
2760
+ /** @hidden */
2761
+ componentWillUnmount() {
2762
+ var i;
2763
+ (i = this.document) != null && i.body && this.observerResize && this.observerResize.disconnect();
2764
+ }
2765
+ /** @hidden */
2766
+ onNavigate(i, t, e) {
2767
+ const { allowCustom: s, data: n = [] } = this.props, a = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: p, focusedIndex: c } = this.getFocusedState(), d = s && a, r = cs(p), h = this.base, u = h.vs;
2768
+ if (this.opened && t === f.up && r)
2769
+ this.state.focusedIndex !== void 0 && (i.data.focusedIndex = void 0);
2770
+ else {
2771
+ const g = h.navigation.navigate({
2772
+ keyCode: t,
2773
+ current: c,
2774
+ max: (u.enabled ? u.total : n.length) - 1,
2775
+ min: d ? -1 : 0,
2776
+ skipItems: e || void 0
2777
+ });
2778
+ g !== void 0 && (this.itemFocus(g, i), this.scrollToFocused = !0);
2779
+ }
2780
+ this.applyState(i);
2781
+ }
2782
+ /** @hidden */
2783
+ render() {
2784
+ const {
2785
+ style: i,
2786
+ className: t,
2787
+ label: e,
2788
+ dir: s,
2789
+ disabled: n,
2790
+ textField: a,
2791
+ dataItemKey: p,
2792
+ virtual: c,
2793
+ size: d,
2794
+ rounded: r,
2795
+ fillMode: h,
2796
+ loading: u,
2797
+ filter: g
2798
+ } = this.props, { text: m, focused: v, focusedTag: b, currentValue: w } = this.state, S = this.base.vs, D = this.props.id || this._inputId;
2799
+ S.enabled = c !== void 0, c !== void 0 && (S.skip = c.skip, S.total = c.total, S.pageSize = c.pageSize);
2800
+ const N = this.mobileMode && this.opened ? w : this.tagsToRender;
2801
+ this.setItems(this.tagsToRender, this._tags);
2802
+ const O = !this.validityStyles || this.validity.valid, _ = !!(g !== void 0 ? g : m) || N && N.length > 0, C = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
2803
+ "div",
2804
+ {
2805
+ ref: this.componentRef,
2806
+ className: B("k-multiselect k-input", t, {
2807
+ [`k-input-${yt[d] || d}`]: d,
2808
+ [`k-rounded-${ri[r] || r}`]: r,
2809
+ [`k-input-${h}`]: h,
2810
+ "k-focus": v && !n,
2811
+ "k-invalid": !O,
2812
+ "k-disabled": n,
2813
+ "k-loading": u,
2814
+ "k-required": this.required
2815
+ }),
2816
+ style: e ? { ...i, width: void 0 } : i,
2817
+ dir: s,
2818
+ onFocus: this.handleFocus,
2819
+ onBlur: this.handleBlur,
2820
+ onClick: this.handleWrapperClick,
2821
+ onMouseDown: Hs
2822
+ },
2823
+ /* @__PURE__ */ o.createElement("div", { className: B("k-input-values") }, /* @__PURE__ */ o.createElement(
2824
+ "div",
2825
+ {
2826
+ className: B(
2827
+ "k-chip-list",
2828
+ { [`k-chip-list-${yt[d] || d}`]: d }
2829
+ ),
2830
+ role: "listbox",
2831
+ id: "tagslist-" + this.base.guid
2832
+ },
2833
+ N && N.length > 0 && /* @__PURE__ */ o.createElement(
2834
+ ys,
2835
+ {
2836
+ tagRender: this.props.tagRender,
2837
+ onTagDelete: this.onTagDelete,
2838
+ data: N,
2839
+ guid: this.base.guid,
2840
+ focused: b ? N.find((F) => xt(F, b, p)) : void 0,
2841
+ size: d
2842
+ }
2843
+ )
2844
+ ), this.renderSearchBar(D)),
2845
+ u && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
2846
+ _ && /* @__PURE__ */ o.createElement(rt, { onClick: this.clearButtonClick }),
2847
+ !this.mobileMode && this.renderListContainer()
2848
+ ), this.mobileMode && this.renderAdaptiveListContainer());
2849
+ return e ? /* @__PURE__ */ o.createElement(
2850
+ Ge,
2851
+ {
2852
+ label: e,
2853
+ editorId: D,
2854
+ editorValue: m || V(this.value[0], a),
2855
+ editorValid: O,
2856
+ editorDisabled: n,
2857
+ style: { width: i ? i.width : void 0 },
2858
+ children: C
2859
+ }
2860
+ ) : C;
2861
+ }
2862
+ renderSearchBar(i) {
2863
+ const { activedescendant: t, focusedTag: e, currentValue: s } = this.state, { disabled: n, placeholder: a, ariaDescribedBy: p } = this.props, c = !this.mobileMode && (this.props.filter !== void 0 ? this.props.filter : this.state.text) || "", { focusedIndex: d } = this.getFocusedState(), r = this.value.length === 0 && !c ? a : void 0, h = s && s.length > 0 ? void 0 : a, u = t === st.TagsList && e !== void 0 ? `tag-${this.base.guid}-${e.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${d}`;
2864
+ return /* @__PURE__ */ o.createElement(
2865
+ Zt,
2866
+ {
2867
+ id: i,
2868
+ size: Math.max((r || "").length, c.length, 1),
2869
+ tabIndex: this.props.tabIndex,
2870
+ accessKey: this.props.accessKey,
2871
+ placeholder: this.mobileMode && this.opened ? h : r,
2872
+ value: c,
2873
+ onChange: this.onChangeHandler,
2874
+ onKeyDown: this.onInputKeyDown,
2875
+ ref: this.searchbarRef,
2876
+ disabled: n,
2877
+ expanded: this.opened,
2878
+ owns: this.base.listBoxId,
2879
+ role: "combobox",
2880
+ activedescendant: u,
2881
+ ariaDescribedBy: `tagslist-${this.base.guid}${p ? " " + p : ""}`,
2882
+ ariaLabelledBy: this.props.ariaLabelledBy,
2883
+ ariaRequired: this.required
2884
+ }
2885
+ );
2886
+ }
2887
+ onTagsNavigate(i, t) {
2888
+ const e = i.keyCode, { focusedTag: s } = this.state, n = this._tags, a = this.props.dataItemKey;
2889
+ let p = s ? n.findIndex((r) => xt(r, s, a)) : -1, c;
2890
+ const d = p !== -1;
2891
+ if (e === f.left)
2892
+ d ? p = Math.max(0, p - 1) : p = n.length - 1, c = n[p];
2893
+ else if (e === f.right)
2894
+ p === n.length - 1 ? c = void 0 : d && (p = Math.min(n.length - 1, p + 1), c = n[p]);
2895
+ else if (e === f.home && !i.shiftKey)
2896
+ c = n[0];
2897
+ else if (e === f.end && !i.shiftKey)
2898
+ c = n[n.length - 1];
2899
+ else if (e === f.delete) {
2900
+ if (d) {
2901
+ const r = this.value;
2902
+ vt(r, n[p].data, a), this.triggerOnChange(r, t);
2903
+ }
2904
+ } else if (e === f.backspace) {
2905
+ const r = this.value;
2906
+ if (d)
2907
+ vt(r, n[p].data, a), this.triggerOnChange(r, t);
2908
+ else if (!d && n.length) {
2909
+ const h = n.pop();
2910
+ vt(r, h.data, a), this.triggerOnChange(r, t);
2911
+ }
2912
+ }
2913
+ c !== s && (t.data.focusedTag = c, t.data.activedescendant = st.TagsList), this.applyState(t);
2914
+ }
2915
+ triggerOnChange(i, t) {
2916
+ this.props.value === void 0 && (t.data.value = [...i]), this._valueItemsDuringOnChange = [], this.setItems(i, this._valueItemsDuringOnChange), t.events.push({ type: "onChange" });
2917
+ }
2918
+ selectFocusedItem(i, t) {
2919
+ const { data: e = [], virtual: s } = this.props, { focusedIndex: n } = t || this.getFocusedState(), a = s ? s.skip : 0;
2920
+ e[n - a] !== void 0 && this.handleItemClick(n, i);
2921
+ }
2922
+ setItems(i, t) {
2923
+ t.length = 0, t.push(...i);
2924
+ }
2925
+ getFocusedState() {
2926
+ const { focusedIndex: i } = this.state, t = this.props.filter !== void 0 ? this.props.filter : this.state.text, { allowCustom: e, data: s = [], dataItemKey: n, virtual: a, textField: p, focusedItemIndex: c = Ve, skipDisabledItems: d } = this.props, r = a && a.skip || 0;
2927
+ let h;
2928
+ if (i !== void 0)
2929
+ return {
2930
+ focusedIndex: i,
2931
+ focusedItem: s[i - r],
2932
+ focusedType: 1
2933
+ /* ListItem */
2934
+ };
2935
+ const u = this.value;
2936
+ if (e && t)
2937
+ return {
2938
+ focusedItem: null,
2939
+ focusedIndex: -1,
2940
+ focusedType: 2
2941
+ /* CustomItem */
2942
+ };
2943
+ if (t)
2944
+ return h = c(s, t, p), {
2945
+ focusedItem: s[h],
2946
+ focusedIndex: h + r,
2947
+ focusedType: 1
2948
+ /* ListItem */
2949
+ };
2950
+ if (u.length) {
2951
+ const g = u[u.length - 1];
2952
+ return h = s.findIndex((m) => R(m, g, n)), s[h] !== void 0 ? {
2953
+ focusedIndex: h + r,
2954
+ focusedItem: s[h],
2955
+ focusedType: 1
2956
+ /* ListItem */
2957
+ } : { focusedType: 0, focusedIndex: -1 };
2958
+ } else if (d && p && !t && r === 0) {
2959
+ const g = s.findIndex((m) => !m.disabled && m[p]);
2960
+ return {
2961
+ focusedIndex: g,
2962
+ focusedItem: s[g - r],
2963
+ focusedType: 1
2964
+ /* ListItem */
2965
+ };
2966
+ }
2967
+ return r === 0 ? {
2968
+ focusedItem: s[0],
2969
+ focusedIndex: 0,
2970
+ focusedType: 1
2971
+ /* ListItem */
2972
+ } : { focusedType: 0, focusedIndex: -1 };
2973
+ }
2974
+ focusElement(i) {
2975
+ this._skipFocusEvent = !0, i.focus(), window.setTimeout(() => this._skipFocusEvent = !1, 0);
2976
+ }
2977
+ applyState(i) {
2978
+ this.base.applyState(i), this._valueItemsDuringOnChange = null;
2979
+ }
2980
+ calculateMedia(i) {
2981
+ for (let t of i)
2982
+ this.setState({ windowWidth: t.target.clientWidth });
2983
+ }
2984
+ /**
2985
+ * Updates the state of the MultiSelect when the complex keyboard navigation that
2986
+ * includes key combinations with the Ctrl/Command, Shift, Home and End keys
2987
+ *
2988
+ * @param {Array<string | Object>} dataToSet Defines the array of new values that will be applied to the MultiSelect
2989
+ * @param {MultiSelectInternalState} state The current state of the MultiSelect
2990
+ */
2991
+ updateStateOnKeyboardNavigation(i, t) {
2992
+ this.setState({ value: i }), this.triggerOnChange(i, t), this.applyState(t);
2993
+ }
2994
+ /**
2995
+ * Returns the last element that was selected or deselected. Needed for the keyboard navigation specifications
2996
+ *
2997
+ * @param {number} correction A correction is needed depending on if UP or DOWN key is pressed
2998
+ */
2999
+ getLastSelectedOrDeselectedIndex(i, t) {
3000
+ return this._lastSelectedOrDeslectedItemIndex === null && (this._lastSelectedOrDeslectedItemIndex = t), this._lastSelectedOrDeslectedItemIndex !== null ? this._lastSelectedOrDeslectedItemIndex + i : null;
3001
+ }
3002
+ };
3003
+ let Ft = qt;
3004
+ Ft.displayName = "MultiSelect";
3005
+ Ft.propTypes = {
3006
+ ...ie.propTypes,
3007
+ autoClose: l.bool,
3008
+ value: l.arrayOf(l.any),
3009
+ defaultValue: l.arrayOf(l.any),
3010
+ dataItemKey: l.string,
3011
+ placeholder: l.string,
3012
+ tags: l.arrayOf(l.shape({
3013
+ text: l.string,
3014
+ data: l.arrayOf(l.any)
3015
+ })),
3016
+ tagRender: l.func,
3017
+ id: l.string,
3018
+ ariaLabelledBy: l.string,
3019
+ ariaDescribedBy: l.string,
3020
+ groupField: l.string,
3021
+ list: l.any,
3022
+ adaptive: l.bool,
3023
+ adaptiveTitle: l.string,
3024
+ onCancel: l.func,
3025
+ skipDisabledItems: l.bool
3026
+ };
3027
+ Ft.defaultProps = {
3028
+ ...ie.defaultProps,
3029
+ autoClose: !0,
3030
+ required: !1,
3031
+ size: "medium",
3032
+ rounded: "medium",
3033
+ fillMode: "solid",
3034
+ groupMode: "modern",
3035
+ skipDisabledItems: !0
3036
+ };
3037
+ const ci = Ke(), pi = wt(ci, Ft);
3038
+ pi.displayName = "KendoReactMultiSelect";
3039
+ const hi = (i) => /* @__PURE__ */ o.createElement(
3040
+ Ue,
3041
+ {
3042
+ ...i,
3043
+ wrapperCssClass: "k-table-body k-table-scroller",
3044
+ listClassName: B(
3045
+ "k-table k-table-list",
3046
+ {
3047
+ "k-virtual-table": i.virtual !== void 0
3048
+ }
3049
+ ),
3050
+ listStyle: { ...i.listStyle }
3051
+ }
3052
+ ), ui = (i, t) => i ? typeof i == "number" ? i + "px" : i : t, gi = Ke(), ts = o.forwardRef((i, t) => {
3053
+ const e = Gt(gi, i), s = o.useRef(null), n = o.useRef(null), a = ws(), {
3054
+ columns: p = He.columns,
3055
+ popupSettings: c = He.popupSettings,
3056
+ className: d,
3057
+ size: r,
3058
+ onOpen: h,
3059
+ onClose: u,
3060
+ onFocus: g,
3061
+ onBlur: m,
3062
+ onChange: v,
3063
+ onFilterChange: b,
3064
+ onPageChange: w,
3065
+ ...S
3066
+ } = e;
3067
+ o.useImperativeHandle(s, () => ({
3068
+ element: n.current && n.current.element,
3069
+ focus() {
3070
+ n.current && n.current.focus();
3071
+ },
3072
+ get value() {
3073
+ return n.current && n.current.value;
3074
+ },
3075
+ get name() {
3076
+ return n.current && n.current.name;
3077
+ },
3078
+ props: e
3079
+ })), o.useImperativeHandle(t, () => s.current);
3080
+ const D = o.useMemo(
3081
+ () => {
3082
+ if (e.groupField !== void 0 && e.data)
3083
+ return V(e.data[0], e.groupField);
3084
+ },
3085
+ [e.data, e.groupField]
3086
+ ), [N, O] = o.useState(D), [_, C] = o.useState(!0), F = o.useMemo(
3087
+ () => {
3088
+ const P = /* @__PURE__ */ o.createElement("th", { className: "k-table-th", colSpan: p.length }, N);
3089
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, e.header, /* @__PURE__ */ o.createElement("div", { className: "k-table-header-wrap" }, /* @__PURE__ */ o.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ o.createElement("colgroup", null, p.map(
3090
+ (H, L) => /* @__PURE__ */ o.createElement(
3091
+ "col",
3092
+ {
3093
+ key: H.uniqueKey ? H.uniqueKey : L,
3094
+ style: { width: H.width ? H.width : He.width }
3095
+ }
3096
+ )
3097
+ )), /* @__PURE__ */ o.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ o.createElement("tr", { className: "k-table-row" }, p.map((H, L) => /* @__PURE__ */ o.createElement("th", { className: "k-table-th", key: H.uniqueKey ? H.uniqueKey : L }, H.header || " "))), N && _ && /* @__PURE__ */ o.createElement("tr", { className: "k-table-group-row" }, e.groupStickyHeaderItemRender ? e.groupStickyHeaderItemRender.call(void 0, P, {}) : P)))));
3098
+ },
3099
+ [e.header, p, N, _]
3100
+ ), x = o.useMemo(
3101
+ () => (
3102
+ // These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
3103
+ `calc(${p.map((P) => ui(P.width, He.width)).filter(Boolean).join(" + ")} + ${a}px + 4px)`
3104
+ ),
3105
+ [p, a]
3106
+ ), E = e.virtual ? e.virtual.skip : 0, M = o.useCallback(
3107
+ (P, H) => {
3108
+ const L = p.map((J, W) => /* @__PURE__ */ o.createElement(
3109
+ "span",
3110
+ {
3111
+ className: e.itemRender ? void 0 : "k-table-td",
3112
+ style: e.itemRender ? void 0 : { width: J.width ? J.width : He.width },
3113
+ key: J.uniqueKey ? J.uniqueKey : W
3114
+ },
3115
+ J.field ? String(kt(J.field)(H.dataItem)) : ""
3116
+ ));
3117
+ let me, Ce, Ne, Oe, Pe = e.data || [];
3118
+ const A = H.index - E;
3119
+ e.groupField !== void 0 && (Oe = kt(e.groupField), Ce = Oe(Pe[A]), Ne = Oe(Pe[A - 1]), Ce && Ne && Ce !== Ne && (me = Ce)), me && e.groupMode === "classic" && L.push(/* @__PURE__ */ o.createElement("div", { key: "group", className: "k-table-td k-table-group-td" }, /* @__PURE__ */ o.createElement("span", null, me)));
3120
+ const X = o.cloneElement(P, {
3121
+ ...P.props,
3122
+ className: B("k-table-row", {
3123
+ "k-table-alt-row": H.index % 2 !== 0,
3124
+ "k-focus": H.focused,
3125
+ "k-selected": H.selected,
3126
+ "k-first": !!me,
3127
+ "k-disabled": H.dataItem.disabled
3128
+ })
3129
+ }, L);
3130
+ return e.itemRender ? e.itemRender.call(void 0, X, H) : X;
3131
+ },
3132
+ [p, e.groupField, e.itemRender, e.data, E]
3133
+ ), K = o.useCallback(
3134
+ (P, H) => {
3135
+ P && P.call(void 0, {
3136
+ ...H,
3137
+ target: s.current
3138
+ });
3139
+ },
3140
+ []
3141
+ ), U = o.useCallback((P) => (e.virtual || O(D), K(h, P)), [K, h, e.virtual, D]), j = o.useCallback((P) => K(u, P), [u]), Y = o.useCallback((P) => K(g, P), [g]), re = o.useCallback((P) => K(m, P), [m]), we = o.useCallback((P) => K(v, P), [v]), ne = o.useCallback((P) => K(w, P), [w]), Q = o.useCallback((P) => (O(D), K(b, {
3142
+ ...P,
3143
+ mobileMode: P.target.mobileMode
3144
+ })), [b]), oe = o.useCallback(
3145
+ (P) => {
3146
+ O(P.group);
3147
+ },
3148
+ []
3149
+ );
3150
+ o.useEffect(() => {
3151
+ Es();
3152
+ }), o.useEffect(() => {
3153
+ const P = e.data;
3154
+ O(D), P && P.length !== 0 ? C(!0) : C(!1);
3155
+ }, [e.data]);
3156
+ const Le = o.useCallback((P) => /* @__PURE__ */ o.createElement(hi, { ...P }), []);
3157
+ return /* @__PURE__ */ o.createElement(
3158
+ Ns.Provider,
3159
+ {
3160
+ value: (P) => ({ ...P, popupClass: `k-dropdowngrid-popup ${c.popupClass}` })
3161
+ },
3162
+ /* @__PURE__ */ o.createElement(
3163
+ bs,
3164
+ {
3165
+ ...S,
3166
+ list: Le,
3167
+ popupSettings: {
3168
+ width: x,
3169
+ ...c,
3170
+ className: c.className
3171
+ },
3172
+ ref: n,
3173
+ header: F,
3174
+ itemRender: M,
3175
+ groupHeaderItemRender: e.groupHeaderItemRender,
3176
+ size: e.size,
3177
+ rounded: e.rounded,
3178
+ fillMode: e.fillMode,
3179
+ groupMode: e.groupMode,
3180
+ groupField: e.groupField,
3181
+ isMultiColumn: !0,
3182
+ onOpen: U,
3183
+ onClose: j,
3184
+ onFocus: Y,
3185
+ onBlur: re,
3186
+ onChange: we,
3187
+ onFilterChange: Q,
3188
+ onPageChange: ne,
3189
+ onGroupScroll: oe,
3190
+ className: B("k-dropdowngrid", d),
3191
+ required: e.required,
3192
+ adaptive: e.adaptive,
3193
+ adaptiveFilter: e.adaptiveFilter,
3194
+ adaptiveTitle: e.adaptiveTitle,
3195
+ footer: e.footer,
3196
+ footerClassName: "k-table-footer"
3197
+ }
3198
+ )
3199
+ );
3200
+ }), fi = {
3201
+ ...dt.propTypes,
3202
+ columns: l.any.isRequired
3203
+ }, He = {
3204
+ columns: [],
3205
+ popupSettings: {},
3206
+ width: "200px",
3207
+ size: "medium",
3208
+ rounded: "medium",
3209
+ fillMode: "solid"
3210
+ };
3211
+ ts.displayName = "KendoMultiColumnComboBox";
3212
+ ts.propTypes = fi;
3213
+ ts.defaultProps = He;
3214
+ function Is(i, t, e) {
3215
+ const [s, n] = o.useState(t);
3216
+ return o.useEffect(
3217
+ () => {
3218
+ s !== void 0 && i.current && n(i.current.offsetWidth);
3219
+ },
3220
+ e
3221
+ ), s;
3222
+ }
3223
+ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata" }, /* @__PURE__ */ o.createElement("div", null, i.children)), { sizeMap: mi, roundedMap: vi } = $e, bi = "Please select a value from the list!", yi = (i) => /* @__PURE__ */ o.createElement("span", { className: "k-input-value-text" }, i.children), ps = (i) => i.split("_").map((t) => parseInt(t, 10)), Ii = (i, t) => {
3224
+ const { validationMessage: e, valid: s, required: n } = i;
3225
+ return {
3226
+ customError: e !== void 0,
3227
+ valid: !!(s !== void 0 ? s : !n || t),
3228
+ valueMissing: !t
3229
+ };
3230
+ }, hs = {
3231
+ selectField: "selected",
3232
+ subItemsField: "items",
3233
+ popupSettings: {
3234
+ animate: !0,
3235
+ width: "200px",
3236
+ height: "200px"
3237
+ },
3238
+ data: [],
3239
+ required: !1,
3240
+ style: {},
3241
+ validityStyles: !0,
3242
+ size: "medium",
3243
+ rounded: "medium",
3244
+ fillMode: "solid"
3245
+ }, ki = Ke(), Cs = o.forwardRef((i, t) => {
3246
+ qe(je);
3247
+ const e = Gt(ki, i), s = {
3248
+ ...hs,
3249
+ ...e
3250
+ }, n = o.useMemo(() => Fe(), []), a = s.id || n, {
3251
+ data: p,
3252
+ dataItemKey: c,
3253
+ popupSettings: d,
3254
+ style: r,
3255
+ opened: h,
3256
+ disabled: u,
3257
+ onOpen: g = De,
3258
+ onClose: m = De,
3259
+ placeholder: v,
3260
+ label: b,
3261
+ name: w,
3262
+ selectField: S,
3263
+ subItemsField: D,
3264
+ validationMessage: N,
3265
+ valid: O,
3266
+ required: _,
3267
+ validityStyles: C
3268
+ } = s, F = $t(s.tabIndex, u), x = o.useRef(null), E = o.useRef(null), M = o.useRef(null), K = o.useRef(null), U = o.useRef(null), j = o.useRef(null), Y = o.useRef(!1), [re, we] = o.useState(void 0), ne = s.value !== void 0, Q = ne ? s.value : re !== void 0 ? re : s.defaultValue, oe = G(Q), Le = oe ? V(Q, s.textField) : "", P = Ii({ validationMessage: N, valid: O, required: _ }, oe), H = o.useCallback(() => E.current && E.current.focus(), []);
3269
+ o.useImperativeHandle(
3270
+ x,
3271
+ () => ({
3272
+ props: s,
3273
+ element: E.current,
3274
+ focus: H
3275
+ })
3276
+ ), o.useImperativeHandle(t, () => x.current);
3277
+ const L = fs(E, s.dir), me = d.width !== void 0 ? d.width : r.width !== void 0 ? r.width : hs.popupSettings.width, Ne = {
3278
+ width: Is(E, me),
3279
+ ...L !== void 0 ? { direction: L } : {}
3280
+ }, [Oe, Pe] = o.useState(!1), A = h !== void 0 ? h : Oe, [X, J] = o.useState(!1), [W, Ye] = o.useState(), ue = !!(W && W <= Se && s.adaptive), [ve, Mt] = o.useState(""), is = o.useCallback(
3281
+ () => {
3282
+ U.current && U.current.setCustomValidity && U.current.setCustomValidity(
3283
+ P.valid ? "" : N === void 0 ? bi : N
3284
+ );
3285
+ },
3286
+ [N, P]
3287
+ );
3288
+ o.useEffect(is), o.useEffect(() => {
3289
+ const I = Me && window.ResizeObserver && new window.ResizeObserver(Rt.bind(void 0));
3290
+ return document != null && document.body && I && I.observe(document.body), () => {
3291
+ document != null && document.body && I && I.disconnect();
3292
+ };
3293
+ }, []);
3294
+ const ct = o.useCallback(
3295
+ (I) => {
3296
+ if (!A) {
3297
+ if (g) {
3298
+ const T = { ...I };
3299
+ g.call(void 0, T);
3300
+ }
3301
+ h === void 0 && Pe(!0);
3302
+ }
3303
+ },
3304
+ [A, h, g]
3305
+ ), xe = o.useCallback(
3306
+ (I) => {
3307
+ if (A) {
3308
+ if (m) {
3309
+ const T = { ...I };
3310
+ m.call(void 0, T);
3311
+ }
3312
+ h === void 0 && (Pe(!1), ue && setTimeout(() => {
3313
+ var T;
3314
+ q((T = K.current) == null ? void 0 : T.element);
3315
+ }, 300));
3316
+ }
3317
+ },
3318
+ [A, h, m, ue]
3319
+ ), Nt = o.useCallback(
3320
+ (I) => {
3321
+ if (!I.isDefaultPrevented() && x.current) {
3322
+ J(!0);
3323
+ const T = {
3324
+ syntheticEvent: I,
3325
+ nativeEvent: I.nativeEvent,
3326
+ target: x.current
3327
+ };
3328
+ (A ? xe : ct)(T);
3329
+ }
3330
+ },
3331
+ [A, h, g, m]
3332
+ ), se = o.useCallback(
3333
+ (I) => {
3334
+ Y.current = !0, I(), window.setTimeout(() => Y.current = !1, 0);
3335
+ },
3336
+ []
3337
+ ), ze = o.useCallback(
3338
+ (I) => {
3339
+ var k, z;
3340
+ const { keyCode: T, altKey: $ } = I, de = j.current && j.current.element;
3341
+ if (!x.current || I.isDefaultPrevented() && ((k = M.current) == null ? void 0 : k.element) === I.target)
3342
+ return;
3343
+ const y = {
3344
+ syntheticEvent: I,
3345
+ nativeEvent: I.nativeEvent,
3346
+ target: x.current
3347
+ };
3348
+ if (A)
3349
+ if (T === f.esc || $ && T === f.up)
3350
+ I.preventDefault(), xe(y);
3351
+ else if (de && de.querySelector(".k-focus") && (T === f.up || T === f.down || T === f.left || T === f.right || T === f.home || T === f.end)) {
3352
+ if (T === f.up && ((z = M.current) != null && z.element)) {
3353
+ const ee = Array.from(de.querySelectorAll(".k-treeview-item")), ye = [...ee].reverse().find((Ie) => !!(Ie && Ie.querySelector(".k-focus")));
3354
+ if (ye && ee.indexOf(ye) === 0)
3355
+ return se(() => {
3356
+ var Ie;
3357
+ q((Ie = M.current) == null ? void 0 : Ie.element);
3358
+ });
3359
+ }
3360
+ se(De);
3361
+ } else
3362
+ T === f.down && se(() => {
3363
+ var ee;
3364
+ q(((ee = M.current) == null ? void 0 : ee.element) || de);
3365
+ });
3366
+ else
3367
+ $ && T === f.down ? (I.preventDefault(), ct(y)) : A || T === f.esc && ut(I);
3368
+ },
3369
+ [A, h, g, m]
3370
+ ), _e = o.useCallback(
3371
+ (I) => {
3372
+ const { keyCode: T, altKey: $ } = I;
3373
+ $ || T !== f.up && T !== f.down || (I.preventDefault(), se(
3374
+ T === f.up ? () => {
3375
+ q(E.current);
3376
+ } : () => {
3377
+ q(j.current && j.current.element);
3378
+ }
3379
+ ));
3380
+ },
3381
+ []
3382
+ ), q = o.useCallback(
3383
+ (I) => {
3384
+ I && se(() => I.focus());
3385
+ },
3386
+ []
3387
+ ), he = o.useCallback(
3388
+ () => {
3389
+ var I;
3390
+ !X && A && !h ? xe({ target: x.current }) : e.filterable ? q((I = M.current) == null ? void 0 : I.element) : q(j.current && j.current.element);
3391
+ },
3392
+ [m, e.filterable, X, h, A]
3393
+ ), Z = o.useCallback(
3394
+ () => {
3395
+ X && q(E.current);
3396
+ },
3397
+ [X]
3398
+ ), Ot = o.useCallback(
3399
+ (I) => {
3400
+ if (!X && !Y.current && (J(!0), e.onFocus && x.current)) {
3401
+ const T = {
3402
+ syntheticEvent: I,
3403
+ nativeEvent: I.nativeEvent,
3404
+ target: x.current
3405
+ };
3406
+ e.onFocus.call(void 0, T);
3407
+ }
3408
+ },
3409
+ [X, e.onFocus]
3410
+ ), Pt = o.useCallback(
3411
+ (I) => {
3412
+ if (X && !Y.current && x.current) {
3413
+ J(!1);
3414
+ const T = {
3415
+ syntheticEvent: I,
3416
+ nativeEvent: I.nativeEvent,
3417
+ target: x.current
3418
+ };
3419
+ if (e.onBlur) {
3420
+ const $ = { ...T };
3421
+ e.onBlur.call(void 0, $);
3422
+ }
3423
+ ue || xe(T);
3424
+ }
3425
+ },
3426
+ [X, e.onBlur, A, h, m]
3427
+ ), _t = o.useCallback(
3428
+ () => {
3429
+ X && se(De), ue && setTimeout(() => {
3430
+ var I;
3431
+ q((I = K.current) == null ? void 0 : I.element);
3432
+ }, 300);
3433
+ },
3434
+ [X, ue]
3435
+ ), pt = o.useCallback(
3436
+ (I, T, $) => {
3437
+ if (e.onChange) {
3438
+ const de = {
3439
+ value: T,
3440
+ level: $ ? ps($) : [],
3441
+ ...I
3442
+ };
3443
+ e.onChange.call(void 0, de);
3444
+ }
3445
+ ne || we(T);
3446
+ },
3447
+ [e.onChange, ne]
3448
+ ), ht = o.useCallback(
3449
+ (I) => {
3450
+ if (R(I.item, Q, c) || !x.current)
3451
+ return;
3452
+ const { item: T, itemHierarchicalIndex: $, nativeEvent: de, syntheticEvent: y } = I, k = {
3453
+ syntheticEvent: y,
3454
+ nativeEvent: de,
3455
+ target: x.current
3456
+ };
3457
+ pt(k, T, $), xe(k);
3458
+ },
3459
+ [ne, Q, e.onChange, c, A, h, m]
3460
+ ), ut = o.useCallback(
3461
+ (I) => {
3462
+ if (!x.current)
3463
+ return;
3464
+ const T = {
3465
+ syntheticEvent: I,
3466
+ nativeEvent: I.nativeEvent,
3467
+ target: x.current
3468
+ };
3469
+ pt(T, null), xe(T), I.preventDefault();
3470
+ },
3471
+ [ne, e.onChange, A, h, m]
3472
+ ), gt = o.useCallback(
3473
+ (I) => {
3474
+ if (I.syntheticEvent.stopPropagation(), e.onExpandChange && x.current) {
3475
+ const { item: T, itemHierarchicalIndex: $, nativeEvent: de, syntheticEvent: y } = I, k = {
3476
+ level: ps($),
3477
+ item: T,
3478
+ nativeEvent: de,
3479
+ syntheticEvent: y,
3480
+ target: x.current
3481
+ };
3482
+ e.onExpandChange.call(void 0, k);
3483
+ }
3484
+ },
3485
+ [e.onExpandChange]
3486
+ ), Je = o.useCallback(
3487
+ (I) => {
3488
+ if (e.onFilterChange && x.current) {
3489
+ const $ = {
3490
+ filter: { field: e.textField, operator: "contains", value: I.target.value },
3491
+ syntheticEvent: I.syntheticEvent,
3492
+ nativeEvent: I.nativeEvent,
3493
+ target: x.current
3494
+ };
3495
+ e.onFilterChange.call(void 0, $), e.filter === void 0 && Mt(I.target.value);
3496
+ }
3497
+ },
3498
+ [e.onFilterChange, e.filter, e.textField]
3499
+ ), Qe = () => {
3500
+ const I = s.filterable ? /* @__PURE__ */ o.createElement(
3501
+ Be,
3502
+ {
3503
+ value: s.filter === void 0 ? ve : s.filter,
3504
+ ref: K,
3505
+ onChange: Je,
3506
+ onKeyDown: _e,
3507
+ size: ge,
3508
+ rounded: be,
3509
+ fillMode: Ee
3510
+ }
3511
+ ) : null, T = {
3512
+ adaptiveTitle: s.adaptiveTitle,
3513
+ expand: A,
3514
+ onClose: ($) => xe($),
3515
+ windowWidth: W,
3516
+ mobileFilter: I
3517
+ };
3518
+ return /* @__PURE__ */ o.createElement(es, { ...T }, /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ o.createElement("div", { className: "k-list k-list-lg" }, p.length > 0 ? /* @__PURE__ */ o.createElement(
3519
+ Ct,
3520
+ {
3521
+ ref: j,
3522
+ tabIndex: F,
3523
+ data: Xe,
3524
+ focusIdField: c,
3525
+ textField: s.textField,
3526
+ selectField: S,
3527
+ expandField: s.expandField,
3528
+ childrenField: D,
3529
+ expandIcons: !0,
3530
+ onItemClick: ht,
3531
+ onExpandChange: gt,
3532
+ size: ge,
3533
+ item: s.item,
3534
+ dir: L
3535
+ }
3536
+ ) : /* @__PURE__ */ o.createElement(Ze, null, et.toLanguageString(fe, le[fe]))))));
3537
+ }, Rt = o.useCallback(
3538
+ (I) => {
3539
+ for (let T of I)
3540
+ Ye(T.target.clientWidth);
3541
+ },
3542
+ []
3543
+ ), Xe = o.useMemo(
3544
+ () => ne || !oe ? p : Ds(
3545
+ p,
3546
+ D,
3547
+ (I) => Ts(
3548
+ I,
3549
+ D,
3550
+ { [S]: R(I, Q, c) }
3551
+ )
3552
+ ),
3553
+ [p, Q, ne, oe, S, D]
3554
+ ), Ze = s.listNoData || ks, ft = s.valueHolder || yi, et = vs(), mt = !C || P.valid, { size: ge, rounded: be, fillMode: Ee } = s, ae = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
3555
+ "span",
3556
+ {
3557
+ className: B("k-dropdowntree k-picker", s.className, {
3558
+ [`k-picker-${mi[ge] || ge}`]: ge,
3559
+ [`k-rounded-${vi[be] || be}`]: be,
3560
+ [`k-picker-${Ee}`]: Ee,
3561
+ "k-focus": X,
3562
+ "k-invalid": !mt,
3563
+ "k-loading": s.loading,
3564
+ "k-required": _,
3565
+ "k-disabled": s.disabled
3566
+ }),
3567
+ tabIndex: F,
3568
+ accessKey: s.accessKey,
3569
+ id: a,
3570
+ style: b ? { ...r, width: void 0 } : r,
3571
+ dir: L,
3572
+ ref: E,
3573
+ onKeyDown: u ? void 0 : ze,
3574
+ onMouseDown: _t,
3575
+ onClick: u ? void 0 : Nt,
3576
+ onFocus: Ot,
3577
+ onBlur: Pt,
3578
+ role: "combobox",
3579
+ "aria-haspopup": "tree",
3580
+ "aria-expanded": A,
3581
+ "aria-disabled": u,
3582
+ "aria-label": b,
3583
+ "aria-labelledby": s.ariaLabelledBy,
3584
+ "aria-describedby": s.ariaDescribedBy,
3585
+ "aria-required": _
3586
+ },
3587
+ /* @__PURE__ */ o.createElement("span", { className: "k-input-inner" }, /* @__PURE__ */ o.createElement(ft, { item: Q }, Le || v)),
3588
+ s.loading && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
3589
+ oe && !u && /* @__PURE__ */ o.createElement(
3590
+ "span",
3591
+ {
3592
+ onClick: ut,
3593
+ className: "k-clear-value",
3594
+ title: et.toLanguageString(it, le[it]),
3595
+ role: "button",
3596
+ tabIndex: -1,
3597
+ onMouseDown: (I) => I.preventDefault()
3598
+ },
3599
+ /* @__PURE__ */ o.createElement(ke, { name: "x", icon: at })
3600
+ ),
3601
+ /* @__PURE__ */ o.createElement(
3602
+ Te,
3603
+ {
3604
+ tabIndex: -1,
3605
+ type: "button",
3606
+ "aria-label": "select",
3607
+ className: "k-input-button",
3608
+ size: ge,
3609
+ fillMode: Ee,
3610
+ themeColor: "base",
3611
+ rounded: null,
3612
+ icon: "caret-alt-down",
3613
+ svgIcon: Ut
3614
+ }
3615
+ ),
3616
+ /* @__PURE__ */ o.createElement(
3617
+ "select",
3618
+ {
3619
+ name: w,
3620
+ ref: U,
3621
+ tabIndex: -1,
3622
+ "aria-hidden": !0,
3623
+ title: b,
3624
+ style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
3625
+ },
3626
+ /* @__PURE__ */ o.createElement("option", { value: s.valueMap ? s.valueMap.call(void 0, Q) : Q })
3627
+ ),
3628
+ !ue && /* @__PURE__ */ o.createElement(
3629
+ jt,
3630
+ {
3631
+ className: B(d.className, { "k-rtl": L === "rtl" }),
3632
+ popupClass: B(
3633
+ d.popupClass,
3634
+ "k-dropdowntree-popup"
3635
+ ),
3636
+ style: Ne,
3637
+ animate: d.animate,
3638
+ anchor: E.current,
3639
+ show: A,
3640
+ onOpen: he,
3641
+ onClose: Z,
3642
+ appendTo: d.appendTo
3643
+ },
3644
+ s.filterable && /* @__PURE__ */ o.createElement(
3645
+ Be,
3646
+ {
3647
+ value: s.filter === void 0 ? ve : s.filter,
3648
+ ref: M,
3649
+ onChange: Je,
3650
+ onKeyDown: _e,
3651
+ size: ge,
3652
+ rounded: be,
3653
+ fillMode: Ee
3654
+ }
3655
+ ),
3656
+ p.length > 0 ? /* @__PURE__ */ o.createElement(
3657
+ Ct,
3658
+ {
3659
+ ref: j,
3660
+ tabIndex: F,
3661
+ data: Xe,
3662
+ focusIdField: c,
3663
+ textField: s.textField,
3664
+ selectField: S,
3665
+ expandField: s.expandField,
3666
+ childrenField: D,
3667
+ expandIcons: !0,
3668
+ onItemClick: ht,
3669
+ onExpandChange: gt,
3670
+ size: ge,
3671
+ item: s.item,
3672
+ dir: L
3673
+ }
3674
+ ) : /* @__PURE__ */ o.createElement(Ze, null, et.toLanguageString(fe, le[fe]))
3675
+ )
3676
+ ), ue && Qe());
3677
+ return b ? /* @__PURE__ */ o.createElement(
3678
+ Ge,
3679
+ {
3680
+ label: b,
3681
+ editorValue: Le,
3682
+ editorPlaceholder: v,
3683
+ editorValid: mt,
3684
+ editorDisabled: u,
3685
+ editorId: a,
3686
+ style: { width: r ? r.width : void 0 },
3687
+ children: ae,
3688
+ dir: L
3689
+ }
3690
+ ) : ae;
3691
+ }), Ci = {
3692
+ opened: l.bool,
3693
+ disabled: l.bool,
3694
+ dir: l.string,
3695
+ tabIndex: l.number,
3696
+ accessKey: l.string,
3697
+ data: l.array,
3698
+ value: l.any,
3699
+ valueMap: l.func,
3700
+ placeholder: l.string,
3701
+ dataItemKey: l.string.isRequired,
3702
+ textField: l.string.isRequired,
3703
+ selectField: l.string,
3704
+ expandField: l.string,
3705
+ subItemsField: l.string,
3706
+ className: l.string,
3707
+ style: l.object,
3708
+ label: l.string,
3709
+ validationMessage: l.string,
3710
+ validityStyles: l.bool,
3711
+ valid: l.bool,
3712
+ required: l.bool,
3713
+ name: l.string,
3714
+ id: l.string,
3715
+ ariaLabelledBy: l.string,
3716
+ ariaDescribedBy: l.string,
3717
+ filterable: l.bool,
3718
+ filter: l.string,
3719
+ loading: l.bool,
3720
+ popupSettings: l.shape({
3721
+ animate: l.oneOfType([l.bool, l.shape({
3722
+ openDuration: l.number,
3723
+ closeDuration: l.number
3724
+ })]),
3725
+ popupClass: l.string,
3726
+ className: l.string,
3727
+ appendTo: l.any,
3728
+ width: l.oneOfType([l.string, l.number]),
3729
+ height: l.oneOfType([l.string, l.number])
3730
+ }),
3731
+ onOpen: l.func,
3732
+ onClose: l.func,
3733
+ onFocus: l.func,
3734
+ onBlur: l.func,
3735
+ onChange: l.func,
3736
+ onFilterChange: l.func,
3737
+ onExpandChange: l.func,
3738
+ item: l.func,
3739
+ valueHolder: l.func,
3740
+ listNoData: l.func,
3741
+ adaptiveTitle: l.string,
3742
+ adaptive: l.bool
3743
+ };
3744
+ Cs.displayName = "KendoReactDropDownTree";
3745
+ Cs.propTypes = Ci;
3746
+ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si } = $e, wi = (i) => i.split("_").map((t) => parseInt(t, 10)), Ei = (i, t) => {
3747
+ const { validationMessage: e, valid: s, required: n } = i;
3748
+ return {
3749
+ customError: e !== void 0,
3750
+ valid: !!(s !== void 0 ? s : !n || t),
3751
+ valueMissing: !t
3752
+ };
3753
+ }, Re = {
3754
+ checkField: "checkField",
3755
+ checkIndeterminateField: "checkIndeterminateField",
3756
+ subItemsField: "items",
3757
+ popupSettings: {
3758
+ animate: !0,
3759
+ width: "200px",
3760
+ height: "200px"
3761
+ },
3762
+ size: "medium",
3763
+ rounded: "medium",
3764
+ fillMode: "solid",
3765
+ required: !1,
3766
+ validityStyles: !0
3767
+ }, Di = Ke(), ss = o.forwardRef((i, t) => {
3768
+ const e = Gt(Di, i);
3769
+ qe(je);
3770
+ const s = o.useMemo(() => Fe(), []), n = e.id || s, {
3771
+ data: a = [],
3772
+ dataItemKey: p,
3773
+ popupSettings: c = {},
3774
+ style: d = {},
3775
+ opened: r,
3776
+ disabled: h,
3777
+ onOpen: u = De,
3778
+ onClose: g = De,
3779
+ placeholder: m,
3780
+ label: v,
3781
+ name: b,
3782
+ checkField: w = Re.checkField,
3783
+ checkIndeterminateField: S = Re.checkIndeterminateField,
3784
+ subItemsField: D = Re.subItemsField,
3785
+ validationMessage: N,
3786
+ valid: O,
3787
+ tags: _,
3788
+ value: C,
3789
+ required: F = Re.required,
3790
+ validityStyles: x = Re.validityStyles
3791
+ } = e, E = $t(e.tabIndex, h), M = o.useRef(null), K = o.useRef(null), U = o.useRef(null), j = o.useRef(null), Y = o.useRef(null), re = o.useRef(null), we = o.useRef(!1), ne = o.useRef([]), Q = o.useRef(null), [oe, Le] = o.useState(), [P, H] = o.useState(!1), [L, me] = o.useState(!1), [Ce, Ne] = o.useState(), [Oe, Pe] = o.useState([]), [A, X] = o.useState(""), J = !!(Ce && Ce <= Se && e.adaptive), W = r !== void 0 ? r : P, Ye = !!(Array.isArray(C) && C.length), ue = Ei({ validationMessage: N, valid: O, required: F }, Ye), ve = fs(K, e.dir), Mt = c.width !== void 0 ? c.width : d.width !== void 0 ? d.width : Re.popupSettings.width, ct = {
3792
+ width: Is(K, Mt),
3793
+ ...ve !== void 0 ? { direction: ve } : {}
3794
+ }, xe = o.useCallback(() => K.current && K.current.focus(), []);
3795
+ ne.current = _ === void 0 ? (C || []).map((y) => ({ text: V(y, e.textField), data: [y] })) : [..._], o.useImperativeHandle(
3796
+ M,
3797
+ () => ({
3798
+ props: e,
3799
+ element: K.current,
3800
+ focus: xe
3801
+ })
3802
+ ), o.useImperativeHandle(t, () => M.current);
3803
+ const Nt = o.useCallback(
3804
+ () => {
3805
+ Y.current && Y.current.setCustomValidity && Y.current.setCustomValidity(
3806
+ ue.valid ? "" : N === void 0 ? xi : N
3807
+ );
3808
+ },
3809
+ [N, ue]
3810
+ );
3811
+ o.useEffect(Nt), o.useEffect(() => {
3812
+ const y = Me && window.ResizeObserver && new window.ResizeObserver(mt.bind(void 0));
3813
+ return document != null && document.body && y && y.observe(document.body), () => {
3814
+ y && y.disconnect();
3815
+ };
3816
+ }, []), o.useEffect(
3817
+ () => {
3818
+ Q.current && W && Q.current.setPosition(Q.current._popup);
3819
+ },
3820
+ [C, W]
3821
+ );
3822
+ const se = o.useCallback(
3823
+ (y, k, z) => {
3824
+ if (e.onChange) {
3825
+ const ee = {
3826
+ items: k,
3827
+ operation: z,
3828
+ ...y
3829
+ };
3830
+ e.onChange.call(void 0, ee);
3831
+ }
3832
+ },
3833
+ [e.onChange]
3834
+ ), ze = o.useCallback(
3835
+ (y) => {
3836
+ if (R(y.item, C, p) || !M.current)
3837
+ return;
3838
+ const { item: k, nativeEvent: z, syntheticEvent: ee } = y, ye = {
3839
+ syntheticEvent: ee,
3840
+ nativeEvent: z,
3841
+ target: M.current
3842
+ };
3843
+ se(ye, [k], "toggle");
3844
+ },
3845
+ [C, p, se]
3846
+ ), _e = o.useCallback(
3847
+ (y) => {
3848
+ if (!W) {
3849
+ if (u) {
3850
+ const k = { ...y };
3851
+ u.call(void 0, k);
3852
+ }
3853
+ r === void 0 && (H(!0), Pe(C || []), J && setTimeout(() => {
3854
+ var k;
3855
+ Z((k = j.current) == null ? void 0 : k.element);
3856
+ }, 300));
3857
+ }
3858
+ },
3859
+ [W, r, u, J, j]
3860
+ ), q = o.useCallback(
3861
+ (y) => {
3862
+ if (W) {
3863
+ if (g) {
3864
+ const k = { ...y };
3865
+ g.call(void 0, k);
3866
+ }
3867
+ r === void 0 && H(!1);
3868
+ }
3869
+ },
3870
+ [W, r, g]
3871
+ ), he = o.useCallback(
3872
+ (y) => {
3873
+ we.current = !0, y(), window.setTimeout(() => we.current = !1, 0);
3874
+ },
3875
+ []
3876
+ ), Z = o.useCallback(
3877
+ (y) => {
3878
+ y && he(() => y.focus());
3879
+ },
3880
+ [he]
3881
+ ), Ot = o.useCallback(
3882
+ () => {
3883
+ var y;
3884
+ !L && W ? q({ target: M.current }) : e.filterable ? Z((y = U.current) == null ? void 0 : y.element) : Z(re.current && re.current.element);
3885
+ },
3886
+ [L, W, Z, q, e.filterable]
3887
+ ), Pt = o.useCallback(
3888
+ () => {
3889
+ L && Z(K.current);
3890
+ },
3891
+ [L, Z]
3892
+ ), _t = o.useCallback(
3893
+ (y) => {
3894
+ if (!L && !we.current && (me(!0), e.onFocus && M.current)) {
3895
+ const k = {
3896
+ syntheticEvent: y,
3897
+ nativeEvent: y.nativeEvent,
3898
+ target: M.current
3899
+ };
3900
+ e.onFocus.call(void 0, k);
3901
+ }
3902
+ },
3903
+ [L, e.onFocus]
3904
+ ), pt = o.useCallback(
3905
+ (y) => {
3906
+ if (L && !we.current && M.current) {
3907
+ me(!1);
3908
+ const k = {
3909
+ syntheticEvent: y,
3910
+ nativeEvent: y.nativeEvent,
3911
+ target: M.current
3912
+ };
3913
+ if (e.onBlur) {
3914
+ const z = { ...k };
3915
+ e.onBlur.call(void 0, z);
3916
+ }
3917
+ J || q(k);
3918
+ }
3919
+ },
3920
+ [L, e.onBlur, W, r, g]
3921
+ ), ht = o.useCallback(
3922
+ () => {
3923
+ L && he(De);
3924
+ },
3925
+ [L, he]
3926
+ ), ut = o.useCallback(
3927
+ (y) => {
3928
+ if (!y.isDefaultPrevented() && M.current) {
3929
+ me(!0);
3930
+ const k = {
3931
+ syntheticEvent: y,
3932
+ nativeEvent: y.nativeEvent,
3933
+ target: M.current
3934
+ };
3935
+ W || _e(k);
3936
+ }
3937
+ },
3938
+ [W, _e]
3939
+ ), gt = o.useCallback(
3940
+ (y) => {
3941
+ var Ie, ns;
3942
+ const { keyCode: k, altKey: z } = y, ee = re.current && re.current.element;
3943
+ if (!M.current || y.isDefaultPrevented() && ((Ie = U.current) == null ? void 0 : Ie.element) === y.target)
3944
+ return;
3945
+ const ye = {
3946
+ syntheticEvent: y,
3947
+ nativeEvent: y.nativeEvent,
3948
+ target: M.current
3949
+ };
3950
+ if (C && C.length > 0 && (k === f.left || k === f.right || k === f.home || k === f.end || k === f.delete)) {
3951
+ const te = ne.current;
3952
+ let ce = oe ? te.findIndex((xs) => xt(xs, oe, p)) : -1, pe;
3953
+ const Bt = ce !== -1;
3954
+ k === f.left ? (Bt ? ce = Math.max(0, ce - 1) : ce = te.length - 1, pe = te[ce]) : k === f.right ? ce === te.length - 1 ? pe = void 0 : Bt && (ce = Math.min(te.length - 1, ce + 1), pe = te[ce]) : k === f.home ? pe = te[0] : k === f.end ? pe = te[te.length - 1] : k === f.delete && Bt && se(ye, te[ce].data, "delete"), pe !== oe && Le(pe);
3955
+ }
3956
+ if (W)
3957
+ if (k === f.esc || z && k === f.up)
3958
+ y.preventDefault(), q(ye);
3959
+ else if (ee && ee.querySelector(".k-focus") && (k === f.up || k === f.down || k === f.left || k === f.right || k === f.home || k === f.end)) {
3960
+ if (k === f.up && ((ns = U.current) != null && ns.element)) {
3961
+ const te = Array.from(ee.querySelectorAll(".k-treeview-item")), ce = [...te].reverse().find((pe) => !!(pe && pe.querySelector(".k-focus")));
3962
+ if (ce && te.indexOf(ce) === 0)
3963
+ return he(() => {
3964
+ var pe;
3965
+ Z((pe = U.current) == null ? void 0 : pe.element);
3966
+ });
3967
+ }
3968
+ he(De);
3969
+ } else
3970
+ k === f.down && he(() => {
3971
+ var te;
3972
+ Z(((te = U.current) == null ? void 0 : te.element) || ee);
3973
+ });
3974
+ else
3975
+ z && k === f.down && (y.preventDefault(), _e(ye));
3976
+ },
3977
+ [W, q, Z, he, _e, oe, p, C, se]
3978
+ ), Je = o.useCallback(
3979
+ (y) => {
3980
+ const { keyCode: k, altKey: z } = y;
3981
+ z || k !== f.up && k !== f.down || (y.preventDefault(), he(
3982
+ k === f.up ? () => {
3983
+ Z(K.current);
3984
+ } : () => {
3985
+ Z(re.current && re.current.element);
3986
+ }
3987
+ ));
3988
+ },
3989
+ [Z, he]
3990
+ ), Qe = o.useCallback(
3991
+ (y) => {
3992
+ if (!M.current)
3993
+ return;
3994
+ const k = {
3995
+ syntheticEvent: y,
3996
+ nativeEvent: y.nativeEvent,
3997
+ target: M.current
3998
+ };
3999
+ se(k, [], "clear"), q(k), y.preventDefault();
4000
+ },
4001
+ [se, q]
4002
+ ), Rt = o.useCallback(
4003
+ (y, k) => {
4004
+ var z;
4005
+ q({ target: M.current }), L || Z((z = U.current) == null ? void 0 : z.element), se({
4006
+ syntheticEvent: k,
4007
+ nativeEvent: k.nativeEvent,
4008
+ target: M.current
4009
+ }, y, "delete");
4010
+ },
4011
+ [se, q, Z, L]
4012
+ ), Xe = o.useCallback(
4013
+ (y) => {
4014
+ if (e.onExpandChange && M.current) {
4015
+ const { item: k, itemHierarchicalIndex: z, nativeEvent: ee, syntheticEvent: ye } = y, Ie = {
4016
+ level: wi(z),
4017
+ item: k,
4018
+ nativeEvent: ee,
4019
+ syntheticEvent: ye,
4020
+ target: M.current
4021
+ };
4022
+ e.onExpandChange.call(void 0, Ie);
4023
+ }
4024
+ },
4025
+ [e.onExpandChange]
4026
+ ), Ze = o.useCallback(
4027
+ (y) => {
4028
+ if (e.onFilterChange && M.current) {
4029
+ const z = {
4030
+ filter: { field: e.textField, operator: "contains", value: y.target.value },
4031
+ syntheticEvent: y.syntheticEvent,
4032
+ nativeEvent: y.nativeEvent,
4033
+ target: M.current
4034
+ };
4035
+ e.onFilterChange.call(void 0, z), e.filter === void 0 && X(y.target.value);
4036
+ }
4037
+ },
4038
+ [e.onFilterChange, e.filter, e.textField]
4039
+ ), ft = o.useCallback(
4040
+ (y) => {
4041
+ if (!M.current)
4042
+ return;
4043
+ const k = {
4044
+ syntheticEvent: y,
4045
+ nativeEvent: y.nativeEvent,
4046
+ target: M.current
4047
+ };
4048
+ e.onCancel && e.onCancel.call(void 0, k), q(k), y.preventDefault();
4049
+ },
4050
+ [e.onCancel, q]
4051
+ ), et = () => {
4052
+ const y = e.filterable ? /* @__PURE__ */ o.createElement(
4053
+ Be,
4054
+ {
4055
+ value: e.filter === void 0 ? A : e.filter,
4056
+ ref: j,
4057
+ onChange: Ze,
4058
+ onKeyDown: Je,
4059
+ size: ae,
4060
+ rounded: I,
4061
+ fillMode: T
4062
+ }
4063
+ ) : null, k = {
4064
+ adaptiveTitle: e.adaptiveTitle,
4065
+ expand: W,
4066
+ onClose: (z) => e.onCancel ? ft(z) : Qe(z),
4067
+ windowWidth: Ce,
4068
+ mobileFilter: y,
4069
+ footer: {
4070
+ cancelText: be.toLanguageString(ot, le[ot]),
4071
+ onCancel: (z) => e.onCancel ? ft(z) : Qe(z),
4072
+ applyText: be.toLanguageString(nt, le[nt]),
4073
+ onApply: (z) => q(z)
4074
+ }
4075
+ };
4076
+ return /* @__PURE__ */ o.createElement(es, { ...k }, /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ o.createElement("div", { className: "k-list k-list-lg" }, a.length > 0 ? /* @__PURE__ */ o.createElement(
4077
+ Ct,
4078
+ {
4079
+ ref: re,
4080
+ tabIndex: E,
4081
+ data: a,
4082
+ focusIdField: p,
4083
+ textField: e.textField,
4084
+ checkField: w,
4085
+ checkIndeterminateField: S,
4086
+ expandField: e.expandField,
4087
+ childrenField: D,
4088
+ expandIcons: !0,
4089
+ onItemClick: ze,
4090
+ onCheckChange: ze,
4091
+ onExpandChange: Xe,
4092
+ checkboxes: !0,
4093
+ size: ae,
4094
+ item: e.item,
4095
+ dir: ve
4096
+ }
4097
+ ) : /* @__PURE__ */ o.createElement(ge, null, be.toLanguageString(fe, le[fe]))))));
4098
+ }, mt = o.useCallback(
4099
+ (y) => {
4100
+ for (let k of y)
4101
+ Ne(k.target.clientWidth);
4102
+ },
4103
+ []
4104
+ ), ge = e.listNoData || ks, be = vs(), Ee = !x || ue.valid, { size: ae, rounded: I, fillMode: T } = e, $ = J && W ? Oe : ne.current, de = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
4105
+ "span",
4106
+ {
4107
+ className: B("k-multiselecttree k-input", e.className, {
4108
+ [`k-input-${us[ae] || ae}`]: ae,
4109
+ [`k-rounded-${Si[I] || I}`]: I,
4110
+ [`k-input-${T}`]: T,
4111
+ "k-focus": L && !h,
4112
+ "k-invalid": !Ee,
4113
+ "k-disabled": h,
4114
+ "k-loading": e.loading,
4115
+ "k-required": F
4116
+ }),
4117
+ tabIndex: E,
4118
+ accessKey: e.accessKey,
4119
+ id: n,
4120
+ style: v ? { ...d, width: void 0 } : d,
4121
+ dir: ve,
4122
+ ref: K,
4123
+ onKeyDown: h ? void 0 : gt,
4124
+ onMouseDown: ht,
4125
+ onFocus: _t,
4126
+ onBlur: pt,
4127
+ role: "combobox",
4128
+ "aria-haspopup": "tree",
4129
+ "aria-expanded": W,
4130
+ "aria-disabled": h,
4131
+ "aria-label": v,
4132
+ "aria-labelledby": e.ariaLabelledBy,
4133
+ "aria-describedby": e.ariaDescribedBy ? e.ariaDescribedBy : "tagslist-" + n,
4134
+ "aria-required": e.required,
4135
+ onClick: h ? void 0 : ut
4136
+ },
4137
+ /* @__PURE__ */ o.createElement(
4138
+ "div",
4139
+ {
4140
+ id: "tagslist-" + n,
4141
+ className: B("k-input-values k-chip-list k-selection-multiple", {
4142
+ [`k-chip-list-${us[ae] || ae}`]: ae
4143
+ })
4144
+ },
4145
+ $.length > 0 ? /* @__PURE__ */ o.createElement(
4146
+ ys,
4147
+ {
4148
+ tag: e.tag,
4149
+ onTagDelete: Rt,
4150
+ data: $,
4151
+ guid: n,
4152
+ focused: oe ? ne.current.find((y) => xt(y, oe, p)) : void 0,
4153
+ size: ae
4154
+ }
4155
+ ) : m
4156
+ ),
4157
+ /* @__PURE__ */ o.createElement("span", { className: "k-input-inner" }, /* @__PURE__ */ o.createElement("span", { className: "k-input-value-text" }, " ")),
4158
+ e.loading && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
4159
+ Ye && !h && $.length > 0 && /* @__PURE__ */ o.createElement(rt, { onClick: Qe }),
4160
+ /* @__PURE__ */ o.createElement(
4161
+ "select",
4162
+ {
4163
+ name: b,
4164
+ ref: Y,
4165
+ tabIndex: -1,
4166
+ "aria-hidden": !0,
4167
+ title: v,
4168
+ style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
4169
+ },
4170
+ /* @__PURE__ */ o.createElement(
4171
+ "option",
4172
+ {
4173
+ value: e.valueMap ? e.valueMap.call(void 0, C) : C
4174
+ }
4175
+ )
4176
+ ),
4177
+ !J && /* @__PURE__ */ o.createElement(
4178
+ jt,
4179
+ {
4180
+ popupClass: B(
4181
+ c.popupClass,
4182
+ "k-multiselecttree-popup"
4183
+ ),
4184
+ className: B(c.className, { "k-rtl": ve === "rtl" }),
4185
+ style: ct,
4186
+ animate: c.animate,
4187
+ anchor: K.current,
4188
+ show: W,
4189
+ onOpen: Ot,
4190
+ onClose: Pt,
4191
+ appendTo: c.appendTo,
4192
+ ref: Q
4193
+ },
4194
+ e.filterable && /* @__PURE__ */ o.createElement(
4195
+ Be,
4196
+ {
4197
+ value: e.filter === void 0 ? A : e.filter,
4198
+ ref: U,
4199
+ onChange: Ze,
4200
+ onKeyDown: Je,
4201
+ tabIndex: E,
4202
+ size: ae,
4203
+ rounded: I,
4204
+ fillMode: T
4205
+ }
4206
+ ),
4207
+ a.length > 0 ? /* @__PURE__ */ o.createElement(
4208
+ Ct,
4209
+ {
4210
+ ref: re,
4211
+ tabIndex: E,
4212
+ data: a,
4213
+ focusIdField: p,
4214
+ textField: e.textField,
4215
+ checkField: w,
4216
+ checkIndeterminateField: S,
4217
+ expandField: e.expandField,
4218
+ childrenField: D,
4219
+ expandIcons: !0,
4220
+ onItemClick: ze,
4221
+ onCheckChange: ze,
4222
+ onExpandChange: Xe,
4223
+ checkboxes: !0,
4224
+ size: ae,
4225
+ item: e.item,
4226
+ dir: ve
4227
+ }
4228
+ ) : /* @__PURE__ */ o.createElement(ge, null, be.toLanguageString(fe, le[fe]))
4229
+ )
4230
+ ), J && et());
4231
+ return v ? /* @__PURE__ */ o.createElement(
4232
+ Ge,
4233
+ {
4234
+ label: v,
4235
+ editorValue: Ye,
4236
+ editorPlaceholder: m,
4237
+ editorValid: Ee,
4238
+ editorDisabled: h,
4239
+ editorId: n,
4240
+ style: { width: d ? d.width : void 0 },
4241
+ children: de,
4242
+ dir: ve
4243
+ }
4244
+ ) : de;
4245
+ }), Ti = {
4246
+ opened: l.bool,
4247
+ disabled: l.bool,
4248
+ dir: l.string,
4249
+ tabIndex: l.number,
4250
+ accessKey: l.string,
4251
+ data: l.array,
4252
+ value: l.any,
4253
+ valueMap: l.func,
4254
+ placeholder: l.string,
4255
+ dataItemKey: l.string.isRequired,
4256
+ textField: l.string.isRequired,
4257
+ checkField: l.string,
4258
+ checkIndeterminateField: l.string,
4259
+ expandField: l.string,
4260
+ subItemsField: l.string,
4261
+ className: l.string,
4262
+ style: l.object,
4263
+ label: l.string,
4264
+ validationMessage: l.string,
4265
+ validityStyles: l.bool,
4266
+ valid: l.bool,
4267
+ required: l.bool,
4268
+ name: l.string,
4269
+ id: l.string,
4270
+ ariaLabelledBy: l.string,
4271
+ ariaDescribedBy: l.string,
4272
+ filterable: l.bool,
4273
+ filter: l.string,
4274
+ loading: l.bool,
4275
+ tags: l.arrayOf(l.shape({
4276
+ text: l.string,
4277
+ data: l.arrayOf(l.any)
4278
+ })),
4279
+ popupSettings: l.shape({
4280
+ animate: l.oneOfType([l.bool, l.shape({
4281
+ openDuration: l.number,
4282
+ closeDuration: l.number
4283
+ })]),
4284
+ popupClass: l.string,
4285
+ className: l.string,
4286
+ appendTo: l.any,
4287
+ width: l.oneOfType([l.string, l.number]),
4288
+ height: l.oneOfType([l.string, l.number])
4289
+ }),
4290
+ onOpen: l.func,
4291
+ onClose: l.func,
4292
+ onFocus: l.func,
4293
+ onBlur: l.func,
4294
+ onChange: l.func,
4295
+ onFilterChange: l.func,
4296
+ onExpandChange: l.func,
4297
+ onCancel: l.func,
4298
+ item: l.func,
4299
+ listNoData: l.func,
4300
+ adaptiveTitle: l.string,
4301
+ adaptive: l.bool
4302
+ };
4303
+ ss.displayName = "KendoReactMultiSelectTree";
4304
+ ss.defaultProps = Re;
4305
+ ss.propTypes = Ti;
4306
+ const tt = (i, t) => {
4307
+ const e = {};
4308
+ return i && i.length && i.forEach((s) => {
4309
+ e[t(s)] = !0;
4310
+ }), e;
4311
+ }, Ki = (i, t) => {
4312
+ const {
4313
+ items: e,
4314
+ dataItemKey: s,
4315
+ value: n,
4316
+ subItemsField: a = "items",
4317
+ operation: p
4318
+ } = t, c = kt(s), d = tt(n, c);
4319
+ if (p === "clear")
4320
+ return [];
4321
+ if (p === "delete") {
4322
+ const O = tt(e, c);
4323
+ return n.filter((_) => !O[c(_)]);
4324
+ }
4325
+ const r = e[0], h = c(r), u = kt(a), g = [...i], m = [];
4326
+ let v = [], b;
4327
+ for (; g.length; ) {
4328
+ const O = g.pop();
4329
+ if (h === c(O)) {
4330
+ v = m.map((_) => _.item), b = O;
4331
+ break;
4332
+ } else {
4333
+ m && m.length && m[m.length - 1].parentPosition === g.length && m.pop();
4334
+ const _ = u(O);
4335
+ _ && _.length && (m.push({ item: O, parentPosition: g.length }), g.push(..._));
4336
+ }
4337
+ }
4338
+ const w = [...u(b) || []];
4339
+ let S = [];
4340
+ for (; w.length; ) {
4341
+ const O = w.pop();
4342
+ S.push(O);
4343
+ const _ = u(O);
4344
+ _ && _.length && w.push(..._);
4345
+ }
4346
+ const D = !d[h], N = [];
4347
+ if (D) {
4348
+ N.push(...n), N.push(b), N.push(...S.filter((C) => !d[c(C)]));
4349
+ const O = v.filter((C) => !d[c(C)]), _ = tt(N, c);
4350
+ for (let C = O.length - 1; C > -1; C--) {
4351
+ const F = O[C], x = u(F);
4352
+ if (x.filter((M) => _[c(M)]).length < x.length)
4353
+ break;
4354
+ N.push(F), _[c(F)] = !0;
4355
+ }
4356
+ } else {
4357
+ const O = c(b), _ = tt(S, c), C = tt(v, c);
4358
+ N.push(
4359
+ ...n.filter((F) => {
4360
+ const x = c(F);
4361
+ return !_[x] && O !== x && !C[x];
4362
+ })
4363
+ );
4364
+ }
4365
+ return N;
4366
+ };
4367
+ export {
4368
+ oi as AutoComplete,
4369
+ ni as AutoCompletePropsContext,
4370
+ Tt as AutoCompleteWithoutContext,
4371
+ bs as ComboBox,
4372
+ ti as ComboBoxPropsContext,
4373
+ dt as ComboBoxWithoutContext,
4374
+ Xs as DropDownList,
4375
+ Qs as DropDownListPropsContext,
4376
+ Dt as DropDownListWithoutContext,
4377
+ Cs as DropDownTree,
4378
+ ki as DropDownTreePropsContext,
4379
+ Ue as List,
4380
+ Et as ListContainer,
4381
+ Be as ListFilter,
4382
+ qs as ListItem,
4383
+ ts as MultiColumnComboBox,
4384
+ gi as MultiColumnComboBoxPropsContext,
4385
+ pi as MultiSelect,
4386
+ ci as MultiSelectPropsContext,
4387
+ ss as MultiSelectTree,
4388
+ Di as MultiSelectTreePropsContext,
4389
+ Ft as MultiSelectWithoutContext,
4390
+ Zt as SearchBar,
4391
+ ys as TagList,
4392
+ le as dropdownsMessages,
4393
+ Ki as getMultiSelectTreeValue,
4394
+ tt as getValueMap,
4395
+ fe as nodata,
4396
+ Ks as scrollToItem
4397
+ };