@m4l/components 0.1.71 → 0.1.73
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/CommonActions/components/ActionCancel/{index.ff90f2c0.js → index.583dd385.js} +2 -2
- package/components/CommonActions/components/ActionFormCancel/{index.392a17c0.js → index.673cb6bc.js} +19 -18
- package/components/CommonActions/components/ActionFormIntro/{index.f88d8849.js → index.ca18700c.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index.e31ab7e9.js → index.41d66b77.js} +3 -3
- package/components/CommonActions/components/Actions/{index.6b7d480a.js → index.665b1d56.js} +18 -17
- package/components/DataGrid/{index.77ae9b4c.js → index.860f4d1c.js} +20 -19
- package/components/DynamicFilter/{index.b2ba5167.js → index.09d83f9d.js} +31 -30
- package/components/HelperText/{index.d7b1b21a.js → index.581ddb8f.js} +8 -8
- package/components/Icon/{index.6f2a5618.js → index.4eeb3de9.js} +2 -2
- package/components/Image/{index.1e3b7ff6.js → index.52c84d9f.js} +1 -1
- package/components/LanguagePopover/{index.310e9a3a.js → index.f7ee5a9c.js} +9 -9
- package/components/ModalDialog/{index.598f9a86.js → index.1e6150f6.js} +7 -7
- package/components/NavLink/{index.ac3778af.js → index.5f3e2493.js} +9 -9
- package/components/NoItemSelected/{index.3809e3d1.js → index.b51f007c.js} +1 -1
- package/components/ObjectLogs/{index.949d3595.js → index.26644722.js} +16 -15
- package/components/PaperForm/{index.cf8af08b.js → index.be12afa3.js} +1 -1
- package/components/Period/{index.53ea0562.js → index.f24d7084.js} +18 -17
- package/components/Resizeable/{index.ff4ce7a4.js → index.949b18ff.js} +1 -1
- package/components/SideBar/{index.4daafbab.js → index.e716e9e0.js} +6 -6
- package/components/areas/components/AreasAdmin/index.b26ee1b2.js +289 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +1 -1
- package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/classes/types.d.ts +14 -2
- package/components/areas/components/{index.31f39977.js → AreasViewer/index.d33b4a7d.js} +204 -305
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +3 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Toasties/index.d.ts +6 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Toasties/subcomponents/Toasty/index.d.ts +7 -0
- package/components/areas/components/index.b2ee7610.js +14 -0
- package/components/areas/constants.66529246.js +6 -0
- package/components/areas/contexts/AreasContext/helper.d.ts +6 -4
- package/components/areas/contexts/AreasContext/{index.e14d6799.js → index.9c35425b.js} +132 -21
- package/components/areas/contexts/AreasContext/types.d.ts +5 -3
- package/components/areas/contexts/DynamicMFParmsContext/store.d.ts +1 -1
- package/components/areas/contexts/DynamicMFParmsContext/types.d.ts +1 -1
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +3 -10
- package/components/areas/contexts/index.d.ts +2 -1
- package/components/areas/contexts/{index.5ba05323.js → index.d2f1c19a.js} +1 -1
- package/components/areas/dictionary.e72db809.js +22 -0
- package/components/areas/hooks/index.0184c6f7.js +4 -0
- package/components/areas/hooks/{useArea/index.c135e0cf.js → useAreas/index.6540b5ab.js} +1 -1
- package/components/areas/hooks/{index.ae8d8631.js → useWindowToolsMF/index.b7afaf88.js} +1 -3
- package/components/areas/icons.3ec589d3.js +19 -0
- package/components/areas/icons.d.ts +2 -0
- package/components/areas/index.8ed127ca.js +16 -0
- package/components/areas/index.d.ts +1 -0
- package/components/areas/types.d.ts +28 -3
- package/components/formatters/BooleanFormatter/{index.99c7fe49.js → index.87ca7bb3.js} +1 -1
- package/components/formatters/{index.1a92006b.js → index.83c50bdb.js} +2 -2
- package/components/hook-form/RHFAutocomplete/{index.c4ba070a.js → index.743b5558.js} +10 -10
- package/components/hook-form/RHFAutocompleteAsync/{index.a63f3704.js → index.5be9ea91.js} +2 -2
- package/components/hook-form/RHFCheckbox/{index.9055f88d.js → index.77758da5.js} +3 -3
- package/components/hook-form/RHFDateTime/{index.2cb94a66.js → index.d554d467.js} +9 -9
- package/components/hook-form/RHFPeriod/{index.14dcf762.js → index.02253c2d.js} +2 -2
- package/components/hook-form/RHFTextField/{index.7ce2b16e.js → index.5066b599.js} +6 -6
- package/components/hook-form/RHFUpload/{index.c57a43f8.js → index.6ecf3230.js} +1 -1
- package/components/modal/{WindowBase.32d35d71.js → WindowBase.e59ef8a1.js} +10 -10
- package/components/modal/{WindowConfirm.70bcbb69.js → WindowConfirm.a9e351fa.js} +16 -15
- package/components/modal/index.2e83c400.js +36 -0
- package/components/mui_extended/Accordion/{index.44e96bb8.js → index.9c36b7a5.js} +2 -2
- package/components/mui_extended/Button/{index.ec6525e0.js → index.1cb53ba2.js} +3 -3
- package/components/mui_extended/IconButton/{index.7aab3e04.js → index.89428485.js} +1 -1
- package/components/mui_extended/MenuActions/{index.bff47c06.js → index.d426f50b.js} +2 -2
- package/components/mui_extended/Pager/{index.907d5801.js → index.2c081f2c.js} +1 -1
- package/components/mui_extended/Typography/{index.d5e0f69f.js → index.1ff05abe.js} +1 -1
- package/components/mui_extended/{index.1f766f93.js → index.bc3da862.js} +8 -8
- package/contexts/ModalContext/{index.fca184e2.js → index.ca4ffa64.js} +1 -1
- package/hooks/useModal/{index.9b244379.js → index.97628a64.js} +1 -1
- package/index.js +84 -81
- package/package.json +4 -4
- package/{react-draggable.29f78f6d.js → react-draggable.64706389.js} +1 -1
- package/{react-resizable.baf54eb2.js → react-resizable.67e38975.js} +2 -2
- package/utils/{index.ee16888d.js → index.94b9dc32.js} +1 -1
- package/{vendor.619c3533.js → vendor.fcb620ee.js} +45 -44
- package/components/areas/index.bd29b1db.js +0 -56
- package/components/modal/index.ef3aa9ac.js +0 -35
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
2
2
|
import { useEnvironment } from "@m4l/core";
|
|
3
3
|
import { createContext, useContext, useState } from "react";
|
|
4
|
-
import { T as TEST_PROP_ID } from "../../vendor.
|
|
5
|
-
import { I as Image } from "../Image/index.
|
|
6
|
-
import { I as IconButton } from "../mui_extended/IconButton/index.
|
|
4
|
+
import { T as TEST_PROP_ID } from "../../vendor.fcb620ee.js";
|
|
5
|
+
import { I as Image } from "../Image/index.52c84d9f.js";
|
|
6
|
+
import { I as IconButton } from "../mui_extended/IconButton/index.89428485.js";
|
|
7
7
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
8
8
|
import { styled as styled$1, generateUtilityClasses, ListItemText, ListItemButton, Collapse, useTheme, Skeleton, Drawer as Drawer$1 } from "@mui/material";
|
|
9
|
-
import { I as Icon, A as ArrowIcon } from "../Icon/index.
|
|
10
|
-
import { T as Typography } from "../mui_extended/Typography/index.
|
|
9
|
+
import { I as Icon, A as ArrowIcon } from "../Icon/index.4eeb3de9.js";
|
|
10
|
+
import { T as Typography } from "../mui_extended/Typography/index.1ff05abe.js";
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import { P as Popover } from "../mui_extended/Popover/index.9f35d0eb.js";
|
|
13
13
|
import { S as ScrollBar } from "../ScrollBar/index.bbe48f4d.js";
|
|
14
14
|
import { styled, alpha } from "@mui/material/styles";
|
|
15
15
|
import { unstable_composeClasses } from "@mui/base";
|
|
16
|
-
import { g as getComponentUtilityClass } from "../../utils/index.
|
|
16
|
+
import { g as getComponentUtilityClass } from "../../utils/index.94b9dc32.js";
|
|
17
17
|
const SideBarRoot = styled("div")(({
|
|
18
18
|
theme
|
|
19
19
|
}) => ({
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { I as IconButton } from "../../../mui_extended/IconButton/index.89428485.js";
|
|
2
|
+
import { u as useAreasStore } from "../../hooks/useAreas/index.6540b5ab.js";
|
|
3
|
+
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
|
+
import { useState, useRef, useMemo } from "react";
|
|
5
|
+
import * as Yup from "yup";
|
|
6
|
+
import { generateUtilityClasses } from "@mui/material";
|
|
7
|
+
import { I as Icon } from "../../../Icon/index.4eeb3de9.js";
|
|
8
|
+
import clsx from "clsx";
|
|
9
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
10
|
+
import "../../../mui_extended/Accordion/index.9c36b7a5.js";
|
|
11
|
+
import "../../../mui_extended/Avatar/index.fe06afd7.js";
|
|
12
|
+
import "react-router-dom";
|
|
13
|
+
import "@mui/material/Button";
|
|
14
|
+
import "../../../mui_extended/Button/index.1cb53ba2.js";
|
|
15
|
+
import "../../../Image/index.52c84d9f.js";
|
|
16
|
+
import "@mui/lab";
|
|
17
|
+
import { T as Typography } from "../../../mui_extended/Typography/index.1ff05abe.js";
|
|
18
|
+
import { P as Popover } from "../../../mui_extended/Popover/index.9f35d0eb.js";
|
|
19
|
+
import "../../../mui_extended/MenuActions/index.d426f50b.js";
|
|
20
|
+
import "../../../mui_extended/Pager/index.2c081f2c.js";
|
|
21
|
+
import "../../../mui_extended/Tab/index.e0653a0a.js";
|
|
22
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
23
|
+
import { g as getComponentUtilityClass } from "../../../../utils/index.94b9dc32.js";
|
|
24
|
+
import { A as AREAS_ADMIN_CLASS_NAME } from "../../constants.66529246.js";
|
|
25
|
+
import { I as ICONS } from "../../icons.3ec589d3.js";
|
|
26
|
+
import "../../contexts/DynamicMFParmsContext/index.1607c78e.js";
|
|
27
|
+
import "../../../../contexts/ModalContext/index.ca4ffa64.js";
|
|
28
|
+
import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index.a7511399.js";
|
|
29
|
+
import "react-hook-form";
|
|
30
|
+
import "../../../hook-form/RHFAutocomplete/index.743b5558.js";
|
|
31
|
+
import "../../../HelperText/index.581ddb8f.js";
|
|
32
|
+
import "lodash/debounce";
|
|
33
|
+
import "../../../hook-form/RHFAutocompleteAsync/index.5be9ea91.js";
|
|
34
|
+
import "../../../hook-form/RHFCheckbox/index.77758da5.js";
|
|
35
|
+
import "@mui/x-date-pickers";
|
|
36
|
+
import "../../../hook-form/RHFDateTime/index.d554d467.js";
|
|
37
|
+
import "@m4l/graphics";
|
|
38
|
+
import { R as RHFTextField } from "../../../hook-form/RHFTextField/index.5066b599.js";
|
|
39
|
+
import "../../../hook-form/RHFPeriod/index.02253c2d.js";
|
|
40
|
+
import "../../../Period/index.f24d7084.js";
|
|
41
|
+
import { A as Actions } from "../../../CommonActions/components/Actions/index.665b1d56.js";
|
|
42
|
+
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index.583dd385.js";
|
|
43
|
+
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index.41d66b77.js";
|
|
44
|
+
import "../../../../react-draggable.64706389.js";
|
|
45
|
+
import "../../../ModalDialog/index.1e6150f6.js";
|
|
46
|
+
import "../../../Resizeable/index.949b18ff.js";
|
|
47
|
+
import "../../../modal/WindowConfirm.a9e351fa.js";
|
|
48
|
+
import "../../../modal/WindowBase.e59ef8a1.js";
|
|
49
|
+
import { shallow } from "zustand/shallow";
|
|
50
|
+
import { styled } from "@mui/material/styles";
|
|
51
|
+
import { S as ScrollBar } from "../../../ScrollBar/index.bbe48f4d.js";
|
|
52
|
+
import "../AreasViewer/index.d33b4a7d.js";
|
|
53
|
+
import "../../contexts/AreasContext/index.9c35425b.js";
|
|
54
|
+
import "../../contexts/WindowToolsMFContext/index.8f3e2a04.js";
|
|
55
|
+
import "zustand";
|
|
56
|
+
import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary.e72db809.js";
|
|
57
|
+
import "lodash/isString";
|
|
58
|
+
import "react-dropzone";
|
|
59
|
+
import "../../../hook-form/RHFUpload/index.6ecf3230.js";
|
|
60
|
+
const areasAdminClasses = generateUtilityClasses(AREAS_ADMIN_CLASS_NAME, [
|
|
61
|
+
"root",
|
|
62
|
+
"areaChipRoot",
|
|
63
|
+
"areaChipTitle",
|
|
64
|
+
"areaChipDeleteButton",
|
|
65
|
+
"areasAddButton",
|
|
66
|
+
"areaContainerChips",
|
|
67
|
+
"areaIconLayer",
|
|
68
|
+
"areaChipEditButton",
|
|
69
|
+
"selected",
|
|
70
|
+
"isMobile",
|
|
71
|
+
"disabled"
|
|
72
|
+
], AREAS_ADMIN_CLASS_NAME);
|
|
73
|
+
const useAreasAdminUtilityClasses = (ownerState) => {
|
|
74
|
+
const slots = {
|
|
75
|
+
root: ["root", ownerState.status, ownerState.isMobile && "isMobile", ownerState.isSkeleton && "isSkeleton"],
|
|
76
|
+
areaChipRoot: ["areaChipRoot"],
|
|
77
|
+
areaIconLayer: ["areaIconLayer"],
|
|
78
|
+
areaContainerChips: ["areaContainerChips"],
|
|
79
|
+
areaChipTitle: ["areaChipTitle"],
|
|
80
|
+
areaChipDeleteButton: ["areaChipDeleteButton"],
|
|
81
|
+
areaChipEditButton: ["areaChipEditButton"],
|
|
82
|
+
areasAddButton: ["areasAddButton"]
|
|
83
|
+
};
|
|
84
|
+
return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
|
|
85
|
+
};
|
|
86
|
+
styled("div")(() => ({
|
|
87
|
+
display: "flex",
|
|
88
|
+
flexDirection: "row",
|
|
89
|
+
border: "1px solid gray",
|
|
90
|
+
"&.active": {
|
|
91
|
+
border: "1px solid red"
|
|
92
|
+
}
|
|
93
|
+
}));
|
|
94
|
+
styled("div")(({
|
|
95
|
+
theme
|
|
96
|
+
}) => ({
|
|
97
|
+
height: "100%",
|
|
98
|
+
width: theme.spacing(1),
|
|
99
|
+
backgroundColor: theme.palette.background.default,
|
|
100
|
+
"&.active": {
|
|
101
|
+
backgroundColor: theme.palette.primary.main
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
104
|
+
const EditAreaHeader = styled("div")(({
|
|
105
|
+
theme
|
|
106
|
+
}) => ({
|
|
107
|
+
display: "flex",
|
|
108
|
+
width: "100%",
|
|
109
|
+
height: "25px",
|
|
110
|
+
borderBottom: "1px solid",
|
|
111
|
+
borderColor: theme.palette.state.default,
|
|
112
|
+
justifyContent: "space-between",
|
|
113
|
+
alignItems: "center"
|
|
114
|
+
}));
|
|
115
|
+
const AreaChip = (props) => {
|
|
116
|
+
const {
|
|
117
|
+
areaId,
|
|
118
|
+
selected,
|
|
119
|
+
areaName,
|
|
120
|
+
disabled
|
|
121
|
+
} = props;
|
|
122
|
+
const {
|
|
123
|
+
host_static_assets,
|
|
124
|
+
environment_assets
|
|
125
|
+
} = useEnvironment();
|
|
126
|
+
const {
|
|
127
|
+
deleteArea,
|
|
128
|
+
selectArea,
|
|
129
|
+
editArea
|
|
130
|
+
} = useAreasStore((state) => state.areasActions);
|
|
131
|
+
const [open, setOpen] = useState(false);
|
|
132
|
+
const {
|
|
133
|
+
getLabel
|
|
134
|
+
} = useModuleDictionary();
|
|
135
|
+
const anchorRef = useRef(null);
|
|
136
|
+
const onClickDeleteArea = (e) => {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
deleteArea(areaId);
|
|
139
|
+
};
|
|
140
|
+
const onSubmit = (data) => {
|
|
141
|
+
console.log("data areachip", data);
|
|
142
|
+
editArea(areaId, data.inputEditArea);
|
|
143
|
+
setOpen(false);
|
|
144
|
+
};
|
|
145
|
+
const handlerOpenPopover = () => {
|
|
146
|
+
setOpen(true);
|
|
147
|
+
};
|
|
148
|
+
const initialValues = {
|
|
149
|
+
inputEditArea: areaName
|
|
150
|
+
};
|
|
151
|
+
const validationSchema = useMemo(() => Yup.object().shape({
|
|
152
|
+
inputEditArea: Yup.string().required(getLabel(getAreasDictionary("validation_edit_area")))
|
|
153
|
+
}), [getLabel]);
|
|
154
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
155
|
+
role: "presentation",
|
|
156
|
+
className: clsx(areasAdminClasses.areaChipRoot, selected ? areasAdminClasses.selected : null, disabled ? areasAdminClasses.disabled : null),
|
|
157
|
+
onClick: () => {
|
|
158
|
+
selectArea(areaId);
|
|
159
|
+
},
|
|
160
|
+
ref: anchorRef,
|
|
161
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
162
|
+
className: areasAdminClasses.areaChipTitle,
|
|
163
|
+
children: areaName
|
|
164
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
165
|
+
style: {
|
|
166
|
+
display: "flex"
|
|
167
|
+
},
|
|
168
|
+
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
169
|
+
className: areasAdminClasses.areaChipEditButton,
|
|
170
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
|
|
171
|
+
size: "extraSmall",
|
|
172
|
+
onClick: handlerOpenPopover
|
|
173
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
174
|
+
className: areasAdminClasses.areaChipDeleteButton,
|
|
175
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
|
|
176
|
+
size: "extraSmall",
|
|
177
|
+
onClick: onClickDeleteArea
|
|
178
|
+
})]
|
|
179
|
+
}), /* @__PURE__ */ jsx(Popover, {
|
|
180
|
+
arrowType: "top-center",
|
|
181
|
+
open,
|
|
182
|
+
anchorEl: anchorRef.current,
|
|
183
|
+
anchorOrigin: {
|
|
184
|
+
vertical: "bottom",
|
|
185
|
+
horizontal: "center"
|
|
186
|
+
},
|
|
187
|
+
transformOrigin: {
|
|
188
|
+
vertical: "top",
|
|
189
|
+
horizontal: "center"
|
|
190
|
+
},
|
|
191
|
+
onClose: () => setOpen(false),
|
|
192
|
+
sx: {
|
|
193
|
+
mt: "10px"
|
|
194
|
+
},
|
|
195
|
+
children: /* @__PURE__ */ jsxs(RHFormProvider, {
|
|
196
|
+
onSubmit,
|
|
197
|
+
values: initialValues,
|
|
198
|
+
validationSchema,
|
|
199
|
+
children: [/* @__PURE__ */ jsxs(EditAreaHeader, {
|
|
200
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
201
|
+
children: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area))
|
|
202
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
203
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
|
|
204
|
+
size: "small",
|
|
205
|
+
onClick: () => setOpen(false)
|
|
206
|
+
})]
|
|
207
|
+
}), /* @__PURE__ */ jsx(RHFTextField, {
|
|
208
|
+
name: "inputEditArea",
|
|
209
|
+
skeletonWidth: "70%",
|
|
210
|
+
skeletonHeight: "18px",
|
|
211
|
+
sx: {
|
|
212
|
+
mt: "20px"
|
|
213
|
+
}
|
|
214
|
+
}), /* @__PURE__ */ jsxs(Actions, {
|
|
215
|
+
children: [/* @__PURE__ */ jsx(ActionCancel, {
|
|
216
|
+
onClick: () => setOpen(false),
|
|
217
|
+
variant: "outlined",
|
|
218
|
+
skeletonWidth: "100%"
|
|
219
|
+
}), /* @__PURE__ */ jsx(ActionIntro, {
|
|
220
|
+
skeletonWidth: "100%"
|
|
221
|
+
})]
|
|
222
|
+
})]
|
|
223
|
+
})
|
|
224
|
+
})]
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
AreaChip.displayName = "AreaButtons";
|
|
228
|
+
const AreasAdminRoot = styled("div")`
|
|
229
|
+
display: flex;
|
|
230
|
+
position: relative;
|
|
231
|
+
|
|
232
|
+
//areaRoot
|
|
233
|
+
& .${areasAdminClasses.areaChipRoot} {
|
|
234
|
+
display: flex;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
${(props) => props.theme.components?.M4LAreasAdmin?.styleOverrides}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
`;
|
|
242
|
+
function AreasAdmin() {
|
|
243
|
+
const areas = useAreasStore((state) => state.areas, shallow);
|
|
244
|
+
const currentArea = useAreasStore((state) => state.currentAreaId, shallow);
|
|
245
|
+
const status = useAreasStore((state) => state.ownerState.status);
|
|
246
|
+
const classesRoot = useAreasStore((state) => state.adminClasses.root);
|
|
247
|
+
const areasLength = useAreasStore((state) => state.areas.length);
|
|
248
|
+
const {
|
|
249
|
+
addArea
|
|
250
|
+
} = useAreasStore((state) => state.areasActions, shallow);
|
|
251
|
+
const {
|
|
252
|
+
host_static_assets,
|
|
253
|
+
environment_assets
|
|
254
|
+
} = useEnvironment();
|
|
255
|
+
console.log("Render AreasAdmin", areas);
|
|
256
|
+
if (status !== "loaded") {
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
return /* @__PURE__ */ jsxs(AreasAdminRoot, {
|
|
260
|
+
className: classesRoot,
|
|
261
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
262
|
+
className: areasAdminClasses.areaIconLayer,
|
|
263
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
264
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`
|
|
265
|
+
})
|
|
266
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
267
|
+
className: areasAdminClasses.areaContainerChips,
|
|
268
|
+
children: /* @__PURE__ */ jsx(ScrollBar, {
|
|
269
|
+
children: /* @__PURE__ */ jsx(Fragment, {
|
|
270
|
+
children: areas.map((area) => /* @__PURE__ */ jsx(AreaChip, {
|
|
271
|
+
areaId: area.id,
|
|
272
|
+
selected: area.id === currentArea,
|
|
273
|
+
areaName: area.name,
|
|
274
|
+
disabled: areasLength === 1
|
|
275
|
+
}, area.id))
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
279
|
+
className: areasAdminClasses.areasAddButton,
|
|
280
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
|
|
281
|
+
size: "small",
|
|
282
|
+
onClick: addArea
|
|
283
|
+
})]
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
export {
|
|
287
|
+
AreasAdmin as A,
|
|
288
|
+
useAreasAdminUtilityClasses as u
|
|
289
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AreasViewerClasses } from './types';
|
|
2
2
|
import { OwnerState } from '../../../contexts/AreasContext/types';
|
|
3
3
|
export declare const areasViewerClasses: AreasViewerClasses;
|
|
4
|
-
export declare const useAreasViewerUtilityClasses: (ownerState: OwnerState) => Record<"root" | "areaRoot" | "areaGridLayoutPanelContainer" | "areaGridLayout" | "areaGridLayoutPopupsContainer" | "windowRoot" | "windowRootContainer" | "windowHeader" | "windowHeaderTitle" | "windowHeaderMainActions" | "windowContent" | "windowPopupRoot" | "windowModalRoot" | "selectedWindow" | "panelWindowsRoot" | "panelWindowsButtonContainer", string>;
|
|
4
|
+
export declare const useAreasViewerUtilityClasses: (ownerState: OwnerState) => Record<"root" | "areaRoot" | "areaGridLayoutPanelContainer" | "areaGridLayout" | "areaGridLayoutPopupsContainer" | "windowRoot" | "windowRootContainer" | "windowHeader" | "windowHeaderTitle" | "windowHeaderMainActions" | "windowContent" | "windowPopupRoot" | "windowModalRoot" | "selectedWindow" | "windowToastiesContainer" | "windowToastyMeesageButtonsContainer" | "windowToastyMessage" | "windowToastyButtonsContainer" | "windowToastyPin" | "windowToastyClose" | "panelWindowsRoot" | "panelWindowsButtonContainer" | "windowToastyContainer", string>;
|
|
5
5
|
export declare type ViwerClasses = ReturnType<typeof useAreasViewerUtilityClasses>;
|
|
@@ -4,8 +4,6 @@ export interface AreasViewerClasses {
|
|
|
4
4
|
areaGridLayoutPanelContainer: string;
|
|
5
5
|
areaGridLayout: string;
|
|
6
6
|
areaGridLayoutPopupsContainer: string;
|
|
7
|
-
panelWindowsRoot: string;
|
|
8
|
-
panelWindowsButtonContainer: string;
|
|
9
7
|
windowRoot: string;
|
|
10
8
|
windowHeader: string;
|
|
11
9
|
windowHeaderTitle: string;
|
|
@@ -14,9 +12,23 @@ export interface AreasViewerClasses {
|
|
|
14
12
|
windowRootContainer: string;
|
|
15
13
|
windowPopupRoot: string;
|
|
16
14
|
windowModalRoot: string;
|
|
15
|
+
windowToastiesContainer: string;
|
|
16
|
+
windowToastyContainer: string;
|
|
17
|
+
windowToastyMeesageButtonsContainer: string;
|
|
18
|
+
windowToastyMessage: string;
|
|
19
|
+
windowToastyButtonsContainer: string;
|
|
20
|
+
windowToastyPin: string;
|
|
21
|
+
windowToastyClose: string;
|
|
22
|
+
panelWindowsRoot: string;
|
|
23
|
+
panelWindowsButtonContainer: string;
|
|
17
24
|
selected: string;
|
|
18
25
|
selectedWindow: string;
|
|
19
26
|
isMobile: string;
|
|
20
27
|
loading: string;
|
|
28
|
+
pinIn: string;
|
|
29
|
+
success: string;
|
|
30
|
+
info: string;
|
|
31
|
+
warning: string;
|
|
32
|
+
error: string;
|
|
21
33
|
}
|
|
22
34
|
export declare type AreasViewerClassesKey = keyof AreasViewerClasses;
|