@progress/kendo-react-dropdowns 14.0.0-develop.1 → 14.0.0-develop.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,46 +6,46 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as e from "react";
9
- import se from "prop-types";
10
- import { MultiColumnList as ie } from "../common/MultiColumnList.mjs";
11
- import { createPropsContext as ue, usePropsContext as de, getScrollbarWidth as ce, getter as T, classNames as v, setScrollbarWidth as pe } from "@progress/kendo-react-common";
12
- import { ComboBox as me, ComboBoxWithoutContext as fe } from "../ComboBox/ComboBox.mjs";
13
- import { getItemValue as ge } from "../common/utils.mjs";
14
- import W from "../common/withCustomComponent.mjs";
15
- const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P = e.forwardRef(
9
+ import ue from "prop-types";
10
+ import { MultiColumnList as de } from "../common/MultiColumnList.mjs";
11
+ import { usePropsContext as ce, getScrollbarWidth as pe, getter as T, classNames as x, setScrollbarWidth as me, createPropsContext as fe } from "@progress/kendo-react-common";
12
+ import { ComboBox as ge, ComboBoxWithoutContext as he } from "../ComboBox/ComboBox.mjs";
13
+ import { getItemValue as Ce } from "../common/utils.mjs";
14
+ import L from "../common/withCustomComponent.mjs";
15
+ const be = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, ke = fe(), P = e.forwardRef(
16
16
  (s, g) => {
17
- const t = de(Ce, s), h = e.useRef(null), i = e.useRef(null), x = ce(), {
18
- columns: r = l.columns,
17
+ const t = ce(ke, s), h = e.useRef(null), i = e.useRef(null), y = pe(), {
18
+ columns: a = l.columns,
19
19
  popupSettings: p = l.popupSettings,
20
20
  size: z = l.size,
21
21
  rounded: O = l.rounded,
22
- fillMode: L = l.fillMode,
23
- className: $,
24
- prefix: j = void 0,
25
- suffix: V = void 0,
26
- onOpen: y,
27
- onClose: w,
22
+ fillMode: $ = l.fillMode,
23
+ className: j,
24
+ prefix: V = void 0,
25
+ suffix: A = void 0,
26
+ onOpen: w,
27
+ onClose: S,
28
28
  onFocus: F,
29
- onBlur: S,
30
- onChange: H,
29
+ onBlur: H,
30
+ onChange: R,
31
31
  onFilterChange: E,
32
32
  onPageChange: N,
33
- ...A
33
+ ...D
34
34
  } = t;
35
35
  e.useImperativeHandle(h, () => {
36
- var o;
36
+ var r;
37
37
  return {
38
- element: ((o = i.current) == null ? void 0 : o.element) || null,
38
+ element: ((r = i.current) == null ? void 0 : r.element) || null,
39
39
  focus() {
40
40
  i.current && i.current.focus();
41
41
  },
42
42
  get value() {
43
- var a;
44
- return (a = i.current) == null ? void 0 : a.value;
43
+ var o;
44
+ return (o = i.current) == null ? void 0 : o.value;
45
45
  },
46
46
  get name() {
47
- var a;
48
- return (a = i.current) == null ? void 0 : a.name;
47
+ var o;
48
+ return (o = i.current) == null ? void 0 : o.name;
49
49
  },
50
50
  props: t
51
51
  };
@@ -55,106 +55,109 @@ const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P =
55
55
  );
56
56
  const d = e.useMemo(() => {
57
57
  if (t.groupField !== void 0 && t.data)
58
- return ge(t.data[0], t.groupField);
59
- }, [t.data, t.groupField]), [C, m] = e.useState(d), [R, M] = e.useState(!0), [D] = j ? W(t.prefix || e.Fragment) : [], [J] = V ? W(t.suffix || e.Fragment) : [], Q = e.useMemo(() => {
60
- const o = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: r.length }, C);
61
- return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap k-table-scroller" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, r.map((a, c) => /* @__PURE__ */ e.createElement(
58
+ return Ce(t.data[0], t.groupField);
59
+ }, [t.data, t.groupField]), [C, m] = e.useState(d), [M, B] = e.useState(!0), b = e.useRef(null), [J] = V ? L(t.prefix || e.Fragment) : [], [Q] = A ? L(t.suffix || e.Fragment) : [], U = e.useMemo(() => {
60
+ const r = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: a.length }, C);
61
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { ref: b, className: "k-table-header-wrap" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, a.map((o, c) => /* @__PURE__ */ e.createElement(
62
62
  "col",
63
63
  {
64
- key: a.uniqueKey ? a.uniqueKey : c,
65
- style: { width: a.width ? a.width : l.width }
64
+ key: o.uniqueKey ? o.uniqueKey : c,
65
+ style: { width: o.width ? o.width : l.width }
66
66
  }
67
- ))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, r.map((a, c) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: a.uniqueKey ? a.uniqueKey : c }, a.header || " "))), C && R && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, o, {}) : o)))));
68
- }, [t.header, r, C, R]), U = e.useMemo(
67
+ ))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, a.map((o, c) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : c }, o.header || " "))), C && M && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
68
+ }, [t.header, a, C, M]), X = e.useMemo(
69
69
  () => (
70
70
  // These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
71
- `calc(${r.map((o) => he(o.width, l.width)).filter(Boolean).join(" + ")} + ${x}px + 4px)`
71
+ `calc(${a.map((r) => be(r.width, l.width)).filter(Boolean).join(" + ")} + ${y}px + 4px)`
72
72
  ),
73
- [r, x]
74
- ), B = t.virtual ? t.virtual.skip : 0, X = e.useCallback(
75
- (o, a) => {
76
- const c = r.map((u, le) => /* @__PURE__ */ e.createElement(
73
+ [a, y]
74
+ ), q = t.virtual ? t.virtual.skip : 0, Y = e.useCallback(
75
+ (r, o) => {
76
+ const c = a.map((u, ie) => /* @__PURE__ */ e.createElement(
77
77
  "span",
78
78
  {
79
79
  className: t.itemRender ? void 0 : "k-table-td",
80
80
  style: t.itemRender ? void 0 : { width: u.width ? u.width : l.width },
81
- key: u.uniqueKey ? u.uniqueKey : le
81
+ key: u.uniqueKey ? u.uniqueKey : ie
82
82
  },
83
- u.field ? String(T(u.field)(a.dataItem)) : ""
83
+ u.field ? String(T(u.field)(o.dataItem)) : ""
84
84
  ));
85
- let q, f, b, k, I = t.data || [];
86
- const K = a.index - B;
87
- t.groupField !== void 0 && (k = T(t.groupField), f = k(I[K]), b = k(I[K - 1]), f && b && f !== b && (q = f));
85
+ let I, f, k, v, K = t.data || [];
86
+ const W = o.index - q;
87
+ t.groupField !== void 0 && (v = T(t.groupField), f = v(K[W]), k = v(K[W - 1]), f && k && f !== k && (I = f));
88
88
  const G = e.cloneElement(
89
- o,
89
+ r,
90
90
  {
91
- ...o.props,
92
- className: v("k-table-row", {
93
- "k-table-alt-row": a.index % 2 !== 0,
94
- "k-focus": a.focused,
95
- "k-selected": a.selected,
96
- "k-first": !!q,
97
- "k-disabled": a.dataItem.disabled
91
+ ...r.props,
92
+ className: x("k-table-row", {
93
+ "k-table-alt-row": o.index % 2 !== 0,
94
+ "k-focus": o.focused,
95
+ "k-selected": o.selected,
96
+ "k-first": !!I,
97
+ "k-disabled": o.dataItem.disabled
98
98
  })
99
99
  },
100
100
  c
101
101
  );
102
- return t.itemRender ? t.itemRender.call(void 0, G, a) : G;
102
+ return t.itemRender ? t.itemRender.call(void 0, G, o) : G;
103
103
  },
104
- [r, t.groupField, t.itemRender, t.data, B]
105
- ), n = e.useCallback((o, a) => {
106
- o && o.call(void 0, {
107
- ...a,
104
+ [a, t.groupField, t.itemRender, t.data, q]
105
+ ), n = e.useCallback((r, o) => {
106
+ r && r.call(void 0, {
107
+ ...o,
108
108
  target: h.current
109
109
  });
110
- }, []), Y = e.useCallback(
111
- (o) => (t.virtual || m(d), n(y, o)),
112
- [n, y, t.virtual, d]
113
- ), Z = e.useCallback((o) => n(w, o), [w]), _ = e.useCallback((o) => n(F, o), [F]), ee = e.useCallback((o) => n(S, o), [S]), te = e.useCallback((o) => n(H, o), [H]), oe = e.useCallback((o) => n(N, o), [N]), ae = e.useCallback(
114
- (o) => (m(d), n(E, {
115
- ...o,
116
- mobileMode: o.target.mobileMode
110
+ }, []), Z = e.useCallback(
111
+ (r) => (t.virtual || m(d), n(w, r)),
112
+ [n, w, t.virtual, d]
113
+ ), _ = e.useCallback((r) => n(S, r), [S]), ee = e.useCallback((r) => n(F, r), [F]), te = e.useCallback((r) => n(H, r), [H]), re = e.useCallback((r) => n(R, r), [R]), oe = e.useCallback((r) => n(N, r), [N]), ae = e.useCallback(
114
+ (r) => (m(d), n(E, {
115
+ ...r,
116
+ mobileMode: r.target.mobileMode
117
117
  })),
118
118
  [E]
119
- ), re = e.useCallback((o) => {
120
- m(o.group);
119
+ ), ne = e.useCallback((r) => {
120
+ m(r.group);
121
+ }, []), le = e.useCallback((r) => {
122
+ b.current && (b.current.scrollLeft = r.target.scrollLeft);
121
123
  }, []);
122
124
  e.useEffect(() => {
123
- pe();
125
+ me();
124
126
  }), e.useEffect(() => {
125
- const o = t.data;
126
- m(d), o && o.length !== 0 ? M(!0) : M(!1);
127
+ const r = t.data;
128
+ m(d), r && r.length !== 0 ? B(!0) : B(!1);
127
129
  }, [t.data]);
128
- const ne = e.useCallback((o) => /* @__PURE__ */ e.createElement(ie, { ...o }), []);
130
+ const se = e.useCallback((r) => /* @__PURE__ */ e.createElement(de, { ...r }), []);
129
131
  return /* @__PURE__ */ e.createElement(
130
- me,
132
+ ge,
131
133
  {
132
- ...A,
133
- list: ne,
134
+ ...D,
135
+ list: se,
134
136
  popupSettings: {
135
137
  ...p,
136
- popupClass: v("k-dropdowngrid-popup", p.popupClass),
137
- width: p.width || U,
138
+ popupClass: x("k-dropdowngrid-popup", p.popupClass),
139
+ width: p.width || X,
138
140
  className: p.className
139
141
  },
140
142
  ref: i,
141
- header: Q,
142
- itemRender: X,
143
+ header: U,
144
+ itemRender: Y,
143
145
  groupHeaderItemRender: t.groupHeaderItemRender,
144
146
  size: z,
145
147
  rounded: O,
146
- fillMode: L,
148
+ fillMode: $,
147
149
  groupField: t.groupField,
148
150
  isMultiColumn: !0,
149
- onOpen: Y,
150
- onClose: Z,
151
- onFocus: _,
152
- onBlur: ee,
153
- onChange: te,
151
+ onOpen: Z,
152
+ onClose: _,
153
+ onFocus: ee,
154
+ onBlur: te,
155
+ onChange: re,
154
156
  onFilterChange: ae,
155
157
  onPageChange: oe,
156
- onGroupScroll: re,
157
- className: v("k-dropdowngrid", $),
158
+ onGroupScroll: ne,
159
+ onListScroll: le,
160
+ className: x("k-dropdowngrid", j),
158
161
  required: t.required,
159
162
  adaptive: t.adaptive,
160
163
  adaptiveFilter: t.adaptiveFilter,
@@ -162,14 +165,14 @@ const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P =
162
165
  adaptiveSubtitle: t.adaptiveSubtitle,
163
166
  footer: t.footer,
164
167
  footerClassName: "k-table-footer",
165
- prefix: D,
166
- suffix: J
168
+ prefix: J,
169
+ suffix: Q
167
170
  }
168
171
  );
169
172
  }
170
- ), be = {
171
- ...fe.propTypes,
172
- columns: se.any.isRequired
173
+ ), ve = {
174
+ ...he.propTypes,
175
+ columns: ue.any.isRequired
173
176
  }, l = {
174
177
  columns: [],
175
178
  popupSettings: {},
@@ -179,8 +182,8 @@ const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P =
179
182
  fillMode: void 0
180
183
  };
181
184
  P.displayName = "KendoMultiColumnComboBox";
182
- P.propTypes = be;
185
+ P.propTypes = ve;
183
186
  export {
184
187
  P as MultiColumnComboBox,
185
- Ce as MultiColumnComboBoxPropsContext
188
+ ke as MultiColumnComboBoxPropsContext
186
189
  };
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import * as g from "react";
9
9
  import v from "prop-types";
10
- import { withIdHOC as J, createPropsContext as Q, withPropsContext as X, withAdaptiveModeContext as Z, Keys as u, classNames as S, kendoThemeMaps as tt, IconWrap as B, WatermarkOverlay as et, getLicenseMessage as st, canUseDOM as V, validatePackage as it, subscribeToKendoPaste as ot } from "@progress/kendo-react-common";
10
+ import { withIdHOC as J, withPropsContext as Q, withAdaptiveModeContext as X, createPropsContext as Z, Keys as u, classNames as S, kendoThemeMaps as tt, IconWrap as B, WatermarkOverlay as et, getLicenseMessage as st, canUseDOM as V, validatePackage as it, subscribeToKendoPaste as ot } from "@progress/kendo-react-common";
11
11
  import { plusIcon as at } from "@progress/kendo-svg-icons";
12
12
  import { FloatingLabel as nt } from "@progress/kendo-react-labels";
13
13
  import lt from "../common/ListContainer.mjs";
@@ -722,10 +722,10 @@ C.displayName = "MultiSelect", C.propTypes = {
722
722
  suffix: void 0
723
723
  };
724
724
  let N = C;
725
- const xt = Q(), St = J(
726
- X(
725
+ const xt = Z(), St = J(
726
+ Q(
727
727
  xt,
728
- Z(N)
728
+ X(N)
729
729
  )
730
730
  );
731
731
  St.displayName = "KendoReactMultiSelect";
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import * as t from "react";
9
9
  import n from "prop-types";
10
- import { createPropsContext as it, usePropsContext as rt, validatePackage as ot, getLicenseMessage as lt, useId as st, noop as Y, getTabIndex as ct, useRtl as ut, useAdaptiveModeContext as dt, canUseDOM as pt, Keys as r, classNames as Z, kendoThemeMaps as ft, IconWrap as mt, WatermarkOverlay as gt } from "@progress/kendo-react-common";
10
+ import { usePropsContext as it, validatePackage as rt, getLicenseMessage as ot, useId as lt, noop as Y, getTabIndex as st, useRtl as ct, useAdaptiveModeContext as ut, canUseDOM as dt, Keys as r, classNames as Z, kendoThemeMaps as pt, IconWrap as ft, WatermarkOverlay as mt, createPropsContext as gt } from "@progress/kendo-react-common";
11
11
  import { Popup as vt } from "@progress/kendo-react-popup";
12
12
  import { useLocalization as ht } from "@progress/kendo-react-intl";
13
13
  import { TreeView as Ie } from "@progress/kendo-react-treeview";
@@ -22,7 +22,7 @@ import xt from "../common/ClearButton.mjs";
22
22
  import Re from "../common/ListFilter.mjs";
23
23
  import { AdaptiveMode as St } from "../common/AdaptiveMode.mjs";
24
24
  import { ActionSheetContent as wt } from "@progress/kendo-react-layout";
25
- const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt } = ft, Dt = (N) => N.split("_").map((M) => parseInt(M, 10)), Mt = (N, M) => {
25
+ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt } = pt, Dt = (N) => N.split("_").map((M) => parseInt(M, 10)), Mt = (N, M) => {
26
26
  const { validationMessage: a, valid: V, required: te } = N;
27
27
  return {
28
28
  customError: a !== void 0,
@@ -43,9 +43,9 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
43
43
  fillMode: void 0,
44
44
  required: !1,
45
45
  validityStyles: !0
46
- }, Rt = it(), Ne = t.forwardRef(
46
+ }, Rt = gt(), Ne = t.forwardRef(
47
47
  (N, M) => {
48
- const a = rt(Rt, N), V = !ot(Te, { component: "MultiSelectTree" }), te = lt(Te), Oe = st(), O = a.id || Oe, {
48
+ const a = it(Rt, N), V = !rt(Te, { component: "MultiSelectTree" }), te = ot(Te), Oe = lt(), O = a.id || Oe, {
49
49
  data: W = [],
50
50
  dataItemKey: x,
51
51
  style: L = {},
@@ -69,10 +69,10 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
69
69
  validityStyles: Ke = b.validityStyles,
70
70
  onOpen: ae = Y,
71
71
  onClose: A = Y
72
- } = a, $ = ct(a.tabIndex, E), o = t.useRef(null), C = t.useRef(null), w = t.useRef(null), ie = t.useRef(null), H = t.useRef(null), k = t.useRef(null), G = t.useRef(!1), _ = t.useRef([]), j = t.useRef(null), [P, Ve] = t.useState(), [We, ge] = t.useState(!1), [d, re] = t.useState(!1), [oe, qe] = t.useState(), [ze, Ae] = t.useState([]), [ve, $e] = t.useState(""), s = S !== void 0 ? S : We, le = !!(Array.isArray(m) && m.length), se = Mt({ validationMessage: q, valid: Be, required: me }, le), I = ut(C, a.dir), He = {
72
+ } = a, $ = st(a.tabIndex, E), o = t.useRef(null), C = t.useRef(null), w = t.useRef(null), ie = t.useRef(null), H = t.useRef(null), k = t.useRef(null), G = t.useRef(!1), _ = t.useRef([]), j = t.useRef(null), [P, Ve] = t.useState(), [We, ge] = t.useState(!1), [d, re] = t.useState(!1), [oe, qe] = t.useState(), [ze, Ae] = t.useState([]), [ve, $e] = t.useState(""), s = S !== void 0 ? S : We, le = !!(Array.isArray(m) && m.length), se = Mt({ validationMessage: q, valid: Be, required: me }, le), I = ct(C, a.dir), He = {
73
73
  width: Ct(C, b, R, L),
74
74
  ...I !== void 0 ? { direction: I } : {}
75
- }, Ge = t.useCallback(() => C.current && C.current.focus(), []), he = dt(), T = !!(oe && he && oe <= he.medium && a.adaptive);
75
+ }, Ge = t.useCallback(() => C.current && C.current.focus(), []), he = ut(), T = !!(oe && he && oe <= he.medium && a.adaptive);
76
76
  _.current = ue === void 0 ? (m || []).map((e) => ({ text: bt(e, a.textField), data: [e] })) : [...ue], t.useImperativeHandle(o, () => ({
77
77
  props: a,
78
78
  element: C.current,
@@ -87,7 +87,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
87
87
  );
88
88
  }, [q, se]);
89
89
  t.useEffect(_e), t.useEffect(() => {
90
- const e = pt && window.ResizeObserver && new window.ResizeObserver(nt.bind(void 0));
90
+ const e = dt && window.ResizeObserver && new window.ResizeObserver(nt.bind(void 0));
91
91
  return document != null && document.body && e && e.observe(document.body), () => {
92
92
  e && e.disconnect();
93
93
  };
@@ -425,7 +425,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
425
425
  )
426
426
  ),
427
427
  /* @__PURE__ */ t.createElement("span", { className: "k-input-inner" }, Q.length === 0 && /* @__PURE__ */ t.createElement("span", { className: "k-input-value-text" }, ne)),
428
- a.loading && /* @__PURE__ */ t.createElement(mt, { className: "k-input-loading-icon", name: "loading" }),
428
+ a.loading && /* @__PURE__ */ t.createElement(ft, { className: "k-input-loading-icon", name: "loading" }),
429
429
  le && !E && Q.length > 0 && /* @__PURE__ */ t.createElement(xt, { onClick: Ze }),
430
430
  /* @__PURE__ */ t.createElement(
431
431
  "select",
@@ -491,7 +491,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
491
491
  dir: I
492
492
  }
493
493
  ) : /* @__PURE__ */ t.createElement(ke, null, Fe.toLanguageString(ee, Me[ee])),
494
- V && /* @__PURE__ */ t.createElement(gt, { message: te })
494
+ V && /* @__PURE__ */ t.createElement(mt, { message: te })
495
495
  )
496
496
  ), T && tt());
497
497
  return B ? /* @__PURE__ */ t.createElement(
package/common/List.d.ts CHANGED
@@ -46,6 +46,13 @@ export interface ListProps {
46
46
  iconField?: string;
47
47
  svgIconField?: string;
48
48
  checkboxField?: string;
49
+ /**
50
+ * Specifies whether to show the group header for the first group.
51
+ * By default, the first group header is hidden because there is no previous group to differentiate from.
52
+ *
53
+ * @default false
54
+ */
55
+ showFirstGroupHeader?: boolean;
49
56
  }
50
57
  /**
51
58
  * @hidden
package/common/List.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";const Y=require("react"),Z=require("./ListItem.js"),w=require("./ListGroupItem.js"),h=require("./utils.js"),ee=require("@progress/kendo-react-intl"),I=require("../messages/index.js"),s=require("@progress/kendo-react-common");function te(e){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(m,l,i.get?i:{enumerable:!0,get:()=>e[l]})}}return m.default=e,Object.freeze(m)}const a=te(Y),re=e=>{const m=ee.useLocalization(),l=s.useUnstyled(),i=l&&l.uDropDownsBase,{id:N,show:b,wrapperCssClass:j,wrapperStyle:M,listStyle:k,listRef:C,wrapperRef:V,listClassName:R,ariaSetSize:B,actionsField:$,descriptionField:_,iconField:q,svgIconField:L,checkboxField:P}=e,D=(()=>{const{textField:o,valueField:t,groupField:n,isMultiColumn:r,optionsGuid:c,skip:f=0,virtual:g,focusedIndex:x,hasDuplicates:H,highlightSelected:J=!0,value:v,data:z,itemRender:K,groupHeaderItemRender:Q}=e,A=Array.isArray(v);let G=0;return z.map((d,u)=>{const E=f+u,F=f+u+G,W=H?v?x===u:!1:d.disabled?!1:J&&(!A&&h.areSame(d,v,t)||A&&v.findIndex(X=>h.areSame(X,d,t))!==-1);let p,y,S;u>0&&n!==void 0&&(y=h.getItemValue(d,n),S=h.getItemValue(z[u-1],n),y&&S&&y!==S&&(p=y));const O=p!==void 0;return p!==void 0&&(G+=1),[O&&a.createElement(w,{id:`option-${c}-${F}`,virtual:g,key:E+"-group-item",group:p,isMultiColumn:r,render:Q,iconField:q,svgIconField:L,groupItem:d}),a.createElement(Z,{id:`option-${c}-${O?F+1:F}`,virtual:g,dataItem:d,selected:W,focused:x===u,index:E,key:E,onClick:e.onClick,textField:o,group:p,render:K,disabled:d.disabled,actionsField:$,descriptionField:_,iconField:q,svgIconField:L,checkboxField:P})]})})(),T=()=>{const o=e.noDataRender,t=a.createElement("div",{className:s.classNames(s.uDropDownsBase.noData({c:i})),"aria-live":"polite"},a.createElement("div",null,m.toLanguageString(I.nodata,I.messages[I.nodata])));return o?o(t):t},U=()=>{if(!e.groupField)return a.createElement("ul",{id:N,role:"listbox","aria-hidden":b?void 0:!0,"aria-setsize":B,className:R||s.classNames(s.uDropDownsBase.ul({c:i})),ref:C,style:k},D);const o=[];let t=[];return D.forEach(n=>{Array.isArray(n)&&n.forEach(r=>{r&&r.type===w?(t.length>0&&o.push(t),t=[r]):r&&t.push(r)})}),t.length>0&&o.push(t),o.map(n=>{var f;const r=n.find(g=>a.isValidElement(g)&&g.type===w),c=(f=r==null?void 0:r.props)==null?void 0:f.id;return a.createElement("ul",{id:c?void 0:N,key:c||"first-group",role:"group","aria-labelledby":c,className:R||s.classNames(s.uDropDownsBase.ul({c:i})),ref:c?void 0:C,style:k},n)})};return D.length?a.createElement("div",{className:j,style:M,ref:V,role:e.groupField?"listbox":void 0,"aria-hidden":e.groupField&&!b?!0:void 0,"aria-setsize":e.groupField?B:void 0,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},U(),e.scroller&&a.createElement("div",{className:s.classNames(s.uDropDownsBase.heightContainer({c:i}))},e.scroller)):T()};module.exports=re;
8
+ "use strict";const Y=require("react"),Z=require("./ListItem.js"),S=require("./ListGroupItem.js"),y=require("./utils.js"),ee=require("@progress/kendo-react-intl"),I=require("../messages/index.js"),a=require("@progress/kendo-react-common");function te(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(g,l,i.get?i:{enumerable:!0,get:()=>e[l]})}}return g.default=e,Object.freeze(g)}const n=te(Y),re=e=>{const g=ee.useLocalization(),l=a.useUnstyled(),i=l&&l.uDropDownsBase,{id:N,show:b,wrapperCssClass:j,wrapperStyle:M,listStyle:k,listRef:C,wrapperRef:V,listClassName:R,ariaSetSize:B,actionsField:$,descriptionField:_,iconField:q,svgIconField:L,checkboxField:P}=e,D=(()=>{const{textField:o,valueField:t,groupField:s,isMultiColumn:r,optionsGuid:c,skip:p=0,virtual:v,focusedIndex:z,hasDuplicates:U,highlightSelected:J=!0,value:h,data:G,itemRender:K,groupHeaderItemRender:Q}=e,x=Array.isArray(h);let A=0;return G.map((d,u)=>{const F=p+u,w=p+u+A,W=U?h?z===u:!1:d.disabled?!1:J&&(!x&&y.areSame(d,h,t)||x&&h.findIndex(X=>y.areSame(X,d,t))!==-1);let f,m,E;s!==void 0&&(m=y.getItemValue(d,s),u===0&&e.showFirstGroupHeader&&m?f=m:u>0&&(E=y.getItemValue(G[u-1],s),m&&E&&m!==E&&(f=m)));const O=f!==void 0;return f!==void 0&&(A+=1),[O&&n.createElement(S,{id:`option-${c}-${w}`,virtual:v,key:F+"-group-item",group:f,isMultiColumn:r,render:Q,iconField:q,svgIconField:L,groupItem:d}),n.createElement(Z,{id:`option-${c}-${O?w+1:w}`,virtual:v,dataItem:d,selected:W,focused:z===u,index:F,key:F,onClick:e.onClick,textField:o,group:f,render:K,disabled:d.disabled,actionsField:$,descriptionField:_,iconField:q,svgIconField:L,checkboxField:P})]})})(),H=()=>{const o=e.noDataRender,t=n.createElement("div",{className:a.classNames(a.uDropDownsBase.noData({c:i})),"aria-live":"polite"},n.createElement("div",null,g.toLanguageString(I.nodata,I.messages[I.nodata])));return o?o(t):t},T=()=>{if(!e.groupField)return n.createElement("ul",{id:N,role:"listbox","aria-hidden":b?void 0:!0,"aria-setsize":B,className:R||a.classNames(a.uDropDownsBase.ul({c:i})),ref:C,style:k},D);const o=[];let t=[];return D.forEach(s=>{Array.isArray(s)&&s.forEach(r=>{r&&r.type===S?(t.length>0&&o.push(t),t=[r]):r&&t.push(r)})}),t.length>0&&o.push(t),o.map(s=>{var p;const r=s.find(v=>n.isValidElement(v)&&v.type===S),c=(p=r==null?void 0:r.props)==null?void 0:p.id;return n.createElement("ul",{id:c?void 0:N,key:c||"first-group",role:"group","aria-labelledby":c,className:R||a.classNames(a.uDropDownsBase.ul({c:i})),ref:c?void 0:C,style:k},s)})};return D.length?n.createElement("div",{className:j,style:M,ref:V,role:e.groupField?"listbox":void 0,"aria-hidden":e.groupField&&!b?!0:void 0,"aria-setsize":e.groupField?B:void 0,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},T(),e.scroller&&n.createElement("div",{className:a.classNames(a.uDropDownsBase.heightContainer({c:i}))},e.scroller)):H()};module.exports=re;
package/common/List.mjs CHANGED
@@ -11,87 +11,87 @@ import D from "./ListGroupItem.mjs";
11
11
  import { areSame as $, getItemValue as M } from "./utils.mjs";
12
12
  import { useLocalization as te } from "@progress/kendo-react-intl";
13
13
  import { nodata as V, messages as re } from "../messages/index.mjs";
14
- import { useUnstyled as oe, classNames as p, uDropDownsBase as v } from "@progress/kendo-react-common";
14
+ import { useUnstyled as oe, classNames as p, uDropDownsBase as h } from "@progress/kendo-react-common";
15
15
  const ue = (e) => {
16
- const U = te(), I = oe(), m = I && I.uDropDownsBase, {
16
+ const H = te(), I = oe(), f = I && I.uDropDownsBase, {
17
17
  id: S,
18
- show: C,
19
- wrapperCssClass: j,
20
- wrapperStyle: q,
21
- listStyle: w,
18
+ show: w,
19
+ wrapperCssClass: U,
20
+ wrapperStyle: j,
21
+ listStyle: C,
22
22
  listRef: N,
23
- wrapperRef: H,
23
+ wrapperRef: q,
24
24
  listClassName: k,
25
25
  ariaSetSize: L,
26
26
  actionsField: J,
27
27
  descriptionField: K,
28
28
  iconField: R,
29
- svgIconField: b,
29
+ svgIconField: G,
30
30
  checkboxField: O
31
- } = e, h = (() => {
31
+ } = e, v = (() => {
32
32
  const {
33
33
  textField: i,
34
34
  valueField: t,
35
35
  groupField: o,
36
36
  isMultiColumn: r,
37
37
  optionsGuid: a,
38
- skip: d = 0,
39
- virtual: c,
40
- focusedIndex: x,
38
+ skip: u = 0,
39
+ virtual: m,
40
+ focusedIndex: b,
41
41
  hasDuplicates: T,
42
42
  highlightSelected: W = !0,
43
- value: f,
43
+ value: g,
44
44
  data: z,
45
45
  itemRender: X,
46
46
  groupHeaderItemRender: Y
47
- } = e, A = Array.isArray(f);
47
+ } = e, A = Array.isArray(g);
48
48
  let B = 0;
49
- return z.map((n, s) => {
50
- const y = d + s, E = d + s + B, Z = T ? f ? x === s : !1 : n.disabled ? !1 : W && (!A && $(n, f, t) || A && f.findIndex((_) => $(_, n, t)) !== -1);
51
- let u, g, F;
52
- s > 0 && o !== void 0 && (g = M(n, o), F = M(z[s - 1], o), g && F && g !== F && (u = g));
53
- const G = u !== void 0;
54
- return u !== void 0 && (B += 1), [
55
- G && /* @__PURE__ */ l.createElement(
49
+ return z.map((s, n) => {
50
+ const y = u + n, F = u + n + B, Z = T ? g ? b === n : !1 : s.disabled ? !1 : W && (!A && $(s, g, t) || A && g.findIndex((_) => $(_, s, t)) !== -1);
51
+ let d, c, E;
52
+ o !== void 0 && (c = M(s, o), n === 0 && e.showFirstGroupHeader && c ? d = c : n > 0 && (E = M(z[n - 1], o), c && E && c !== E && (d = c)));
53
+ const x = d !== void 0;
54
+ return d !== void 0 && (B += 1), [
55
+ x && /* @__PURE__ */ l.createElement(
56
56
  D,
57
57
  {
58
- id: `option-${a}-${E}`,
59
- virtual: c,
58
+ id: `option-${a}-${F}`,
59
+ virtual: m,
60
60
  key: y + "-group-item",
61
- group: u,
61
+ group: d,
62
62
  isMultiColumn: r,
63
63
  render: Y,
64
64
  iconField: R,
65
- svgIconField: b,
66
- groupItem: n
65
+ svgIconField: G,
66
+ groupItem: s
67
67
  }
68
68
  ),
69
69
  /* @__PURE__ */ l.createElement(
70
70
  ee,
71
71
  {
72
- id: `option-${a}-${G ? E + 1 : E}`,
73
- virtual: c,
74
- dataItem: n,
72
+ id: `option-${a}-${x ? F + 1 : F}`,
73
+ virtual: m,
74
+ dataItem: s,
75
75
  selected: Z,
76
- focused: x === s,
76
+ focused: b === n,
77
77
  index: y,
78
78
  key: y,
79
79
  onClick: e.onClick,
80
80
  textField: i,
81
- group: u,
81
+ group: d,
82
82
  render: X,
83
- disabled: n.disabled,
83
+ disabled: s.disabled,
84
84
  actionsField: J,
85
85
  descriptionField: K,
86
86
  iconField: R,
87
- svgIconField: b,
87
+ svgIconField: G,
88
88
  checkboxField: O
89
89
  }
90
90
  )
91
91
  ];
92
92
  });
93
93
  })(), P = () => {
94
- const i = e.noDataRender, t = /* @__PURE__ */ l.createElement("div", { className: p(v.noData({ c: m })), "aria-live": "polite" }, /* @__PURE__ */ l.createElement("div", null, U.toLanguageString(V, re[V])));
94
+ const i = e.noDataRender, t = /* @__PURE__ */ l.createElement("div", { className: p(h.noData({ c: f })), "aria-live": "polite" }, /* @__PURE__ */ l.createElement("div", null, H.toLanguageString(V, re[V])));
95
95
  return i ? i(t) : t;
96
96
  }, Q = () => {
97
97
  if (!e.groupField)
@@ -100,25 +100,25 @@ const ue = (e) => {
100
100
  {
101
101
  id: S,
102
102
  role: "listbox",
103
- "aria-hidden": C ? void 0 : !0,
103
+ "aria-hidden": w ? void 0 : !0,
104
104
  "aria-setsize": L,
105
- className: k || p(v.ul({ c: m })),
105
+ className: k || p(h.ul({ c: f })),
106
106
  ref: N,
107
- style: w
107
+ style: C
108
108
  },
109
- h
109
+ v
110
110
  );
111
111
  const i = [];
112
112
  let t = [];
113
- return h.forEach((o) => {
113
+ return v.forEach((o) => {
114
114
  Array.isArray(o) && o.forEach((r) => {
115
115
  r && r.type === D ? (t.length > 0 && i.push(t), t = [r]) : r && t.push(r);
116
116
  });
117
117
  }), t.length > 0 && i.push(t), i.map((o) => {
118
- var d;
118
+ var u;
119
119
  const r = o.find(
120
- (c) => l.isValidElement(c) && c.type === D
121
- ), a = (d = r == null ? void 0 : r.props) == null ? void 0 : d.id;
120
+ (m) => l.isValidElement(m) && m.type === D
121
+ ), a = (u = r == null ? void 0 : r.props) == null ? void 0 : u.id;
122
122
  return /* @__PURE__ */ l.createElement(
123
123
  "ul",
124
124
  {
@@ -126,22 +126,22 @@ const ue = (e) => {
126
126
  key: a || "first-group",
127
127
  role: "group",
128
128
  "aria-labelledby": a,
129
- className: k || p(v.ul({ c: m })),
129
+ className: k || p(h.ul({ c: f })),
130
130
  ref: a ? void 0 : N,
131
- style: w
131
+ style: C
132
132
  },
133
133
  o
134
134
  );
135
135
  });
136
136
  };
137
- return h.length ? /* @__PURE__ */ l.createElement(
137
+ return v.length ? /* @__PURE__ */ l.createElement(
138
138
  "div",
139
139
  {
140
- className: j,
141
- style: q,
142
- ref: H,
140
+ className: U,
141
+ style: j,
142
+ ref: q,
143
143
  role: e.groupField ? "listbox" : void 0,
144
- "aria-hidden": e.groupField && !C ? !0 : void 0,
144
+ "aria-hidden": e.groupField && !w ? !0 : void 0,
145
145
  "aria-setsize": e.groupField ? L : void 0,
146
146
  onMouseDown: e.onMouseDown,
147
147
  onBlur: e.onBlur,
@@ -149,7 +149,7 @@ const ue = (e) => {
149
149
  unselectable: "on"
150
150
  },
151
151
  Q(),
152
- e.scroller && /* @__PURE__ */ l.createElement("div", { className: p(v.heightContainer({ c: m })) }, e.scroller)
152
+ e.scroller && /* @__PURE__ */ l.createElement("div", { className: p(h.heightContainer({ c: f })) }, e.scroller)
153
153
  ) : P();
154
154
  };
155
155
  export {