@m4l/components 0.2.36 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AccountPopover/{index.a9dc9f92.js → index.efc74d5c.js} +3 -5
- package/components/AppBar/{index.7dee7427.js → index.fc126a22.js} +6 -5
- package/components/AppBar/styles.d.ts +1 -1
- package/components/CommonActions/components/Actions/styles.d.ts +1 -1
- package/components/DataGrid/styles.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +7 -7
- package/components/DragResizeWindow/{index.a9f25040.js → index.46b380e1.js} +3 -6
- package/components/DynamicFilter/dynamicFilterSlots.d.ts +76 -101
- package/components/DynamicFilter/{index.48d809e2.js → index.d9168c12.js} +22 -96
- package/components/FieldLabel/{index.2622ee40.js → index.f9cdcc27.js} +4 -4
- package/components/GridLayout/{index.b9c47a4c.js → index.bb3b7769.js} +23 -46
- package/components/GridLayout/subcomponents/Griditem/{index.69bc14e5.js → index.bb23f651.js} +4 -3
- package/components/GridLayout/subcomponents/Responsive/{index.094c1d09.js → index.b8a2a121.js} +2 -1
- package/components/GridLayout/subcomponents/SizeProvider/{index.e1d2df80.js → index.094bc6b5.js} +1 -1
- package/components/{commercial/index.b90488db.js → HamburgerMenu/index.5997af31.js} +4 -6
- package/components/HelperText/{index.81c5d349.js → index.be949cdf.js} +3 -2
- package/components/HelperText/styles.d.ts +1 -1
- package/components/Icon/index.d5fed418.js +420 -0
- package/components/Icon/styles.d.ts +2 -2
- package/components/{hook-form/RHFUpload/index.c5e5c61c.js → Image/index.36a3d440.js} +233 -32
- package/components/Image/styles.d.ts +1 -1
- package/components/LanguagePopover/{index.72f316fc.js → index.e6fa2336.js} +5 -8
- package/components/LanguagePopover/styles.d.ts +5 -5
- package/components/LinearProgressIndeterminate/{index.2ecd571e.js → index.de9d447c.js} +2 -4
- package/components/Loadable/{index.97fe63f9.js → index.e83cdb4e.js} +1 -1
- package/components/LoadingError/{index.7aaba1cf.js → index.9f00c83c.js} +8 -12
- package/components/LoadingError/styles.d.ts +1 -1
- package/components/MFLoader/{index.40c419c0.js → index.402c1acc.js} +4 -8
- package/components/ModalDialog/{index.42349189.js → index.ea9189c3.js} +5 -14
- package/components/NavLink/{index.9e847eb5.js → index.4e548cee.js} +4 -4
- package/components/NavLink/styles.d.ts +1 -1
- package/components/NoItemSelected/{index.5a8160fd.js → index.418c8316.js} +6 -15
- package/components/NoItemSelected/styles.d.ts +4 -4
- package/components/ObjectLogs/{index.6955149e.js → index.bfa7dad3.js} +10 -27
- package/components/ObjectLogs/styles.d.ts +3 -3
- package/components/PDFViewer/{index.47bb0928.js → index.bb2eca5a.js} +2 -2
- package/components/{mui_extended/Pager/index.1ba2d52b.js → Page/index.fdf04592.js} +134 -26
- package/components/PaperForm/{index.9f6fd02d.js → index.8121e3da.js} +8 -7
- package/components/PaperForm/styles.d.ts +6 -6
- package/components/Period/{index.c6d1a95a.js → index.5233694b.js} +157 -22
- package/components/Period/styles.d.ts +5 -5
- package/components/PrintingSystem/{index.f51a00f8.js → index.fb176a93.js} +14 -14
- package/components/PrintingSystem/subcomponents/BodyNode/{index.6792c353.js → index.c1d61038.js} +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index.eec6b4cd.js → index.18bd9bad.js} +1 -1
- package/components/PrintingSystem/subcomponents/DividerNode/{index.e58467c9.js → index.67d9f1b4.js} +1 -1
- package/components/PrintingSystem/subcomponents/FooterNode/{index.920b75c9.js → index.eaee152a.js} +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/{index.6c1ad53c.js → index.f5f63a2a.js} +1 -1
- package/components/PrintingSystem/subcomponents/HeaderNode/{index.e8b151ad.js → index.7de4e411.js} +1 -1
- package/components/PrintingSystem/subcomponents/PaperNode/{index.bf199422.js → index.f9ccf22b.js} +1 -1
- package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.44d436b9.js → index.f2f2e903.js} +1 -1
- package/components/PrintingSystem/subcomponents/SectionNode/{index.879cf13d.js → index.540a4b19.js} +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/{index.eb6af0ca.js → index.41e7fcb0.js} +1 -1
- package/components/PropertyValue/{index.5e59580c.js → index.9572c347.js} +4 -7
- package/components/Resizeable/{index.5e8e48b1.js → index.1f0c1359.js} +7 -7
- package/components/ResizeableWindow/styles.d.ts +1 -1
- package/components/ScrollBar/{index.4b965665.js → index.adf0eade.js} +2 -4
- package/components/SideBar/classes/index.d.ts +1 -1
- package/components/SideBar/{index.5d1f4a23.js → index.629ba840.js} +24 -26
- package/components/SideBar/styles.d.ts +2 -2
- package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +3 -3
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +2 -18
- package/components/SplitLayout/{index.15756f0f.js → index.74091a81.js} +1 -3
- package/components/ToastContainer/{index.dbd78941.js → index.f9b507b9.js} +3 -3
- package/components/animate/LoadingScreen/{index.1a83615a.js → index.779690a7.js} +3 -5
- package/components/animate/PropagateLoader/{index.76d7ea70.js → index.a9da8d00.js} +3 -2
- package/components/animate/PropagateLoader/syles.d.ts +1 -1
- package/components/animate/{index.87296638.js → index.b8497385.js} +3 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +3 -3
- package/components/areas/constants.5387d83e.js +412 -0
- package/components/areas/contexts/AreasContext/{index.19c7b906.js → index.bb316000.js} +5 -6
- package/components/areas/contexts/DynamicMFParmsContext/{index.3d9ad0ad.js → index.37d1d444.js} +2 -2
- package/components/areas/contexts/WindowToolsMFContext/{index.992ae7a3.js → index.69d95c15.js} +2 -2
- package/components/areas/dictionary.7e74022a.js +286 -0
- package/components/areas/hooks/useAreas/{index.cedd30ee.js → index.e24bd74d.js} +1 -1
- package/components/areas/hooks/useDynamicMFParameters/{index.9e09e1e3.js → index.03ce6078.js} +1 -1
- package/components/areas/hooks/useWindowToolsMF/{index.2fbae9dc.js → index.09801b66.js} +1 -1
- package/components/areas/icons.504ec098.js +83 -0
- package/components/commercial/HamburgerMenu/styles.d.ts +1 -1
- package/components/commercial/SectionCommercial/styles.d.ts +4 -9
- package/components/hook-form/RHFAutocomplete/classes/index.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/styles.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +4 -4
- package/components/hook-form/RHFCheckbox/styles.d.ts +2 -10
- package/components/hook-form/RHFPeriod/styles.d.ts +1 -1
- package/components/hook-form/RHFTextField/styles.d.ts +2 -2
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +2 -2
- package/components/hook-form/RHFTextFieldPassword/styles.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +1 -1
- package/components/maps/components/GpsTools/{index.4ea69dd1.js → index.75880ce0.js} +14 -136
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +4 -9
- package/components/maps/{components/Map/index.62b7d09b.js → index.8ec46ce4.js} +19 -194
- package/components/modal/{WindowBase.2414cd02.js → WindowBase.a3ac7adc.js} +3 -4
- package/components/modal/{WindowConfirm.48140481.js → WindowConfirm.e35da619.js} +6 -10
- package/components/modal/{index.81eb6def.js → index.a0e30c8b.js} +1 -5
- package/components/mui_extended/Accordion/styles.d.ts +3 -3
- package/components/mui_extended/Badge/styles.d.ts +1 -1
- package/components/mui_extended/Button/styles.d.ts +2 -10
- package/components/mui_extended/IconButton/styles.d.ts +1 -1
- package/components/mui_extended/ImageButton/styles.d.ts +1 -1
- package/components/mui_extended/MenuActions/styles.d.ts +2 -27
- package/components/mui_extended/Pager/styles.d.ts +1 -1
- package/components/mui_extended/Stack/styles.d.ts +2 -9
- package/components/mui_extended/Tab/styles.d.ts +2 -2
- package/components/mui_extended/Tabs/styles.d.ts +3 -58
- package/components/mui_extended/Typography/styles.d.ts +1 -1
- package/components/popups/PopupsProvider/{index.8fb6232a.js → index.18669fb4.js} +1 -1
- package/components/popups/PopupsViewer/{index.813854e4.js → index.ba354267.js} +5 -10
- package/contexts/ModalContext/{index.45c275cd.js → index.cf02e6bd.js} +1 -1
- package/contexts/RHFormContext/{index.bf3a2812.js → index.dc955a09.js} +2 -6
- package/hooks/useFormAddEdit/{index.9b27ca02.js → index.f156a2cd.js} +4 -8
- package/hooks/useModal/index.ef54bcf2.js +66 -0
- package/hooks/useTab/{index.f7973779.js → index.bce8b99e.js} +1 -1
- package/index.d.ts +0 -1
- package/index.js +276 -360
- package/package.json +3 -2
- package/{react-draggable.79b4c69a.js → react-draggable.5331add7.js} +1 -1
- package/{react-resizable.af1f31c1.js → react-resizable.37bfb965.js} +3 -5
- package/test/{getNameDataTestId.0faeade8.js → getNameDataTestId.aee44365.js} +2 -2
- package/test/index.6d4b98b9.js +4 -0
- package/utils/{index.0718eeac.js → index.9ee4c99a.js} +113 -3
- package/vendor.a1ce6777.js +6352 -0
- package/assets/Logo/index.109a182d.js +0 -38
- package/assets/Logo.d.ts +0 -6
- package/components/CommonActions/components/ActionCancel/index.46f636e9.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index.2b0bd50d.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index.4f212c39.js +0 -33
- package/components/CommonActions/components/ActionIntro/index.7406bd47.js +0 -25
- package/components/CommonActions/components/Actions/index.273645af.js +0 -70
- package/components/DataGrid/constants.e334cd50.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.cee6b676.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.708f3fb5.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index.e00d0cf2.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.c064bb07.js +0 -23
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.880e743b.js +0 -14
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.226cc583.js +0 -10
- package/components/DataGrid/formatters/ColumnPriceFormatter/index.bf9d9e60.js +0 -10
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js +0 -36
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.a87302d1.js +0 -10
- package/components/DataGrid/formatters/index.2c2f0ae4.js +0 -1
- package/components/DataGrid/index.304437ee.js +0 -917
- package/components/DataGrid/subcomponents/Actions/index.f14590d2.js +0 -595
- package/components/DataGrid/subcomponents/editors/TextEditor/index.3f0d9e28.js +0 -76
- package/components/Icon/index.ee7b85c9.js +0 -192
- package/components/Image/index.8cc036b1.js +0 -168
- package/components/Page/index.c1d4a319.js +0 -114
- package/components/animate/variants/index.7a912140.js +0 -1
- package/components/areas/components/AreasAdmin/index.f239c717.js +0 -733
- package/components/areas/components/AreasViewer/index.61e0538b.js +0 -1071
- package/components/areas/components/index.558684b3.js +0 -1
- package/components/areas/constants.66529246.js +0 -6
- package/components/areas/contexts/index.24025b97.js +0 -1
- package/components/areas/dictionary.08cfc4c9.js +0 -36
- package/components/areas/hooks/index.d9dc1e21.js +0 -1
- package/components/areas/icons.8266ccc8.js +0 -26
- package/components/areas/index.4cc6a221.js +0 -22
- package/components/commercial/AppBarCommercial/index.9f654f8e.js +0 -28
- package/components/commercial/SectionCommercial/index.3df4685b.js +0 -57
- package/components/commercial/TopBar/index.7aeb6ec0.js +0 -234
- package/components/formatters/BooleanFormatter/index.0c2d8e35.js +0 -44
- package/components/formatters/DateFormatter/index.2ef6f261.js +0 -43
- package/components/formatters/PointsFormatter/index.d8a4ee54.js +0 -25
- package/components/formatters/PriceFormatter/index.97f75b4b.js +0 -35
- package/components/formatters/UncertaintyFormatter/index.c3ffdebc.js +0 -29
- package/components/formatters/index.b816c6b6.js +0 -117
- package/components/hook-form/HelperError/index.c8b046b7.js +0 -19
- package/components/hook-form/RHFAutocomplete/index.ea2ac2b1.js +0 -408
- package/components/hook-form/RHFAutocompleteAsync/index.98dcf0de.js +0 -158
- package/components/hook-form/RHFCheckbox/index.c32278fa.js +0 -142
- package/components/hook-form/RHFColorPicker/index.8c939bfd.js +0 -191
- package/components/hook-form/RHFDateTime/index.ac27deab.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index.437e6ba3.js +0 -34
- package/components/hook-form/RHFPeriod/index.70cfc422.js +0 -104
- package/components/hook-form/RHFRadioGroup/index.11c0add8.js +0 -35
- package/components/hook-form/RHFSelect/index.c6c60ecc.js +0 -29
- package/components/hook-form/RHFTextField/index.fa97889a.js +0 -325
- package/components/maps/index.13bb982c.js +0 -7
- package/components/mui_extended/Accordion/index.d08a0361.js +0 -142
- package/components/mui_extended/Avatar/index.fb9ad158.js +0 -63
- package/components/mui_extended/Badge/index.2a3aef2c.js +0 -30
- package/components/mui_extended/BoxIcon/index.d61e7ac5.js +0 -22
- package/components/mui_extended/Breadcrumbs/index.4a44883c.js +0 -87
- package/components/mui_extended/Button/index.5395d101.js +0 -213
- package/components/mui_extended/CheckBox.256169f0.js +0 -76
- package/components/mui_extended/CircularProgress/index.967e70b7.js +0 -8
- package/components/mui_extended/IconButton/index.b0ee4965.js +0 -119
- package/components/mui_extended/LinearProgress/index.4092bb69.js +0 -9
- package/components/mui_extended/LinkWithRoute/index.288c51f3.js +0 -15
- package/components/mui_extended/MenuActions/index.d92ed0d6.js +0 -175
- package/components/mui_extended/Popover/index.4e7340b4.js +0 -142
- package/components/mui_extended/Stack/index.fe363ca5.js +0 -31
- package/components/mui_extended/Tab/index.c5ad86e2.js +0 -134
- package/components/mui_extended/ToggleButton/index.7fbc8614.js +0 -18
- package/components/mui_extended/ToggleIconButton/index.0cd347b4.js +0 -24
- package/components/mui_extended/Tooltip/index.49bb5ee1.js +0 -40
- package/components/mui_extended/Typography/index.a1e774a2.js +0 -54
- package/components/mui_extended/index.b606cd9d.js +0 -1
- package/hooks/useModal/index.30674bb7.js +0 -11
- package/style.css +0 -65
- package/test/constants_no_mock.86c553a9.js +0 -4
|
@@ -1,595 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { M as MenuActions } from "../../../mui_extended/MenuActions/index.d92ed0d6.js";
|
|
3
|
-
import { u as useDataGrid, a as useFilters, D as DataGridRoot, b as dictionary } from "../../index.304437ee.js";
|
|
4
|
-
import { useTheme, styled, Skeleton } from "@mui/material";
|
|
5
|
-
import { b as DATAGRID_ACTIONS_COLUMN_KEY } from "../../constants.e334cd50.js";
|
|
6
|
-
import { P as Pager } from "../../../mui_extended/Pager/index.1ba2d52b.js";
|
|
7
|
-
import { I as IconButton } from "../../../mui_extended/IconButton/index.b0ee4965.js";
|
|
8
|
-
import { useEnvironment, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
9
|
-
import { useIsMobile, useResponsiveContainerStore } from "@m4l/graphics";
|
|
10
|
-
import { forwardRef, useRef, useState, useImperativeHandle, useMemo, useEffect, useCallback } from "react";
|
|
11
|
-
import { D as DataGrid$1 } from "../../../../react-data-grid.c5377916.js";
|
|
12
|
-
import { C as ColumnInteractiveCheckFormatter } from "../../formatters/ColumnInteractiveCheckFormatter/index.c064bb07.js";
|
|
13
|
-
import { u as useModal } from "../../../../hooks/useModal/index.30674bb7.js";
|
|
14
|
-
import { W as WindowBase } from "../../../modal/WindowBase.2414cd02.js";
|
|
15
|
-
import { A as Actions$1 } from "../../../CommonActions/components/Actions/index.273645af.js";
|
|
16
|
-
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index.46f636e9.js";
|
|
17
|
-
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index.7406bd47.js";
|
|
18
|
-
import { shallow } from "zustand/shallow";
|
|
19
|
-
function ActionsFormatter(props) {
|
|
20
|
-
const { rowActionsGetter, classes } = useDataGrid();
|
|
21
|
-
const theme = useTheme();
|
|
22
|
-
if (rowActionsGetter === void 0) {
|
|
23
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
24
|
-
}
|
|
25
|
-
return /* @__PURE__ */ jsx(
|
|
26
|
-
MenuActions,
|
|
27
|
-
{
|
|
28
|
-
arrowType: "top-left",
|
|
29
|
-
objItem: props.row,
|
|
30
|
-
menuActions: rowActionsGetter,
|
|
31
|
-
className: classes.actionsFormatter,
|
|
32
|
-
menuActionSx: theme.components?.M4LDataGridActionsFormatter?.styleOverrides,
|
|
33
|
-
marginTop: 1,
|
|
34
|
-
marginLeft: "-11px",
|
|
35
|
-
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
36
|
-
transformOrigin: { vertical: "top", horizontal: "left" }
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
const ActionsColumn = {
|
|
41
|
-
key: DATAGRID_ACTIONS_COLUMN_KEY,
|
|
42
|
-
name: getActionLabel(),
|
|
43
|
-
width: 32,
|
|
44
|
-
minWidth: 32,
|
|
45
|
-
isDraggable: false,
|
|
46
|
-
withFilter: false,
|
|
47
|
-
resizable: true,
|
|
48
|
-
sortable: false,
|
|
49
|
-
frozen: true,
|
|
50
|
-
type: "custom",
|
|
51
|
-
formatter: ActionsFormatter
|
|
52
|
-
};
|
|
53
|
-
function getActionLabel() {
|
|
54
|
-
return "";
|
|
55
|
-
}
|
|
56
|
-
function Filter() {
|
|
57
|
-
const { activeFilters, setActiveFilters } = useFilters();
|
|
58
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
59
|
-
const { classes } = useDataGrid();
|
|
60
|
-
const toggleIcon = () => {
|
|
61
|
-
setActiveFilters(!activeFilters);
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ jsx(
|
|
64
|
-
IconButton,
|
|
65
|
-
{
|
|
66
|
-
dictionaryTooltipId: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show",
|
|
67
|
-
className: classes.actionFilter,
|
|
68
|
-
onClick: toggleIcon,
|
|
69
|
-
"aria-label": "filter",
|
|
70
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/filter.svg`
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
const WrapperColumnsConfig = styled("div")(({ theme }) => ({
|
|
75
|
-
color: theme.palette.text.primary,
|
|
76
|
-
position: "relative",
|
|
77
|
-
display: "flex",
|
|
78
|
-
flexDirection: "column",
|
|
79
|
-
height: "100%",
|
|
80
|
-
width: "100%"
|
|
81
|
-
}));
|
|
82
|
-
styled("div")(({ theme }) => ({
|
|
83
|
-
color: theme.palette.text.primary,
|
|
84
|
-
fontSize: theme.typography.h4.fontSize
|
|
85
|
-
}));
|
|
86
|
-
const DivSelColumns = styled("div")(({ theme }) => ({
|
|
87
|
-
...theme.typography.bodyDens,
|
|
88
|
-
color: theme.palette.text.primary,
|
|
89
|
-
padding: `16px 8px`
|
|
90
|
-
}));
|
|
91
|
-
const WrapperDataGrid = styled("div")(() => ({
|
|
92
|
-
position: "relative",
|
|
93
|
-
display: "flex",
|
|
94
|
-
flexDirection: "column",
|
|
95
|
-
flexGrow: 1,
|
|
96
|
-
overflow: "auto"
|
|
97
|
-
}));
|
|
98
|
-
styled("div")(() => ({
|
|
99
|
-
display: "flex",
|
|
100
|
-
flexDirection: "row"
|
|
101
|
-
}));
|
|
102
|
-
const ColumnActions = styled("div")(() => ({
|
|
103
|
-
paddingTop: "16px",
|
|
104
|
-
paddingBottom: "8px",
|
|
105
|
-
display: "flex",
|
|
106
|
-
flexDirection: "row"
|
|
107
|
-
}));
|
|
108
|
-
styled("div")(({ theme }) => ({
|
|
109
|
-
paddingTop: theme.spacing(3),
|
|
110
|
-
display: "flex",
|
|
111
|
-
flexDirection: "row",
|
|
112
|
-
justifyContent: "flex-end",
|
|
113
|
-
"& > button": {
|
|
114
|
-
marginLeft: "10px"
|
|
115
|
-
}
|
|
116
|
-
}));
|
|
117
|
-
function getRowsFromColumnsConfig(columnsConfig) {
|
|
118
|
-
return columnsConfig.filter((column) => !column.hidden).map(
|
|
119
|
-
(column) => ({
|
|
120
|
-
key: column.key,
|
|
121
|
-
name: column.name,
|
|
122
|
-
visible: column.visible === void 0 ? true : column.visible,
|
|
123
|
-
frozen: column.frozen === void 0 ? false : column.frozen,
|
|
124
|
-
originalIndex: column.orginalIndex,
|
|
125
|
-
originalFrozen: column.originalFrozen,
|
|
126
|
-
originalVisible: column.originalVisible
|
|
127
|
-
})
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
const ColumnsConfig = forwardRef((props, ref) => {
|
|
131
|
-
const refdata_grid = useRef(null);
|
|
132
|
-
const { onCloseSettings, columnsConfig, onChangeColumnsConfig, classes } = props;
|
|
133
|
-
const { getLabel } = useModuleDictionary();
|
|
134
|
-
const [isInit, setIsInit] = useState(true);
|
|
135
|
-
const [rows, setRows] = useState(getRowsFromColumnsConfig(columnsConfig));
|
|
136
|
-
const [selRows, setSelRows] = useState(() => /* @__PURE__ */ new Set());
|
|
137
|
-
const divRef = useRef(null);
|
|
138
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
139
|
-
useImperativeHandle(ref, () => ({
|
|
140
|
-
onClickIntro: handleIntro,
|
|
141
|
-
current: divRef.current
|
|
142
|
-
}));
|
|
143
|
-
const columnsdata_grid = useMemo(
|
|
144
|
-
() => [
|
|
145
|
-
{
|
|
146
|
-
key: "name",
|
|
147
|
-
name: getLabel("data_grid.settings_column_name"),
|
|
148
|
-
width: 200,
|
|
149
|
-
resizable: true,
|
|
150
|
-
type: "string"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
key: "originalIndex",
|
|
154
|
-
name: getLabel("data_grid.settings_column_position"),
|
|
155
|
-
width: 50,
|
|
156
|
-
type: "number",
|
|
157
|
-
cellClass: "rdg-cell-align-center"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
key: "visible",
|
|
161
|
-
name: getLabel("data_grid.settings_column_visible"),
|
|
162
|
-
width: 80,
|
|
163
|
-
type: "boolean",
|
|
164
|
-
formatter: ColumnInteractiveCheckFormatter,
|
|
165
|
-
cellClass: "rdg-cell-align-center"
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
key: "frozen",
|
|
169
|
-
name: getLabel("data_grid.settings_column_frozen"),
|
|
170
|
-
width: 80,
|
|
171
|
-
type: "boolean",
|
|
172
|
-
formatter: ColumnInteractiveCheckFormatter,
|
|
173
|
-
cellClass: "rdg-cell-align-center"
|
|
174
|
-
}
|
|
175
|
-
],
|
|
176
|
-
[getLabel]
|
|
177
|
-
);
|
|
178
|
-
const checkAll = () => {
|
|
179
|
-
setRows(rows.map((row) => ({ ...row, visible: true })));
|
|
180
|
-
};
|
|
181
|
-
const unCheckAll = () => {
|
|
182
|
-
setRows(rows.map((row) => ({ ...row, visible: false })));
|
|
183
|
-
};
|
|
184
|
-
const restoreAll = () => {
|
|
185
|
-
setRows(
|
|
186
|
-
rows.map((row) => ({
|
|
187
|
-
...row,
|
|
188
|
-
visible: row.originalVisible,
|
|
189
|
-
frozen: row.originalFrozen,
|
|
190
|
-
index: row.originalIndex
|
|
191
|
-
})).sort((a, b) => a.index - b.index)
|
|
192
|
-
);
|
|
193
|
-
};
|
|
194
|
-
useEffect(() => {
|
|
195
|
-
if (isInit === false) {
|
|
196
|
-
setRows(getRowsFromColumnsConfig(columnsConfig));
|
|
197
|
-
}
|
|
198
|
-
setIsInit(false);
|
|
199
|
-
}, [columnsConfig]);
|
|
200
|
-
const rowSelectedIndex = useMemo(() => {
|
|
201
|
-
let rowIndex = -1;
|
|
202
|
-
if (selRows.size !== 1)
|
|
203
|
-
return rowIndex;
|
|
204
|
-
const iterator = selRows.entries();
|
|
205
|
-
const entry = iterator.next().value[1];
|
|
206
|
-
rowIndex = rows.findIndex((row) => row.key === entry);
|
|
207
|
-
return rowIndex;
|
|
208
|
-
}, [rows, selRows]);
|
|
209
|
-
const handleMoveFirst = () => {
|
|
210
|
-
if (rowSelectedIndex === -1)
|
|
211
|
-
return -1;
|
|
212
|
-
const newRows = [...rows];
|
|
213
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
214
|
-
newRows.splice(0, 0, rows[rowSelectedIndex]);
|
|
215
|
-
refdata_grid.current?.selectCell({ idx: 0, rowIdx: 0 });
|
|
216
|
-
setRows(newRows);
|
|
217
|
-
};
|
|
218
|
-
const handleMoveLast = () => {
|
|
219
|
-
if (rowSelectedIndex === -1)
|
|
220
|
-
return -1;
|
|
221
|
-
const newRows = [...rows];
|
|
222
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
223
|
-
newRows.splice(newRows.length, 0, rows[rowSelectedIndex]);
|
|
224
|
-
refdata_grid.current?.selectCell({ idx: 0, rowIdx: newRows.length - 1 });
|
|
225
|
-
setRows(newRows);
|
|
226
|
-
};
|
|
227
|
-
const handleMoveUpDownd = (position) => {
|
|
228
|
-
if (rowSelectedIndex === -1)
|
|
229
|
-
return -1;
|
|
230
|
-
const newRows = [...rows];
|
|
231
|
-
const element = newRows[rowSelectedIndex];
|
|
232
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
233
|
-
newRows.splice(rowSelectedIndex + position, 0, element);
|
|
234
|
-
refdata_grid.current?.selectCell({ idx: 0, rowIdx: rowSelectedIndex + position });
|
|
235
|
-
setRows(newRows);
|
|
236
|
-
};
|
|
237
|
-
const getColumnConfigByKey = (key) => {
|
|
238
|
-
const rowIndexFinded = rows.findIndex((row) => row.key === key);
|
|
239
|
-
if (rowIndexFinded > -1) {
|
|
240
|
-
return {
|
|
241
|
-
visible: rows[rowIndexFinded].visible,
|
|
242
|
-
frozen: rows[rowIndexFinded].frozen
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
return void 0;
|
|
246
|
-
};
|
|
247
|
-
const getRowIndex = (column) => {
|
|
248
|
-
const rowIndexFinded = rows.findIndex((row) => row.key === column.key);
|
|
249
|
-
if (rowIndexFinded > -1) {
|
|
250
|
-
return rowIndexFinded;
|
|
251
|
-
}
|
|
252
|
-
return columnsConfig.findIndex((columnConfig) => columnConfig.key === column.key);
|
|
253
|
-
};
|
|
254
|
-
const handleIntro = () => {
|
|
255
|
-
const newColumnsConfig = columnsConfig.map((columnConfig) => {
|
|
256
|
-
const newColumnConfig = { ...columnConfig };
|
|
257
|
-
if (!columnConfig.hidden) {
|
|
258
|
-
const columnConfigRow = getColumnConfigByKey(columnConfig.key);
|
|
259
|
-
if (columnConfigRow) {
|
|
260
|
-
newColumnConfig.visible = columnConfigRow.visible;
|
|
261
|
-
newColumnConfig.frozen = columnConfigRow.frozen;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return newColumnConfig;
|
|
265
|
-
}).sort((a, b) => getRowIndex(a) - getRowIndex(b));
|
|
266
|
-
onChangeColumnsConfig(newColumnsConfig);
|
|
267
|
-
onCloseSettings();
|
|
268
|
-
};
|
|
269
|
-
const onInternalSelectedRowsChange = () => {
|
|
270
|
-
};
|
|
271
|
-
const onInternalRowsChange = (newRows) => {
|
|
272
|
-
setRows(newRows);
|
|
273
|
-
};
|
|
274
|
-
const onRowClick = (row) => {
|
|
275
|
-
if (selRows.has(row.key))
|
|
276
|
-
return;
|
|
277
|
-
const mySet = /* @__PURE__ */ new Set([row.key]);
|
|
278
|
-
setSelRows(mySet);
|
|
279
|
-
};
|
|
280
|
-
return /* @__PURE__ */ jsxs(WrapperColumnsConfig, { ref: divRef, className: classes.columnsConfigContainer, children: [
|
|
281
|
-
/* @__PURE__ */ jsx(DivSelColumns, { className: classes.columnsLabelSetColumns, children: getLabel("data_grid.settings_sel_columns") }),
|
|
282
|
-
/* @__PURE__ */ jsx(WrapperDataGrid, { className: classes.columnsConfigContent, children: /* @__PURE__ */ jsx("div", { className: classes.wrapperDataGridCss, children: /* @__PURE__ */ jsx(
|
|
283
|
-
DataGrid$1,
|
|
284
|
-
{
|
|
285
|
-
className: classes.columnsConfigGrid,
|
|
286
|
-
ref: refdata_grid,
|
|
287
|
-
columns: columnsdata_grid,
|
|
288
|
-
rows,
|
|
289
|
-
onRowsChange: onInternalRowsChange,
|
|
290
|
-
selectedRows: selRows,
|
|
291
|
-
onSelectedRowsChange: onInternalSelectedRowsChange,
|
|
292
|
-
onRowClick,
|
|
293
|
-
rowKeyGetter: (row) => row.key,
|
|
294
|
-
cellNavigationMode: "CHANGE_ROW",
|
|
295
|
-
defaultColumnOptions: { resizable: true, sortable: true }
|
|
296
|
-
}
|
|
297
|
-
) }) }),
|
|
298
|
-
/* @__PURE__ */ jsxs(ColumnActions, { className: classes.columnsConfigActions, children: [
|
|
299
|
-
/* @__PURE__ */ jsx(
|
|
300
|
-
IconButton,
|
|
301
|
-
{
|
|
302
|
-
tooltip: getLabel("data_grid.settings_move_first"),
|
|
303
|
-
onClick: handleMoveFirst,
|
|
304
|
-
"aria-label": "move first place",
|
|
305
|
-
disabled: rowSelectedIndex < 1,
|
|
306
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_first_place.svg`
|
|
307
|
-
}
|
|
308
|
-
),
|
|
309
|
-
/* @__PURE__ */ jsx(
|
|
310
|
-
IconButton,
|
|
311
|
-
{
|
|
312
|
-
tooltip: getLabel("data_grid.settings_move_up"),
|
|
313
|
-
dictionaryTooltipId: "data_grid.settings_move_up",
|
|
314
|
-
onClick: () => handleMoveUpDownd(-1),
|
|
315
|
-
"aria-label": "move up place",
|
|
316
|
-
disabled: rowSelectedIndex < 1,
|
|
317
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_up_place.svg`
|
|
318
|
-
}
|
|
319
|
-
),
|
|
320
|
-
/* @__PURE__ */ jsx(
|
|
321
|
-
IconButton,
|
|
322
|
-
{
|
|
323
|
-
tooltip: getLabel("data_grid.settings_move_last"),
|
|
324
|
-
onClick: handleMoveLast,
|
|
325
|
-
"aria-label": "move last place",
|
|
326
|
-
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
327
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_last_place.svg`
|
|
328
|
-
}
|
|
329
|
-
),
|
|
330
|
-
/* @__PURE__ */ jsx(
|
|
331
|
-
IconButton,
|
|
332
|
-
{
|
|
333
|
-
tooltip: getLabel("data_grid.settings_move_down"),
|
|
334
|
-
onClick: () => handleMoveUpDownd(1),
|
|
335
|
-
"aria-label": "move down place",
|
|
336
|
-
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
337
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_down_place.svg`
|
|
338
|
-
}
|
|
339
|
-
),
|
|
340
|
-
/* @__PURE__ */ jsx(
|
|
341
|
-
IconButton,
|
|
342
|
-
{
|
|
343
|
-
tooltip: getLabel("data_grid.settings_visible_all"),
|
|
344
|
-
onClick: checkAll,
|
|
345
|
-
"aria-label": "check visible all",
|
|
346
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/check_all.svg`
|
|
347
|
-
}
|
|
348
|
-
),
|
|
349
|
-
/* @__PURE__ */ jsx(
|
|
350
|
-
IconButton,
|
|
351
|
-
{
|
|
352
|
-
tooltip: getLabel("data_grid.settings_no_visible_all"),
|
|
353
|
-
onClick: unCheckAll,
|
|
354
|
-
"aria-label": "un check all",
|
|
355
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/uncheck_all.svg`
|
|
356
|
-
}
|
|
357
|
-
),
|
|
358
|
-
/* @__PURE__ */ jsx(
|
|
359
|
-
IconButton,
|
|
360
|
-
{
|
|
361
|
-
tooltip: getLabel("data_grid.settings_restore"),
|
|
362
|
-
onClick: restoreAll,
|
|
363
|
-
"aria-label": "Restore columns",
|
|
364
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/restore_columns.svg`
|
|
365
|
-
}
|
|
366
|
-
)
|
|
367
|
-
] })
|
|
368
|
-
] });
|
|
369
|
-
});
|
|
370
|
-
ColumnsConfig.displayName = "ColumnsConfig";
|
|
371
|
-
const useModalSettings = () => {
|
|
372
|
-
const { openModal, closeModal } = useModal();
|
|
373
|
-
const { columnsConfig, onChangeColumnsConfig } = useDataGrid();
|
|
374
|
-
const { getLabel } = useModuleDictionary();
|
|
375
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
376
|
-
const isMobile = useIsMobile();
|
|
377
|
-
const { classes } = useDataGrid();
|
|
378
|
-
const ref = useRef(null);
|
|
379
|
-
const onCloseSettings = useCallback(() => {
|
|
380
|
-
closeModal();
|
|
381
|
-
}, [closeModal]);
|
|
382
|
-
const onClickIntro = useCallback(() => {
|
|
383
|
-
if (ref.current?.onClickIntro) {
|
|
384
|
-
ref.current.onClickIntro();
|
|
385
|
-
}
|
|
386
|
-
}, []);
|
|
387
|
-
const onClickSettings = () => {
|
|
388
|
-
openModal({
|
|
389
|
-
initialWidth: 500,
|
|
390
|
-
initialHeigth: 680,
|
|
391
|
-
fullScreen: isMobile,
|
|
392
|
-
window: /* @__PURE__ */ jsxs(
|
|
393
|
-
WindowBase,
|
|
394
|
-
{
|
|
395
|
-
title: getLabel("data_grid.settings_title"),
|
|
396
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`,
|
|
397
|
-
children: [
|
|
398
|
-
/* @__PURE__ */ jsx(DataGridRoot, { className: classes.root, children: /* @__PURE__ */ jsx("div", { className: classes.tableContaniner, style: { inset: "0" }, children: /* @__PURE__ */ jsx("div", { className: classes.wrapperDataGridCss, children: /* @__PURE__ */ jsx(
|
|
399
|
-
ColumnsConfig,
|
|
400
|
-
{
|
|
401
|
-
ref,
|
|
402
|
-
columnsConfig,
|
|
403
|
-
onChangeColumnsConfig,
|
|
404
|
-
onCloseSettings,
|
|
405
|
-
classes
|
|
406
|
-
}
|
|
407
|
-
) }) }) }),
|
|
408
|
-
/* @__PURE__ */ jsxs(Actions$1, { children: [
|
|
409
|
-
/* @__PURE__ */ jsx(ActionCancel, { onClick: closeModal }),
|
|
410
|
-
/* @__PURE__ */ jsx(ActionIntro, { onClick: onClickIntro })
|
|
411
|
-
] })
|
|
412
|
-
]
|
|
413
|
-
}
|
|
414
|
-
)
|
|
415
|
-
});
|
|
416
|
-
};
|
|
417
|
-
return onClickSettings;
|
|
418
|
-
};
|
|
419
|
-
const useModalSettings$1 = useModalSettings;
|
|
420
|
-
function Settings() {
|
|
421
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
422
|
-
const { classes } = useDataGrid();
|
|
423
|
-
const modalSettings = useModalSettings$1();
|
|
424
|
-
return /* @__PURE__ */ jsx(
|
|
425
|
-
IconButton,
|
|
426
|
-
{
|
|
427
|
-
className: classes.actionSettings,
|
|
428
|
-
dictionaryTooltipId: "data_grid.tooltip_settings",
|
|
429
|
-
onClick: modalSettings,
|
|
430
|
-
"aria-label": "settings",
|
|
431
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`
|
|
432
|
-
}
|
|
433
|
-
);
|
|
434
|
-
}
|
|
435
|
-
function RowsCount() {
|
|
436
|
-
const { rowsCount, classes } = useDataGrid();
|
|
437
|
-
const { getLabel } = useModuleDictionary();
|
|
438
|
-
const isSkeleton = useModuleSkeleton();
|
|
439
|
-
return /* @__PURE__ */ jsx("div", { className: classes.rowsCount, children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
440
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountLabel, children: getLabel("data_grid.rows") }),
|
|
441
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountValue, children: rowsCount })
|
|
442
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
443
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountLabel, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "40px", height: "16px" }) }),
|
|
444
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountValue, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "20px", height: "16px" }) })
|
|
445
|
-
] }) });
|
|
446
|
-
}
|
|
447
|
-
function Density() {
|
|
448
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
449
|
-
const { rowHeights, currentRowHeightVariant, setRowHeightVariant, classes } = useDataGrid();
|
|
450
|
-
const { getLabel } = useModuleDictionary();
|
|
451
|
-
const menuActions = useMemo(() => {
|
|
452
|
-
if (typeof rowHeights === "number") {
|
|
453
|
-
return [];
|
|
454
|
-
}
|
|
455
|
-
return [
|
|
456
|
-
{
|
|
457
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`,
|
|
458
|
-
onClick: () => setRowHeightVariant("compact"),
|
|
459
|
-
disabled: currentRowHeightVariant === "compact",
|
|
460
|
-
dictionaryField: "data_grid.density_compact"
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`,
|
|
464
|
-
onClick: () => setRowHeightVariant("standard"),
|
|
465
|
-
disabled: currentRowHeightVariant === "standard",
|
|
466
|
-
dictionaryField: "data_grid.density_standard"
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`,
|
|
470
|
-
onClick: () => setRowHeightVariant("confortable"),
|
|
471
|
-
disabled: currentRowHeightVariant === "confortable",
|
|
472
|
-
dictionaryField: "data_grid.density_confortable"
|
|
473
|
-
}
|
|
474
|
-
];
|
|
475
|
-
}, [
|
|
476
|
-
rowHeights,
|
|
477
|
-
currentRowHeightVariant,
|
|
478
|
-
setRowHeightVariant,
|
|
479
|
-
host_static_assets,
|
|
480
|
-
environment_assets
|
|
481
|
-
]);
|
|
482
|
-
const theme = useTheme();
|
|
483
|
-
const currenViewIcon = useMemo(() => {
|
|
484
|
-
if (currentRowHeightVariant === "compact") {
|
|
485
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`;
|
|
486
|
-
}
|
|
487
|
-
if (currentRowHeightVariant === "standard") {
|
|
488
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`;
|
|
489
|
-
}
|
|
490
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`;
|
|
491
|
-
}, [currentRowHeightVariant, host_static_assets, environment_assets]);
|
|
492
|
-
if (menuActions.length === 0) {
|
|
493
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
494
|
-
}
|
|
495
|
-
return /* @__PURE__ */ jsx(
|
|
496
|
-
MenuActions,
|
|
497
|
-
{
|
|
498
|
-
arrowType: "right-top",
|
|
499
|
-
className: classes.actionDensityPopover,
|
|
500
|
-
menuActionSx: theme.components?.M4LDataGridDensityPopover?.styleOverrides,
|
|
501
|
-
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
502
|
-
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
503
|
-
menuActions,
|
|
504
|
-
urlIcon: currenViewIcon,
|
|
505
|
-
toolTip: getLabel("data_grid.tooltip_density")
|
|
506
|
-
}
|
|
507
|
-
);
|
|
508
|
-
}
|
|
509
|
-
const MobileMenuActions = () => {
|
|
510
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
511
|
-
const { currentRowHeightVariant, setRowHeightVariant } = useDataGrid();
|
|
512
|
-
const { activeFilters, setActiveFilters } = useFilters();
|
|
513
|
-
const modalSettings = useModalSettings$1();
|
|
514
|
-
const toggleIcon = () => {
|
|
515
|
-
setActiveFilters(!activeFilters);
|
|
516
|
-
};
|
|
517
|
-
const menuActions = [
|
|
518
|
-
{
|
|
519
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`,
|
|
520
|
-
onClick: () => setRowHeightVariant("compact"),
|
|
521
|
-
disabled: currentRowHeightVariant === "compact",
|
|
522
|
-
dictionaryId: "data_grid.density_compact"
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`,
|
|
526
|
-
onClick: () => setRowHeightVariant("standard"),
|
|
527
|
-
disabled: currentRowHeightVariant === "standard",
|
|
528
|
-
dictionaryId: "data_grid.density_standard"
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`,
|
|
532
|
-
onClick: () => setRowHeightVariant("confortable"),
|
|
533
|
-
disabled: currentRowHeightVariant === "confortable",
|
|
534
|
-
dictionaryId: "data_grid.density_confortable"
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/filter.svg`,
|
|
538
|
-
onClick: () => toggleIcon(),
|
|
539
|
-
dictionaryId: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show"
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`,
|
|
543
|
-
onClick: () => modalSettings(),
|
|
544
|
-
dictionaryId: "data_grid.tooltip_settings"
|
|
545
|
-
}
|
|
546
|
-
];
|
|
547
|
-
return /* @__PURE__ */ jsx(
|
|
548
|
-
MenuActions,
|
|
549
|
-
{
|
|
550
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/menu.svg`,
|
|
551
|
-
arrowType: "no-arrow",
|
|
552
|
-
marginTop: "12px",
|
|
553
|
-
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
554
|
-
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
555
|
-
menuActions
|
|
556
|
-
}
|
|
557
|
-
);
|
|
558
|
-
};
|
|
559
|
-
function Actions(props) {
|
|
560
|
-
const isXs = useResponsiveContainerStore((state) => state.isXs, shallow);
|
|
561
|
-
const { rowHeights, classes } = useDataGrid();
|
|
562
|
-
const isSkeleton = useModuleSkeleton();
|
|
563
|
-
const { getLabel } = useModuleDictionary();
|
|
564
|
-
const {
|
|
565
|
-
withRowsCount = true,
|
|
566
|
-
withPager = true,
|
|
567
|
-
pagerOptions,
|
|
568
|
-
withSettings = true,
|
|
569
|
-
settingsProps,
|
|
570
|
-
withLocalFilters
|
|
571
|
-
} = props;
|
|
572
|
-
return /* @__PURE__ */ jsxs("div", { className: classes.actions, children: [
|
|
573
|
-
withRowsCount && !isXs && /* @__PURE__ */ jsx(RowsCount, {}),
|
|
574
|
-
withPager && pagerOptions && /* @__PURE__ */ jsx(
|
|
575
|
-
Pager,
|
|
576
|
-
{
|
|
577
|
-
...pagerOptions,
|
|
578
|
-
totalRecords: pagerOptions.totalRecords,
|
|
579
|
-
isSkeleton,
|
|
580
|
-
isXs,
|
|
581
|
-
labelRows: getLabel(dictionary.LABEL_ROWS_PER_PAGE),
|
|
582
|
-
labelOf: getLabel(dictionary.LABEL_OF)
|
|
583
|
-
}
|
|
584
|
-
),
|
|
585
|
-
isXs ? /* @__PURE__ */ jsx(MobileMenuActions, {}) : /* @__PURE__ */ jsxs("div", { className: classes.actionsConfigContainer, children: [
|
|
586
|
-
typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}),
|
|
587
|
-
withLocalFilters && /* @__PURE__ */ jsx(Filter, {}),
|
|
588
|
-
withSettings && /* @__PURE__ */ jsx(Settings, { ...settingsProps })
|
|
589
|
-
] })
|
|
590
|
-
] });
|
|
591
|
-
}
|
|
592
|
-
export {
|
|
593
|
-
ActionsColumn as A,
|
|
594
|
-
Actions as a
|
|
595
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { styled } from "@mui/material";
|
|
3
|
-
const Input = styled("input")(() => ({
|
|
4
|
-
appearance: "none",
|
|
5
|
-
boxSizing: "border-box",
|
|
6
|
-
inlineSize: "100%",
|
|
7
|
-
blockSize: "100%",
|
|
8
|
-
paddingBlock: "0",
|
|
9
|
-
verticalAlign: "top",
|
|
10
|
-
textAlign: "right",
|
|
11
|
-
color: "var(--rdg-color)",
|
|
12
|
-
backgroundColor: "var(--rdg-background-color)",
|
|
13
|
-
fontFamily: "inherit",
|
|
14
|
-
"&:focus": {
|
|
15
|
-
outline: "none"
|
|
16
|
-
},
|
|
17
|
-
"&::placeholder": {
|
|
18
|
-
color: "#999",
|
|
19
|
-
opacity: "1"
|
|
20
|
-
}
|
|
21
|
-
}));
|
|
22
|
-
function autoFocusAndSelect(input) {
|
|
23
|
-
input?.focus();
|
|
24
|
-
input?.select();
|
|
25
|
-
}
|
|
26
|
-
function TextEditor({
|
|
27
|
-
row,
|
|
28
|
-
column,
|
|
29
|
-
onRowChange,
|
|
30
|
-
onClose
|
|
31
|
-
}) {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
Input,
|
|
34
|
-
{
|
|
35
|
-
className: "rdg-text-editor",
|
|
36
|
-
ref: autoFocusAndSelect,
|
|
37
|
-
value: row[column.key],
|
|
38
|
-
onChange: (event) => onRowChange({ ...row, [column.key]: event.target.value }),
|
|
39
|
-
onBlur: () => onClose(true)
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
function NumberEditor({
|
|
44
|
-
row,
|
|
45
|
-
column,
|
|
46
|
-
onRowChange,
|
|
47
|
-
onClose
|
|
48
|
-
}) {
|
|
49
|
-
const handleKeyDown = (event) => {
|
|
50
|
-
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
51
|
-
onClose(true);
|
|
52
|
-
}
|
|
53
|
-
if (event.key === "Enter") {
|
|
54
|
-
onClose(true);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
Input,
|
|
59
|
-
{
|
|
60
|
-
className: "rdg-text-editor",
|
|
61
|
-
ref: autoFocusAndSelect,
|
|
62
|
-
type: "number",
|
|
63
|
-
value: row[column.key],
|
|
64
|
-
onKeyDown: handleKeyDown,
|
|
65
|
-
onChange: (event) => onRowChange({
|
|
66
|
-
...row,
|
|
67
|
-
[column.key]: event.target.value !== "" ? Number(event.target.value) : ""
|
|
68
|
-
}),
|
|
69
|
-
onBlur: () => onClose(true)
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
NumberEditor as N,
|
|
75
|
-
TextEditor as T
|
|
76
|
-
};
|