@m4l/components 0.0.33 → 0.0.36

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.
@@ -59,7 +59,7 @@ const CompanyLogo = (props) => {
59
59
  const width = size === "small" ? "50px" : "380px";
60
60
  const {
61
61
  host_static_assets,
62
- environment
62
+ environment_assets
63
63
  } = useEnvironment();
64
64
  const mdUp = useResponsive("up", "md");
65
65
  if (isSkeleton) {
@@ -72,7 +72,7 @@ const CompanyLogo = (props) => {
72
72
  });
73
73
  }
74
74
  return /* @__PURE__ */ jsx(Image, {
75
- src: `${host_static_assets}/${environment}/frontend/commons/assets/icons/${size === "small" ? "isotipo_m4l.svg" : "logotipo_m4l.svg"}`,
75
+ src: `${host_static_assets}/${environment_assets}/frontend/commons/assets/icons/${size === "small" ? "isotipo_m4l.svg" : "logotipo_m4l.svg"}`,
76
76
  effect: "opacity",
77
77
  width,
78
78
  height,
@@ -968,7 +968,7 @@ function Filter() {
968
968
  } = useFilters();
969
969
  const {
970
970
  host_static_assets,
971
- environment
971
+ environment_assets
972
972
  } = useEnvironment();
973
973
  const toggleIcon = () => {
974
974
  setActiveFilters(!activeFilters);
@@ -986,7 +986,7 @@ function Filter() {
986
986
  dictionaryTooltip: activeFilters ? "grid.filter_hide" : "grid.filter_show",
987
987
  onClick: toggleIcon,
988
988
  "aria-label": "filter",
989
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/filter.svg`
989
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/filter.svg`
990
990
  });
991
991
  }
992
992
  const WrapperColumnsConfig = styled("div")(({ theme }) => ({
@@ -1075,7 +1075,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
1075
1075
  const divRef = useRef(null);
1076
1076
  const {
1077
1077
  host_static_assets,
1078
- environment
1078
+ environment_assets
1079
1079
  } = useEnvironment();
1080
1080
  useImperativeHandle(ref, () => ({
1081
1081
  onClickIntro: handleIntro,
@@ -1258,40 +1258,40 @@ const ColumnsConfig = forwardRef((props, ref) => {
1258
1258
  onClick: handleMoveFirst,
1259
1259
  "aria-label": "move first place",
1260
1260
  disabled: rowSelectedIndex < 1,
1261
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/move_first_place.svg`
1261
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/move_first_place.svg`
1262
1262
  }), /* @__PURE__ */ jsx(IconButton, {
1263
1263
  dictionaryTooltip: "grid.settings_move_up",
1264
1264
  onClick: () => handleMoveUpDownd(-1),
1265
1265
  "aria-label": "move up place",
1266
1266
  disabled: rowSelectedIndex < 1,
1267
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/move_up_place.svg`
1267
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/move_up_place.svg`
1268
1268
  }), /* @__PURE__ */ jsx(IconButton, {
1269
1269
  dictionaryTooltip: "grid.settings_move_last",
1270
1270
  onClick: handleMoveLast,
1271
1271
  "aria-label": "move last place",
1272
1272
  disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
1273
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/move_last_place.svg`
1273
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/move_last_place.svg`
1274
1274
  }), /* @__PURE__ */ jsx(IconButton, {
1275
1275
  dictionaryTooltip: "grid.settings_move_down",
1276
1276
  onClick: () => handleMoveUpDownd(1),
1277
1277
  "aria-label": "move down place",
1278
1278
  disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
1279
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/move_down_place.svg`
1279
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/move_down_place.svg`
1280
1280
  }), /* @__PURE__ */ jsx(IconButton, {
1281
1281
  dictionaryTooltip: "grid.settings_visible_all",
1282
1282
  onClick: checkAll,
1283
1283
  "aria-label": "check visible all",
1284
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/check_all.svg`
1284
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/check_all.svg`
1285
1285
  }), /* @__PURE__ */ jsx(IconButton, {
1286
1286
  dictionaryTooltip: "grid.settings_no_visible_all",
1287
1287
  onClick: unCheckAll,
1288
1288
  "aria-label": "un check all",
1289
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/uncheck_all.svg`
1289
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/uncheck_all.svg`
1290
1290
  }), /* @__PURE__ */ jsx(IconButton, {
1291
1291
  dictionaryTooltip: "grid.settings_restore",
1292
1292
  onClick: restoreAll,
1293
1293
  "aria-label": "Restore columns",
1294
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/restore_columns.svg`
1294
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/restore_columns.svg`
1295
1295
  })]
1296
1296
  })]
1297
1297
  });
@@ -1319,7 +1319,7 @@ function Settings() {
1319
1319
  } = useModuleDictionary();
1320
1320
  const {
1321
1321
  host_static_assets,
1322
- environment
1322
+ environment_assets
1323
1323
  } = useEnvironment();
1324
1324
  const ref = useRef(null);
1325
1325
  const onCloseSettings = useCallback(() => {
@@ -1362,7 +1362,7 @@ function Settings() {
1362
1362
  dictionaryTooltip: "grid.settings_tooltip",
1363
1363
  onClick: onClickSettings,
1364
1364
  "aria-label": "settings",
1365
- src: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/configuration.svg`
1365
+ src: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/configuration.svg`
1366
1366
  });
1367
1367
  }
1368
1368
  const Container = styled("div")(() => ({
@@ -1429,7 +1429,7 @@ const SKTWrapperDensity = styled("div")(({ theme }) => ({
1429
1429
  function Density() {
1430
1430
  const {
1431
1431
  host_static_assets,
1432
- environment
1432
+ environment_assets
1433
1433
  } = useEnvironment();
1434
1434
  const {
1435
1435
  rowHeights,
@@ -1445,31 +1445,31 @@ function Density() {
1445
1445
  return [];
1446
1446
  }
1447
1447
  return [{
1448
- urlIcon: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/compact.svg`,
1448
+ urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/compact.svg`,
1449
1449
  onClick: () => setRowHeightVariant("compact"),
1450
1450
  disabled: currentRowHeightVariant === "compact",
1451
1451
  dictionaryField: "grid.density_compact"
1452
1452
  }, {
1453
- urlIcon: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/standard.svg`,
1453
+ urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/standard.svg`,
1454
1454
  onClick: () => setRowHeightVariant("standard"),
1455
1455
  disabled: currentRowHeightVariant === "standard",
1456
1456
  dictionaryField: "grid.density_standard"
1457
1457
  }, {
1458
- urlIcon: `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/confortable.svg`,
1458
+ urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/confortable.svg`,
1459
1459
  onClick: () => setRowHeightVariant("confortable"),
1460
1460
  disabled: currentRowHeightVariant === "confortable",
1461
1461
  dictionaryField: "grid.density_confortable"
1462
1462
  }];
1463
- }, [rowHeights, currentRowHeightVariant, setRowHeightVariant, host_static_assets, environment]);
1463
+ }, [rowHeights, currentRowHeightVariant, setRowHeightVariant, host_static_assets, environment_assets]);
1464
1464
  const currenViewIcon = useMemo(() => {
1465
1465
  if (currentRowHeightVariant === "compact") {
1466
- return `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/compact.svg`;
1466
+ return `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/compact.svg`;
1467
1467
  }
1468
1468
  if (currentRowHeightVariant === "standard") {
1469
- return `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/standard.svg`;
1469
+ return `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/standard.svg`;
1470
1470
  }
1471
- return `${host_static_assets}/${environment}/frontend/components/grid/assets/icons/confortable.svg`;
1472
- }, [currentRowHeightVariant, host_static_assets, environment]);
1471
+ return `${host_static_assets}/${environment_assets}/frontend/components/grid/assets/icons/confortable.svg`;
1472
+ }, [currentRowHeightVariant, host_static_assets, environment_assets]);
1473
1473
  if (menuActions.length === 0) {
1474
1474
  return /* @__PURE__ */ jsx(Fragment, {});
1475
1475
  }
@@ -1,2 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  export declare const WrapperApplyedFilters: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
3
+ export declare const ContainerApplyedFilters: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,7 +1,7 @@
1
1
  import { S as ScrollBar } from "../ScrollBar/index.js";
2
2
  import { styled } from "@mui/material/styles";
3
3
  import { useRef, useState, useMemo, useCallback, useEffect, createContext, useContext } from "react";
4
- import { useModuleDictionary, voidFunction, useHostTools, useEnvironment, useFlagsPresent } from "@m4l/core";
4
+ import { useModuleDictionary, useEnvironment, voidFunction, useHostTools, useFlagsPresent } from "@m4l/core";
5
5
  import * as Yup from "yup";
6
6
  import { useFormContext, useWatch } from "react-hook-form";
7
7
  import { F as FormProvider } from "../hook-form/FormProvider/index.js";
@@ -29,6 +29,12 @@ import { M as MenuPopover } from "../mui_extended/MenuPopover/index.js";
29
29
  import { useResponsiveDesktop } from "@m4l/graphics";
30
30
  const WrapperApplyedFilters = styled("div")(({
31
31
  theme
32
+ }) => ({
33
+ width: "100%",
34
+ marginLeft: theme.spacing(1.5)
35
+ }));
36
+ const ContainerApplyedFilters = styled("div")(({
37
+ theme
32
38
  }) => ({
33
39
  width: "100%",
34
40
  display: "flex",
@@ -276,6 +282,11 @@ function DateTimeFilter() {
276
282
  const {
277
283
  getLabel
278
284
  } = useModuleDictionary();
285
+ const {
286
+ dfnsFormat: {
287
+ datetime_format
288
+ }
289
+ } = useEnvironment();
279
290
  const {
280
291
  popupData: {
281
292
  filter,
@@ -310,10 +321,10 @@ function DateTimeFilter() {
310
321
  };
311
322
  if (data.valueOperator.id === "b") {
312
323
  newFilter.operand2 = data.valueOperand2.toISOString();
313
- newFilter.labelOperands = `${format(data.valueOperand1, "yyyy-MM-dd HH:mm:ss")} - ${format(data.valueOperand2, "yyyy-MM-dd HH:mm:ss")}`;
324
+ newFilter.labelOperands = `${format(data.valueOperand1, datetime_format)} - ${format(data.valueOperand2, datetime_format)}`;
314
325
  } else {
315
326
  newFilter.operand2 = newFilter.operand2 ? newFilter.operand2 : newFilter.operand1;
316
- newFilter.labelOperands = format(data.valueOperand1, "yyyy-MM-dd HH:mm:ss");
327
+ newFilter.labelOperands = format(data.valueOperand1, datetime_format);
317
328
  }
318
329
  return newFilter;
319
330
  }, []);
@@ -614,12 +625,17 @@ function BaseProvider(props) {
614
625
  } = useModuleDictionary();
615
626
  const [popupValidationSchema, setInternalPopupValidationSchema] = useState(Yup.object().shape({}));
616
627
  const [fnTransformFormValuesIntoRawValues, setInternalfnTransormFormValuesIntoRawValues] = useState(() => void 0);
628
+ const {
629
+ host_static_assets,
630
+ environment_assets
631
+ } = useEnvironment();
617
632
  const all_fields = useMemo(() => {
618
633
  return {
619
634
  ...ALL_FIELDS,
620
- label: getLabel("filter.all_fields")
635
+ label: getLabel("filter.all_fields"),
636
+ urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/filter/assets/icons/all_fields.svg`
621
637
  };
622
- }, [getLabel]);
638
+ }, [getLabel, host_static_assets, environment_assets]);
623
639
  const [inEdition, setInEdition] = useState(false);
624
640
  const [isDirty, setIsDirty] = useState(!automatic);
625
641
  const [isValid, setIsValid] = useState(false);
@@ -876,7 +892,7 @@ function ApplyedFilter(props) {
876
892
  } = useBase();
877
893
  const {
878
894
  host_static_assets,
879
- environment
895
+ environment_assets
880
896
  } = useEnvironment();
881
897
  console.log("fieldName by ApplyedFilter 1", getFieldByName(fieldName));
882
898
  const field = useMemo(() => {
@@ -905,7 +921,7 @@ function ApplyedFilter(props) {
905
921
  return /* @__PURE__ */ jsxs(WrapperApplyedFilter, {
906
922
  id: "WrapperApplyedFilter",
907
923
  className: !isSetted ? "waf_no_setted" : "",
908
- children: [/* @__PURE__ */ jsx(Icon, {
924
+ children: [urlIcon && /* @__PURE__ */ jsx(Icon, {
909
925
  src: urlIcon,
910
926
  onClick
911
927
  }), /* @__PURE__ */ jsxs(AplyedFilterStyled, {
@@ -918,7 +934,7 @@ function ApplyedFilter(props) {
918
934
  children: labelOperands
919
935
  })]
920
936
  }), !fixed && /* @__PURE__ */ jsx(IconButton, {
921
- src: `${host_static_assets}/${environment}/frontend/components/dynamic_filter/assets/icons/close.svg`,
937
+ src: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/close.svg`,
922
938
  onClick: onDelete
923
939
  })]
924
940
  });
@@ -933,12 +949,9 @@ function ApplyedFilters() {
933
949
  id: "WrapperApplyedFilters"
934
950
  });
935
951
  }
936
- return /* @__PURE__ */ jsx("div", {
937
- style: {
938
- width: "100%"
939
- },
952
+ return /* @__PURE__ */ jsx(WrapperApplyedFilters, {
940
953
  children: /* @__PURE__ */ jsx(ScrollBar, {
941
- children: /* @__PURE__ */ jsx(WrapperApplyedFilters, {
954
+ children: /* @__PURE__ */ jsx(ContainerApplyedFilters, {
942
955
  id: "WrapperApplyedFilters",
943
956
  children: [...applyedFilters].sort((a, b) => a.isSetted === b.isSetted ? 0 : a.isSetted ? -1 : 1).reverse().map((filter) => /* @__PURE__ */ jsx(ApplyedFilter, {
944
957
  ...filter
@@ -968,11 +981,12 @@ const WrapperClearFilters = styled$1("div")(({
968
981
  const ClearFilters = () => {
969
982
  const {
970
983
  host_static_assets,
971
- environment
984
+ environment_assets
972
985
  } = useEnvironment();
973
986
  const {
974
987
  clearFilters,
975
- isSkeleton
988
+ isSkeleton,
989
+ applyedFilters
976
990
  } = useBase();
977
991
  if (isSkeleton) {
978
992
  return /* @__PURE__ */ jsx(SKTClearFilters, {
@@ -983,12 +997,16 @@ const ClearFilters = () => {
983
997
  })
984
998
  });
985
999
  }
986
- return /* @__PURE__ */ jsx(WrapperClearFilters, {
987
- children: /* @__PURE__ */ jsx(IconButton, {
988
- src: `${host_static_assets}/${environment}/frontend/components/dynamic_filter/assets/icons/clear.svg`,
989
- onClick: clearFilters
990
- })
991
- });
1000
+ console.log("Dynamic validation", applyedFilters.findIndex((f) => f.fixed == false) > -1);
1001
+ if (applyedFilters.findIndex((f) => f.fixed == false) > -1) {
1002
+ return /* @__PURE__ */ jsx(WrapperClearFilters, {
1003
+ children: /* @__PURE__ */ jsx(IconButton, {
1004
+ src: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/clear.svg`,
1005
+ onClick: clearFilters
1006
+ })
1007
+ });
1008
+ }
1009
+ return /* @__PURE__ */ jsx(Fragment, {});
992
1010
  };
993
1011
  const SKTWrapperFilterButton = styled("div")(({
994
1012
  theme
@@ -1032,7 +1050,7 @@ function FilterButton() {
1032
1050
  } = useBase();
1033
1051
  const {
1034
1052
  host_static_assets,
1035
- environment
1053
+ environment_assets
1036
1054
  } = useEnvironment();
1037
1055
  console.log("Render isDirty", isDirty, automatic);
1038
1056
  if (isSkeleton) {
@@ -1060,7 +1078,7 @@ function FilterButton() {
1060
1078
  dictionaryTooltip: "filter.filter_tooltip",
1061
1079
  onClick: () => fireOnChangeFilters(),
1062
1080
  "aria-label": "settings",
1063
- src: `${host_static_assets}/${environment}/frontend/components/dynamic_filter/assets/icons/${automatic ? "refresh" : "search"}.svg`
1081
+ src: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/${automatic ? "refresh" : "search"}.svg`
1064
1082
  })
1065
1083
  });
1066
1084
  }
@@ -1072,7 +1090,7 @@ const WrapperInputFilter = styled("div")(({
1072
1090
  alignItems: "center",
1073
1091
  width: "100%",
1074
1092
  height: theme.spacing(3.75),
1075
- margin: theme.spacing(0, 1.5),
1093
+ marginLeft: theme.spacing(1.5),
1076
1094
  padding: theme.spacing(0, 1.5),
1077
1095
  borderRight: `1px solid ${theme.palette.divider}`,
1078
1096
  borderLeft: `1px solid ${theme.palette.divider}`,
@@ -1165,6 +1183,9 @@ function InputFilter() {
1165
1183
  }
1166
1184
  };
1167
1185
  console.log("Render InputFilter");
1186
+ if (!withAllField && availableFields.length == 0) {
1187
+ return /* @__PURE__ */ jsx(Fragment, {});
1188
+ }
1168
1189
  return /* @__PURE__ */ jsxs(WrapperInputFilter, {
1169
1190
  id: "WrapperInputFilter",
1170
1191
  children: [/* @__PURE__ */ jsx(StyledInputFilter, {
@@ -1301,8 +1322,8 @@ const PopupEditFilter = () => {
1301
1322
  urlCancel: -1,
1302
1323
  children: /* @__PURE__ */ jsxs(WrapperPopupEditFilter, {
1303
1324
  children: [/* @__PURE__ */ jsxs(HeaderContainer, {
1304
- children: [/* @__PURE__ */ jsx(Icon, {
1305
- src: field?.urlIcon
1325
+ children: [field?.urlIcon && /* @__PURE__ */ jsx(Icon, {
1326
+ src: field.urlIcon
1306
1327
  }), /* @__PURE__ */ jsx(TitleContainer, {
1307
1328
  children: field?.label
1308
1329
  })]
@@ -1336,6 +1357,7 @@ const WrapperFilter = styled("div", {
1336
1357
  alignItems: "center",
1337
1358
  justifyContent: "flex-start",
1338
1359
  height: "auto",
1360
+ width: "100%",
1339
1361
  padding: theme.spacing(1.5),
1340
1362
  borderRadius: theme.spacing(1),
1341
1363
  border: inEdition ? `1px solid ${theme.palette.primary.main}` : `1px solid ${theme.palette.divider}`
@@ -1352,16 +1374,16 @@ const WrapperFilterMobile = styled("div", {
1352
1374
  justifyContent: "space-between",
1353
1375
  minWidth: theme.spacing(25),
1354
1376
  height: "auto",
1377
+ width: "100%",
1355
1378
  padding: theme.spacing(1.5),
1356
1379
  borderRadius: theme.spacing(1),
1357
1380
  border: inEdition ? `1px solid ${theme.palette.primary.main}` : `1px solid ${theme.palette.divider}`,
1358
1381
  gap: theme.spacing(1.5)
1359
1382
  }));
1360
- const ContainerFistRow = styled("div")(({
1361
- theme
1362
- }) => ({
1383
+ const ContainerFistRow = styled("div")(() => ({
1384
+ width: "100%",
1363
1385
  display: "flex",
1364
- width: "100%"
1386
+ justifyContent: "space-between"
1365
1387
  }));
1366
1388
  const DynamicFilter = (props) => {
1367
1389
  const isDesktop = useResponsiveDesktop();
@@ -1,4 +1,5 @@
1
1
  import { styled } from "@mui/material";
2
+ import { useState, useEffect } from "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  const MaskIcon = styled("div", {
4
5
  shouldForwardProp: (props) => props !== "src" && props !== "width" && props !== "height" && props !== "bgColor"
@@ -7,22 +8,57 @@ const MaskIcon = styled("div", {
7
8
  mask: `url(${props.src}) no-repeat`,
8
9
  width: props.width === void 0 ? "20px" : props.width,
9
10
  height: props.height === void 0 ? "20px" : props.height,
10
- backgroundColor: props.bgColor === "active" ? props.theme.palette.action.active : props.bgColor === "selected" ? props.theme.palette.primary.main : props.bgColor === "info" ? props.theme.palette.info.main : props.bgColor === "warning" ? props.theme.palette.warning.main : props.bgColor === "error" ? props.theme.palette.error.main : props.bgColor
11
+ backgroundColor: props.bgColor === "active" ? props.theme.palette.action.active : props.bgColor === "selected" ? props.theme.palette.primary.main : props.bgColor === "info" ? props.theme.palette.info.main : props.bgColor === "warning" ? props.theme.palette.warning.main : props.bgColor === "error" ? props.theme.palette.warning.main : props.bgColor === "selected" ? props.theme.palette.primary.main : props.bgColor
12
+ }));
13
+ const WrapperPlaceHolder = styled("div", {
14
+ shouldForwardProp: (props) => props !== "widht" && props !== "height"
15
+ })((props) => ({
16
+ display: "flex",
17
+ justifyContent: "center",
18
+ alignItems: "center",
19
+ width: props.width,
20
+ height: props.height
11
21
  }));
12
22
  function Icon(props) {
23
+ const [resource, setResource] = useState(void 0);
13
24
  const {
14
- src = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/commons/assets/icons/default.svg",
15
- width = "20px",
16
- height = "20px",
17
- bgColor = "active",
18
- onClick
19
- } = props;
20
- return /* @__PURE__ */ jsx(MaskIcon, {
21
25
  src,
26
+ width = "16px",
27
+ height = "16px",
28
+ bgColor = "active"
29
+ } = props;
30
+ useEffect(() => {
31
+ let mounted = true;
32
+ if (resource)
33
+ return;
34
+ (async function networkOperation() {
35
+ await fetch(src).then((response) => {
36
+ if (mounted) {
37
+ console.log("Icon***", response.body);
38
+ setResource(response.url);
39
+ }
40
+ }).catch((_err) => {
41
+ });
42
+ })();
43
+ return function clenUp() {
44
+ console.log("CleanUP", "Icon");
45
+ mounted = false;
46
+ };
47
+ }, []);
48
+ const placeHolder = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDcwIDcwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA3MCA3MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM2MzczODE7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00NSw4LjdjMS40LTEuNSwzLjQtMi4zLDUuNC0yLjNzMy45LDAuOCw1LjQsMi4zczIuNCwzLjUsMi41LDUuN2MwLDIuMi0wLjksNC4yLTIuNCw1LjdzLTMuNSwyLjMtNS41LDIuMgoJCWMtMi4xLDAuMS00LTAuNy01LjUtMi4yYy0xLjQtMS41LTIuMy0zLjUtMi40LTUuN0M0Mi42LDEyLjIsNDMuNSwxMC4yLDQ1LDguN3oiLz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02OC40LDYyLjFjLTAuMywwLjUtMC43LDAuOC0xLjIsMS4xcy0xLDAuNC0xLjYsMC40SDQuM2MtMC42LDAtMS4xLTAuMS0xLjYtMC40cy0wLjktMC42LTEuMi0xLjEKCQljLTAuMi0wLjUtMC40LTEtMC40LTEuNXMwLjEtMS4xLDAuNC0xLjVsMjMtMzYuNGMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNHMwLjksMC42LDEuMiwxLjEKCQlsMTEuNSwxOC4yYzAuMiwwLjMsMC41LDAuNSwwLjgsMC43czAuNiwwLjMsMSwwLjNjMC4zLDAsMC43LTAuMSwxLTAuM3MwLjYtMC40LDAuOC0wLjdsMy4xLTQuOWMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMQoJCXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNGMwLjUsMC4zLDAuOSwwLjYsMS4yLDEuMWwxNC42LDIzLjFjMC4zLDAuNSwwLjMsMSwwLjMsMS41UzY4LjcsNjEuNyw2OC40LDYyLjF6Ii8+CjwvZz4KPC9zdmc+Cg==";
49
+ return /* @__PURE__ */ jsx(WrapperPlaceHolder, {
50
+ id: "IconReact",
22
51
  width,
23
52
  height,
24
- bgColor,
25
- onClick
53
+ children: resource ? /* @__PURE__ */ jsx(MaskIcon, {
54
+ src: resource,
55
+ width,
56
+ height,
57
+ bgColor
58
+ }) : /* @__PURE__ */ jsx("img", {
59
+ src: placeHolder,
60
+ alt: "icon_svg"
61
+ })
26
62
  });
27
63
  }
28
64
  export { Icon as I };
@@ -1,2 +1,4 @@
1
1
  /// <reference types="react" />
2
+ import { WrapperPlaceHolderProps } from './types';
2
3
  export declare const MaskIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("./types").OwnProps & import("react").HTMLProps<HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
+ export declare const WrapperPlaceHolder: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & WrapperPlaceHolderProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,8 +1,9 @@
1
1
  import { HTMLProps } from 'react';
2
2
  export interface OwnProps {
3
- src: string | undefined;
3
+ src: string;
4
4
  width?: number | string;
5
5
  height?: number | string;
6
- bgColor?: string | 'info' | 'warning' | 'error' | 'active' | 'disabled';
6
+ bgColor?: string | 'info' | 'warning' | 'error' | 'active' | 'selected' | 'disabled';
7
7
  }
8
+ export declare type WrapperPlaceHolderProps = Pick<OwnProps, 'width' | 'height'>;
8
9
  export declare type IconProps = OwnProps & HTMLProps<HTMLDivElement>;
@@ -6,7 +6,7 @@ import { a as getThemeVariantColor } from "../../vendor.js";
6
6
  import { R as Resizeable } from "../Resizeable/index.js";
7
7
  import { useResponsiveDesktop } from "@m4l/graphics";
8
8
  import { useEnvironment } from "@m4l/core";
9
- import { B as BoxIcon } from "../mui_extended/BoxIcon/index.js";
9
+ import { I as Icon } from "../Icon/index.js";
10
10
  import { jsxs, jsx } from "react/jsx-runtime";
11
11
  import { F as FormActions, g as getActionnsComponentsDictionary } from "../FormActions/index.js";
12
12
  const WrapperDialog = styled(Dialog)(() => ({}));
@@ -54,7 +54,7 @@ const ModalTitle = styled("div")(({ theme, variant }) => ({
54
54
  const Header = (props) => {
55
55
  const {
56
56
  host_static_assets,
57
- environment
57
+ environment_assets
58
58
  } = useEnvironment();
59
59
  const {
60
60
  variant,
@@ -63,17 +63,17 @@ const Header = (props) => {
63
63
  withClose,
64
64
  onCloseModal
65
65
  } = props;
66
- const iconSrcWarning = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/warning.svg`;
67
- const iconSrcError = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/error.svg`;
68
- const iconSrcInfo = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/info.svg`;
69
- const iconDefault = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/icon_bar_tittle.svg`;
66
+ const iconSrcWarning = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/warning.svg`;
67
+ const iconSrcError = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/error.svg`;
68
+ const iconSrcInfo = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/info.svg`;
69
+ const iconDefault = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/icon_bar_tittle.svg`;
70
70
  return /* @__PURE__ */ jsxs(Header$1, {
71
71
  id: "Header",
72
72
  children: [/* @__PURE__ */ jsxs(IconTitleContainer, {
73
73
  className: "draggable-dialog-title",
74
74
  children: [/* @__PURE__ */ jsx(IconHeader, {
75
75
  variant,
76
- children: !iconComponent ? /* @__PURE__ */ jsx(BoxIcon, {
76
+ children: !iconComponent ? /* @__PURE__ */ jsx(Icon, {
77
77
  src: variant === "warning" ? iconSrcWarning : variant === "delete" ? iconSrcError : variant === "info" ? iconSrcInfo : iconDefault
78
78
  }) : iconComponent
79
79
  }), /* @__PURE__ */ jsx(ModalTitle, {
@@ -83,8 +83,8 @@ const Header = (props) => {
83
83
  }), withClose && /* @__PURE__ */ jsx(IconButton, {
84
84
  onClick: onCloseModal,
85
85
  "aria-label": "click",
86
- children: /* @__PURE__ */ jsx(BoxIcon, {
87
- src: `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/close.svg`
86
+ children: /* @__PURE__ */ jsx(Icon, {
87
+ src: `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/close.svg`
88
88
  })
89
89
  })]
90
90
  });
@@ -50,12 +50,12 @@ const Label = styled("span")(({
50
50
  function NoItemSelected() {
51
51
  const {
52
52
  host_static_assets,
53
- environment
53
+ environment_assets
54
54
  } = useEnvironment();
55
55
  const {
56
56
  getLabel
57
57
  } = useModuleDictionary();
58
- const src = `${host_static_assets}/${environment}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
58
+ const src = `${host_static_assets}/${environment_assets}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
59
59
  return /* @__PURE__ */ jsxs(WrapperNoItemSelected, {
60
60
  id: "Wrapper",
61
61
  children: [/* @__PURE__ */ jsx(Image, {
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useCallback, useMemo } from "react";
2
- import { useNetwork, useModuleDictionary, usePaginate } from "@m4l/core";
2
+ import { useNetwork, useModuleDictionary, useEnvironment, usePaginate } from "@m4l/core";
3
3
  import { styled } from "@mui/material/styles";
4
4
  import { D as DataGrid } from "../DataGrid/index.js";
5
5
  import { D as DateFormatter } from "../DataGrid/formatters/DateFormatter/index.js";
@@ -7,6 +7,7 @@ import { Tooltip, IconButton } from "@mui/material";
7
7
  import { R as ReactJson } from "../../react-json-view.js";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { u as useModal } from "../../hooks/useModal/index.js";
10
+ import { I as Icon } from "../Icon/index.js";
10
11
  import { D as DynamicFilter } from "../DynamicFilter/index.js";
11
12
  const Container$1 = styled("div")(() => ({
12
13
  height: "100%",
@@ -19,7 +20,7 @@ const Actions = styled("div")(({
19
20
  theme
20
21
  }) => ({
21
22
  position: "relative",
22
- height: "60px",
23
+ height: "auto",
23
24
  display: "flex",
24
25
  flexDirection: "row",
25
26
  justifyContent: "flex-start",
@@ -93,6 +94,10 @@ function DetailFormatter(props) {
93
94
  const {
94
95
  getLabel
95
96
  } = useModuleDictionary();
97
+ const {
98
+ host_static_assets,
99
+ environment_assets
100
+ } = useEnvironment();
96
101
  const onClickDetail = () => {
97
102
  openModal({
98
103
  onQueryClose: () => closeModal(),
@@ -110,8 +115,8 @@ function DetailFormatter(props) {
110
115
  children: /* @__PURE__ */ jsx(IconButton, {
111
116
  onClick: onClickDetail,
112
117
  "aria-label": "filter",
113
- children: /* @__PURE__ */ jsx("div", {
114
- children: "Sin icono"
118
+ children: /* @__PURE__ */ jsx(Icon, {
119
+ src: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/search.svg`
115
120
  })
116
121
  })
117
122
  });
@@ -120,6 +125,7 @@ function ObjectLogs(props) {
120
125
  const {
121
126
  getLabel
122
127
  } = useModuleDictionary();
128
+ useEnvironment();
123
129
  const {
124
130
  resource_id,
125
131
  object_id
@@ -190,7 +196,7 @@ function ObjectLogs(props) {
190
196
  children: [/* @__PURE__ */ jsx(Actions, {
191
197
  id: "objectLogsActions",
192
198
  children: /* @__PURE__ */ jsx(DynamicFilter, {
193
- withAllField: false,
199
+ withAllField: true,
194
200
  onChangeFilter,
195
201
  automatic: false,
196
202
  fields: [{
@@ -200,6 +206,13 @@ function ObjectLogs(props) {
200
206
  multiple: false,
201
207
  fixed: true,
202
208
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
209
+ }, {
210
+ name: "user_logs.log_detail",
211
+ label: getLabel("object_logs.log_detail"),
212
+ type: "string",
213
+ multiple: false,
214
+ fixed: false,
215
+ urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
203
216
  }],
204
217
  initialFilters: []
205
218
  })
@@ -1,7 +1,7 @@
1
1
  import { styled, useTheme } from "@mui/material/styles";
2
2
  import { Skeleton } from "@mui/material";
3
3
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
4
- import { B as BoxIcon } from "../mui_extended/BoxIcon/index.js";
4
+ import { I as Icon } from "../Icon/index.js";
5
5
  const WrapperPaper = styled("div")(({
6
6
  theme
7
7
  }) => ({
@@ -93,7 +93,7 @@ function PaperForm(props) {
93
93
  children,
94
94
  isSkeleton = false
95
95
  } = props;
96
- const theme = useTheme();
96
+ useTheme();
97
97
  return /* @__PURE__ */ jsx(WrapperPaper, {
98
98
  id: "ContainerPropertyValue",
99
99
  children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, {
@@ -102,11 +102,8 @@ function PaperForm(props) {
102
102
  children: /* @__PURE__ */ jsxs(IconTitleContainer, {
103
103
  className: "draggable-dialog-title",
104
104
  children: [/* @__PURE__ */ jsx(IconHeader, {
105
- children: /* @__PURE__ */ jsx(BoxIcon, {
106
- src: urlIcon,
107
- sx: {
108
- color: theme.palette.action.active
109
- }
105
+ children: /* @__PURE__ */ jsx(Icon, {
106
+ src: urlIcon
110
107
  })
111
108
  }), tittle]
112
109
  })
@@ -1,6 +1,7 @@
1
1
  import { styled } from "@mui/material/styles";
2
2
  import { Skeleton } from "@mui/material";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useResponsiveDesktop } from "@m4l/graphics";
4
5
  const WrapperPropertyValue = styled("div", {
5
6
  shouldForwardProp: (prop) => prop !== "propertyWidth" && prop !== "propertyHeight" && prop !== "isForm"
6
7
  })(({
@@ -12,7 +13,7 @@ const WrapperPropertyValue = styled("div", {
12
13
  alignItems: "flex-start",
13
14
  width: "100%",
14
15
  padding: `${theme.spacing(1)} ${theme.spacing(2)}`,
15
- height: propertyHeight || "auto",
16
+ maxHeight: propertyHeight || "auto",
16
17
  ":hover": {
17
18
  backgroundColor: isForm ? "unset" : theme.palette.grid?.rowHover
18
19
  },
@@ -44,8 +45,9 @@ const Property = styled("span", {
44
45
  overflowWrap: "break-word"
45
46
  }));
46
47
  const Value = styled("div", {
47
- shouldForwardProp: (prop) => prop !== "propertyWidth" && prop !== "propertyHeight"
48
+ shouldForwardProp: (prop) => prop !== "propertyWidth" && prop !== "propertyHeight" && prop !== "valueWidth"
48
49
  })(({
50
+ width,
49
51
  propertyHeight,
50
52
  theme
51
53
  }) => ({
@@ -54,9 +56,9 @@ const Value = styled("div", {
54
56
  color: theme.palette.text.secondary,
55
57
  position: "relative",
56
58
  padding: "1px",
57
- height: propertyHeight ? propertyHeight - 24 : "auto",
59
+ width: width ? `${width}%` : "100%",
60
+ height: propertyHeight ? propertyHeight : "auto",
58
61
  marginTop: theme.spacing(1),
59
- width: "100%",
60
62
  [theme.breakpoints.up("sm")]: {
61
63
  marginLeft: theme.spacing(2),
62
64
  marginTop: "0px"
@@ -83,9 +85,34 @@ function PropertyValue(props) {
83
85
  value,
84
86
  propertyWidth,
85
87
  propertyHeight,
88
+ valueWidth = "100",
86
89
  isForm,
87
90
  isSkeleton = false
88
91
  } = props;
92
+ const isDesktop = useResponsiveDesktop();
93
+ console.log("valueWidth", valueWidth);
94
+ const getValueW = () => {
95
+ if (valueWidth === "75" && isDesktop) {
96
+ return "75";
97
+ } else if (valueWidth === "75" && !isDesktop) {
98
+ return "100";
99
+ }
100
+ if (valueWidth === "50" && isDesktop) {
101
+ return "50";
102
+ } else if (valueWidth === "50" && !isDesktop) {
103
+ return "100";
104
+ }
105
+ if (valueWidth === "25" && isDesktop || valueWidth === "12.5" && isDesktop) {
106
+ return parseFloat(valueWidth).toString(10);
107
+ } else if (valueWidth === "25" && !isDesktop || valueWidth === "12.5" && !isDesktop) {
108
+ return (parseFloat(valueWidth) * 2).toString(10);
109
+ }
110
+ console.log("valueWidth in function", valueWidth);
111
+ return "100";
112
+ };
113
+ const valueW = getValueW();
114
+ console.log("valueWidth in function", valueWidth);
115
+ console.log("getValueW", typeof getValueW(), getValueW());
89
116
  return /* @__PURE__ */ jsxs(WrapperPropertyValue, {
90
117
  id: "ContainerPropertyValue",
91
118
  isForm,
@@ -99,7 +126,7 @@ function PropertyValue(props) {
99
126
  children: isSkeleton ? /* @__PURE__ */ jsx(SKTProperty, {}) : property
100
127
  }), /* @__PURE__ */ jsx(Value, {
101
128
  id: "Value",
102
- propertyWidth,
129
+ width: valueW,
103
130
  propertyHeight,
104
131
  children: value
105
132
  })]
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { PropertyProps } from './types';
2
+ import { PropertyProps, ValueProps } from './types';
3
3
  export declare const WrapperPropertyValue: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PropertyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
4
  export declare const Property: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PropertyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
5
- export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PropertyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & ValueProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
6
  export declare const SKTWrapperProperty: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,11 +1,18 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export interface PropertyProps {
3
3
  propertyWidth?: number;
4
- propertyHeight?: number;
4
+ propertyHeight?: number | string;
5
5
  isForm?: boolean;
6
6
  }
7
- export interface PropertyValueProps extends PropertyProps {
8
- isSkeleton?: boolean;
7
+ export interface ValueProps {
8
+ width: string;
9
+ propertyHeight?: number | string;
10
+ }
11
+ export interface PropertyValueProps extends PropertyProps, ValueTypeProps {
9
12
  property: string;
13
+ isSkeleton?: boolean;
10
14
  value: number | string | ReactNode;
11
15
  }
16
+ export interface ValueTypeProps {
17
+ valueWidth?: '100' | '75' | '50' | '25' | '12.5';
18
+ }
@@ -2,6 +2,7 @@ import { useFormContext, Controller } from "react-hook-form";
2
2
  import { Skeleton, TextField } from "@mui/material";
3
3
  import { styled } from "@mui/material/styles";
4
4
  import { DateTimePicker } from "@mui/x-date-pickers";
5
+ import { useEnvironment } from "@m4l/core";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  const SKTRHFWrapperTextField = styled("div")(({
7
8
  theme
@@ -27,6 +28,12 @@ function RHFDateTime(props) {
27
28
  const {
28
29
  control
29
30
  } = useFormContext();
31
+ const {
32
+ dfnsFormat: {
33
+ datetime_format,
34
+ datetime_mask
35
+ }
36
+ } = useEnvironment();
30
37
  if (isSkeleton) {
31
38
  return /* @__PURE__ */ jsx(SKTRHFWrapperTextField, {
32
39
  children: /* @__PURE__ */ jsx(Skeleton, {
@@ -47,8 +54,8 @@ function RHFDateTime(props) {
47
54
  }) => {
48
55
  return /* @__PURE__ */ jsx(DateTimePicker, {
49
56
  ampm: false,
50
- inputFormat: "yyyy-MM-dd HH:mm:ss",
51
- mask: "____-__-__ __:__:__",
57
+ inputFormat: datetime_format,
58
+ mask: datetime_mask,
52
59
  label: "",
53
60
  value: field.value,
54
61
  onChange: (value) => {
@@ -2,3 +2,10 @@
2
2
  export declare const RootStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
3
3
  export declare const DropZoneStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
4
  export declare const PlaceholderStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const ContainerUploadBody: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const Containermessage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
+ export declare const ContainerTitle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
8
+ export declare const ContainerDescription: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
9
+ export declare const ContainerConditions: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
10
+ export declare const WrapperImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export declare const ContainerPlaceHolder: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const WrapperRHFUploadImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,18 +1,19 @@
1
- import { Typography, FormHelperText } from "@mui/material";
1
+ import { styled as styled$1, FormHelperText } from "@mui/material";
2
2
  import { useCallback } from "react";
3
3
  import { useFormContext, Controller } from "react-hook-form";
4
4
  import { i as isString_1 } from "../../lodash.js";
5
5
  import { u as useDropzone } from "../../node_modules.js";
6
+ import { styled, alpha } from "@mui/material/styles";
6
7
  import { I as Image } from "../Image/index.js";
7
- import { useEnvironment } from "@m4l/core";
8
+ import { useEnvironment, useModuleDictionary } from "@m4l/core";
8
9
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
9
10
  import "../../react-lazy-load-image-component.js";
10
- import { styled } from "@mui/material/styles";
11
11
  const RootStyle = styled("div")(({
12
12
  theme
13
13
  }) => ({
14
- width: 144,
15
- height: 144,
14
+ width: "inherit",
15
+ height: "100%",
16
+ minWidth: theme.spacing(20),
16
17
  margin: "auto",
17
18
  borderRadius: theme.spacing(1),
18
19
  padding: theme.spacing(1),
@@ -45,20 +46,74 @@ const DropZoneStyle = styled("div")(({
45
46
  const PlaceholderStyle = styled("div")(({
46
47
  theme
47
48
  }) => ({
49
+ "&:hover": {
50
+ opacity: 1
51
+ },
48
52
  display: "flex",
49
- position: "absolute",
50
- alignItems: "center",
51
- flexDirection: "column",
52
53
  justifyContent: "center",
53
- color: theme.palette.text.secondary,
54
- backgroundColor: theme.palette.background.neutral,
54
+ position: "absolute",
55
+ zIndex: "2",
56
+ inset: "0",
55
57
  transition: theme.transitions.create("opacity", {
56
58
  easing: theme.transitions.easing.easeInOut,
57
59
  duration: theme.transitions.duration.shorter
58
60
  }),
59
- "&:hover": {
60
- opacity: 0.72
61
- }
61
+ overflow: "auto"
62
+ }));
63
+ const ContainerUploadBody = styled("div")(({
64
+ theme
65
+ }) => ({
66
+ padding: theme.spacing(3, 5),
67
+ display: "flex",
68
+ flexWrap: "wrap",
69
+ justifyContent: "center",
70
+ width: "100%",
71
+ height: "100%",
72
+ gap: theme.spacing(3)
73
+ }));
74
+ const Containermessage = styled("div")(({
75
+ theme
76
+ }) => ({
77
+ display: "flex",
78
+ justifyContent: "center",
79
+ flexDirection: "column",
80
+ gap: theme.spacing(3)
81
+ }));
82
+ const ContainerTitle = styled("span")(({
83
+ theme
84
+ }) => ({
85
+ ...theme.typography.subtitle2,
86
+ width: "fit-content"
87
+ }));
88
+ const ContainerDescription = styled("span")(({
89
+ theme
90
+ }) => ({
91
+ ...theme.typography.body2,
92
+ minWidth: theme.spacing(20)
93
+ }));
94
+ const ContainerConditions = styled("span")(({
95
+ theme
96
+ }) => ({
97
+ ...theme.typography.caption,
98
+ width: "fit-content"
99
+ }));
100
+ const WrapperImage = styled("div")(({
101
+ theme
102
+ }) => ({
103
+ display: "flex",
104
+ alignItems: "center",
105
+ maxWidth: theme.spacing(20)
106
+ }));
107
+ styled("div")(({
108
+ theme
109
+ }) => ({
110
+ width: "100%",
111
+ height: "100%",
112
+ position: "absolute",
113
+ inset: "0",
114
+ display: "flex",
115
+ justifyContent: "center",
116
+ alignItems: "center"
62
117
  }));
63
118
  function UploadImage({
64
119
  error,
@@ -78,10 +133,14 @@ function UploadImage({
78
133
  });
79
134
  const {
80
135
  host_static_assets,
81
- environment
136
+ environment_assets
82
137
  } = useEnvironment();
138
+ const {
139
+ getLabel
140
+ } = useModuleDictionary();
83
141
  return /* @__PURE__ */ jsxs(Fragment, {
84
142
  children: [/* @__PURE__ */ jsx(RootStyle, {
143
+ id: "RootStyle",
85
144
  sx: {
86
145
  ...(isDragReject || error) && {
87
146
  borderColor: "error.light"
@@ -89,6 +148,7 @@ function UploadImage({
89
148
  ...sx
90
149
  },
91
150
  children: /* @__PURE__ */ jsxs(DropZoneStyle, {
151
+ id: "DropZoneStyle",
92
152
  ...getRootProps(),
93
153
  sx: {
94
154
  ...isDragActive && {
@@ -103,36 +163,54 @@ function UploadImage({
103
163
  sx: {
104
164
  zIndex: 8
105
165
  }
106
- }), /* @__PURE__ */ jsxs(PlaceholderStyle, {
166
+ }), /* @__PURE__ */ jsx(PlaceholderStyle, {
167
+ id: "PlaceholderStyle",
107
168
  className: "placeholder",
108
169
  sx: {
109
- ...file && {
110
- opacity: 0,
170
+ ...file ? {
171
+ bgcolor: alpha("#161C24", 0.72),
111
172
  color: "common.white",
112
- bgcolor: "grey.900",
113
- "&:hover": {
114
- opacity: 0.72
115
- }
173
+ opacity: 0
174
+ } : {
175
+ opacity: 1
116
176
  },
117
177
  ...(isDragReject || error) && {
118
- bgcolor: "error.lighter"
178
+ backgroundColor: alpha("error.main", 0.72),
179
+ color: "common.white"
119
180
  }
120
181
  },
121
- children: [/* @__PURE__ */ jsx(Image, {
122
- src: `${host_static_assets}/${environment}/frontend/commons/assets/icons/more_vertical.svg`,
123
- effect: "opacity",
124
- width: "24",
125
- height: "24",
126
- mb: 1
127
- }), /* @__PURE__ */ jsx(Typography, {
128
- variant: "caption",
129
- children: file ? "Update photo" : "Upload photo"
130
- })]
182
+ children: /* @__PURE__ */ jsxs(ContainerUploadBody, {
183
+ className: "ContainerUploadBody",
184
+ children: [/* @__PURE__ */ jsx(WrapperImage, {
185
+ children: /* @__PURE__ */ jsx(Image, {
186
+ src: `${host_static_assets}/${environment_assets}/frontend/components/upload_image/assets/img/upload_image_illustration.svg`,
187
+ effect: "opacity",
188
+ width: "100%",
189
+ height: "auto",
190
+ mb: 1
191
+ })
192
+ }), /* @__PURE__ */ jsxs(Containermessage, {
193
+ children: [/* @__PURE__ */ jsx(ContainerTitle, {
194
+ children: file ? getLabel("upload_image.title_update") : getLabel("upload_image.title_upload")
195
+ }), /* @__PURE__ */ jsx(ContainerDescription, {
196
+ children: getLabel("upload_image.description")
197
+ }), /* @__PURE__ */ jsx(ContainerConditions, {
198
+ children: getLabel("upload_image.conditions")
199
+ })]
200
+ })]
201
+ })
131
202
  })]
132
203
  })
133
204
  }), helperText && helperText]
134
205
  });
135
206
  }
207
+ const WrapperRHFUploadImage = styled$1("div")(({
208
+ theme
209
+ }) => ({
210
+ width: "inherit",
211
+ height: "inherit",
212
+ padding: "1px"
213
+ }));
136
214
  function RHFUploadImage({
137
215
  name,
138
216
  ...other
@@ -161,7 +239,7 @@ function RHFUploadImage({
161
239
  }
162
240
  }) => {
163
241
  const checkError = !!error && !field.value;
164
- return /* @__PURE__ */ jsxs("div", {
242
+ return /* @__PURE__ */ jsxs(WrapperRHFUploadImage, {
165
243
  children: [/* @__PURE__ */ jsx(UploadImage, {
166
244
  onDrop: handleDrop,
167
245
  error: checkError,
@@ -5,7 +5,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
5
5
  function Accordion(props) {
6
6
  const {
7
7
  host_static_assets,
8
- environment
8
+ environment_assets
9
9
  } = useEnvironment();
10
10
  const {
11
11
  label,
@@ -29,7 +29,7 @@ function Accordion(props) {
29
29
  disableTouchRipple: false,
30
30
  expandIcon: /* @__PURE__ */ jsx(IconButton, {
31
31
  "aria-label": "settings",
32
- src: `${host_static_assets}/${environment}/frontend/components/accordion/assets/icons/expanded.svg`
32
+ src: `${host_static_assets}/${environment_assets}/frontend/components/accordion/assets/icons/expanded.svg`
33
33
  }),
34
34
  ...summaryProps,
35
35
  children: isSkeleton ? /* @__PURE__ */ jsx(Skeleton, {
@@ -3,7 +3,7 @@ import { forwardRef, useMemo } from "react";
3
3
  import { IconButton as IconButton$1, Box, Tooltip } from "@mui/material";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { useModuleDictionary } from "@m4l/core";
6
- import { B as BoxIcon } from "../BoxIcon/index.js";
6
+ import { I as Icon } from "../../Icon/index.js";
7
7
  const varSmall = {
8
8
  hover: {
9
9
  scale: 1.1
@@ -69,13 +69,12 @@ function IconButton({
69
69
  const {
70
70
  getLabel
71
71
  } = useModuleDictionary();
72
- const iconButton = useMemo(() => /* @__PURE__ */ jsx(IconButton$1, {
73
- size,
74
- ...other,
75
- children: /* @__PURE__ */ jsx(BoxIcon, {
72
+ const iconMemo = useMemo(() => {
73
+ console.log("IconButton", size, other, src);
74
+ return /* @__PURE__ */ jsx(Icon, {
76
75
  src
77
- })
78
- }), [size, other, src]);
76
+ });
77
+ }, [src]);
79
78
  const finalTooltip = useMemo(() => {
80
79
  if (dictionaryTooltip && getLabel) {
81
80
  return getLabel(dictionaryTooltip);
@@ -85,9 +84,17 @@ function IconButton({
85
84
  if (finalTooltip && !other.disabled) {
86
85
  return /* @__PURE__ */ jsx(Tooltip, {
87
86
  title: finalTooltip,
88
- children: iconButton
87
+ children: /* @__PURE__ */ jsx(IconButton$1, {
88
+ size,
89
+ ...other,
90
+ children: iconMemo
91
+ })
89
92
  });
90
93
  }
91
- return iconButton;
94
+ return /* @__PURE__ */ jsx(IconButton$1, {
95
+ size,
96
+ ...other,
97
+ children: iconMemo
98
+ });
92
99
  }
93
100
  export { IconButton as I, IconButtonAnimate as a };
@@ -3,7 +3,7 @@ import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
3
  import { IconButton, Tooltip, MenuItem } from "@mui/material";
4
4
  import { M as MenuPopover } from "../MenuPopover/index.js";
5
5
  import { styled } from "@mui/material/styles";
6
- import { B as BoxIcon } from "../BoxIcon/index.js";
6
+ import { I as Icon } from "../../Icon/index.js";
7
7
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
8
8
  const WrapperMenuActions = styled(IconButton)(() => ({}));
9
9
  const LabelMemuItem = styled("div")(({
@@ -30,7 +30,7 @@ function MenuActions(props) {
30
30
  } = props;
31
31
  const {
32
32
  host_static_assets,
33
- environment
33
+ environment_assets
34
34
  } = useEnvironment();
35
35
  const {
36
36
  getLabel
@@ -42,8 +42,8 @@ function MenuActions(props) {
42
42
  const urlFinalIcon = useMemo(() => {
43
43
  if (urlIcon)
44
44
  return urlIcon;
45
- return `${host_static_assets}/${environment}/frontend/commons/assets/icons/more_vertical.svg`;
46
- }, [urlIcon, host_static_assets, environment]);
45
+ return `${host_static_assets}/${environment_assets}/frontend/commons/assets/icons/more_vertical.svg`;
46
+ }, [urlIcon, host_static_assets, environment_assets]);
47
47
  const handleClose = () => {
48
48
  setOpen(null);
49
49
  };
@@ -67,12 +67,10 @@ function MenuActions(props) {
67
67
  id: "WrapperMenuActions",
68
68
  size: "small",
69
69
  onClick: handleOpen,
70
- children: /* @__PURE__ */ jsx(BoxIcon, {
70
+ children: /* @__PURE__ */ jsx(Icon, {
71
71
  src: urlFinalIcon,
72
- sx: {
73
- width: 20,
74
- height: 20
75
- }
72
+ width: 16,
73
+ height: 16
76
74
  })
77
75
  })
78
76
  }), /* @__PURE__ */ jsx(MenuPopover, {
@@ -101,7 +99,7 @@ function MenuActions(props) {
101
99
  color: menuAction.color ? menuAction.color : "text.main"
102
100
  },
103
101
  disabled: menuAction.disabled,
104
- children: [/* @__PURE__ */ jsx(BoxIcon, {
102
+ children: [/* @__PURE__ */ jsx(Icon, {
105
103
  src: menuAction.urlIcon
106
104
  }), /* @__PURE__ */ jsx(LabelMemuItem, {
107
105
  children: getLabel(menuAction.dictionaryField)
@@ -24,7 +24,7 @@ function PagerActions(props) {
24
24
  } = props;
25
25
  const {
26
26
  host_static_assets,
27
- environment
27
+ environment_assets
28
28
  } = useEnvironment();
29
29
  const handleFirstPageButtonClick = (event) => {
30
30
  onPageChange(event, 0);
@@ -45,25 +45,25 @@ function PagerActions(props) {
45
45
  onClick: handleFirstPageButtonClick,
46
46
  disabled: page === 0,
47
47
  "aria-label": "first page",
48
- src: `${host_static_assets}/${environment}/frontend/components/pager/assets/icons/first.svg`
48
+ src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/first.svg`
49
49
  }), /* @__PURE__ */ jsx(IconButton, {
50
50
  dictionaryTooltip: "pager.previous",
51
51
  onClick: handleBackButtonClick,
52
52
  disabled: page === 0,
53
53
  "aria-label": "first page",
54
- src: `${host_static_assets}/${environment}/frontend/components/pager/assets/icons/previous.svg`
54
+ src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/previous.svg`
55
55
  }), /* @__PURE__ */ jsx(IconButton, {
56
56
  dictionaryTooltip: "pager.next",
57
57
  onClick: handleNextButtonClick,
58
58
  disabled: page >= Math.ceil(count / rowsPerPage) - 1,
59
59
  "aria-label": "next page",
60
- src: `${host_static_assets}/${environment}/frontend/components/pager/assets/icons/next.svg`
60
+ src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/next.svg`
61
61
  }), /* @__PURE__ */ jsx(IconButton, {
62
62
  dictionaryTooltip: "pager.last",
63
63
  onClick: handleLastPageButtonClick,
64
64
  disabled: page >= Math.ceil(count / rowsPerPage) - 1,
65
65
  "aria-label": "last page",
66
- src: `${host_static_assets}/${environment}/frontend/components/pager/assets/icons/last.svg`
66
+ src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/last.svg`
67
67
  })]
68
68
  });
69
69
  }
@@ -47,11 +47,11 @@ const ContentConfirm = (props) => {
47
47
  } = props;
48
48
  const {
49
49
  host_static_assets,
50
- environment
50
+ environment_assets
51
51
  } = useEnvironment();
52
- const illustrationWarning = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/illustration_confirm_warning.svg`;
53
- const illustrationError = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/illustration_confirm_danger.svg`;
54
- const illustrationInfo = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/illustration_confirm_info.svg`;
52
+ const illustrationWarning = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_warning.svg`;
53
+ const illustrationError = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_danger.svg`;
54
+ const illustrationInfo = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_info.svg`;
55
55
  return /* @__PURE__ */ jsx(WrapperContentConfirm, {
56
56
  children: /* @__PURE__ */ jsxs(ModalContent, {
57
57
  children: [/* @__PURE__ */ jsx(IllustrationContainer, {
package/dist/vendor.js CHANGED
@@ -15,10 +15,11 @@ import "./components/hook-form/RHFDateTime.js";
15
15
  import "@mui/x-date-pickers";
16
16
  import "./components/hook-form/RHFTextField/index.js";
17
17
  import "./lodash.js";
18
- import "./react-lazy-load-image-component.js";
19
18
  import { styled } from "@mui/material/styles";
19
+ import "./react-lazy-load-image-component.js";
20
20
  import "./components/Image/index.js";
21
21
  import "./components/hook-form/RHFUpload.js";
22
+ import "./components/Icon/index.js";
22
23
  import "./components/mui_extended/LoadingButton/index.js";
23
24
  import "./components/mui_extended/MenuPopover/index.js";
24
25
  import "./components/mui_extended/MenuActions/index.js";
@@ -32,7 +33,6 @@ import "react-dnd-html5-backend";
32
33
  import "date-fns";
33
34
  import "./components/ScrollBar/index.js";
34
35
  import "./components/DynamicFilter/index.js";
35
- import "./components/Icon/index.js";
36
36
  import "./simplebar.js";
37
37
  import "yup";
38
38
  import "./components/FormActions/index.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
3
  "private": false,
4
- "version": "0.0.33",
4
+ "version": "0.0.36",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -14,14 +14,13 @@
14
14
  "format": "npm run prettier:fix && npm run lint:fix"
15
15
  },
16
16
  "dependencies": {
17
+ "@m4l/graphics": "^0.0.28",
17
18
  "react": "^17.0.0 || 18.x",
18
19
  "react-dom": "^18.0.0",
19
20
  "react-draggable": "^4.4.5"
20
21
  },
21
22
  "peerDependencies": {
22
23
  "@hookform/resolvers": "^2.9.5",
23
- "@m4l/core": "^0.0.32",
24
- "@m4l/graphics": "^0.0.22",
25
24
  "@mui/lab": "^5.0.0-alpha.89",
26
25
  "@mui/material": "^5.8.7",
27
26
  "@mui/x-date-pickers": "^5.0.0-beta.0",
@@ -42,8 +41,6 @@
42
41
  "devDependencies": {
43
42
  "@emotion/styled": "^11.9.3",
44
43
  "@hookform/resolvers": "^2.9.5",
45
- "@m4l/core": "^0.0.32",
46
- "@m4l/graphics": "^0.0.22",
47
44
  "@mui/lab": "^5.0.0-alpha.89",
48
45
  "@mui/material": "^5.8.7",
49
46
  "@mui/x-date-pickers": "^5.0.0-beta.0",