@m4l/components 9.1.120 → 9.1.122
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/.storybook/decorators/WithAppearanceContext/index.d.ts +0 -0
- package/.storybook/utils/getStylesColorsByMode.d.ts +4 -4
- package/components/DataGrid/contexts/DataGridContext/index.js +3 -5
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +1 -3
- package/components/DataGrid/contexts/FilterContext/index.d.ts +1 -1
- package/components/DataGrid/dictionary.d.ts +18 -0
- package/components/DataGrid/dictionary.js +19 -1
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.js +1 -1
- package/components/DataGrid/formatters/ColumnDateFormatter/index.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/index.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/index.js +1 -2
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.js +1 -3
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.d.ts +0 -3
- package/components/DataGrid/hooks/useDataGrid.d.ts +2 -1
- package/components/DataGrid/icons.d.ts +15 -0
- package/components/DataGrid/icons.js +18 -0
- package/components/DataGrid/index.d.ts +5 -1
- package/components/DataGrid/index.js +5 -10
- package/components/DataGrid/slots/DataGridEnum.d.ts +30 -0
- package/components/DataGrid/slots/DataGridEnum.js +44 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +48 -0
- package/components/DataGrid/slots/DataGridSlot.js +97 -0
- package/components/DataGrid/styles.d.ts +2 -1
- package/components/DataGrid/styles.js +479 -12
- package/components/DataGrid/subcomponents/Actions/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/index.js +7 -7
- package/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.js +13 -12
- package/components/DataGrid/subcomponents/Actions/subcomponents/Filter/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/Filter/index.js +5 -6
- package/components/DataGrid/subcomponents/Actions/subcomponents/MobileMenuActions/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/MobileMenuActions/index.js +14 -13
- package/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/index.js +7 -6
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/index.js +2 -4
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +28 -27
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/types.d.ts +1 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/hooks/useModalSettings/index.js +11 -11
- package/components/DataGrid/subcomponents/Actions/types.d.ts +1 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +1 -1
- package/components/DataGrid/subcomponents/Table/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Table/index.js +5 -4
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +12 -43
- package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +2 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/index.js +2 -4
- package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +0 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +3 -28
- package/components/DataGrid/tests/DataGrid.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +6 -0
- package/components/ScrollBar/ScrollBar.d.ts +1 -5
- package/components/ScrollBar/ScrollBar.js +3 -2
- package/components/ScrollBar/ScrollBar.styles.js +8 -19
- package/components/areas/components/AreasViewer/types.d.ts +1 -1
- package/components/gclick/MyDevice/MyDevice.js +1 -1
- package/package.json +1 -1
- package/components/DataGrid/classes/constants.d.ts +0 -1
- package/components/DataGrid/classes/constants.js +0 -4
- package/components/DataGrid/classes/index.d.ts +0 -33
- package/components/DataGrid/classes/index.js +0 -71
- package/components/DataGrid/classes/types.d.ts +0 -30
- package/components/DataGrid/formatters/ColumnDateFormatter/styles.d.ts +0 -1
- package/components/DataGrid/subcomponents/Actions/styles.d.ts +0 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/Filter/types.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/types.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +0 -7
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.js +0 -50
- package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.d.ts +0 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.js +0 -10
- /package/components/DataGrid/subcomponents/Actions/subcomponents/{Settings/types.d.ts → types.d.ts} +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEnvironment } from "@m4l/core";
|
|
2
|
+
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
3
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
4
4
|
import { u as useFilters } from "../../../../hooks/useFilters.js";
|
|
5
5
|
import { u as useModalSettings } from "../hooks/useModalSettings/index.js";
|
|
6
|
+
import { p as pathIcons } from "../../../../icons.js";
|
|
6
7
|
import { M as MenuActions } from "../../../../../MenuActions/MenuActions.js";
|
|
7
8
|
const MobileMenuActions = () => {
|
|
9
|
+
const { getLabel } = useModuleDictionary();
|
|
8
10
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
9
11
|
const { currentRowHeightVariant, setRowHeightVariant } = useDataGrid();
|
|
10
12
|
const { activeFilters, setActiveFilters } = useFilters();
|
|
@@ -15,44 +17,43 @@ const MobileMenuActions = () => {
|
|
|
15
17
|
const menuActions = [
|
|
16
18
|
{
|
|
17
19
|
type: "menuItem",
|
|
18
|
-
startIcon: `${host_static_assets}/${environment_assets}
|
|
20
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.compact}`,
|
|
19
21
|
onClick: () => setRowHeightVariant("compact"),
|
|
20
22
|
disabled: currentRowHeightVariant === "compact",
|
|
21
|
-
label: "data_grid.density_compact"
|
|
23
|
+
label: getLabel("data_grid.density_compact")
|
|
22
24
|
},
|
|
23
25
|
{
|
|
24
26
|
type: "menuItem",
|
|
25
|
-
startIcon: `${host_static_assets}/${environment_assets}
|
|
27
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.standard}`,
|
|
26
28
|
onClick: () => setRowHeightVariant("standard"),
|
|
27
29
|
disabled: currentRowHeightVariant === "standard",
|
|
28
|
-
label: "data_grid.density_standard"
|
|
30
|
+
label: getLabel("data_grid.density_standard")
|
|
29
31
|
},
|
|
30
32
|
{
|
|
31
33
|
type: "menuItem",
|
|
32
|
-
startIcon: `${host_static_assets}/${environment_assets}
|
|
34
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.confortable}`,
|
|
33
35
|
onClick: () => setRowHeightVariant("confortable"),
|
|
34
36
|
disabled: currentRowHeightVariant === "confortable",
|
|
35
|
-
label: "data_grid.density_confortable"
|
|
37
|
+
label: getLabel("data_grid.density_confortable")
|
|
36
38
|
},
|
|
37
39
|
{
|
|
38
40
|
type: "menuItem",
|
|
39
|
-
startIcon: `${host_static_assets}/${environment_assets}
|
|
41
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.filter}`,
|
|
40
42
|
onClick: () => toggleIcon(),
|
|
41
|
-
label: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show"
|
|
43
|
+
label: activeFilters ? getLabel("data_grid.tooltip_filter_hide") : getLabel("data_grid.tooltip_filter_show")
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
type: "menuItem",
|
|
45
|
-
startIcon: `${host_static_assets}/${environment_assets}
|
|
47
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.configuration}`,
|
|
46
48
|
onClick: () => modalSettings(),
|
|
47
|
-
label: "data_grid.tooltip_settings"
|
|
49
|
+
label: getLabel("data_grid.tooltip_settings")
|
|
48
50
|
}
|
|
49
51
|
];
|
|
50
52
|
return /* @__PURE__ */ jsx(
|
|
51
53
|
MenuActions,
|
|
52
54
|
{
|
|
53
|
-
|
|
55
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.menu}`,
|
|
54
56
|
arrowType: "no-arrow",
|
|
55
|
-
marginTop: "12px",
|
|
56
57
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
57
58
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
58
59
|
menuActions
|
|
@@ -2,16 +2,17 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
3
3
|
import { Skeleton } from "@mui/material";
|
|
4
4
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
5
|
+
import { R as RowsCountRootStyled, b as RowsCountLabelStyled, c as RowsCountValueStyled } from "../../../../slots/DataGridSlot.js";
|
|
5
6
|
function RowsCount() {
|
|
6
|
-
const { rowsCount
|
|
7
|
+
const { rowsCount } = useDataGrid();
|
|
7
8
|
const { getLabel } = useModuleDictionary();
|
|
8
9
|
const isSkeleton = useModuleSkeleton();
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
-
/* @__PURE__ */ jsx(
|
|
11
|
-
/* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(RowsCountRootStyled, { children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(RowsCountLabelStyled, { children: getLabel("data_grid.rows") }),
|
|
12
|
+
/* @__PURE__ */ jsx(RowsCountValueStyled, { children: rowsCount })
|
|
12
13
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
|
-
/* @__PURE__ */ jsx(
|
|
14
|
-
/* @__PURE__ */ jsx(
|
|
14
|
+
/* @__PURE__ */ jsx(RowsCountLabelStyled, { children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "40px", height: "16px" }) }),
|
|
15
|
+
/* @__PURE__ */ jsx(RowsCountValueStyled, { children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "20px", height: "16px" }) })
|
|
15
16
|
] }) });
|
|
16
17
|
}
|
|
17
18
|
export {
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
|
|
3
|
-
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
4
3
|
import { useEnvironment } from "@m4l/core";
|
|
5
4
|
import { u as useModalSettings } from "../hooks/useModalSettings/index.js";
|
|
5
|
+
import { p as pathIcons } from "../../../../icons.js";
|
|
6
6
|
function Settings() {
|
|
7
7
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
8
|
-
const { classes } = useDataGrid();
|
|
9
8
|
const modalSettings = useModalSettings();
|
|
10
9
|
return /* @__PURE__ */ jsx(
|
|
11
10
|
IconButton,
|
|
12
11
|
{
|
|
13
|
-
className: classes.actionSettings,
|
|
14
12
|
dictionaryTooltipId: "data_grid.tooltip_settings",
|
|
15
13
|
onClick: modalSettings,
|
|
16
14
|
"aria-label": "settings",
|
|
17
|
-
|
|
15
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.configuration}`
|
|
18
16
|
}
|
|
19
17
|
);
|
|
20
18
|
}
|
|
@@ -3,7 +3,9 @@ import { forwardRef, useRef, useState, useImperativeHandle, useMemo, useEffect }
|
|
|
3
3
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
4
4
|
import DataGrid from "react-data-grid";
|
|
5
5
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
6
|
-
import {
|
|
6
|
+
import { p as pathIcons } from "../../../../../../icons.js";
|
|
7
|
+
import { C as ColumnsConfigWrapperStyled, d as ColumnsConfigSelColumnsStyled, e as ColumnsConfigDataGridStyled, T as TableWrapperDataGridStyled, f as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
8
|
+
import { d as dictionary } from "../../../../../../dictionary.js";
|
|
7
9
|
import { C as ColumnInteractiveCheckFormatter } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/index.js";
|
|
8
10
|
function getRowsFromColumnsConfig(columnsConfig) {
|
|
9
11
|
return columnsConfig.filter((column) => !column.hidden).map(
|
|
@@ -20,7 +22,7 @@ function getRowsFromColumnsConfig(columnsConfig) {
|
|
|
20
22
|
}
|
|
21
23
|
const ColumnsConfig = forwardRef((props, ref) => {
|
|
22
24
|
const refdata_grid = useRef(null);
|
|
23
|
-
const { onCloseSettings, columnsConfig, onChangeColumnsConfig,
|
|
25
|
+
const { onCloseSettings, columnsConfig, onChangeColumnsConfig, rowHeight } = props;
|
|
24
26
|
const { getLabel } = useModuleDictionary();
|
|
25
27
|
const [isInit, setIsInit] = useState(true);
|
|
26
28
|
const [rows, setRows] = useState(getRowsFromColumnsConfig(columnsConfig));
|
|
@@ -35,21 +37,21 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
35
37
|
() => [
|
|
36
38
|
{
|
|
37
39
|
key: "name",
|
|
38
|
-
name: getLabel(
|
|
39
|
-
width:
|
|
40
|
+
name: getLabel(dictionary.SETTINGS_COLUMN_NAME),
|
|
41
|
+
width: 220,
|
|
40
42
|
resizable: true,
|
|
41
43
|
type: "string"
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
key: "originalIndex",
|
|
45
|
-
name: getLabel(
|
|
47
|
+
name: getLabel(dictionary.SETTINGS_COLUMN_POSITION),
|
|
46
48
|
width: 50,
|
|
47
49
|
type: "number",
|
|
48
50
|
cellClass: "rdg-cell-align-center"
|
|
49
51
|
},
|
|
50
52
|
{
|
|
51
53
|
key: "visible",
|
|
52
|
-
name: getLabel(
|
|
54
|
+
name: getLabel(dictionary.SETTINGS_COLUMN_VISIBLE),
|
|
53
55
|
width: 80,
|
|
54
56
|
type: "boolean",
|
|
55
57
|
formatter: ColumnInteractiveCheckFormatter,
|
|
@@ -57,7 +59,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
57
59
|
},
|
|
58
60
|
{
|
|
59
61
|
key: "frozen",
|
|
60
|
-
name: getLabel(
|
|
62
|
+
name: getLabel(dictionary.SETTINGS_COLUMNS_FROZEN),
|
|
61
63
|
width: 80,
|
|
62
64
|
type: "boolean",
|
|
63
65
|
formatter: ColumnInteractiveCheckFormatter,
|
|
@@ -135,7 +137,6 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
135
137
|
return {
|
|
136
138
|
visible: rows[rowIndexFinded].visible,
|
|
137
139
|
frozen: rows[rowIndexFinded].frozen
|
|
138
|
-
// index: rowIndexFinded,
|
|
139
140
|
};
|
|
140
141
|
}
|
|
141
142
|
return void 0;
|
|
@@ -174,13 +175,13 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
174
175
|
const mySet = /* @__PURE__ */ new Set([row.key]);
|
|
175
176
|
setSelRows(mySet);
|
|
176
177
|
};
|
|
177
|
-
return /* @__PURE__ */ jsxs(
|
|
178
|
-
/* @__PURE__ */ jsx(
|
|
179
|
-
/* @__PURE__ */ jsx(
|
|
178
|
+
return /* @__PURE__ */ jsxs(ColumnsConfigWrapperStyled, { ref: divRef, children: [
|
|
179
|
+
/* @__PURE__ */ jsx(ColumnsConfigSelColumnsStyled, { children: getLabel(dictionary.SETTINGS_SEL_COLUMNS) }),
|
|
180
|
+
/* @__PURE__ */ jsx(ColumnsConfigDataGridStyled, { children: /* @__PURE__ */ jsx(TableWrapperDataGridStyled, { children: /* @__PURE__ */ jsx(
|
|
180
181
|
DataGrid,
|
|
181
182
|
{
|
|
182
|
-
className: classes.columnsConfigGrid,
|
|
183
183
|
ref: refdata_grid,
|
|
184
|
+
rowHeight,
|
|
184
185
|
columns: columnsdata_grid,
|
|
185
186
|
rows,
|
|
186
187
|
onRowsChange: onInternalRowsChange,
|
|
@@ -192,73 +193,73 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
192
193
|
defaultColumnOptions: { resizable: true, sortable: true }
|
|
193
194
|
}
|
|
194
195
|
) }) }),
|
|
195
|
-
/* @__PURE__ */ jsxs(
|
|
196
|
+
/* @__PURE__ */ jsxs(ColumnsConfigActiosStyled, { children: [
|
|
196
197
|
/* @__PURE__ */ jsx(
|
|
197
198
|
IconButton,
|
|
198
199
|
{
|
|
199
|
-
tooltip: getLabel(
|
|
200
|
+
tooltip: getLabel(dictionary.SETTINGS_MOVE_FIRST),
|
|
200
201
|
onClick: handleMoveFirst,
|
|
201
202
|
"aria-label": "move first place",
|
|
202
203
|
disabled: rowSelectedIndex < 1,
|
|
203
|
-
|
|
204
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.moveFirstPlace}`
|
|
204
205
|
}
|
|
205
206
|
),
|
|
206
207
|
/* @__PURE__ */ jsx(
|
|
207
208
|
IconButton,
|
|
208
209
|
{
|
|
209
|
-
tooltip: getLabel(
|
|
210
|
+
tooltip: getLabel(dictionary.SETTINGS_MOVE_UP),
|
|
210
211
|
dictionaryTooltipId: "data_grid.settings_move_up",
|
|
211
212
|
onClick: () => handleMoveUpDownd(-1),
|
|
212
213
|
"aria-label": "move up place",
|
|
213
214
|
disabled: rowSelectedIndex < 1,
|
|
214
|
-
|
|
215
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.moveUpPlace}`
|
|
215
216
|
}
|
|
216
217
|
),
|
|
217
218
|
/* @__PURE__ */ jsx(
|
|
218
219
|
IconButton,
|
|
219
220
|
{
|
|
220
|
-
tooltip: getLabel(
|
|
221
|
+
tooltip: getLabel(dictionary.SETTINGS_MOVE_LAST),
|
|
221
222
|
onClick: handleMoveLast,
|
|
222
223
|
"aria-label": "move last place",
|
|
223
224
|
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
224
|
-
|
|
225
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.moveLastPlace}`
|
|
225
226
|
}
|
|
226
227
|
),
|
|
227
228
|
/* @__PURE__ */ jsx(
|
|
228
229
|
IconButton,
|
|
229
230
|
{
|
|
230
|
-
tooltip: getLabel(
|
|
231
|
+
tooltip: getLabel(dictionary.SETTINGS_MOVE_DOWN),
|
|
231
232
|
onClick: () => handleMoveUpDownd(1),
|
|
232
233
|
"aria-label": "move down place",
|
|
233
234
|
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
234
|
-
|
|
235
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.moveDownPlace}`
|
|
235
236
|
}
|
|
236
237
|
),
|
|
237
238
|
/* @__PURE__ */ jsx(
|
|
238
239
|
IconButton,
|
|
239
240
|
{
|
|
240
|
-
tooltip: getLabel(
|
|
241
|
+
tooltip: getLabel(dictionary.SETTINGS_VISIBLE_ALL),
|
|
241
242
|
onClick: checkAll,
|
|
242
243
|
"aria-label": "check visible all",
|
|
243
|
-
|
|
244
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.checkAll}`
|
|
244
245
|
}
|
|
245
246
|
),
|
|
246
247
|
/* @__PURE__ */ jsx(
|
|
247
248
|
IconButton,
|
|
248
249
|
{
|
|
249
|
-
tooltip: getLabel(
|
|
250
|
+
tooltip: getLabel(dictionary.SETTINGS_NO_VISIBLE_ALL),
|
|
250
251
|
onClick: unCheckAll,
|
|
251
252
|
"aria-label": "un check all",
|
|
252
|
-
|
|
253
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.uncheckAll}`
|
|
253
254
|
}
|
|
254
255
|
),
|
|
255
256
|
/* @__PURE__ */ jsx(
|
|
256
257
|
IconButton,
|
|
257
258
|
{
|
|
258
|
-
tooltip: getLabel(
|
|
259
|
+
tooltip: getLabel(dictionary.SETTINGS_RESTORE),
|
|
259
260
|
onClick: restoreAll,
|
|
260
261
|
"aria-label": "Restore columns",
|
|
261
|
-
|
|
262
|
+
icon: `${host_static_assets}/${environment_assets}/${pathIcons.restoreColumns}`
|
|
262
263
|
}
|
|
263
264
|
)
|
|
264
265
|
] })
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Classes } from '../../../../../../classes/types';
|
|
2
1
|
import { IConfigColumn } from '../../../../../../contexts/DataGridContext/types';
|
|
3
2
|
export interface Row {
|
|
4
3
|
key: string;
|
|
@@ -19,7 +18,7 @@ export interface ConfigProps {
|
|
|
19
18
|
onCloseSettings: () => void;
|
|
20
19
|
columnsConfig: IConfigColumn[];
|
|
21
20
|
onChangeColumnsConfig: (newColumnsConfig: IConfigColumn[]) => void;
|
|
22
|
-
|
|
21
|
+
rowHeight: number;
|
|
23
22
|
}
|
|
24
23
|
export interface CheckFormatterProps {
|
|
25
24
|
key: string;
|
package/components/DataGrid/subcomponents/Actions/subcomponents/hooks/useModalSettings/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
3
|
import { useIsMobile } from "@m4l/graphics";
|
|
4
4
|
import { useRef, useCallback } from "react";
|
|
5
5
|
import { u as useDataGrid } from "../../../../../hooks/useDataGrid.js";
|
|
6
6
|
import { u as useModal } from "../../../../../../../hooks/useModal/index.js";
|
|
7
|
-
import { D as DataGridRoot } from "../../../../../styles.js";
|
|
8
7
|
import { C as ColumnsConfig } from "../../Settings/subcomponents/ColumnsConfig/index.js";
|
|
8
|
+
import { g as ContentModalSettingStyled, D as DataGridRootStyled, h as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../../../../slots/DataGridSlot.js";
|
|
9
|
+
import { p as pathIcons } from "../../../../../icons.js";
|
|
9
10
|
import { A as ActionsContainer } from "../../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
10
11
|
import { W as WindowBase } from "../../../../../../WindowBase/WindowBase.js";
|
|
11
12
|
import { A as ActionCancel } from "../../../../../../CommonActions/components/ActionCancel/ActionCancel.js";
|
|
12
13
|
import { A as ActionIntro } from "../../../../../../CommonActions/components/ActionIntro/ActionIntro.js";
|
|
13
14
|
const useModalSettings = () => {
|
|
14
15
|
const { openModal, closeModal } = useModal();
|
|
15
|
-
const { columnsConfig, onChangeColumnsConfig } = useDataGrid();
|
|
16
|
+
const { columnsConfig, onChangeColumnsConfig, currentRowHeight } = useDataGrid();
|
|
16
17
|
const { getLabel } = useModuleDictionary();
|
|
17
18
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
18
19
|
const isMobile = useIsMobile();
|
|
19
|
-
const { classes } = useDataGrid();
|
|
20
20
|
const ref = useRef(null);
|
|
21
21
|
const onCloseSettings = useCallback(() => {
|
|
22
22
|
closeModal();
|
|
@@ -31,27 +31,27 @@ const useModalSettings = () => {
|
|
|
31
31
|
initialWidth: 500,
|
|
32
32
|
initialHeight: 680,
|
|
33
33
|
fullScreen: isMobile,
|
|
34
|
-
window: /* @__PURE__ */
|
|
34
|
+
window: /* @__PURE__ */ jsx(
|
|
35
35
|
WindowBase,
|
|
36
36
|
{
|
|
37
37
|
title: getLabel("data_grid.settings_title"),
|
|
38
|
-
iconUrl: `${host_static_assets}/${environment_assets}
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
38
|
+
iconUrl: `${host_static_assets}/${environment_assets}/${pathIcons.configuration}`,
|
|
39
|
+
children: /* @__PURE__ */ jsxs(ContentModalSettingStyled, { children: [
|
|
40
|
+
/* @__PURE__ */ jsx(DataGridRootStyled, { children: /* @__PURE__ */ jsx(TableContainerStyled, { children: /* @__PURE__ */ jsx(TableWrapperDataGridStyled, { children: /* @__PURE__ */ jsx(
|
|
41
41
|
ColumnsConfig,
|
|
42
42
|
{
|
|
43
43
|
ref,
|
|
44
|
+
rowHeight: currentRowHeight,
|
|
44
45
|
columnsConfig,
|
|
45
46
|
onChangeColumnsConfig,
|
|
46
|
-
onCloseSettings
|
|
47
|
-
classes
|
|
47
|
+
onCloseSettings
|
|
48
48
|
}
|
|
49
49
|
) }) }) }),
|
|
50
50
|
/* @__PURE__ */ jsxs(ActionsContainer, { children: [
|
|
51
51
|
/* @__PURE__ */ jsx(ActionCancel, { onClick: closeModal }),
|
|
52
52
|
/* @__PURE__ */ jsx(ActionIntro, { onClick: onClickIntro })
|
|
53
53
|
] })
|
|
54
|
-
]
|
|
54
|
+
] })
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo } from "react";
|
|
2
2
|
import { g as getDragHeaderRenderer } from "./getDragHeaderRenderer.js";
|
|
3
3
|
import { A as ActionsColumn } from "../subcomponents/ActionsColumn.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as filterColumnClassName, S as SelectColumn } from "../subcomponents/SelectColumn.js";
|
|
5
5
|
import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
6
6
|
import { u as useFilters } from "../../../hooks/useFilters.js";
|
|
7
7
|
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GridProps, RowKey } from '../../types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Componente que renderiza la tabla con las filas y columnas
|
|
4
4
|
*/
|
|
5
5
|
export declare function Table<TRow, TSummaryRow, TKey extends RowKey = RowKey>(props: GridProps<TRow, TSummaryRow, TKey>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,10 +4,11 @@ import DataGrid from "react-data-grid";
|
|
|
4
4
|
import { DndProvider } from "react-dnd";
|
|
5
5
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
6
6
|
import { C as CheckboxFormatter } from "./subcomponents/CheckboxFormatter.js";
|
|
7
|
-
import {
|
|
7
|
+
import { f 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 { h as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../slots/DataGridSlot.js";
|
|
11
12
|
function Table(props) {
|
|
12
13
|
const { columns, rows, onRowsChange, rowKeyGetter, selectedRows, onSelectedRowsChange } = props;
|
|
13
14
|
const { finalColumns, sortColumns, setSortColumns, finalRows } = useSortColumnsRows(
|
|
@@ -15,7 +16,7 @@ function Table(props) {
|
|
|
15
16
|
rows
|
|
16
17
|
);
|
|
17
18
|
const { activeFilters } = useFilters();
|
|
18
|
-
const { onChangeColumnWidth, setRowsCount, currentRowHeight, currentRowHeaderHeight
|
|
19
|
+
const { onChangeColumnWidth, setRowsCount, currentRowHeight, currentRowHeaderHeight } = useDataGrid();
|
|
19
20
|
const ref_data_grid = useRef(null);
|
|
20
21
|
const onRowClick = (row) => {
|
|
21
22
|
if (selectedRows && onSelectedRowsChange) {
|
|
@@ -49,10 +50,10 @@ function Table(props) {
|
|
|
49
50
|
const onChangeSort = (newSortColumns) => {
|
|
50
51
|
setSortColumns(newSortColumns);
|
|
51
52
|
};
|
|
52
|
-
return /* @__PURE__ */ jsx(
|
|
53
|
+
return /* @__PURE__ */ jsx(TableContainerStyled, { id: "WrapperTable", children: /* @__PURE__ */ jsx(TableWrapperDataGridStyled, { children: /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsx(
|
|
53
54
|
DataGrid,
|
|
54
55
|
{
|
|
55
|
-
className: "
|
|
56
|
+
className: "rdg-light",
|
|
56
57
|
ref: ref_data_grid,
|
|
57
58
|
headerRowHeight: activeFilters ? currentRowHeaderHeight + filterHeight : currentRowHeaderHeight,
|
|
58
59
|
columns: finalColumns,
|
|
@@ -4,7 +4,7 @@ import { useTheme } from "@mui/material";
|
|
|
4
4
|
import { b as DATAGRID_ACTIONS_COLUMN_KEY } from "../../../constants.js";
|
|
5
5
|
import { M as MenuActions } from "../../../../MenuActions/MenuActions.js";
|
|
6
6
|
function ActionsFormatter(props) {
|
|
7
|
-
const { rowActionsGetter
|
|
7
|
+
const { rowActionsGetter } = useDataGrid();
|
|
8
8
|
const theme = useTheme();
|
|
9
9
|
if (rowActionsGetter === void 0) {
|
|
10
10
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
@@ -15,7 +15,6 @@ function ActionsFormatter(props) {
|
|
|
15
15
|
arrowType: "top-left",
|
|
16
16
|
objItem: props.row,
|
|
17
17
|
menuActions: rowActionsGetter,
|
|
18
|
-
className: classes.actionsFormatter,
|
|
19
18
|
menuActionSx: theme.components?.M4LDataGridActionsFormatter?.styleOverrides,
|
|
20
19
|
marginTop: 1,
|
|
21
20
|
marginLeft: "-11px",
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { useModuleDictionary } from "@m4l/core";
|
|
4
|
-
import { InputBase } from "@mui/material";
|
|
5
4
|
import { useDrag, useDrop } from "react-dnd";
|
|
6
5
|
import { HeaderRenderer } from "react-data-grid";
|
|
7
|
-
import { a as filterHeight } from "./SelectColumn.js";
|
|
8
6
|
import { u as useFocusRef } from "../hooks/useFocusRef.js";
|
|
9
7
|
import { u as useFilters } from "../../../hooks/useFilters.js";
|
|
8
|
+
import { i as DraggableHeaderRootStyled, j as DraggableWrapperInputBaseStyled, H as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
|
|
10
9
|
function DraggableHeaderRenderer(props) {
|
|
11
10
|
const { onColumnsReorder, column, isCellSelected, ...others } = props;
|
|
12
11
|
const { ref, tabIndex } = useFocusRef(isCellSelected);
|
|
@@ -51,7 +50,7 @@ function DraggableHeaderRenderer(props) {
|
|
|
51
50
|
newColumn.name = newColumn.withinHeaderRenderer(props);
|
|
52
51
|
}
|
|
53
52
|
return /* @__PURE__ */ jsxs(
|
|
54
|
-
|
|
53
|
+
DraggableHeaderRootStyled,
|
|
55
54
|
{
|
|
56
55
|
ref: (newRef) => {
|
|
57
56
|
drag(newRef);
|
|
@@ -59,51 +58,21 @@ function DraggableHeaderRenderer(props) {
|
|
|
59
58
|
},
|
|
60
59
|
style: {
|
|
61
60
|
opacity: isDragging ? 0.5 : 1,
|
|
62
|
-
backgroundColor: isOver ? "#ececec" : void 0
|
|
63
|
-
cursor: "move",
|
|
64
|
-
display: "flex",
|
|
65
|
-
flexDirection: "column",
|
|
66
|
-
lineHeight: "1",
|
|
67
|
-
// activeFilters && column.withFilter ? '30px' : '60px',
|
|
68
|
-
height: "100%",
|
|
69
|
-
justifyContent: "center",
|
|
70
|
-
textAlign: "center"
|
|
71
|
-
// alignItems: 'center',
|
|
72
|
-
// justifyContent: 'space-evenly'
|
|
61
|
+
backgroundColor: isOver ? "#ececec" : void 0
|
|
73
62
|
},
|
|
74
63
|
children: [
|
|
75
64
|
/* @__PURE__ */ jsx(HeaderRenderer, { column: newColumn, isCellSelected, ...others }),
|
|
76
|
-
activeFilters && (column?.withFilter === void 0 || column.withFilter === true) && /* @__PURE__ */ jsx(
|
|
77
|
-
|
|
65
|
+
activeFilters && (column?.withFilter === void 0 || column.withFilter === true) && /* @__PURE__ */ jsx(DraggableWrapperInputBaseStyled, { children: /* @__PURE__ */ jsx(
|
|
66
|
+
HeaderInputBaseStyled,
|
|
78
67
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// flexGrow: 1,
|
|
86
|
-
height: `${filterHeight}px`
|
|
87
|
-
// paddingLeft: '2px', paddingRight: '2px'
|
|
88
|
-
},
|
|
89
|
-
children: /* @__PURE__ */ jsx(
|
|
90
|
-
InputBase,
|
|
91
|
-
{
|
|
92
|
-
inputRef: ref,
|
|
93
|
-
placeholder: getLabel("data_grid.filter_holder"),
|
|
94
|
-
style: {
|
|
95
|
-
width: "100%",
|
|
96
|
-
paddingBottom: "2px",
|
|
97
|
-
border: "1px solid var(--rdg-border-color)"
|
|
98
|
-
},
|
|
99
|
-
tabIndex,
|
|
100
|
-
type: "text",
|
|
101
|
-
onChange: handleChange,
|
|
102
|
-
value: filter
|
|
103
|
-
}
|
|
104
|
-
)
|
|
68
|
+
inputRef: ref,
|
|
69
|
+
placeholder: getLabel("data_grid.filter_holder"),
|
|
70
|
+
tabIndex,
|
|
71
|
+
type: "text",
|
|
72
|
+
onChange: handleChange,
|
|
73
|
+
value: filter
|
|
105
74
|
}
|
|
106
|
-
)
|
|
75
|
+
) })
|
|
107
76
|
]
|
|
108
77
|
}
|
|
109
78
|
);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from "@mui/material";
|
|
3
|
-
import { W as
|
|
4
|
-
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
3
|
+
import { W as WrapperSkeletonStyled } from "../../../../slots/DataGridSlot.js";
|
|
5
4
|
function SkeletonFormatter() {
|
|
6
|
-
|
|
7
|
-
return /* @__PURE__ */ jsx(WrapperSkeleton, { className: classes.skeletonFormatter, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "100%", height: "12px" }) });
|
|
5
|
+
return /* @__PURE__ */ jsx(WrapperSkeletonStyled, { children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "100%", height: "12px" }) });
|
|
8
6
|
}
|
|
9
7
|
export {
|
|
10
8
|
SkeletonFormatter as S
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EditorProps } from 'react-data-grid';
|
|
2
|
-
export declare const Input: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
|
|
3
2
|
/**
|
|
4
3
|
* TODO: Documentar
|
|
5
4
|
*/
|
|
@@ -1,28 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
const Input = styled("input")(() => ({
|
|
4
|
-
appearance: "none",
|
|
5
|
-
boxSizing: "border-box",
|
|
6
|
-
inlineSize: "100%",
|
|
7
|
-
blockSize: "100%",
|
|
8
|
-
paddingBlock: "0",
|
|
9
|
-
/* padding-inline: 6px; */
|
|
10
|
-
/* border: 2px solid #ccc; */
|
|
11
|
-
verticalAlign: "top",
|
|
12
|
-
textAlign: "right",
|
|
13
|
-
color: "var(--rdg-color)",
|
|
14
|
-
backgroundColor: "var(--rdg-background-color)",
|
|
15
|
-
fontFamily: "inherit",
|
|
16
|
-
// fontSize: 'var(--rdg-font-size)',
|
|
17
|
-
"&:focus": {
|
|
18
|
-
// borderColor: 'var(--rdg-selection-color)',
|
|
19
|
-
outline: "none"
|
|
20
|
-
},
|
|
21
|
-
"&::placeholder": {
|
|
22
|
-
color: "#999",
|
|
23
|
-
opacity: "1"
|
|
24
|
-
}
|
|
25
|
-
}));
|
|
2
|
+
import { I as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
|
|
26
3
|
function autoFocusAndSelect(input) {
|
|
27
4
|
input?.focus();
|
|
28
5
|
input?.select();
|
|
@@ -34,9 +11,8 @@ function TextEditor({
|
|
|
34
11
|
onClose
|
|
35
12
|
}) {
|
|
36
13
|
return /* @__PURE__ */ jsx(
|
|
37
|
-
|
|
14
|
+
InputTextEditorStyled,
|
|
38
15
|
{
|
|
39
|
-
className: "rdg-text-editor",
|
|
40
16
|
ref: autoFocusAndSelect,
|
|
41
17
|
value: row[column.key],
|
|
42
18
|
onChange: (event) => onRowChange({ ...row, [column.key]: event.target.value }),
|
|
@@ -59,9 +35,8 @@ function NumberEditor({
|
|
|
59
35
|
}
|
|
60
36
|
};
|
|
61
37
|
return /* @__PURE__ */ jsx(
|
|
62
|
-
|
|
38
|
+
InputTextEditorStyled,
|
|
63
39
|
{
|
|
64
|
-
className: "rdg-text-editor",
|
|
65
40
|
ref: autoFocusAndSelect,
|
|
66
41
|
type: "number",
|
|
67
42
|
value: row[column.key],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|