@m4l/components 9.1.79 → 9.1.81

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 (74) hide show
  1. package/components/DataGrid/dictionary.d.ts +1 -1
  2. package/components/DataGrid/dictionary.js +1 -1
  3. package/components/DataGrid/styles.js +1 -0
  4. package/components/DataGrid/subcomponents/Actions/index.d.ts +4 -0
  5. package/components/DataGrid/subcomponents/Actions/index.js +2 -5
  6. package/components/DataGrid/subcomponents/Actions/types.d.ts +1 -1
  7. package/components/Pager/Pager.d.ts +55 -0
  8. package/components/Pager/Pager.js +60 -0
  9. package/components/Pager/Pager.styles.d.ts +2 -0
  10. package/components/Pager/Pager.styles.js +129 -0
  11. package/components/Pager/constants.d.ts +1 -0
  12. package/components/Pager/constants.js +4 -0
  13. package/components/Pager/dicctionary.d.ts +12 -0
  14. package/components/Pager/dicctionary.js +18 -0
  15. package/components/Pager/slots/PagerEnum.d.ts +10 -0
  16. package/components/Pager/slots/PagerEnum.js +14 -0
  17. package/components/Pager/slots/PagerSlots.d.ts +7 -0
  18. package/components/Pager/slots/PagerSlots.js +42 -0
  19. package/components/Pager/slots/index.d.ts +2 -0
  20. package/components/Pager/slots/index.js +1 -0
  21. package/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.d.ts +9 -0
  22. package/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.js +92 -0
  23. package/components/{mui_extended/Pager → Pager}/subcomponents/CustomTablePagination/types.d.ts +4 -5
  24. package/components/{mui_extended/Pager/subcomponents/PagerActions/index.d.ts → Pager/subcomponents/PagerActions/PagerActions.d.ts} +4 -0
  25. package/components/{mui_extended/Pager/subcomponents/PagerActions/index.js → Pager/subcomponents/PagerActions/PagerActions.js} +15 -7
  26. package/components/{mui_extended/Pager → Pager}/subcomponents/PagerActions/types.d.ts +2 -2
  27. package/components/Pager/tests/Pager.test.d.ts +1 -0
  28. package/components/Pager/types.d.ts +25 -0
  29. package/components/extended/React-Splitter/SplitLayout/SplitLayout.d.ts +14 -0
  30. package/components/extended/React-Splitter/SplitLayout/SplitLayout.js +53 -0
  31. package/components/extended/React-Splitter/SplitLayout/SplitLayout.styles.d.ts +2 -0
  32. package/components/extended/React-Splitter/SplitLayout/SplitLayout.styles.js +157 -0
  33. package/components/extended/React-Splitter/SplitLayout/constants.d.ts +9 -0
  34. package/components/extended/React-Splitter/SplitLayout/constants.js +6 -0
  35. package/components/extended/React-Splitter/SplitLayout/slots/SplitLayoutEnum.d.ts +5 -0
  36. package/components/extended/React-Splitter/SplitLayout/slots/SplitLayoutEnum.js +9 -0
  37. package/components/extended/React-Splitter/SplitLayout/slots/SplitLayoutSlots.d.ts +3 -0
  38. package/components/extended/React-Splitter/SplitLayout/slots/SplitLayoutSlots.js +21 -0
  39. package/components/extended/React-Splitter/SplitLayout/tests/SplitLayout.test.d.ts +1 -0
  40. package/components/{SplitLayout → extended/React-Splitter/SplitLayout}/types.d.ts +11 -5
  41. package/components/hook-form/RHFSelect/slots/RHFSlots.js +1 -1
  42. package/components/index.d.ts +2 -2
  43. package/components/mui_extended/Select/Select.styles.js +17 -10
  44. package/components/mui_extended/index.d.ts +3 -3
  45. package/index.js +3 -3
  46. package/package.json +1 -1
  47. package/components/SplitLayout/SplitLayout.d.ts +0 -16
  48. package/components/SplitLayout/SplitLayout.js +0 -57
  49. package/components/SplitLayout/classes/constants.d.ts +0 -1
  50. package/components/SplitLayout/classes/constants.js +0 -4
  51. package/components/SplitLayout/classes/index.d.ts +0 -17
  52. package/components/SplitLayout/classes/index.js +0 -33
  53. package/components/SplitLayout/classes/types.d.ts +0 -10
  54. package/components/SplitLayout/index.d.ts +0 -2
  55. package/components/SplitLayout/styles.d.ts +0 -3
  56. package/components/SplitLayout/styles.js +0 -29
  57. package/components/SplitLayout/tests/constants.d.ts +0 -1
  58. package/components/SplitLayout/tests/constants.js +0 -4
  59. package/components/SplitLayout/tests/utils.d.ts +0 -2
  60. package/components/SplitLayout/tests/utils.js +0 -7
  61. package/components/mui_extended/Pager/classes/constants.d.ts +0 -1
  62. package/components/mui_extended/Pager/classes/constants.js +0 -4
  63. package/components/mui_extended/Pager/classes/index.d.ts +0 -25
  64. package/components/mui_extended/Pager/classes/index.js +0 -55
  65. package/components/mui_extended/Pager/classes/types.d.ts +0 -18
  66. package/components/mui_extended/Pager/dicctionary.d.ts +0 -3
  67. package/components/mui_extended/Pager/dicctionary.js +0 -6
  68. package/components/mui_extended/Pager/index.d.ts +0 -6
  69. package/components/mui_extended/Pager/index.js +0 -49
  70. package/components/mui_extended/Pager/styles.d.ts +0 -1
  71. package/components/mui_extended/Pager/styles.js +0 -7
  72. package/components/mui_extended/Pager/subcomponents/CustomTablePagination/index.d.ts +0 -5
  73. package/components/mui_extended/Pager/subcomponents/CustomTablePagination/index.js +0 -96
  74. package/components/mui_extended/Pager/types.d.ts +0 -13
@@ -1,10 +0,0 @@
1
- import { useSplitLayoutUtilityClasses } from './index';
2
- export interface SplitLayoutClassesType {
3
- root: string;
4
- firstPart: string;
5
- secondPart: string;
6
- stateVertical: string;
7
- stateHorizontal: string;
8
- }
9
- export type SplitLayoutClassesKey = keyof SplitLayoutClassesType;
10
- export type Classes = ReturnType<typeof useSplitLayoutUtilityClasses>;
@@ -1,2 +0,0 @@
1
- export { SplitLayout } from './SplitLayout';
2
- export type { SplitLayoutProps } from './types';
@@ -1,3 +0,0 @@
1
- export declare const SplitLayoutRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
2
- export declare const SplitMaster: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
3
- export declare const SplitDetail: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,29 +0,0 @@
1
- import { styled } from "@mui/material";
2
- const SplitLayoutRoot = styled("div")(({ theme }) => ({
3
- ...theme.components?.M4LSplitLayout?.styleOverrides || {}
4
- }));
5
- const SplitMaster = styled("div")(() => ({
6
- display: "flex",
7
- flexDirection: "column",
8
- position: "relative",
9
- width: "100%",
10
- height: "100%",
11
- overflow: "hidden"
12
- }));
13
- const SplitDetail = styled("div")(() => ({
14
- display: "flex",
15
- flexDirection: "column",
16
- justifyContent: "center",
17
- alignItems: "center",
18
- overflow: "hidden",
19
- position: "absolute",
20
- left: "0px",
21
- right: "0px",
22
- top: "0px",
23
- bottom: "0px"
24
- }));
25
- export {
26
- SplitLayoutRoot as S,
27
- SplitMaster as a,
28
- SplitDetail as b
29
- };
@@ -1 +0,0 @@
1
- export declare const SPLITLAYOUT_PREFIX = "M4LSplitLayout";
@@ -1,4 +0,0 @@
1
- const SPLITLAYOUT_PREFIX = "M4LSplitLayout";
2
- export {
3
- SPLITLAYOUT_PREFIX as S
4
- };
@@ -1,2 +0,0 @@
1
- import { SplitLayoutClassesKey } from '../classes/types';
2
- export declare const getNameSplitLayoutDataTestId: (KEY: SplitLayoutClassesKey) => string;
@@ -1,7 +0,0 @@
1
- import { S as SPLITLAYOUT_PREFIX } from "./constants.js";
2
- const getNameSplitLayoutDataTestId = (KEY) => {
3
- return `${SPLITLAYOUT_PREFIX}-${KEY}`;
4
- };
5
- export {
6
- getNameSplitLayoutDataTestId as g
7
- };
@@ -1 +0,0 @@
1
- export declare const componentName = "M4LPager";
@@ -1,4 +0,0 @@
1
- const componentName = "M4LPager";
2
- export {
3
- componentName as c
4
- };
@@ -1,25 +0,0 @@
1
- import { PagerClassesType } from './types';
2
- export declare const pagerClasses: PagerClassesType;
3
- export declare function getPagerUtilityClass(slot: string): string;
4
- /**
5
- * TODO: Documentar
6
- */
7
- export declare const pagerUtilityClasses: () => {
8
- select: string;
9
- root: string;
10
- labelRowsPerPageContainer: string;
11
- labelRowsPager: string;
12
- selectMenuPopover: string;
13
- selectMenuItem: string;
14
- labelDisplayRows: string;
15
- pagerActions: string;
16
- customTablePaginationRoot: string;
17
- actionIconFirstPage: string;
18
- actionIconPrevious: string;
19
- actionIconNextPage: string;
20
- actionIconLastPage: string;
21
- skeletonRoot: string;
22
- skeletonRowsPerPage: string;
23
- skeletonButtonContainer: string;
24
- skeletonIconButton: string;
25
- };
@@ -1,55 +0,0 @@
1
- import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
2
- import { unstable_composeClasses } from "@mui/base";
3
- import { c as componentName } from "./constants.js";
4
- generateUtilityClasses(componentName, [
5
- /* elements */
6
- "root",
7
- "labelRowsPerPageContainer",
8
- "labelRowsPager",
9
- "select",
10
- "selectMenuItem",
11
- "selectMenuPopover",
12
- "labelDisplayRows",
13
- "pagerActions",
14
- "customTablePaginationRoot",
15
- "skeletonRoot",
16
- "skeletonRowsPerPage",
17
- "skeletonButtonContainer",
18
- "skeletonIconButton",
19
- "actionIconFirstPage",
20
- "actionIconPrevious",
21
- "actionIconNextPage",
22
- "actionIconLastPage"
23
- /* states or variants of elements */
24
- ]);
25
- function getPagerUtilityClass(slot) {
26
- return generateUtilityClass(componentName, slot);
27
- }
28
- const pagerUtilityClasses = () => {
29
- const slots = {
30
- root: ["root"],
31
- labelRowsPerPageContainer: ["labelRowsPerPageContainer"],
32
- labelRowsPager: ["labelRowsBager"],
33
- select: ["select"],
34
- selectMenuPopover: ["selectMenuPopover"],
35
- selectMenuItem: ["selectMenuItem"],
36
- labelDisplayRows: ["labelDisplayRows"],
37
- pagerActions: ["pagerActions"],
38
- customTablePaginationRoot: ["customTablePaginationRoot"],
39
- skeletonRoot: ["skeletonRoot"],
40
- skeletonRowsPerPage: ["skeletonRowsPerPage"],
41
- skeletonButtonContainer: ["skeletonButtonContainer"],
42
- skeletonIconButton: ["skeletonIconButton"],
43
- actionIconFirstPage: ["actionIconFirstPage"],
44
- actionIconPrevious: ["actionIconPrevious"],
45
- actionIconNextPage: ["actionIconNextPage"],
46
- actionIconLastPage: ["actionIconLastPage"]
47
- };
48
- const composedClasses = unstable_composeClasses(slots, getPagerUtilityClass, {});
49
- return {
50
- ...composedClasses
51
- };
52
- };
53
- export {
54
- pagerUtilityClasses as p
55
- };
@@ -1,18 +0,0 @@
1
- import { pagerUtilityClasses } from '.';
2
- export interface PagerClassesType {
3
- root: string;
4
- labelRowsPerPageContainer: string;
5
- labelRowsPager: string;
6
- select: string;
7
- selectMenuPopover: string;
8
- selectMenuItem: string;
9
- labelDisplayRows: string;
10
- pagerActions: string;
11
- customTablePaginationRoot: string;
12
- actionIconFirstPage: string;
13
- actionIconPrevious: string;
14
- actionIconNextPage: string;
15
- actionIconLastPage: string;
16
- }
17
- export type PagerClassesKey = keyof PagerClassesType;
18
- export type Classes = ReturnType<typeof pagerUtilityClasses>;
@@ -1,3 +0,0 @@
1
- import { Dictionary } from '@m4l/core';
2
- export declare function getPagerComponentsDictionary(): string[];
3
- export declare const defaultPagerDictionary: Dictionary;
@@ -1,6 +0,0 @@
1
- function getPagerComponentsDictionary() {
2
- return ["pager"];
3
- }
4
- export {
5
- getPagerComponentsDictionary as g
6
- };
@@ -1,6 +0,0 @@
1
- import { PagerProps } from './types';
2
- /**
3
- * TODO: Documentar
4
- */
5
- export declare function Pager(props: PagerProps): import("react/jsx-runtime").JSX.Element;
6
- export default Pager;
@@ -1,49 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import { P as PagerRoot } from "./styles.js";
4
- import { p as pagerUtilityClasses } from "./classes/index.js";
5
- import { C as CustomTablePagination } from "./subcomponents/CustomTablePagination/index.js";
6
- function Pager(props) {
7
- const {
8
- totalRecords,
9
- rowsPerPageOptions = [5, 10, 2],
10
- rowsPerPage = 25,
11
- page,
12
- onPageChange,
13
- onRowsPerPageChange,
14
- labelRows = "Rows per page",
15
- labelOf = "Of",
16
- isXs
17
- } = props;
18
- const currentPage = useMemo(() => {
19
- if (rowsPerPage * page > totalRecords) {
20
- return Math.floor(totalRecords / rowsPerPage);
21
- }
22
- return page;
23
- }, [page, rowsPerPage, totalRecords]);
24
- const handleChangeRowsPerPage = (event) => {
25
- onRowsPerPageChange(parseInt(event.target.value, 10));
26
- onPageChange(0);
27
- };
28
- const handleChangePage = (_event, newPage) => {
29
- onPageChange(newPage);
30
- };
31
- const classes = pagerUtilityClasses();
32
- return /* @__PURE__ */ jsx(PagerRoot, { className: classes.root, children: /* @__PURE__ */ jsx(
33
- CustomTablePagination,
34
- {
35
- rowsPerPageOptions,
36
- count: totalRecords,
37
- rowsPerPage,
38
- classes,
39
- labelRowsPerPage: labelRows,
40
- page: currentPage,
41
- onPageChange: handleChangePage,
42
- onRowsPerPageChange: handleChangeRowsPerPage,
43
- labelDisplayedRows: !isXs ? ({ from, to, count }) => `${from}-${to} ${labelOf} ${count}` : () => ``
44
- }
45
- ) });
46
- }
47
- export {
48
- Pager as P
49
- };
@@ -1 +0,0 @@
1
- export declare const PagerRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,7 +0,0 @@
1
- import { styled } from "@mui/material/styles";
2
- const PagerRoot = styled("div")(({ theme }) => ({
3
- ...theme.components?.M4LPager?.styleOverrides || {}
4
- }));
5
- export {
6
- PagerRoot as P
7
- };
@@ -1,5 +0,0 @@
1
- import { CustomTablePaginationProps } from './types';
2
- /**
3
- * TODO: Documentar
4
- */
5
- export declare const CustomTablePagination: (props: CustomTablePaginationProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,96 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useTheme, Select, InputBase, MenuItem } from "@mui/material";
3
- import { P as PagerActions } from "../PagerActions/index.js";
4
- import { useResponsiveContainerStore } from "@m4l/graphics";
5
- import { shallow } from "zustand/shallow";
6
- import { useEnvironment } from "@m4l/core";
7
- import { T as Typography } from "../../../Typography/Typography.js";
8
- import { I as Icon } from "../../../../Icon/Icon.js";
9
- const CustomTablePagination = (props) => {
10
- const {
11
- count: countTotal,
12
- page,
13
- rowsPerPage,
14
- rowsPerPageOptions = [10, 25, 50, 100],
15
- labelRowsPerPage,
16
- classes,
17
- onRowsPerPageChange,
18
- onPageChange,
19
- SelectProps,
20
- labelDisplayedRows = defaultLabelDisplayedRows
21
- } = props;
22
- const { host_static_assets, environment_assets } = useEnvironment();
23
- const isUpSm = useResponsiveContainerStore((state) => state.isUpSm, shallow);
24
- const theme = useTheme();
25
- function defaultLabelDisplayedRows({
26
- from,
27
- to,
28
- count
29
- }) {
30
- return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
31
- }
32
- const getLabelDisplayedRowsTo = () => {
33
- if (countTotal === -1) {
34
- return (page + 1) * rowsPerPage;
35
- }
36
- return rowsPerPage === -1 ? countTotal : Math.min(countTotal, (page + 1) * rowsPerPage);
37
- };
38
- const CustomIconComponent = (CustomIconComponentProps) => /* @__PURE__ */ jsx(
39
- Icon,
40
- {
41
- src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/chevronDown.svg`,
42
- ...CustomIconComponentProps
43
- }
44
- );
45
- return /* @__PURE__ */ jsxs(Fragment, { children: [
46
- rowsPerPageOptions?.length > 1 ? /* @__PURE__ */ jsxs("div", { className: classes.labelRowsPerPageContainer, children: [
47
- isUpSm ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: labelRowsPerPage }) : null,
48
- /* @__PURE__ */ jsx(
49
- Select,
50
- {
51
- variant: "standard",
52
- ...!SelectProps?.variant && { input: /* @__PURE__ */ jsx(InputBase, {}) },
53
- value: rowsPerPage,
54
- onChange: (e) => {
55
- onRowsPerPageChange(e);
56
- },
57
- className: classes.select,
58
- MenuProps: {
59
- className: classes.selectMenuPopover,
60
- sx: { ...theme.components?.M4LPagerMenuPopover?.styleOverrides }
61
- },
62
- IconComponent: CustomIconComponent,
63
- ...SelectProps,
64
- children: rowsPerPageOptions.map((item, idx) => /* @__PURE__ */ jsx(
65
- MenuItem,
66
- {
67
- className: classes.selectMenuItem,
68
- value: item,
69
- children: item
70
- },
71
- `${classes.selectMenuItem}-${idx}`
72
- ))
73
- }
74
- )
75
- ] }) : null,
76
- /* @__PURE__ */ jsx(Typography, { variant: "body", className: classes.labelDisplayRows, children: labelDisplayedRows({
77
- from: countTotal === 0 ? 0 : page * rowsPerPage + 1,
78
- to: getLabelDisplayedRowsTo(),
79
- count: countTotal === -1 ? -1 : countTotal,
80
- page
81
- }) }),
82
- /* @__PURE__ */ jsx(
83
- PagerActions,
84
- {
85
- count: countTotal,
86
- page,
87
- rowsPerPage,
88
- onPageChange,
89
- classes
90
- }
91
- )
92
- ] });
93
- };
94
- export {
95
- CustomTablePagination as C
96
- };
@@ -1,13 +0,0 @@
1
- export interface PagerProps {
2
- records: number;
3
- totalRecords: number;
4
- rowsPerPageOptions?: number[];
5
- rowsPerPage?: number;
6
- page: number;
7
- onPageChange: (newPage: number) => void;
8
- onRowsPerPageChange: (newRowsPerPage: number) => void;
9
- labelRows?: string;
10
- labelOf?: string;
11
- isSkeleton?: boolean;
12
- isXs?: boolean;
13
- }