@progress/kendo-react-dropdowns 15.2.0-develop.4 → 15.2.0-develop.5
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/MultiSelect/MultiSelect.d.ts +17 -2
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +541 -402
- package/MultiSelect/MultiSelectProps.d.ts +69 -0
- package/common/List.d.ts +1 -0
- package/common/List.js +1 -1
- package/common/List.mjs +60 -58
- package/common/ListItem.d.ts +5 -0
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +40 -37
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/messages/index.d.ts +15 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +23 -17
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -53,6 +53,24 @@ export interface MultiSelectBlurEvent extends BlurEvent<MultiSelect> {
|
|
|
53
53
|
*/
|
|
54
54
|
export interface MultiSelectPageChangeEvent extends PageChangeEvent<MultiSelect> {
|
|
55
55
|
}
|
|
56
|
+
export interface MultiSelectSelectAllChangeEvent {
|
|
57
|
+
/**
|
|
58
|
+
* A native DOM event.
|
|
59
|
+
*/
|
|
60
|
+
nativeEvent: Event;
|
|
61
|
+
/**
|
|
62
|
+
* The synthetic event that triggered the select-all action.
|
|
63
|
+
*/
|
|
64
|
+
syntheticEvent: React.SyntheticEvent<HTMLElement>;
|
|
65
|
+
/**
|
|
66
|
+
* An event target.
|
|
67
|
+
*/
|
|
68
|
+
target: MultiSelect;
|
|
69
|
+
/**
|
|
70
|
+
* Indicates whether all items should be selected (`true`) or deselected (`false`).
|
|
71
|
+
*/
|
|
72
|
+
allSelected: boolean;
|
|
73
|
+
}
|
|
56
74
|
/**
|
|
57
75
|
* Represents the props of the [KendoReact MultiSelect component](https://www.telerik.com/kendo-react-ui/components/dropdowns/multiselect).
|
|
58
76
|
*/
|
|
@@ -414,6 +432,57 @@ export interface MultiSelectProps extends FormComponentProps {
|
|
|
414
432
|
* ```
|
|
415
433
|
*/
|
|
416
434
|
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
435
|
+
/**
|
|
436
|
+
* Controls whether a built-in `Select all` option appears at the top of the popup list.
|
|
437
|
+
* Selecting this option toggles all currently applicable items.
|
|
438
|
+
*
|
|
439
|
+
* @default false
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```jsx
|
|
443
|
+
* <MultiSelect selectAll={true} />
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
selectAll?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Controls whether checkboxes are rendered in the select-all header and in each list item.
|
|
449
|
+
* The checkbox state reflects the selected state of the items.
|
|
450
|
+
*
|
|
451
|
+
* @default false
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
* ```jsx
|
|
455
|
+
* <MultiSelect selectAll={true} checkboxes={true} />
|
|
456
|
+
* ```
|
|
457
|
+
*/
|
|
458
|
+
checkboxes?: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* Specifies the maximum number of individual tag chips to display before showing a summary tag.
|
|
461
|
+
* When the number of selected items exceeds this value, the first `summarizeAfter` items
|
|
462
|
+
* are shown as individual chips and the remaining items are collapsed into a summary chip.
|
|
463
|
+
*
|
|
464
|
+
* @default 10
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```jsx
|
|
468
|
+
* <MultiSelect summarizeAfter={5} />
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
summarizeAfter?: number;
|
|
472
|
+
/**
|
|
473
|
+
* Fires when the select-all item is clicked.
|
|
474
|
+
* When provided, the component delegates the select-all logic to the consumer.
|
|
475
|
+
* Useful for virtualization scenarios where the consumer manages the full dataset.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* ```jsx
|
|
479
|
+
* <MultiSelect
|
|
480
|
+
* selectAll={true}
|
|
481
|
+
* onSelectAllChange={(event) => { setAllSelected(!allSelected); }}
|
|
482
|
+
* />
|
|
483
|
+
* ```
|
|
484
|
+
*/
|
|
485
|
+
onSelectAllChange?: (event: MultiSelectSelectAllChangeEvent) => void;
|
|
417
486
|
/**
|
|
418
487
|
* Fires when the element which indicates no data in the popup is about to be rendered ([see example](https://www.telerik.com/kendo-react-ui/components/dropdowns/multiselect/custom-rendering#toc-no-data)). Used to override the default appearance of the element.
|
|
419
488
|
*
|
package/common/List.d.ts
CHANGED
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
|
|
8
|
+
"use strict";const ee=require("react"),te=require("./ListItem.js"),S=require("./ListGroupItem.js"),y=require("./utils.js"),re=require("@progress/kendo-react-intl"),k=require("../messages/index.js"),s=require("@progress/kendo-react-common");function ae(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(g,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return g.default=e,Object.freeze(g)}const o=ae(ee),se=e=>{const g=re.useLocalization(),n=s.useUnstyled(),i=n&&n.uDropDownsBase,{id:E,show:I,wrapperCssClass:M,wrapperStyle:V,listStyle:N,listRef:C,wrapperRef:$,listClassName:R,ariaLabel:B,ariaSetSize:L,actionsField:_,descriptionField:P,iconField:q,svgIconField:x,checkboxField:H,showSelectionCheckbox:T}=e,D=(()=>{const{textField:l,valueField:t,groupField:a,isMultiColumn:r,optionsGuid:c,skip:h=0,virtual:v,focusedIndex:z,hasDuplicates:K,highlightSelected:Q=!0,value:p,data:G,itemRender:W,groupHeaderItemRender:X}=e,A=Array.isArray(p);let O=0;return G.map((d,u)=>{const b=h+u,F=h+u+O,Y=K?p?z===u:!1:d.disabled?!1:Q&&(!A&&y.areSame(d,p,t)||A&&p.findIndex(Z=>y.areSame(Z,d,t))!==-1);let m,f,w;a!==void 0&&(f=y.getItemValue(d,a),u===0&&e.showFirstGroupHeader&&f?m=f:u>0&&(w=y.getItemValue(G[u-1],a),f&&w&&f!==w&&(m=f)));const j=m!==void 0;return m!==void 0&&(O+=1),[j&&o.createElement(S,{id:`k-${c}-item-${F+1}`,virtual:v,key:b+"-group-item",group:m,isMultiColumn:r,render:X,iconField:q,svgIconField:x,groupItem:d}),o.createElement(te,{id:`k-${c}-item-${(j?F+1:F)+1}`,virtual:v,dataItem:d,selected:Y,focused:z===u,index:b,key:b,onClick:e.onClick,textField:l,group:m,render:W,disabled:d.disabled,actionsField:_,descriptionField:P,iconField:q,svgIconField:x,checkboxField:H,showSelectionCheckbox:T})]})})(),U=()=>{const l=e.noDataRender,t=o.createElement("div",{className:s.classNames(s.uDropDownsBase.noData({c:i})),"aria-live":"polite"},o.createElement("div",null,g.toLanguageString(k.nodata,k.messages[k.nodata])));return l?l(t):t},J=()=>{if(!e.groupField)return o.createElement("ul",{id:E,role:"listbox","aria-label":B,"aria-hidden":I?void 0:!0,"aria-setsize":L,className:R||s.classNames(s.uDropDownsBase.ul({c:i})),ref:C,style:N},D);const l=[];let t=[];return D.forEach(a=>{Array.isArray(a)&&a.forEach(r=>{r&&r.type===S?(t.length>0&&l.push(t),t=[r]):r&&t.push(r)})}),t.length>0&&l.push(t),l.map(a=>{var h;const r=a.find(v=>o.isValidElement(v)&&v.type===S),c=(h=r==null?void 0:r.props)==null?void 0:h.id;return o.createElement("ul",{id:c?void 0:E,key:c||"first-group",role:"group","aria-labelledby":c,className:R||s.classNames(s.uDropDownsBase.ul({c:i})),ref:c?void 0:C,style:N},a)})};return D.length?o.createElement("div",{className:M,style:V,ref:$,role:e.groupField?"listbox":void 0,"aria-label":e.groupField?B:void 0,"aria-hidden":e.groupField&&!I?!0:void 0,"aria-setsize":e.groupField?L:void 0,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},J(),e.scroller&&o.createElement("div",{className:s.classNames(s.uDropDownsBase.heightContainer({c:i}))},e.scroller)):U()};module.exports=se;
|
package/common/List.mjs
CHANGED
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
8
|
+
import * as a from "react";
|
|
9
|
+
import te from "./ListItem.mjs";
|
|
10
10
|
import D from "./ListGroupItem.mjs";
|
|
11
11
|
import { areSame as M, getItemValue as V } from "./utils.mjs";
|
|
12
|
-
import { useLocalization as
|
|
12
|
+
import { useLocalization as le } from "@progress/kendo-react-intl";
|
|
13
13
|
import { nodata as H, messages as ae } from "../messages/index.mjs";
|
|
14
|
-
import { useUnstyled as
|
|
15
|
-
const
|
|
16
|
-
const U =
|
|
17
|
-
id:
|
|
18
|
-
show:
|
|
14
|
+
import { useUnstyled as ie, classNames as h, uDropDownsBase as v } from "@progress/kendo-react-common";
|
|
15
|
+
const fe = (e) => {
|
|
16
|
+
const U = le(), S = ie(), f = S && S.uDropDownsBase, {
|
|
17
|
+
id: k,
|
|
18
|
+
show: w,
|
|
19
19
|
wrapperCssClass: j,
|
|
20
20
|
wrapperStyle: q,
|
|
21
|
-
listStyle:
|
|
22
|
-
listRef:
|
|
21
|
+
listStyle: C,
|
|
22
|
+
listRef: I,
|
|
23
23
|
wrapperRef: J,
|
|
24
24
|
listClassName: b,
|
|
25
25
|
ariaLabel: L,
|
|
@@ -28,32 +28,33 @@ const me = (e) => {
|
|
|
28
28
|
descriptionField: O,
|
|
29
29
|
iconField: R,
|
|
30
30
|
svgIconField: G,
|
|
31
|
-
checkboxField: P
|
|
31
|
+
checkboxField: P,
|
|
32
|
+
showSelectionCheckbox: Q
|
|
32
33
|
} = e, p = (() => {
|
|
33
34
|
const {
|
|
34
35
|
textField: i,
|
|
35
36
|
valueField: r,
|
|
36
|
-
groupField:
|
|
37
|
+
groupField: l,
|
|
37
38
|
isMultiColumn: t,
|
|
38
39
|
optionsGuid: o,
|
|
39
40
|
skip: u = 0,
|
|
40
41
|
virtual: m,
|
|
41
|
-
focusedIndex:
|
|
42
|
-
hasDuplicates:
|
|
43
|
-
highlightSelected:
|
|
42
|
+
focusedIndex: x,
|
|
43
|
+
hasDuplicates: X,
|
|
44
|
+
highlightSelected: Y = !0,
|
|
44
45
|
value: g,
|
|
45
|
-
data:
|
|
46
|
-
itemRender:
|
|
47
|
-
groupHeaderItemRender:
|
|
48
|
-
} = e,
|
|
49
|
-
let
|
|
50
|
-
return
|
|
51
|
-
const y = u + n, F = u + n +
|
|
46
|
+
data: z,
|
|
47
|
+
itemRender: Z,
|
|
48
|
+
groupHeaderItemRender: _
|
|
49
|
+
} = e, A = Array.isArray(g);
|
|
50
|
+
let B = 0;
|
|
51
|
+
return z.map((s, n) => {
|
|
52
|
+
const y = u + n, F = u + n + B, ee = X ? g ? x === n : !1 : s.disabled ? !1 : Y && (!A && M(s, g, r) || A && g.findIndex((re) => M(re, s, r)) !== -1);
|
|
52
53
|
let d, c, E;
|
|
53
|
-
|
|
54
|
+
l !== void 0 && (c = V(s, l), n === 0 && e.showFirstGroupHeader && c ? d = c : n > 0 && (E = V(z[n - 1], l), c && E && c !== E && (d = c)));
|
|
54
55
|
const $ = d !== void 0;
|
|
55
|
-
return d !== void 0 && (
|
|
56
|
-
$ && /* @__PURE__ */
|
|
56
|
+
return d !== void 0 && (B += 1), [
|
|
57
|
+
$ && /* @__PURE__ */ a.createElement(
|
|
57
58
|
D,
|
|
58
59
|
{
|
|
59
60
|
id: `k-${o}-item-${F + 1}`,
|
|
@@ -61,82 +62,83 @@ const me = (e) => {
|
|
|
61
62
|
key: y + "-group-item",
|
|
62
63
|
group: d,
|
|
63
64
|
isMultiColumn: t,
|
|
64
|
-
render:
|
|
65
|
+
render: _,
|
|
65
66
|
iconField: R,
|
|
66
67
|
svgIconField: G,
|
|
67
68
|
groupItem: s
|
|
68
69
|
}
|
|
69
70
|
),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
71
|
+
/* @__PURE__ */ a.createElement(
|
|
72
|
+
te,
|
|
72
73
|
{
|
|
73
74
|
id: `k-${o}-item-${($ ? F + 1 : F) + 1}`,
|
|
74
75
|
virtual: m,
|
|
75
76
|
dataItem: s,
|
|
76
|
-
selected:
|
|
77
|
-
focused:
|
|
77
|
+
selected: ee,
|
|
78
|
+
focused: x === n,
|
|
78
79
|
index: y,
|
|
79
80
|
key: y,
|
|
80
81
|
onClick: e.onClick,
|
|
81
82
|
textField: i,
|
|
82
83
|
group: d,
|
|
83
|
-
render:
|
|
84
|
+
render: Z,
|
|
84
85
|
disabled: s.disabled,
|
|
85
86
|
actionsField: K,
|
|
86
87
|
descriptionField: O,
|
|
87
88
|
iconField: R,
|
|
88
89
|
svgIconField: G,
|
|
89
|
-
checkboxField: P
|
|
90
|
+
checkboxField: P,
|
|
91
|
+
showSelectionCheckbox: Q
|
|
90
92
|
}
|
|
91
93
|
)
|
|
92
94
|
];
|
|
93
95
|
});
|
|
94
|
-
})(),
|
|
95
|
-
const i = e.noDataRender, r = /* @__PURE__ */
|
|
96
|
+
})(), T = () => {
|
|
97
|
+
const i = e.noDataRender, r = /* @__PURE__ */ a.createElement("div", { className: h(v.noData({ c: f })), "aria-live": "polite" }, /* @__PURE__ */ a.createElement("div", null, U.toLanguageString(H, ae[H])));
|
|
96
98
|
return i ? i(r) : r;
|
|
97
|
-
},
|
|
99
|
+
}, W = () => {
|
|
98
100
|
if (!e.groupField)
|
|
99
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ a.createElement(
|
|
100
102
|
"ul",
|
|
101
103
|
{
|
|
102
|
-
id:
|
|
104
|
+
id: k,
|
|
103
105
|
role: "listbox",
|
|
104
106
|
"aria-label": L,
|
|
105
|
-
"aria-hidden":
|
|
107
|
+
"aria-hidden": w ? void 0 : !0,
|
|
106
108
|
"aria-setsize": N,
|
|
107
|
-
className: b || v
|
|
108
|
-
ref:
|
|
109
|
-
style:
|
|
109
|
+
className: b || h(v.ul({ c: f })),
|
|
110
|
+
ref: I,
|
|
111
|
+
style: C
|
|
110
112
|
},
|
|
111
113
|
p
|
|
112
114
|
);
|
|
113
115
|
const i = [];
|
|
114
116
|
let r = [];
|
|
115
|
-
return p.forEach((
|
|
116
|
-
Array.isArray(
|
|
117
|
+
return p.forEach((l) => {
|
|
118
|
+
Array.isArray(l) && l.forEach((t) => {
|
|
117
119
|
t && t.type === D ? (r.length > 0 && i.push(r), r = [t]) : t && r.push(t);
|
|
118
120
|
});
|
|
119
|
-
}), r.length > 0 && i.push(r), i.map((
|
|
121
|
+
}), r.length > 0 && i.push(r), i.map((l) => {
|
|
120
122
|
var u;
|
|
121
|
-
const t =
|
|
122
|
-
(m) =>
|
|
123
|
+
const t = l.find(
|
|
124
|
+
(m) => a.isValidElement(m) && m.type === D
|
|
123
125
|
), o = (u = t == null ? void 0 : t.props) == null ? void 0 : u.id;
|
|
124
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ a.createElement(
|
|
125
127
|
"ul",
|
|
126
128
|
{
|
|
127
|
-
id: o ? void 0 :
|
|
129
|
+
id: o ? void 0 : k,
|
|
128
130
|
key: o || "first-group",
|
|
129
131
|
role: "group",
|
|
130
132
|
"aria-labelledby": o,
|
|
131
|
-
className: b || v
|
|
132
|
-
ref: o ? void 0 :
|
|
133
|
-
style:
|
|
133
|
+
className: b || h(v.ul({ c: f })),
|
|
134
|
+
ref: o ? void 0 : I,
|
|
135
|
+
style: C
|
|
134
136
|
},
|
|
135
|
-
|
|
137
|
+
l
|
|
136
138
|
);
|
|
137
139
|
});
|
|
138
140
|
};
|
|
139
|
-
return p.length ? /* @__PURE__ */
|
|
141
|
+
return p.length ? /* @__PURE__ */ a.createElement(
|
|
140
142
|
"div",
|
|
141
143
|
{
|
|
142
144
|
className: j,
|
|
@@ -144,17 +146,17 @@ const me = (e) => {
|
|
|
144
146
|
ref: J,
|
|
145
147
|
role: e.groupField ? "listbox" : void 0,
|
|
146
148
|
"aria-label": e.groupField ? L : void 0,
|
|
147
|
-
"aria-hidden": e.groupField && !
|
|
149
|
+
"aria-hidden": e.groupField && !w ? !0 : void 0,
|
|
148
150
|
"aria-setsize": e.groupField ? N : void 0,
|
|
149
151
|
onMouseDown: e.onMouseDown,
|
|
150
152
|
onBlur: e.onBlur,
|
|
151
153
|
onScroll: e.onScroll,
|
|
152
154
|
unselectable: "on"
|
|
153
155
|
},
|
|
154
|
-
|
|
155
|
-
e.scroller && /* @__PURE__ */
|
|
156
|
-
) :
|
|
156
|
+
W(),
|
|
157
|
+
e.scroller && /* @__PURE__ */ a.createElement("div", { className: h(v.heightContainer({ c: f })) }, e.scroller)
|
|
158
|
+
) : T();
|
|
157
159
|
};
|
|
158
160
|
export {
|
|
159
|
-
|
|
161
|
+
fe as default
|
|
160
162
|
};
|
package/common/ListItem.d.ts
CHANGED
|
@@ -79,6 +79,11 @@ export interface ListItemProps {
|
|
|
79
79
|
* The field name in the dataItem that contains the checkbox state.
|
|
80
80
|
*/
|
|
81
81
|
checkboxField?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @hidden
|
|
84
|
+
* When true, renders a checkbox whose checked state reflects the item's selected state.
|
|
85
|
+
*/
|
|
86
|
+
showSelectionCheckbox?: boolean;
|
|
82
87
|
}
|
|
83
88
|
/**
|
|
84
89
|
* @hidden
|
package/common/ListItem.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
|
|
8
|
+
"use strict";const w=require("react"),r=require("@progress/kendo-react-common"),s=require("./utils.js"),h=require("@progress/kendo-react-inputs"),y=require("./ListItemIcon.js");function F(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const c=F(w),V=t=>{const{selected:n,dataItem:e,virtual:i,disabled:u,id:C,focused:p,render:d,actionsField:m,descriptionField:k,iconField:a,svgIconField:l,checkboxField:b,showSelectionCheckbox:x}=t,g=r.useUnstyled(),f=g&&g.uDropDownsBase,v=o=>t.onClick(t.index,o),D=()=>{if(x)return c.createElement(h.Checkbox,{checked:n,tabIndex:-1});if(!b)return null;const o=s.getItemValue(e,b)||!1;return c.createElement("span",{className:"k-checkbox-wrap"},c.createElement(h.Checkbox,{checked:o,onChange:S=>{e.onCheckboxChange&&e.onCheckboxChange(e,S.value)}}))},E=()=>m?s.getItemValue(e,m):null,N=()=>{if(!k)return null;const o=s.getItemValue(e,k);return o?c.createElement("span",{className:"k-list-item-description"},o):null},I=c.createElement("li",{id:C,role:"option","aria-selected":n,"aria-disabled":u?!0:void 0,className:r.classNames(r.uDropDownsBase.li({c:f,selected:n,focused:p,disabled:u})),onClick:v,style:{position:i?"relative":"unset"}},D(),(l||a)&&c.createElement(y.ListItemIcon,{icon:a?s.getItemValue(e,a):void 0,svgIcon:l?s.getItemValue(e,l):void 0}),c.createElement("span",{className:r.classNames(r.uDropDownsBase.itemText({c:f}))},s.getItemValue(e,t.textField).toString()),E(),N());return d!==void 0?d(I,t):I};module.exports=V;
|
package/common/ListItem.mjs
CHANGED
|
@@ -5,75 +5,78 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { useUnstyled as
|
|
8
|
+
import * as t from "react";
|
|
9
|
+
import { useUnstyled as w, classNames as x, uDropDownsBase as C } from "@progress/kendo-react-common";
|
|
10
10
|
import { getItemValue as o } from "./utils.mjs";
|
|
11
|
-
import { Checkbox as
|
|
12
|
-
import { ListItemIcon as
|
|
13
|
-
const
|
|
11
|
+
import { Checkbox as b } from "@progress/kendo-react-inputs";
|
|
12
|
+
import { ListItemIcon as y } from "./ListItemIcon.mjs";
|
|
13
|
+
const T = (c) => {
|
|
14
14
|
const {
|
|
15
|
-
selected:
|
|
15
|
+
selected: i,
|
|
16
16
|
dataItem: e,
|
|
17
|
-
virtual:
|
|
17
|
+
virtual: p,
|
|
18
18
|
disabled: l,
|
|
19
19
|
id: v,
|
|
20
|
-
focused:
|
|
20
|
+
focused: I,
|
|
21
21
|
render: a,
|
|
22
22
|
actionsField: d,
|
|
23
23
|
descriptionField: m,
|
|
24
|
-
iconField:
|
|
24
|
+
iconField: r,
|
|
25
25
|
svgIconField: s,
|
|
26
|
-
checkboxField: u
|
|
27
|
-
|
|
26
|
+
checkboxField: u,
|
|
27
|
+
showSelectionCheckbox: g
|
|
28
|
+
} = c, h = w(), k = h && h.uDropDownsBase, E = (n) => c.onClick(c.index, n), F = () => {
|
|
29
|
+
if (g)
|
|
30
|
+
return /* @__PURE__ */ t.createElement(b, { checked: i, tabIndex: -1 });
|
|
28
31
|
if (!u)
|
|
29
32
|
return null;
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
33
|
+
const n = o(e, u) || !1;
|
|
34
|
+
return /* @__PURE__ */ t.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ t.createElement(
|
|
35
|
+
b,
|
|
33
36
|
{
|
|
34
|
-
checked:
|
|
35
|
-
onChange: (
|
|
36
|
-
e.onCheckboxChange && e.onCheckboxChange(e,
|
|
37
|
+
checked: n,
|
|
38
|
+
onChange: (S) => {
|
|
39
|
+
e.onCheckboxChange && e.onCheckboxChange(e, S.value);
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
));
|
|
40
|
-
},
|
|
43
|
+
}, D = () => d ? o(e, d) : null, N = () => {
|
|
41
44
|
if (!m)
|
|
42
45
|
return null;
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
-
},
|
|
46
|
+
const n = o(e, m);
|
|
47
|
+
return n ? /* @__PURE__ */ t.createElement("span", { className: "k-list-item-description" }, n) : null;
|
|
48
|
+
}, f = /* @__PURE__ */ t.createElement(
|
|
46
49
|
"li",
|
|
47
50
|
{
|
|
48
51
|
id: v,
|
|
49
52
|
role: "option",
|
|
50
|
-
"aria-selected":
|
|
53
|
+
"aria-selected": i,
|
|
51
54
|
"aria-disabled": l ? !0 : void 0,
|
|
52
|
-
className:
|
|
53
|
-
|
|
55
|
+
className: x(
|
|
56
|
+
C.li({
|
|
54
57
|
c: k,
|
|
55
|
-
selected:
|
|
56
|
-
focused:
|
|
58
|
+
selected: i,
|
|
59
|
+
focused: I,
|
|
57
60
|
disabled: l
|
|
58
61
|
})
|
|
59
62
|
),
|
|
60
|
-
onClick:
|
|
61
|
-
style: { position:
|
|
63
|
+
onClick: E,
|
|
64
|
+
style: { position: p ? "relative" : "unset" }
|
|
62
65
|
},
|
|
63
|
-
|
|
64
|
-
(s ||
|
|
65
|
-
|
|
66
|
+
F(),
|
|
67
|
+
(s || r) && /* @__PURE__ */ t.createElement(
|
|
68
|
+
y,
|
|
66
69
|
{
|
|
67
|
-
icon:
|
|
70
|
+
icon: r ? o(e, r) : void 0,
|
|
68
71
|
svgIcon: s ? o(e, s) : void 0
|
|
69
72
|
}
|
|
70
73
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
/* @__PURE__ */ t.createElement("span", { className: x(C.itemText({ c: k })) }, o(e, c.textField).toString()),
|
|
75
|
+
D(),
|
|
76
|
+
N()
|
|
74
77
|
);
|
|
75
|
-
return a !== void 0 ? a(
|
|
78
|
+
return a !== void 0 ? a(f, c) : f;
|
|
76
79
|
};
|
|
77
80
|
export {
|
|
78
|
-
|
|
81
|
+
T as default
|
|
79
82
|
};
|