@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.
@@ -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
@@ -46,6 +46,7 @@ export interface ListProps {
46
46
  iconField?: string;
47
47
  svgIconField?: string;
48
48
  checkboxField?: string;
49
+ showSelectionCheckbox?: boolean;
49
50
  ariaLabel?: string;
50
51
  /**
51
52
  * Specifies whether to show the group header for the first group.
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 Z=require("react"),ee=require("./ListItem.js"),E=require("./ListGroupItem.js"),y=require("./utils.js"),te=require("@progress/kendo-react-intl"),S=require("../messages/index.js"),s=require("@progress/kendo-react-common");function re(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(g,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return g.default=e,Object.freeze(g)}const l=re(Z),ae=e=>{const g=te.useLocalization(),o=s.useUnstyled(),i=o&&o.uDropDownsBase,{id:k,show:I,wrapperCssClass:M,wrapperStyle:V,listStyle:N,listRef:C,wrapperRef:$,listClassName:R,ariaLabel:B,ariaSetSize:L,actionsField:_,descriptionField:P,iconField:q,svgIconField:z,checkboxField:H}=e,D=(()=>{const{textField:n,valueField:t,groupField:a,isMultiColumn:r,optionsGuid:c,skip:v=0,virtual:p,focusedIndex:G,hasDuplicates:J,highlightSelected:K=!0,value:h,data:x,itemRender:Q,groupHeaderItemRender:W}=e,A=Array.isArray(h);let O=0;return x.map((d,u)=>{const F=v+u,b=v+u+O,X=J?h?G===u:!1:d.disabled?!1:K&&(!A&&y.areSame(d,h,t)||A&&h.findIndex(Y=>y.areSame(Y,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(x[u-1],a),f&&w&&f!==w&&(m=f)));const j=m!==void 0;return m!==void 0&&(O+=1),[j&&l.createElement(E,{id:`k-${c}-item-${b+1}`,virtual:p,key:F+"-group-item",group:m,isMultiColumn:r,render:W,iconField:q,svgIconField:z,groupItem:d}),l.createElement(ee,{id:`k-${c}-item-${(j?b+1:b)+1}`,virtual:p,dataItem:d,selected:X,focused:G===u,index:F,key:F,onClick:e.onClick,textField:n,group:m,render:Q,disabled:d.disabled,actionsField:_,descriptionField:P,iconField:q,svgIconField:z,checkboxField:H})]})})(),T=()=>{const n=e.noDataRender,t=l.createElement("div",{className:s.classNames(s.uDropDownsBase.noData({c:i})),"aria-live":"polite"},l.createElement("div",null,g.toLanguageString(S.nodata,S.messages[S.nodata])));return n?n(t):t},U=()=>{if(!e.groupField)return l.createElement("ul",{id:k,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 n=[];let t=[];return D.forEach(a=>{Array.isArray(a)&&a.forEach(r=>{r&&r.type===E?(t.length>0&&n.push(t),t=[r]):r&&t.push(r)})}),t.length>0&&n.push(t),n.map(a=>{var v;const r=a.find(p=>l.isValidElement(p)&&p.type===E),c=(v=r==null?void 0:r.props)==null?void 0:v.id;return l.createElement("ul",{id:c?void 0:k,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?l.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"},U(),e.scroller&&l.createElement("div",{className:s.classNames(s.uDropDownsBase.heightContainer({c:i}))},e.scroller)):T()};module.exports=ae;
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 l from "react";
9
- import re from "./ListItem.mjs";
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 te } from "@progress/kendo-react-intl";
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 le, classNames as v, uDropDownsBase as h } from "@progress/kendo-react-common";
15
- const me = (e) => {
16
- const U = te(), I = le(), f = I && I.uDropDownsBase, {
17
- id: S,
18
- show: k,
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: w,
22
- listRef: C,
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: a,
37
+ groupField: l,
37
38
  isMultiColumn: t,
38
39
  optionsGuid: o,
39
40
  skip: u = 0,
40
41
  virtual: m,
41
- focusedIndex: z,
42
- hasDuplicates: W,
43
- highlightSelected: X = !0,
42
+ focusedIndex: x,
43
+ hasDuplicates: X,
44
+ highlightSelected: Y = !0,
44
45
  value: g,
45
- data: A,
46
- itemRender: Y,
47
- groupHeaderItemRender: Z
48
- } = e, B = Array.isArray(g);
49
- let x = 0;
50
- return A.map((s, n) => {
51
- const y = u + n, F = u + n + x, _ = W ? g ? z === n : !1 : s.disabled ? !1 : X && (!B && M(s, g, r) || B && g.findIndex((ee) => M(ee, s, r)) !== -1);
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
- a !== void 0 && (c = V(s, a), n === 0 && e.showFirstGroupHeader && c ? d = c : n > 0 && (E = V(A[n - 1], a), c && E && c !== E && (d = c)));
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 && (x += 1), [
56
- $ && /* @__PURE__ */ l.createElement(
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: Z,
65
+ render: _,
65
66
  iconField: R,
66
67
  svgIconField: G,
67
68
  groupItem: s
68
69
  }
69
70
  ),
70
- /* @__PURE__ */ l.createElement(
71
- re,
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: z === n,
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: Y,
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
- })(), Q = () => {
95
- const i = e.noDataRender, r = /* @__PURE__ */ l.createElement("div", { className: v(h.noData({ c: f })), "aria-live": "polite" }, /* @__PURE__ */ l.createElement("div", null, U.toLanguageString(H, ae[H])));
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
- }, T = () => {
99
+ }, W = () => {
98
100
  if (!e.groupField)
99
- return /* @__PURE__ */ l.createElement(
101
+ return /* @__PURE__ */ a.createElement(
100
102
  "ul",
101
103
  {
102
- id: S,
104
+ id: k,
103
105
  role: "listbox",
104
106
  "aria-label": L,
105
- "aria-hidden": k ? void 0 : !0,
107
+ "aria-hidden": w ? void 0 : !0,
106
108
  "aria-setsize": N,
107
- className: b || v(h.ul({ c: f })),
108
- ref: C,
109
- style: w
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((a) => {
116
- Array.isArray(a) && a.forEach((t) => {
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((a) => {
121
+ }), r.length > 0 && i.push(r), i.map((l) => {
120
122
  var u;
121
- const t = a.find(
122
- (m) => l.isValidElement(m) && m.type === D
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__ */ l.createElement(
126
+ return /* @__PURE__ */ a.createElement(
125
127
  "ul",
126
128
  {
127
- id: o ? void 0 : S,
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(h.ul({ c: f })),
132
- ref: o ? void 0 : C,
133
- style: w
133
+ className: b || h(v.ul({ c: f })),
134
+ ref: o ? void 0 : I,
135
+ style: C
134
136
  },
135
- a
137
+ l
136
138
  );
137
139
  });
138
140
  };
139
- return p.length ? /* @__PURE__ */ l.createElement(
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 && !k ? !0 : void 0,
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
- T(),
155
- e.scroller && /* @__PURE__ */ l.createElement("div", { className: v(h.heightContainer({ c: f })) }, e.scroller)
156
- ) : Q();
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
- me as default
161
+ fe as default
160
162
  };
@@ -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
@@ -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"),r=require("@progress/kendo-react-common"),s=require("./utils.js"),E=require("@progress/kendo-react-inputs"),F=require("./ListItemIcon.js");function S(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 o=S(y),V=t=>{const{selected:n,dataItem:e,virtual:i,disabled:u,id:p,focused:C,render:d,actionsField:m,descriptionField:g,iconField:a,svgIconField:l,checkboxField:f}=t,k=r.useUnstyled(),I=k&&k.uDropDownsBase,h=c=>t.onClick(t.index,c),v=()=>{if(!f)return null;const c=s.getItemValue(e,f)||!1;return o.createElement("span",{className:"k-checkbox-wrap"},o.createElement(E.Checkbox,{checked:c,onChange:N=>{e.onCheckboxChange&&e.onCheckboxChange(e,N.value)}}))},x=()=>m?s.getItemValue(e,m):null,D=()=>{if(!g)return null;const c=s.getItemValue(e,g);return c?o.createElement("span",{className:"k-list-item-description"},c):null},b=o.createElement("li",{id:p,role:"option","aria-selected":n,"aria-disabled":u?!0:void 0,className:r.classNames(r.uDropDownsBase.li({c:I,selected:n,focused:C,disabled:u})),onClick:h,style:{position:i?"relative":"unset"}},v(),(l||a)&&o.createElement(F.ListItemIcon,{icon:a?s.getItemValue(e,a):void 0,svgIcon:l?s.getItemValue(e,l):void 0}),o.createElement("span",{className:r.classNames(r.uDropDownsBase.itemText({c:I}))},s.getItemValue(e,t.textField).toString()),x(),D());return d!==void 0?d(b,t):b};module.exports=V;
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;
@@ -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 n from "react";
9
- import { useUnstyled as N, classNames as C, uDropDownsBase as p } from "@progress/kendo-react-common";
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 S } from "@progress/kendo-react-inputs";
12
- import { ListItemIcon as w } from "./ListItemIcon.mjs";
13
- const R = (i) => {
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: r,
15
+ selected: i,
16
16
  dataItem: e,
17
- virtual: x,
17
+ virtual: p,
18
18
  disabled: l,
19
19
  id: v,
20
- focused: b,
20
+ focused: I,
21
21
  render: a,
22
22
  actionsField: d,
23
23
  descriptionField: m,
24
- iconField: c,
24
+ iconField: r,
25
25
  svgIconField: s,
26
- checkboxField: u
27
- } = i, f = N(), k = f && f.uDropDownsBase, g = (t) => i.onClick(i.index, t), I = () => {
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 t = o(e, u) || !1;
31
- return /* @__PURE__ */ n.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ n.createElement(
32
- S,
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: t,
35
- onChange: (D) => {
36
- e.onCheckboxChange && e.onCheckboxChange(e, D.value);
37
+ checked: n,
38
+ onChange: (S) => {
39
+ e.onCheckboxChange && e.onCheckboxChange(e, S.value);
37
40
  }
38
41
  }
39
42
  ));
40
- }, E = () => d ? o(e, d) : null, F = () => {
43
+ }, D = () => d ? o(e, d) : null, N = () => {
41
44
  if (!m)
42
45
  return null;
43
- const t = o(e, m);
44
- return t ? /* @__PURE__ */ n.createElement("span", { className: "k-list-item-description" }, t) : null;
45
- }, h = /* @__PURE__ */ n.createElement(
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": r,
53
+ "aria-selected": i,
51
54
  "aria-disabled": l ? !0 : void 0,
52
- className: C(
53
- p.li({
55
+ className: x(
56
+ C.li({
54
57
  c: k,
55
- selected: r,
56
- focused: b,
58
+ selected: i,
59
+ focused: I,
57
60
  disabled: l
58
61
  })
59
62
  ),
60
- onClick: g,
61
- style: { position: x ? "relative" : "unset" }
63
+ onClick: E,
64
+ style: { position: p ? "relative" : "unset" }
62
65
  },
63
- I(),
64
- (s || c) && /* @__PURE__ */ n.createElement(
65
- w,
66
+ F(),
67
+ (s || r) && /* @__PURE__ */ t.createElement(
68
+ y,
66
69
  {
67
- icon: c ? o(e, c) : void 0,
70
+ icon: r ? o(e, r) : void 0,
68
71
  svgIcon: s ? o(e, s) : void 0
69
72
  }
70
73
  ),
71
- /* @__PURE__ */ n.createElement("span", { className: C(p.itemText({ c: k })) }, o(e, i.textField).toString()),
72
- E(),
73
- F()
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(h, i) : h;
78
+ return a !== void 0 ? a(f, c) : f;
76
79
  };
77
80
  export {
78
- R as default
81
+ T as default
79
82
  };