@m4l/components 9.3.24-JT04112025.beta.1 → 9.3.24-JT04112025.beta.3

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.
Files changed (152) hide show
  1. package/@types/export.d.ts +6 -0
  2. package/@types/types.d.ts +26 -1
  3. package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +8 -17
  4. package/components/CommonActions/components/ActionFormCancel/types.d.ts +0 -9
  5. package/components/DataGrid/DataGrid.js +6 -2
  6. package/components/DataGrid/Datagrid.styles.js +67 -18
  7. package/components/DataGrid/constants.d.ts +19 -0
  8. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +1 -2
  9. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +3 -6
  10. package/components/DataGrid/formatters/ColumnIconFormatter/index.d.ts +0 -1
  11. package/components/DataGrid/formatters/ColumnIconFormatter/types.d.ts +2 -4
  12. package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +7 -1
  13. package/components/DataGrid/formatters/ColumnSetCheckFormatter/types.d.ts +1 -0
  14. package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.d.ts +8 -0
  15. package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.js +16 -0
  16. package/components/DataGrid/formatters/ColumnTagsFormatter/index.d.ts +3 -0
  17. package/components/DataGrid/formatters/ColumnTagsFormatter/index.js +1 -0
  18. package/components/DataGrid/formatters/ColumnTagsFormatter/types.d.ts +5 -0
  19. package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.d.ts +9 -0
  20. package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.js +60 -0
  21. package/components/DataGrid/formatters/index.d.ts +1 -0
  22. package/components/DataGrid/hooks/useModalCardDetail.d.ts +2 -2
  23. package/components/DataGrid/hooks/useModalCardDetail.js +49 -48
  24. package/components/DataGrid/index.d.ts +1 -1
  25. package/components/DataGrid/slots/DataGridEnum.d.ts +2 -0
  26. package/components/DataGrid/slots/DataGridEnum.js +2 -0
  27. package/components/DataGrid/slots/DataGridSlot.d.ts +3 -1
  28. package/components/DataGrid/slots/DataGridSlot.js +45 -37
  29. package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.d.ts +18 -0
  30. package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.js +10 -0
  31. package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.d.ts +9 -0
  32. package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.js +25 -0
  33. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -2
  34. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +62 -73
  35. package/components/DataGrid/subcomponents/Cards/index.js +71 -16
  36. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +36 -18
  37. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.d.ts +1 -1
  38. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +13 -20
  39. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +6 -1
  40. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +67 -36
  41. package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.js +9 -2
  42. package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.js +4 -2
  43. package/components/DataGrid/subcomponents/Cards/types.d.ts +50 -1
  44. package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +5 -2
  45. package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
  46. package/components/DataGrid/subcomponents/HeaderActions/index.js +1 -1
  47. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
  48. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
  49. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
  50. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
  51. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +1 -1
  52. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.js +1 -1
  53. package/components/DataGrid/subcomponents/Table/index.js +60 -41
  54. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +16 -18
  55. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +3 -3
  56. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  57. package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
  58. package/components/DataGrid/tests/helpers/types.d.ts +3 -0
  59. package/components/DataGrid/types.d.ts +17 -4
  60. package/components/Label/Label.js +1 -1
  61. package/components/ObjectLogs/slots/ObjectLogsSlots.js +3 -5
  62. package/components/PaperForm/PaperForm.js +1 -1
  63. package/components/PaperForm/components/Header.js +7 -9
  64. package/components/PaperForm/styles.js +4 -9
  65. package/components/PaperForm/types.d.ts +2 -3
  66. package/components/Stepper/Stepper.styles.js +0 -2
  67. package/components/Stepper/dictionary.js +1 -0
  68. package/components/Stepper/subcomponents/StepArea/index.js +115 -7
  69. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -2
  70. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +53 -3
  71. package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +2 -3
  72. package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +2 -3
  73. package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -24
  74. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +51 -2
  75. package/components/Stepper/types.d.ts +0 -4
  76. package/components/ToastContainer/ToastContainer.js +0 -1
  77. package/components/ToastContainer/constants.d.ts +1 -1
  78. package/components/ToastContainer/constants.js +1 -1
  79. package/components/WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js +3 -47
  80. package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +1 -1
  81. package/components/WindowBase/subcomponents/Component/index.d.ts +1 -12
  82. package/components/WindowBase/subcomponents/Component/index.js +2 -56
  83. package/components/WindowBase/subcomponents/Component/types.d.ts +0 -1
  84. package/components/WindowBase/types.d.ts +1 -1
  85. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +0 -1
  86. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +1 -1
  87. package/components/areas/contexts/AreasContext/store.js +1 -5
  88. package/components/areas/contexts/AreasContext/types.d.ts +1 -1
  89. package/components/formatters/IconsFormatter/IconsFormatter.d.ts +6 -0
  90. package/components/formatters/IconsFormatter/IconsFormatter.js +22 -0
  91. package/components/formatters/IconsFormatter/IconsFormatter.styles.d.ts +2 -0
  92. package/components/formatters/IconsFormatter/IconsFormatter.styles.js +29 -0
  93. package/components/formatters/IconsFormatter/constants.d.ts +1 -0
  94. package/components/formatters/IconsFormatter/constants.js +4 -0
  95. package/components/{DataGrid/formatters/ColumnIconFormatter → formatters/IconsFormatter}/helpers/renderIcon.d.ts +2 -2
  96. package/components/formatters/IconsFormatter/helpers/renderIcon.js +24 -0
  97. package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.d.ts +7 -0
  98. package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.js +16 -0
  99. package/components/formatters/IconsFormatter/index.d.ts +3 -0
  100. package/components/formatters/IconsFormatter/index.js +1 -0
  101. package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.d.ts +5 -0
  102. package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.js +9 -0
  103. package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.d.ts +9 -0
  104. package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.js +22 -0
  105. package/components/formatters/IconsFormatter/types.d.ts +57 -0
  106. package/components/formatters/IconsFormatter/types.js +1 -0
  107. package/components/formatters/TagsFormatter/TagsFormatter.d.ts +5 -0
  108. package/components/formatters/TagsFormatter/TagsFormatter.js +28 -0
  109. package/components/formatters/TagsFormatter/TagsFormatter.styles.d.ts +2 -0
  110. package/components/formatters/TagsFormatter/TagsFormatter.styles.js +41 -0
  111. package/components/formatters/TagsFormatter/constants.d.ts +5 -0
  112. package/components/formatters/TagsFormatter/constants.js +11 -0
  113. package/components/formatters/TagsFormatter/helpers/renderMultipleTag.d.ts +8 -0
  114. package/components/formatters/TagsFormatter/helpers/renderMultipleTag.js +19 -0
  115. package/components/formatters/TagsFormatter/helpers/renderTag.d.ts +7 -0
  116. package/components/formatters/TagsFormatter/helpers/renderTag.js +9 -0
  117. package/components/formatters/TagsFormatter/helpers/validateHexColor.d.ts +8 -0
  118. package/components/formatters/TagsFormatter/helpers/validateHexColor.js +9 -0
  119. package/components/formatters/TagsFormatter/index.d.ts +2 -0
  120. package/components/formatters/TagsFormatter/index.js +1 -0
  121. package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.d.ts +5 -0
  122. package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.js +9 -0
  123. package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.d.ts +6 -0
  124. package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.js +16 -0
  125. package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.d.ts +5 -0
  126. package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.js +35 -0
  127. package/components/formatters/TagsFormatter/subcomponents/Tag/index.d.ts +1 -0
  128. package/components/formatters/TagsFormatter/subcomponents/Tag/index.js +1 -0
  129. package/components/formatters/TagsFormatter/types.d.ts +47 -0
  130. package/components/formatters/index.d.ts +6 -5
  131. package/components/hook-form/RHFormContext/styles.js +1 -2
  132. package/components/mui_extended/CircularProgress/types.d.ts +1 -1
  133. package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +1 -5
  134. package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +1 -1
  135. package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +4 -2
  136. package/components/popups/components/PopupsProvider/hooks/usePopups.js +7 -19
  137. package/components/popups/components/PopupsViewer/PopupsViewer.js +1 -1
  138. package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +1 -1
  139. package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +21 -32
  140. package/contexts/ModalContext/index.js +5 -5
  141. package/index.js +32 -28
  142. package/package.json +1 -1
  143. package/components/DataGrid/formatters/ColumnIconFormatter/constants.js +0 -4
  144. package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.js +0 -58
  145. package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.d.ts +0 -7
  146. package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.js +0 -19
  147. package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts +0 -13
  148. package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +0 -111
  149. package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.d.ts +0 -8
  150. package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.js +0 -79
  151. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.d.ts +0 -8
  152. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.js +0 -93
@@ -8,7 +8,7 @@ import { a as filterHeight } from "./subcomponents/SelectColumn.js";
8
8
  import { u as useSortColumnsRows } from "./hooks/useSortColumnsRows.js";
9
9
  import { u as useFilters } from "../../hooks/useFilters.js";
10
10
  import { u as useDataGrid } from "../../hooks/useDataGrid.js";
11
- import { y as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../slots/DataGridSlot.js";
11
+ import { z as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../slots/DataGridSlot.js";
12
12
  import { u as useHeaderMenuActions } from "./hooks/useHeaderMenuActions.js";
13
13
  import { H as HeaderRenderClick } from "./subcomponents/HeaderRenderClick/HeaderRenderClick.js";
14
14
  function Table(props) {
@@ -20,6 +20,7 @@ function Table(props) {
20
20
  selectedRows,
21
21
  onSelectedRowsChange,
22
22
  defaultColumnOptions: defaultColumnOptionsProp,
23
+ focusOnRowKey,
23
24
  ...restProps
24
25
  } = props;
25
26
  const renderCheckbox = (formatterProps) => {
@@ -57,6 +58,7 @@ function Table(props) {
57
58
  setRowsCount,
58
59
  currentRowHeight,
59
60
  currentRowHeaderHeight,
61
+ currentRowHeightVariant,
60
62
  size,
61
63
  sortColumns,
62
64
  setSortColumns
@@ -109,6 +111,17 @@ function Table(props) {
109
111
  useEffect(() => {
110
112
  setRowsCount(finalRows.length);
111
113
  }, [finalRows]);
114
+ useEffect(() => {
115
+ if (!focusOnRowKey) {
116
+ return;
117
+ }
118
+ const rowIndex = finalRows.findIndex(
119
+ (row) => rowKeyGetter(row) === focusOnRowKey
120
+ );
121
+ if (rowIndex !== -1) {
122
+ ref_data_grid.current?.scrollToCell({ rowIdx: rowIndex });
123
+ }
124
+ }, [focusOnRowKey, finalRows, rowKeyGetter]);
112
125
  const onColumnResize = (idx, width) => {
113
126
  onChangeColumnWidth(finalColumns[idx].key, width);
114
127
  };
@@ -123,47 +136,53 @@ function Table(props) {
123
136
  Boolean(defaultColumnOptions.sortable),
124
137
  handleSortFromPopover
125
138
  );
126
- return /* @__PURE__ */ jsx(TableContainerStyled, { id: "WrapperTable", children: /* @__PURE__ */ jsxs(TableWrapperDataGridStyled, { ownerState: { size }, children: [
127
- /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsx(
128
- DataGrid,
129
- {
130
- className: "rdg-light",
131
- ref: ref_data_grid,
132
- headerRowHeight: activeFilters ? currentRowHeaderHeight + filterHeight : currentRowHeaderHeight,
133
- columns: finalColumns,
134
- sortColumns,
135
- onSortColumnsChange: handleSortColumnsChange,
136
- onColumnResize,
137
- rows: finalRows,
138
- onRowsChange,
139
- selectedRows,
140
- onSelectedRowsChange,
141
- onCellClick,
142
- rowHeight: currentRowHeight,
143
- rowKeyGetter,
144
- renderers: {
145
- renderCheckbox
146
- },
147
- defaultColumnOptions,
148
- ...restProps
149
- }
150
- ) }),
151
- popoverState.columnKey && popoverState.anchorEl instanceof HTMLDivElement && /* @__PURE__ */ jsx(
152
- HeaderRenderClick,
153
- {
154
- externalOpen: popoverState.anchorEl,
155
- onOpen: (open) => {
156
- if (!open) {
157
- setPopoverState({
158
- anchorEl: null,
159
- columnKey: null
160
- });
139
+ return /* @__PURE__ */ jsx(TableContainerStyled, { id: "WrapperTable", children: /* @__PURE__ */ jsxs(
140
+ TableWrapperDataGridStyled,
141
+ {
142
+ ownerState: { size, currentRowHeightVariant, currentRowHeight },
143
+ children: [
144
+ /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsx(
145
+ DataGrid,
146
+ {
147
+ className: "rdg-light",
148
+ ref: ref_data_grid,
149
+ headerRowHeight: activeFilters ? currentRowHeaderHeight + filterHeight : currentRowHeaderHeight,
150
+ columns: finalColumns,
151
+ sortColumns,
152
+ onSortColumnsChange: handleSortColumnsChange,
153
+ onColumnResize,
154
+ rows: finalRows,
155
+ onRowsChange,
156
+ selectedRows,
157
+ onSelectedRowsChange,
158
+ onCellClick,
159
+ rowHeight: currentRowHeight,
160
+ rowKeyGetter,
161
+ renderers: {
162
+ renderCheckbox
163
+ },
164
+ defaultColumnOptions,
165
+ ...restProps
161
166
  }
162
- },
163
- menuActions
164
- }
165
- )
166
- ] }) });
167
+ ) }),
168
+ popoverState.columnKey && popoverState.anchorEl instanceof HTMLDivElement && /* @__PURE__ */ jsx(
169
+ HeaderRenderClick,
170
+ {
171
+ externalOpen: popoverState.anchorEl,
172
+ onOpen: (open) => {
173
+ if (!open) {
174
+ setPopoverState({
175
+ anchorEl: null,
176
+ columnKey: null
177
+ });
178
+ }
179
+ },
180
+ menuActions
181
+ }
182
+ )
183
+ ]
184
+ }
185
+ ) });
167
186
  }
168
187
  export {
169
188
  Table as T
@@ -2,25 +2,23 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { C as CheckboxIndeterminateIcon, a as CheckboxCheckedIcon, b as CheckboxIcon } from "./CustomIcons.js";
4
4
  import { Checkbox } from "@mui/material";
5
- const CheckboxFormatter = forwardRef(
6
- function CheckboxFormatter2({ onChange, checked, ...props }, _ref) {
7
- function handleChange(e) {
8
- onChange(e.target.checked, e.nativeEvent.shiftKey);
9
- }
10
- return /* @__PURE__ */ jsx(
11
- Checkbox,
12
- {
13
- checked,
14
- size: "small",
15
- icon: /* @__PURE__ */ jsx(CheckboxIcon, {}),
16
- checkedIcon: /* @__PURE__ */ jsx(CheckboxCheckedIcon, {}),
17
- indeterminateIcon: /* @__PURE__ */ jsx(CheckboxIndeterminateIcon, {}),
18
- onChange: handleChange,
19
- ...props
20
- }
21
- );
5
+ const CheckboxFormatter = forwardRef(function CheckboxFormatter2({ onChange, checked, ...props }, _ref) {
6
+ function handleChange(e) {
7
+ onChange(e.target.checked, e.nativeEvent.shiftKey);
22
8
  }
23
- );
9
+ return /* @__PURE__ */ jsx(
10
+ Checkbox,
11
+ {
12
+ checked,
13
+ size: "small",
14
+ icon: /* @__PURE__ */ jsx(CheckboxIcon, {}),
15
+ checkedIcon: /* @__PURE__ */ jsx(CheckboxCheckedIcon, {}),
16
+ indeterminateIcon: /* @__PURE__ */ jsx(CheckboxIndeterminateIcon, {}),
17
+ onChange: handleChange,
18
+ ...props
19
+ }
20
+ );
21
+ });
24
22
  export {
25
23
  CheckboxFormatter as C
26
24
  };
@@ -5,7 +5,7 @@ import { useDrag, useDrop } from "react-dnd";
5
5
  import { renderHeaderCell } from "react-data-grid";
6
6
  import { u as useFocusRef } from "../hooks/useFocusRef.js";
7
7
  import { u as useFilters } from "../../../hooks/useFilters.js";
8
- import { N as NameColumnIconStyled, z as NameColumnStyled, I as IconColumnStyled, B as DraggableHeaderRootStyled, F as ButtonHeaderActionsStyled, G as DraggableWrapperInputBaseStyled, H as IconSearchStyled, J as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
8
+ import { N as NameColumnIconStyled, B as NameColumnStyled, I as IconColumnStyled, F as DraggableHeaderRootStyled, G as ButtonHeaderActionsStyled, H as DraggableWrapperInputBaseStyled, J as IconSearchStyled, K as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
9
9
  import { p as pathIcons } from "../../../icons.js";
10
10
  import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
11
11
  import { I as Icon } from "../../../../Icon/Icon.js";
@@ -21,7 +21,7 @@ function DraggableHeaderRenderer(props) {
21
21
  headerTabIndex !== void 0 && headerTabIndex >= 0
22
22
  );
23
23
  const { getLabel } = useModuleDictionary();
24
- const { size, classes, externalSortSettings, externalFilterSettings } = useDataGrid();
24
+ const { size, classes, externalSortSettings, externalFilterSettings, currentRowHeightVariant } = useDataGrid();
25
25
  const { host_static_assets, environment_assets } = useEnvironment();
26
26
  const { activeFilters, filters, onChangeFilter } = useFilters();
27
27
  const [filter, setFilter] = useState(filters?.get(column.key) || "");
@@ -117,7 +117,7 @@ function DraggableHeaderRenderer(props) {
117
117
  }
118
118
  };
119
119
  newColumn.name = /* @__PURE__ */ jsxs(NameColumnIconStyled, { style: { justifyContent: getJustifyContent() }, children: [
120
- /* @__PURE__ */ jsx(NameColumnStyled, { children: newColumn.name }),
120
+ /* @__PURE__ */ jsx(NameColumnStyled, { ownerState: { size, currentRowHeightVariant }, children: newColumn.name }),
121
121
  /* @__PURE__ */ jsx(IconColumnStyled, { children: columnIcons })
122
122
  ] });
123
123
  }
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useMemo, useEffect, useCallback } from "react";
3
3
  import { useModuleDictionary } from "@m4l/core";
4
4
  import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
5
- import { M as MenuListStyled, K as HeaderRenderClickStyled } from "../../../../slots/DataGridSlot.js";
5
+ import { M as MenuListStyled, O as HeaderRenderClickStyled } from "../../../../slots/DataGridSlot.js";
6
6
  import { M as MenuDivider } from "../../../../../mui_extended/MenuDivider/MenuDivider.js";
7
7
  import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
8
8
  import { D as DICTIONARY } from "../../../../dictionary.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { O as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
2
+ import { P as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
3
3
  function autoFocusAndSelect(input) {
4
4
  input?.focus();
5
5
  input?.select();
@@ -2,6 +2,7 @@ import { RenderHeaderCellProps } from 'react-data-grid';
2
2
  import { ChipStatusFormatterProps } from '../../../formatters/ChipStatusFormatter/types';
3
3
  import { DeepKeyOf } from '../../../../utils/types';
4
4
  import { ColumnAlign } from '../../types';
5
+ import { TagConfig } from '../../../formatters/TagsFormatter/types';
5
6
  export interface SeedProps {
6
7
  quantity: number;
7
8
  withBoolean?: boolean;
@@ -17,6 +18,7 @@ export interface SeedProps {
17
18
  withSetCheck?: boolean;
18
19
  withCesar?: boolean;
19
20
  withChipStatus?: boolean;
21
+ withTags?: boolean;
20
22
  withActions?: boolean;
21
23
  withActionsUser?: boolean;
22
24
  withBooleanStatus?: boolean;
@@ -52,6 +54,7 @@ export interface RowType {
52
54
  symbol: string;
53
55
  unit: string;
54
56
  };
57
+ tags?: TagConfig[];
55
58
  setCheck?: boolean;
56
59
  cesar?: string;
57
60
  status?: {
@@ -112,8 +112,6 @@ export interface FilterSettings {
112
112
  filtersApplied: FilterApplied[];
113
113
  onChange: (event: FilterChangeEvent) => void;
114
114
  }
115
- export type RowActionsGetter<TRow> = (row: TRow) => MenuAction[];
116
- export type RowKeyGetter<TRow, TKey extends RowKey = RowKey> = (row: TRow) => TKey;
117
115
  /**--------------------Termina tipado de filtros-------------------------------------------- */
118
116
  export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Omit<NativeDataGridProps<TRow, TSummaryRow>, 'rowKeyGetter' | 'rows' | 'columns' | 'onRowsChange' | 'selectedRows' | 'onSelectedRowsChange' | 'renderers'> {
119
117
  id: string;
@@ -161,6 +159,11 @@ export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> exte
161
159
  * Incluye habilitación, configuración de columnas y renderizado personalizado
162
160
  */
163
161
  cardsViewConfig?: CardsViewConfig<TRow>;
162
+ /**
163
+ * Key de la fila a la que se debe hacer scroll y highlight automáticamente.
164
+ * Útil cuando se agrega un nuevo elemento y se quiere enfocar en él.
165
+ */
166
+ focusOnRowKey?: TKey;
164
167
  }
165
168
  export declare const DATAGRID_TEST_ID = "m4ldatagrid";
166
169
  export declare const PREFIX_TEST_ATTRIBUTE = "data-testid";
@@ -185,7 +188,6 @@ export interface ActionsProps {
185
188
  * Props para el hook useModalDetail
186
189
  */
187
190
  export interface UseModalDetailProps<TRow> {
188
- row: TRow;
189
191
  columns: readonly Column<TRow, any>[];
190
192
  viewMode: ViewMode;
191
193
  onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
@@ -249,7 +251,18 @@ export interface CardContentProps<TRow> {
249
251
  originalColumns: readonly Column<TRow, any>[];
250
252
  onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
251
253
  }
252
- export type DataGridOwnerState<TRow, TSummaryRow, TKey extends RowKey = RowKey> = Pick<DataGridProps<TRow, TSummaryRow, TKey>, 'visibleCustomHeader'> & {
254
+ /**
255
+ * Configuración de densidad para el DataGrid.
256
+ * Define las alturas de filas, headers y la variante inicial.
257
+ */
258
+ export interface DataGridDensityConfig {
259
+ rowHeights: RowHeights;
260
+ rowHeaderHeights: RowHeights;
261
+ initialRowHeightVariant: RowHeightVariants;
262
+ }
263
+ export type DataGridOwnerState<TRow, TSummaryRow, TKey extends RowKey = RowKey> = Pick<DataGridProps<TRow, TSummaryRow, TKey>, 'visibleCustomHeader' | 'size'> & {
264
+ currentRowHeightVariant?: RowHeightVariants;
265
+ currentRowHeight?: number;
253
266
  viewMode?: ViewMode;
254
267
  isActive?: boolean;
255
268
  hasActions?: boolean;
@@ -9,7 +9,7 @@ const Label = (props) => {
9
9
  const { host_static_assets, environment_assets } = useEnvironment();
10
10
  const isSkeleton = useModuleSkeleton();
11
11
  const { currentSize } = useComponentSize(size);
12
- const hasHelperIcon = typeof helperMessage === "string" && helperMessage.length > 0 ? true : false;
12
+ const hasHelperIcon = typeof helperMessage === "string" ? true : false;
13
13
  const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
14
14
  const ownerState = {
15
15
  disabled,
@@ -41,11 +41,11 @@ styled(IconButton, {
41
41
  name: OBJECT_LOGS_KEY_COMPONENT,
42
42
  slot: ObjectLogsSlots.iconButtonStyled
43
43
  })(objectLogsStyles?.iconButtonStyled);
44
- const IconStyled = styled(Icon, {
44
+ styled(Icon, {
45
45
  name: OBJECT_LOGS_KEY_COMPONENT,
46
46
  slot: ObjectLogsSlots.iconStyled
47
47
  })(objectLogsStyles?.iconStyled);
48
- const IconClickeableStyled = styled(Icon, {
48
+ styled(Icon, {
49
49
  name: OBJECT_LOGS_KEY_COMPONENT,
50
50
  slot: ObjectLogsSlots.iconClickeableStyled
51
51
  })(objectLogsStyles?.iconClickeableStyled);
@@ -57,8 +57,6 @@ export {
57
57
  ContainerWrapperStyled as C,
58
58
  DetailDialogComponent as D,
59
59
  GridWrapperStyled as G,
60
- IconClickeableStyled as I,
61
60
  StackStyled as S,
62
- WindowBaseStyled as W,
63
- IconStyled as a
61
+ WindowBaseStyled as W
64
62
  };
@@ -45,7 +45,7 @@ function PaperForm(props) {
45
45
  ownerState: { ...ownerState },
46
46
  ...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {},
47
47
  children: [
48
- variant !== "onlyContainer" && /* @__PURE__ */ jsx(Header, { urlIcon, title, color, size, variant }),
48
+ variant !== "text" && /* @__PURE__ */ jsx(Header, { urlIcon, title, color, size }),
49
49
  /* @__PURE__ */ jsx(ContentStyled, { ownerState: { ...ownerState }, children: renderChildren(children) })
50
50
  ]
51
51
  }
@@ -1,19 +1,17 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { I as IconStyled, T as TitleStyled, H as HeaderStyled } from "../slots/PaperFormSlots.js";
3
- import { useMemo } from "react";
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { H as HeaderStyled, I as IconStyled, T as TitleStyled } from "../slots/PaperFormSlots.js";
4
3
  const Header = (props) => {
5
- const { urlIcon, title, size, dataTestId, color, variant } = props;
4
+ const { urlIcon, title, size, dataTestId, color } = props;
6
5
  const ownerState = {
7
- color,
8
- variant
6
+ color
9
7
  };
10
- const contentHeader = useMemo(() => {
8
+ const renderContentHeader = () => {
11
9
  return /* @__PURE__ */ jsxs(Fragment, { children: [
12
10
  urlIcon ? /* @__PURE__ */ jsx(IconStyled, { src: urlIcon, size }) : null,
13
11
  /* @__PURE__ */ jsx(TitleStyled, { variant: "bodyDens", size, children: title })
14
12
  ] });
15
- }, [urlIcon, title, size]);
16
- return /* @__PURE__ */ jsx(HeaderStyled, { role: "heading", ownerState, ...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {}, children: contentHeader });
13
+ };
14
+ return /* @__PURE__ */ jsx(HeaderStyled, { role: "heading", ownerState, ...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {}, children: renderContentHeader() });
17
15
  };
18
16
  export {
19
17
  Header as H
@@ -8,14 +8,11 @@ const paperFormStyles = {
8
8
  */
9
9
  paperFormRoot: ({ theme, ownerState }) => ({
10
10
  background: theme.vars.palette.background.default,
11
- ...ownerState?.paperFormVariant === "standard" && {
11
+ ...ownerState?.paperFormVariant !== "text" && {
12
12
  borderRadius: theme.size.borderRadius.r1,
13
13
  border: `${theme.size.borderStroke.container}`,
14
14
  borderColor: theme.vars.palette.border.default
15
15
  },
16
- // ...(ownerState?.paperFormVariant === 'text' && {
17
- // borderRadius: theme.size.borderRadius.r1,
18
- // }),
19
16
  width: "100%",
20
17
  overflow: "auto",
21
18
  ...ownerState?.height === "full" && {
@@ -44,10 +41,8 @@ const paperFormStyles = {
44
41
  gap: theme.vars.size.baseSpacings.sp1,
45
42
  overflow: "hidden",
46
43
  padding: `${theme.vars.size.baseSpacings.sp1} ${theme.vars.size.baseSpacings.sp2}`,
47
- ...ownerState?.paperFormVariant === "standard" && {
48
- borderRadius: `${theme.vars.size.borderRadius.r1} ${theme.vars.size.borderRadius.r1} 0 0`,
49
- background: theme.vars.palette[ownerState?.color ?? "default"].hoverOpacity
50
- },
44
+ borderRadius: `${theme.vars.size.borderRadius.r1} ${theme.vars.size.borderRadius.r1} 0 0`,
45
+ background: theme.vars.palette[ownerState?.color ?? "default"].hoverOpacity,
51
46
  alignSelf: "stretch",
52
47
  ...getSizeStyles(
53
48
  theme,
@@ -95,7 +90,7 @@ const paperFormStyles = {
95
90
  justifyContent: ownerState?.isForm ? "flex-start" : "center",
96
91
  gap: ownerState?.isForm ? theme.vars.size.baseSpacings.sp3 : theme.vars.size.baseSpacings.sp0,
97
92
  flexWrap: ownerState?.isForm ? "wrap" : "nowrap",
98
- padding: ownerState?.paperFormVariant === "onlyContainer" ? "0px" : theme.vars.size.baseSpacings.sp3,
93
+ padding: ownerState?.paperFormVariant === "text" ? "0px" : theme.vars.size.baseSpacings.sp3,
99
94
  background: theme.vars.palette.background.default,
100
95
  flex: 1,
101
96
  overflow: "auto"
@@ -9,12 +9,11 @@ export interface PaperFormProps {
9
9
  urlIcon?: string;
10
10
  title: string;
11
11
  children?: ReactNode | PropertyValueProps[];
12
- variant?: 'standard' | 'text' | 'onlyContainer';
12
+ variant?: 'standard' | 'text';
13
13
  color?: Extract<ComponentPalletColor, 'default'>;
14
14
  size?: Extract<Sizes, 'small' | 'medium'>;
15
15
  isForm?: boolean;
16
16
  dataTestId?: string;
17
- border?: boolean;
18
17
  height?: 'auto' | 'full';
19
18
  }
20
19
  /**
@@ -26,7 +25,7 @@ export interface PaperFormProps {
26
25
  interface CommonsProps {
27
26
  paperFormVariant?: PaperFormProps['variant'];
28
27
  }
29
- export type HeaderProps = Omit<PaperFormProps, 'children' | 'isForm'> & CommonsProps;
28
+ export type HeaderProps = Omit<PaperFormProps, 'children' | 'isForm' | 'variant'> & CommonsProps;
30
29
  export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color' | 'size' | 'height'> & CommonsProps;
31
30
  /**
32
31
  * ***********************************
@@ -56,7 +56,6 @@ const stepperStyles = {
56
56
  display: "flex",
57
57
  flexDirection: "column",
58
58
  gap: theme.vars.size.baseSpacings.sp6,
59
- overflowY: "auto",
60
59
  ...ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? {
61
60
  borderTop: "1px solid",
62
61
  paddingTop: theme.vars.size.baseSpacings.sp8
@@ -153,7 +152,6 @@ const stepperStyles = {
153
152
  alignItems: "center",
154
153
  justifyContent: "center",
155
154
  flexShrink: 0,
156
- zIndex: 1,
157
155
  order: ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? 0 : 1,
158
156
  background: !isValidStep && ownerState?.hasBeenValidated ? theme.vars.palette.error.enabled : isCompleted && isValidStep ? ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : theme.vars.palette.primary.toneOpacity : isCurrent ? ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : theme.vars.palette.primary.enabled : ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : theme.vars.palette.default.enabled,
159
157
  borderRadius: theme.vars.size.borderRadius.r2,
@@ -5,6 +5,7 @@ function getStepperComponentsDictionary() {
5
5
  const DICTIONARY = {
6
6
  LABEL_PREV_BUTTON: `${STEPPER_DICTIONARY_ID}.label_prev_button`,
7
7
  LABEL_NEXT_BUTTON: `${STEPPER_DICTIONARY_ID}.label_next_button`,
8
+ LABEL_CANCEL_BUTTON: `${STEPPER_DICTIONARY_ID}.label_cancel_button`,
8
9
  LABEL_SUBMIT_BUTTON: `${STEPPER_DICTIONARY_ID}.label_submit_button`
9
10
  };
10
11
  export {
@@ -1,19 +1,127 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useFormContext, useWatch } from "react-hook-form";
4
+ import { u as useStepper } from "../../hooks/useStepper/index.js";
2
5
  import { e as StepAreaStyled, f as StepStyled, g as StepNameStyled } from "../../slots/StepperSlot.js";
3
6
  import { I as Indicator } from "./subcomponents/Inidicator/index.js";
4
- import { u as useStepArea } from "./hooks/useStepArea.js";
5
- import { u as useVisibileSteps } from "./hooks/useVisibileSteps.js";
7
+ import { shallow } from "zustand/shallow";
8
+ import { u as useDynamicValidation } from "../../hooks/useDynamicValidation/index.js";
9
+ import { e as evaluateVisibilityStepCondition } from "../../helpers/evaluateVisibilityStepCondition/index.js";
6
10
  function StepArea() {
7
- const { visibleSteps } = useVisibileSteps();
8
- const { handleStepClick, visibleTitle, orientation, steps, currentStep } = useStepArea({ visibleSteps });
11
+ const { trigger, clearErrors } = useFormContext();
12
+ const formValues = useWatch();
13
+ const {
14
+ activateFieldsValidation,
15
+ startExternalValidation,
16
+ endExternalValidation
17
+ } = useDynamicValidation();
18
+ const {
19
+ currentStep,
20
+ steps,
21
+ visibleTitle,
22
+ setCurrentStep,
23
+ orientation,
24
+ setStepValidationStatus,
25
+ stepValidationStatus,
26
+ visibilityData
27
+ } = useStepper(
28
+ (state) => ({
29
+ currentStep: state.currentStep,
30
+ steps: state.steps,
31
+ visibleTitle: state.visibleTitle,
32
+ setCurrentStep: state.actions.setCurrentStep,
33
+ indicatorType: state.indicatorType,
34
+ orientation: state.orientation,
35
+ setStepValidationStatus: state.actions.setStepValidationStatus,
36
+ stepValidationStatus: state.stepValidationStatus,
37
+ visibilityData: state.visibilityData
38
+ }),
39
+ shallow
40
+ );
41
+ const allSteps = steps;
42
+ const visibleSteps = useMemo(() => {
43
+ return steps.filter(
44
+ (step) => evaluateVisibilityStepCondition(step, formValues || {}, visibilityData)
45
+ );
46
+ }, [steps, formValues, visibilityData]);
9
47
  const ownerState = {
10
48
  visibleTitle,
11
49
  orientation,
12
50
  totalSteps: visibleSteps.length
13
51
  };
14
- return /* @__PURE__ */ jsx(StepAreaStyled, { ownerState, children: steps.map((step, originalIndex) => {
15
- const visibleStepIndex = visibleSteps.findIndex((visibleStep) => visibleStep.key === step.key);
16
- const isStepVisible = visibleStepIndex !== -1;
52
+ const handleStepClick = async (targetIndex) => {
53
+ const currentIndex = visibleSteps.findIndex(
54
+ (step) => step.key === steps[currentStep].key
55
+ );
56
+ if (targetIndex === currentIndex) {
57
+ return;
58
+ }
59
+ const isNavigatingForward = targetIndex > currentIndex;
60
+ const targetOriginalIndex = steps.findIndex(
61
+ (s) => s.key === visibleSteps[targetIndex].key
62
+ );
63
+ if (!isNavigatingForward) {
64
+ setCurrentStep(targetOriginalIndex);
65
+ return;
66
+ }
67
+ const isSkippingSteps = targetIndex > currentIndex + 1;
68
+ if (isSkippingSteps) {
69
+ for (let i = currentIndex; i < targetIndex; i++) {
70
+ const step = visibleSteps[i];
71
+ const stepOriginalIndex = steps.findIndex((s) => s.key === step.key);
72
+ startExternalValidation();
73
+ const isValid = await trigger(step.validationFields);
74
+ endExternalValidation();
75
+ if (!isValid) {
76
+ setCurrentStep(stepOriginalIndex);
77
+ setStepValidationStatus(stepOriginalIndex, false);
78
+ activateFieldsValidation(step.validationFields || []);
79
+ return;
80
+ }
81
+ setStepValidationStatus(stepOriginalIndex, true);
82
+ }
83
+ } else {
84
+ const currentStepData = visibleSteps[currentIndex];
85
+ const currentStepOriginalIndex = steps.findIndex(
86
+ (s) => s.key === currentStepData.key
87
+ );
88
+ startExternalValidation();
89
+ const isCurrentValid = await trigger(currentStepData.validationFields);
90
+ endExternalValidation();
91
+ if (!isCurrentValid) {
92
+ setStepValidationStatus(currentStepOriginalIndex, false);
93
+ activateFieldsValidation(currentStepData.validationFields || []);
94
+ return;
95
+ }
96
+ setStepValidationStatus(currentStepOriginalIndex, true);
97
+ }
98
+ setCurrentStep(targetOriginalIndex);
99
+ if (isNavigatingForward) {
100
+ const currentStepData = visibleSteps[currentIndex];
101
+ const currentStepOriginalIndex = steps.findIndex(
102
+ (s) => s.key === currentStepData.key
103
+ );
104
+ const isCurrentStepValid = stepValidationStatus[currentStepOriginalIndex] !== false;
105
+ if (isCurrentStepValid) {
106
+ const targetStep = visibleSteps[targetIndex];
107
+ const targetStepFields = targetStep.validationFields || [];
108
+ if (targetStepFields.length > 0) {
109
+ clearErrors(targetStepFields);
110
+ setTimeout(() => {
111
+ clearErrors(targetStepFields);
112
+ setStepValidationStatus(targetOriginalIndex, true);
113
+ }, 100);
114
+ }
115
+ }
116
+ }
117
+ };
118
+ return /* @__PURE__ */ jsx(StepAreaStyled, { ownerState, children: allSteps.map((step, originalIndex) => {
119
+ const isStepVisible = evaluateVisibilityStepCondition(
120
+ step,
121
+ formValues || {},
122
+ visibilityData
123
+ );
124
+ const visibleStepIndex = isStepVisible ? visibleSteps.findIndex((visStep) => visStep.key === step.key) : -1;
17
125
  return /* @__PURE__ */ jsxs(
18
126
  StepStyled,
19
127
  {
@@ -1,5 +1,5 @@
1
- import { ActionFormCancelProps } from '../../../../CommonActions/components/ActionFormCancel/types';
1
+ import { StepperButtonProps } from '../../../types';
2
2
  /**
3
3
  * Botón modular para cancelar el proceso del Stepper
4
4
  */
5
- export declare function StepperCancelButton(props: ActionFormCancelProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function StepperCancelButton(props: StepperButtonProps): import("react/jsx-runtime").JSX.Element;