@m4l/components 9.49.0 → 9.50.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CheckableList.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/CheckableList/CheckableList.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AA8BjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,qDA8QtD,CAAC"}
1
+ {"version":3,"file":"CheckableList.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/CheckableList/CheckableList.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAgCjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,qDAiStD,CAAC"}
@@ -1,137 +1,138 @@
1
- import { jsx as e, jsxs as H } from "@emotion/react/jsx-runtime";
2
- import { useRef as R } from "react";
3
- import _ from "clsx";
4
- import { CHECKABLE_LIST_CLASSES as s } from "./constants.js";
5
- import { useModuleDictionary as ue } from "@m4l/core";
1
+ import { jsx as e, jsxs as T } from "@emotion/react/jsx-runtime";
2
+ import { useRef as _ } from "react";
3
+ import v from "clsx";
4
+ import { CHECKABLE_LIST_CLASSES as d } from "./constants.js";
5
+ import { useModuleDictionary as ge } from "@m4l/core";
6
6
  import { DICCTIONARY as c } from "./dictionary.js";
7
- import { useSizeContainer as he } from "../../hooks/useSizeContainer/index.js";
8
- import { useStateRef as pe } from "../../hooks/useStateRef/index.js";
9
- import { Icon as ge } from "@m4l/base";
10
- import { useCheckableListState as Se } from "./hooks/useCheckableListState.js";
11
- import { useCheckableListItems as fe } from "./hooks/useCheckableListItems.js";
12
- import { useCheckableListSelection as be } from "./hooks/useCheckableListSelection.js";
13
- import { useCheckableListHandlers as Ce } from "./hooks/useCheckableListHandlers.js";
14
- import { useCheckableListVirtualization as Ie } from "./hooks/useCheckableListVirtualization.js";
15
- import { useCheckableListRender as ye } from "./hooks/useCheckableListRender.js";
16
- import { RootStyled as A, LoadingContainerStyled as Le, SearchContainerStyled as ke, SearchInputStyled as xe, SelectAllContainerStyled as ve, SelectAllCheckboxStyled as ze, ChipCountTypografyStyled as Ge, ListContainerStyled as He, VirtualizedListStyled as Re, EmptyMessageWrapperStyled as _e } from "./slots/styled.js";
17
- import { Skeleton as Ae } from "../extended/mui/Skeleton/Skeleton.js";
18
- import { ImageText as Te } from "../ImageText/ImageText.js";
19
- const Xe = (T) => {
7
+ import { useSizeContainer as Se } from "../../hooks/useSizeContainer/index.js";
8
+ import { useStateRef as fe } from "../../hooks/useStateRef/index.js";
9
+ import { Icon as be } from "@m4l/base";
10
+ import { useCheckableListState as Ce } from "./hooks/useCheckableListState.js";
11
+ import { useCheckableListItems as ye } from "./hooks/useCheckableListItems.js";
12
+ import { useCheckableListSelection as Ie } from "./hooks/useCheckableListSelection.js";
13
+ import { useCheckableListHandlers as xe } from "./hooks/useCheckableListHandlers.js";
14
+ import { useCheckableListVirtualization as Le } from "./hooks/useCheckableListVirtualization.js";
15
+ import { useCheckableListRender as ke } from "./hooks/useCheckableListRender.js";
16
+ import { RootStyled as A, LoadingContainerStyled as we, SearchContainerStyled as ze, SearchInputStyled as He, SelectAllContainerStyled as Re, SelectAllCheckboxStyled as Ge, ChipCountTypografyStyled as Te, ListContainerStyled as _e, VirtualizedListStyled as ve, VirtualContainerStyled as Ae, VirtualRowStyled as Ee, EmptyMessageWrapperStyled as Ne } from "./slots/styled.js";
17
+ import { Skeleton as Ve } from "../extended/mui/Skeleton/Skeleton.js";
18
+ import { ImageText as Be } from "../ImageText/ImageText.js";
19
+ const rt = (E) => {
20
20
  const {
21
- value: r = [],
22
- onChange: w,
23
- items: E = [],
24
- groups: d,
25
- multiple: m = !0,
26
- selectAll: N = !1,
27
- groupable: B = !0,
21
+ value: l = [],
22
+ onChange: N,
23
+ items: V = [],
24
+ groups: m,
25
+ multiple: u = !0,
26
+ selectAll: B = !1,
27
+ groupable: j = !0,
28
28
  expandAllGroups: D = !0,
29
- searchable: V = !1,
30
- filterFn: j,
31
- size: l = "medium",
29
+ searchable: F = !1,
30
+ filterFn: M,
31
+ size: a = "medium",
32
32
  variant: g = "standard",
33
- width: F = "100%",
33
+ width: O = "100%",
34
34
  checkboxSize: S = "medium",
35
- showCheckboxOnGroup: M = !0,
36
- indeterminateBehavior: O = "indicate-some",
35
+ showCheckboxOnGroup: P = !0,
36
+ indeterminateBehavior: Q = "indicate-some",
37
37
  className: f,
38
38
  "data-testid": b,
39
39
  ariaLabel: C,
40
- ariaLabelledBy: I,
41
- renderItem: P,
42
- renderGroup: Q,
43
- loading: K = !1,
44
- disabled: a = !1,
45
- itemRowHeight: U,
46
- groupRowHeight: W
47
- } = T, Y = R(null), [q, J] = pe(null), i = he(q, {
40
+ ariaLabelledBy: y,
41
+ renderItem: W,
42
+ renderGroup: K,
43
+ loading: U = !1,
44
+ disabled: i = !1,
45
+ itemRowHeight: Y,
46
+ groupRowHeight: q
47
+ } = E, I = _(null), [J, X] = fe(null), o = Se(J, {
48
48
  // excludePadding: true,
49
- }), { getLabel: o } = ue(), n = R(i?.containerHeight ?? 0);
50
- n.current !== i?.containerHeight && i?.containerHeight !== 0 && (n.current = i?.containerHeight ?? 0);
49
+ }), { getLabel: n } = ge(), s = _(o?.containerHeight ?? 0);
50
+ s.current !== o?.containerHeight && o?.containerHeight !== 0 && (s.current = o?.containerHeight ?? 0);
51
51
  const {
52
- searchQuery: y,
53
- setSearchQuery: X,
52
+ searchQuery: x,
53
+ setSearchQuery: Z,
54
54
  expandedGroups: L,
55
- itemHeights: Z,
56
- handleGroupExpandToggle: $
57
- } = Se({
58
- groups: d,
55
+ itemHeights: $,
56
+ handleGroupExpandToggle: ee
57
+ } = Ce({
58
+ groups: m,
59
59
  expandAllGroups: D
60
60
  }), {
61
- isGrouped: u,
61
+ isGrouped: h,
62
62
  normalizedItems: k,
63
- filteredItems: ee,
64
- filteredGroups: te,
65
- virtualizedItems: h
66
- } = fe({
67
- items: E,
68
- groups: d,
69
- searchQuery: y,
70
- filterFn: j,
63
+ filteredItems: te,
64
+ filteredGroups: re,
65
+ virtualizedItems: w
66
+ } = ye({
67
+ items: V,
68
+ groups: m,
69
+ searchQuery: x,
70
+ filterFn: M,
71
71
  expandedGroups: L
72
72
  }), {
73
- getGroupItems: x,
74
- isItemSelected: v,
75
- isGroupFullySelected: z,
76
- isGroupPartiallySelected: re,
73
+ getGroupItems: z,
74
+ isItemSelected: H,
75
+ isGroupFullySelected: R,
76
+ isGroupPartiallySelected: le,
77
77
  areAllItemsSelected: p,
78
- areSomeItemsSelected: le
79
- } = be({
80
- value: r,
78
+ areSomeItemsSelected: ae
79
+ } = Ie({
80
+ value: l,
81
81
  normalizedItems: k,
82
- groups: d,
83
- isGrouped: u
84
- }), { handleItemToggle: ae, handleGroupToggle: ie, handleSelectAllToggle: oe } = Ce({
85
- value: r,
86
- onChange: w,
87
- multiple: m,
88
- disabled: a,
82
+ groups: m,
83
+ isGrouped: h
84
+ }), { handleItemToggle: ie, handleGroupToggle: oe, handleSelectAllToggle: ne } = xe({
85
+ value: l,
86
+ onChange: N,
87
+ multiple: u,
88
+ disabled: i,
89
89
  normalizedItems: k,
90
- getGroupItems: x,
91
- isGroupFullySelected: z,
92
- isItemSelected: v,
90
+ getGroupItems: z,
91
+ isGroupFullySelected: R,
92
+ isItemSelected: H,
93
93
  areAllItemsSelected: p
94
- }), { getItemSize: ne } = Ie({
95
- virtualizedItems: h,
96
- itemHeights: Z,
97
- defaultItemRowHeight: U,
98
- defaultGroupRowHeight: W
99
- }), { renderVirtualizedItem: se, urlIconSearch: ce, urlIconNoResults: de } = ye({
100
- isItemSelected: v,
101
- disabled: a,
102
- size: l,
94
+ }), { getItemSize: se, virtualizer: de, virtualItems: ce, totalSize: me } = Le({
95
+ virtualizedItems: w,
96
+ itemHeights: $,
97
+ defaultItemRowHeight: Y,
98
+ defaultGroupRowHeight: q,
99
+ scrollElementRef: I
100
+ }), { renderVirtualizedItem: ue, urlIconSearch: he, urlIconNoResults: pe } = ke({
101
+ isItemSelected: H,
102
+ disabled: i,
103
+ size: a,
103
104
  variant: g,
104
105
  checkboxSize: S,
105
- handleItemToggle: ae,
106
- renderItem: P,
106
+ handleItemToggle: ie,
107
+ renderItem: W,
107
108
  expandedGroups: L,
108
- isGroupFullySelected: z,
109
- isGroupPartiallySelected: re,
110
- getGroupItems: x,
111
- indeterminateBehavior: O,
112
- renderGroup: Q,
113
- groupable: B,
114
- showCheckboxOnGroup: M,
115
- handleGroupExpandToggle: $,
116
- handleGroupToggle: ie
109
+ isGroupFullySelected: R,
110
+ isGroupPartiallySelected: le,
111
+ getGroupItems: z,
112
+ indeterminateBehavior: Q,
113
+ renderGroup: K,
114
+ groupable: j,
115
+ showCheckboxOnGroup: P,
116
+ handleGroupExpandToggle: ee,
117
+ handleGroupToggle: oe
117
118
  }), t = {
118
- size: l,
119
+ size: a,
119
120
  variant: g,
120
- disabled: a,
121
- grouped: u,
122
- hasSelected: r.length > 0
121
+ disabled: i,
122
+ grouped: h,
123
+ hasSelected: l.length > 0
123
124
  };
124
- if (K)
125
+ if (U)
125
126
  return /* @__PURE__ */ e(
126
127
  A,
127
128
  {
128
129
  ownerState: t,
129
- className: _(f, s.root),
130
+ className: v(f, d.root),
130
131
  "data-testid": b,
131
132
  "aria-label": C || "checkable list",
132
- "aria-labelledby": I,
133
- children: /* @__PURE__ */ e(Le, { ownerState: t, children: /* @__PURE__ */ e(
134
- Ae,
133
+ "aria-labelledby": y,
134
+ children: /* @__PURE__ */ e(we, { ownerState: t, children: /* @__PURE__ */ e(
135
+ Ve,
135
136
  {
136
137
  variant: "rectangular",
137
138
  width: "100%",
@@ -143,82 +144,97 @@ const Xe = (T) => {
143
144
  ) })
144
145
  }
145
146
  );
146
- const G = u ? te.length > 0 : ee.length > 0;
147
- return /* @__PURE__ */ H(
147
+ const G = h ? re.length > 0 : te.length > 0;
148
+ return /* @__PURE__ */ T(
148
149
  A,
149
150
  {
150
151
  ownerState: t,
151
- className: _(f, s.root),
152
+ className: v(f, d.root),
152
153
  "data-testid": b,
153
154
  role: "group",
154
155
  "aria-label": C || "checkable list",
155
- "aria-labelledby": I,
156
+ "aria-labelledby": y,
156
157
  children: [
157
- V && /* @__PURE__ */ e(ke, { ownerState: t, role: "search", children: /* @__PURE__ */ e(
158
- xe,
158
+ F && /* @__PURE__ */ e(ze, { ownerState: t, role: "search", children: /* @__PURE__ */ e(
159
+ He,
159
160
  {
160
161
  role: "searchbox",
161
162
  "aria-label": "search",
162
163
  ownerState: t,
163
- value: y,
164
- onChange: (me) => X(me.target.value),
165
- placeholder: o(c.label_search_placeholder),
166
- size: l,
167
- className: s.searchInput,
164
+ value: x,
165
+ onChange: (r) => Z(r.target.value),
166
+ placeholder: n(c.label_search_placeholder),
167
+ size: a,
168
+ className: d.searchInput,
168
169
  variant: "contained",
169
170
  InputProps: {
170
- startAdornment: /* @__PURE__ */ e(ge, { src: ce })
171
+ startAdornment: /* @__PURE__ */ e(be, { src: he })
171
172
  }
172
173
  }
173
174
  ) }),
174
- N && G && m && /* @__PURE__ */ H(ve, { ownerState: t, role: "group", "aria-label": "Seleccionar todo", children: [
175
+ B && G && u && /* @__PURE__ */ T(Re, { ownerState: t, role: "group", "aria-label": "Seleccionar todo", children: [
175
176
  /* @__PURE__ */ e(
176
- ze,
177
+ Ge,
177
178
  {
178
179
  checked: p,
179
- indeterminate: le && !p,
180
- disabled: a,
180
+ indeterminate: ae && !p,
181
+ disabled: i,
181
182
  size: S,
182
- onChange: oe,
183
- inlineText: o(c.label_select_all)
183
+ onChange: ne,
184
+ inlineText: n(c.label_select_all)
184
185
  }
185
186
  ),
186
187
  /* @__PURE__ */ e(
187
- Ge,
188
+ Te,
188
189
  {
189
190
  ownerState: t,
190
191
  variant: "bodyStandard",
191
- size: l,
192
+ size: a,
192
193
  color: "text.disabled",
193
- children: r.length
194
+ children: l.length
194
195
  }
195
196
  )
196
197
  ] }),
197
198
  /* @__PURE__ */ e(
198
- He,
199
+ _e,
199
200
  {
200
- ref: J,
201
+ ref: X,
201
202
  ownerState: { ...t },
202
- "aria-multiselectable": m ? "true" : "false",
203
- children: G ? n.current > 0 ? /* @__PURE__ */ e(
204
- Re,
203
+ "aria-multiselectable": u ? "true" : "false",
204
+ children: G ? s.current > 0 ? /* @__PURE__ */ e(
205
+ ve,
205
206
  {
206
- ref: Y,
207
- height: n.current,
208
- width: F,
209
- itemCount: h.length,
210
- itemSize: ne,
211
- itemData: h,
212
- layout: "vertical",
213
- className: s.virtualizedList,
214
- children: se
207
+ ref: I,
208
+ ownerState: {
209
+ ...t,
210
+ listHeight: s.current,
211
+ listWidth: O
212
+ },
213
+ className: d.virtualizedList,
214
+ children: /* @__PURE__ */ e(Ae, { ownerState: { ...t, totalSize: me }, children: ce.map((r) => /* @__PURE__ */ e(
215
+ Ee,
216
+ {
217
+ ref: de.measureElement,
218
+ "data-index": r.index,
219
+ ownerState: {
220
+ ...t,
221
+ offsetTop: r.start,
222
+ minRowHeight: se(r.index)
223
+ },
224
+ children: ue({
225
+ index: r.index,
226
+ virtualizedItems: w
227
+ })
228
+ },
229
+ r.key
230
+ )) })
215
231
  }
216
- ) : null : /* @__PURE__ */ e(_e, { ownerState: t, role: "status", "aria-live": "polite", children: /* @__PURE__ */ e(
217
- Te,
232
+ ) : null : /* @__PURE__ */ e(Ne, { ownerState: t, role: "status", "aria-live": "polite", children: /* @__PURE__ */ e(
233
+ Be,
218
234
  {
219
- title: o(c.label_no_results),
220
- message: o(c.label_no_results_description),
221
- imageUrl: de
235
+ title: n(c.label_no_results),
236
+ message: n(c.label_no_results_description),
237
+ imageUrl: pe
222
238
  }
223
239
  ) })
224
240
  }
@@ -228,5 +244,5 @@ const Xe = (T) => {
228
244
  );
229
245
  };
230
246
  export {
231
- Xe as CheckableList
247
+ rt as CheckableList
232
248
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckableList.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/CheckableList/CheckableList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,mBAAmB,EAAE,mBAiQjC,CAAC"}
1
+ {"version":3,"file":"CheckableList.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/CheckableList/CheckableList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,mBAAmB,EAAE,mBA8RjC,CAAC"}
@@ -1,10 +1,10 @@
1
- import { getContrastTextColor as r } from "@m4l/graphics";
1
+ import { getContrastTextColor as t } from "@m4l/graphics";
2
2
  import { getSizeStyles as s } from "../../utils/getSizeStyles/getSizeStyles.js";
3
3
  const n = {
4
4
  /**
5
5
  * Root: Estilos del contenedor principal del componente.
6
6
  */
7
- root: ({ theme: e, ownerState: a }) => ({
7
+ root: ({ theme: e, ownerState: i }) => ({
8
8
  width: "100%",
9
9
  // height: '100%',
10
10
  flexGrow: 1,
@@ -12,7 +12,7 @@ const n = {
12
12
  display: "flex",
13
13
  flexDirection: "column",
14
14
  gap: e.vars.size.baseSpacings.sp2,
15
- ...a?.disabled && {
15
+ ...i?.disabled && {
16
16
  opacity: 0.6,
17
17
  pointerEvents: "none"
18
18
  }
@@ -27,11 +27,11 @@ const n = {
27
27
  /**
28
28
  * searchInput: Estilos del input de búsqueda.
29
29
  */
30
- searchInput: ({ theme: e, ownerState: a }) => ({
30
+ searchInput: ({ theme: e, ownerState: i }) => ({
31
31
  width: "100%",
32
- ...s(e, a?.size || "medium", "container", (i) => ({
33
- height: i,
34
- minHeight: i
32
+ ...s(e, i?.size || "medium", "container", (a) => ({
33
+ height: a,
34
+ minHeight: a
35
35
  }))
36
36
  }),
37
37
  /**
@@ -55,7 +55,7 @@ const n = {
55
55
  /**
56
56
  * listContainer: Estilos del contenedor de la lista.
57
57
  */
58
- listContainer: ({ theme: e, ownerState: a }) => ({
58
+ listContainer: ({ theme: e, ownerState: i }) => ({
59
59
  flex: 1,
60
60
  overflow: "hidden",
61
61
  display: "flex",
@@ -64,25 +64,51 @@ const n = {
64
64
  // border: `1px solid ${theme.vars.palette.border.secondary}`,
65
65
  // borderRadius: theme.vars.size.borderRadius.r2,
66
66
  backgroundColor: e.vars.palette.background.default,
67
- ...a?.maxHeight && {
68
- maxHeight: typeof a.maxHeight == "number" ? `${a.maxHeight}px` : a.maxHeight
67
+ ...i?.maxHeight && {
68
+ maxHeight: typeof i.maxHeight == "number" ? `${i.maxHeight}px` : i.maxHeight
69
69
  }
70
70
  }),
71
71
  /**
72
72
  * virtualizedList: Estilos de la lista virtualizada.
73
+ * Es el elemento scrolleable que TanStack Virtual observa (`getScrollElement`).
74
+ * El alto lo aporta `useSizeContainer` a través de `ownerState.listHeight`, igual que antes se
75
+ * pasaba como prop `height` a react-window.
73
76
  */
74
- virtualizedList: () => ({
77
+ virtualizedList: ({ ownerState: e }) => ({
78
+ width: typeof e?.listWidth == "number" ? `${e.listWidth}px` : e?.listWidth ?? "100%",
79
+ height: e?.listHeight ? `${e.listHeight}px` : "100%",
80
+ overflow: "auto"
81
+ }),
82
+ /**
83
+ * virtualContainer: Contenedor que reserva la altura total del contenido virtualizado.
84
+ * Define el área scrolleable; su alto es la suma de todas las filas (`getTotalSize`).
85
+ */
86
+ virtualContainer: ({ ownerState: e }) => ({
87
+ width: "100%",
88
+ position: "relative",
89
+ height: `${e?.totalSize ?? 0}px`
90
+ }),
91
+ /**
92
+ * virtualRow: Wrapper de cada fila virtualizada, posicionada por TanStack Virtual.
93
+ * `minHeight` usa la altura estimada por `getItemSize`, de modo que las filas conservan su
94
+ * altura habitual pero pueden crecer cuando el contenido real lo requiere.
95
+ */
96
+ virtualRow: ({ ownerState: e }) => ({
97
+ position: "absolute",
98
+ top: 0,
99
+ left: 0,
75
100
  width: "100%",
76
- height: "100%"
101
+ minHeight: `${e?.minRowHeight ?? 0}px`,
102
+ transform: `translateY(${e?.offsetTop ?? 0}px)`
77
103
  }),
78
104
  /**
79
105
  * itemWrapper: Estilos del contenedor de cada item.
80
106
  */
81
- itemWrapper: ({ theme: e, ownerState: a }) => ({
107
+ itemWrapper: ({ theme: e, ownerState: i }) => ({
82
108
  display: "flex",
83
109
  alignItems: "center",
84
110
  height: "100%",
85
- backgroundColor: a?.selected ? e.vars.palette.primary.opacity : "transparent",
111
+ backgroundColor: i?.selected ? e.vars.palette.primary.opacity : "transparent",
86
112
  // borderBottom: `1px solid ${theme.vars.palette.border.secondary}`,
87
113
  gap: e.vars.size.baseSpacings["sp2-5"],
88
114
  padding: e.vars.size.baseSpacings["sp1-5"],
@@ -97,11 +123,11 @@ const n = {
97
123
  /**
98
124
  * itemCheckbox: Estilos del checkbox del item.
99
125
  */
100
- itemCheckbox: ({ theme: e, ownerState: a }) => ({
126
+ itemCheckbox: ({ theme: e, ownerState: i }) => ({
101
127
  flexShrink: 0,
102
- ...s(e, a?.size || "medium", "action", (i) => ({
103
- width: i,
104
- height: i
128
+ ...s(e, i?.size || "medium", "action", (a) => ({
129
+ width: a,
130
+ height: a
105
131
  }))
106
132
  }),
107
133
  /**
@@ -129,18 +155,18 @@ const n = {
129
155
  alignItems: "center",
130
156
  justifyContent: "center",
131
157
  flexShrink: 0,
132
- ...s(e, "medium", "action", (a) => ({
133
- width: a,
134
- height: a
158
+ ...s(e, "medium", "action", (i) => ({
159
+ width: i,
160
+ height: i
135
161
  }))
136
162
  }),
137
163
  /**
138
164
  * groupWrapper: Estilos del contenedor del grupo.
139
165
  */
140
- groupWrapper: ({ theme: e, ownerState: a }) => ({
166
+ groupWrapper: ({ theme: e, ownerState: i }) => ({
141
167
  display: "flex",
142
168
  flexDirection: "column",
143
- backgroundColor: a?.selected ? e.vars.palette.primary.opacity : "transparent",
169
+ backgroundColor: i?.selected ? e.vars.palette.primary.opacity : "transparent",
144
170
  borderBottom: `1px solid ${e.vars.palette.border.secondary}`,
145
171
  "&:last-child": {
146
172
  borderBottom: "none"
@@ -183,13 +209,13 @@ const n = {
183
209
  /**
184
210
  * chipCount: Estilos del contador del grupo.
185
211
  */
186
- chipCount: ({ theme: e, ownerState: a }) => ({
212
+ chipCount: ({ theme: e, ownerState: i }) => ({
187
213
  "&&& ": {
188
214
  borderRadius: e.vars.size.borderRadius["r1-5"],
189
215
  paddingLeft: e.vars.size.baseSpacings.sp1,
190
216
  paddingRight: e.vars.size.baseSpacings.sp1,
191
- backgroundColor: a?.color ?? e.vars.palette.background.surface,
192
- color: a?.color ? r(a?.color) : e.vars.palette.text.secondary
217
+ backgroundColor: i?.color ?? e.vars.palette.background.surface,
218
+ color: i?.color ? t(i?.color) : e.vars.palette.text.secondary
193
219
  }
194
220
  }),
195
221
  /**
@@ -200,19 +226,19 @@ const n = {
200
226
  alignItems: "center",
201
227
  justifyContent: "center",
202
228
  flexShrink: 0,
203
- ...s(e, "medium", "action", (a) => ({
204
- width: a,
205
- height: a
229
+ ...s(e, "medium", "action", (i) => ({
230
+ width: i,
231
+ height: i
206
232
  }))
207
233
  }),
208
234
  /**
209
235
  * groupToggleButton: Estilos del botón para expandir/colapsar grupo.
210
236
  */
211
- groupToggleButton: ({ theme: e, ownerState: a }) => ({
237
+ groupToggleButton: ({ theme: e, ownerState: i }) => ({
212
238
  flexShrink: 0,
213
- ...s(e, a?.size || "medium", "action", (i) => ({
214
- width: i,
215
- height: i
239
+ ...s(e, i?.size || "medium", "action", (a) => ({
240
+ width: a,
241
+ height: a
216
242
  }))
217
243
  }),
218
244
  /**
@@ -1,6 +1,11 @@
1
1
  export declare const CHECKABLE_LIST_KEY_COMPONENT = "M4LCheckableList";
2
- export declare const CHECKABLE_LIST_CLASSES: Record<"root" | "searchContainer" | "searchInput" | "selectAllContainer" | "selectAllCheckbox" | "listContainer" | "virtualizedList" | "itemWrapper" | "itemCheckbox" | "itemContentWrapper" | "itemLabel" | "itemDescription" | "itemIcon" | "groupWrapper" | "groupHeader" | "groupCheckbox" | "groupLabelCountWrapper" | "groupLabel" | "chipCount" | "groupIcon" | "groupToggleButton" | "groupItems" | "emptyMessageWrapper" | "loadingContainer", string>;
2
+ export declare const CHECKABLE_LIST_CLASSES: Record<"root" | "searchContainer" | "searchInput" | "selectAllContainer" | "selectAllCheckbox" | "listContainer" | "virtualizedList" | "virtualContainer" | "virtualRow" | "itemWrapper" | "itemCheckbox" | "itemContentWrapper" | "itemLabel" | "itemDescription" | "itemIcon" | "groupWrapper" | "groupHeader" | "groupCheckbox" | "groupLabelCountWrapper" | "groupLabel" | "chipCount" | "groupIcon" | "groupToggleButton" | "groupItems" | "emptyMessageWrapper" | "loadingContainer", string>;
3
3
  export declare const CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT = 36;
4
4
  export declare const CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT_WITH_DESCRIPTION = 46;
5
5
  export declare const CHECKABLE_LIST_DEFAULT_GROUP_ROW_HEIGHT = 36;
6
+ /**
7
+ * Cantidad de filas que TanStack Virtual monta fuera del viewport, arriba y abajo.
8
+ * Evita ver huecos en blanco durante el scroll rápido.
9
+ */
10
+ export declare const CHECKABLE_LIST_VIRTUALIZER_OVERSCAN = 5;
6
11
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/CheckableList/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,eAAO,MAAM,sBAAsB,icAGlC,CAAC;AAEF,eAAO,MAAM,sCAAsC,KAAK,CAAC;AACzD,eAAO,MAAM,uDAAuD,KAAK,CAAC;AAC1E,eAAO,MAAM,uCAAuC,KAAK,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/CheckableList/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,eAAO,MAAM,sBAAsB,qeAGlC,CAAC;AAEF,eAAO,MAAM,sCAAsC,KAAK,CAAC;AACzD,eAAO,MAAM,uDAAuD,KAAK,CAAC;AAC1E,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,mCAAmC,IAAI,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import { getComponentClasses as E } from "../../utils/getComponentSlotRoot.js";
2
2
  import { CheckableListSlots as _ } from "./slots/slots.js";
3
- const C = "M4LCheckableList", o = E(
3
+ const C = "M4LCheckableList", I = E(
4
4
  C,
5
5
  _
6
- ), t = 36, I = 46, H = 36;
6
+ ), o = 36, t = 46, H = 36, s = 5;
7
7
  export {
8
- o as CHECKABLE_LIST_CLASSES,
8
+ I as CHECKABLE_LIST_CLASSES,
9
9
  H as CHECKABLE_LIST_DEFAULT_GROUP_ROW_HEIGHT,
10
- t as CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT,
11
- I as CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT_WITH_DESCRIPTION,
12
- C as CHECKABLE_LIST_KEY_COMPONENT
10
+ o as CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT,
11
+ t as CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT_WITH_DESCRIPTION,
12
+ C as CHECKABLE_LIST_KEY_COMPONENT,
13
+ s as CHECKABLE_LIST_VIRTUALIZER_OVERSCAN
13
14
  };
@@ -1,7 +1,6 @@
1
1
  import { MouseEvent, ChangeEvent } from 'react';
2
- import { ListChildComponentProps } from 'react-window';
3
2
  import { Sizes } from '@m4l/styles';
4
- import { CheckableListItem, CheckableListGroup, CheckableListRenderItemParams } from '../types';
3
+ import { CheckableListItem, CheckableListGroup, CheckableListRenderItemParams, RenderVirtualizedItemParams } from '../types';
5
4
  export interface CheckableListRenderGroupParams {
6
5
  group: CheckableListGroup;
7
6
  items: CheckableListItem[];
@@ -41,7 +40,7 @@ interface UseCheckableListRenderProps {
41
40
  interface UseCheckableListRenderReturn {
42
41
  renderItemContent: (item: CheckableListItem, index: number) => React.ReactNode;
43
42
  renderGroupContent: (group: CheckableListGroup, index: number) => React.ReactNode;
44
- renderVirtualizedItem: (props: ListChildComponentProps) => React.ReactNode;
43
+ renderVirtualizedItem: (params: RenderVirtualizedItemParams) => React.ReactNode;
45
44
  urlIconSearch: string;
46
45
  urlIconNoResults: string;
47
46
  }