@m4l/components 0.0.48 → 0.0.51

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/dist/commonjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "react";
2
- import "prop-types";
3
2
  import "react-dom";
3
+ import "prop-types";
4
4
  import "clsx";
5
5
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
6
6
  function getDefaultExportFromCjs(x) {
@@ -7,6 +7,7 @@ const ActionCancel = (props) => {
7
7
  } = useModuleDictionary();
8
8
  return /* @__PURE__ */ jsx(Button, {
9
9
  variant: "outlined",
10
+ color: "inherit",
10
11
  ...props,
11
12
  children: getLabel("common_actions.cancel")
12
13
  });
@@ -29,13 +29,6 @@ function ActionFormCancel(props) {
29
29
  } = useFormState({
30
30
  control
31
31
  });
32
- if (isSkeleton) {
33
- return /* @__PURE__ */ jsx(Skeleton, {
34
- variant: "text",
35
- width: 57,
36
- height: 30
37
- });
38
- }
39
32
  const onConfirmCancel = () => {
40
33
  navigate(to, navigateOptions);
41
34
  };
@@ -43,14 +36,21 @@ function ActionFormCancel(props) {
43
36
  if (isDirty) {
44
37
  openModalConfirm({
45
38
  variant: "warning",
46
- title: getLabel("form_provider.confirm_quit_title"),
47
- msg: getLabel("form_provider.confirm_quit_msg"),
39
+ title: getLabel("common_actions.confirm_quit_title"),
40
+ msg: getLabel("common_actions.confirm_quit_msg"),
48
41
  onClickIntro: onConfirmCancel
49
42
  });
50
43
  } else {
51
44
  onConfirmCancel();
52
45
  }
53
46
  }, [getLabel, isDirty, onConfirmCancel, openModalConfirm]);
47
+ if (isSkeleton) {
48
+ return /* @__PURE__ */ jsx(Skeleton, {
49
+ variant: "text",
50
+ width: 57,
51
+ height: 30
52
+ });
53
+ }
54
54
  return /* @__PURE__ */ jsx(Button, {
55
55
  variant: "outlined",
56
56
  color: "inherit",
@@ -26,6 +26,7 @@ function ActionFormIntro(props) {
26
26
  return /* @__PURE__ */ jsx(LoadingButton, {
27
27
  variant: "contained",
28
28
  type: "submit",
29
+ color: "primary",
29
30
  loading: isSubmitting,
30
31
  ...props,
31
32
  children: getLabel("common_actions.intro")
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import type { StandardActionsProps } from './types';
3
- export declare const Actions: (props: StandardActionsProps) => JSX.Element;
2
+ import type { CommonActionsProps } from './types';
3
+ export declare const Actions: (props: CommonActionsProps) => JSX.Element;
@@ -1,16 +1,13 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useNavigate } from "react-router-dom";
3
- import { createContext, useCallback, useState, useMemo, forwardRef, useRef, useImperativeHandle, useEffect } from "react";
4
- import { useFormContext, useFormState } from "react-hook-form";
5
- import { useModuleDictionary, useFlagsPresent, useEnvironment } from "@m4l/core";
6
- import { LoadingButton } from "@mui/lab";
7
- import { Skeleton, Button, IconButton, Tooltip, MenuItem, Checkbox } from "@mui/material";
8
1
  import { styled } from "@mui/material/styles";
9
- import { u as useModal } from "../../../../hooks/useModal/index.js";
10
2
  import { I as IconButton$1 } from "../../../mui_extended/IconButton/index.js";
3
+ import { useEnvironment, useModuleDictionary } from "@m4l/core";
4
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
11
5
  import { u as useBase, a as useFilters, O as OriginalGridWrapperStyled } from "../../../DataGrid/index.js";
12
6
  import { P as Pager } from "../../../mui_extended/Pager/index.js";
7
+ import { IconButton, Tooltip, MenuItem, Skeleton, Checkbox } from "@mui/material";
8
+ import { useState, useMemo, forwardRef, useRef, useImperativeHandle, useEffect, useCallback } from "react";
13
9
  import { D as DataGrid$1 } from "../../../../react-data-grid.js";
10
+ import { u as useModal } from "../../../../hooks/useModal/index.js";
14
11
  import { A as ActionCancel } from "../ActionCancel/index.js";
15
12
  import { A as ActionIntro } from "../ActionIntro/index.js";
16
13
  import { M as MenuPopover } from "../../../mui_extended/MenuPopover/index.js";
@@ -18,150 +15,10 @@ import { I as Icon } from "../../../Icon/index.js";
18
15
  import { useResponsiveDesktop } from "@m4l/graphics";
19
16
  import "@mui/material/Button";
20
17
  import "../../../../vendor.js";
18
+ import "react-hook-form";
19
+ import "react-router-dom";
21
20
  import "../../../../contexts/ModalContext/index.js";
22
- const WrapperFormActions = styled("div")(({
23
- theme
24
- }) => ({
25
- paddingTop: theme.spacing(3),
26
- marginRight: theme.spacing(1.5),
27
- display: "flex",
28
- flexDirection: "row",
29
- justifyContent: "flex-end",
30
- "& > button": {
31
- marginLeft: "10px"
32
- },
33
- "& .MuiLoadingButton-root ": {
34
- minWidth: "80px"
35
- }
36
- }));
37
- const WrapperSKTFormActions = styled("div")(({
38
- theme
39
- }) => ({
40
- display: "grid",
41
- gridTemplateColumns: "auto auto",
42
- margin: "0px",
43
- gridGap: `${theme.spacing(3)}`,
44
- justifyContent: "flex-end",
45
- paddingTop: `${theme.spacing(3)}`,
46
- borderTop: `1px solid ${theme.palette.divider}`,
47
- [theme.breakpoints.up("sm")]: {
48
- margin: `0 ${theme.spacing(4.5)}`
49
- }
50
- }));
51
- const initialState = {
52
- variantColor: "primary"
53
- };
54
- const CommonActionsContext = createContext(initialState);
55
- function CommonActionsProvider(props) {
56
- const {
57
- children,
58
- variantColor
59
- } = props;
60
- return /* @__PURE__ */ jsx(CommonActionsContext.Provider, {
61
- value: {
62
- variantColor
63
- },
64
- children
65
- });
66
- }
67
- const WrapperStandarActions = styled("div")(({
68
- theme
69
- }) => ({
70
- paddingTop: theme.spacing(3),
71
- display: "flex",
72
- flexDirection: "row",
73
- justifyContent: "flex-end",
74
- "& > button": {
75
- marginLeft: "10px"
76
- }
77
- }));
78
- const Actions$1 = (props) => {
79
- const {
80
- children,
81
- variantColor = "primary"
82
- } = props;
83
- return /* @__PURE__ */ jsx(WrapperStandarActions, {
84
- id: "WrapperStandarActions",
85
- children: /* @__PURE__ */ jsx(CommonActionsProvider, {
86
- variantColor,
87
- children
88
- })
89
- });
90
- };
91
- function SKTFormActions() {
92
- return /* @__PURE__ */ jsxs(WrapperSKTFormActions, {
93
- children: [/* @__PURE__ */ jsx(Skeleton, {
94
- variant: "text",
95
- width: 57,
96
- height: 30
97
- }), /* @__PURE__ */ jsx(Skeleton, {
98
- variant: "text",
99
- width: 57,
100
- height: 30
101
- })]
102
- });
103
- }
104
- function FormActions(props) {
105
- const {
106
- withIntro,
107
- urlCancel
108
- } = props;
109
- const navigate = useNavigate();
110
- const {
111
- getLabel
112
- } = useModuleDictionary();
113
- const isSkeleton = !useFlagsPresent(["dictionary_loaded", "form_loaded"]);
114
- const {
115
- openModalConfirm
116
- } = useModal();
117
- const {
118
- control
119
- } = useFormContext();
120
- const {
121
- isDirty,
122
- isSubmitting
123
- } = useFormState({
124
- control
125
- });
126
- const onConfirmCancel = useCallback(() => {
127
- if (typeof urlCancel === "number") {
128
- navigate(urlCancel);
129
- }
130
- if (urlCancel && typeof urlCancel === "undefined") {
131
- navigate(urlCancel, {
132
- replace: false
133
- });
134
- }
135
- }, [navigate, urlCancel]);
136
- const onClickCancel = useCallback(() => {
137
- if (isDirty) {
138
- openModalConfirm({
139
- variant: "warning",
140
- title: getLabel("form_provider.confirm_quit_title"),
141
- msg: getLabel("form_provider.confirm_quit_msg"),
142
- onClickIntro: onConfirmCancel
143
- });
144
- } else {
145
- onConfirmCancel();
146
- }
147
- }, [getLabel, isDirty, onConfirmCancel, openModalConfirm]);
148
- if (isSkeleton) {
149
- return /* @__PURE__ */ jsx(SKTFormActions, {});
150
- }
151
- return /* @__PURE__ */ jsxs(WrapperFormActions, {
152
- children: [urlCancel && /* @__PURE__ */ jsx(Button, {
153
- variant: "outlined",
154
- color: "inherit",
155
- onClick: onClickCancel,
156
- children: getLabel("actions.action_cancel")
157
- }), withIntro && /* @__PURE__ */ jsx(LoadingButton, {
158
- variant: "contained",
159
- type: "submit",
160
- loading: isSubmitting,
161
- children: getLabel("actions.action_accept")
162
- })]
163
- });
164
- }
21
+ import "@mui/lab";
165
22
  const WrapperMenuActions = styled(IconButton)(() => ({}));
166
23
  const LabelMemuItem = styled("div")(({
167
24
  theme
@@ -719,6 +576,26 @@ const SKTWrapperColumnsSettings = styled("div")(({ theme }) => ({
719
576
  minWidth: theme.spacing(3.75),
720
577
  height: theme.spacing(3.75)
721
578
  }));
579
+ const WrapperStandarActions = styled("div")(({
580
+ theme
581
+ }) => ({
582
+ paddingTop: theme.spacing(3),
583
+ display: "flex",
584
+ flexDirection: "row",
585
+ justifyContent: "flex-end",
586
+ "& > button": {
587
+ marginLeft: "10px"
588
+ }
589
+ }));
590
+ const Actions$1 = (props) => {
591
+ const {
592
+ children
593
+ } = props;
594
+ return /* @__PURE__ */ jsx(WrapperStandarActions, {
595
+ id: "WrapperStandarActions",
596
+ children
597
+ });
598
+ };
722
599
  function Settings() {
723
600
  const {
724
601
  openModal,
@@ -962,19 +839,22 @@ function Actions(props) {
962
839
  children: [withRowsCount && isDesktop && /* @__PURE__ */ jsx(RowsCount, {}), withPager && pagerOptions && /* @__PURE__ */ jsx(Pager, {
963
840
  ...pagerOptions,
964
841
  totalRecords: pagerOptions.totalRecords,
965
- isSkeleton
842
+ isSkeleton,
843
+ isDesktop
966
844
  }), typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}), withLocalFilters && /* @__PURE__ */ jsx(Filter, {}), withSettings && /* @__PURE__ */ jsx(Settings, {
967
845
  ...settingsProps
968
846
  })]
969
847
  });
970
848
  }
971
- function getStandardActionsDictionary() {
849
+ function getCommonActionsDictionary() {
972
850
  return ["common_actions"];
973
851
  }
974
- const defaultActionsDictionary = {
852
+ const defaultCommonActionsDictionary = {
975
853
  common_actions: {
976
854
  cancel: "Cancel",
977
- intro: "Intro"
855
+ intro: "Intro",
856
+ confirm_quit_title: "Confirm",
857
+ confirm_quit_msg: "Are your sure exit?"
978
858
  }
979
859
  };
980
- export { ActionsColumn as A, FormActions as F, LabelMemuItem as L, MenuActions as M, PagerActions as P, Actions as a, Actions$1 as b, defaultActionsDictionary as d, getStandardActionsDictionary as g };
860
+ export { ActionsColumn as A, LabelMemuItem as L, MenuActions as M, PagerActions as P, Actions as a, Actions$1 as b, defaultCommonActionsDictionary as d, getCommonActionsDictionary as g };
@@ -1,6 +1,4 @@
1
1
  import { ReactNode } from 'react';
2
- import { VariantColor } from '../../../../utils/types';
3
- export interface StandardActionsProps {
2
+ export interface CommonActionsProps {
4
3
  children: ReactNode;
5
- variantColor?: VariantColor;
6
4
  }
@@ -1,3 +1,3 @@
1
1
  import type { Dictionary } from '@m4l/core';
2
- export declare function getStandardActionsDictionary(): string[];
3
- export declare const defaultActionsDictionary: Dictionary;
2
+ export declare function getCommonActionsDictionary(): string[];
3
+ export declare const defaultCommonActionsDictionary: Dictionary;
@@ -5,13 +5,9 @@ import { useModuleDictionary, useHostTools, useEnvironment, voidFunction, useFla
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";
8
- import "react-router-dom";
9
- import "@mui/lab";
10
- import { styled as styled$1, Skeleton, MenuItem, useTheme, Popper, Button } from "@mui/material";
11
- import { L as LabelMemuItem } from "../CommonActions/components/Actions/index.js";
12
- import "../../contexts/ModalContext/index.js";
13
8
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
14
9
  import { R as RHFAutocomplete } from "../../vendor.js";
10
+ import { styled as styled$1, Skeleton, MenuItem, useTheme, Popper } from "@mui/material";
15
11
  import "../hook-form/RHFAutocompleteAsync/index.js";
16
12
  import "../hook-form/RHFCheckbox/index.js";
17
13
  import { R as RHFDateTime } from "../hook-form/RHFDateTime.js";
@@ -24,7 +20,14 @@ import "../hook-form/RHFUpload.js";
24
20
  import { I as IconButton } from "../mui_extended/IconButton/index.js";
25
21
  import { I as Icon } from "../Icon/index.js";
26
22
  import "../../simplebar.js";
23
+ import { L as LabelMemuItem, b as Actions } from "../CommonActions/components/Actions/index.js";
27
24
  import { M as MenuPopover } from "../mui_extended/MenuPopover/index.js";
25
+ import { A as ActionCancel } from "../CommonActions/components/ActionCancel/index.js";
26
+ import { A as ActionIntro } from "../CommonActions/components/ActionIntro/index.js";
27
+ import "react-router-dom";
28
+ import "@mui/material/Button";
29
+ import "../../contexts/ModalContext/index.js";
30
+ import "@mui/lab";
28
31
  import { useResponsiveDesktop } from "@m4l/graphics";
29
32
  const WrapperApplyedFilters = styled("div")(({
30
33
  theme
@@ -840,7 +843,7 @@ function BaseProvider(props) {
840
843
  const all_fields = useMemo(() => {
841
844
  return {
842
845
  ...ALL_FIELDS,
843
- label: getLabel("filter.all_fields"),
846
+ label: getLabel("dynamic_filter.all_fields"),
844
847
  urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/all_fields.svg`
845
848
  };
846
849
  }, [getLabel, host_static_assets, environment_assets]);
@@ -1136,6 +1139,7 @@ function ApplyedFilter(props) {
1136
1139
  children: labelOperands
1137
1140
  })]
1138
1141
  }), !fixed && /* @__PURE__ */ jsx(IconButton, {
1142
+ size: "small",
1139
1143
  src: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/close_filter.svg`,
1140
1144
  onClick: onDelete
1141
1145
  })]
@@ -1431,7 +1435,7 @@ const WrapperPopupEditFilter = styled("div")(({
1431
1435
  backgroundColor: theme.palette.background.default,
1432
1436
  borderRadius: theme.spacing(1)
1433
1437
  }));
1434
- const PopperActionsContainer = styled("div")(({
1438
+ styled("div")(({
1435
1439
  theme
1436
1440
  }) => ({
1437
1441
  display: "flex",
@@ -1518,7 +1522,6 @@ const PopupEditFilter = () => {
1518
1522
  onSubmit,
1519
1523
  values,
1520
1524
  validationSchema: popupValidationSchema,
1521
- urlCancel: -1,
1522
1525
  children: /* @__PURE__ */ jsxs(WrapperPopupEditFilter, {
1523
1526
  children: [/* @__PURE__ */ jsxs(HeaderContainer, {
1524
1527
  children: [field?.urlIcon && /* @__PURE__ */ jsx(Icon, {
@@ -1528,18 +1531,10 @@ const PopupEditFilter = () => {
1528
1531
  })]
1529
1532
  }), /* @__PURE__ */ jsx(PopupEditFilterComponent, {
1530
1533
  filter
1531
- }), /* @__PURE__ */ jsxs(PopperActionsContainer, {
1532
- children: [/* @__PURE__ */ jsx(Button, {
1533
- variant: "outlined",
1534
- color: "inherit",
1535
- onClick: onClose,
1536
- children: `Cerrar`
1537
- }), /* @__PURE__ */ jsx(Button, {
1538
- variant: "contained",
1539
- color: "primary",
1540
- type: "submit",
1541
- children: `Agregar ${filter.id}`
1542
- })]
1534
+ }), /* @__PURE__ */ jsxs(Actions, {
1535
+ children: [/* @__PURE__ */ jsx(ActionCancel, {
1536
+ onClick: onClose
1537
+ }), /* @__PURE__ */ jsx(ActionIntro, {})]
1543
1538
  })]
1544
1539
  })
1545
1540
  })
@@ -8,7 +8,7 @@ import { useResponsiveDesktop } from "@m4l/graphics";
8
8
  import { useEnvironment } from "@m4l/core";
9
9
  import { I as Icon } from "../Icon/index.js";
10
10
  import { jsxs, jsx } from "react/jsx-runtime";
11
- import { b as Actions, g as getStandardActionsDictionary } from "../CommonActions/components/Actions/index.js";
11
+ import { b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.js";
12
12
  const WrapperDialog = styled(Dialog)(() => ({}));
13
13
  const Container = styled("div")(({ theme }) => ({
14
14
  display: "flex",
@@ -172,7 +172,7 @@ const ModalDialog = () => {
172
172
  });
173
173
  };
174
174
  function getModalDialogComponentsDictionary() {
175
- return ["modal_dialog"].concat(getStandardActionsDictionary());
175
+ return ["modal_dialog"].concat(getCommonActionsDictionary());
176
176
  }
177
177
  const defaultModalDialogDictionary = {
178
178
  modal_dialog: {}
@@ -160,8 +160,8 @@ function ObjectLogs(props) {
160
160
  name: getLabel("object_logs.resource_name"),
161
161
  type: "text"
162
162
  }, {
163
- key: "preview",
164
- name: getLabel("object_logs.preview"),
163
+ key: "log_preview",
164
+ name: getLabel("object_logs.log_preview"),
165
165
  type: "text"
166
166
  }, {
167
167
  key: "Detail",
@@ -208,16 +208,30 @@ function ObjectLogs(props) {
208
208
  automatic: false,
209
209
  fields: [{
210
210
  name: "user_logs.created_at",
211
- label: getLabel("object_logs.date"),
211
+ label: getLabel("object_logs.created_at"),
212
212
  type: "datetime",
213
213
  multiple: false,
214
+ presence: "fixed",
215
+ urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
216
+ }, {
217
+ name: "users.email",
218
+ label: getLabel("object_logs.email"),
219
+ type: "string",
220
+ multiple: true,
221
+ presence: "optional",
222
+ urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
223
+ }, {
224
+ name: "user_logs.log_preview",
225
+ label: getLabel("object_logs.log_preview"),
226
+ type: "string",
227
+ multiple: true,
214
228
  presence: "optional",
215
229
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
216
230
  }, {
217
231
  name: "user_logs.log_detail",
218
232
  label: getLabel("object_logs.log_detail"),
219
233
  type: "string",
220
- multiple: false,
234
+ multiple: true,
221
235
  presence: "optional",
222
236
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
223
237
  }],
@@ -254,14 +268,11 @@ function getObjectLogsComponentsDictionary() {
254
268
  }
255
269
  const defaultObjectLogDictionary = {
256
270
  object_logs: {
257
- start_date: "Start date",
258
- end_date: "End date",
259
- search: "Search",
260
- date_time: "Date time",
261
- user: "User",
262
- module: "Module",
271
+ created_at: "Start date",
272
+ user: "User/email",
273
+ resource_name: "Resource",
263
274
  privilege_name: "Privilege",
264
- log_resume: "Log",
275
+ log_preview: "Log",
265
276
  log_detail: "Detail",
266
277
  ip: "Ip"
267
278
  }
@@ -2,8 +2,7 @@ import { useEffect } from "react";
2
2
  import { useForm, FormProvider as FormProvider$1 } from "react-hook-form";
3
3
  import { o } from "../../../node_modules.js";
4
4
  import { styled } from "@mui/material/styles";
5
- import { F as FormActions } from "../../CommonActions/components/Actions/index.js";
6
- import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { jsx } from "react/jsx-runtime";
7
6
  const WrapperFormProvider = styled("form")(() => ({
8
7
  display: "flex",
9
8
  flexDirection: "column",
@@ -15,9 +14,7 @@ function FormProvider(props) {
15
14
  children,
16
15
  onSubmit,
17
16
  values,
18
- validationSchema,
19
- withIntro,
20
- urlCancel = -1
17
+ validationSchema
21
18
  } = props;
22
19
  const methods = useForm({
23
20
  resolver: o(validationSchema),
@@ -38,13 +35,10 @@ function FormProvider(props) {
38
35
  }, [methods, values]);
39
36
  return /* @__PURE__ */ jsx(FormProvider$1, {
40
37
  ...methods,
41
- children: /* @__PURE__ */ jsxs(WrapperFormProvider, {
38
+ children: /* @__PURE__ */ jsx(WrapperFormProvider, {
42
39
  id: "formProvider",
43
40
  onSubmit: methods.handleSubmit(onSubmit),
44
- children: [children, withIntro && /* @__PURE__ */ jsx(FormActions, {
45
- withIntro,
46
- urlCancel
47
- })]
41
+ children
48
42
  })
49
43
  });
50
44
  }
@@ -5,6 +5,4 @@ export interface FormProviderProps {
5
5
  onSubmit: (data: FieldValues) => void;
6
6
  values: FieldValues;
7
7
  validationSchema: any;
8
- withIntro?: boolean;
9
- urlCancel?: string | number;
10
8
  }
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ export { B as BoxIcon } from "./components/mui_extended/BoxIcon/index.js";
20
20
  export { B as Breadcrumbs } from "./components/mui_extended/Breadcrumbs/index.js";
21
21
  export { L as LinkWithRoute } from "./components/mui_extended/LinkWithRoute/index.js";
22
22
  export { L as LoadingButton } from "./components/mui_extended/LoadingButton/index.js";
23
- export { b as Actions, M as MenuActions, d as defaultActionsDictionary, g as getStandardActionsDictionary } from "./components/CommonActions/components/Actions/index.js";
23
+ export { b as Actions, M as MenuActions, d as defaultCommonActionsDictionary, g as getCommonActionsDictionary } from "./components/CommonActions/components/Actions/index.js";
24
24
  export { M as MenuPopover } from "./components/mui_extended/MenuPopover/index.js";
25
25
  export { P as Pager, g as getPagerComponentsDictionary } from "./components/mui_extended/Pager/index.js";
26
26
  export { T as Tab } from "./components/mui_extended/Tab/index.js";
@@ -57,15 +57,15 @@ import "react-hook-form";
57
57
  import "./node_modules.js";
58
58
  import "prop-types";
59
59
  import "@mui/material/styles";
60
- import "@mui/material/Button";
61
- import "react-router-dom";
62
- import "@mui/lab";
63
60
  import "@mui/x-date-pickers";
64
61
  import "./lodash.js";
65
62
  import "./commonjs.js";
66
63
  import "react-dom";
67
64
  import "clsx";
68
65
  import "./react-lazy-load-image-component.js";
66
+ import "react-router-dom";
67
+ import "@mui/lab";
68
+ import "@mui/material/Button";
69
69
  import "@m4l/graphics";
70
70
  import "react-dnd";
71
71
  import "react-dnd-html5-backend";
package/dist/vendor.js CHANGED
@@ -1,36 +1,36 @@
1
1
  import "./components/mui_extended/IconButton/index.js";
2
2
  import "framer-motion";
3
- import { styled, Skeleton, Autocomplete, TextField } from "@mui/material";
3
+ import { Skeleton, Autocomplete, TextField, styled as styled$1 } from "@mui/material";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
- import { useModuleSkeleton, useModuleDictionary } from "@m4l/core";
6
- import MuiButton from "@mui/material/Button";
7
5
  import "react";
8
6
  import { useFormContext, Controller } from "react-hook-form";
9
7
  import "./components/hook-form/FormProvider/index.js";
10
- import "react-router-dom";
11
- import "@mui/lab";
12
- import "./components/CommonActions/components/Actions/index.js";
13
- import "./contexts/ModalContext/index.js";
8
+ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
14
9
  import "./components/hook-form/RHFAutocompleteAsync/index.js";
15
10
  import "./components/hook-form/RHFCheckbox/index.js";
16
11
  import "./components/hook-form/RHFDateTime.js";
17
12
  import "@mui/x-date-pickers";
18
13
  import "./components/hook-form/RHFTextField/index.js";
19
14
  import "./lodash.js";
20
- import { styled as styled$1 } from "@mui/material/styles";
15
+ import { styled } from "@mui/material/styles";
21
16
  import "./react-lazy-load-image-component.js";
22
17
  import "./components/Image/index.js";
23
18
  import "./components/hook-form/RHFUpload.js";
24
19
  import "./components/Icon/index.js";
20
+ import "react-router-dom";
21
+ import "@mui/lab";
25
22
  import "./components/mui_extended/LoadingButton/index.js";
26
23
  import "./components/mui_extended/MenuPopover/index.js";
24
+ import "./components/CommonActions/components/Actions/index.js";
27
25
  import "./components/mui_extended/Pager/index.js";
28
26
  import "./components/mui_extended/Tab/index.js";
27
+ import MuiButton from "@mui/material/Button";
29
28
  import "@m4l/graphics";
30
29
  import "./components/CompanyLogo/index.js";
31
30
  import "./components/DataGrid/index.js";
32
31
  import "react-dnd";
33
32
  import "react-dnd-html5-backend";
33
+ import "./contexts/ModalContext/index.js";
34
34
  import "./components/ScrollBar/index.js";
35
35
  import "./components/DynamicFilter/index.js";
36
36
  import "./simplebar.js";
@@ -67,55 +67,12 @@ import "./components/CommonActions/components/ActionFormIntro/index.js";
67
67
  import "./components/LanguagePopover/index.js";
68
68
  import "./components/Loadable/index.js";
69
69
  import "./hooks/useModal/index.js";
70
- const getVariantColor = (variant) => {
71
- switch (variant) {
72
- case "warning":
73
- return "warning";
74
- case "delete":
75
- return "error";
76
- case "info":
77
- return "info";
78
- }
79
- return "primary";
80
- };
81
- const getThemeVariantColor = (theme, variant) => {
82
- switch (variant) {
83
- case "warning":
84
- theme.palette.warning.main;
85
- break;
86
- case "delete":
87
- theme.palette.error.main;
88
- break;
89
- case "info":
90
- theme.palette.info.main;
91
- break;
92
- }
93
- return theme.palette.text.primary;
94
- };
95
- const SKTButton = styled(Skeleton)(({
96
- theme
97
- }) => ({
98
- borderRadius: theme.spacing(0.5)
99
- }));
100
- const Button = (props) => {
101
- const isSkeleton = useModuleSkeleton();
102
- if (isSkeleton) {
103
- return /* @__PURE__ */ jsx(SKTButton, {
104
- variant: "rectangular",
105
- width: "100px",
106
- height: "36px"
107
- });
108
- }
109
- return /* @__PURE__ */ jsx(MuiButton, {
110
- ...props
111
- });
112
- };
113
- const SKTRHFAutocompleteWrapper = styled$1("div")(() => ({
70
+ const SKTRHFAutocompleteWrapper = styled("div")(() => ({
114
71
  display: "flex",
115
72
  width: "100%",
116
73
  flexDirection: "column"
117
74
  }));
118
- styled$1("div")(({
75
+ styled("div")(({
119
76
  theme
120
77
  }) => ({
121
78
  display: "flex",
@@ -125,7 +82,7 @@ styled$1("div")(({
125
82
  justifyContent: "flex-start"
126
83
  }
127
84
  }));
128
- const SKTInputText = styled$1("div")(({
85
+ const SKTInputText = styled("div")(({
129
86
  theme
130
87
  }) => ({
131
88
  width: "100%",
@@ -141,7 +98,7 @@ const SKTInputText = styled$1("div")(({
141
98
  width: "100%"
142
99
  }
143
100
  }));
144
- styled$1("div")(() => ({
101
+ styled("div")(() => ({
145
102
  display: "flex",
146
103
  width: "100%",
147
104
  "& .MuiAutocomplete-root": {
@@ -243,4 +200,47 @@ function RHFAutocomplete(props) {
243
200
  }
244
201
  });
245
202
  }
203
+ const getVariantColor = (variant) => {
204
+ switch (variant) {
205
+ case "warning":
206
+ return "warning";
207
+ case "delete":
208
+ return "error";
209
+ case "info":
210
+ return "info";
211
+ }
212
+ return "primary";
213
+ };
214
+ const getThemeVariantColor = (theme, variant) => {
215
+ switch (variant) {
216
+ case "warning":
217
+ theme.palette.warning.main;
218
+ break;
219
+ case "delete":
220
+ theme.palette.error.main;
221
+ break;
222
+ case "info":
223
+ theme.palette.info.main;
224
+ break;
225
+ }
226
+ return theme.palette.text.primary;
227
+ };
228
+ const SKTButton = styled$1(Skeleton)(({
229
+ theme
230
+ }) => ({
231
+ borderRadius: theme.spacing(0.5)
232
+ }));
233
+ const Button = (props) => {
234
+ const isSkeleton = useModuleSkeleton();
235
+ if (isSkeleton) {
236
+ return /* @__PURE__ */ jsx(SKTButton, {
237
+ variant: "rectangular",
238
+ width: "100px",
239
+ height: "36px"
240
+ });
241
+ }
242
+ return /* @__PURE__ */ jsx(MuiButton, {
243
+ ...props
244
+ });
245
+ };
246
246
  export { Button as B, RHFAutocomplete as R, getVariantColor as a, getThemeVariantColor as g };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
3
  "private": false,
4
- "version": "0.0.48",
4
+ "version": "0.0.51",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -14,7 +14,7 @@
14
14
  "format": "npm run prettier:fix && npm run lint:fix"
15
15
  },
16
16
  "dependencies": {
17
- "@m4l/graphics": "^0.0.33",
17
+ "@m4l/graphics": "^0.0.34",
18
18
  "react": "^17.0.0 || 18.x",
19
19
  "react-dom": "^18.0.0",
20
20
  "react-draggable": "^4.4.5"
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { CommonActionsContextProps, CommonActionsProviderProps } from './types';
3
- declare const CommonActionsContext: import("react").Context<CommonActionsContextProps>;
4
- declare function CommonActionsProvider(props: CommonActionsProviderProps): JSX.Element;
5
- export { CommonActionsProvider, CommonActionsContext };
@@ -1,9 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { VariantColor } from '../../../utils/types';
3
- export interface CommonActionsProviderProps {
4
- variantColor: VariantColor;
5
- children: ReactNode;
6
- }
7
- export interface CommonActionsContextProps {
8
- variantColor: VariantColor;
9
- }
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import type { FormActionsProps } from './types';
3
- export declare function FormActions(props: FormActionsProps): JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function SKTFormActions(): JSX.Element;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const WrapperFormActions: 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 WrapperSKTFormActions: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,4 +0,0 @@
1
- export interface FormActionsProps {
2
- withIntro?: boolean;
3
- urlCancel?: string | number;
4
- }