@m4l/components 9.4.7-BE20260106-beta.1 → 9.4.8-BE20260108-beta.1

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.
@@ -143,19 +143,9 @@ const CheckableList = (props) => {
143
143
  ownerState,
144
144
  className: clsx(className, CHECKABLE_LIST_CLASSES.root),
145
145
  "data-testid": dataTestId,
146
- "aria-label": ariaLabel || "checkable list",
146
+ "aria-label": ariaLabel,
147
147
  "aria-labelledby": ariaLabelledBy,
148
- children: /* @__PURE__ */ jsx(LoadingContainerStyled, { ownerState, children: /* @__PURE__ */ jsx(
149
- Skeleton,
150
- {
151
- variant: "rectangular",
152
- width: "100%",
153
- height: 200,
154
- role: "status",
155
- "aria-label": "Cargando lista de elementos",
156
- "aria-live": "polite"
157
- }
158
- ) })
148
+ children: /* @__PURE__ */ jsx(LoadingContainerStyled, { ownerState, children: /* @__PURE__ */ jsx(Skeleton, { variant: "rectangular", width: "100%", height: 200 }) })
159
149
  }
160
150
  );
161
151
  }
@@ -166,28 +156,24 @@ const CheckableList = (props) => {
166
156
  ownerState,
167
157
  className: clsx(className, CHECKABLE_LIST_CLASSES.root),
168
158
  "data-testid": dataTestId,
169
- role: "group",
170
- "aria-label": ariaLabel || "checkable list",
159
+ "aria-label": ariaLabel,
171
160
  "aria-labelledby": ariaLabelledBy,
172
161
  children: [
173
- searchable && /* @__PURE__ */ jsx(SearchContainerStyled, { ownerState, role: "search", children: /* @__PURE__ */ jsx(
162
+ searchable && /* @__PURE__ */ jsx(SearchContainerStyled, { ownerState, children: /* @__PURE__ */ jsx(
174
163
  SearchInputStyled,
175
164
  {
176
- role: "searchbox",
177
- "aria-label": "search",
178
165
  ownerState,
179
166
  value: searchQuery,
180
167
  onChange: (e) => setSearchQuery(e.target.value),
181
168
  placeholder: getLabel(DICCTIONARY.label_search_placeholder),
182
169
  size,
183
- className: CHECKABLE_LIST_CLASSES.searchInput,
184
170
  variant: "contained",
185
171
  InputProps: {
186
172
  startAdornment: /* @__PURE__ */ jsx(Icon, { src: urlIconSearch })
187
173
  }
188
174
  }
189
175
  ) }),
190
- selectAll && hasItems && /* @__PURE__ */ jsxs(SelectAllContainerStyled, { ownerState, role: "group", "aria-label": "Seleccionar todo", children: [
176
+ selectAll && hasItems && /* @__PURE__ */ jsxs(SelectAllContainerStyled, { ownerState, children: [
191
177
  /* @__PURE__ */ jsx(
192
178
  SelectAllCheckboxStyled,
193
179
  {
@@ -210,35 +196,26 @@ const CheckableList = (props) => {
210
196
  }
211
197
  )
212
198
  ] }),
213
- /* @__PURE__ */ jsx(
214
- ListContainerStyled,
199
+ /* @__PURE__ */ jsx(ListContainerStyled, { ref: setContainerElement, ownerState: { ...ownerState }, children: hasItems ? refHeight.current > 0 ? /* @__PURE__ */ jsx(
200
+ VirtualizedListStyled,
201
+ {
202
+ ref: listRef,
203
+ height: refHeight.current,
204
+ width,
205
+ itemCount: virtualizedItems.length,
206
+ itemSize: getItemSize,
207
+ itemData: virtualizedItems,
208
+ layout: "vertical",
209
+ children: renderVirtualizedItem
210
+ }
211
+ ) : null : /* @__PURE__ */ jsx(EmptyMessageWrapperStyled, { ownerState, children: /* @__PURE__ */ jsx(
212
+ ImageText,
215
213
  {
216
- ref: setContainerElement,
217
- ownerState: { ...ownerState },
218
- "aria-multiselectable": multiple ? "true" : "false",
219
- children: hasItems ? refHeight.current > 0 ? /* @__PURE__ */ jsx(
220
- VirtualizedListStyled,
221
- {
222
- ref: listRef,
223
- height: refHeight.current,
224
- width,
225
- itemCount: virtualizedItems.length,
226
- itemSize: getItemSize,
227
- itemData: virtualizedItems,
228
- layout: "vertical",
229
- className: CHECKABLE_LIST_CLASSES.virtualizedList,
230
- children: renderVirtualizedItem
231
- }
232
- ) : null : /* @__PURE__ */ jsx(EmptyMessageWrapperStyled, { ownerState, role: "status", "aria-live": "polite", children: /* @__PURE__ */ jsx(
233
- ImageText,
234
- {
235
- title: getLabel(DICCTIONARY.label_no_results),
236
- message: getLabel(DICCTIONARY.label_no_results_description),
237
- imageUrl: urlIconNoResults
238
- }
239
- ) })
214
+ title: getLabel(DICCTIONARY.label_no_results),
215
+ message: getLabel(DICCTIONARY.label_no_results_description),
216
+ imageUrl: urlIconNoResults
240
217
  }
241
- )
218
+ ) }) })
242
219
  ]
243
220
  }
244
221
  );
@@ -10,6 +10,5 @@ export declare const DICCTIONARY: {
10
10
  readonly label_no_results_description: "checkable_list.label_no_results_description";
11
11
  readonly label_group_title: "checkable_list.label_group_title";
12
12
  readonly label_select_all: "checkable_list.label_select_all";
13
- readonly label_loading: "checkable_list.label_loading";
14
13
  };
15
14
  export type TypeDictionary = typeof DICCTIONARY;
@@ -14,27 +14,25 @@ const useCheckableListItems = ({
14
14
  return items;
15
15
  }, [items, groups, isGrouped]);
16
16
  const filteredItems = useMemo(() => {
17
- const trimmedQuery = searchQuery.trim();
18
- if (!trimmedQuery) {
17
+ if (!searchQuery.trim()) {
19
18
  return normalizedItems;
20
19
  }
21
- const query = trimmedQuery.toLowerCase();
20
+ const query = searchQuery.toLowerCase();
22
21
  const defaultFilter = (item) => item.label.toLowerCase().includes(query) || item.description?.toLowerCase().includes(query);
23
22
  return normalizedItems.filter(
24
- (item) => filterFn ? filterFn(item, trimmedQuery) : defaultFilter(item)
23
+ (item) => filterFn ? filterFn(item, searchQuery) : defaultFilter(item)
25
24
  );
26
25
  }, [normalizedItems, searchQuery, filterFn]);
27
26
  const filteredGroups = useMemo(() => {
28
- const trimmedQuery = searchQuery.trim();
29
- if (!isGrouped || !trimmedQuery) {
27
+ if (!isGrouped || !searchQuery.trim()) {
30
28
  return groups || [];
31
29
  }
32
- const normalizedQuery = trimmedQuery.toLowerCase();
30
+ const normalizedQuery = searchQuery.toLowerCase();
33
31
  const defaultGroupFilter = (candidate) => candidate.label.toLowerCase().includes(normalizedQuery) || candidate.description?.toLowerCase().includes(normalizedQuery);
34
32
  return (groups || []).map((group) => ({
35
33
  ...group,
36
34
  items: group.items.filter(
37
- (groupItem) => filterFn ? filterFn(groupItem, trimmedQuery) : defaultGroupFilter(groupItem)
35
+ (groupItem) => filterFn ? filterFn(groupItem, searchQuery) : defaultGroupFilter(groupItem)
38
36
  )
39
37
  })).filter((group) => group.items.length > 0);
40
38
  }, [groups, isGrouped, searchQuery, filterFn]);
@@ -65,10 +65,6 @@ const useCheckableListRender = ({
65
65
  ItemWrapperStyled,
66
66
  {
67
67
  ownerState: { size, variant, disabled: itemDisabled, selected: checked },
68
- role: "option",
69
- "aria-label": "item",
70
- "aria-selected": checked,
71
- "aria-disabled": itemDisabled,
72
68
  onClick: () => !itemDisabled && handleItemToggle(item.id),
73
69
  children: [
74
70
  /* @__PURE__ */ jsx(
@@ -164,48 +160,37 @@ const useCheckableListRender = ({
164
160
  )
165
161
  ] });
166
162
  const groupBodyContent = customGroupContent ?? fallbackGroupLabel;
167
- return /* @__PURE__ */ jsx(
168
- GroupWrapperStyled,
163
+ return /* @__PURE__ */ jsx(GroupWrapperStyled, { ownerState: { size, variant, grouped: true, selected: checkboxState === true }, children: /* @__PURE__ */ jsxs(
164
+ GroupHeaderStyled,
169
165
  {
170
- ownerState: { size, variant, grouped: true, selected: checkboxState === true },
171
- role: "group",
172
- "aria-label": group.label,
173
- "aria-expanded": isExpanded,
174
- "aria-disabled": groupDisabled,
175
- children: /* @__PURE__ */ jsxs(
176
- GroupHeaderStyled,
177
- {
178
- ownerState: { size, variant, disabled: groupDisabled },
179
- onClick: handleExpand,
180
- children: [
181
- showCheckboxOnGroup && /* @__PURE__ */ jsx(
182
- GroupCheckboxStyled,
183
- {
184
- checked: checkboxState === true,
185
- indeterminate: checkboxState === "indeterminate",
186
- disabled: groupDisabled,
187
- size: checkboxSize,
188
- onChange: handleToggleGroup,
189
- onClick: (e) => e.stopPropagation()
190
- }
191
- ),
192
- group.icon && /* @__PURE__ */ jsx(GroupIconStyled, { children: group.icon }),
193
- /* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 0 }, children: groupBodyContent }),
194
- groupable && /* @__PURE__ */ jsx(
195
- GroupToggleButtonStyled,
196
- {
197
- size,
198
- variant: "text",
199
- icon: isExpanded ? urlIconCompact : urlIconExpanded,
200
- onClick: handleExpand,
201
- "aria-label": isExpanded ? "Colapsar grupo" : "Expandir grupo"
202
- }
203
- )
204
- ]
205
- }
206
- )
166
+ ownerState: { size, variant, disabled: groupDisabled },
167
+ onClick: handleExpand,
168
+ children: [
169
+ showCheckboxOnGroup && /* @__PURE__ */ jsx(
170
+ GroupCheckboxStyled,
171
+ {
172
+ checked: checkboxState === true,
173
+ indeterminate: checkboxState === "indeterminate",
174
+ disabled: groupDisabled,
175
+ size: checkboxSize,
176
+ onChange: handleToggleGroup,
177
+ onClick: (e) => e.stopPropagation()
178
+ }
179
+ ),
180
+ group.icon && /* @__PURE__ */ jsx(GroupIconStyled, { children: group.icon }),
181
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 0 }, children: groupBodyContent }),
182
+ groupable && /* @__PURE__ */ jsx(
183
+ GroupToggleButtonStyled,
184
+ {
185
+ size,
186
+ variant: "text",
187
+ icon: isExpanded ? urlIconCompact : urlIconExpanded,
188
+ onClick: handleExpand
189
+ }
190
+ )
191
+ ]
207
192
  }
208
- );
193
+ ) });
209
194
  },
210
195
  [expandedGroups, disabled, isGroupFullySelected, isGroupPartiallySelected, getGroupItems, indeterminateBehavior, renderGroup, size, variant, showCheckboxOnGroup, checkboxSize, groupable, urlIconCompact, urlIconExpanded, handleGroupExpandToggle, handleGroupToggle, isItemSelected]
211
196
  );
@@ -1,12 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useEnvironment, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider, CommonFlags } from "@m4l/core";
3
3
  import { useLocales, useThemeSettingsStore } from "@m4l/graphics";
4
- import { S as SETTINGS_LAYOUT_DEFAULT_WIDTH } from "./constants.js";
4
+ import { S as SETTINGS_LAYOUT_DEFAULT_MODULE_ID, a as SETTINGS_LAYOUT_DEFAULT_WIDTH } from "./constants.js";
5
5
  import { useMemo } from "react";
6
6
  import { S as SettingsLayoutBase } from "./subcomponents/SettingsLayoutBase/SettingsLayoutBase.js";
7
7
  const SettingsLayout = (props) => {
8
8
  const {
9
- width = SETTINGS_LAYOUT_DEFAULT_WIDTH
9
+ width = SETTINGS_LAYOUT_DEFAULT_WIDTH,
10
+ moduleId = SETTINGS_LAYOUT_DEFAULT_MODULE_ID
10
11
  } = props;
11
12
  const currentLang = useLocales().currentLocale?.localeString;
12
13
  const { host_static_assets, environment_assets } = useEnvironment();
@@ -22,7 +23,7 @@ const SettingsLayout = (props) => {
22
23
  ModuleDictionaryProvider,
23
24
  {
24
25
  isAuth: false,
25
- moduleId: "theme_settings",
26
+ moduleId,
26
27
  componentsDictionary,
27
28
  currentLang,
28
29
  children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, { flags: [CommonFlags.FLAG_DICTIONARY_LOADED], children: /* @__PURE__ */ jsx(SettingsLayoutBase, { prefixPathIcon, width }) })
@@ -5,3 +5,4 @@ import { SettingsLayoutSlots } from './slots/SettingsLayoutEnum';
5
5
  export declare const SETTINGS_LAYOUT_COMPONENT_KEY = "M4LSettingsLayout";
6
6
  export declare const SETTINGS_LAYOUT_CLASSES: Record<keyof typeof SettingsLayoutSlots, string>;
7
7
  export declare const SETTINGS_LAYOUT_DEFAULT_WIDTH = 300;
8
+ export declare const SETTINGS_LAYOUT_DEFAULT_MODULE_ID = "theme_settings";
@@ -3,8 +3,10 @@ import { S as SettingsLayoutSlots } from "./slots/SettingsLayoutEnum.js";
3
3
  const SETTINGS_LAYOUT_COMPONENT_KEY = "M4LSettingsLayout";
4
4
  const SETTINGS_LAYOUT_CLASSES = getComponentClasses(SETTINGS_LAYOUT_COMPONENT_KEY, SettingsLayoutSlots);
5
5
  const SETTINGS_LAYOUT_DEFAULT_WIDTH = 300;
6
+ const SETTINGS_LAYOUT_DEFAULT_MODULE_ID = "theme_settings";
6
7
  export {
7
- SETTINGS_LAYOUT_DEFAULT_WIDTH as S,
8
- SETTINGS_LAYOUT_COMPONENT_KEY as a,
9
- SETTINGS_LAYOUT_CLASSES as b
8
+ SETTINGS_LAYOUT_DEFAULT_MODULE_ID as S,
9
+ SETTINGS_LAYOUT_DEFAULT_WIDTH as a,
10
+ SETTINGS_LAYOUT_COMPONENT_KEY as b,
11
+ SETTINGS_LAYOUT_CLASSES as c
10
12
  };
@@ -1,6 +1,6 @@
1
1
  import { styled } from "@mui/material/styles";
2
2
  import { S as SettingsLayoutSlots } from "./SettingsLayoutEnum.js";
3
- import { a as SETTINGS_LAYOUT_COMPONENT_KEY } from "../constants.js";
3
+ import { b as SETTINGS_LAYOUT_COMPONENT_KEY } from "../constants.js";
4
4
  import { s as settingsLayoutStyles } from "../SettingsLayout.styles.js";
5
5
  import { Backdrop } from "@mui/material";
6
6
  import { I as Icon } from "../../Icon/Icon.js";
@@ -6,7 +6,7 @@ import { B as BackdropStyled, g as SettingsLayoutRootStyled, H as HeaderContaine
6
6
  import { S as SettingDirection } from "../SettingDirection/SettingDirection.js";
7
7
  import { D as DICTIONARY } from "../../dictionary.js";
8
8
  import { useThemeSettingsStore } from "@m4l/graphics";
9
- import { b as SETTINGS_LAYOUT_CLASSES } from "../../constants.js";
9
+ import { c as SETTINGS_LAYOUT_CLASSES } from "../../constants.js";
10
10
  import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
11
11
  import { S as SettingMode } from "../SettingMode/SettingMode.js";
12
12
  import { S as SettingColorPresets } from "../SettingColorPresets/SettingColorPresets.js";
@@ -21,6 +21,10 @@ export interface SettingsLayoutProps {
21
21
  * Identificador usado para pruebas del componente.
22
22
  */
23
23
  dataTestId?: string;
24
+ /**
25
+ * Identificador del módulo.
26
+ */
27
+ moduleId?: string;
24
28
  }
25
29
  /**
26
30
  * Tipo para las ranuras del componente.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.4.7-BE20260106-beta.1",
3
+ "version": "9.4.8-BE20260108-beta.1",
4
4
  "license": "UNLICENSED",
5
5
  "description": "M4L Components",
6
6
  "lint-staged": {
@@ -1 +0,0 @@
1
- export {};