@m4l/components 0.0.35 → 0.0.38

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.
Files changed (45) hide show
  1. package/dist/components/CompanyLogo/index.js +2 -3
  2. package/dist/components/DataGrid/index.js +21 -22
  3. package/dist/components/DynamicFilter/components/FilterButton/styles.d.ts +0 -1
  4. package/dist/components/DynamicFilter/components/fieldstypes/BooleanFilter/index.d.ts +4 -0
  5. package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/BooleanFilter/styles.d.ts +0 -0
  6. package/dist/components/DynamicFilter/components/fieldstypes/DateTimeFilter/index.d.ts +4 -0
  7. package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/DateTimeFilter/styles.d.ts +0 -0
  8. package/dist/components/DynamicFilter/components/fieldstypes/NumberFilter/index.d.ts +4 -0
  9. package/dist/components/DynamicFilter/components/{PopupEditFilter/components/StringFilter → fieldstypes/NumberFilter}/styles.d.ts +0 -0
  10. package/dist/components/DynamicFilter/components/fieldstypes/StringFilter/index.d.ts +4 -0
  11. package/dist/components/DynamicFilter/components/fieldstypes/StringFilter/styles.d.ts +3 -0
  12. package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/factory.d.ts +2 -2
  13. package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/validations.d.ts +1 -1
  14. package/dist/components/DynamicFilter/index.js +338 -140
  15. package/dist/components/DynamicFilter/types.d.ts +4 -2
  16. package/dist/components/Icon/index.js +29 -6
  17. package/dist/components/ModalDialog/index.js +6 -6
  18. package/dist/components/NoItemSelected/index.js +2 -3
  19. package/dist/components/ObjectLogs/index.js +17 -7
  20. package/dist/components/{DataGrid/formatters → formatters}/BooleanFormatter/index.d.ts +0 -0
  21. package/dist/components/formatters/BooleanFormatter/index.js +32 -0
  22. package/dist/components/{DataGrid/formatters → formatters}/BooleanFormatter/types.d.ts +2 -0
  23. package/dist/components/{DataGrid/formatters → formatters}/DateFormatter/index.d.ts +0 -0
  24. package/dist/components/formatters/DateFormatter/index.js +55 -0
  25. package/dist/components/{DataGrid/formatters → formatters}/DateFormatter/types.d.ts +4 -2
  26. package/dist/components/{DataGrid/formatters → formatters}/index.d.ts +0 -0
  27. package/dist/components/formatters/types.d.ts +2 -0
  28. package/dist/components/hook-form/RHFDateTime.js +9 -2
  29. package/dist/components/hook-form/RHFUpload.js +2 -2
  30. package/dist/components/index.d.ts +1 -1
  31. package/dist/components/mui_extended/Accordion/index.js +2 -2
  32. package/dist/components/mui_extended/IconButton/index.d.ts +1 -1
  33. package/dist/components/mui_extended/IconButton/index.js +4 -2
  34. package/dist/components/mui_extended/IconButton/types.d.ts +2 -1
  35. package/dist/components/mui_extended/MenuActions/index.js +3 -3
  36. package/dist/components/mui_extended/Pager/index.js +5 -5
  37. package/dist/contexts/ModalContext/index.js +4 -4
  38. package/dist/index.js +3 -3
  39. package/dist/vendor.js +3 -3
  40. package/package.json +2 -5
  41. package/dist/components/DataGrid/formatters/BooleanFormatter/index.js +0 -26
  42. package/dist/components/DataGrid/formatters/DateFormatter/index.js +0 -33
  43. package/dist/components/DynamicFilter/components/PopupEditFilter/components/BooleanFilter/index.d.ts +0 -2
  44. package/dist/components/DynamicFilter/components/PopupEditFilter/components/DateTimeFilter/index.d.ts +0 -2
  45. package/dist/components/DynamicFilter/components/PopupEditFilter/components/StringFilter/index.d.ts +0 -2
@@ -1,10 +1,12 @@
1
1
  import { Maybe } from '@m4l/core';
2
2
  export declare type FieldType = 'number' | 'string' | 'boolean' | 'date' | 'datetime' | 'time' | 'select' | 'in';
3
3
  export declare type OperandType = number | string | boolean | Date | [] | object;
4
- export declare type Operator = 'e' | 'ne' | 'b' | 'gt' | 'gte' | 'lt' | 'lte' | 'c' | 'nc';
4
+ export declare type Operator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'c' | 'nc';
5
5
  export declare const OPERATORS: Array<Operator>;
6
6
  export declare type StringOperator = 'c' | 'nc';
7
7
  export declare const STRING_OPERATORS: Array<StringOperator>;
8
+ export declare type NumberOperator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
9
+ export declare const NUMBER_OPERATORS: Array<NumberOperator>;
8
10
  export declare type BooleanOperator = 'e' | 'ne';
9
11
  export declare const BOOLEAN_OPERATORS: Array<BooleanOperator>;
10
12
  export declare type DateTimeOperator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
@@ -32,7 +34,7 @@ export interface BaseApplyFilter {
32
34
  export interface ValuesFilter {
33
35
  operator: Operator;
34
36
  labelOperator: string;
35
- labelOperands: string;
37
+ labelOperands: string | number;
36
38
  operand1?: Maybe<OperandType>;
37
39
  operand2?: Maybe<OperandType>;
38
40
  }
@@ -1,4 +1,4 @@
1
- import { styled } from "@mui/material";
1
+ import { styled, useTheme } from "@mui/material";
2
2
  import { useState, useEffect } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  const MaskIcon = styled("div", {
@@ -8,7 +8,7 @@ const MaskIcon = styled("div", {
8
8
  mask: `url(${props.src}) no-repeat`,
9
9
  width: props.width === void 0 ? "20px" : props.width,
10
10
  height: props.height === void 0 ? "20px" : props.height,
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
11
+ backgroundColor: props.bgColor
12
12
  }));
13
13
  const WrapperPlaceHolder = styled("div", {
14
14
  shouldForwardProp: (props) => props !== "widht" && props !== "height"
@@ -20,13 +20,35 @@ const WrapperPlaceHolder = styled("div", {
20
20
  height: props.height
21
21
  }));
22
22
  function Icon(props) {
23
- const [resource, setResource] = useState(void 0);
24
23
  const {
25
24
  src,
26
25
  width = "16px",
27
26
  height = "16px",
28
27
  bgColor = "active"
29
28
  } = props;
29
+ const [resource, setResource] = useState(void 0);
30
+ const theme = useTheme();
31
+ const getBgColor = () => {
32
+ if (bgColor === "active") {
33
+ return theme.palette.action.active;
34
+ }
35
+ if (bgColor === "selected") {
36
+ return theme.palette.primary.main;
37
+ }
38
+ if (bgColor === "info") {
39
+ return theme.palette.info.main;
40
+ }
41
+ if (bgColor === "warning") {
42
+ return theme.palette.warning.main;
43
+ }
44
+ if (bgColor === "error") {
45
+ return theme.palette.error.main;
46
+ }
47
+ if (bgColor === "disabled") {
48
+ return theme.palette.action.disabled;
49
+ }
50
+ return bgColor;
51
+ };
30
52
  useEffect(() => {
31
53
  let mounted = true;
32
54
  if (resource)
@@ -34,9 +56,10 @@ function Icon(props) {
34
56
  (async function networkOperation() {
35
57
  await fetch(src).then((response) => {
36
58
  if (mounted) {
59
+ console.log("Icon***", response.body);
37
60
  setResource(response.url);
38
61
  }
39
- }).catch((err) => {
62
+ }).catch((_err) => {
40
63
  });
41
64
  })();
42
65
  return function clenUp() {
@@ -50,10 +73,10 @@ function Icon(props) {
50
73
  width,
51
74
  height,
52
75
  children: resource ? /* @__PURE__ */ jsx(MaskIcon, {
53
- src,
76
+ src: resource,
54
77
  width,
55
78
  height,
56
- bgColor
79
+ bgColor: getBgColor()
57
80
  }) : /* @__PURE__ */ jsx("img", {
58
81
  src: placeHolder,
59
82
  alt: "icon_svg"
@@ -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,10 +63,10 @@ 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, {
@@ -84,7 +84,7 @@ const Header = (props) => {
84
84
  onClick: onCloseModal,
85
85
  "aria-label": "click",
86
86
  children: /* @__PURE__ */ jsx(Icon, {
87
- src: `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/close.svg`
87
+ src: `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/close.svg`
88
88
  })
89
89
  })]
90
90
  });
@@ -19,7 +19,6 @@ const Image = styled("span", {
19
19
  src,
20
20
  theme
21
21
  }) => ({
22
- zIndex: 9,
23
22
  top: 0,
24
23
  height: "100%",
25
24
  width: "100%",
@@ -50,12 +49,12 @@ const Label = styled("span")(({
50
49
  function NoItemSelected() {
51
50
  const {
52
51
  host_static_assets,
53
- environment
52
+ environment_assets
54
53
  } = useEnvironment();
55
54
  const {
56
55
  getLabel
57
56
  } = useModuleDictionary();
58
- const src = `${host_static_assets}/${environment}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
57
+ const src = `${host_static_assets}/${environment_assets}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
59
58
  return /* @__PURE__ */ jsxs(WrapperNoItemSelected, {
60
59
  id: "Wrapper",
61
60
  children: [/* @__PURE__ */ jsx(Image, {
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback, useMemo } from "react";
2
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
- import { D as DateFormatter } from "../DataGrid/formatters/DateFormatter/index.js";
5
+ import { D as DateFormatter } from "../formatters/DateFormatter/index.js";
6
6
  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";
@@ -79,6 +79,10 @@ function DetailDialog(props) {
79
79
  return /* @__PURE__ */ jsx(Container, {
80
80
  id: "objectLogsDetail",
81
81
  children: /* @__PURE__ */ jsx(ReactJson, {
82
+ name: null,
83
+ sortKeys: true,
84
+ displayDataTypes: false,
85
+ quotesOnKeys: false,
82
86
  src: detail
83
87
  })
84
88
  });
@@ -96,7 +100,7 @@ function DetailFormatter(props) {
96
100
  } = useModuleDictionary();
97
101
  const {
98
102
  host_static_assets,
99
- environment
103
+ environment_assets
100
104
  } = useEnvironment();
101
105
  const onClickDetail = () => {
102
106
  openModal({
@@ -116,7 +120,7 @@ function DetailFormatter(props) {
116
120
  onClick: onClickDetail,
117
121
  "aria-label": "filter",
118
122
  children: /* @__PURE__ */ jsx(Icon, {
119
- src: `${host_static_assets}/${environment}/frontend/components/object_logs/assets/icons/search.svg`
123
+ src: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/search.svg`
120
124
  })
121
125
  })
122
126
  });
@@ -125,7 +129,6 @@ function ObjectLogs(props) {
125
129
  const {
126
130
  getLabel
127
131
  } = useModuleDictionary();
128
- useEnvironment();
129
132
  const {
130
133
  resource_id,
131
134
  object_id
@@ -136,7 +139,7 @@ function ObjectLogs(props) {
136
139
  });
137
140
  const dateFormatterCreatedAt = useCallback((rowProps) => /* @__PURE__ */ jsx(DateFormatter, {
138
141
  presentationType: "datetime",
139
- dateTime: rowProps.row.created_at
142
+ value: rowProps.row.created_at
140
143
  }), []);
141
144
  const DetailRowFormatter = useCallback((rowProps) => /* @__PURE__ */ jsx(DetailFormatter, {
142
145
  log_id: rowProps.row.id
@@ -190,13 +193,13 @@ function ObjectLogs(props) {
190
193
  object_id,
191
194
  f: rawFilters
192
195
  });
193
- console.log("filter was change*****", JSON.stringify(rawFilters));
196
+ console.log("filter was change*****", resource_id, object_id, JSON.stringify(rawFilters));
194
197
  };
195
198
  return /* @__PURE__ */ jsxs(Container$1, {
196
199
  children: [/* @__PURE__ */ jsx(Actions, {
197
200
  id: "objectLogsActions",
198
201
  children: /* @__PURE__ */ jsx(DynamicFilter, {
199
- withAllField: false,
202
+ withAllField: true,
200
203
  onChangeFilter,
201
204
  automatic: false,
202
205
  fields: [{
@@ -206,6 +209,13 @@ function ObjectLogs(props) {
206
209
  multiple: false,
207
210
  fixed: true,
208
211
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
212
+ }, {
213
+ name: "user_logs.log_detail",
214
+ label: getLabel("object_logs.log_detail"),
215
+ type: "string",
216
+ multiple: false,
217
+ fixed: false,
218
+ urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
209
219
  }],
210
220
  initialFilters: []
211
221
  })
@@ -0,0 +1,32 @@
1
+ import require$$0 from "react";
2
+ import { useModuleDictionary } from "@m4l/core";
3
+ import { Checkbox } from "@mui/material";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function BooleanFormatter(props) {
6
+ const {
7
+ presentationType,
8
+ value,
9
+ Component = require$$0.Fragment
10
+ } = props;
11
+ const {
12
+ getLabel
13
+ } = useModuleDictionary();
14
+ if (presentationType === "string_yes_no") {
15
+ return /* @__PURE__ */ jsx(Component, {
16
+ children: value ? getLabel("formatters.boolean_yes") : getLabel("formatters.boolean_no")
17
+ });
18
+ }
19
+ if (presentationType === "string_true_false") {
20
+ return /* @__PURE__ */ jsx(Component, {
21
+ children: value ? getLabel("formatters.boolean_true") : getLabel("formatters.boolean_false")
22
+ });
23
+ }
24
+ return /* @__PURE__ */ jsx(Checkbox, {
25
+ checked: value !== void 0 ? value : false,
26
+ size: "small",
27
+ readOnly: true,
28
+ disableFocusRipple: true,
29
+ disableRipple: true
30
+ });
31
+ }
32
+ export { BooleanFormatter as B };
@@ -1,5 +1,7 @@
1
+ import { ComponentForrmaterType } from '../types';
1
2
  export declare type PresentationType = 'string_yes_no' | 'string_true_false' | 'check';
2
3
  export interface BooleanFormatterProps {
4
+ Component?: ComponentForrmaterType;
3
5
  presentationType: PresentationType;
4
6
  value: boolean;
5
7
  }
@@ -0,0 +1,55 @@
1
+ import { useEnvironment } from "@m4l/core";
2
+ import { format } from "date-fns";
3
+ import require$$0 from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function DateFormatter(props) {
6
+ const {
7
+ presentationType,
8
+ value,
9
+ format: format$1,
10
+ Component = require$$0.Fragment
11
+ } = props;
12
+ const {
13
+ dfnsFormat
14
+ } = useEnvironment();
15
+ let finalFormat = format$1 || dfnsFormat.datetime_format;
16
+ let result;
17
+ let resultDate;
18
+ switch (presentationType) {
19
+ case "datetime":
20
+ finalFormat = format$1 || dfnsFormat.datetime_format;
21
+ break;
22
+ case "date":
23
+ finalFormat = format$1 || dfnsFormat.date_format;
24
+ break;
25
+ case "time":
26
+ finalFormat = format$1 || dfnsFormat.time_format;
27
+ break;
28
+ }
29
+ try {
30
+ if (typeof value === "number" || typeof value === "string") {
31
+ resultDate = new Date(value);
32
+ } else {
33
+ resultDate = value;
34
+ }
35
+ result = format(resultDate, finalFormat);
36
+ } catch (e) {
37
+ result = "err_typing";
38
+ }
39
+ switch (Component) {
40
+ case "div":
41
+ return /* @__PURE__ */ jsx("div", {
42
+ className: "DateFormatter",
43
+ children: result
44
+ });
45
+ case "span":
46
+ return /* @__PURE__ */ jsx("span", {
47
+ className: "DateFormatter",
48
+ children: result
49
+ });
50
+ }
51
+ return /* @__PURE__ */ jsx(Component, {
52
+ children: result
53
+ });
54
+ }
55
+ export { DateFormatter as D };
@@ -1,6 +1,8 @@
1
+ import { ComponentForrmaterType } from '../types';
1
2
  export declare type PresentationType = 'date' | 'datetime' | 'time';
2
3
  export interface DateFormatterProps {
4
+ Component?: ComponentForrmaterType;
3
5
  presentationType: PresentationType;
4
- formatDate?: string;
5
- dateTime: Date | string | number;
6
+ format?: string;
7
+ value: Date | string | number;
6
8
  }
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare type ComponentForrmaterType = 'div' | 'span' | ((props: PropsWithChildren<any>) => JSX.Element);
@@ -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) => {
@@ -133,7 +133,7 @@ function UploadImage({
133
133
  });
134
134
  const {
135
135
  host_static_assets,
136
- environment
136
+ environment_assets
137
137
  } = useEnvironment();
138
138
  const {
139
139
  getLabel
@@ -183,7 +183,7 @@ function UploadImage({
183
183
  className: "ContainerUploadBody",
184
184
  children: [/* @__PURE__ */ jsx(WrapperImage, {
185
185
  children: /* @__PURE__ */ jsx(Image, {
186
- src: `${host_static_assets}/${environment}/frontend/components/upload_image/assets/img/upload_image_illustration.svg`,
186
+ src: `${host_static_assets}/${environment_assets}/frontend/components/upload_image/assets/img/upload_image_illustration.svg`,
187
187
  effect: "opacity",
188
188
  width: "100%",
189
189
  height: "auto",
@@ -2,8 +2,8 @@ export * from '../components/animate';
2
2
  export * from '../components/hook-form';
3
3
  export * from '../components/mui_extended';
4
4
  export * from '../components/CompanyLogo';
5
+ export * from './formatters';
5
6
  export { DataGrid } from '../components/DataGrid';
6
- export { DateFormatter, BooleanFormatter } from '../components/DataGrid/formatters';
7
7
  export type { Column } from 'react-data-grid';
8
8
  export type { RowKey } from '../components/DataGrid/types';
9
9
  export { getGridComponentsDictionary } from '../components/DataGrid/dictionary';
@@ -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, {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { IconButtonProps as MUIIconButtonProps } from '@mui/material';
3
3
  import { IconButtonProps } from './types';
4
- export declare function IconButton({ src, tooltip, size, dictionaryTooltip, ...other }: IconButtonProps & MUIIconButtonProps): JSX.Element;
4
+ export declare function IconButton({ src, tooltip, size, dictionaryTooltip, bgColor, ...other }: IconButtonProps & MUIIconButtonProps): JSX.Element;
5
5
  export default IconButton;
@@ -64,6 +64,7 @@ function IconButton({
64
64
  tooltip,
65
65
  size = "small",
66
66
  dictionaryTooltip,
67
+ bgColor = "active",
67
68
  ...other
68
69
  }) {
69
70
  const {
@@ -72,9 +73,10 @@ function IconButton({
72
73
  const iconMemo = useMemo(() => {
73
74
  console.log("IconButton", size, other, src);
74
75
  return /* @__PURE__ */ jsx(Icon, {
75
- src
76
+ src,
77
+ bgColor
76
78
  });
77
- }, [src]);
79
+ }, [src, bgColor]);
78
80
  const finalTooltip = useMemo(() => {
79
81
  if (dictionaryTooltip && getLabel) {
80
82
  return getLabel(dictionaryTooltip);
@@ -1,4 +1,5 @@
1
- export interface IconButtonProps {
1
+ import { OwnProps } from '../../Icon/types';
2
+ export interface IconButtonProps extends Pick<OwnProps, 'bgColor'> {
2
3
  src: string;
3
4
  tooltip?: string;
4
5
  dictionaryTooltip?: string;
@@ -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
  };
@@ -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/index.js CHANGED
@@ -26,9 +26,9 @@ export { P as Pager, g as getPagerComponentsDictionary } from "./components/mui_
26
26
  export { T as Tab } from "./components/mui_extended/Tab/index.js";
27
27
  export { T as Typography } from "./components/mui_extended/Typography/index.js";
28
28
  export { C as CompanyLogo } from "./components/CompanyLogo/index.js";
29
+ export { B as BooleanFormatter } from "./components/formatters/BooleanFormatter/index.js";
30
+ export { D as DateFormatter } from "./components/formatters/DateFormatter/index.js";
29
31
  export { D as DataGrid, g as getGridComponentsDictionary } from "./components/DataGrid/index.js";
30
- export { B as BooleanFormatter } from "./components/DataGrid/formatters/BooleanFormatter/index.js";
31
- export { D as DateFormatter } from "./components/DataGrid/formatters/DateFormatter/index.js";
32
32
  export { D as DynamicFilter } from "./components/DynamicFilter/index.js";
33
33
  export { F as FormActions, d as defaultActionsDictionary, g as getActionnsComponentsDictionary } from "./components/FormActions/index.js";
34
34
  export { I as Icon } from "./components/Icon/index.js";
@@ -62,10 +62,10 @@ import "./commonjs.js";
62
62
  import "react-dom";
63
63
  import "clsx";
64
64
  import "./react-lazy-load-image-component.js";
65
+ import "date-fns";
65
66
  import "@m4l/graphics";
66
67
  import "react-dnd";
67
68
  import "react-dnd-html5-backend";
68
- import "date-fns";
69
69
  import "./simplebar.js";
70
70
  import "./core-js.js";
71
71
  import "./juggle.js";
package/dist/vendor.js CHANGED
@@ -25,12 +25,12 @@ import "./components/mui_extended/MenuPopover/index.js";
25
25
  import "./components/mui_extended/MenuActions/index.js";
26
26
  import "./components/mui_extended/Pager/index.js";
27
27
  import "./components/mui_extended/Tab/index.js";
28
+ import "date-fns";
28
29
  import "@m4l/graphics";
29
30
  import "./components/CompanyLogo/index.js";
30
31
  import "./components/DataGrid/index.js";
31
32
  import "react-dnd";
32
33
  import "react-dnd-html5-backend";
33
- import "date-fns";
34
34
  import "./components/ScrollBar/index.js";
35
35
  import "./components/DynamicFilter/index.js";
36
36
  import "./simplebar.js";
@@ -60,8 +60,8 @@ import "./components/mui_extended/BoxIcon/index.js";
60
60
  import "./components/mui_extended/Breadcrumbs/index.js";
61
61
  import "./components/mui_extended/LinkWithRoute/index.js";
62
62
  import "./components/mui_extended/Typography/index.js";
63
- import "./components/DataGrid/formatters/BooleanFormatter/index.js";
64
- import "./components/DataGrid/formatters/DateFormatter/index.js";
63
+ import "./components/formatters/BooleanFormatter/index.js";
64
+ import "./components/formatters/DateFormatter/index.js";
65
65
  import "./components/LanguagePopover/index.js";
66
66
  import "./components/Loadable/index.js";
67
67
  import "./hooks/useModal/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.35",
4
+ "version": "0.0.38",
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.30",
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.24",
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.24",
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",