@m4l/components 9.2.60 → 9.2.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/DataGrid/DataGrid.js +17 -3
- package/components/DataGrid/Datagrid.styles.js +72 -20
- package/components/DataGrid/constants.d.ts +2 -0
- package/components/DataGrid/constants.js +7 -3
- package/components/DataGrid/contexts/DataGridContext/index.js +77 -30
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +5 -2
- package/components/DataGrid/dictionary.d.ts +8 -0
- package/components/DataGrid/dictionary.js +26 -17
- package/components/DataGrid/icons.d.ts +7 -0
- package/components/DataGrid/icons.js +8 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +7 -1
- package/components/DataGrid/slots/DataGridEnum.js +6 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +6 -0
- package/components/DataGrid/slots/DataGridSlot.js +35 -5
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Filter/index.js +9 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +3 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.js +9 -2
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.d.ts +6 -0
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +262 -0
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.d.ts +6 -4
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +35 -20
- package/components/DataGrid/subcomponents/Table/index.js +97 -34
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +79 -4
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.d.ts +5 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +146 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/index.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/index.js +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/types.d.ts +131 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/tests/HeaderRenderClick.test.d.ts +1 -0
- package/components/DataGrid/tests/useHeaderMenuActions.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +53 -0
- package/components/DynamicFilter/store/DynamicFilterContext.js +63 -23
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicFilter/types.d.ts +3 -0
- package/components/DynamicSort/DynamicSort.js +10 -6
- package/components/DynamicSort/store/DynamicSortContext.js +96 -67
- package/components/DynamicSort/store/DynamicSortStore.js +53 -4
- package/components/DynamicSort/store/types.d.ts +11 -0
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +0 -2
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +0 -5
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/components/mui_extended/CheckBox/CheckBox.styles.js +2 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts +3 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +334 -88
- package/index.js +7 -7
- package/package.json +1 -1
- package/storybook/components/DataGrid/DataGrid.stories.d.ts +22 -0
- package/storybook/components/DataGrid/MswHandles.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/filterFieldsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/getRows.d.ts +4 -0
- package/storybook/components/DataGrid/helpers/getRowsWithBackendSimulation.d.ts +9 -0
- package/storybook/components/DataGrid/helpers/sortsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/types.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/useSeed.d.ts +3 -0
- package/storybook/components/DataGrid/subcomponents/DataGridRender.d.ts +2 -0
- package/storybook/components/ObjectLogs/ObjectLogs.stories.d.ts +2 -2
|
@@ -35,7 +35,9 @@ function DataGrid(props) {
|
|
|
35
35
|
visibleCustomHeader = true,
|
|
36
36
|
defaultUserColumns,
|
|
37
37
|
onChangeUserColumns,
|
|
38
|
-
size
|
|
38
|
+
size,
|
|
39
|
+
externalSortSettings,
|
|
40
|
+
externalFilterSettings
|
|
39
41
|
} = props;
|
|
40
42
|
const {
|
|
41
43
|
withSettings,
|
|
@@ -63,7 +65,11 @@ function DataGrid(props) {
|
|
|
63
65
|
className: classRoot,
|
|
64
66
|
...process.env.NODE_ENV !== "production" ? {
|
|
65
67
|
[TEST_PROP_COLUMNS]: JSON.stringify(columns),
|
|
66
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
68
|
+
[TEST_PROP_ID]: getNameDataTestId(
|
|
69
|
+
DATAGRID_PREFIX_NAME,
|
|
70
|
+
"root",
|
|
71
|
+
dataTestId
|
|
72
|
+
),
|
|
67
73
|
[TEST_SKELETON]: isSkeleton ? true : false
|
|
68
74
|
} : {},
|
|
69
75
|
children: /* @__PURE__ */ jsx(
|
|
@@ -83,6 +89,8 @@ function DataGrid(props) {
|
|
|
83
89
|
onChangeUserColumns,
|
|
84
90
|
defaultUserColumns,
|
|
85
91
|
size: currentSize,
|
|
92
|
+
externalSortSettings,
|
|
93
|
+
externalFilterSettings,
|
|
86
94
|
children: /* @__PURE__ */ jsxs(FilterProvider, { initialActiveFilters: false, children: [
|
|
87
95
|
withActions && actionsProps && /* @__PURE__ */ jsx(
|
|
88
96
|
HeaderActions,
|
|
@@ -112,7 +120,13 @@ function DataGrid(props) {
|
|
|
112
120
|
onRowsChange
|
|
113
121
|
}
|
|
114
122
|
),
|
|
115
|
-
withPager && /* @__PURE__ */ jsx(
|
|
123
|
+
withPager && /* @__PURE__ */ jsx(
|
|
124
|
+
ControlNavigate,
|
|
125
|
+
{
|
|
126
|
+
size: currentSize,
|
|
127
|
+
...{ withPager, pagerOptions }
|
|
128
|
+
}
|
|
129
|
+
)
|
|
116
130
|
] })
|
|
117
131
|
}
|
|
118
132
|
)
|
|
@@ -142,7 +142,11 @@ const dataGridStyles = {
|
|
|
142
142
|
//Se utiliza directamente el valor porque no está tokenizado
|
|
143
143
|
height: "100%",
|
|
144
144
|
lineHeight: theme.vars.size.baseSpacings.sp4,
|
|
145
|
-
fontSize: getTypographyStyles(
|
|
145
|
+
fontSize: getTypographyStyles(
|
|
146
|
+
theme.generalSettings.isMobile,
|
|
147
|
+
ownerState?.size || "medium",
|
|
148
|
+
"body"
|
|
149
|
+
).fontSize
|
|
146
150
|
}),
|
|
147
151
|
/**
|
|
148
152
|
* Estilos para el valor de RowsCount
|
|
@@ -155,7 +159,11 @@ const dataGridStyles = {
|
|
|
155
159
|
paddingRight: "6px",
|
|
156
160
|
//No hay token para este valor
|
|
157
161
|
paddingTop: theme.vars.size.baseSpacings.sp1,
|
|
158
|
-
fontSize: getTypographyStyles(
|
|
162
|
+
fontSize: getTypographyStyles(
|
|
163
|
+
theme.generalSettings.isMobile,
|
|
164
|
+
ownerState?.size || "medium",
|
|
165
|
+
"body"
|
|
166
|
+
).fontSize
|
|
159
167
|
}),
|
|
160
168
|
/**
|
|
161
169
|
* Estilos para el contenedor de las columnas
|
|
@@ -576,15 +584,10 @@ const dataGridStyles = {
|
|
|
576
584
|
padding: theme.vars.size.baseSpacings.sp1,
|
|
577
585
|
gap: theme.vars.size.baseSpacings.sp1,
|
|
578
586
|
borderRadius: theme.vars.size.borderRadius.r1,
|
|
579
|
-
...getSizeStyles(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
(size) => ({
|
|
584
|
-
minHeight: size,
|
|
585
|
-
height: size
|
|
586
|
-
})
|
|
587
|
-
)
|
|
587
|
+
...getSizeStyles(theme, ownerState?.size || "medium", "action", (size) => ({
|
|
588
|
+
minHeight: size,
|
|
589
|
+
height: size
|
|
590
|
+
}))
|
|
588
591
|
}),
|
|
589
592
|
/**
|
|
590
593
|
* Estilos de los inputs del header para el filtro
|
|
@@ -603,15 +606,10 @@ const dataGridStyles = {
|
|
|
603
606
|
height: "100%",
|
|
604
607
|
alignItems: "center",
|
|
605
608
|
"& .MuiSkeleton-root": {
|
|
606
|
-
...getSizeStyles(
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
(size) => ({
|
|
611
|
-
minHeight: `${size}!important`,
|
|
612
|
-
height: `${size}!important`
|
|
613
|
-
})
|
|
614
|
-
)
|
|
609
|
+
...getSizeStyles(theme, ownerState?.size || "medium", "base", (size) => ({
|
|
610
|
+
minHeight: `${size}!important`,
|
|
611
|
+
height: `${size}!important`
|
|
612
|
+
}))
|
|
615
613
|
}
|
|
616
614
|
}),
|
|
617
615
|
/**
|
|
@@ -623,6 +621,60 @@ const dataGridStyles = {
|
|
|
623
621
|
flexDirection: "column",
|
|
624
622
|
height: "100%"
|
|
625
623
|
}
|
|
624
|
+
}),
|
|
625
|
+
/**
|
|
626
|
+
* Estilos para el contenedor del nombre de la columna y el icono de sort
|
|
627
|
+
*/
|
|
628
|
+
nameColumnIcon: ({ theme }) => ({
|
|
629
|
+
display: "flex",
|
|
630
|
+
alignItems: "center",
|
|
631
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
632
|
+
position: "relative",
|
|
633
|
+
overflow: "visible"
|
|
634
|
+
}),
|
|
635
|
+
/**
|
|
636
|
+
* Estilos para el contenedor del nombre de la columna
|
|
637
|
+
*/
|
|
638
|
+
nameColumn: () => ({
|
|
639
|
+
textOverflow: "ellipsis",
|
|
640
|
+
overflow: "hidden",
|
|
641
|
+
whiteSpace: "nowrap"
|
|
642
|
+
}),
|
|
643
|
+
/**
|
|
644
|
+
* Estilos para el contenedor del icono de la columna
|
|
645
|
+
*/
|
|
646
|
+
iconColumn: ({ theme }) => ({
|
|
647
|
+
display: "flex",
|
|
648
|
+
alignItems: "center",
|
|
649
|
+
gap: theme.vars.size.baseSpacings.sp1
|
|
650
|
+
}),
|
|
651
|
+
/**
|
|
652
|
+
* Estilos para el popover del header actions
|
|
653
|
+
*/
|
|
654
|
+
headerRenderClick: () => ({
|
|
655
|
+
width: "fit-content"
|
|
656
|
+
}),
|
|
657
|
+
/**
|
|
658
|
+
* Estilos para el menuList del header actions
|
|
659
|
+
*/
|
|
660
|
+
menuList: ({ theme }) => ({
|
|
661
|
+
padding: theme.vars.size.baseSpacings.sp3,
|
|
662
|
+
display: "flex",
|
|
663
|
+
flexDirection: "column",
|
|
664
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
665
|
+
"& > div": {
|
|
666
|
+
paddingLeft: theme.vars.size.baseSpacings.sp4,
|
|
667
|
+
paddingRight: theme.vars.size.baseSpacings.sp4
|
|
668
|
+
}
|
|
669
|
+
}),
|
|
670
|
+
/**
|
|
671
|
+
* Estilos para el contenedor del boton de acciones del header
|
|
672
|
+
*/
|
|
673
|
+
buttonHeaderActions: () => ({
|
|
674
|
+
display: "flex",
|
|
675
|
+
alignItems: "center",
|
|
676
|
+
justifyContent: "space-between",
|
|
677
|
+
width: "100%"
|
|
626
678
|
})
|
|
627
679
|
};
|
|
628
680
|
export {
|
|
@@ -2,6 +2,8 @@ export declare const DATAGRID_PREFIX_NAME = "M4LDataGrid";
|
|
|
2
2
|
export declare const DATAGRID_SELECT_COLUMN_KEY = "M4LDataGrid-CheckedColumn";
|
|
3
3
|
export declare const DATAGRID_ACTIONS_COLUMN_KEY = "M4LDataGrid-ActionsColumn";
|
|
4
4
|
export declare const TEST_SKELETON = "data-skeleton";
|
|
5
|
+
export declare const DATAGRID_HEADER_RENDER_CLICK_KEY = "M4LDataGrid-HeaderRenderClick";
|
|
6
|
+
export declare const DATAGRID_ID_DICTIONARY = "data_grid";
|
|
5
7
|
export declare enum DATAGRID_SEMANTIC_WIDTHS {
|
|
6
8
|
actions = 40,
|
|
7
9
|
bigChip = 190,
|
|
@@ -2,6 +2,8 @@ const DATAGRID_PREFIX_NAME = "M4LDataGrid";
|
|
|
2
2
|
const DATAGRID_SELECT_COLUMN_KEY = "M4LDataGrid-CheckedColumn";
|
|
3
3
|
const DATAGRID_ACTIONS_COLUMN_KEY = "M4LDataGrid-ActionsColumn";
|
|
4
4
|
const TEST_SKELETON = "data-skeleton";
|
|
5
|
+
const DATAGRID_HEADER_RENDER_CLICK_KEY = "M4LDataGrid-HeaderRenderClick";
|
|
6
|
+
const DATAGRID_ID_DICTIONARY = "data_grid";
|
|
5
7
|
var DATAGRID_SEMANTIC_WIDTHS = /* @__PURE__ */ ((DATAGRID_SEMANTIC_WIDTHS2) => {
|
|
6
8
|
DATAGRID_SEMANTIC_WIDTHS2[DATAGRID_SEMANTIC_WIDTHS2["actions"] = 40] = "actions";
|
|
7
9
|
DATAGRID_SEMANTIC_WIDTHS2[DATAGRID_SEMANTIC_WIDTHS2["bigChip"] = 190] = "bigChip";
|
|
@@ -31,7 +33,9 @@ export {
|
|
|
31
33
|
TEST_SKELETON as T,
|
|
32
34
|
DATAGRID_ROW_HEIGHTS as a,
|
|
33
35
|
DATAGRID_ROW_HEADER_HEIGHTS as b,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
DATAGRID_ID_DICTIONARY as c,
|
|
37
|
+
DATAGRID_SELECT_COLUMN_KEY as d,
|
|
38
|
+
DATAGRID_SEMANTIC_WIDTHS as e,
|
|
39
|
+
DATAGRID_ACTIONS_COLUMN_KEY as f,
|
|
40
|
+
DATAGRID_HEADER_RENDER_CLICK_KEY as g
|
|
37
41
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState,
|
|
2
|
+
import { useState, useEffect, useMemo, useCallback, createContext } from "react";
|
|
3
3
|
import { c as castMapColumnsWidthToRecord } from "../../helpers/castMapColumnsWidthToRecord.js";
|
|
4
4
|
import { useFirstRender } from "@m4l/graphics";
|
|
5
5
|
import { g as getComponentClasses } from "../../../../utils/getComponentSlotRoot.js";
|
|
@@ -32,10 +32,7 @@ function getColumnsConfig(id, columns, defaultUserColumns = void 0) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
return columns.map((column, index) => {
|
|
35
|
-
const [columnConfig = { ...column }, columnConfigIndex] = getColumnConfigByKey(
|
|
36
|
-
column.key,
|
|
37
|
-
columnsConfig
|
|
38
|
-
);
|
|
35
|
+
const [columnConfig = { ...column }, columnConfigIndex] = getColumnConfigByKey(column.key, columnsConfig);
|
|
39
36
|
return {
|
|
40
37
|
key: column.key,
|
|
41
38
|
name: typeof column.name === "string" ? column.name : String(column.name),
|
|
@@ -81,10 +78,16 @@ function getColumnsWidth(id, columns, defaultUserColumns) {
|
|
|
81
78
|
function saveColumnsWidth(id, storeColumnsWidth, onChangeUserColumns) {
|
|
82
79
|
if (onChangeUserColumns) {
|
|
83
80
|
const columnsWidthObject = castMapColumnsWidthToRecord(storeColumnsWidth);
|
|
84
|
-
onChangeUserColumns({
|
|
81
|
+
onChangeUserColumns({
|
|
82
|
+
reason: "columnsWidths",
|
|
83
|
+
userConfig: columnsWidthObject
|
|
84
|
+
});
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
localStorage.setItem(
|
|
87
|
+
localStorage.setItem(
|
|
88
|
+
`${id}_columns_width`,
|
|
89
|
+
JSON.stringify([...storeColumnsWidth])
|
|
90
|
+
);
|
|
88
91
|
}
|
|
89
92
|
function saveColumnsConfig(id, columnsConfig, onChangeUserColumns) {
|
|
90
93
|
if (onChangeUserColumns) {
|
|
@@ -118,26 +121,26 @@ function DataGridProvider(props) {
|
|
|
118
121
|
onCheckedRowsChange,
|
|
119
122
|
rowKeyGetter,
|
|
120
123
|
onChangeUserColumns,
|
|
124
|
+
externalSortSettings: sortSettings,
|
|
125
|
+
externalFilterSettings: filterSettings,
|
|
121
126
|
size
|
|
122
127
|
} = props;
|
|
123
128
|
const isFirstRender = useFirstRender([columns, id]);
|
|
124
|
-
const classes = getComponentClasses(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const [columnsWidths, setColumnsWidths] = useState(
|
|
137
|
-
/* @__PURE__ */ new Map()
|
|
129
|
+
const classes = getComponentClasses(DATAGRID_PREFIX_NAME, {
|
|
130
|
+
...DataGridSlots,
|
|
131
|
+
...ActionsSlots,
|
|
132
|
+
...RowsCountSlots,
|
|
133
|
+
...TableSlots,
|
|
134
|
+
...TextEditorSlots,
|
|
135
|
+
...ColumnsConfigSlots,
|
|
136
|
+
...ControlNavigateSlots
|
|
137
|
+
});
|
|
138
|
+
const [columnsWidths, setColumnsWidths] = useState(/* @__PURE__ */ new Map());
|
|
139
|
+
const [columnsConfig, setColumnsConfigOptions] = useState(
|
|
140
|
+
() => []
|
|
138
141
|
);
|
|
139
|
-
const [columnsConfig, setColumnsConfigOptions] = useState(() => []);
|
|
140
142
|
const [rowsFilterCount, setRowFilterCount] = useState(rowsCount);
|
|
143
|
+
const [sortColumns, setSortColumns] = useState([]);
|
|
141
144
|
const [currentRowHeightVariant, setCurrentRowHeightVariant] = useState(() => {
|
|
142
145
|
if (typeof rowHeights !== typeof rowHeaderHeights) {
|
|
143
146
|
throw new Error("Must be same type rowheights and rowHeaderTypes");
|
|
@@ -161,19 +164,44 @@ function DataGridProvider(props) {
|
|
|
161
164
|
rowHeaderHeight: typeof rowHeaderHeights !== "number" ? rowHeaderHeights[getIndexRowHeightVariant(initialRowHeightVariant)] : rowHeaderHeights
|
|
162
165
|
};
|
|
163
166
|
});
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
const keys = new Set(columns.map((c) => c.key));
|
|
169
|
+
if (sortSettings?.sortsColumns) {
|
|
170
|
+
for (const sort of sortSettings.sortsColumns) {
|
|
171
|
+
if (!keys.has(sort)) {
|
|
172
|
+
throw new Error(
|
|
173
|
+
`DataGridProvider: Sorts incluye "${sort}", pero no existe ninguna columna con key="${sort}".`
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (filterSettings?.filterColumns) {
|
|
179
|
+
for (const filterField of filterSettings.filterColumns) {
|
|
180
|
+
if (!keys.has(filterField.name)) {
|
|
181
|
+
throw new Error(
|
|
182
|
+
`DataGridProvider: Fields incluye "${filterField.name}", pero no existe ninguna columna con key="${filterField.name}".`
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}, [columns, sortSettings, filterSettings]);
|
|
164
188
|
const finalRowHeights = useMemo(() => rowHeights, [rowHeights]);
|
|
165
189
|
let timerSaveColumns;
|
|
166
190
|
useEffect(() => {
|
|
167
191
|
if (isFirstRender) {
|
|
168
192
|
setColumnsWidths(getColumnsWidth(id, columns, defaultUserColumns));
|
|
169
|
-
setColumnsConfigOptions(
|
|
193
|
+
setColumnsConfigOptions(
|
|
194
|
+
getColumnsConfig(id, columns, defaultUserColumns)
|
|
195
|
+
);
|
|
170
196
|
}
|
|
171
197
|
}, [defaultUserColumns]);
|
|
172
198
|
useEffect(() => {
|
|
173
199
|
if (!isFirstRender) {
|
|
174
200
|
const finalColumnsConfig = [];
|
|
175
201
|
for (let i = 0; i < columnsConfig.length; i++) {
|
|
176
|
-
const columnIndex = columns.findIndex(
|
|
202
|
+
const columnIndex = columns.findIndex(
|
|
203
|
+
(c) => c.key === columnsConfig[i]?.key
|
|
204
|
+
);
|
|
177
205
|
if (columnIndex !== -1) {
|
|
178
206
|
const column = columns[columnIndex];
|
|
179
207
|
finalColumnsConfig.push({
|
|
@@ -185,11 +213,18 @@ function DataGridProvider(props) {
|
|
|
185
213
|
});
|
|
186
214
|
}
|
|
187
215
|
}
|
|
188
|
-
const newColumns = columns.filter(
|
|
216
|
+
const newColumns = columns.filter(
|
|
217
|
+
(column, index) => column.key !== columnsConfig[index]?.key
|
|
218
|
+
);
|
|
189
219
|
if (newColumns.length > 0) {
|
|
190
220
|
const colLength = finalColumnsConfig.length;
|
|
191
|
-
const newColConfig = getColumnsConfig(
|
|
192
|
-
|
|
221
|
+
const newColConfig = getColumnsConfig(
|
|
222
|
+
id,
|
|
223
|
+
newColumns
|
|
224
|
+
).map((columnConfig, index) => {
|
|
225
|
+
const columnIndex = columns.findIndex(
|
|
226
|
+
(c) => c.key === newColumns[index].key
|
|
227
|
+
);
|
|
193
228
|
const column = newColumns[index];
|
|
194
229
|
const indexNewCol = index + colLength;
|
|
195
230
|
return {
|
|
@@ -206,7 +241,11 @@ function DataGridProvider(props) {
|
|
|
206
241
|
if (deepEqual(columnsConfig, finalColumnsConfig)) {
|
|
207
242
|
return;
|
|
208
243
|
}
|
|
209
|
-
console.log(
|
|
244
|
+
console.log(
|
|
245
|
+
"useEffect columnsConfig changed",
|
|
246
|
+
columnsConfig,
|
|
247
|
+
finalColumnsConfig
|
|
248
|
+
);
|
|
210
249
|
setColumnsConfigOptions(finalColumnsConfig);
|
|
211
250
|
}
|
|
212
251
|
}, [columns, id]);
|
|
@@ -223,8 +262,12 @@ function DataGridProvider(props) {
|
|
|
223
262
|
if (sourceKey === targetKey) {
|
|
224
263
|
return;
|
|
225
264
|
}
|
|
226
|
-
const sourceColumnIndex = columnsConfig.findIndex(
|
|
227
|
-
|
|
265
|
+
const sourceColumnIndex = columnsConfig.findIndex(
|
|
266
|
+
(c) => c.key === sourceKey
|
|
267
|
+
);
|
|
268
|
+
const targetColumnIndex = columnsConfig.findIndex(
|
|
269
|
+
(c) => c.key === targetKey
|
|
270
|
+
);
|
|
228
271
|
const reorderedColumnsConfig = [...columnsConfig];
|
|
229
272
|
reorderedColumnsConfig.splice(
|
|
230
273
|
targetColumnIndex,
|
|
@@ -282,6 +325,10 @@ function DataGridProvider(props) {
|
|
|
282
325
|
onCheckedRowsChange,
|
|
283
326
|
rowKeyGetter,
|
|
284
327
|
onChangeUserColumns,
|
|
328
|
+
sortColumns,
|
|
329
|
+
setSortColumns,
|
|
330
|
+
externalSortSettings: sortSettings,
|
|
331
|
+
externalFilterSettings: filterSettings,
|
|
285
332
|
classes,
|
|
286
333
|
size
|
|
287
334
|
},
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { RowKey, RowHeightVariants, GridProps } from '../../types';
|
|
3
3
|
import { Maybe } from '@m4l/core';
|
|
4
4
|
import { ActionsSlots, ColumnsConfigSlots, ControlNavigateSlots, DataGridSlots, RowsCountSlots, TableSlots, TextEditorSlots } from '../../slots/DataGridEnum';
|
|
5
|
+
import { SortColumn } from 'react-data-grid';
|
|
5
6
|
export interface BaseConfigColumn {
|
|
6
7
|
key: string;
|
|
7
8
|
visible: boolean;
|
|
@@ -22,7 +23,7 @@ export interface IGridConfig {
|
|
|
22
23
|
columnsConfig: BaseConfigColumn[];
|
|
23
24
|
columnsWidths: Record<RowKey, number>;
|
|
24
25
|
}
|
|
25
|
-
export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'rowKeyGetter' | 'onChangeUserColumns' | 'defaultUserColumns'> {
|
|
26
|
+
export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'rowKeyGetter' | 'onChangeUserColumns' | 'defaultUserColumns' | 'externalSortSettings' | 'externalFilterSettings'> {
|
|
26
27
|
id: number | string;
|
|
27
28
|
children: ReactNode;
|
|
28
29
|
rowsCount: number;
|
|
@@ -33,7 +34,7 @@ export type RowHeightState = {
|
|
|
33
34
|
rowHeight: number;
|
|
34
35
|
rowHeaderHeight: number;
|
|
35
36
|
};
|
|
36
|
-
export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'onChangeUserColumns'> {
|
|
37
|
+
export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'onChangeUserColumns' | 'externalSortSettings' | 'externalFilterSettings'> {
|
|
37
38
|
columnsConfig: IConfigColumn[];
|
|
38
39
|
columnsWidths: Map<string, Maybe<string | number>>;
|
|
39
40
|
setRowsCount: (newRowsCount: number) => void;
|
|
@@ -46,4 +47,6 @@ export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = R
|
|
|
46
47
|
onChangeColumnWidth: (columnKey: string, width: number) => void;
|
|
47
48
|
classes?: Record<DataGridSlots | ActionsSlots | RowsCountSlots | TableSlots | TextEditorSlots | ColumnsConfigSlots | ControlNavigateSlots, string>;
|
|
48
49
|
size: GridProps<any, any, any>['size'];
|
|
50
|
+
sortColumns: SortColumn[];
|
|
51
|
+
setSortColumns: React.Dispatch<React.SetStateAction<SortColumn[]>>;
|
|
49
52
|
}
|
|
@@ -25,4 +25,12 @@ export declare const DICTIONARY: {
|
|
|
25
25
|
SETTINGS_VISIBLE_ALL: string;
|
|
26
26
|
SETTINGS_NO_VISIBLE_ALL: string;
|
|
27
27
|
SETTINGS_RESTORE: string;
|
|
28
|
+
NO_ACTIONS_LABEL: string;
|
|
29
|
+
ORDER_ASC_COLUMN: string;
|
|
30
|
+
ORDER_DESC_COLUMN: string;
|
|
31
|
+
REMOVE_ORDER_COLUMN: string;
|
|
32
|
+
FREEZE_COLUMN: string;
|
|
33
|
+
UNFREEZE_COLUMN: string;
|
|
34
|
+
HIDE_COLUMN: string;
|
|
35
|
+
ADD_FILTER_COLUMN: string;
|
|
28
36
|
};
|
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import { g as getMenuActionsComponentsDictionary } from "../MenuActions/dictionary.js";
|
|
2
2
|
import { g as getModalDictionary } from "../ModalDialog/dictionary.js";
|
|
3
3
|
import { g as getPagerComponentsDictionary } from "../Pager/dicctionary.js";
|
|
4
|
+
import { c as DATAGRID_ID_DICTIONARY } from "./constants.js";
|
|
4
5
|
const DATAGRID_DICTIONARY_ID = "data_grid";
|
|
5
6
|
function getDataGridComponentsDictionary() {
|
|
6
7
|
return [DATAGRID_DICTIONARY_ID].concat(getPagerComponentsDictionary()).concat(getMenuActionsComponentsDictionary()).concat(getModalDictionary());
|
|
7
8
|
}
|
|
8
9
|
const DICTIONARY = {
|
|
9
10
|
DENSITY_COMPACT: `${DATAGRID_DICTIONARY_ID}.density_compact`,
|
|
10
|
-
DENSITY_STANDARD: `${
|
|
11
|
-
DENSITY_CONFORTABLE: `${
|
|
12
|
-
DENSITY_TOOLTIP: `${
|
|
13
|
-
TOOLTIP_FILTER_HIDE: `${
|
|
14
|
-
TOOLTIP_FILTER_SHOW: `${
|
|
15
|
-
SETTINGS_COLUMN_NAME: `${
|
|
16
|
-
SETTINGS_COLUMN_POSITION: `${
|
|
17
|
-
SETTINGS_COLUMN_VISIBLE: `${
|
|
18
|
-
SETTINGS_COLUMNS_FROZEN: `${
|
|
19
|
-
SETTINGS_SEL_COLUMNS: `${
|
|
20
|
-
SETTINGS_MOVE_FIRST: `${
|
|
21
|
-
SETTINGS_MOVE_UP: `${
|
|
22
|
-
SETTINGS_MOVE_LAST: `${
|
|
23
|
-
SETTINGS_MOVE_DOWN: `${
|
|
24
|
-
SETTINGS_VISIBLE_ALL: `${
|
|
25
|
-
SETTINGS_NO_VISIBLE_ALL: `${
|
|
26
|
-
SETTINGS_RESTORE: `${
|
|
11
|
+
DENSITY_STANDARD: `${DATAGRID_ID_DICTIONARY}.density_standard`,
|
|
12
|
+
DENSITY_CONFORTABLE: `${DATAGRID_ID_DICTIONARY}.density_confortable`,
|
|
13
|
+
DENSITY_TOOLTIP: `${DATAGRID_ID_DICTIONARY}.tooltip_density`,
|
|
14
|
+
TOOLTIP_FILTER_HIDE: `${DATAGRID_ID_DICTIONARY}.tooltip_filter_hide`,
|
|
15
|
+
TOOLTIP_FILTER_SHOW: `${DATAGRID_ID_DICTIONARY}.tooltip_filter_show`,
|
|
16
|
+
SETTINGS_COLUMN_NAME: `${DATAGRID_ID_DICTIONARY}.settings_column_name`,
|
|
17
|
+
SETTINGS_COLUMN_POSITION: `${DATAGRID_ID_DICTIONARY}.settings_column_position`,
|
|
18
|
+
SETTINGS_COLUMN_VISIBLE: `${DATAGRID_ID_DICTIONARY}.settings_column_visible`,
|
|
19
|
+
SETTINGS_COLUMNS_FROZEN: `${DATAGRID_ID_DICTIONARY}.settings_column_frozen`,
|
|
20
|
+
SETTINGS_SEL_COLUMNS: `${DATAGRID_ID_DICTIONARY}.settings_sel_columns`,
|
|
21
|
+
SETTINGS_MOVE_FIRST: `${DATAGRID_ID_DICTIONARY}.settings_move_first`,
|
|
22
|
+
SETTINGS_MOVE_UP: `${DATAGRID_ID_DICTIONARY}.settings_move_up`,
|
|
23
|
+
SETTINGS_MOVE_LAST: `${DATAGRID_ID_DICTIONARY}.settings_move_last`,
|
|
24
|
+
SETTINGS_MOVE_DOWN: `${DATAGRID_ID_DICTIONARY}.settings_move_down`,
|
|
25
|
+
SETTINGS_VISIBLE_ALL: `${DATAGRID_ID_DICTIONARY}.settings_visible_all`,
|
|
26
|
+
SETTINGS_NO_VISIBLE_ALL: `${DATAGRID_ID_DICTIONARY}.settings_no_visible_all`,
|
|
27
|
+
SETTINGS_RESTORE: `${DATAGRID_ID_DICTIONARY}.settings_restore`,
|
|
28
|
+
NO_ACTIONS_LABEL: `${DATAGRID_ID_DICTIONARY}.no_actions_label`,
|
|
29
|
+
ORDER_ASC_COLUMN: `${DATAGRID_ID_DICTIONARY}.order_asc_column`,
|
|
30
|
+
ORDER_DESC_COLUMN: `${DATAGRID_ID_DICTIONARY}.order_desc_column`,
|
|
31
|
+
REMOVE_ORDER_COLUMN: `${DATAGRID_ID_DICTIONARY}.remove_order_column`,
|
|
32
|
+
FREEZE_COLUMN: `${DATAGRID_ID_DICTIONARY}.freeze_column`,
|
|
33
|
+
UNFREEZE_COLUMN: `${DATAGRID_ID_DICTIONARY}.unfreeze_column`,
|
|
34
|
+
HIDE_COLUMN: `${DATAGRID_ID_DICTIONARY}.hide_column`,
|
|
35
|
+
ADD_FILTER_COLUMN: `${DATAGRID_ID_DICTIONARY}.add_filter`
|
|
27
36
|
};
|
|
28
37
|
export {
|
|
29
38
|
DICTIONARY as D,
|
|
@@ -13,4 +13,11 @@ export declare const pathIcons: {
|
|
|
13
13
|
uncheckAll: string;
|
|
14
14
|
restoreColumns: string;
|
|
15
15
|
search: string;
|
|
16
|
+
sortAsc: string;
|
|
17
|
+
sortDesc: string;
|
|
18
|
+
filter2: string;
|
|
19
|
+
removeSort: string;
|
|
20
|
+
freezeColumn: string;
|
|
21
|
+
unfreezeColumn: string;
|
|
22
|
+
hideColumn: string;
|
|
16
23
|
};
|
|
@@ -12,7 +12,14 @@ const pathIcons = {
|
|
|
12
12
|
checkAll: "frontend/components/data_grid/assets/icons/check_all.svg",
|
|
13
13
|
uncheckAll: "frontend/components/data_grid/assets/icons/uncheck_all.svg",
|
|
14
14
|
restoreColumns: "frontend/components/data_grid/assets/icons/restore_columns.svg",
|
|
15
|
-
search: "frontend/components/data_grid/assets/icons/search.svg"
|
|
15
|
+
search: "frontend/components/data_grid/assets/icons/search.svg",
|
|
16
|
+
sortAsc: "frontend/components/data_grid/assets/icons/sort_asc.svg",
|
|
17
|
+
sortDesc: "frontend/components/data_grid/assets/icons/sort_desc.svg",
|
|
18
|
+
filter2: "frontend/components/data_grid/assets/icons/filter.svg",
|
|
19
|
+
removeSort: "frontend/components/data_grid/assets/icons/eraser.svg",
|
|
20
|
+
freezeColumn: "frontend/components/data_grid/assets/icons/pin.svg",
|
|
21
|
+
unfreezeColumn: "frontend/components/data_grid/assets/icons/pin-off.svg",
|
|
22
|
+
hideColumn: "frontend/components/data_grid/assets/icons/eye-off.svg"
|
|
16
23
|
};
|
|
17
24
|
export {
|
|
18
25
|
pathIcons as p
|
|
@@ -21,7 +21,13 @@ export declare enum TableSlots {
|
|
|
21
21
|
draggableWrapperInputBase = "draggableWrapperInputBase",
|
|
22
22
|
headerInputBase = "headerInputBase",
|
|
23
23
|
wrapperSkeleton = "wrapperSkeleton",
|
|
24
|
-
contentModalSetting = "contentModalSetting"
|
|
24
|
+
contentModalSetting = "contentModalSetting",
|
|
25
|
+
headerRenderClick = "headerRenderClick",
|
|
26
|
+
menuList = "menuList",
|
|
27
|
+
buttonHeaderActions = "buttonHeaderActions",
|
|
28
|
+
nameColumnIcon = "nameColumnIcon",
|
|
29
|
+
iconColumn = "iconColumn",
|
|
30
|
+
nameColumn = "nameColumn"
|
|
25
31
|
}
|
|
26
32
|
export declare enum TextEditorSlots {
|
|
27
33
|
inputTexEditor = "inputTexEditor"
|
|
@@ -25,6 +25,12 @@ var TableSlots = /* @__PURE__ */ ((TableSlots2) => {
|
|
|
25
25
|
TableSlots2["headerInputBase"] = "headerInputBase";
|
|
26
26
|
TableSlots2["wrapperSkeleton"] = "wrapperSkeleton";
|
|
27
27
|
TableSlots2["contentModalSetting"] = "contentModalSetting";
|
|
28
|
+
TableSlots2["headerRenderClick"] = "headerRenderClick";
|
|
29
|
+
TableSlots2["menuList"] = "menuList";
|
|
30
|
+
TableSlots2["buttonHeaderActions"] = "buttonHeaderActions";
|
|
31
|
+
TableSlots2["nameColumnIcon"] = "nameColumnIcon";
|
|
32
|
+
TableSlots2["iconColumn"] = "iconColumn";
|
|
33
|
+
TableSlots2["nameColumn"] = "nameColumn";
|
|
28
34
|
return TableSlots2;
|
|
29
35
|
})(TableSlots || {});
|
|
30
36
|
var TextEditorSlots = /* @__PURE__ */ ((TextEditorSlots2) => {
|
|
@@ -44,6 +44,12 @@ export declare const DraggableWrapperInputBaseStyled: import('@emotion/styled').
|
|
|
44
44
|
export declare const HeaderInputBaseStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
|
|
45
45
|
export declare const WrapperSkeletonStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
46
46
|
export declare const ContentModalSettingStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
47
|
+
export declare const HeaderRenderClickStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
48
|
+
export declare const MenuListStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
|
|
49
|
+
export declare const ButtonHeaderActionsStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
50
|
+
export declare const NameColumnIconStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
51
|
+
export declare const IconColumnStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
52
|
+
export declare const NameColumnStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
47
53
|
/**
|
|
48
54
|
* ****************
|
|
49
55
|
* Slots TextEditor
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { InputBase } from "@mui/material";
|
|
2
|
+
import { MenuList, InputBase } from "@mui/material";
|
|
3
3
|
import { D as DATAGRID_PREFIX_NAME } from "../constants.js";
|
|
4
4
|
import { D as DataGridSlots, T as TextEditorSlots, A as ActionsSlots, b as TableSlots, C as ControlNavigateSlots, R as RowsCountSlots, a as ColumnsConfigSlots } from "./DataGridEnum.js";
|
|
5
5
|
import { d as dataGridStyles } from "../Datagrid.styles.js";
|
|
@@ -88,6 +88,30 @@ const ContentModalSettingStyled = styled("div", {
|
|
|
88
88
|
name: DATAGRID_PREFIX_NAME,
|
|
89
89
|
slot: TableSlots.contentModalSetting
|
|
90
90
|
})(dataGridStyles.contentModalSetting);
|
|
91
|
+
const HeaderRenderClickStyled = styled("div", {
|
|
92
|
+
name: DATAGRID_PREFIX_NAME,
|
|
93
|
+
slot: TableSlots.headerRenderClick
|
|
94
|
+
})(dataGridStyles.headerRenderClick);
|
|
95
|
+
const MenuListStyled = styled(MenuList, {
|
|
96
|
+
name: DATAGRID_PREFIX_NAME,
|
|
97
|
+
slot: TableSlots.menuList
|
|
98
|
+
})(dataGridStyles.menuList);
|
|
99
|
+
const ButtonHeaderActionsStyled = styled("div", {
|
|
100
|
+
name: DATAGRID_PREFIX_NAME,
|
|
101
|
+
slot: TableSlots.buttonHeaderActions
|
|
102
|
+
})(dataGridStyles.buttonHeaderActions);
|
|
103
|
+
const NameColumnIconStyled = styled("div", {
|
|
104
|
+
name: DATAGRID_PREFIX_NAME,
|
|
105
|
+
slot: TableSlots.nameColumnIcon
|
|
106
|
+
})(dataGridStyles.nameColumnIcon);
|
|
107
|
+
const IconColumnStyled = styled("div", {
|
|
108
|
+
name: DATAGRID_PREFIX_NAME,
|
|
109
|
+
slot: TableSlots.iconColumn
|
|
110
|
+
})(dataGridStyles.iconColumn);
|
|
111
|
+
const NameColumnStyled = styled("div", {
|
|
112
|
+
name: DATAGRID_PREFIX_NAME,
|
|
113
|
+
slot: TableSlots.nameColumn
|
|
114
|
+
})(dataGridStyles.nameColumn);
|
|
91
115
|
const InputTextEditorStyled = styled("input", {
|
|
92
116
|
name: DATAGRID_PREFIX_NAME,
|
|
93
117
|
slot: TextEditorSlots.inputTexEditor
|
|
@@ -98,10 +122,13 @@ const ControlNavigateStyled = styled("div", {
|
|
|
98
122
|
})(dataGridStyles.controlNavigate);
|
|
99
123
|
export {
|
|
100
124
|
ActionsRootStyled as A,
|
|
125
|
+
ButtonHeaderActionsStyled as B,
|
|
101
126
|
CustomHeaderStyled as C,
|
|
102
127
|
DataGridRootStyled as D,
|
|
103
128
|
HeaderInputBaseStyled as H,
|
|
104
|
-
|
|
129
|
+
IconColumnStyled as I,
|
|
130
|
+
MenuListStyled as M,
|
|
131
|
+
NameColumnIconStyled as N,
|
|
105
132
|
RowsCountRootStyled as R,
|
|
106
133
|
TableWrapperDataGridStyled as T,
|
|
107
134
|
WrapperSkeletonStyled as W,
|
|
@@ -117,7 +144,10 @@ export {
|
|
|
117
144
|
ColumnsConfigActiosStyled as j,
|
|
118
145
|
ContentModalSettingStyled as k,
|
|
119
146
|
TableContainerStyled as l,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
147
|
+
NameColumnStyled as m,
|
|
148
|
+
DraggableHeaderRootStyled as n,
|
|
149
|
+
DraggableWrapperInputBaseStyled as o,
|
|
150
|
+
IconSearchStyled as p,
|
|
151
|
+
HeaderRenderClickStyled as q,
|
|
152
|
+
InputTextEditorStyled as r
|
|
123
153
|
};
|
|
@@ -4,12 +4,20 @@ import { u as useFilters } from "../../../../hooks/useFilters.js";
|
|
|
4
4
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
|
|
5
5
|
import { p as pathIcons } from "../../../../icons.js";
|
|
6
6
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
7
|
+
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
7
8
|
function Filter() {
|
|
8
9
|
const { activeFilters, setActiveFilters } = useFilters();
|
|
9
10
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
10
11
|
const { getLabel } = useModuleDictionary();
|
|
12
|
+
const { externalFilterSettings } = useDataGrid();
|
|
11
13
|
const toggleIcon = () => {
|
|
12
|
-
|
|
14
|
+
if (externalFilterSettings) {
|
|
15
|
+
externalFilterSettings.onChange?.({
|
|
16
|
+
action: "openPopoverMenuFields"
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
setActiveFilters(!activeFilters);
|
|
20
|
+
}
|
|
13
21
|
};
|
|
14
22
|
return /* @__PURE__ */ jsx(
|
|
15
23
|
IconButton,
|