@m4l/components 0.0.49 → 0.0.52

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.
@@ -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",
@@ -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;
@@ -839,19 +839,22 @@ function Actions(props) {
839
839
  children: [withRowsCount && isDesktop && /* @__PURE__ */ jsx(RowsCount, {}), withPager && pagerOptions && /* @__PURE__ */ jsx(Pager, {
840
840
  ...pagerOptions,
841
841
  totalRecords: pagerOptions.totalRecords,
842
- isSkeleton
842
+ isSkeleton,
843
+ isDesktop
843
844
  }), typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}), withLocalFilters && /* @__PURE__ */ jsx(Filter, {}), withSettings && /* @__PURE__ */ jsx(Settings, {
844
845
  ...settingsProps
845
846
  })]
846
847
  });
847
848
  }
848
- function getStandardActionsDictionary() {
849
+ function getCommonActionsDictionary() {
849
850
  return ["common_actions"];
850
851
  }
851
- const defaultActionsDictionary = {
852
+ const defaultCommonActionsDictionary = {
852
853
  common_actions: {
853
854
  cancel: "Cancel",
854
- intro: "Intro"
855
+ intro: "Intro",
856
+ confirm_quit_title: "Confirm",
857
+ confirm_quit_msg: "Are your sure exit?"
855
858
  }
856
859
  };
857
- export { ActionsColumn as A, 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,4 +1,4 @@
1
1
  import { ReactNode } from 'react';
2
- export interface StandardActionsProps {
2
+ export interface CommonActionsProps {
3
3
  children: ReactNode;
4
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;
@@ -0,0 +1,3 @@
1
+ import { Dictionary } from '@m4l/core';
2
+ export declare function getDynamicFilterComponentsDictionary(): string[];
3
+ export declare const defaultDynamicFilterDictionary: Dictionary;
@@ -7,7 +7,7 @@ import { useFormContext, useWatch } from "react-hook-form";
7
7
  import { F as FormProvider } from "../hook-form/FormProvider/index.js";
8
8
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
9
9
  import { R as RHFAutocomplete } from "../../vendor.js";
10
- import { styled as styled$1, Skeleton, MenuItem, useTheme, Popper, Button } from "@mui/material";
10
+ import { styled as styled$1, Skeleton, MenuItem, useTheme, Popper } from "@mui/material";
11
11
  import "../hook-form/RHFAutocompleteAsync/index.js";
12
12
  import "../hook-form/RHFCheckbox/index.js";
13
13
  import { R as RHFDateTime } from "../hook-form/RHFDateTime.js";
@@ -20,8 +20,14 @@ import "../hook-form/RHFUpload.js";
20
20
  import { I as IconButton } from "../mui_extended/IconButton/index.js";
21
21
  import { I as Icon } from "../Icon/index.js";
22
22
  import "../../simplebar.js";
23
- import { L as LabelMemuItem } from "../CommonActions/components/Actions/index.js";
23
+ import { L as LabelMemuItem, b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.js";
24
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";
25
31
  import { useResponsiveDesktop } from "@m4l/graphics";
26
32
  const WrapperApplyedFilters = styled("div")(({
27
33
  theme
@@ -837,7 +843,7 @@ function BaseProvider(props) {
837
843
  const all_fields = useMemo(() => {
838
844
  return {
839
845
  ...ALL_FIELDS,
840
- label: getLabel("filter.all_fields"),
846
+ label: getLabel("dynamic_filter.all_fields"),
841
847
  urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/all_fields.svg`
842
848
  };
843
849
  }, [getLabel, host_static_assets, environment_assets]);
@@ -1133,6 +1139,7 @@ function ApplyedFilter(props) {
1133
1139
  children: labelOperands
1134
1140
  })]
1135
1141
  }), !fixed && /* @__PURE__ */ jsx(IconButton, {
1142
+ size: "small",
1136
1143
  src: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/close_filter.svg`,
1137
1144
  onClick: onDelete
1138
1145
  })]
@@ -1428,7 +1435,7 @@ const WrapperPopupEditFilter = styled("div")(({
1428
1435
  backgroundColor: theme.palette.background.default,
1429
1436
  borderRadius: theme.spacing(1)
1430
1437
  }));
1431
- const PopperActionsContainer = styled("div")(({
1438
+ styled("div")(({
1432
1439
  theme
1433
1440
  }) => ({
1434
1441
  display: "flex",
@@ -1524,18 +1531,10 @@ const PopupEditFilter = () => {
1524
1531
  })]
1525
1532
  }), /* @__PURE__ */ jsx(PopupEditFilterComponent, {
1526
1533
  filter
1527
- }), /* @__PURE__ */ jsxs(PopperActionsContainer, {
1528
- children: [/* @__PURE__ */ jsx(Button, {
1529
- variant: "outlined",
1530
- color: "inherit",
1531
- onClick: onClose,
1532
- children: getLabel(`dyamic_filter.cancel`)
1533
- }), /* @__PURE__ */ jsx(Button, {
1534
- variant: "contained",
1535
- color: "primary",
1536
- type: "submit",
1537
- children: getLabel(`dyamic_filter.intro`)
1538
- })]
1534
+ }), /* @__PURE__ */ jsxs(Actions, {
1535
+ children: [/* @__PURE__ */ jsx(ActionCancel, {
1536
+ onClick: onClose
1537
+ }), /* @__PURE__ */ jsx(ActionIntro, {})]
1539
1538
  })]
1540
1539
  })
1541
1540
  })
@@ -1606,4 +1605,29 @@ const DynamicFilter = (props) => {
1606
1605
  })
1607
1606
  });
1608
1607
  };
1609
- export { DynamicFilter as D };
1608
+ function getDynamicFilterComponentsDictionary() {
1609
+ return ["dynamic_filter"].concat(getCommonActionsDictionary());
1610
+ }
1611
+ const defaultDynamicFilterDictionary = {
1612
+ dynamic_filter: {
1613
+ filter_tooltip: "Search",
1614
+ operator_b: "between",
1615
+ operator_e: "=",
1616
+ operator_ne: "!=",
1617
+ operator_gt: ">",
1618
+ operator_gte: ">=",
1619
+ operator_lt: "<",
1620
+ operator_lte: "<=",
1621
+ operator_c: "contains",
1622
+ operator_nc: "not contains",
1623
+ all_fields: "all_fields",
1624
+ operand_true: "true",
1625
+ operand_false: "false",
1626
+ error_operator_required: "Operator required",
1627
+ error_operand_required: "Operand required",
1628
+ error_invalid_date: "Invalid date",
1629
+ error_operand_mustbe_number: "Invalid number",
1630
+ error_filters_no_setted: "Filters not yet set"
1631
+ }
1632
+ };
1633
+ export { DynamicFilter as D, defaultDynamicFilterDictionary as d, getDynamicFilterComponentsDictionary as g };
@@ -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: {}
@@ -1,14 +1,14 @@
1
1
  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
- import { D as DataGrid } from "../DataGrid/index.js";
4
+ import { D as DataGrid, g as getGridComponentsDictionary } from "../DataGrid/index.js";
5
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";
9
9
  import { u as useModal } from "../../hooks/useModal/index.js";
10
10
  import { I as Icon } from "../Icon/index.js";
11
- import { D as DynamicFilter } from "../DynamicFilter/index.js";
11
+ import { D as DynamicFilter, g as getDynamicFilterComponentsDictionary } from "../DynamicFilter/index.js";
12
12
  const Container$1 = styled("div")(() => ({
13
13
  height: "100%",
14
14
  width: "100%",
@@ -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
  }],
@@ -250,18 +264,15 @@ function ObjectLogs(props) {
250
264
  });
251
265
  }
252
266
  function getObjectLogsComponentsDictionary() {
253
- return ["object_logs"];
267
+ return ["object_logs"].concat(getGridComponentsDictionary()).concat(getDynamicFilterComponentsDictionary());
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
  }
@@ -8,6 +8,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';
10
10
  export * from '../components/DynamicFilter';
11
+ export * from '../components/DynamicFilter/dictionary';
11
12
  export type { FilterFieldApply, RawFilterFieldApply } from '../components/DynamicFilter/types';
12
13
  export * from './CommonActions/';
13
14
  export * from './CommonActions/dictionary';
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";
@@ -29,7 +29,7 @@ export { C as CompanyLogo } from "./components/CompanyLogo/index.js";
29
29
  export { B as BooleanFormatter } from "./components/formatters/BooleanFormatter/index.js";
30
30
  export { D as DateFormatter } from "./components/formatters/DateFormatter/index.js";
31
31
  export { D as DataGrid, g as getGridComponentsDictionary } from "./components/DataGrid/index.js";
32
- export { D as DynamicFilter } from "./components/DynamicFilter/index.js";
32
+ export { D as DynamicFilter, d as defaultDynamicFilterDictionary, g as getDynamicFilterComponentsDictionary } from "./components/DynamicFilter/index.js";
33
33
  export { A as ActionCancel } from "./components/CommonActions/components/ActionCancel/index.js";
34
34
  export { A as ActionIntro } from "./components/CommonActions/components/ActionIntro/index.js";
35
35
  export { A as ActionFormCancel } from "./components/CommonActions/components/ActionFormCancel/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.49",
4
+ "version": "0.0.52",
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"