@m4l/components 1.0.11 → 1.0.13
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.62b1290b.js → index.f22ad364.js} +4 -4
- package/components/AppBar/{index.b48343d8.js → index.8d90ce87.js} +4 -4
- package/components/CommonActions/components/ActionCancel/index.609a78ca.js +12 -0
- package/components/CommonActions/components/ActionFormCancel/index.a1318eac.js +56 -0
- package/components/CommonActions/components/ActionFormIntro/index.34d569d1.js +33 -0
- package/components/CommonActions/components/ActionIntro/index.ebac0bc1.js +25 -0
- package/components/CommonActions/components/Actions/index.258bf919.js +71 -0
- package/components/DataGrid/constants.e334cd50.js +10 -0
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.7fb1ebaa.js +26 -0
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.0ee10612.js +22 -0
- package/components/DataGrid/formatters/ColumnDateFormatter/index.e00d0cf2.js +19 -0
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.dce9ada8.js +23 -0
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.880e743b.js +14 -0
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.226cc583.js +10 -0
- package/components/DataGrid/formatters/ColumnPriceFormatter/index.bf9d9e60.js +10 -0
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js +36 -0
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.a87302d1.js +10 -0
- package/components/DataGrid/formatters/index.2c2f0ae4.js +1 -0
- package/components/DataGrid/index.68e19254.js +915 -0
- package/components/DataGrid/subcomponents/Actions/index.6b044e84.js +596 -0
- package/components/DataGrid/subcomponents/editors/TextEditor/index.3f0d9e28.js +76 -0
- package/components/DragResizeWindow/{index.8b3e79f7.js → index.a358789f.js} +6 -3
- package/components/DynamicFilter/constants.1dddd09c.js +31 -0
- package/components/DynamicFilter/dictionary.d28d39ef.js +51 -0
- package/components/DynamicFilter/helpers/{index.609b3915.js → index.11ed2896.js} +4 -4
- package/components/DynamicFilter/{index.0f04f223.js → index.056a99c7.js} +3 -3
- package/components/DynamicFilter/slots/{index.00b68384.js → index.82d7eaf2.js} +31 -31
- package/components/DynamicFilter/store/{index.85a2812f.js → index.9b5121d6.js} +2 -2
- package/components/DynamicFilter/subcomponents/{index.86c6fda2.js → index.778c93cc.js} +217 -15
- package/components/FieldLabel/{index.1577ac9c.js → index.6b6f708e.js} +4 -4
- package/components/GridLayout/{index.656840a5.js → index.68d907d4.js} +34 -11
- package/components/GridLayout/subcomponents/Griditem/{index.b23625d7.js → index.8955a794.js} +3 -4
- package/components/GridLayout/subcomponents/Responsive/{index.97505a31.js → index.45cecca2.js} +1 -2
- package/components/GridLayout/subcomponents/SizeProvider/{index.36cb4139.js → index.7050ac4f.js} +1 -1
- package/components/HelperText/{index.ebb53dac.js → index.09e80920.js} +1 -1
- package/components/Icon/{index.8ecfb193.js → index.83867398.js} +10 -26
- package/components/Image/{index.4a822ede.js → index.19aa7ff5.js} +3 -2
- package/components/LanguagePopover/index.921efd11.js +188 -0
- package/components/{mui_extended/LinearProgress/index.e9455b2e.js → LinearProgressIndeterminate/index.ea9c8518.js} +4 -9
- package/components/LoadingError/{index.9e829e8d.js → index.aee18b24.js} +11 -7
- package/components/MFLoader/{index.29f445e2.js → index.c975666e.js} +8 -4
- package/components/ModalDialog/{index.96c4aba3.js → index.0dd5af28.js} +14 -5
- package/components/NavLink/{index.9f5d5670.js → index.ad039baf.js} +3 -2
- package/components/NoItemSelected/{index.0ae9f28f.js → index.d10603d7.js} +13 -3
- package/components/ObjectLogs/{index.40c5047f.js → index.a3e42b21.js} +26 -8
- package/components/PDFViewer/{index.651cc4b6.js → index.35f68e67.js} +2 -2
- package/components/Page/{index.1d08818c.js → index.f4755eba.js} +18 -2
- package/components/PaperForm/{index.1a8b10d4.js → index.007ef4cf.js} +2 -2
- package/components/Period/{index.236971ae.js → index.9647181b.js} +15 -54
- package/components/PrintingSystem/{index.9fdae551.js → index.a69a9d85.js} +14 -15
- package/components/PrintingSystem/subcomponents/BodyNode/{index.794dbc69.js → index.528fcfbf.js} +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index.6bbf7d75.js → index.fbe87257.js} +1 -1
- package/components/PrintingSystem/subcomponents/DividerNode/{index.015a2212.js → index.f5adab1d.js} +1 -1
- package/components/PrintingSystem/subcomponents/FooterNode/{index.08eeb1d2.js → index.f42ca7dc.js} +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/{index.23995699.js → index.041b9cff.js} +1 -1
- package/components/PrintingSystem/subcomponents/HeaderNode/{index.3fa36620.js → index.a8140332.js} +1 -1
- package/components/PrintingSystem/subcomponents/PaperNode/{index.8b7d43f4.js → index.aabde2bb.js} +1 -1
- package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.9856c572.js → index.7f75ca46.js} +1 -1
- package/components/PrintingSystem/subcomponents/SectionNode/{index.89b3a4e0.js → index.61babb47.js} +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/{index.dc6e9dc2.js → index.4d0e67a3.js} +1 -1
- package/components/PropertyValue/{index.646a7e8b.js → index.51faabb5.js} +7 -4
- package/components/Resizeable/{index.414ff687.js → index.4f75c0b5.js} +1 -1
- package/components/ScrollBar/{index.1e89bb44.js → index.21bc5025.js} +1 -1
- package/components/SideBar/{index.d221254d.js → index.4075c562.js} +36 -7
- package/components/SplitLayout/{index.7d9edf4e.js → index.15756f0f.js} +3 -1
- package/components/ToastContainer/{index.7f246bbd.js → index.2a7d304e.js} +3 -3
- package/components/animate/variants/index.7a912140.js +1 -0
- package/components/areas/components/AreasAdmin/index.325bac22.js +733 -0
- package/components/areas/components/AreasViewer/index.6e30ec72.js +1072 -0
- package/components/areas/components/index.558684b3.js +1 -0
- package/components/areas/constants.66529246.js +6 -0
- package/components/areas/contexts/AreasContext/{index.0815f278.js → index.3311cbf9.js} +6 -5
- package/components/areas/contexts/DynamicMFParmsContext/{index.37d1d444.js → index.3d9ad0ad.js} +2 -2
- package/components/areas/contexts/WindowToolsMFContext/{index.69d95c15.js → index.992ae7a3.js} +2 -2
- package/components/areas/contexts/index.24025b97.js +1 -0
- package/components/areas/dictionary.08cfc4c9.js +36 -0
- package/components/areas/hooks/index.d9dc1e21.js +1 -0
- package/components/areas/hooks/useAreas/{index.4039e30d.js → index.f81493ef.js} +1 -1
- package/components/areas/hooks/useDynamicMFParameters/{index.03ce6078.js → index.9e09e1e3.js} +1 -1
- package/components/areas/hooks/useWindowToolsMF/{index.09801b66.js → index.2fbae9dc.js} +1 -1
- package/components/areas/icons.8266ccc8.js +26 -0
- package/components/areas/index.4cc6a221.js +22 -0
- package/components/commercial/AppBarCommercial/index.cbd55cf8.js +28 -0
- package/components/commercial/SectionCommercial/index.d22ebbd5.js +57 -0
- package/components/commercial/TopBar/index.410fffa8.js +234 -0
- package/components/{HamburgerMenu/index.6c82741d.js → commercial/index.07638f52.js} +5 -3
- package/components/formatters/BooleanFormatter/index.cbf9cd6e.js +44 -0
- package/components/formatters/DateFormatter/index.2ef6f261.js +43 -0
- package/components/formatters/PointsFormatter/index.d8a4ee54.js +25 -0
- package/components/formatters/PriceFormatter/index.97f75b4b.js +35 -0
- package/components/formatters/UncertaintyFormatter/index.c3ffdebc.js +29 -0
- package/components/formatters/index.63a3e08e.js +117 -0
- package/components/hook-form/HelperError/{index.2ed03a3c.js → index.c0109d5b.js} +1 -1
- package/components/hook-form/RHFAutocomplete/index.2991d444.js +404 -0
- package/components/hook-form/RHFAutocompleteAsync/{index.69f5661d.js → index.d97c727b.js} +2 -3
- package/components/hook-form/RHFCheckbox/{index.13de27db.js → index.b57e3131.js} +4 -4
- package/components/hook-form/RHFColorPicker/{index.66004599.js → index.310f6ff0.js} +6 -6
- package/components/hook-form/RHFDateTime/{index.dfe07e18.js → index.5689a29f.js} +5 -5
- package/components/hook-form/RHFPeriod/{index.d852649b.js → index.019e61ae.js} +4 -4
- package/components/hook-form/RHFTextField/{index.d207efc1.js → index.10e57945.js} +6 -6
- package/components/hook-form/RHFUpload/{index.955a4ba5.js → index.7fd23b2a.js} +5 -5
- package/components/{mui_extended/Tab/index.37d588d6.js → maps/components/GpsTools/index.20f83559.js} +331 -645
- package/components/maps/{index.a1bf63f2.js → components/Map/index.c37f3304.js} +737 -28
- package/components/maps/index.13bb982c.js +7 -0
- package/components/modal/{WindowBase.390b0910.js → WindowBase.cfbb0c9e.js} +4 -4
- package/components/modal/{WindowConfirm.243e1bef.js → WindowConfirm.300bd34b.js} +10 -6
- package/components/modal/{index.5bce430d.js → index.81eb6def.js} +5 -1
- package/components/mui_extended/Accordion/{index.f7a17c83.js → index.0843a609.js} +5 -5
- package/components/mui_extended/Avatar/{index.12b96914.js → index.fb9ad158.js} +1 -1
- package/components/mui_extended/Badge/{index.4737c113.js → index.8beaeefc.js} +1 -1
- package/components/mui_extended/Button/{index.52852c42.js → index.d742e9ee.js} +6 -81
- package/components/mui_extended/{CheckBox/index.01218423.js → CheckBox.21c25705.js} +1 -1
- package/components/mui_extended/IconButton/{index.d5b273e6.js → index.b4532b85.js} +1 -1
- package/components/mui_extended/LinearProgress/index.4092bb69.js +9 -0
- package/components/mui_extended/MenuActions/index.eae97857.js +176 -0
- package/components/mui_extended/Pager/{index.8960227c.js → index.3926c835.js} +22 -40
- package/components/mui_extended/Popover/index.2348fc4f.js +143 -0
- package/components/mui_extended/Tab/index.e911930f.js +135 -0
- package/components/mui_extended/ToggleButton/{index.c441b949.js → index.b834f5f0.js} +1 -1
- package/components/mui_extended/ToggleIconButton/{index.8a84f25e.js → index.fcd5205c.js} +1 -1
- package/components/mui_extended/Typography/{index.463f613f.js → index.642798f1.js} +1 -1
- package/components/mui_extended/index.b606cd9d.js +1 -0
- package/components/popups/PopupsProvider/{index.d4caacc3.js → index.d7c9efce.js} +1 -1
- package/components/popups/PopupsViewer/{index.42312806.js → index.f3677ab1.js} +10 -6
- package/contexts/ModalContext/{index.5f77a463.js → index.ad1fb73b.js} +1 -1
- package/contexts/RHFormContext/{index.95ebabc9.js → index.bf3a2812.js} +6 -2
- package/hooks/useFormAddEdit/{index.ecb77e67.js → index.6d983cd8.js} +6 -2
- package/hooks/useModal/index.2003c854.js +11 -0
- package/hooks/useTab/index.8d1a6e63.js +12 -0
- package/index.js +328 -273
- package/package.json +1 -1
- package/{react-draggable.0cc9b257.js → react-draggable.1c1ba224.js} +1 -1
- package/{react-resizable.837c446d.js → react-resizable.a59c14f4.js} +2 -2
- package/test/constants_no_mock.86c553a9.js +4 -0
- package/test/{getNameDataTestId.aee44365.js → getNameDataTestId.0faeade8.js} +2 -2
- package/utils/{index.c64c2dd1.js → index.14912462.js} +1 -54
- package/components/CommonActions/index.19f39dca.js +0 -170
- package/components/areas/constants.0d3ba950.js +0 -289
- package/components/areas/dictionary.6168209a.js +0 -266
- package/components/areas/icons.504ec098.js +0 -83
- package/components/maps/components/GpsTools/index.01acaf3e.js +0 -251
- package/components/mui_extended/Popover/index.146ded9e.js +0 -1044
- package/hooks/useModal/index.d14c7e46.js +0 -67
- package/vendor.5b266106.js +0 -3952
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { M as MenuActions } from "../../../mui_extended/MenuActions/index.eae97857.js";
|
|
3
|
+
import { u as useDataGrid, a as useFilters, D as DataGridRoot, b as dictionary } from "../../index.68e19254.js";
|
|
4
|
+
import { useTheme, 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.3926c835.js";
|
|
7
|
+
import { I as IconButton } from "../../../mui_extended/IconButton/index.b4532b85.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 { styled } from "@mui/material/styles";
|
|
13
|
+
import { C as ColumnInteractiveCheckFormatter } from "../../formatters/ColumnInteractiveCheckFormatter/index.dce9ada8.js";
|
|
14
|
+
import { u as useModal } from "../../../../hooks/useModal/index.2003c854.js";
|
|
15
|
+
import { W as WindowBase } from "../../../modal/WindowBase.cfbb0c9e.js";
|
|
16
|
+
import { A as Actions$1 } from "../../../CommonActions/components/Actions/index.258bf919.js";
|
|
17
|
+
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index.609a78ca.js";
|
|
18
|
+
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index.ebac0bc1.js";
|
|
19
|
+
import { shallow } from "zustand/shallow";
|
|
20
|
+
function ActionsFormatter(props) {
|
|
21
|
+
const { rowActionsGetter, classes } = useDataGrid();
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
if (rowActionsGetter === void 0) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
MenuActions,
|
|
28
|
+
{
|
|
29
|
+
arrowType: "top-left",
|
|
30
|
+
objItem: props.row,
|
|
31
|
+
menuActions: rowActionsGetter,
|
|
32
|
+
className: classes.actionsFormatter,
|
|
33
|
+
menuActionSx: theme.components?.M4LDataGridActionsFormatter?.styleOverrides,
|
|
34
|
+
marginTop: 1,
|
|
35
|
+
marginLeft: "-11px",
|
|
36
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
37
|
+
transformOrigin: { vertical: "top", horizontal: "left" }
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const ActionsColumn = {
|
|
42
|
+
key: DATAGRID_ACTIONS_COLUMN_KEY,
|
|
43
|
+
name: getActionLabel(),
|
|
44
|
+
width: 32,
|
|
45
|
+
minWidth: 32,
|
|
46
|
+
isDraggable: false,
|
|
47
|
+
withFilter: false,
|
|
48
|
+
resizable: true,
|
|
49
|
+
sortable: false,
|
|
50
|
+
frozen: true,
|
|
51
|
+
type: "custom",
|
|
52
|
+
formatter: ActionsFormatter
|
|
53
|
+
};
|
|
54
|
+
function getActionLabel() {
|
|
55
|
+
return "";
|
|
56
|
+
}
|
|
57
|
+
function Filter() {
|
|
58
|
+
const { activeFilters, setActiveFilters } = useFilters();
|
|
59
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
60
|
+
const { classes } = useDataGrid();
|
|
61
|
+
const toggleIcon = () => {
|
|
62
|
+
setActiveFilters(!activeFilters);
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
IconButton,
|
|
66
|
+
{
|
|
67
|
+
dictionaryTooltipId: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show",
|
|
68
|
+
className: classes.actionFilter,
|
|
69
|
+
onClick: toggleIcon,
|
|
70
|
+
"aria-label": "filter",
|
|
71
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/filter.svg`
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
const WrapperColumnsConfig = styled("div")(({ theme }) => ({
|
|
76
|
+
color: theme.vars.palette.text.primary,
|
|
77
|
+
position: "relative",
|
|
78
|
+
display: "flex",
|
|
79
|
+
flexDirection: "column",
|
|
80
|
+
height: "100%",
|
|
81
|
+
width: "100%"
|
|
82
|
+
}));
|
|
83
|
+
styled("div")(({ theme }) => ({
|
|
84
|
+
color: theme.vars.palette.text.primary,
|
|
85
|
+
fontSize: theme.typography.h4.fontSize
|
|
86
|
+
}));
|
|
87
|
+
const DivSelColumns = styled("div")(({ theme }) => ({
|
|
88
|
+
...theme.colorSchemes.finalTheme.typography.bodyDens,
|
|
89
|
+
color: theme.vars.palette.text.primary,
|
|
90
|
+
padding: `16px 8px`
|
|
91
|
+
}));
|
|
92
|
+
const WrapperDataGrid = styled("div")(() => ({
|
|
93
|
+
position: "relative",
|
|
94
|
+
display: "flex",
|
|
95
|
+
flexDirection: "column",
|
|
96
|
+
flexGrow: 1,
|
|
97
|
+
overflow: "auto"
|
|
98
|
+
}));
|
|
99
|
+
styled("div")(() => ({
|
|
100
|
+
display: "flex",
|
|
101
|
+
flexDirection: "row"
|
|
102
|
+
}));
|
|
103
|
+
const ColumnActions = styled("div")(() => ({
|
|
104
|
+
paddingTop: "16px",
|
|
105
|
+
paddingBottom: "8px",
|
|
106
|
+
display: "flex",
|
|
107
|
+
flexDirection: "row"
|
|
108
|
+
}));
|
|
109
|
+
styled("div")(({ theme }) => ({
|
|
110
|
+
paddingTop: theme.spacing(3),
|
|
111
|
+
display: "flex",
|
|
112
|
+
flexDirection: "row",
|
|
113
|
+
justifyContent: "flex-end",
|
|
114
|
+
"& > button": {
|
|
115
|
+
marginLeft: "10px"
|
|
116
|
+
}
|
|
117
|
+
}));
|
|
118
|
+
function getRowsFromColumnsConfig(columnsConfig) {
|
|
119
|
+
return columnsConfig.filter((column) => !column.hidden).map(
|
|
120
|
+
(column) => ({
|
|
121
|
+
key: column.key,
|
|
122
|
+
name: column.name,
|
|
123
|
+
visible: column.visible === void 0 ? true : column.visible,
|
|
124
|
+
frozen: column.frozen === void 0 ? false : column.frozen,
|
|
125
|
+
originalIndex: column.orginalIndex,
|
|
126
|
+
originalFrozen: column.originalFrozen,
|
|
127
|
+
originalVisible: column.originalVisible
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
const ColumnsConfig = forwardRef((props, ref) => {
|
|
132
|
+
const refdata_grid = useRef(null);
|
|
133
|
+
const { onCloseSettings, columnsConfig, onChangeColumnsConfig, classes } = props;
|
|
134
|
+
const { getLabel } = useModuleDictionary();
|
|
135
|
+
const [isInit, setIsInit] = useState(true);
|
|
136
|
+
const [rows, setRows] = useState(getRowsFromColumnsConfig(columnsConfig));
|
|
137
|
+
const [selRows, setSelRows] = useState(() => /* @__PURE__ */ new Set());
|
|
138
|
+
const divRef = useRef(null);
|
|
139
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
140
|
+
useImperativeHandle(ref, () => ({
|
|
141
|
+
onClickIntro: handleIntro,
|
|
142
|
+
current: divRef.current
|
|
143
|
+
}));
|
|
144
|
+
const columnsdata_grid = useMemo(
|
|
145
|
+
() => [
|
|
146
|
+
{
|
|
147
|
+
key: "name",
|
|
148
|
+
name: getLabel("data_grid.settings_column_name"),
|
|
149
|
+
width: 200,
|
|
150
|
+
resizable: true,
|
|
151
|
+
type: "string"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: "originalIndex",
|
|
155
|
+
name: getLabel("data_grid.settings_column_position"),
|
|
156
|
+
width: 50,
|
|
157
|
+
type: "number",
|
|
158
|
+
cellClass: "rdg-cell-align-center"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
key: "visible",
|
|
162
|
+
name: getLabel("data_grid.settings_column_visible"),
|
|
163
|
+
width: 80,
|
|
164
|
+
type: "boolean",
|
|
165
|
+
formatter: ColumnInteractiveCheckFormatter,
|
|
166
|
+
cellClass: "rdg-cell-align-center"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
key: "frozen",
|
|
170
|
+
name: getLabel("data_grid.settings_column_frozen"),
|
|
171
|
+
width: 80,
|
|
172
|
+
type: "boolean",
|
|
173
|
+
formatter: ColumnInteractiveCheckFormatter,
|
|
174
|
+
cellClass: "rdg-cell-align-center"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
[getLabel]
|
|
178
|
+
);
|
|
179
|
+
const checkAll = () => {
|
|
180
|
+
setRows(rows.map((row) => ({ ...row, visible: true })));
|
|
181
|
+
};
|
|
182
|
+
const unCheckAll = () => {
|
|
183
|
+
setRows(rows.map((row) => ({ ...row, visible: false })));
|
|
184
|
+
};
|
|
185
|
+
const restoreAll = () => {
|
|
186
|
+
setRows(
|
|
187
|
+
rows.map((row) => ({
|
|
188
|
+
...row,
|
|
189
|
+
visible: row.originalVisible,
|
|
190
|
+
frozen: row.originalFrozen,
|
|
191
|
+
index: row.originalIndex
|
|
192
|
+
})).sort((a, b) => a.index - b.index)
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
if (isInit === false) {
|
|
197
|
+
setRows(getRowsFromColumnsConfig(columnsConfig));
|
|
198
|
+
}
|
|
199
|
+
setIsInit(false);
|
|
200
|
+
}, [columnsConfig]);
|
|
201
|
+
const rowSelectedIndex = useMemo(() => {
|
|
202
|
+
let rowIndex = -1;
|
|
203
|
+
if (selRows.size !== 1)
|
|
204
|
+
return rowIndex;
|
|
205
|
+
const iterator = selRows.entries();
|
|
206
|
+
const entry = iterator.next().value[1];
|
|
207
|
+
rowIndex = rows.findIndex((row) => row.key === entry);
|
|
208
|
+
return rowIndex;
|
|
209
|
+
}, [rows, selRows]);
|
|
210
|
+
const handleMoveFirst = () => {
|
|
211
|
+
if (rowSelectedIndex === -1)
|
|
212
|
+
return -1;
|
|
213
|
+
const newRows = [...rows];
|
|
214
|
+
newRows.splice(rowSelectedIndex, 1);
|
|
215
|
+
newRows.splice(0, 0, rows[rowSelectedIndex]);
|
|
216
|
+
refdata_grid.current?.selectCell({ idx: 0, rowIdx: 0 });
|
|
217
|
+
setRows(newRows);
|
|
218
|
+
};
|
|
219
|
+
const handleMoveLast = () => {
|
|
220
|
+
if (rowSelectedIndex === -1)
|
|
221
|
+
return -1;
|
|
222
|
+
const newRows = [...rows];
|
|
223
|
+
newRows.splice(rowSelectedIndex, 1);
|
|
224
|
+
newRows.splice(newRows.length, 0, rows[rowSelectedIndex]);
|
|
225
|
+
refdata_grid.current?.selectCell({ idx: 0, rowIdx: newRows.length - 1 });
|
|
226
|
+
setRows(newRows);
|
|
227
|
+
};
|
|
228
|
+
const handleMoveUpDownd = (position) => {
|
|
229
|
+
if (rowSelectedIndex === -1)
|
|
230
|
+
return -1;
|
|
231
|
+
const newRows = [...rows];
|
|
232
|
+
const element = newRows[rowSelectedIndex];
|
|
233
|
+
newRows.splice(rowSelectedIndex, 1);
|
|
234
|
+
newRows.splice(rowSelectedIndex + position, 0, element);
|
|
235
|
+
refdata_grid.current?.selectCell({ idx: 0, rowIdx: rowSelectedIndex + position });
|
|
236
|
+
setRows(newRows);
|
|
237
|
+
};
|
|
238
|
+
const getColumnConfigByKey = (key) => {
|
|
239
|
+
const rowIndexFinded = rows.findIndex((row) => row.key === key);
|
|
240
|
+
if (rowIndexFinded > -1) {
|
|
241
|
+
return {
|
|
242
|
+
visible: rows[rowIndexFinded].visible,
|
|
243
|
+
frozen: rows[rowIndexFinded].frozen
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
return void 0;
|
|
247
|
+
};
|
|
248
|
+
const getRowIndex = (column) => {
|
|
249
|
+
const rowIndexFinded = rows.findIndex((row) => row.key === column.key);
|
|
250
|
+
if (rowIndexFinded > -1) {
|
|
251
|
+
return rowIndexFinded;
|
|
252
|
+
}
|
|
253
|
+
return columnsConfig.findIndex((columnConfig) => columnConfig.key === column.key);
|
|
254
|
+
};
|
|
255
|
+
const handleIntro = () => {
|
|
256
|
+
const newColumnsConfig = columnsConfig.map((columnConfig) => {
|
|
257
|
+
const newColumnConfig = { ...columnConfig };
|
|
258
|
+
if (!columnConfig.hidden) {
|
|
259
|
+
const columnConfigRow = getColumnConfigByKey(columnConfig.key);
|
|
260
|
+
if (columnConfigRow) {
|
|
261
|
+
newColumnConfig.visible = columnConfigRow.visible;
|
|
262
|
+
newColumnConfig.frozen = columnConfigRow.frozen;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return newColumnConfig;
|
|
266
|
+
}).sort((a, b) => getRowIndex(a) - getRowIndex(b));
|
|
267
|
+
onChangeColumnsConfig(newColumnsConfig);
|
|
268
|
+
onCloseSettings();
|
|
269
|
+
};
|
|
270
|
+
const onInternalSelectedRowsChange = () => {
|
|
271
|
+
};
|
|
272
|
+
const onInternalRowsChange = (newRows) => {
|
|
273
|
+
setRows(newRows);
|
|
274
|
+
};
|
|
275
|
+
const onRowClick = (row) => {
|
|
276
|
+
if (selRows.has(row.key))
|
|
277
|
+
return;
|
|
278
|
+
const mySet = /* @__PURE__ */ new Set([row.key]);
|
|
279
|
+
setSelRows(mySet);
|
|
280
|
+
};
|
|
281
|
+
return /* @__PURE__ */ jsxs(WrapperColumnsConfig, { ref: divRef, className: classes.columnsConfigContainer, children: [
|
|
282
|
+
/* @__PURE__ */ jsx(DivSelColumns, { className: classes.columnsLabelSetColumns, children: getLabel("data_grid.settings_sel_columns") }),
|
|
283
|
+
/* @__PURE__ */ jsx(WrapperDataGrid, { className: classes.columnsConfigContent, children: /* @__PURE__ */ jsx("div", { className: classes.wrapperDataGridCss, children: /* @__PURE__ */ jsx(
|
|
284
|
+
DataGrid$1,
|
|
285
|
+
{
|
|
286
|
+
className: classes.columnsConfigGrid,
|
|
287
|
+
ref: refdata_grid,
|
|
288
|
+
columns: columnsdata_grid,
|
|
289
|
+
rows,
|
|
290
|
+
onRowsChange: onInternalRowsChange,
|
|
291
|
+
selectedRows: selRows,
|
|
292
|
+
onSelectedRowsChange: onInternalSelectedRowsChange,
|
|
293
|
+
onRowClick,
|
|
294
|
+
rowKeyGetter: (row) => row.key,
|
|
295
|
+
cellNavigationMode: "CHANGE_ROW",
|
|
296
|
+
defaultColumnOptions: { resizable: true, sortable: true }
|
|
297
|
+
}
|
|
298
|
+
) }) }),
|
|
299
|
+
/* @__PURE__ */ jsxs(ColumnActions, { className: classes.columnsConfigActions, children: [
|
|
300
|
+
/* @__PURE__ */ jsx(
|
|
301
|
+
IconButton,
|
|
302
|
+
{
|
|
303
|
+
tooltip: getLabel("data_grid.settings_move_first"),
|
|
304
|
+
onClick: handleMoveFirst,
|
|
305
|
+
"aria-label": "move first place",
|
|
306
|
+
disabled: rowSelectedIndex < 1,
|
|
307
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_first_place.svg`
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ jsx(
|
|
311
|
+
IconButton,
|
|
312
|
+
{
|
|
313
|
+
tooltip: getLabel("data_grid.settings_move_up"),
|
|
314
|
+
dictionaryTooltipId: "data_grid.settings_move_up",
|
|
315
|
+
onClick: () => handleMoveUpDownd(-1),
|
|
316
|
+
"aria-label": "move up place",
|
|
317
|
+
disabled: rowSelectedIndex < 1,
|
|
318
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_up_place.svg`
|
|
319
|
+
}
|
|
320
|
+
),
|
|
321
|
+
/* @__PURE__ */ jsx(
|
|
322
|
+
IconButton,
|
|
323
|
+
{
|
|
324
|
+
tooltip: getLabel("data_grid.settings_move_last"),
|
|
325
|
+
onClick: handleMoveLast,
|
|
326
|
+
"aria-label": "move last place",
|
|
327
|
+
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
328
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_last_place.svg`
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
/* @__PURE__ */ jsx(
|
|
332
|
+
IconButton,
|
|
333
|
+
{
|
|
334
|
+
tooltip: getLabel("data_grid.settings_move_down"),
|
|
335
|
+
onClick: () => handleMoveUpDownd(1),
|
|
336
|
+
"aria-label": "move down place",
|
|
337
|
+
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
338
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_down_place.svg`
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
/* @__PURE__ */ jsx(
|
|
342
|
+
IconButton,
|
|
343
|
+
{
|
|
344
|
+
tooltip: getLabel("data_grid.settings_visible_all"),
|
|
345
|
+
onClick: checkAll,
|
|
346
|
+
"aria-label": "check visible all",
|
|
347
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/check_all.svg`
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
/* @__PURE__ */ jsx(
|
|
351
|
+
IconButton,
|
|
352
|
+
{
|
|
353
|
+
tooltip: getLabel("data_grid.settings_no_visible_all"),
|
|
354
|
+
onClick: unCheckAll,
|
|
355
|
+
"aria-label": "un check all",
|
|
356
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/uncheck_all.svg`
|
|
357
|
+
}
|
|
358
|
+
),
|
|
359
|
+
/* @__PURE__ */ jsx(
|
|
360
|
+
IconButton,
|
|
361
|
+
{
|
|
362
|
+
tooltip: getLabel("data_grid.settings_restore"),
|
|
363
|
+
onClick: restoreAll,
|
|
364
|
+
"aria-label": "Restore columns",
|
|
365
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/restore_columns.svg`
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] })
|
|
369
|
+
] });
|
|
370
|
+
});
|
|
371
|
+
ColumnsConfig.displayName = "ColumnsConfig";
|
|
372
|
+
const useModalSettings = () => {
|
|
373
|
+
const { openModal, closeModal } = useModal();
|
|
374
|
+
const { columnsConfig, onChangeColumnsConfig } = useDataGrid();
|
|
375
|
+
const { getLabel } = useModuleDictionary();
|
|
376
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
377
|
+
const isMobile = useIsMobile();
|
|
378
|
+
const { classes } = useDataGrid();
|
|
379
|
+
const ref = useRef(null);
|
|
380
|
+
const onCloseSettings = useCallback(() => {
|
|
381
|
+
closeModal();
|
|
382
|
+
}, [closeModal]);
|
|
383
|
+
const onClickIntro = useCallback(() => {
|
|
384
|
+
if (ref.current?.onClickIntro) {
|
|
385
|
+
ref.current.onClickIntro();
|
|
386
|
+
}
|
|
387
|
+
}, []);
|
|
388
|
+
const onClickSettings = () => {
|
|
389
|
+
openModal({
|
|
390
|
+
initialWidth: 500,
|
|
391
|
+
initialHeigth: 680,
|
|
392
|
+
fullScreen: isMobile,
|
|
393
|
+
window: /* @__PURE__ */ jsxs(
|
|
394
|
+
WindowBase,
|
|
395
|
+
{
|
|
396
|
+
title: getLabel("data_grid.settings_title"),
|
|
397
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`,
|
|
398
|
+
children: [
|
|
399
|
+
/* @__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(
|
|
400
|
+
ColumnsConfig,
|
|
401
|
+
{
|
|
402
|
+
ref,
|
|
403
|
+
columnsConfig,
|
|
404
|
+
onChangeColumnsConfig,
|
|
405
|
+
onCloseSettings,
|
|
406
|
+
classes
|
|
407
|
+
}
|
|
408
|
+
) }) }) }),
|
|
409
|
+
/* @__PURE__ */ jsxs(Actions$1, { children: [
|
|
410
|
+
/* @__PURE__ */ jsx(ActionCancel, { onClick: closeModal }),
|
|
411
|
+
/* @__PURE__ */ jsx(ActionIntro, { onClick: onClickIntro })
|
|
412
|
+
] })
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
return onClickSettings;
|
|
419
|
+
};
|
|
420
|
+
const useModalSettings$1 = useModalSettings;
|
|
421
|
+
function Settings() {
|
|
422
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
423
|
+
const { classes } = useDataGrid();
|
|
424
|
+
const modalSettings = useModalSettings$1();
|
|
425
|
+
return /* @__PURE__ */ jsx(
|
|
426
|
+
IconButton,
|
|
427
|
+
{
|
|
428
|
+
className: classes.actionSettings,
|
|
429
|
+
dictionaryTooltipId: "data_grid.tooltip_settings",
|
|
430
|
+
onClick: modalSettings,
|
|
431
|
+
"aria-label": "settings",
|
|
432
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
function RowsCount() {
|
|
437
|
+
const { rowsCount, classes } = useDataGrid();
|
|
438
|
+
const { getLabel } = useModuleDictionary();
|
|
439
|
+
const isSkeleton = useModuleSkeleton();
|
|
440
|
+
return /* @__PURE__ */ jsx("div", { className: classes.rowsCount, children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
441
|
+
/* @__PURE__ */ jsx("div", { className: classes.rowsCountLabel, children: getLabel("data_grid.rows") }),
|
|
442
|
+
/* @__PURE__ */ jsx("div", { className: classes.rowsCountValue, children: rowsCount })
|
|
443
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
444
|
+
/* @__PURE__ */ jsx("div", { className: classes.rowsCountLabel, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "40px", height: "16px" }) }),
|
|
445
|
+
/* @__PURE__ */ jsx("div", { className: classes.rowsCountValue, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "20px", height: "16px" }) })
|
|
446
|
+
] }) });
|
|
447
|
+
}
|
|
448
|
+
function Density() {
|
|
449
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
450
|
+
const { rowHeights, currentRowHeightVariant, setRowHeightVariant, classes } = useDataGrid();
|
|
451
|
+
const { getLabel } = useModuleDictionary();
|
|
452
|
+
const menuActions = useMemo(() => {
|
|
453
|
+
if (typeof rowHeights === "number") {
|
|
454
|
+
return [];
|
|
455
|
+
}
|
|
456
|
+
return [
|
|
457
|
+
{
|
|
458
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`,
|
|
459
|
+
onClick: () => setRowHeightVariant("compact"),
|
|
460
|
+
disabled: currentRowHeightVariant === "compact",
|
|
461
|
+
dictionaryField: "data_grid.density_compact"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`,
|
|
465
|
+
onClick: () => setRowHeightVariant("standard"),
|
|
466
|
+
disabled: currentRowHeightVariant === "standard",
|
|
467
|
+
dictionaryField: "data_grid.density_standard"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`,
|
|
471
|
+
onClick: () => setRowHeightVariant("confortable"),
|
|
472
|
+
disabled: currentRowHeightVariant === "confortable",
|
|
473
|
+
dictionaryField: "data_grid.density_confortable"
|
|
474
|
+
}
|
|
475
|
+
];
|
|
476
|
+
}, [
|
|
477
|
+
rowHeights,
|
|
478
|
+
currentRowHeightVariant,
|
|
479
|
+
setRowHeightVariant,
|
|
480
|
+
host_static_assets,
|
|
481
|
+
environment_assets
|
|
482
|
+
]);
|
|
483
|
+
const theme = useTheme();
|
|
484
|
+
const currenViewIcon = useMemo(() => {
|
|
485
|
+
if (currentRowHeightVariant === "compact") {
|
|
486
|
+
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`;
|
|
487
|
+
}
|
|
488
|
+
if (currentRowHeightVariant === "standard") {
|
|
489
|
+
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`;
|
|
490
|
+
}
|
|
491
|
+
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`;
|
|
492
|
+
}, [currentRowHeightVariant, host_static_assets, environment_assets]);
|
|
493
|
+
if (menuActions.length === 0) {
|
|
494
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
495
|
+
}
|
|
496
|
+
return /* @__PURE__ */ jsx(
|
|
497
|
+
MenuActions,
|
|
498
|
+
{
|
|
499
|
+
arrowType: "right-top",
|
|
500
|
+
className: classes.actionDensityPopover,
|
|
501
|
+
menuActionSx: theme.components?.M4LDataGridDensityPopover?.styleOverrides,
|
|
502
|
+
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
503
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
504
|
+
menuActions,
|
|
505
|
+
urlIcon: currenViewIcon,
|
|
506
|
+
toolTip: getLabel("data_grid.tooltip_density")
|
|
507
|
+
}
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
const MobileMenuActions = () => {
|
|
511
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
512
|
+
const { currentRowHeightVariant, setRowHeightVariant } = useDataGrid();
|
|
513
|
+
const { activeFilters, setActiveFilters } = useFilters();
|
|
514
|
+
const modalSettings = useModalSettings$1();
|
|
515
|
+
const toggleIcon = () => {
|
|
516
|
+
setActiveFilters(!activeFilters);
|
|
517
|
+
};
|
|
518
|
+
const menuActions = [
|
|
519
|
+
{
|
|
520
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`,
|
|
521
|
+
onClick: () => setRowHeightVariant("compact"),
|
|
522
|
+
disabled: currentRowHeightVariant === "compact",
|
|
523
|
+
dictionaryId: "data_grid.density_compact"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`,
|
|
527
|
+
onClick: () => setRowHeightVariant("standard"),
|
|
528
|
+
disabled: currentRowHeightVariant === "standard",
|
|
529
|
+
dictionaryId: "data_grid.density_standard"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`,
|
|
533
|
+
onClick: () => setRowHeightVariant("confortable"),
|
|
534
|
+
disabled: currentRowHeightVariant === "confortable",
|
|
535
|
+
dictionaryId: "data_grid.density_confortable"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/filter.svg`,
|
|
539
|
+
onClick: () => toggleIcon(),
|
|
540
|
+
dictionaryId: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`,
|
|
544
|
+
onClick: () => modalSettings(),
|
|
545
|
+
dictionaryId: "data_grid.tooltip_settings"
|
|
546
|
+
}
|
|
547
|
+
];
|
|
548
|
+
return /* @__PURE__ */ jsx(
|
|
549
|
+
MenuActions,
|
|
550
|
+
{
|
|
551
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/menu.svg`,
|
|
552
|
+
arrowType: "no-arrow",
|
|
553
|
+
marginTop: "12px",
|
|
554
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
555
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
556
|
+
menuActions
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
};
|
|
560
|
+
function Actions(props) {
|
|
561
|
+
const isXs = useResponsiveContainerStore((state) => state.isXs, shallow);
|
|
562
|
+
const { rowHeights, classes } = useDataGrid();
|
|
563
|
+
const isSkeleton = useModuleSkeleton();
|
|
564
|
+
const { getLabel } = useModuleDictionary();
|
|
565
|
+
const {
|
|
566
|
+
withRowsCount = true,
|
|
567
|
+
withPager = true,
|
|
568
|
+
pagerOptions,
|
|
569
|
+
withSettings = true,
|
|
570
|
+
settingsProps,
|
|
571
|
+
withLocalFilters
|
|
572
|
+
} = props;
|
|
573
|
+
return /* @__PURE__ */ jsxs("div", { className: classes.actions, children: [
|
|
574
|
+
withRowsCount && !isXs && /* @__PURE__ */ jsx(RowsCount, {}),
|
|
575
|
+
withPager && pagerOptions && /* @__PURE__ */ jsx(
|
|
576
|
+
Pager,
|
|
577
|
+
{
|
|
578
|
+
...pagerOptions,
|
|
579
|
+
totalRecords: pagerOptions.totalRecords,
|
|
580
|
+
isSkeleton,
|
|
581
|
+
isXs,
|
|
582
|
+
labelRows: getLabel(dictionary.LABEL_ROWS_PER_PAGE),
|
|
583
|
+
labelOf: getLabel(dictionary.LABEL_OF)
|
|
584
|
+
}
|
|
585
|
+
),
|
|
586
|
+
isXs ? /* @__PURE__ */ jsx(MobileMenuActions, {}) : /* @__PURE__ */ jsxs("div", { className: classes.actionsConfigContainer, children: [
|
|
587
|
+
typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}),
|
|
588
|
+
withLocalFilters && /* @__PURE__ */ jsx(Filter, {}),
|
|
589
|
+
withSettings && /* @__PURE__ */ jsx(Settings, { ...settingsProps })
|
|
590
|
+
] })
|
|
591
|
+
] });
|
|
592
|
+
}
|
|
593
|
+
export {
|
|
594
|
+
ActionsColumn as A,
|
|
595
|
+
Actions as a
|
|
596
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useRef, useImperativeHandle, useCallback, useEffect, useMemo } from "react";
|
|
3
|
-
import { D as DraggableCore_1 } from "../../react-draggable.
|
|
3
|
+
import { D as DraggableCore_1 } from "../../react-draggable.1c1ba224.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { styled, generateUtilityClasses } from "@mui/material";
|
|
6
|
-
import { M as MAP_ZINDEX_OVER_MAP
|
|
6
|
+
import { M as MAP_ZINDEX_OVER_MAP } from "../maps/components/Map/index.c37f3304.js";
|
|
7
7
|
import "@mui/base";
|
|
8
|
-
import {
|
|
8
|
+
import { M as MAP_ZINDEX_OVER_MAP$1 } from "../popups/PopupsViewer/index.f3677ab1.js";
|
|
9
|
+
import { R as Resizable } from "../../react-resizable.a59c14f4.js";
|
|
9
10
|
const WrapperWindowRoot = styled("div")`
|
|
10
11
|
position: absolute;
|
|
11
12
|
left: 0px;
|
|
@@ -16,6 +17,8 @@ const WrapperWindowRoot = styled("div")`
|
|
|
16
17
|
|
|
17
18
|
${(props) => props.theme.components?.M4LDragResizeWindow?.styleOverrides}
|
|
18
19
|
`;
|
|
20
|
+
const COMPONENT_CLASS_NAME = "M4LDraggableWindow";
|
|
21
|
+
const DEFAULT_TRANSFORM_SCALE = 1;
|
|
19
22
|
const draggableWindowClasses = generateUtilityClasses(
|
|
20
23
|
COMPONENT_CLASS_NAME,
|
|
21
24
|
[
|