@m4l/components 3.1.7 → 3.1.8
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/index.js +183 -340
- package/node_modules-CQtkw0uG.js +7350 -0
- package/package.json +1 -1
- package/vendor-AfIOyqRr.js +24636 -0
- package/components/AccountPopover/index-Dm2-k-Mv.js +0 -334
- package/components/AppBar/index-i0rhG3J1.js +0 -93
- package/components/BaseModule/index-CiNNlxzS.js +0 -30
- package/components/CommonActions/components/ActionCancel/index-CIdpDXkr.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index-CpyASN3q.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index-7KKtcUra.js +0 -33
- package/components/CommonActions/components/ActionIntro/index-CqqDZZcG.js +0 -25
- package/components/CommonActions/components/Actions/index-CuG1pnXW.js +0 -70
- package/components/DataGrid/constants-8L7QgBKi.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index-CveSCbq_.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-CHqvieM2.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js +0 -23
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
- package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
- package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
- package/components/DataGrid/formatters/index-CrZXPa0e.js +0 -13
- package/components/DataGrid/index-BZ-lbmuU.js +0 -908
- package/components/DataGrid/subcomponents/Actions/index-CHvPZ4Ru.js +0 -549
- package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
- package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
- package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
- package/components/DynamicFilter/dictionary-PrbXU3VZ.js +0 -51
- package/components/DynamicFilter/index-DZiJc9h7.js +0 -116
- package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
- package/components/DynamicFilter/slots/dynamicFilterSlots-DHxelhXP.js +0 -151
- package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
- package/components/DynamicFilter/store/index-BT-eWVnJ.js +0 -254
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-B32bAzi-.js +0 -60
- package/components/DynamicFilter/subcomponents/AppliedFilters/index-Bha19drV.js +0 -26
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BmvzoHit.js +0 -40
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-BcO3SlP5.js +0 -129
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BCJhpNS8.js +0 -171
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-DCNhz68u.js +0 -153
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-BdypjM1Y.js +0 -146
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-D-NFIVnK.js +0 -114
- package/components/DynamicFilter/subcomponents/FieldTypes/index-BwQHJqk9.js +0 -38
- package/components/DynamicFilter/subcomponents/FilterActions/index-B9UWmk07.js +0 -88
- package/components/DynamicFilter/subcomponents/InputFilter/index-CfGb1TfV.js +0 -188
- package/components/DynamicFilter/subcomponents/PopoverFilter/index-DkfRGrlO.js +0 -158
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DSegwAm2.js +0 -63
- package/components/FieldLabel/index-CI57EizR.js +0 -54
- package/components/GridLayout/index-C4HyxNYX.js +0 -1044
- package/components/GridLayout/subcomponents/Griditem/index-C7jT4s8t.js +0 -395
- package/components/GridLayout/subcomponents/Responsive/index-BKcU2OnF.js +0 -348
- package/components/GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js +0 -71
- package/components/HelperText/index-Crn_XIPF.js +0 -50
- package/components/Icon/index-C89MAkeH.js +0 -176
- package/components/Image/index-COp8vP0X.js +0 -175
- package/components/LanguagePopover/index-BA2Igs9L.js +0 -179
- package/components/LinearProgressIndeterminate/index-BwI756Mb.js +0 -55
- package/components/Loadable/index-BMbi9ISF.js +0 -9
- package/components/LoadingError/index-Cf0oGUrL.js +0 -89
- package/components/MFIsolationApp/index-V4R55hNU.js +0 -169
- package/components/MFLoader/index-BI8vQZSH.js +0 -299
- package/components/ModalDialog/index-CEVQBQ7W.js +0 -77
- package/components/NavLink/index-D1S_vtFO.js +0 -55
- package/components/NoItemSelected/index-B9oM26AX.js +0 -54
- package/components/ObjectLogs/index-CiXOJpS4.js +0 -233
- package/components/PDFViewer/index-GVN2rfd6.js +0 -51
- package/components/Page/index-DZMkYmr4.js +0 -117
- package/components/PaperForm/index-DwgAfjci.js +0 -59
- package/components/Period/index-2pJG3VmY.js +0 -238
- package/components/PrintingSystem/index-B2qcnfw0.js +0 -187
- package/components/PrintingSystem/subcomponents/BodyNode/index-Cv2aoy8S.js +0 -49
- package/components/PrintingSystem/subcomponents/ChartNode/index-BmJm8v_C.js +0 -105
- package/components/PrintingSystem/subcomponents/DividerNode/index-MpFhE-H0.js +0 -20
- package/components/PrintingSystem/subcomponents/FooterNode/index-ZEcWdMSM.js +0 -49
- package/components/PrintingSystem/subcomponents/GridNode/index-SsKax2xu.js +0 -74
- package/components/PrintingSystem/subcomponents/HeaderNode/index-Cs8TOOBL.js +0 -49
- package/components/PrintingSystem/subcomponents/PaperNode/index-DBb25Ecg.js +0 -30
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index-CTVn7J9Q.js +0 -47
- package/components/PrintingSystem/subcomponents/SectionNode/index-iYPM3EaS.js +0 -49
- package/components/PrintingSystem/subcomponents/TextBoxNode/index-DGjXCFKJ.js +0 -24
- package/components/PropertyValue/index-Bh-Jnrte.js +0 -264
- package/components/Resizeable/index-DdP1xfE9.js +0 -20
- package/components/ScrollBar/index-f2URPPE2.js +0 -35
- package/components/ScrollToTop/index-TxORk5dB.js +0 -12
- package/components/SideBar/index-PUBBe0yH.js +0 -758
- package/components/SplitLayout/index-Bu1hcO6G.js +0 -89
- package/components/ToastContainer/index-DK1d8NNd.js +0 -191
- package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
- package/components/animate/LoadingScreen/index-CkVLOrMz.js +0 -70
- package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
- package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
- package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
- package/components/animate/features-BbnE33u3.js +0 -5
- package/components/animate/index-BsWiJfzp.js +0 -89
- package/components/animate/variants/bounce-DanQqHAX.js +0 -101
- package/components/animate/variants/container-Dmpr6tg5.js +0 -22
- package/components/animate/variants/fade-CAOJNn06.js +0 -65
- package/components/animate/variants/index-l0sNRNKZ.js +0 -1
- package/components/animate/variants/transition-B9W5SWTa.js +0 -20
- package/components/areas/components/AreasAdmin/index-OxQU3P8Y.js +0 -699
- package/components/areas/components/AreasViewer/index-DQ0aPioP.js +0 -805
- package/components/areas/components/index-l0sNRNKZ.js +0 -1
- package/components/areas/constants-rqODZNZe.js +0 -6
- package/components/areas/contexts/AreasContext/index-BqRlA7JA.js +0 -1110
- package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
- package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
- package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
- package/components/areas/dictionary-YUsP9beq.js +0 -36
- package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
- package/components/areas/hooks/useAreas/index-BSbwbJLS.js +0 -11
- package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
- package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
- package/components/areas/icons-CwFr-alN.js +0 -24
- package/components/areas/index-B_Odny9h.js +0 -22
- package/components/commercial/AppBarCommercial/index-CHq3P3GY.js +0 -28
- package/components/commercial/SectionCommercial/index-BeABGtdr.js +0 -56
- package/components/commercial/TopBar/index-F1repmti.js +0 -232
- package/components/commercial/index-CxDzs6Ax.js +0 -81
- package/components/formatters/BooleanFormatter/index-DktIidqW.js +0 -44
- package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
- package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
- package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
- package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
- package/components/formatters/index-pnJhDYKe.js +0 -109
- package/components/hook-form/HelperError/index-BVnmUazV.js +0 -19
- package/components/hook-form/RHFAutocomplete/index-BtPL16HR.js +0 -657
- package/components/hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js +0 -226
- package/components/hook-form/RHFCheckbox/index-Vyttu8Vx.js +0 -132
- package/components/hook-form/RHFColorPicker/index-Cxxb5Wa_.js +0 -191
- package/components/hook-form/RHFDateTime/index-CW1Slb-f.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
- package/components/hook-form/RHFPeriod/index-r-HeIOoZ.js +0 -98
- package/components/hook-form/RHFRadioGroup/index-CTD-0zKo.js +0 -52
- package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
- package/components/hook-form/RHFTextField/index-B6ufruSB.js +0 -337
- package/components/hook-form/RHFUpload/index-CDPbm8NR.js +0 -253
- package/components/maps/components/GpsTools/index-5MXlhIEt.js +0 -1948
- package/components/maps/components/Map/index-2Lx5ARXa.js +0 -2546
- package/components/maps/index-Ci-7-FHg.js +0 -7
- package/components/modal/WindowBase-Gd27v5FU.js +0 -44
- package/components/modal/WindowConfirm-u6vAMFo7.js +0 -73
- package/components/modal/index-CydPIpKZ.js +0 -65
- package/components/mui_extended/Accordion/index-DMLYJL7o.js +0 -124
- package/components/mui_extended/Avatar/index-ClBa-6eF.js +0 -64
- package/components/mui_extended/Badge/index-zI-F_Qkq.js +0 -29
- package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
- package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
- package/components/mui_extended/Button/index-CGfZbaea.js +0 -222
- package/components/mui_extended/CheckBox-BXUrbonB.js +0 -76
- package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
- package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
- package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
- package/components/mui_extended/IconButton/index-CusYFjie.js +0 -97
- package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
- package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
- package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
- package/components/mui_extended/MenuActions/MenuActions-C6CjSU6C.js +0 -149
- package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
- package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots-D65KZAKF.js +0 -46
- package/components/mui_extended/Pager/index-DCbxiTZA.js +0 -257
- package/components/mui_extended/Popover/index-DfrJAQkV.js +0 -153
- package/components/mui_extended/Stack/index-DzEeCYfp.js +0 -31
- package/components/mui_extended/Tab/index-Bu3dPidV.js +0 -129
- package/components/mui_extended/ToggleButton/index-C9cBkT1V.js +0 -18
- package/components/mui_extended/ToggleIconButton/index--0b3Td6C.js +0 -26
- package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
- package/components/mui_extended/Typography/index-Cf_4Zw8f.js +0 -54
- package/components/mui_extended/index-l0sNRNKZ.js +0 -1
- package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
- package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
- package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
- package/components/popups/PopupsViewer/index-BecevSns.js +0 -172
- package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
- package/components/popups/PopupsViewer/slots/popupsViewerSlots-BXH77nCF.js +0 -46
- package/components/popups/index-l0sNRNKZ.js +0 -1
- package/contexts/ModalContext/index-CPfNnfTL.js +0 -39
- package/contexts/RHFormContext/index-D_nK759o.js +0 -78
- package/hocs/withToggle/index-C1_DMZD3.js +0 -14
- package/hooks/useFormAddEdit/index-D9oSjUn1.js +0 -90
- package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
- package/hooks/useModal/index-BJSQOX3U.js +0 -10
- package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
- package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
- package/hooks/useTab/index-B_GEQFOP.js +0 -12
- package/react-data-grid-BfYuZ6AK.js +0 -2606
- package/react-draggable-DsCPdgQP.js +0 -811
- package/react-json-view-bhqIAaNg.js +0 -2576
- package/react-resizable-eBbFl2dX.js +0 -618
- package/react-spinners-TpKN9lZg.js +0 -123
- package/react-splitter-layout-C-JTsNGs.js +0 -158
- package/styles/DynamicFilter-CJFsIegc.js +0 -319
- package/styles/MenuActions-lTi-ynPM.js +0 -42
- package/styles/index-DKj6m8SL.js +0 -1691
- package/test/constants_no_mock-CF-669v-.js +0 -4
- package/test/getNameDataTestId-BaBTWhBr.js +0 -10
- package/utils/index-DiMrtgIu.js +0 -502
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
|
@@ -1,549 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { u as useDataGrid, a as useFilters, b as dictionary } from "../../index-BZ-lbmuU.js";
|
|
3
|
-
import { useTheme, Skeleton } from "@mui/material";
|
|
4
|
-
import { b as DATAGRID_ACTIONS_COLUMN_KEY } from "../../constants-8L7QgBKi.js";
|
|
5
|
-
import { M as MenuActions } from "../../../mui_extended/MenuActions/MenuActions-C6CjSU6C.js";
|
|
6
|
-
import { P as Pager } from "../../../mui_extended/Pager/index-DCbxiTZA.js";
|
|
7
|
-
import { I as IconButton } from "../../../mui_extended/IconButton/index-CusYFjie.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 { b as WrapperColumnsConfig, c as DivSelColumns, d as WrapperDataGrid, C as ColumnActions, D as DataGridRoot } from "../../../../styles/index-DKj6m8SL.js";
|
|
12
|
-
import { D as DataGrid$1 } from "../../../../react-data-grid-BfYuZ6AK.js";
|
|
13
|
-
import { C as ColumnInteractiveCheckFormatter } from "../../formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js";
|
|
14
|
-
import { u as useModal } from "../../../../hooks/useModal/index-BJSQOX3U.js";
|
|
15
|
-
import { W as WindowBase } from "../../../modal/WindowBase-Gd27v5FU.js";
|
|
16
|
-
import { A as Actions$1 } from "../../../CommonActions/components/Actions/index-CuG1pnXW.js";
|
|
17
|
-
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index-CIdpDXkr.js";
|
|
18
|
-
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index-CqqDZZcG.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: getLabel(dictionary.LABEL_ACTIONS),
|
|
44
|
-
name: getActionLabel(),
|
|
45
|
-
width: 32,
|
|
46
|
-
minWidth: 32,
|
|
47
|
-
isDraggable: false,
|
|
48
|
-
withFilter: false,
|
|
49
|
-
resizable: true,
|
|
50
|
-
sortable: false,
|
|
51
|
-
frozen: true,
|
|
52
|
-
type: "custom",
|
|
53
|
-
formatter: ActionsFormatter
|
|
54
|
-
};
|
|
55
|
-
function getActionLabel() {
|
|
56
|
-
return "";
|
|
57
|
-
}
|
|
58
|
-
function Filter() {
|
|
59
|
-
const { activeFilters, setActiveFilters } = useFilters();
|
|
60
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
61
|
-
const { classes } = useDataGrid();
|
|
62
|
-
const toggleIcon = () => {
|
|
63
|
-
setActiveFilters(!activeFilters);
|
|
64
|
-
};
|
|
65
|
-
return /* @__PURE__ */ jsx(
|
|
66
|
-
IconButton,
|
|
67
|
-
{
|
|
68
|
-
dictionaryTooltipId: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show",
|
|
69
|
-
className: classes.actionFilter,
|
|
70
|
-
onClick: toggleIcon,
|
|
71
|
-
"aria-label": "filter",
|
|
72
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/filter.svg`
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
function getRowsFromColumnsConfig(columnsConfig) {
|
|
77
|
-
return columnsConfig.filter((column) => !column.hidden).map(
|
|
78
|
-
(column) => ({
|
|
79
|
-
key: column.key,
|
|
80
|
-
name: column.name,
|
|
81
|
-
visible: column.visible === void 0 ? true : column.visible,
|
|
82
|
-
frozen: column.frozen === void 0 ? false : column.frozen,
|
|
83
|
-
originalIndex: column.orginalIndex,
|
|
84
|
-
originalFrozen: column.originalFrozen,
|
|
85
|
-
originalVisible: column.originalVisible
|
|
86
|
-
})
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
const ColumnsConfig = forwardRef((props, ref) => {
|
|
90
|
-
const refdata_grid = useRef(null);
|
|
91
|
-
const { onCloseSettings, columnsConfig, onChangeColumnsConfig, classes } = props;
|
|
92
|
-
const { getLabel } = useModuleDictionary();
|
|
93
|
-
const [isInit, setIsInit] = useState(true);
|
|
94
|
-
const [rows, setRows] = useState(getRowsFromColumnsConfig(columnsConfig));
|
|
95
|
-
const [selRows, setSelRows] = useState(() => /* @__PURE__ */ new Set());
|
|
96
|
-
const divRef = useRef(null);
|
|
97
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
98
|
-
useImperativeHandle(ref, () => ({
|
|
99
|
-
onClickIntro: handleIntro,
|
|
100
|
-
current: divRef.current
|
|
101
|
-
}));
|
|
102
|
-
const columnsdata_grid = useMemo(
|
|
103
|
-
() => [
|
|
104
|
-
{
|
|
105
|
-
key: "name",
|
|
106
|
-
name: getLabel("data_grid.settings_column_name"),
|
|
107
|
-
width: 200,
|
|
108
|
-
resizable: true,
|
|
109
|
-
type: "string"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
key: "originalIndex",
|
|
113
|
-
name: getLabel("data_grid.settings_column_position"),
|
|
114
|
-
width: 50,
|
|
115
|
-
type: "number",
|
|
116
|
-
cellClass: "rdg-cell-align-center"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
key: "visible",
|
|
120
|
-
name: getLabel("data_grid.settings_column_visible"),
|
|
121
|
-
width: 80,
|
|
122
|
-
type: "boolean",
|
|
123
|
-
formatter: ColumnInteractiveCheckFormatter,
|
|
124
|
-
cellClass: "rdg-cell-align-center"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
key: "frozen",
|
|
128
|
-
name: getLabel("data_grid.settings_column_frozen"),
|
|
129
|
-
width: 80,
|
|
130
|
-
type: "boolean",
|
|
131
|
-
formatter: ColumnInteractiveCheckFormatter,
|
|
132
|
-
cellClass: "rdg-cell-align-center"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
[getLabel]
|
|
136
|
-
);
|
|
137
|
-
const checkAll = () => {
|
|
138
|
-
setRows(rows.map((row) => ({ ...row, visible: true })));
|
|
139
|
-
};
|
|
140
|
-
const unCheckAll = () => {
|
|
141
|
-
setRows(rows.map((row) => ({ ...row, visible: false })));
|
|
142
|
-
};
|
|
143
|
-
const restoreAll = () => {
|
|
144
|
-
setRows(
|
|
145
|
-
rows.map((row) => ({
|
|
146
|
-
...row,
|
|
147
|
-
visible: row.originalVisible,
|
|
148
|
-
frozen: row.originalFrozen,
|
|
149
|
-
index: row.originalIndex
|
|
150
|
-
})).sort((a, b) => a.index - b.index)
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
useEffect(() => {
|
|
154
|
-
if (isInit === false) {
|
|
155
|
-
setRows(getRowsFromColumnsConfig(columnsConfig));
|
|
156
|
-
}
|
|
157
|
-
setIsInit(false);
|
|
158
|
-
}, [columnsConfig]);
|
|
159
|
-
const rowSelectedIndex = useMemo(() => {
|
|
160
|
-
let rowIndex = -1;
|
|
161
|
-
if (selRows.size !== 1) return rowIndex;
|
|
162
|
-
const iterator = selRows.entries();
|
|
163
|
-
const entry = iterator.next().value[1];
|
|
164
|
-
rowIndex = rows.findIndex((row) => row.key === entry);
|
|
165
|
-
return rowIndex;
|
|
166
|
-
}, [rows, selRows]);
|
|
167
|
-
const handleMoveFirst = () => {
|
|
168
|
-
if (rowSelectedIndex === -1) return -1;
|
|
169
|
-
const newRows = [...rows];
|
|
170
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
171
|
-
newRows.splice(0, 0, rows[rowSelectedIndex]);
|
|
172
|
-
refdata_grid.current?.selectCell({ idx: 0, rowIdx: 0 });
|
|
173
|
-
setRows(newRows);
|
|
174
|
-
};
|
|
175
|
-
const handleMoveLast = () => {
|
|
176
|
-
if (rowSelectedIndex === -1) return -1;
|
|
177
|
-
const newRows = [...rows];
|
|
178
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
179
|
-
newRows.splice(newRows.length, 0, rows[rowSelectedIndex]);
|
|
180
|
-
refdata_grid.current?.selectCell({ idx: 0, rowIdx: newRows.length - 1 });
|
|
181
|
-
setRows(newRows);
|
|
182
|
-
};
|
|
183
|
-
const handleMoveUpDownd = (position) => {
|
|
184
|
-
if (rowSelectedIndex === -1) return -1;
|
|
185
|
-
const newRows = [...rows];
|
|
186
|
-
const element = newRows[rowSelectedIndex];
|
|
187
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
188
|
-
newRows.splice(rowSelectedIndex + position, 0, element);
|
|
189
|
-
refdata_grid.current?.selectCell({ idx: 0, rowIdx: rowSelectedIndex + position });
|
|
190
|
-
setRows(newRows);
|
|
191
|
-
};
|
|
192
|
-
const getColumnConfigByKey = (key) => {
|
|
193
|
-
const rowIndexFinded = rows.findIndex((row) => row.key === key);
|
|
194
|
-
if (rowIndexFinded > -1) {
|
|
195
|
-
return {
|
|
196
|
-
visible: rows[rowIndexFinded].visible,
|
|
197
|
-
frozen: rows[rowIndexFinded].frozen
|
|
198
|
-
// index: rowIndexFinded,
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
return void 0;
|
|
202
|
-
};
|
|
203
|
-
const getRowIndex = (column) => {
|
|
204
|
-
const rowIndexFinded = rows.findIndex((row) => row.key === column.key);
|
|
205
|
-
if (rowIndexFinded > -1) {
|
|
206
|
-
return rowIndexFinded;
|
|
207
|
-
}
|
|
208
|
-
return columnsConfig.findIndex((columnConfig) => columnConfig.key === column.key);
|
|
209
|
-
};
|
|
210
|
-
const handleIntro = () => {
|
|
211
|
-
const newColumnsConfig = columnsConfig.map((columnConfig) => {
|
|
212
|
-
const newColumnConfig = { ...columnConfig };
|
|
213
|
-
if (!columnConfig.hidden) {
|
|
214
|
-
const columnConfigRow = getColumnConfigByKey(columnConfig.key);
|
|
215
|
-
if (columnConfigRow) {
|
|
216
|
-
newColumnConfig.visible = columnConfigRow.visible;
|
|
217
|
-
newColumnConfig.frozen = columnConfigRow.frozen;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return newColumnConfig;
|
|
221
|
-
}).sort((a, b) => getRowIndex(a) - getRowIndex(b));
|
|
222
|
-
onChangeColumnsConfig(newColumnsConfig);
|
|
223
|
-
onCloseSettings();
|
|
224
|
-
};
|
|
225
|
-
const onInternalSelectedRowsChange = () => {
|
|
226
|
-
};
|
|
227
|
-
const onInternalRowsChange = (newRows) => {
|
|
228
|
-
setRows(newRows);
|
|
229
|
-
};
|
|
230
|
-
const onRowClick = (row) => {
|
|
231
|
-
if (selRows.has(row.key)) return;
|
|
232
|
-
const mySet = /* @__PURE__ */ new Set([row.key]);
|
|
233
|
-
setSelRows(mySet);
|
|
234
|
-
};
|
|
235
|
-
return /* @__PURE__ */ jsxs(WrapperColumnsConfig, { ref: divRef, className: classes.columnsConfigContainer, children: [
|
|
236
|
-
/* @__PURE__ */ jsx(DivSelColumns, { className: classes.columnsLabelSetColumns, children: getLabel("data_grid.settings_sel_columns") }),
|
|
237
|
-
/* @__PURE__ */ jsx(WrapperDataGrid, { className: classes.columnsConfigContent, children: /* @__PURE__ */ jsx("div", { className: classes.wrapperDataGridCss, children: /* @__PURE__ */ jsx(
|
|
238
|
-
DataGrid$1,
|
|
239
|
-
{
|
|
240
|
-
className: classes.columnsConfigGrid,
|
|
241
|
-
ref: refdata_grid,
|
|
242
|
-
columns: columnsdata_grid,
|
|
243
|
-
rows,
|
|
244
|
-
onRowsChange: onInternalRowsChange,
|
|
245
|
-
selectedRows: selRows,
|
|
246
|
-
onSelectedRowsChange: onInternalSelectedRowsChange,
|
|
247
|
-
onRowClick,
|
|
248
|
-
rowKeyGetter: (row) => row.key,
|
|
249
|
-
cellNavigationMode: "CHANGE_ROW",
|
|
250
|
-
defaultColumnOptions: { resizable: true, sortable: true }
|
|
251
|
-
}
|
|
252
|
-
) }) }),
|
|
253
|
-
/* @__PURE__ */ jsxs(ColumnActions, { className: classes.columnsConfigActions, children: [
|
|
254
|
-
/* @__PURE__ */ jsx(
|
|
255
|
-
IconButton,
|
|
256
|
-
{
|
|
257
|
-
tooltip: getLabel("data_grid.settings_move_first"),
|
|
258
|
-
onClick: handleMoveFirst,
|
|
259
|
-
"aria-label": "move first place",
|
|
260
|
-
disabled: rowSelectedIndex < 1,
|
|
261
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_first_place.svg`
|
|
262
|
-
}
|
|
263
|
-
),
|
|
264
|
-
/* @__PURE__ */ jsx(
|
|
265
|
-
IconButton,
|
|
266
|
-
{
|
|
267
|
-
tooltip: getLabel("data_grid.settings_move_up"),
|
|
268
|
-
dictionaryTooltipId: "data_grid.settings_move_up",
|
|
269
|
-
onClick: () => handleMoveUpDownd(-1),
|
|
270
|
-
"aria-label": "move up place",
|
|
271
|
-
disabled: rowSelectedIndex < 1,
|
|
272
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_up_place.svg`
|
|
273
|
-
}
|
|
274
|
-
),
|
|
275
|
-
/* @__PURE__ */ jsx(
|
|
276
|
-
IconButton,
|
|
277
|
-
{
|
|
278
|
-
tooltip: getLabel("data_grid.settings_move_last"),
|
|
279
|
-
onClick: handleMoveLast,
|
|
280
|
-
"aria-label": "move last place",
|
|
281
|
-
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
282
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_last_place.svg`
|
|
283
|
-
}
|
|
284
|
-
),
|
|
285
|
-
/* @__PURE__ */ jsx(
|
|
286
|
-
IconButton,
|
|
287
|
-
{
|
|
288
|
-
tooltip: getLabel("data_grid.settings_move_down"),
|
|
289
|
-
onClick: () => handleMoveUpDownd(1),
|
|
290
|
-
"aria-label": "move down place",
|
|
291
|
-
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
292
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_down_place.svg`
|
|
293
|
-
}
|
|
294
|
-
),
|
|
295
|
-
/* @__PURE__ */ jsx(
|
|
296
|
-
IconButton,
|
|
297
|
-
{
|
|
298
|
-
tooltip: getLabel("data_grid.settings_visible_all"),
|
|
299
|
-
onClick: checkAll,
|
|
300
|
-
"aria-label": "check visible all",
|
|
301
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/check_all.svg`
|
|
302
|
-
}
|
|
303
|
-
),
|
|
304
|
-
/* @__PURE__ */ jsx(
|
|
305
|
-
IconButton,
|
|
306
|
-
{
|
|
307
|
-
tooltip: getLabel("data_grid.settings_no_visible_all"),
|
|
308
|
-
onClick: unCheckAll,
|
|
309
|
-
"aria-label": "un check all",
|
|
310
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/uncheck_all.svg`
|
|
311
|
-
}
|
|
312
|
-
),
|
|
313
|
-
/* @__PURE__ */ jsx(
|
|
314
|
-
IconButton,
|
|
315
|
-
{
|
|
316
|
-
tooltip: getLabel("data_grid.settings_restore"),
|
|
317
|
-
onClick: restoreAll,
|
|
318
|
-
"aria-label": "Restore columns",
|
|
319
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/restore_columns.svg`
|
|
320
|
-
}
|
|
321
|
-
)
|
|
322
|
-
] })
|
|
323
|
-
] });
|
|
324
|
-
});
|
|
325
|
-
ColumnsConfig.displayName = "ColumnsConfig";
|
|
326
|
-
const useModalSettings = () => {
|
|
327
|
-
const { openModal, closeModal } = useModal();
|
|
328
|
-
const { columnsConfig, onChangeColumnsConfig } = useDataGrid();
|
|
329
|
-
const { getLabel } = useModuleDictionary();
|
|
330
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
331
|
-
const isMobile = useIsMobile();
|
|
332
|
-
const { classes } = useDataGrid();
|
|
333
|
-
const ref = useRef(null);
|
|
334
|
-
const onCloseSettings = useCallback(() => {
|
|
335
|
-
closeModal();
|
|
336
|
-
}, [closeModal]);
|
|
337
|
-
const onClickIntro = useCallback(() => {
|
|
338
|
-
if (ref.current?.onClickIntro) {
|
|
339
|
-
ref.current.onClickIntro();
|
|
340
|
-
}
|
|
341
|
-
}, []);
|
|
342
|
-
const onClickSettings = () => {
|
|
343
|
-
openModal({
|
|
344
|
-
initialWidth: 500,
|
|
345
|
-
initialHeigth: 680,
|
|
346
|
-
fullScreen: isMobile,
|
|
347
|
-
window: /* @__PURE__ */ jsxs(
|
|
348
|
-
WindowBase,
|
|
349
|
-
{
|
|
350
|
-
title: getLabel("data_grid.settings_title"),
|
|
351
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`,
|
|
352
|
-
children: [
|
|
353
|
-
/* @__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(
|
|
354
|
-
ColumnsConfig,
|
|
355
|
-
{
|
|
356
|
-
ref,
|
|
357
|
-
columnsConfig,
|
|
358
|
-
onChangeColumnsConfig,
|
|
359
|
-
onCloseSettings,
|
|
360
|
-
classes
|
|
361
|
-
}
|
|
362
|
-
) }) }) }),
|
|
363
|
-
/* @__PURE__ */ jsxs(Actions$1, { children: [
|
|
364
|
-
/* @__PURE__ */ jsx(ActionCancel, { onClick: closeModal }),
|
|
365
|
-
/* @__PURE__ */ jsx(ActionIntro, { onClick: onClickIntro })
|
|
366
|
-
] })
|
|
367
|
-
]
|
|
368
|
-
}
|
|
369
|
-
)
|
|
370
|
-
});
|
|
371
|
-
};
|
|
372
|
-
return onClickSettings;
|
|
373
|
-
};
|
|
374
|
-
function Settings() {
|
|
375
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
376
|
-
const { classes } = useDataGrid();
|
|
377
|
-
const modalSettings = useModalSettings();
|
|
378
|
-
return /* @__PURE__ */ jsx(
|
|
379
|
-
IconButton,
|
|
380
|
-
{
|
|
381
|
-
className: classes.actionSettings,
|
|
382
|
-
dictionaryTooltipId: "data_grid.tooltip_settings",
|
|
383
|
-
onClick: modalSettings,
|
|
384
|
-
"aria-label": "settings",
|
|
385
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`
|
|
386
|
-
}
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
function RowsCount() {
|
|
390
|
-
const { rowsCount, classes } = useDataGrid();
|
|
391
|
-
const { getLabel } = useModuleDictionary();
|
|
392
|
-
const isSkeleton = useModuleSkeleton();
|
|
393
|
-
return /* @__PURE__ */ jsx("div", { className: classes.rowsCount, children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
394
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountLabel, children: getLabel("data_grid.rows") }),
|
|
395
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountValue, children: rowsCount })
|
|
396
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
397
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountLabel, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "40px", height: "16px" }) }),
|
|
398
|
-
/* @__PURE__ */ jsx("div", { className: classes.rowsCountValue, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "20px", height: "16px" }) })
|
|
399
|
-
] }) });
|
|
400
|
-
}
|
|
401
|
-
function Density() {
|
|
402
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
403
|
-
const { rowHeights, currentRowHeightVariant, setRowHeightVariant, classes } = useDataGrid();
|
|
404
|
-
const { getLabel } = useModuleDictionary();
|
|
405
|
-
const menuActions = useMemo(() => {
|
|
406
|
-
if (typeof rowHeights === "number") {
|
|
407
|
-
return [];
|
|
408
|
-
}
|
|
409
|
-
return [
|
|
410
|
-
{
|
|
411
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`,
|
|
412
|
-
onClick: () => setRowHeightVariant("compact"),
|
|
413
|
-
disabled: currentRowHeightVariant === "compact",
|
|
414
|
-
dictionaryField: "data_grid.density_compact"
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`,
|
|
418
|
-
onClick: () => setRowHeightVariant("standard"),
|
|
419
|
-
disabled: currentRowHeightVariant === "standard",
|
|
420
|
-
dictionaryField: "data_grid.density_standard"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`,
|
|
424
|
-
onClick: () => setRowHeightVariant("confortable"),
|
|
425
|
-
disabled: currentRowHeightVariant === "confortable",
|
|
426
|
-
dictionaryField: "data_grid.density_confortable"
|
|
427
|
-
}
|
|
428
|
-
];
|
|
429
|
-
}, [
|
|
430
|
-
rowHeights,
|
|
431
|
-
currentRowHeightVariant,
|
|
432
|
-
setRowHeightVariant,
|
|
433
|
-
host_static_assets,
|
|
434
|
-
environment_assets
|
|
435
|
-
]);
|
|
436
|
-
const theme = useTheme();
|
|
437
|
-
const currenViewIcon = useMemo(() => {
|
|
438
|
-
if (currentRowHeightVariant === "compact") {
|
|
439
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`;
|
|
440
|
-
}
|
|
441
|
-
if (currentRowHeightVariant === "standard") {
|
|
442
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`;
|
|
443
|
-
}
|
|
444
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`;
|
|
445
|
-
}, [currentRowHeightVariant, host_static_assets, environment_assets]);
|
|
446
|
-
if (menuActions.length === 0) {
|
|
447
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
448
|
-
}
|
|
449
|
-
return /* @__PURE__ */ jsx(
|
|
450
|
-
MenuActions,
|
|
451
|
-
{
|
|
452
|
-
arrowType: "right-top",
|
|
453
|
-
className: classes.actionDensityPopover,
|
|
454
|
-
menuActionSx: theme.components?.M4LDataGridDensityPopover?.styleOverrides,
|
|
455
|
-
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
456
|
-
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
457
|
-
menuActions,
|
|
458
|
-
urlIcon: currenViewIcon,
|
|
459
|
-
toolTip: getLabel("data_grid.tooltip_density")
|
|
460
|
-
}
|
|
461
|
-
);
|
|
462
|
-
}
|
|
463
|
-
const MobileMenuActions = () => {
|
|
464
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
465
|
-
const { currentRowHeightVariant, setRowHeightVariant } = useDataGrid();
|
|
466
|
-
const { activeFilters, setActiveFilters } = useFilters();
|
|
467
|
-
const modalSettings = useModalSettings();
|
|
468
|
-
const toggleIcon = () => {
|
|
469
|
-
setActiveFilters(!activeFilters);
|
|
470
|
-
};
|
|
471
|
-
const menuActions = [
|
|
472
|
-
{
|
|
473
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`,
|
|
474
|
-
onClick: () => setRowHeightVariant("compact"),
|
|
475
|
-
disabled: currentRowHeightVariant === "compact",
|
|
476
|
-
dictionaryId: "data_grid.density_compact"
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`,
|
|
480
|
-
onClick: () => setRowHeightVariant("standard"),
|
|
481
|
-
disabled: currentRowHeightVariant === "standard",
|
|
482
|
-
dictionaryId: "data_grid.density_standard"
|
|
483
|
-
},
|
|
484
|
-
{
|
|
485
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`,
|
|
486
|
-
onClick: () => setRowHeightVariant("confortable"),
|
|
487
|
-
disabled: currentRowHeightVariant === "confortable",
|
|
488
|
-
dictionaryId: "data_grid.density_confortable"
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/filter.svg`,
|
|
492
|
-
onClick: () => toggleIcon(),
|
|
493
|
-
dictionaryId: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show"
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`,
|
|
497
|
-
onClick: () => modalSettings(),
|
|
498
|
-
dictionaryId: "data_grid.tooltip_settings"
|
|
499
|
-
}
|
|
500
|
-
];
|
|
501
|
-
return /* @__PURE__ */ jsx(
|
|
502
|
-
MenuActions,
|
|
503
|
-
{
|
|
504
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/menu.svg`,
|
|
505
|
-
arrowType: "no-arrow",
|
|
506
|
-
marginTop: "12px",
|
|
507
|
-
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
508
|
-
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
509
|
-
menuActions
|
|
510
|
-
}
|
|
511
|
-
);
|
|
512
|
-
};
|
|
513
|
-
function Actions(props) {
|
|
514
|
-
const isXs = useResponsiveContainerStore((state) => state.isXs, shallow);
|
|
515
|
-
const { rowHeights, classes } = useDataGrid();
|
|
516
|
-
const isSkeleton = useModuleSkeleton();
|
|
517
|
-
const { getLabel } = useModuleDictionary();
|
|
518
|
-
const {
|
|
519
|
-
withRowsCount = true,
|
|
520
|
-
withPager = true,
|
|
521
|
-
pagerOptions,
|
|
522
|
-
withSettings = true,
|
|
523
|
-
settingsProps,
|
|
524
|
-
withLocalFilters
|
|
525
|
-
} = props;
|
|
526
|
-
return /* @__PURE__ */ jsxs("div", { className: classes.actions, children: [
|
|
527
|
-
withRowsCount && !isXs && /* @__PURE__ */ jsx(RowsCount, {}),
|
|
528
|
-
withPager && pagerOptions && /* @__PURE__ */ jsx(
|
|
529
|
-
Pager,
|
|
530
|
-
{
|
|
531
|
-
...pagerOptions,
|
|
532
|
-
totalRecords: pagerOptions.totalRecords,
|
|
533
|
-
isSkeleton,
|
|
534
|
-
isXs,
|
|
535
|
-
labelRows: getLabel(dictionary.LABEL_ROWS_PER_PAGE),
|
|
536
|
-
labelOf: getLabel(dictionary.LABEL_OF)
|
|
537
|
-
}
|
|
538
|
-
),
|
|
539
|
-
isXs ? /* @__PURE__ */ jsx(MobileMenuActions, {}) : /* @__PURE__ */ jsxs("div", { className: classes.actionsConfigContainer, children: [
|
|
540
|
-
typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}),
|
|
541
|
-
withLocalFilters && /* @__PURE__ */ jsx(Filter, {}),
|
|
542
|
-
withSettings && /* @__PURE__ */ jsx(Settings, { ...settingsProps })
|
|
543
|
-
] })
|
|
544
|
-
] });
|
|
545
|
-
}
|
|
546
|
-
export {
|
|
547
|
-
ActionsColumn as A,
|
|
548
|
-
Actions as a
|
|
549
|
-
};
|
|
@@ -1,80 +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
|
-
/* 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
|
-
}));
|
|
26
|
-
function autoFocusAndSelect(input) {
|
|
27
|
-
input?.focus();
|
|
28
|
-
input?.select();
|
|
29
|
-
}
|
|
30
|
-
function TextEditor({
|
|
31
|
-
row,
|
|
32
|
-
column,
|
|
33
|
-
onRowChange,
|
|
34
|
-
onClose
|
|
35
|
-
}) {
|
|
36
|
-
return /* @__PURE__ */ jsx(
|
|
37
|
-
Input,
|
|
38
|
-
{
|
|
39
|
-
className: "rdg-text-editor",
|
|
40
|
-
ref: autoFocusAndSelect,
|
|
41
|
-
value: row[column.key],
|
|
42
|
-
onChange: (event) => onRowChange({ ...row, [column.key]: event.target.value }),
|
|
43
|
-
onBlur: () => onClose(true)
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
function NumberEditor({
|
|
48
|
-
row,
|
|
49
|
-
column,
|
|
50
|
-
onRowChange,
|
|
51
|
-
onClose
|
|
52
|
-
}) {
|
|
53
|
-
const handleKeyDown = (event) => {
|
|
54
|
-
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
55
|
-
onClose(true);
|
|
56
|
-
}
|
|
57
|
-
if (event.key === "Enter") {
|
|
58
|
-
onClose(true);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
62
|
-
Input,
|
|
63
|
-
{
|
|
64
|
-
className: "rdg-text-editor",
|
|
65
|
-
ref: autoFocusAndSelect,
|
|
66
|
-
type: "number",
|
|
67
|
-
value: row[column.key],
|
|
68
|
-
onKeyDown: handleKeyDown,
|
|
69
|
-
onChange: (event) => onRowChange({
|
|
70
|
-
...row,
|
|
71
|
-
[column.key]: event.target.value !== "" ? Number(event.target.value) : ""
|
|
72
|
-
}),
|
|
73
|
-
onBlur: () => onClose(true)
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
NumberEditor as N,
|
|
79
|
-
TextEditor as T
|
|
80
|
-
};
|