@progress/kendo-react-dropdowns 11.0.0-develop.3 → 11.0.0-develop.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,452 +5,430 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as i from "react";
9
- import E from "prop-types";
10
- import { usePropsContext as Yt, validatePackage as $t, useUnstyled as jt, useId as Jt, canUseDOM as nt, useAdaptiveModeContext as Qt, classNames as C, uDropDownList as L, getTabIndex as Xt, IconWrap as Zt, svgIconPropType as Rt, createPropsContext as en, Keys as w, uDropDownsActionSheet as j, WatermarkOverlay as tn } from "@progress/kendo-react-common";
11
- import { FloatingLabel as nn } from "@progress/kendo-react-labels";
12
- import { caretAltDownIcon as rn, checkIcon as on } from "@progress/kendo-svg-icons";
8
+ import * as s from "react";
9
+ import C from "prop-types";
10
+ import { usePropsContext as Yt, validatePackage as jt, useUnstyled as Jt, useId as Qt, canUseDOM as tt, useAdaptiveModeContext as Xt, classNames as L, uDropDownList as P, getTabIndex as Zt, IconWrap as Rt, svgIconPropType as en, createPropsContext as tn, Keys as I, WatermarkOverlay as nn, sizeMap as rn } from "@progress/kendo-react-common";
11
+ import { FloatingLabel as on } from "@progress/kendo-react-labels";
12
+ import { caretAltDownIcon as sn } from "@progress/kendo-svg-icons";
13
13
  import an from "../common/ListContainer.mjs";
14
- import sn from "../common/ListFilter.mjs";
15
- import rt from "../common/GroupStickyHeader.mjs";
16
- import ln from "../common/ListDefaultItem.mjs";
17
- import dn from "../common/List.mjs";
14
+ import ln from "../common/ListFilter.mjs";
15
+ import nt from "../common/GroupStickyHeader.mjs";
16
+ import dn from "../common/ListDefaultItem.mjs";
17
+ import cn from "../common/List.mjs";
18
18
  import lt from "../common/DropDownBase.mjs";
19
- import { getFilteredData as b, areSame as M, getItemValue as fe, isPresent as ot, itemIndexStartsWith as cn, sameCharsOnly as un, shuffleData as pn, matchText as it } from "../common/utils.mjs";
20
- import { packageMetadata as mn } from "../package-metadata.mjs";
21
- import { Button as at } from "@progress/kendo-react-buttons";
22
- import { useLocalization as fn } from "@progress/kendo-react-intl";
23
- import { dropDownListArrowBtnAriaLabel as st, messages as vn } from "../messages/index.mjs";
24
- import { ActionSheet as gn, ActionSheetHeader as hn, ActionSheetContent as In } from "@progress/kendo-react-layout";
25
- const yn = "Please select a value from the list!", Ke = i.forwardRef((dt, ct) => {
26
- let Te = !1;
19
+ import { getFilteredData as E, areSame as M, getItemValue as te, isPresent as rt, itemIndexStartsWith as un, sameCharsOnly as pn, shuffleData as mn, matchText as ot } from "../common/utils.mjs";
20
+ import { packageMetadata as fn } from "../package-metadata.mjs";
21
+ import { Button as gn } from "@progress/kendo-react-buttons";
22
+ import { useLocalization as vn } from "@progress/kendo-react-intl";
23
+ import { dropDownListArrowBtnAriaLabel as it, messages as st, dropDownListAdaptiveFilterPlaceholder as at } from "../messages/index.mjs";
24
+ import { ActionSheetContent as In } from "@progress/kendo-react-layout";
25
+ import { AdaptiveMode as hn } from "../common/AdaptiveMode.mjs";
26
+ const yn = "Please select a value from the list!", Fe = s.forwardRef((dt, ct) => {
27
+ let Ke = !1;
27
28
  const n = Yt(wn, dt), {
28
29
  delay: ut = T.delay,
29
30
  tabIndex: pt = T.tabIndex,
30
- ignoreCase: ve = T.ignoreCase,
31
- size: ne = T.size,
32
- rounded: ze = T.rounded,
33
- fillMode: ge = T.fillMode,
31
+ ignoreCase: pe = T.ignoreCase,
32
+ size: O = T.size,
33
+ rounded: Ne = T.rounded,
34
+ fillMode: me = T.fillMode,
34
35
  groupMode: Dn = T.groupMode
35
36
  } = n;
36
37
  if (n.filterable || n.virtual) {
37
38
  const e = [];
38
- n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"), Te = !$t(mn, {
39
+ n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"), Ke = !jt(fn, {
39
40
  component: "DropDownList",
40
41
  features: e
41
42
  });
42
43
  }
43
- const N = jt(), he = Jt(n.id), Ie = () => {
44
+ const F = Jt(), fe = Qt(n.id), ge = () => {
44
45
  var e;
45
- if (nt)
46
- return ((e = Q.current) == null ? void 0 : e.ownerDocument) || window.document;
46
+ if (tt)
47
+ return ((e = J.current) == null ? void 0 : e.ownerDocument) || window.document;
47
48
  }, mt = () => {
48
49
  var e, r;
49
50
  (e = t == null ? void 0 : t.current) != null && e.wrapper && ((r = t == null ? void 0 : t.current) == null || r.wrapper.focus({ preventScroll: !0 }));
50
51
  }, k = () => {
51
52
  let e;
52
- return A.current !== void 0 && A.current !== null ? e = A.current : n.value !== void 0 ? e = n.value : p.value !== void 0 && p.value !== null ? e = p.value : n.defaultValue !== void 0 && n.defaultValue !== null && (e = n.defaultValue), !ot(e) && n.defaultItem !== void 0 && n.defaultItem !== null && (e = n.defaultItem), e;
53
+ return H.current !== void 0 && H.current !== null ? e = H.current : n.value !== void 0 ? e = n.value : p.value !== void 0 && p.value !== null ? e = p.value : n.defaultValue !== void 0 && n.defaultValue !== null && (e = n.defaultValue), !rt(e) && n.defaultItem !== void 0 && n.defaultItem !== null && (e = n.defaultItem), e;
53
54
  }, ft = () => {
54
- const { dataItemKey: e } = n, r = b(n), a = k();
55
- return r.findIndex((c) => M(c, a, e));
56
- }, ye = () => n.required !== void 0 ? n.required : T.required, we = () => {
57
- const e = n.validationMessage !== void 0, r = k(), a = !ye() || r !== null && r !== "" && r !== void 0, c = n.valid !== void 0 ? n.valid : a;
55
+ const { dataItemKey: e } = n, r = E(n), o = k();
56
+ return r.findIndex((l) => M(l, o, e));
57
+ }, ve = () => n.required !== void 0 ? n.required : T.required, Ie = () => {
58
+ const e = n.validationMessage !== void 0, r = k(), o = !ve() || r !== null && r !== "" && r !== void 0, l = n.valid !== void 0 ? n.valid : o;
58
59
  return {
59
60
  customError: e,
60
- valid: c,
61
+ valid: l,
61
62
  valueMissing: r === null
62
63
  };
63
- }, vt = () => n.validityStyles !== void 0 ? n.validityStyles : T.validityStyles, re = (e) => {
64
- oe.current = !0, e.focus(), window.setTimeout(() => oe.current = !1, 30);
65
- }, De = () => {
66
- X.current && re(X.current), n.adaptive && setTimeout(() => {
67
- X.current && re(X.current);
64
+ }, gt = () => n.validityStyles !== void 0 ? n.validityStyles : T.validityStyles, ne = (e) => {
65
+ re.current = !0, e.focus(), window.setTimeout(() => re.current = !1, 30);
66
+ }, he = () => {
67
+ Q.current && ne(Q.current), n.adaptive && setTimeout(() => {
68
+ Q.current && ne(Q.current);
68
69
  }, 300);
69
- }, gt = i.useCallback((e) => {
70
+ }, vt = s.useCallback((e) => {
70
71
  for (const r of e)
71
- Tt(r.target.clientWidth);
72
- }, []), Oe = () => {
72
+ Ot(r.target.clientWidth);
73
+ }, []), Te = () => {
73
74
  var e;
74
- (e = Ee.current) != null && e.setCustomValidity && Ee.current.setCustomValidity(
75
- we().valid ? "" : n.validationMessage || yn
75
+ (e = xe.current) != null && e.setCustomValidity && xe.current.setCustomValidity(
76
+ Ie().valid ? "" : n.validationMessage || yn
76
77
  );
77
- }, q = (e, r) => {
78
- const a = k();
79
- M(a, e, n.dataItemKey) || (n.value === void 0 && (r.data.value = e), t.current.updateComponentArgs({ value: e }), A.current = e, r.events.push({ type: "onChange" }));
80
- }, F = (e) => {
78
+ }, U = (e, r) => {
79
+ const o = k();
80
+ M(o, e, n.dataItemKey) || (n.value === void 0 && (r.data.value = e), t.current.updateComponentArgs({ value: e }), H.current = e, r.events.push({ type: "onChange" }));
81
+ }, K = (e) => {
81
82
  var r;
82
- (r = t == null ? void 0 : t.current) == null || r.applyState(e), A.current = void 0;
83
- }, J = (e, r) => {
84
- var l;
85
- const { virtual: a, dataItemKey: c, defaultItem: u } = n, m = b(n), v = a ? a.skip : 0, f = k(), o = e === -1 && u !== void 0 ? u : m[e - v], d = !M(o, f, c);
86
- q(o, r), d && ((l = t == null ? void 0 : t.current) == null || l.triggerPageChangeCornerItems(o, r));
87
- }, O = (e, r, a) => {
88
- var I, h;
89
- const { defaultItem: c, dataItemKey: u, virtual: m = { skip: 0, total: 0, pageSize: 0 } } = n, v = k(), f = b(n), o = (I = t == null ? void 0 : t.current) == null ? void 0 : I.vs, d = f.findIndex((y) => M(y, v, u)), l = (h = t == null ? void 0 : t.current) == null ? void 0 : h.navigation.navigate({
90
- current: m.skip + d,
91
- max: (o != null && o.enabled ? m.total : f.length) - 1,
92
- min: c !== void 0 ? -1 : 0,
83
+ (r = t == null ? void 0 : t.current) == null || r.applyState(e), H.current = void 0;
84
+ }, j = (e, r) => {
85
+ var c;
86
+ const { virtual: o, dataItemKey: l, defaultItem: d } = n, u = E(n), g = o ? o.skip : 0, m = k(), i = e === -1 && d !== void 0 ? d : u[e - g], f = !M(i, m, l);
87
+ U(i, r), f && ((c = t == null ? void 0 : t.current) == null || c.triggerPageChangeCornerItems(i, r));
88
+ }, V = (e, r, o) => {
89
+ var x, h;
90
+ const { defaultItem: l, dataItemKey: d, virtual: u = { skip: 0, total: 0, pageSize: 0 } } = n, g = k(), m = E(n), i = (x = t == null ? void 0 : t.current) == null ? void 0 : x.vs, f = m.findIndex((w) => M(w, g, d)), c = (h = t == null ? void 0 : t.current) == null ? void 0 : h.navigation.navigate({
91
+ current: u.skip + f,
92
+ max: (i != null && i.enabled ? u.total : m.length) - 1,
93
+ min: l !== void 0 ? -1 : 0,
93
94
  keyCode: r,
94
- skipItems: a || void 0
95
+ skipItems: o || void 0
95
96
  });
96
- l !== void 0 && J(l, e), F(e);
97
- }, ht = (e) => {
98
- Q.current = e, t.current.wrapper = e;
99
- }, It = (e) => /* @__PURE__ */ i.createElement(
97
+ c !== void 0 && j(c, e), K(e);
98
+ }, It = (e) => {
99
+ J.current = e, t.current.wrapper = e;
100
+ }, ht = (e) => /* @__PURE__ */ s.createElement(
100
101
  "select",
101
102
  {
102
103
  name: n.name,
103
104
  ref: (r) => {
104
- Ee.current = r;
105
+ xe.current = r;
105
106
  },
106
107
  tabIndex: -1,
107
108
  "aria-hidden": !0,
108
109
  title: n.label,
109
110
  style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
110
111
  },
111
- /* @__PURE__ */ i.createElement("option", { value: n.valueMap ? n.valueMap.call(void 0, e) : e })
112
- ), Se = () => {
112
+ /* @__PURE__ */ s.createElement("option", { value: n.valueMap ? n.valueMap.call(void 0, e) : e })
113
+ ), ye = () => {
113
114
  const {
114
115
  textField: e,
115
116
  dataItemKey: r,
116
- virtual: a = { skip: 0 },
117
- focusedItemIndex: c = cn,
118
- filterable: u,
119
- skipDisabledItems: m = !0
120
- } = n, v = k(), f = b(n), o = n.filter ? n.filter : p.text;
121
- return m && e && !o && !v ? f.findIndex((d) => !d.disabled && d[e]) : ot(v) && o === void 0 || u && o === "" ? f.findIndex((d) => M(d, v, r)) : o ? ke.current ? c(f, o, e) : f.findIndex((d) => M(d, v, r)) : a.skip === 0 ? 0 : -1;
122
- }, Ae = (e, r) => r !== void 0 && r !== -1 && e && e.length > 0 && e[r].disabled, xe = () => {
123
- const e = b(n), r = t.current.initState(), a = Se();
124
- Ae(e, a) && (q(null, r), F(r));
125
- }, Ce = (e) => {
117
+ virtual: o = { skip: 0 },
118
+ focusedItemIndex: l = un,
119
+ filterable: d,
120
+ skipDisabledItems: u = !0
121
+ } = n, g = k(), m = E(n), i = n.filter ? n.filter : p.text;
122
+ return u && e && !i && !g ? m.findIndex((f) => !f.disabled && f[e]) : rt(g) && i === void 0 || d && i === "" ? m.findIndex((f) => M(f, g, r)) : i ? Se.current ? l(m, i, e) : m.findIndex((f) => M(f, g, r)) : o.skip === 0 ? 0 : -1;
123
+ }, ze = (e, r) => r !== void 0 && r !== -1 && e && e.length > 0 && e[r].disabled, we = () => {
124
+ const e = E(n), r = t.current.initState(), o = ye();
125
+ ze(e, o) && (U(null, r), K(r));
126
+ }, De = (e) => {
126
127
  if (e.isPropagationStopped())
127
128
  return;
128
129
  const r = t.current.initState();
129
- r.syntheticEvent = e, p.focused || (r.data.focused = !0), xe(), t.current.togglePopup(r), F(r);
130
- }, He = (e) => {
131
- var z, pe, W, me, $, et, tt;
130
+ r.syntheticEvent = e, p.focused || (r.data.focused = !0), we(), t.current.togglePopup(r), K(r);
131
+ }, Oe = (e) => {
132
+ var z, ce, q, ue, Y, Re, et;
132
133
  e && e.target instanceof Element && e.target.nodeName === "INPUT" && e.stopPropagation && e.stopPropagation();
133
134
  const {
134
135
  filterable: r,
135
- disabled: a,
136
- defaultItem: c,
137
- leftRightKeysNavigation: u = !0,
138
- virtual: m = { skip: 0, total: 0, pageSize: 0 },
139
- dataItemKey: v,
140
- groupField: f = "",
141
- textField: o,
142
- skipDisabledItems: d = !0
143
- } = n, l = b(n), I = k(), h = l.findIndex((x) => M(x, I, v)), y = n.opened !== void 0 ? n.opened : p.opened, s = e.keyCode, K = s === w.home || s === w.end, P = s === w.up || s === w.down, Y = !y && (e.altKey && s === w.down || s === w.enter || s === w.space), te = y && (e.altKey && s === w.up || s === w.esc), ce = u && (s === w.left || s === w.right), ue = P || ce && !r || K, S = t.current.initState();
144
- if (S.syntheticEvent = e, !a) {
145
- if (K && ((z = t == null ? void 0 : t.current) != null && z.vs.enabled))
146
- s === w.home ? m.skip !== 0 ? ((pe = t == null ? void 0 : t.current) == null || pe.triggerOnPageChange(S, 0, m.pageSize), H.current = !0) : q(l[0], S) : m.skip < m.total - m.pageSize ? ((W = t == null ? void 0 : t.current) == null || W.triggerOnPageChange(
147
- S,
148
- m.total - m.pageSize,
149
- m.pageSize
150
- ), H.current = !0) : q(l[l.length - 1], S);
151
- else if (y && s === w.pageUp)
152
- e.preventDefault(), (me = t == null ? void 0 : t.current) == null || me.scrollPopupByPageSize(-1);
153
- else if (y && s === w.pageDown)
154
- e.preventDefault(), ($ = t == null ? void 0 : t.current) == null || $.scrollPopupByPageSize(1);
155
- else if (y && s === w.enter) {
156
- const x = Se();
157
- Ae(l, x) ? (q(null, S), F(S)) : J(x, S), (et = t == null ? void 0 : t.current) == null || et.togglePopup(S), e.preventDefault();
158
- } else if (Y || te)
159
- te && xe(), (tt = t == null ? void 0 : t.current) == null || tt.togglePopup(S), e.preventDefault();
160
- else if (ue) {
161
- if (ke.current = !1, f !== "" && o)
162
- if (!d && y)
163
- O(S, s);
136
+ disabled: o,
137
+ defaultItem: l,
138
+ leftRightKeysNavigation: d = !0,
139
+ virtual: u = { skip: 0, total: 0, pageSize: 0 },
140
+ dataItemKey: g,
141
+ groupField: m = "",
142
+ textField: i,
143
+ skipDisabledItems: f = !0
144
+ } = n, c = E(n), x = k(), h = c.findIndex((S) => M(S, x, g)), w = n.opened !== void 0 ? n.opened : p.opened, a = e.keyCode, N = a === I.home || a === I.end, b = a === I.up || a === I.down, $ = !w && (e.altKey && a === I.down || a === I.enter || a === I.space), ee = w && (e.altKey && a === I.up || a === I.esc), le = d && (a === I.left || a === I.right), de = b || le && !r || N, D = t.current.initState();
145
+ if (D.syntheticEvent = e, !o) {
146
+ if (N && ((z = t == null ? void 0 : t.current) != null && z.vs.enabled))
147
+ a === I.home ? u.skip !== 0 ? ((ce = t == null ? void 0 : t.current) == null || ce.triggerOnPageChange(D, 0, u.pageSize), A.current = !0) : U(c[0], D) : u.skip < u.total - u.pageSize ? ((q = t == null ? void 0 : t.current) == null || q.triggerOnPageChange(
148
+ D,
149
+ u.total - u.pageSize,
150
+ u.pageSize
151
+ ), A.current = !0) : U(c[c.length - 1], D);
152
+ else if (w && a === I.pageUp)
153
+ e.preventDefault(), (ue = t == null ? void 0 : t.current) == null || ue.scrollPopupByPageSize(-1);
154
+ else if (w && a === I.pageDown)
155
+ e.preventDefault(), (Y = t == null ? void 0 : t.current) == null || Y.scrollPopupByPageSize(1);
156
+ else if (w && a === I.enter) {
157
+ const S = ye();
158
+ ze(c, S) ? (U(null, D), K(D)) : j(S, D), (Re = t == null ? void 0 : t.current) == null || Re.togglePopup(D), e.preventDefault();
159
+ } else if ($ || ee)
160
+ ee && we(), (et = t == null ? void 0 : t.current) == null || et.togglePopup(D), e.preventDefault();
161
+ else if (de) {
162
+ if (Se.current = !1, m !== "" && i)
163
+ if (!f && w)
164
+ V(D, a);
164
165
  else {
165
- let x;
166
- if (s === w.down || s === w.right) {
167
- const D = l.slice(h + 1).find((g) => !g.disabled && g[o]);
168
- x = D && l.findIndex((g) => g[o] === D[o]);
169
- } else if (s === w.up || s === w.left) {
170
- let D;
171
- if (h === 0 && c)
172
- x = -1;
166
+ let S;
167
+ if (a === I.down || a === I.right) {
168
+ const y = c.slice(h + 1).find((v) => !v.disabled && v[i]);
169
+ S = y && c.findIndex((v) => v[i] === y[i]);
170
+ } else if (a === I.up || a === I.left) {
171
+ let y;
172
+ if (h === 0 && l)
173
+ S = -1;
173
174
  else if (h === -1)
174
- D = l, x = l.findIndex((g) => !g.disabled && g[o]);
175
+ y = c, S = c.findIndex((v) => !v.disabled && v[i]);
175
176
  else {
176
- D = l.slice(0, h);
177
- let g = D.pop();
178
- for (; g && g.disabled; )
179
- g = D.pop();
180
- x = g && l.findIndex((Fe) => Fe[o] === g[o]);
177
+ y = c.slice(0, h);
178
+ let v = y.pop();
179
+ for (; v && v.disabled; )
180
+ v = y.pop();
181
+ S = v && c.findIndex((Me) => Me[i] === v[i]);
181
182
  }
182
183
  }
183
- if (x !== void 0) {
184
- const D = x - h;
185
- O(S, s, D);
186
- } else x === void 0 && l.findIndex((D) => D[o] === I[o]) === l.length - 1 && O(S, s);
184
+ if (S !== void 0) {
185
+ const y = S - h;
186
+ V(D, a, y);
187
+ } else S === void 0 && c.findIndex((y) => y[i] === x[i]) === c.length - 1 && V(D, a);
187
188
  }
188
- else if (!d && y || K)
189
- O(S, s);
190
- else if (o) {
191
- let x;
192
- if (s === w.down || s === w.right) {
193
- const D = l.slice(h + 1).find((g) => !g.disabled && g[o]);
194
- x = D && l.findIndex((g) => g[o] === D[o]);
195
- } else if (s === w.up || s === w.left) {
196
- let D;
197
- if (h === 0 && c)
198
- x = -1;
189
+ else if (!f && w || N)
190
+ V(D, a);
191
+ else if (i) {
192
+ let S;
193
+ if (a === I.down || a === I.right) {
194
+ const y = c.slice(h + 1).find((v) => !v.disabled && v[i]);
195
+ S = y && c.findIndex((v) => v[i] === y[i]);
196
+ } else if (a === I.up || a === I.left) {
197
+ let y;
198
+ if (h === 0 && l)
199
+ S = -1;
199
200
  else if (h === -1)
200
- D = l, x = l.find((g) => !g.disabled && g[o]);
201
+ y = c, S = c.find((v) => !v.disabled && v[i]);
201
202
  else {
202
- D = l.slice(0, h);
203
- let g = D.pop();
204
- for (; g && g.disabled; )
205
- g = D.pop();
206
- x = g && l.findIndex((Fe) => Fe[o] === g[o]);
203
+ y = c.slice(0, h);
204
+ let v = y.pop();
205
+ for (; v && v.disabled; )
206
+ v = y.pop();
207
+ S = v && c.findIndex((Me) => Me[i] === v[i]);
207
208
  }
208
209
  }
209
- if (x !== void 0) {
210
- const D = x - h;
211
- O(S, s, D);
212
- } else x === void 0 && l.findIndex((D) => D[o] === I[o]) === l.length - 1 && O(S, s);
210
+ if (S !== void 0) {
211
+ const y = S - h;
212
+ V(D, a, y);
213
+ } else S === void 0 && c.findIndex((y) => y[i] === x[i]) === c.length - 1 && V(D, a);
213
214
  } else
214
- O(S, s);
215
+ V(D, a);
215
216
  e.preventDefault();
216
217
  }
217
- F(S);
218
+ K(D);
218
219
  }
219
220
  }, yt = (e) => {
220
221
  const r = t.current.initState();
221
- r.syntheticEvent = e.syntheticEvent, n.filter === void 0 && (r.data.text = e.target.value), t.current.filterChanged(e.target.value, r), ke.current = !0, F(r), R({ group: void 0, text: String(e.target.value) });
222
- }, Ve = () => {
223
- const e = n.filter !== void 0 ? n.filter : p.text;
224
- return n.filterable && /* @__PURE__ */ i.createElement(
225
- sn,
222
+ r.syntheticEvent = e.syntheticEvent, n.filter === void 0 && (r.data.text = e.target.value), t.current.filterChanged(e.target.value, r), Se.current = !0, K(r), Z({ group: void 0, text: String(e.target.value) });
223
+ }, Ve = (e) => {
224
+ const r = n.filter !== void 0 ? n.filter : p.text;
225
+ return n.filterable && /* @__PURE__ */ s.createElement(
226
+ ln,
226
227
  {
227
- value: e,
228
- ref: (r) => {
229
- X.current = r && r.element;
228
+ value: r,
229
+ ref: (o) => {
230
+ Q.current = o && o.element;
230
231
  },
231
232
  onChange: yt,
232
- onKeyDown: He,
233
- size: ne,
234
- rounded: ze,
235
- fillMode: ge,
236
- renderListFilterWrapper: !0
233
+ onKeyDown: Oe,
234
+ size: e ? "large" : O,
235
+ rounded: Ne,
236
+ fillMode: me,
237
+ renderListFilterWrapper: !0,
238
+ placeholder: Ue.toLanguageString(
239
+ at,
240
+ st[at]
241
+ )
237
242
  }
238
243
  );
239
244
  }, wt = (e) => {
240
- var a;
245
+ var o;
241
246
  const r = t.current.initState();
242
- r.syntheticEvent = e, (a = t == null ? void 0 : t.current) == null || a.togglePopup(r), q(n.defaultItem, r), F(r);
243
- }, Be = () => {
244
- const { textField: e, defaultItem: r, dataItemKey: a } = n, c = k();
245
- return r !== void 0 && /* @__PURE__ */ i.createElement(
246
- ln,
247
+ r.syntheticEvent = e, (o = t == null ? void 0 : t.current) == null || o.togglePopup(r), U(n.defaultItem, r), K(r);
248
+ }, Dt = () => {
249
+ const { textField: e, defaultItem: r, dataItemKey: o } = n, l = k();
250
+ return r !== void 0 && /* @__PURE__ */ s.createElement(
251
+ dn,
247
252
  {
248
253
  defaultItem: r,
249
254
  textField: e,
250
- selected: M(c, r, a),
255
+ selected: M(l, r, o),
251
256
  key: "defaultitemkey",
252
257
  onClick: wt
253
258
  }
254
259
  );
255
- }, Dt = (e, r) => {
256
- var a;
257
- (a = t == null ? void 0 : t.current) == null || a.handleItemClick(e, r), A.current = void 0;
260
+ }, xt = (e, r) => {
261
+ var o;
262
+ (o = t == null ? void 0 : t.current) == null || o.handleItemClick(e, r), H.current = void 0;
258
263
  }, St = (e) => {
259
- const { vs: r, list: a } = t.current;
264
+ const { vs: r, list: o } = t.current;
260
265
  r.scrollHandler(e);
261
- const { groupField: c } = n;
262
- let u = b(n);
263
- if (!(!c || !u.length) && c) {
264
- const m = _e.current = _e.current || (r.enabled ? r.itemHeight : a ? a.children[0].offsetHeight : 0), f = e.target.scrollTop - r.skip * m;
265
- u = t.current.getGroupedDataModernMode(u, c);
266
- let o = u[0][c];
267
- for (let d = 1; d < u.length && !(m * d > f); d++)
268
- u[d] && u[d][c] && (o = u[d][c]);
269
- o !== p.group && R({ group: o });
266
+ const { groupField: l } = n;
267
+ let d = E(n);
268
+ if (!(!l || !d.length) && l) {
269
+ const u = We.current = We.current || (r.enabled ? r.itemHeight : o ? o.children[0].offsetHeight : 0), m = e.target.scrollTop - r.skip * u;
270
+ d = t.current.getGroupedDataModernMode(d, l);
271
+ let i = d[0][l];
272
+ for (let f = 1; f < d.length && !(u * f > m); f++)
273
+ d[f] && d[f][l] && (i = d[f][l]);
274
+ i !== p.group && Z({ group: i });
270
275
  }
271
- }, We = () => {
272
- var s;
276
+ }, He = () => {
277
+ var a;
273
278
  const {
274
279
  textField: e,
275
280
  dataItemKey: r,
276
- virtual: a = { skip: 0, total: void 0 },
277
- groupHeaderItemRender: c,
278
- listNoDataRender: u,
279
- itemRender: m
280
- } = n, v = b(n), f = N && N.uDropDownList, o = t.current.vs, d = a.skip, l = n.opened !== void 0 ? n.opened : p.opened, I = t.current.getPopupSettings(), h = `translateY(${o.translate}px)`, y = k();
281
- return /* @__PURE__ */ i.createElement(
282
- dn,
281
+ virtual: o = { skip: 0, total: void 0 },
282
+ groupHeaderItemRender: l,
283
+ listNoDataRender: d,
284
+ itemRender: u
285
+ } = n, g = E(n), m = F && F.uDropDownList, i = t.current.vs, f = o.skip, c = n.opened !== void 0 ? n.opened : p.opened, x = t.current.getPopupSettings(), h = `translateY(${i.translate}px)`, w = k();
286
+ return /* @__PURE__ */ s.createElement(
287
+ cn,
283
288
  {
284
- id: be,
285
- show: l,
286
- data: v.slice(),
287
- focusedIndex: Se(),
288
- value: y,
289
+ id: Ee,
290
+ show: c,
291
+ data: g.slice(),
292
+ focusedIndex: ye(),
293
+ value: w,
289
294
  textField: e,
290
295
  valueField: r,
291
- optionsGuid: $e,
296
+ optionsGuid: Ge,
292
297
  groupField: n.groupField,
293
298
  groupMode: "modern",
294
- listRef: (K) => {
295
- o.list = t.current.list = K;
299
+ listRef: (N) => {
300
+ i.list = t.current.list = N;
296
301
  },
297
- wrapperStyle: { maxHeight: de ? void 0 : I.height },
298
- wrapperCssClass: C(L.listContent({ c: f })),
299
- listStyle: o.enabled ? { transform: h } : void 0,
302
+ wrapperStyle: { maxHeight: G ? void 0 : x.height },
303
+ wrapperCssClass: L(P.listContent({ c: m })),
304
+ listStyle: i.enabled ? { transform: h } : void 0,
300
305
  key: "listkey",
301
- skip: d,
302
- onClick: Dt,
303
- itemRender: m,
304
- groupHeaderItemRender: c,
305
- noDataRender: u,
306
+ skip: f,
307
+ onClick: xt,
308
+ itemRender: u,
309
+ groupHeaderItemRender: l,
310
+ noDataRender: d,
306
311
  onScroll: St,
307
- wrapperRef: o.scrollerRef,
308
- scroller: (s = t == null ? void 0 : t.current) == null ? void 0 : s.renderScrollElement(),
309
- ariaSetSize: a.total
312
+ wrapperRef: i.scrollerRef,
313
+ scroller: (a = t == null ? void 0 : t.current) == null ? void 0 : a.renderScrollElement(),
314
+ ariaSetSize: o.total
310
315
  }
311
316
  );
312
- }, xt = () => {
313
- var h;
314
- const { header: e, footer: r, adaptiveTitle: a, groupField: c, groupStickyHeaderItemRender: u, list: m } = n, v = b(n), f = n.opened !== void 0 ? n.opened : p.opened, o = N && N.uDropDownList, d = N && N.uDropDownsActionSheet, l = {
315
- navigatable: !1,
316
- navigatableElements: [],
317
- expand: f,
318
- animation: !0,
319
- onClose: (y) => Ce(y),
320
- className: C(
321
- j.wrapper({
322
- c: d
323
- }),
324
- "k-adaptive-actionsheet"
325
- ),
326
- animationStyles: _ && G && _ <= G.small ? { top: 0, width: "100%", height: "100%" } : void 0,
327
- position: _ && G && _ <= G.small ? "fullscreen" : void 0
328
- };
329
- let { group: I } = p;
330
- return I === void 0 && c !== void 0 && (I = fe(v[0], c)), /* @__PURE__ */ i.createElement(gn, { ...l }, /* @__PURE__ */ i.createElement(hn, { className: C(j.header({ c: d })) }, /* @__PURE__ */ i.createElement("div", { className: C(j.titleBar({ c: d })) }, /* @__PURE__ */ i.createElement("div", { className: C(j.title({ c: d })) }, /* @__PURE__ */ i.createElement("div", null, a)), /* @__PURE__ */ i.createElement("div", { className: C(j.actions({ c: d })) }, /* @__PURE__ */ i.createElement(
331
- at,
332
- {
333
- tabIndex: 0,
334
- "aria-label": "Cancel",
335
- "aria-disabled": "false",
336
- type: "button",
337
- fillMode: "flat",
338
- onClick: Ce,
339
- themeColor: "primary",
340
- svgIcon: on
341
- }
342
- ))), /* @__PURE__ */ i.createElement("div", { className: C(j.titleBarGroup({ c: d })) }, Ve())), /* @__PURE__ */ i.createElement(In, null, e && /* @__PURE__ */ i.createElement("div", { className: C(L.listHeader({ c: o })) }, e), /* @__PURE__ */ i.createElement(
343
- "div",
344
- {
345
- className: C(
346
- L.list({
347
- c: o,
348
- size: "large",
349
- virtual: (h = t == null ? void 0 : t.current) == null ? void 0 : h.vs.enabled
350
- })
351
- )
352
- },
353
- Be(),
354
- !m && I && v.length !== 0 && /* @__PURE__ */ i.createElement(
355
- rt,
356
- {
357
- group: I,
358
- groupMode: "modern",
359
- render: u
360
- }
361
- ),
362
- We()
363
- ), r && /* @__PURE__ */ i.createElement("div", { className: C(L.listFooter({ c: o })) }, r)));
364
317
  }, Ct = () => {
318
+ const { groupField: e } = n, r = E(n), o = n.opened !== void 0 ? n.opened : p.opened, l = F && F.uDropDownList, d = {
319
+ title: n.adaptiveTitle || n.label,
320
+ subTitle: n.adaptiveSubtitle,
321
+ expand: o,
322
+ onClose: (g) => De(g),
323
+ windowWidth: ke,
324
+ mobileFilter: Ve(!0)
325
+ };
326
+ let { group: u } = p;
327
+ return u === void 0 && e !== void 0 && (u = te(r[0], e)), /* @__PURE__ */ s.createElement(hn, { ...d }, /* @__PURE__ */ s.createElement(In, null, /* @__PURE__ */ s.createElement("div", { className: L(P.listContainer({ c: l, popup: !1 })) }, bt())));
328
+ }, kt = () => {
365
329
  p.focused && window.setTimeout(() => {
366
- p.focused && t.current.wrapper && re(t.current.wrapper);
330
+ p.focused && t.current.wrapper && ne(t.current.wrapper);
367
331
  });
368
332
  }, Et = (e) => {
369
333
  "onMouseDownOutside" in (n.popupSettings || {}) && n.popupSettings.onMouseDownOutside.call(void 0, e);
370
- }, kt = () => {
371
- const { header: e, footer: r, dir: a, groupField: c, groupStickyHeaderItemRender: u, list: m } = n, v = b(n), f = t.current, o = f.getPopupSettings(), d = n.opened !== void 0 ? n.opened : p.opened, l = o.width !== void 0 ? o.width : f.popupWidth, I = N && N.uDropDownList, h = {
372
- dir: a !== void 0 ? a : f.dirCalculated,
373
- width: l,
334
+ }, Lt = () => {
335
+ const { header: e, footer: r, dir: o, groupField: l, groupStickyHeaderItemRender: d, list: u } = n, g = E(n), m = t.current, i = m.getPopupSettings(), f = n.opened !== void 0 ? n.opened : p.opened, c = i.width !== void 0 ? i.width : m.popupWidth, x = F && F.uDropDownList, h = {
336
+ dir: o !== void 0 ? o : m.dirCalculated,
337
+ width: c,
374
338
  popupSettings: {
375
- ...o,
376
- popupClass: C(
377
- o.popupClass,
378
- L.listContainer({
379
- c: I
339
+ ...i,
340
+ popupClass: L(
341
+ i.popupClass,
342
+ P.listContainer({
343
+ c: x,
344
+ popup: !0
380
345
  })
381
346
  ),
382
- anchor: o.anchor || Q.current,
383
- show: d,
384
- onOpen: De,
385
- onClose: Ct,
347
+ anchor: i.anchor || J.current,
348
+ show: f,
349
+ onOpen: he,
350
+ onClose: kt,
386
351
  onMouseDownOutside: Et
387
352
  },
388
- itemsCount: [v.length]
353
+ itemsCount: [g.length]
389
354
  };
390
- let { group: y } = p;
391
- return y === void 0 && c !== void 0 && (y = fe(v[0], c)), /* @__PURE__ */ i.createElement(an, { ...h }, Ve(), e && /* @__PURE__ */ i.createElement("div", { className: C(L.listHeader({ c: I })) }, e), /* @__PURE__ */ i.createElement(
355
+ let { group: w } = p;
356
+ return w === void 0 && l !== void 0 && (w = te(g[0], l)), /* @__PURE__ */ s.createElement(an, { ...h }, Ve(!1), e && /* @__PURE__ */ s.createElement("div", { className: L(P.listHeader({ c: x })) }, e), /* @__PURE__ */ s.createElement(
392
357
  "div",
393
358
  {
394
- className: C(
395
- L.list({
396
- c: I,
397
- size: ne,
359
+ className: L(
360
+ P.list({
361
+ c: x,
362
+ size: O,
398
363
  virtual: t.current.vs.enabled
399
364
  })
400
365
  )
401
366
  },
402
- Be(),
403
- !m && y && v.length !== 0 && /* @__PURE__ */ i.createElement(rt, { group: y, groupMode: "modern", render: u }),
404
- We()
405
- ), r && /* @__PURE__ */ i.createElement("div", { className: C(L.listFooter({ c: I })) }, r), Te && /* @__PURE__ */ i.createElement(tn, null));
406
- }, Lt = (e) => {
407
- const { dataItemKey: r } = n, a = b(n), c = k();
408
- let u = a.map((P, Y) => ({ item: P, itemIndex: Y }));
409
- const m = U.current.word, v = U.current.last, f = un(m, v);
410
- let o = u.length, d = Math.max(
367
+ Dt(),
368
+ !u && w && g.length !== 0 && /* @__PURE__ */ s.createElement(nt, { group: w, groupMode: "modern", render: d }),
369
+ He()
370
+ ), r && /* @__PURE__ */ s.createElement("div", { className: L(P.listFooter({ c: x })) }, r), Ke && /* @__PURE__ */ s.createElement(nn, null));
371
+ }, bt = () => {
372
+ const { header: e, footer: r, groupStickyHeaderItemRender: o, groupField: l, list: d } = n, u = E(n), g = F && F.uDropDownList;
373
+ let { group: m } = p;
374
+ return m === void 0 && l !== void 0 && (m = te(u[0], l)), /* @__PURE__ */ s.createElement(s.Fragment, null, e && /* @__PURE__ */ s.createElement("div", { className: L(P.listHeader({ c: g })) }, e), /* @__PURE__ */ s.createElement(
375
+ "div",
376
+ {
377
+ className: L("k-list", {
378
+ [`k-list-${G ? "lg" : rn[O] || O}`]: O
379
+ })
380
+ },
381
+ !d && m && u.length !== 0 && /* @__PURE__ */ s.createElement(nt, { group: m, groupMode: "modern", render: o }),
382
+ He()
383
+ ), r && /* @__PURE__ */ s.createElement("div", { className: "k-list-footer" }, r));
384
+ }, Pt = (e) => {
385
+ const { dataItemKey: r } = n, o = E(n), l = k();
386
+ let d = o.map((b, $) => ({ item: b, itemIndex: $ }));
387
+ const u = _.current.word, g = _.current.last, m = pn(u, g);
388
+ let i = d.length, f = Math.max(
411
389
  0,
412
- a.findIndex((P) => M(P, c, r))
413
- ), l;
414
- n.defaultItem && (l = { item: n.defaultItem, itemIndex: -1 }, o += 1, d += 1), d += f ? 1 : 0, u = pn(u, d, l);
415
- let I, h, y, s = 0;
416
- const { textField: K } = n;
417
- for (; s < o; ) {
418
- if (I = fe(u[s].item, K), h = f && it(I, v, ve), y = it(I, m, ve), h || y) {
419
- s = u[s].itemIndex;
390
+ o.findIndex((b) => M(b, l, r))
391
+ ), c;
392
+ n.defaultItem && (c = { item: n.defaultItem, itemIndex: -1 }, i += 1, f += 1), f += m ? 1 : 0, d = mn(d, f, c);
393
+ let x, h, w, a = 0;
394
+ const { textField: N } = n;
395
+ for (; a < i; ) {
396
+ if (x = te(d[a].item, N), h = m && ot(x, g, pe), w = ot(x, u, pe), h || w) {
397
+ a = d[a].itemIndex;
420
398
  break;
421
399
  }
422
- s++;
400
+ a++;
423
401
  }
424
- if (s !== o) {
425
- const P = t.current.initState();
426
- P.syntheticEvent = e, J(s, P), F(P), A.current = void 0;
402
+ if (a !== i) {
403
+ const b = t.current.initState();
404
+ b.syntheticEvent = e, j(a, b), K(b), H.current = void 0;
427
405
  }
428
- }, bt = (e) => {
429
- clearTimeout(Ue.current), n.filterable || (Ue.current = window.setTimeout(() => U.current.word = "", ut), Lt(e));
430
- }, Pt = (e) => {
431
- oe.current || t.current.handleFocus(e);
432
406
  }, Mt = (e) => {
433
- if (oe.current || !p.focused)
407
+ clearTimeout(Be.current), n.filterable || (Be.current = window.setTimeout(() => _.current.word = "", ut), Pt(e));
408
+ }, Ft = (e) => {
409
+ re.current || t.current.handleFocus(e);
410
+ }, Kt = (e) => {
411
+ if (re.current || !p.focused)
434
412
  return;
435
- const r = n.opened !== void 0 ? n.opened : p.opened, a = t.current.initState();
436
- a.syntheticEvent = e, a.data.focused = !1, a.events.push({ type: "onBlur" }), r && xe(), r && !de && t.current.togglePopup(a), F(a);
413
+ const r = n.opened !== void 0 ? n.opened : p.opened, o = t.current.initState();
414
+ o.syntheticEvent = e, o.data.focused = !1, o.events.push({ type: "onBlur" }), r && we(), r && !G && t.current.togglePopup(o), K(o);
437
415
  }, Nt = (e) => {
438
- if (n.filterable || e.which === 0 || e.keyCode === w.enter)
416
+ if (n.filterable || e.which === 0 || e.keyCode === I.enter)
439
417
  return;
440
418
  let r = String.fromCharCode(e.charCode || e.keyCode);
441
- ve && (r = r.toLowerCase()), r === " " && e.preventDefault(), U.current = {
442
- word: U.current.word + r,
443
- last: U.current.last + r
444
- }, bt(e);
445
- }, Ft = () => {
419
+ pe && (r = r.toLowerCase()), r === " " && e.preventDefault(), _.current = {
420
+ word: _.current.word + r,
421
+ last: _.current.last + r
422
+ }, Mt(e);
423
+ }, Tt = () => {
446
424
  const e = t.current.initState();
447
- e.data.opened = p.opened, t.current.togglePopup(e), F(e);
448
- }, qe = i.useRef(null), Q = i.useRef(null), Ee = i.useRef(null), X = i.useRef(null);
449
- i.useImperativeHandle(
450
- qe,
425
+ e.data.opened = p.opened, t.current.togglePopup(e), K(e);
426
+ }, Ae = s.useRef(null), J = s.useRef(null), xe = s.useRef(null), Q = s.useRef(null);
427
+ s.useImperativeHandle(
428
+ Ae,
451
429
  () => ({
452
430
  get element() {
453
- return Q.current;
431
+ return J.current;
454
432
  },
455
433
  get index() {
456
434
  return ft();
@@ -459,7 +437,7 @@ const yn = "Please select a value from the list!", Ke = i.forwardRef((dt, ct) =>
459
437
  return n.name;
460
438
  },
461
439
  get validity() {
462
- return we();
440
+ return Ie();
463
441
  },
464
442
  get value() {
465
443
  return k();
@@ -472,13 +450,13 @@ const yn = "Please select a value from the list!", Ke = i.forwardRef((dt, ct) =>
472
450
  },
473
451
  focus: mt,
474
452
  props: n,
475
- togglePopup: Ft
453
+ togglePopup: Tt
476
454
  })
477
- ), i.useImperativeHandle(
455
+ ), s.useImperativeHandle(
478
456
  ct,
479
- () => qe.current
457
+ () => Ae.current
480
458
  );
481
- const Ue = i.useRef(null), U = i.useRef({ word: "", last: "" }), oe = i.useRef(!1), A = i.useRef(null), H = i.useRef(!1), ke = i.useRef(!1), V = i.useRef({}), Le = i.useRef({}), t = i.useRef(
459
+ const Be = s.useRef(null), _ = s.useRef({ word: "", last: "" }), re = s.useRef(!1), H = s.useRef(null), A = s.useRef(!1), Se = s.useRef(!1), B = s.useRef({}), Ce = s.useRef({}), t = s.useRef(
482
460
  new lt({
483
461
  props: n,
484
462
  setState: () => {
@@ -491,159 +469,159 @@ const yn = "Please select a value from the list!", Ke = i.forwardRef((dt, ct) =>
491
469
  handleItemSelect: () => {
492
470
  }
493
471
  })
494
- ), _e = i.useRef(0), Z = i.useRef(null), [p, Kt] = i.useState({}), [_, Tt] = i.useState(), [, Ge] = i.useReducer((e) => e, !0), zt = fn(), R = (e) => {
495
- Kt({ ...p, ...e });
472
+ ), We = s.useRef(0), X = s.useRef(null), [p, zt] = s.useState({}), [ke, Ot] = s.useState(), [, qe] = s.useReducer((e) => e, !0), Ue = vn(), Z = (e) => {
473
+ zt({ ...p, ...e });
496
474
  };
497
- i.useEffect(() => {
475
+ s.useEffect(() => {
498
476
  t.current.updateComponentArgs({
499
477
  props: n,
500
- setState: R,
478
+ setState: Z,
501
479
  state: p,
502
- forceUpdate: Ge,
503
- element: Q.current,
504
- handleItemSelect: J,
480
+ forceUpdate: qe,
481
+ element: J.current,
482
+ handleItemSelect: j,
505
483
  value: k()
506
484
  });
507
- }, [R, p, Ge, J, k]), i.useEffect(() => {
508
- var d, l, I, h, y, s, K, P, Y, te, ce, ue, S;
509
- const { dataItemKey: e, virtual: r, groupField: a = "", textField: c } = n, u = b(n), m = V.current.virtual ? V.current.virtual.total : 0, v = n.opened !== void 0 ? n.opened : p.opened, f = V.current.opened !== void 0 ? V.current.opened : Le.current.opened, o = !f && v;
510
- if ((d = t == null ? void 0 : t.current) == null || d.didUpdate(), (l = t == null ? void 0 : t.current) != null && l.getPopupSettings().animate || o && De(), r && r.total !== m)
511
- (I = t == null ? void 0 : t.current) == null || I.vs.calcScrollElementHeight(), (h = t == null ? void 0 : t.current) == null || h.vs.reset();
485
+ }, [Z, p, qe, j, k]), s.useEffect(() => {
486
+ var f, c, x, h, w, a, N, b, $, ee, le, de, D;
487
+ const { dataItemKey: e, virtual: r, groupField: o = "", textField: l } = n, d = E(n), u = B.current.virtual ? B.current.virtual.total : 0, g = n.opened !== void 0 ? n.opened : p.opened, m = B.current.opened !== void 0 ? B.current.opened : Ce.current.opened, i = !m && g;
488
+ if ((f = t == null ? void 0 : t.current) == null || f.didUpdate(), (c = t == null ? void 0 : t.current) != null && c.getPopupSettings().animate || i && he(), r && r.total !== u)
489
+ (x = t == null ? void 0 : t.current) == null || x.vs.calcScrollElementHeight(), (h = t == null ? void 0 : t.current) == null || h.vs.reset();
512
490
  else {
513
- const z = k(), pe = V.current.value !== void 0 ? V.current.value : Le.current.value;
514
- let W = u.findIndex(($) => M($, z, e));
515
- a !== "" && z && c && (W = (s = (y = t == null ? void 0 : t.current) == null ? void 0 : y.getGroupedDataModernMode(u, a)) == null ? void 0 : s.map(($) => $[c]).indexOf(z[c]));
516
- const me = !M(pe, z, e);
517
- o && r ? (K = t == null ? void 0 : t.current) == null || K.scrollToVirtualItem(r, W) : o && !r ? (De(), u && u.length !== 0 && ((P = t == null ? void 0 : t.current) == null || P.resetGroupStickyHeader(u[0][a], {
518
- setState: R,
491
+ const z = k(), ce = B.current.value !== void 0 ? B.current.value : Ce.current.value;
492
+ let q = d.findIndex((Y) => M(Y, z, e));
493
+ o !== "" && z && l && (q = (a = (w = t == null ? void 0 : t.current) == null ? void 0 : w.getGroupedDataModernMode(d, o)) == null ? void 0 : a.map((Y) => Y[l]).indexOf(z[l]));
494
+ const ue = !M(ce, z, e);
495
+ i && r ? (N = t == null ? void 0 : t.current) == null || N.scrollToVirtualItem(r, q) : i && !r ? (he(), d && d.length !== 0 && ((b = t == null ? void 0 : t.current) == null || b.resetGroupStickyHeader(d[0][o], {
496
+ setState: Z,
519
497
  group: p.group,
520
498
  state: p
521
- })), (Y = t == null ? void 0 : t.current) == null || Y.scrollToItem(W)) : v && f && z && me && !H.current ? (ce = t == null ? void 0 : t.current) == null || ce.scrollToItem(W, (te = t == null ? void 0 : t.current) == null ? void 0 : te.vs.enabled) : v && f && H.current && (H.current && r && r.skip === 0 ? (ue = t == null ? void 0 : t.current) == null || ue.vs.reset() : H.current && r && r.skip === r.total - r.pageSize && ((S = t == null ? void 0 : t.current) == null || S.vs.scrollToEnd()));
499
+ })), ($ = t == null ? void 0 : t.current) == null || $.scrollToItem(q)) : g && m && z && ue && !A.current ? (le = t == null ? void 0 : t.current) == null || le.scrollToItem(q, (ee = t == null ? void 0 : t.current) == null ? void 0 : ee.vs.enabled) : g && m && A.current && (A.current && r && r.skip === 0 ? (de = t == null ? void 0 : t.current) == null || de.vs.reset() : A.current && r && r.skip === r.total - r.pageSize && ((D = t == null ? void 0 : t.current) == null || D.vs.scrollToEnd()));
522
500
  }
523
- H.current = !1, Le.current = p, V.current = n, Oe();
524
- }), i.useEffect(() => {
501
+ A.current = !1, Ce.current = p, B.current = n, Te();
502
+ }), s.useEffect(() => {
525
503
  var e, r;
526
- return Z.current = nt && window.ResizeObserver && new window.ResizeObserver(gt.bind(void 0)), (e = t == null ? void 0 : t.current) == null || e.didMount(), Oe(), (r = Ie()) != null && r.body && Z.current && Z.current.observe(Ie().body), () => {
527
- var a;
528
- (a = Ie()) != null && a.body && Z.current && Z.current.disconnect();
504
+ return X.current = tt && window.ResizeObserver && new window.ResizeObserver(vt.bind(void 0)), (e = t == null ? void 0 : t.current) == null || e.didMount(), Te(), (r = ge()) != null && r.body && X.current && X.current.observe(ge().body), () => {
505
+ var o;
506
+ (o = ge()) != null && o.body && X.current && X.current.disconnect();
529
507
  };
530
508
  }, []);
531
- const Ye = he + "-accessibility-id", be = he + "-listbox-id", $e = he + "-guid", Ot = zt.toLanguageString(
532
- st,
533
- vn[st]
509
+ const _e = fe + "-accessibility-id", Ee = fe + "-listbox-id", Ge = fe + "-guid", Vt = Ue.toLanguageString(
510
+ it,
511
+ st[it]
534
512
  ), {
535
- style: ie,
536
- className: At,
537
- label: Pe,
538
- dir: Ht,
539
- virtual: B,
540
- adaptive: Sn,
541
- dataItemKey: Vt,
542
- disabled: ae,
543
- loading: je,
544
- iconClassName: Je,
545
- svgIcon: Bt,
546
- valueRender: Qe
547
- } = n, Me = n.opened !== void 0 ? n.opened : p.opened, se = k(), Ne = fe(se, n.textField), Xe = !vt() || we().valid, le = t.current, Wt = le.vs, ee = N && N.uDropDownList;
548
- Wt.enabled = B !== void 0;
549
- const G = Qt(), de = !!(_ && G && _ <= G.medium && n.adaptive);
550
- B !== void 0 && (le.vs.skip = B.skip, le.vs.total = B.total, le.vs.pageSize = B.pageSize);
551
- const qt = b(n), { focused: Ut } = p, _t = qt.findIndex((e) => M(e, se, Vt)), Ze = /* @__PURE__ */ i.createElement("span", { id: Ye, className: C(L.inputInner({ c: ee })) }, Ne && /* @__PURE__ */ i.createElement("span", { className: C(L.inputText({ c: ee })) }, Ne)), Gt = Qe !== void 0 ? Qe.call(void 0, Ze, se) : Ze, Re = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
513
+ style: oe,
514
+ className: Ht,
515
+ label: Le,
516
+ dir: At,
517
+ virtual: W,
518
+ adaptive: xn,
519
+ dataItemKey: Bt,
520
+ disabled: ie,
521
+ loading: $e,
522
+ iconClassName: Ye,
523
+ svgIcon: Wt,
524
+ valueRender: je
525
+ } = n, be = n.opened !== void 0 ? n.opened : p.opened, se = k(), Pe = te(se, n.textField), Je = !gt() || Ie().valid, ae = t.current, qt = ae.vs, R = F && F.uDropDownList;
526
+ qt.enabled = W !== void 0;
527
+ const Qe = Xt(), G = !!(ke && Qe && ke <= Qe.medium && n.adaptive);
528
+ W !== void 0 && (ae.vs.skip = W.skip, ae.vs.total = W.total, ae.vs.pageSize = W.pageSize);
529
+ const Ut = E(n), { focused: _t } = p, Gt = Ut.findIndex((e) => M(e, se, Bt)), Xe = /* @__PURE__ */ s.createElement("span", { id: _e, className: L(P.inputInner({ c: R })) }, Pe && /* @__PURE__ */ s.createElement("span", { className: L(P.inputText({ c: R })) }, Pe)), $t = je !== void 0 ? je.call(void 0, Xe, se) : Xe, Ze = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
552
530
  "span",
553
531
  {
554
- ref: ht,
555
- className: C(
556
- L.wrapper({
557
- c: ee,
558
- size: ne,
559
- rounded: ze,
560
- fillMode: ge,
561
- focused: Ut,
562
- disabled: ae,
563
- invalid: !Xe,
564
- loading: je,
565
- required: ye()
532
+ ref: It,
533
+ className: L(
534
+ P.wrapper({
535
+ c: R,
536
+ size: O,
537
+ rounded: Ne,
538
+ fillMode: me,
539
+ focused: _t,
540
+ disabled: ie,
541
+ invalid: !Je,
542
+ loading: $e,
543
+ required: ve()
566
544
  }),
567
- At
545
+ Ht
568
546
  ),
569
- style: Pe ? { ...ie, width: void 0 } : ie,
570
- dir: Ht,
571
- onMouseDown: Me ? (e) => {
572
- e.target.nodeName !== "INPUT" && (re(t.current.wrapper), e.preventDefault());
547
+ style: Le ? { ...oe, width: void 0 } : oe,
548
+ dir: At,
549
+ onMouseDown: be ? (e) => {
550
+ e.target.nodeName !== "INPUT" && (ne(t.current.wrapper), e.preventDefault());
573
551
  } : void 0,
574
- onFocus: Pt,
575
- onBlur: Mt,
576
- tabIndex: Xt(pt, ae),
552
+ onFocus: G ? (e) => De(e) : Ft,
553
+ onBlur: Kt,
554
+ tabIndex: Zt(pt, ie),
577
555
  accessKey: n.accessKey,
578
- onKeyDown: He,
556
+ onKeyDown: Oe,
579
557
  onKeyPress: Nt,
580
- onClick: ae ? void 0 : Ce,
558
+ onClick: ie ? void 0 : De,
581
559
  role: "combobox",
582
- "aria-required": ye(),
583
- "aria-disabled": ae || void 0,
560
+ "aria-required": ve(),
561
+ "aria-disabled": ie || void 0,
584
562
  "aria-haspopup": "listbox",
585
- "aria-expanded": Me || !1,
586
- "aria-owns": be,
587
- "aria-activedescendant": Me ? "option-" + $e + "-" + (_t + (B ? B.skip : 0)) : void 0,
563
+ "aria-expanded": be || !1,
564
+ "aria-owns": Ee,
565
+ "aria-activedescendant": be ? "option-" + Ge + "-" + (Gt + (W ? W.skip : 0)) : void 0,
588
566
  "aria-label": n.ariaLabel || n.label,
589
567
  "aria-labelledby": n.ariaLabelledBy,
590
- "aria-describedby": n.ariaDescribedBy || Ye,
591
- "aria-controls": be,
568
+ "aria-describedby": n.ariaDescribedBy || _e,
569
+ "aria-controls": Ee,
592
570
  id: n.id,
593
571
  title: n.title
594
572
  },
595
- Gt,
596
- je && /* @__PURE__ */ i.createElement(Zt, { className: C(L.loadingIcon({ c: ee })), name: "loading" }),
597
- /* @__PURE__ */ i.createElement(
598
- at,
573
+ $t,
574
+ $e && /* @__PURE__ */ s.createElement(Rt, { className: L(P.loadingIcon({ c: R })), name: "loading" }),
575
+ /* @__PURE__ */ s.createElement(
576
+ gn,
599
577
  {
600
578
  tabIndex: -1,
601
579
  type: "button",
602
- "aria-label": Ot,
603
- size: ne,
604
- fillMode: ge,
605
- className: C(L.inputButton({ c: ee })),
580
+ "aria-label": Vt,
581
+ size: O,
582
+ fillMode: me,
583
+ className: L(P.inputButton({ c: R })),
606
584
  rounded: null,
607
585
  themeColor: "base",
608
- iconClass: Je,
609
- svgIcon: Je ? void 0 : Bt || rn,
586
+ iconClass: Ye,
587
+ svgIcon: Ye ? void 0 : Wt || sn,
610
588
  onMouseDown: (e) => p.focused && e.preventDefault()
611
589
  }
612
590
  ),
613
- It(se),
614
- !de && kt()
615
- ), de && xt());
616
- return Pe ? /* @__PURE__ */ i.createElement(
617
- nn,
591
+ ht(se),
592
+ !G && Lt()
593
+ ), G && Ct());
594
+ return Le ? /* @__PURE__ */ s.createElement(
595
+ on,
618
596
  {
619
- label: Pe,
620
- editorValue: Ne,
621
- editorValid: Xe,
597
+ label: Le,
598
+ editorValue: Pe,
599
+ editorValid: Je,
622
600
  editorDisabled: n.disabled,
623
- style: { width: ie ? ie.width : void 0 },
624
- children: Re
601
+ style: { width: oe ? oe.width : void 0 },
602
+ children: Ze
625
603
  }
626
- ) : Re;
604
+ ) : Ze;
627
605
  });
628
- Ke.propTypes = {
629
- delay: E.number,
630
- ignoreCase: E.bool,
631
- iconClassName: E.string,
632
- svgIcon: Rt,
633
- defaultItem: E.any,
634
- valueRender: E.func,
635
- valueMap: E.func,
636
- validationMessage: E.string,
637
- required: E.bool,
638
- id: E.string,
639
- ariaLabelledBy: E.string,
640
- ariaDescribedBy: E.string,
641
- ariaLabel: E.string,
642
- leftRightKeysNavigation: E.bool,
643
- title: E.string,
644
- groupField: E.string,
645
- list: E.any,
646
- skipDisabledItems: E.bool
606
+ Fe.propTypes = {
607
+ delay: C.number,
608
+ ignoreCase: C.bool,
609
+ iconClassName: C.string,
610
+ svgIcon: en,
611
+ defaultItem: C.any,
612
+ valueRender: C.func,
613
+ valueMap: C.func,
614
+ validationMessage: C.string,
615
+ required: C.bool,
616
+ id: C.string,
617
+ ariaLabelledBy: C.string,
618
+ ariaDescribedBy: C.string,
619
+ ariaLabel: C.string,
620
+ leftRightKeysNavigation: C.bool,
621
+ title: C.string,
622
+ groupField: C.string,
623
+ list: C.any,
624
+ skipDisabledItems: C.bool
647
625
  };
648
626
  const T = {
649
627
  delay: 500,
@@ -656,11 +634,11 @@ const T = {
656
634
  fillMode: "solid",
657
635
  groupMode: "modern"
658
636
  };
659
- Ke.displayName = "KendoReactDropDownList";
660
- const wn = en();
661
- Ke.displayName = "KendoReactDropDownList";
637
+ Fe.displayName = "KendoReactDropDownList";
638
+ const wn = tn();
639
+ Fe.displayName = "KendoReactDropDownList";
662
640
  export {
663
- Ke as DropDownList,
641
+ Fe as DropDownList,
664
642
  wn as DropDownListPropsContext,
665
643
  T as dropDownListDefaultProps
666
644
  };