@max-ts/components 0.2.3 → 0.2.4

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 (57) hide show
  1. package/lib/components/DataGrid/Body/Body.d.ts +1 -29
  2. package/lib/components/DataGrid/Body/Body.mjs +26 -29
  3. package/lib/components/DataGrid/DataGrid.d.ts +0 -53
  4. package/lib/components/DataGrid/DataGrid.mjs +49 -71
  5. package/lib/components/DataGrid/HeadCell/HeadCell.mjs +21 -20
  6. package/lib/components/DataGrid/HeadCell/styles.mjs +3 -2
  7. package/lib/components/DataGrid/Row/Row.d.ts +1 -38
  8. package/lib/components/DataGrid/Row/Row.mjs +55 -147
  9. package/lib/components/DataGrid/Row/constants.d.ts +0 -1
  10. package/lib/components/DataGrid/Row/constants.mjs +2 -3
  11. package/lib/components/DataGrid/Row/index.d.ts +0 -1
  12. package/lib/components/DataGrid/Row/styles.d.ts +0 -22
  13. package/lib/components/DataGrid/Row/styles.mjs +11 -78
  14. package/lib/components/DataGrid/Row/useLogic/useLogic.d.ts +2 -10
  15. package/lib/components/DataGrid/Row/useLogic/useLogic.mjs +36 -67
  16. package/lib/components/DataGrid/constants.d.ts +0 -3
  17. package/lib/components/DataGrid/constants.mjs +3 -6
  18. package/lib/components/DataGrid/enums.d.ts +0 -4
  19. package/lib/components/DataGrid/enums.mjs +2 -3
  20. package/lib/components/DataGrid/faker.d.ts +1 -1
  21. package/lib/components/DataGrid/types.d.ts +2 -7
  22. package/lib/components/DataGrid/useLogic/useLogic.d.ts +1 -6
  23. package/lib/components/DataGrid/useLogic/useLogic.mjs +31 -36
  24. package/lib/components/DataGridActionCell/useLogic/useLogic.mjs +13 -42
  25. package/lib/components/DataGridPagination/DataGridPagination.mjs +9 -9
  26. package/lib/components/DataGridPagination/faker.d.ts +1 -1
  27. package/lib/components/TextField/TextField.d.ts +1 -1
  28. package/lib/components/TextField/TextField.mjs +1 -1
  29. package/lib/index.mjs +189 -197
  30. package/package.json +1 -1
  31. package/lib/components/DataGrid/DataGridContext/DataGridContext.d.ts +0 -7
  32. package/lib/components/DataGrid/DataGridContext/DataGridContext.mjs +0 -12
  33. package/lib/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +0 -6
  34. package/lib/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.mjs +0 -41
  35. package/lib/components/DataGrid/DataGridContext/DataGridProvider/index.d.ts +0 -1
  36. package/lib/components/DataGrid/DataGridContext/index.d.ts +0 -2
  37. package/lib/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +0 -55
  38. package/lib/components/DataGrid/Row/NestedChildren/NestedChildren.mjs +0 -72
  39. package/lib/components/DataGrid/Row/NestedChildren/index.d.ts +0 -1
  40. package/lib/components/DataGrid/Row/NestedChildren/styles.d.ts +0 -20
  41. package/lib/components/DataGrid/Row/NestedChildren/styles.mjs +0 -68
  42. package/lib/components/DataGrid/Row/NestedChildren/useLogic/index.d.ts +0 -1
  43. package/lib/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +0 -18
  44. package/lib/components/DataGrid/Row/NestedChildren/useLogic/useLogic.mjs +0 -27
  45. package/lib/components/DataGrid/Row/RowContext/RowContext.d.ts +0 -7
  46. package/lib/components/DataGrid/Row/RowContext/RowContext.mjs +0 -11
  47. package/lib/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +0 -6
  48. package/lib/components/DataGrid/Row/RowContext/RowProvider/RowProvider.mjs +0 -25
  49. package/lib/components/DataGrid/Row/RowContext/RowProvider/index.d.ts +0 -1
  50. package/lib/components/DataGrid/Row/RowContext/index.d.ts +0 -2
  51. package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/getColumnsMap.d.ts +0 -4
  52. package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/getColumnsMap.mjs +0 -8
  53. package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/index.d.ts +0 -1
  54. package/lib/components/DataGrid/Row/useLogic/utils/index.d.ts +0 -2
  55. package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/index.d.ts +0 -1
  56. package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/mergeColumnsOptions.d.ts +0 -2
  57. package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/mergeColumnsOptions.mjs +0 -14
@@ -1,20 +0,0 @@
1
- export declare const NestedRows: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
2
- $level: number;
3
- $isShowConnector: boolean;
4
- }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
5
- export declare const MoreButtonRow: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
6
- $level: number;
7
- $isShowConnector: boolean;
8
- $gridColumns: string;
9
- }, import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
10
- export declare const MoreButton: import('@emotion/styled').StyledComponent<Omit<import('../../../types').WithoutEmotionSpecific<import('@mui/material').ButtonProps<import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>>>, "color" | "variant"> & {
11
- variant?: `${import('../../../Button').ButtonVariants}`;
12
- loading?: boolean;
13
- loadingIndicator?: import('react').ReactNode;
14
- loadingPosition?: "start" | "end" | "center";
15
- color?: `${import('../../../Button').ButtonColors}`;
16
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
- selected?: boolean;
18
- } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
19
- $moreButtonColumnPosition: number;
20
- }, {}, {}>;
@@ -1,68 +0,0 @@
1
- import { styled as e } from "@mui/material";
2
- import { Button as i } from "../../../Button/Button.mjs";
3
- import { ROOT_ACTION_CELL_WIDTH as r, TREE_LINE_WIDTH as t } from "../../constants.mjs";
4
- const p = e("ul", {
5
- shouldForwardProp: (o) => !["$level", "$isShowConnector"].includes(o.toString())
6
- })`
7
- position: relative;
8
-
9
- margin: 0;
10
- padding: 0;
11
-
12
- list-style: none;
13
-
14
- &::before {
15
- content: '';
16
-
17
- position: absolute;
18
- z-index: 2;
19
- top: 0;
20
- transform: ${({ $level: o }) => `translateX(calc(${r}px * ${o} - ${t}px))`};
21
-
22
- display: ${({ $isShowConnector: o }) => o ? "block" : "none"};
23
-
24
- width: 0;
25
- height: 100%;
26
-
27
- border-left: 1px solid ${({ theme: o }) => o.palette.grey[400]};
28
- }
29
- `, d = e("li", {
30
- shouldForwardProp: (o) => !["$level", "$isShowConnector", "$gridColumns"].includes(o.toString())
31
- })`
32
- position: relative;
33
-
34
- display: grid;
35
- grid-template-columns: ${({ $gridColumns: o }) => o};
36
-
37
- height: 36px;
38
- margin-left: ${({ $level: o }) => `${o * r}px`};
39
-
40
- &::before {
41
- content: '';
42
-
43
- position: absolute;
44
- top: 0;
45
- left: -${t}px;
46
-
47
- display: ${({ $isShowConnector: o }) => o ? "block" : "none"};
48
-
49
- width: ${t}px;
50
- height: 50%;
51
-
52
- border-bottom: 1px solid ${({ theme: o }) => o.palette.grey[400]};
53
- border-left: 1px solid ${({ theme: o }) => o.palette.grey[400]};
54
- border-radius: 0 0 0 ${({ theme: o }) => o.shape.small};
55
- }
56
- `, a = e(i, {
57
- shouldForwardProp: (o) => !["$moreButtonColumnPosition"].includes(o.toString())
58
- })`
59
- grid-column: ${({ $moreButtonColumnPosition: o }) => o};
60
- justify-self: start;
61
-
62
- margin: ${({ theme: o }) => o.spacing(0, 2)};
63
- `;
64
- export {
65
- a as MoreButton,
66
- d as MoreButtonRow,
67
- p as NestedRows
68
- };
@@ -1 +0,0 @@
1
- export * from './useLogic';
@@ -1,18 +0,0 @@
1
- import { MouseEvent } from 'react';
2
- import { CellValue } from '../../../types';
3
- import { NestedChildrenProps } from '../NestedChildren';
4
- type UseLogicParams<TData extends Record<string, CellValue>> = NestedChildrenProps<TData>;
5
- export declare const useLogic: <TData extends Record<string, CellValue>>({ rowId, data, level, variant, initialVisibleChildrenCount, }: UseLogicParams<TData>) => {
6
- isShowAllChildren: boolean;
7
- isShowMoreButton: boolean;
8
- isShowConnector: boolean;
9
- initialVisibleChildren: (TData & {
10
- options?: import('../../../types').DataGridRowOptions<TData> | undefined;
11
- })[];
12
- otherChildren: (TData & {
13
- options?: import('../../../types').DataGridRowOptions<TData> | undefined;
14
- })[];
15
- nextLevel: number;
16
- handleToggleShowAllChildren: (event: MouseEvent<HTMLElement>) => void;
17
- };
18
- export {};
@@ -1,27 +0,0 @@
1
- import { useContext as d } from "react";
2
- import { DataGridContext as C } from "../../../DataGridContext/DataGridContext.mjs";
3
- import "../../../../../_virtual/jsx-runtime.mjs";
4
- import { Variant as S } from "../../../enums.mjs";
5
- const A = ({
6
- rowId: o,
7
- data: e,
8
- level: s,
9
- variant: i,
10
- initialVisibleChildrenCount: t
11
- }) => {
12
- const { checkIsMoreOpened: l, toggleOpenMoreItems: c } = d(C), n = Object.is(i, S.Tree), h = n ? s + 1 : 0, a = e?.slice(0, t), r = e?.slice(t), g = l(o), p = !!r?.length;
13
- return {
14
- isShowAllChildren: g,
15
- isShowMoreButton: p,
16
- isShowConnector: n,
17
- initialVisibleChildren: a,
18
- otherChildren: r,
19
- nextLevel: h,
20
- handleToggleShowAllChildren: (m) => {
21
- m.stopPropagation(), c(o);
22
- }
23
- };
24
- };
25
- export {
26
- A as useLogic
27
- };
@@ -1,7 +0,0 @@
1
- export type RowContextProps = {
2
- isDisabled: boolean;
3
- disabledReason?: string;
4
- addDisabledRow: (disabledReason?: string) => void;
5
- removeDisabledRow: () => void;
6
- };
7
- export declare const RowContext: import('react').Context<RowContextProps>;
@@ -1,11 +0,0 @@
1
- import { createContext as e } from "react";
2
- const t = e({
3
- isDisabled: !1,
4
- addDisabledRow: () => {
5
- },
6
- removeDisabledRow: () => {
7
- }
8
- });
9
- export {
10
- t as RowContext
11
- };
@@ -1,6 +0,0 @@
1
- import { ReactNode } from 'react';
2
- type RowContextProviderProps = {
3
- children: ReactNode;
4
- };
5
- export declare const RowContextProvider: ({ children }: RowContextProviderProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,25 +0,0 @@
1
- import { j as l } from "../../../../../_virtual/jsx-runtime.mjs";
2
- import { useState as s } from "react";
3
- import { RowContext as m } from "../RowContext.mjs";
4
- const c = ({ children: t }) => {
5
- const [r, e] = s(!1), [a, o] = s(), i = (n) => {
6
- e(!0), o(n);
7
- }, d = () => {
8
- e(!1), o(void 0);
9
- };
10
- return /* @__PURE__ */ l.jsx(
11
- m.Provider,
12
- {
13
- value: {
14
- isDisabled: r,
15
- disabledReason: a,
16
- addDisabledRow: i,
17
- removeDisabledRow: d
18
- },
19
- children: t
20
- }
21
- );
22
- };
23
- export {
24
- c as RowContextProvider
25
- };
@@ -1 +0,0 @@
1
- export * from './RowProvider';
@@ -1,2 +0,0 @@
1
- export * from './RowContext';
2
- export * from './RowProvider';
@@ -1,4 +0,0 @@
1
- import { CellValue, DataGridRowOptionColumns } from '../../../../types';
2
- type GetColumnsMapResult<TData> = Record<keyof TData, Omit<TData, 'field'>> | object;
3
- export declare const getColumnsMap: <TData extends Record<string, CellValue>>(columns: DataGridRowOptionColumns<TData>[]) => GetColumnsMapResult<TData>;
4
- export {};
@@ -1,8 +0,0 @@
1
- const u = (t) => t.reduce((r, { field: e, ...n }) => e ? {
2
- // biome-ignore lint/performance/noAccumulatingSpread: <explanation>
3
- ...r,
4
- [e]: n
5
- } : r, {});
6
- export {
7
- u as getColumnsMap
8
- };
@@ -1 +0,0 @@
1
- export * from './getColumnsMap';
@@ -1,2 +0,0 @@
1
- export { getColumnsMap } from './getColumnsMap';
2
- export { mergeColumnsOptions } from './mergeColumnsOptions';
@@ -1 +0,0 @@
1
- export * from './mergeColumnsOptions';
@@ -1,2 +0,0 @@
1
- import { CellValue, DataGridColumns, DataGridRowOptionColumns } from '../../../../types';
2
- export declare const mergeColumnsOptions: <TData extends Record<string, CellValue>>(columns: DataGridColumns<TData>[], childrenColumns: DataGridRowOptionColumns<TData>[] | undefined) => any[];
@@ -1,14 +0,0 @@
1
- import { getColumnsMap as n } from "../getColumnsMap/getColumnsMap.mjs";
2
- const f = (e, t) => {
3
- if (!t)
4
- return e;
5
- const i = n(t);
6
- return Object.keys(i).length ? e.map((r) => r.hasOwnProperty("field") ? {
7
- ...r,
8
- // @ts-ignore
9
- ...i[r.field] || {}
10
- } : r) : e;
11
- };
12
- export {
13
- f as mergeColumnsOptions
14
- };