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

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