@progress/kendo-react-dropdowns 13.4.0-develop.5 → 14.0.0-develop.2
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.
- package/AutoComplete/AutoComplete.mjs +4 -4
- package/ComboBox/ComboBox.mjs +5 -5
- package/DropDownList/DropDownList.mjs +9 -9
- package/DropDownTree/DropDownTree.mjs +12 -12
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +4 -4
- package/MultiSelect/MultiSelect.mjs +4 -4
- package/MultiSelectTree/MultiSelectTree.mjs +9 -9
- package/common/List.d.ts +7 -0
- package/common/List.js +1 -1
- package/common/List.mjs +50 -50
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +12 -12
|
@@ -13,7 +13,7 @@ import K from "../common/List.mjs";
|
|
|
13
13
|
import S from "../common/DropDownBase.mjs";
|
|
14
14
|
import L from "../common/GroupStickyHeader.mjs";
|
|
15
15
|
import { getFilteredData as b, getItemValue as y, areSame as w, isPresent as z, getFocusedItem as E, itemIndexStartsWith as H } from "../common/utils.mjs";
|
|
16
|
-
import { withIdHOC as A,
|
|
16
|
+
import { withIdHOC as A, withPropsContext as q, withAdaptiveModeContext as W, createPropsContext as G, classNames as k, kendoThemeMaps as U, Keys as m, canUseDOM as M, subscribeToKendoPaste as $, IconWrap as j } from "@progress/kendo-react-common";
|
|
17
17
|
import { FloatingLabel as J } from "@progress/kendo-react-labels";
|
|
18
18
|
import Q from "../common/ClearButton.mjs";
|
|
19
19
|
import { AdaptiveMode as X } from "../common/AdaptiveMode.mjs";
|
|
@@ -513,10 +513,10 @@ I.displayName = "AutoComplete", I.propTypes = {
|
|
|
513
513
|
suffix: void 0
|
|
514
514
|
};
|
|
515
515
|
let _ = I;
|
|
516
|
-
const se =
|
|
517
|
-
|
|
516
|
+
const se = G(), ie = A(
|
|
517
|
+
q(
|
|
518
518
|
se,
|
|
519
|
-
|
|
519
|
+
W(_)
|
|
520
520
|
)
|
|
521
521
|
);
|
|
522
522
|
ie.displayName = "KendoReactAutoComplete";
|
package/ComboBox/ComboBox.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import * as u from "react";
|
|
9
9
|
import m from "prop-types";
|
|
10
10
|
import _ from "../common/DropDownBase.mjs";
|
|
11
|
-
import { withIdHOC as et,
|
|
11
|
+
import { withIdHOC as et, withPropsContext as st, withUnstyledHOC as it, withAdaptiveModeContext as ot, createPropsContext as at, classNames as S, uComboBox as F, Keys as I, validatePackage as nt, getLicenseMessage as lt, svgIconPropType as rt, canUseDOM as A, subscribeToKendoPaste as pt, IconWrap as dt, WatermarkOverlay as ht } from "@progress/kendo-react-common";
|
|
12
12
|
import { FloatingLabel as ct } from "@progress/kendo-react-labels";
|
|
13
13
|
import { getPlainDataDuplicates as ut, getItemIndexByText as P, getFilteredData as y, areSame as w, getItemValue as D, isPresent as k, itemIndexStartsWith as L, suggestValue as gt } from "../common/utils.mjs";
|
|
14
14
|
import mt from "../common/SearchBar.mjs";
|
|
@@ -721,11 +721,11 @@ M.displayName = "ComboBox", M.propTypes = {
|
|
|
721
721
|
suffix: void 0
|
|
722
722
|
};
|
|
723
723
|
let N = M;
|
|
724
|
-
const kt =
|
|
725
|
-
|
|
724
|
+
const kt = at(), wt = et(
|
|
725
|
+
st(
|
|
726
726
|
kt,
|
|
727
|
-
|
|
728
|
-
|
|
727
|
+
it(
|
|
728
|
+
ot(N)
|
|
729
729
|
)
|
|
730
730
|
)
|
|
731
731
|
);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as s from "react";
|
|
9
9
|
import C from "prop-types";
|
|
10
|
-
import {
|
|
10
|
+
import { getLicenseMessage as Xt, usePropsContext as Zt, validatePackage as Rt, useUnstyled as en, useId as tn, useKendoPaste as nn, canUseDOM as nt, useAdaptiveModeContext as rn, classNames as L, uDropDownList as P, getTabIndex as on, IconWrap as sn, createPropsContext as an, Keys as I, WatermarkOverlay as ln, sizeMap as dn, svgIconPropType as cn } from "@progress/kendo-react-common";
|
|
11
11
|
import { FloatingLabel as un } from "@progress/kendo-react-labels";
|
|
12
12
|
import { caretAltDownIcon as pn } from "@progress/kendo-svg-icons";
|
|
13
13
|
import mn from "../common/ListContainer.mjs";
|
|
@@ -25,7 +25,7 @@ import { ActionSheetContent as Sn } from "@progress/kendo-react-layout";
|
|
|
25
25
|
import { AdaptiveMode as Cn } from "../common/AdaptiveMode.mjs";
|
|
26
26
|
const kn = "Please select a value from the list!", Me = s.forwardRef((ut, pt) => {
|
|
27
27
|
let Ke = !1;
|
|
28
|
-
const mt =
|
|
28
|
+
const mt = Xt(st), n = Zt(En, ut), {
|
|
29
29
|
delay: ft = z.delay,
|
|
30
30
|
tabIndex: gt = z.tabIndex,
|
|
31
31
|
ignoreCase: J = z.ignoreCase,
|
|
@@ -35,12 +35,12 @@ const kn = "Please select a value from the list!", Me = s.forwardRef((ut, pt) =>
|
|
|
35
35
|
} = n;
|
|
36
36
|
if (n.filterable || n.virtual) {
|
|
37
37
|
const e = [];
|
|
38
|
-
n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"), Ke = !
|
|
38
|
+
n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"), Ke = !Rt(st, {
|
|
39
39
|
component: "DropDownList",
|
|
40
40
|
features: e
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
const K =
|
|
43
|
+
const K = en(), fe = tn(n.id), ge = () => {
|
|
44
44
|
var e;
|
|
45
45
|
if (nt)
|
|
46
46
|
return ((e = A.current) == null ? void 0 : e.ownerDocument) || window.document;
|
|
@@ -481,7 +481,7 @@ const kn = "Please select a value from the list!", Me = s.forwardRef((ut, pt) =>
|
|
|
481
481
|
},
|
|
482
482
|
[n, J]
|
|
483
483
|
);
|
|
484
|
-
|
|
484
|
+
nn(A, {
|
|
485
485
|
fieldName: _e,
|
|
486
486
|
onValueChange: Bt,
|
|
487
487
|
enabled: !!_e
|
|
@@ -541,7 +541,7 @@ const kn = "Please select a value from the list!", Me = s.forwardRef((ut, pt) =>
|
|
|
541
541
|
valueRender: Je
|
|
542
542
|
} = n, be = n.opened !== void 0 ? n.opened : m.opened, ae = k(), Pe = ne(ae, n.textField), Qe = !ht() || Ie().valid, le = t.current, $t = le.vs, ee = K && K.uDropDownList;
|
|
543
543
|
$t.enabled = U !== void 0;
|
|
544
|
-
const Xe =
|
|
544
|
+
const Xe = rn(), _ = !!(ke && Xe && ke <= Xe.medium && n.adaptive);
|
|
545
545
|
U !== void 0 && (le.vs.skip = U.skip, le.vs.total = U.total, le.vs.pageSize = U.pageSize);
|
|
546
546
|
const Yt = E(n), { focused: jt } = m, Jt = Yt.findIndex((e) => F(e, ae, _t)), Ze = /* @__PURE__ */ s.createElement("span", { id: Ge, className: L(P.inputInner({ c: ee })) }, Pe && /* @__PURE__ */ s.createElement("span", { className: L(P.inputText({ c: ee })) }, Pe)), Qt = Je !== void 0 ? Je.call(void 0, Ze, ae) : Ze, Re = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
547
547
|
"span",
|
|
@@ -568,7 +568,7 @@ const kn = "Please select a value from the list!", Me = s.forwardRef((ut, pt) =>
|
|
|
568
568
|
} : void 0,
|
|
569
569
|
onFocus: _ ? (e) => xe(e) : Tt,
|
|
570
570
|
onBlur: zt,
|
|
571
|
-
tabIndex:
|
|
571
|
+
tabIndex: on(gt, se),
|
|
572
572
|
accessKey: n.accessKey,
|
|
573
573
|
onKeyDown: Oe,
|
|
574
574
|
onKeyPress: Ot,
|
|
@@ -588,7 +588,7 @@ const kn = "Please select a value from the list!", Me = s.forwardRef((ut, pt) =>
|
|
|
588
588
|
title: n.title
|
|
589
589
|
},
|
|
590
590
|
Qt,
|
|
591
|
-
Ye && /* @__PURE__ */ s.createElement(
|
|
591
|
+
Ye && /* @__PURE__ */ s.createElement(sn, { className: L(P.loadingIcon({ c: ee })), name: "loading" }),
|
|
592
592
|
/* @__PURE__ */ s.createElement(
|
|
593
593
|
xn,
|
|
594
594
|
{
|
|
@@ -649,7 +649,7 @@ const z = {
|
|
|
649
649
|
fillMode: void 0
|
|
650
650
|
};
|
|
651
651
|
Me.displayName = "KendoReactDropDownList";
|
|
652
|
-
const En =
|
|
652
|
+
const En = an();
|
|
653
653
|
Me.displayName = "KendoReactDropDownList";
|
|
654
654
|
export {
|
|
655
655
|
Me as DropDownList,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
|
-
import {
|
|
10
|
+
import { validatePackage as at, getLicenseMessage as rt, usePropsContext as it, useId as lt, getTabIndex as st, ZIndexContext as Se, useRtl as ct, useAdaptiveModeContext as ut, canUseDOM as dt, noop as X, Keys as c, mapTree as pt, extendDataItem as ft, classNames as re, kendoThemeMaps as mt, IconWrap as Te, WatermarkOverlay as vt, createPropsContext as gt } from "@progress/kendo-react-common";
|
|
11
11
|
import { Popup as bt } from "@progress/kendo-react-popup";
|
|
12
12
|
import { useLocalization as ht } from "@progress/kendo-react-intl";
|
|
13
13
|
import { TreeView as Re } from "@progress/kendo-react-treeview";
|
|
@@ -22,7 +22,7 @@ import { Button as wt } from "@progress/kendo-react-buttons";
|
|
|
22
22
|
import { xIcon as Dt, caretAltDownIcon as Ft } from "@progress/kendo-svg-icons";
|
|
23
23
|
import { AdaptiveMode as It } from "../common/AdaptiveMode.mjs";
|
|
24
24
|
import { ActionSheetContent as St } from "@progress/kendo-react-layout";
|
|
25
|
-
const { sizeMap: Tt, roundedMap: Rt } =
|
|
25
|
+
const { sizeMap: Tt, roundedMap: Rt } = mt, Mt = 12e3, Pt = 2e3, Nt = "Please select a value from the list!", Ot = (E) => /* @__PURE__ */ t.createElement("span", { className: "k-input-value-text" }, E.children), Ve = (E) => E.split("_").map((D) => parseInt(D, 10)), Vt = (E, D) => {
|
|
26
26
|
const { validationMessage: G, valid: B, required: r } = E;
|
|
27
27
|
return {
|
|
28
28
|
customError: G !== void 0,
|
|
@@ -44,11 +44,11 @@ const { sizeMap: Tt, roundedMap: Rt } = vt, Mt = 12e3, Pt = 2e3, Nt = "Please se
|
|
|
44
44
|
size: void 0,
|
|
45
45
|
rounded: void 0,
|
|
46
46
|
fillMode: void 0
|
|
47
|
-
}, Lt =
|
|
48
|
-
const G = !
|
|
47
|
+
}, Lt = gt(), Le = t.forwardRef((E, D) => {
|
|
48
|
+
const G = !at(Me, { component: "DropDownTree" }), B = rt(Me), r = it(Lt, E), a = {
|
|
49
49
|
...le,
|
|
50
50
|
...r
|
|
51
|
-
}, We =
|
|
51
|
+
}, We = lt(), se = a.id || We, {
|
|
52
52
|
data: N,
|
|
53
53
|
dataItemKey: O,
|
|
54
54
|
popupSettings: f = {},
|
|
@@ -66,13 +66,13 @@ const { sizeMap: Tt, roundedMap: Rt } = vt, Mt = 12e3, Pt = 2e3, Nt = "Please se
|
|
|
66
66
|
valid: ze,
|
|
67
67
|
required: J,
|
|
68
68
|
validityStyles: qe
|
|
69
|
-
} = a, Q =
|
|
69
|
+
} = a, Q = st(a.tabIndex, F), i = t.useRef(null), v = t.useRef(null), S = t.useRef(null), Y = t.useRef(null), $ = t.useRef(null), y = t.useRef(null), U = t.useRef(!1), [ce, Ae] = t.useState(void 0), C = a.value !== void 0, g = C ? a.value : ce !== void 0 ? ce : a.defaultValue, K = yt(g), ee = K ? Et(g, a.textField) : "", te = Vt({ validationMessage: Z, valid: ze, required: J }, K), ue = t.useContext(Se), Be = ue ? ue + Pt : Mt, He = t.useCallback(() => v.current && v.current.focus(), []);
|
|
70
70
|
t.useImperativeHandle(i, () => ({
|
|
71
71
|
props: a,
|
|
72
72
|
element: v.current,
|
|
73
73
|
focus: He
|
|
74
74
|
})), t.useImperativeHandle(D, () => i.current);
|
|
75
|
-
const k =
|
|
75
|
+
const k = ct(v, a.dir), _e = {
|
|
76
76
|
width: Ct(
|
|
77
77
|
v,
|
|
78
78
|
le,
|
|
@@ -80,13 +80,13 @@ const { sizeMap: Tt, roundedMap: Rt } = vt, Mt = 12e3, Pt = 2e3, Nt = "Please se
|
|
|
80
80
|
V
|
|
81
81
|
),
|
|
82
82
|
...k !== void 0 ? { direction: k } : {}
|
|
83
|
-
}, [Ze, de] = t.useState(!1), l = u !== void 0 ? u : Ze, [p, ne] = t.useState(!1), [oe, $e] = t.useState(), [pe, Ue] = t.useState(""), fe =
|
|
83
|
+
}, [Ze, de] = t.useState(!1), l = u !== void 0 ? u : Ze, [p, ne] = t.useState(!1), [oe, $e] = t.useState(), [pe, Ue] = t.useState(""), fe = ut(), h = !!(oe && fe && oe <= fe.medium && a.adaptive), Xe = t.useCallback(() => {
|
|
84
84
|
$.current && $.current.setCustomValidity && $.current.setCustomValidity(
|
|
85
85
|
te.valid ? "" : Z === void 0 ? Nt : Z
|
|
86
86
|
);
|
|
87
87
|
}, [Z, te]);
|
|
88
88
|
t.useEffect(Xe), t.useEffect(() => {
|
|
89
|
-
const e =
|
|
89
|
+
const e = dt && window.ResizeObserver && new window.ResizeObserver(nt.bind(void 0));
|
|
90
90
|
return document != null && document.body && e && e.observe(document.body), () => {
|
|
91
91
|
document != null && document.body && e && e.disconnect();
|
|
92
92
|
};
|
|
@@ -331,10 +331,10 @@ const { sizeMap: Tt, roundedMap: Rt } = vt, Mt = 12e3, Pt = 2e3, Nt = "Please se
|
|
|
331
331
|
}, nt = t.useCallback((e) => {
|
|
332
332
|
for (const o of e)
|
|
333
333
|
$e(o.target.clientWidth);
|
|
334
|
-
}, []), ke = t.useMemo(() => C || !K ? N :
|
|
334
|
+
}, []), ke = t.useMemo(() => C || !K ? N : pt(
|
|
335
335
|
N,
|
|
336
336
|
W,
|
|
337
|
-
(e) =>
|
|
337
|
+
(e) => ft(e, W, { [_]: Pe(e, g, O) })
|
|
338
338
|
), [N, g, C, K, _, W]), xe = a.listNoData || kt, ot = a.valueHolder || Ot, ae = ht(), we = !qe || te.valid, { size: R, rounded: z, fillMode: q } = a, De = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
339
339
|
"span",
|
|
340
340
|
{
|
|
@@ -454,7 +454,7 @@ const { sizeMap: Tt, roundedMap: Rt } = vt, Mt = 12e3, Pt = 2e3, Nt = "Please se
|
|
|
454
454
|
animate: !1
|
|
455
455
|
}
|
|
456
456
|
) : /* @__PURE__ */ t.createElement(xe, null, ae.toLanguageString(j, ie[j])),
|
|
457
|
-
G && /* @__PURE__ */ t.createElement(
|
|
457
|
+
G && /* @__PURE__ */ t.createElement(vt, { message: B })
|
|
458
458
|
))
|
|
459
459
|
), h && tt());
|
|
460
460
|
return I ? /* @__PURE__ */ t.createElement(
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import se from "prop-types";
|
|
10
10
|
import { MultiColumnList as ie } from "../common/MultiColumnList.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { usePropsContext as ue, getScrollbarWidth as de, getter as T, classNames as v, setScrollbarWidth as ce, createPropsContext as pe } from "@progress/kendo-react-common";
|
|
12
12
|
import { ComboBox as me, ComboBoxWithoutContext as fe } from "../ComboBox/ComboBox.mjs";
|
|
13
13
|
import { getItemValue as ge } from "../common/utils.mjs";
|
|
14
14
|
import W from "../common/withCustomComponent.mjs";
|
|
15
|
-
const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce =
|
|
15
|
+
const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = pe(), P = e.forwardRef(
|
|
16
16
|
(s, g) => {
|
|
17
|
-
const t =
|
|
17
|
+
const t = ue(Ce, s), h = e.useRef(null), i = e.useRef(null), x = de(), {
|
|
18
18
|
columns: r = l.columns,
|
|
19
19
|
popupSettings: p = l.popupSettings,
|
|
20
20
|
size: z = l.size,
|
|
@@ -120,7 +120,7 @@ const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P =
|
|
|
120
120
|
m(o.group);
|
|
121
121
|
}, []);
|
|
122
122
|
e.useEffect(() => {
|
|
123
|
-
|
|
123
|
+
ce();
|
|
124
124
|
}), e.useEffect(() => {
|
|
125
125
|
const o = t.data;
|
|
126
126
|
m(d), o && o.length !== 0 ? M(!0) : M(!1);
|
|
@@ -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,
|
|
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 =
|
|
726
|
-
|
|
725
|
+
const xt = Z(), St = J(
|
|
726
|
+
Q(
|
|
727
727
|
xt,
|
|
728
|
-
|
|
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 {
|
|
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 } =
|
|
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 =
|
|
46
|
+
}, Rt = gt(), Ne = t.forwardRef(
|
|
47
47
|
(N, M) => {
|
|
48
|
-
const a =
|
|
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, $ =
|
|
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 =
|
|
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 =
|
|
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(
|
|
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(
|
|
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"),
|
|
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
|
|
14
|
+
import { useUnstyled as oe, classNames as p, uDropDownsBase as h } from "@progress/kendo-react-common";
|
|
15
15
|
const ue = (e) => {
|
|
16
|
-
const
|
|
16
|
+
const H = te(), I = oe(), f = I && I.uDropDownsBase, {
|
|
17
17
|
id: S,
|
|
18
|
-
show:
|
|
19
|
-
wrapperCssClass:
|
|
20
|
-
wrapperStyle:
|
|
21
|
-
listStyle:
|
|
18
|
+
show: w,
|
|
19
|
+
wrapperCssClass: U,
|
|
20
|
+
wrapperStyle: j,
|
|
21
|
+
listStyle: C,
|
|
22
22
|
listRef: N,
|
|
23
|
-
wrapperRef:
|
|
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:
|
|
29
|
+
svgIconField: G,
|
|
30
30
|
checkboxField: O
|
|
31
|
-
} = e,
|
|
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:
|
|
39
|
-
virtual:
|
|
40
|
-
focusedIndex:
|
|
38
|
+
skip: u = 0,
|
|
39
|
+
virtual: m,
|
|
40
|
+
focusedIndex: b,
|
|
41
41
|
hasDuplicates: T,
|
|
42
42
|
highlightSelected: W = !0,
|
|
43
|
-
value:
|
|
43
|
+
value: g,
|
|
44
44
|
data: z,
|
|
45
45
|
itemRender: X,
|
|
46
46
|
groupHeaderItemRender: Y
|
|
47
|
-
} = e, A = Array.isArray(
|
|
47
|
+
} = e, A = Array.isArray(g);
|
|
48
48
|
let B = 0;
|
|
49
|
-
return z.map((
|
|
50
|
-
const y =
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
|
|
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}-${
|
|
59
|
-
virtual:
|
|
58
|
+
id: `option-${a}-${F}`,
|
|
59
|
+
virtual: m,
|
|
60
60
|
key: y + "-group-item",
|
|
61
|
-
group:
|
|
61
|
+
group: d,
|
|
62
62
|
isMultiColumn: r,
|
|
63
63
|
render: Y,
|
|
64
64
|
iconField: R,
|
|
65
|
-
svgIconField:
|
|
66
|
-
groupItem:
|
|
65
|
+
svgIconField: G,
|
|
66
|
+
groupItem: s
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
69
|
/* @__PURE__ */ l.createElement(
|
|
70
70
|
ee,
|
|
71
71
|
{
|
|
72
|
-
id: `option-${a}-${
|
|
73
|
-
virtual:
|
|
74
|
-
dataItem:
|
|
72
|
+
id: `option-${a}-${x ? F + 1 : F}`,
|
|
73
|
+
virtual: m,
|
|
74
|
+
dataItem: s,
|
|
75
75
|
selected: Z,
|
|
76
|
-
focused:
|
|
76
|
+
focused: b === n,
|
|
77
77
|
index: y,
|
|
78
78
|
key: y,
|
|
79
79
|
onClick: e.onClick,
|
|
80
80
|
textField: i,
|
|
81
|
-
group:
|
|
81
|
+
group: d,
|
|
82
82
|
render: X,
|
|
83
|
-
disabled:
|
|
83
|
+
disabled: s.disabled,
|
|
84
84
|
actionsField: J,
|
|
85
85
|
descriptionField: K,
|
|
86
86
|
iconField: R,
|
|
87
|
-
svgIconField:
|
|
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(
|
|
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":
|
|
103
|
+
"aria-hidden": w ? void 0 : !0,
|
|
104
104
|
"aria-setsize": L,
|
|
105
|
-
className: k || p(
|
|
105
|
+
className: k || p(h.ul({ c: f })),
|
|
106
106
|
ref: N,
|
|
107
|
-
style:
|
|
107
|
+
style: C
|
|
108
108
|
},
|
|
109
|
-
|
|
109
|
+
v
|
|
110
110
|
);
|
|
111
111
|
const i = [];
|
|
112
112
|
let t = [];
|
|
113
|
-
return
|
|
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
|
|
118
|
+
var u;
|
|
119
119
|
const r = o.find(
|
|
120
|
-
(
|
|
121
|
-
), a = (
|
|
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(
|
|
129
|
+
className: k || p(h.ul({ c: f })),
|
|
130
130
|
ref: a ? void 0 : N,
|
|
131
|
-
style:
|
|
131
|
+
style: C
|
|
132
132
|
},
|
|
133
133
|
o
|
|
134
134
|
);
|
|
135
135
|
});
|
|
136
136
|
};
|
|
137
|
-
return
|
|
137
|
+
return v.length ? /* @__PURE__ */ l.createElement(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
140
|
-
className:
|
|
141
|
-
style:
|
|
142
|
-
ref:
|
|
140
|
+
className: U,
|
|
141
|
+
style: j,
|
|
142
|
+
ref: q,
|
|
143
143
|
role: e.groupField ? "listbox" : void 0,
|
|
144
|
-
"aria-hidden": e.groupField && !
|
|
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(
|
|
152
|
+
e.scroller && /* @__PURE__ */ l.createElement("div", { className: p(h.heightContainer({ c: f })) }, e.scroller)
|
|
153
153
|
) : P();
|
|
154
154
|
};
|
|
155
155
|
export {
|