@cerberus-design/data-grid 0.25.3 → 1.0.0-rc.6

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 (34) hide show
  1. package/dist/column-helpers.cjs +55 -21
  2. package/dist/column-helpers.js +55 -17
  3. package/dist/components/cerby-data-grid.client.cjs +12 -11
  4. package/dist/components/cerby-data-grid.client.js +12 -7
  5. package/dist/components/count-menu.client.cjs +46 -49
  6. package/dist/components/count-menu.client.js +46 -45
  7. package/dist/components/data-grid.client.cjs +89 -82
  8. package/dist/components/data-grid.client.js +89 -78
  9. package/dist/components/features.client.cjs +72 -76
  10. package/dist/components/features.client.js +72 -72
  11. package/dist/components/grid.client.cjs +280 -309
  12. package/dist/components/grid.client.js +281 -303
  13. package/dist/components/pagination.client.cjs +90 -113
  14. package/dist/components/pagination.client.js +90 -109
  15. package/dist/components/pinned-items.client.cjs +60 -59
  16. package/dist/components/pinned-items.client.js +60 -55
  17. package/dist/components/sort-items.client.cjs +44 -49
  18. package/dist/components/sort-items.client.js +44 -45
  19. package/dist/const.cjs +32 -43
  20. package/dist/const.js +33 -31
  21. package/dist/context.client.cjs +12 -12
  22. package/dist/context.client.js +12 -8
  23. package/dist/hooks.client.cjs +13 -20
  24. package/dist/hooks.client.js +13 -16
  25. package/dist/index.cjs +9 -15
  26. package/dist/index.js +5 -4
  27. package/dist/panda.buildinfo.json +23 -0
  28. package/dist/store.cjs +241 -284
  29. package/dist/store.js +241 -280
  30. package/dist/utils.cjs +23 -45
  31. package/dist/utils.js +23 -41
  32. package/dist/virtualizer.client.cjs +63 -53
  33. package/dist/virtualizer.client.js +63 -49
  34. package/package.json +33 -27
@@ -1,66 +1,71 @@
1
- 'use client';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
- import { useCerberusContext, MenuItem } from '@cerberus-design/react';
4
- import { useRead } from '@cerberus-design/signals';
5
- import { HStack } from 'styled-system/jsx';
6
-
1
+ "use client";
2
+ "use client";
3
+ import { MenuItem, useCerberusContext } from "@cerberus-design/react";
4
+ import { useRead } from "@cerberus-design/signals";
5
+ import { HStack } from "styled-system/jsx";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/pinned-items.client.tsx
7
8
  function MatchPinnedItems(props) {
8
- const pinned = useRead(props.pinned);
9
- const MenuItems = {
10
- right: PinRightItem,
11
- left: PinLeftItem,
12
- unpinRight: UnpinRightItem,
13
- unpinLeft: UnpinLeftItem
14
- };
15
- switch (pinned) {
16
- case "right":
17
- return /* @__PURE__ */ jsxs(Fragment, { children: [
18
- /* @__PURE__ */ jsx(MenuItems.unpinRight, {}),
19
- /* @__PURE__ */ jsx(MenuItems.left, {})
20
- ] });
21
- case "left":
22
- return /* @__PURE__ */ jsxs(Fragment, { children: [
23
- /* @__PURE__ */ jsx(MenuItems.right, {}),
24
- /* @__PURE__ */ jsx(MenuItems.unpinLeft, {})
25
- ] });
26
- default:
27
- return /* @__PURE__ */ jsxs(Fragment, { children: [
28
- /* @__PURE__ */ jsx(MenuItems.right, {}),
29
- /* @__PURE__ */ jsx(MenuItems.left, {})
30
- ] });
31
- }
9
+ const pinned = useRead(props.pinned);
10
+ const MenuItems = {
11
+ right: PinRightItem,
12
+ left: PinLeftItem,
13
+ unpinRight: UnpinRightItem,
14
+ unpinLeft: UnpinLeftItem
15
+ };
16
+ switch (pinned) {
17
+ case "right": return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItems.unpinRight, {}), /* @__PURE__ */ jsx(MenuItems.left, {})] });
18
+ case "left": return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItems.right, {}), /* @__PURE__ */ jsx(MenuItems.unpinLeft, {})] });
19
+ default: return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItems.right, {}), /* @__PURE__ */ jsx(MenuItems.left, {})] });
20
+ }
32
21
  }
33
22
  function UnpinRightItem() {
34
- const { icons } = useCerberusContext();
35
- const Icon = icons.pinRightFilled;
36
- return /* @__PURE__ */ jsx(MenuItem, { value: "unpin_right", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", w: "full", children: [
37
- /* @__PURE__ */ jsx(Icon, {}),
38
- "Unpin Right"
39
- ] }) });
23
+ const { icons } = useCerberusContext();
24
+ const Icon = icons.pinRightFilled;
25
+ return /* @__PURE__ */ jsx(MenuItem, {
26
+ value: "unpin_right",
27
+ children: /* @__PURE__ */ jsxs(HStack, {
28
+ gap: "sm",
29
+ w: "full",
30
+ children: [/* @__PURE__ */ jsx(Icon, {}), "Unpin Right"]
31
+ })
32
+ });
40
33
  }
41
34
  function UnpinLeftItem() {
42
- const { icons } = useCerberusContext();
43
- const Icon = icons.pinLeftFilled;
44
- return /* @__PURE__ */ jsx(MenuItem, { value: "unpin_left", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", w: "full", children: [
45
- /* @__PURE__ */ jsx(Icon, {}),
46
- "Unpin Left"
47
- ] }) });
35
+ const { icons } = useCerberusContext();
36
+ const Icon = icons.pinLeftFilled;
37
+ return /* @__PURE__ */ jsx(MenuItem, {
38
+ value: "unpin_left",
39
+ children: /* @__PURE__ */ jsxs(HStack, {
40
+ gap: "sm",
41
+ w: "full",
42
+ children: [/* @__PURE__ */ jsx(Icon, {}), "Unpin Left"]
43
+ })
44
+ });
48
45
  }
49
46
  function PinRightItem() {
50
- const { icons } = useCerberusContext();
51
- const Icon = icons.pinRight;
52
- return /* @__PURE__ */ jsx(MenuItem, { value: "pin_right", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", w: "full", children: [
53
- /* @__PURE__ */ jsx(Icon, {}),
54
- "Pin Right"
55
- ] }) });
47
+ const { icons } = useCerberusContext();
48
+ const Icon = icons.pinRight;
49
+ return /* @__PURE__ */ jsx(MenuItem, {
50
+ value: "pin_right",
51
+ children: /* @__PURE__ */ jsxs(HStack, {
52
+ gap: "sm",
53
+ w: "full",
54
+ children: [/* @__PURE__ */ jsx(Icon, {}), "Pin Right"]
55
+ })
56
+ });
56
57
  }
57
58
  function PinLeftItem() {
58
- const { icons } = useCerberusContext();
59
- const Icon = icons.pinLeft;
60
- return /* @__PURE__ */ jsx(MenuItem, { value: "pin_left", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", w: "full", children: [
61
- /* @__PURE__ */ jsx(Icon, {}),
62
- "Pin Left"
63
- ] }) });
59
+ const { icons } = useCerberusContext();
60
+ const Icon = icons.pinLeft;
61
+ return /* @__PURE__ */ jsx(MenuItem, {
62
+ value: "pin_left",
63
+ children: /* @__PURE__ */ jsxs(HStack, {
64
+ gap: "sm",
65
+ w: "full",
66
+ children: [/* @__PURE__ */ jsx(Icon, {}), "Pin Left"]
67
+ })
68
+ });
64
69
  }
65
-
70
+ //#endregion
66
71
  export { MatchPinnedItems };
@@ -1,58 +1,53 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const jsxRuntime = require('react/jsx-runtime');
7
- const react = require('@cerberus-design/react');
8
- const jsx = require('styled-system/jsx');
9
-
1
+ "use client";
2
+ "use client";
3
+ let _cerberus_design_react = require("@cerberus-design/react");
4
+ let styled_system_jsx = require("styled-system/jsx");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ //#region src/components/sort-items.client.tsx
10
7
  function MatchSortItems(props) {
11
- const { sorting } = props;
12
- const MenuItems = {
13
- asc: SortAsc,
14
- desc: SortDesc,
15
- unsort: UnsortItem
16
- };
17
- if (!sorting) {
18
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19
- /* @__PURE__ */ jsxRuntime.jsx(MenuItems.asc, {}),
20
- /* @__PURE__ */ jsxRuntime.jsx(MenuItems.desc, {})
21
- ] });
22
- }
23
- if (sorting.desc) {
24
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25
- /* @__PURE__ */ jsxRuntime.jsx(MenuItems.asc, {}),
26
- /* @__PURE__ */ jsxRuntime.jsx(MenuItems.unsort, {})
27
- ] });
28
- } else {
29
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30
- /* @__PURE__ */ jsxRuntime.jsx(MenuItems.unsort, {}),
31
- /* @__PURE__ */ jsxRuntime.jsx(MenuItems.desc, {})
32
- ] });
33
- }
8
+ const { sorting } = props;
9
+ const MenuItems = {
10
+ asc: SortAsc,
11
+ desc: SortDesc,
12
+ unsort: UnsortItem
13
+ };
14
+ if (!sorting) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItems.asc, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItems.desc, {})] });
15
+ if (sorting.desc) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItems.asc, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItems.unsort, {})] });
16
+ else return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItems.unsort, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItems.desc, {})] });
34
17
  }
35
18
  function UnsortItem() {
36
- return /* @__PURE__ */ jsxRuntime.jsx(react.MenuItem, { value: "unsort", children: /* @__PURE__ */ jsxRuntime.jsxs(jsx.HStack, { gap: "sm", w: "full", children: [
37
- /* @__PURE__ */ jsxRuntime.jsx(jsx.Square, { size: "4" }),
38
- "Unsort"
39
- ] }) });
19
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_cerberus_design_react.MenuItem, {
20
+ value: "unsort",
21
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(styled_system_jsx.HStack, {
22
+ gap: "sm",
23
+ w: "full",
24
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(styled_system_jsx.Square, { size: "4" }), "Unsort"]
25
+ })
26
+ });
40
27
  }
41
28
  function SortAsc() {
42
- const { icons } = react.useCerberusContext();
43
- const Icon = icons.sortAsc;
44
- return /* @__PURE__ */ jsxRuntime.jsx(react.MenuItem, { value: "sort_asc", children: /* @__PURE__ */ jsxRuntime.jsxs(jsx.HStack, { gap: "sm", w: "full", children: [
45
- /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
46
- "Sort ASC"
47
- ] }) });
29
+ const { icons } = (0, _cerberus_design_react.useCerberusContext)();
30
+ const Icon = icons.sortAsc;
31
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_cerberus_design_react.MenuItem, {
32
+ value: "sort_asc",
33
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(styled_system_jsx.HStack, {
34
+ gap: "sm",
35
+ w: "full",
36
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {}), "Sort ASC"]
37
+ })
38
+ });
48
39
  }
49
40
  function SortDesc() {
50
- const { icons } = react.useCerberusContext();
51
- const Icon = icons.sortDesc;
52
- return /* @__PURE__ */ jsxRuntime.jsx(react.MenuItem, { value: "sort_desc", children: /* @__PURE__ */ jsxRuntime.jsxs(jsx.HStack, { gap: "sm", w: "full", children: [
53
- /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
54
- "Sort DESC"
55
- ] }) });
41
+ const { icons } = (0, _cerberus_design_react.useCerberusContext)();
42
+ const Icon = icons.sortDesc;
43
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_cerberus_design_react.MenuItem, {
44
+ value: "sort_desc",
45
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(styled_system_jsx.HStack, {
46
+ gap: "sm",
47
+ w: "full",
48
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {}), "Sort DESC"]
49
+ })
50
+ });
56
51
  }
57
-
52
+ //#endregion
58
53
  exports.MatchSortItems = MatchSortItems;
@@ -1,54 +1,53 @@
1
- 'use client';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
- import { useCerberusContext, MenuItem } from '@cerberus-design/react';
4
- import { HStack, Square } from 'styled-system/jsx';
5
-
1
+ "use client";
2
+ "use client";
3
+ import { MenuItem, useCerberusContext } from "@cerberus-design/react";
4
+ import { HStack, Square } from "styled-system/jsx";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/sort-items.client.tsx
6
7
  function MatchSortItems(props) {
7
- const { sorting } = props;
8
- const MenuItems = {
9
- asc: SortAsc,
10
- desc: SortDesc,
11
- unsort: UnsortItem
12
- };
13
- if (!sorting) {
14
- return /* @__PURE__ */ jsxs(Fragment, { children: [
15
- /* @__PURE__ */ jsx(MenuItems.asc, {}),
16
- /* @__PURE__ */ jsx(MenuItems.desc, {})
17
- ] });
18
- }
19
- if (sorting.desc) {
20
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21
- /* @__PURE__ */ jsx(MenuItems.asc, {}),
22
- /* @__PURE__ */ jsx(MenuItems.unsort, {})
23
- ] });
24
- } else {
25
- return /* @__PURE__ */ jsxs(Fragment, { children: [
26
- /* @__PURE__ */ jsx(MenuItems.unsort, {}),
27
- /* @__PURE__ */ jsx(MenuItems.desc, {})
28
- ] });
29
- }
8
+ const { sorting } = props;
9
+ const MenuItems = {
10
+ asc: SortAsc,
11
+ desc: SortDesc,
12
+ unsort: UnsortItem
13
+ };
14
+ if (!sorting) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItems.asc, {}), /* @__PURE__ */ jsx(MenuItems.desc, {})] });
15
+ if (sorting.desc) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItems.asc, {}), /* @__PURE__ */ jsx(MenuItems.unsort, {})] });
16
+ else return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItems.unsort, {}), /* @__PURE__ */ jsx(MenuItems.desc, {})] });
30
17
  }
31
18
  function UnsortItem() {
32
- return /* @__PURE__ */ jsx(MenuItem, { value: "unsort", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", w: "full", children: [
33
- /* @__PURE__ */ jsx(Square, { size: "4" }),
34
- "Unsort"
35
- ] }) });
19
+ return /* @__PURE__ */ jsx(MenuItem, {
20
+ value: "unsort",
21
+ children: /* @__PURE__ */ jsxs(HStack, {
22
+ gap: "sm",
23
+ w: "full",
24
+ children: [/* @__PURE__ */ jsx(Square, { size: "4" }), "Unsort"]
25
+ })
26
+ });
36
27
  }
37
28
  function SortAsc() {
38
- const { icons } = useCerberusContext();
39
- const Icon = icons.sortAsc;
40
- return /* @__PURE__ */ jsx(MenuItem, { value: "sort_asc", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", w: "full", children: [
41
- /* @__PURE__ */ jsx(Icon, {}),
42
- "Sort ASC"
43
- ] }) });
29
+ const { icons } = useCerberusContext();
30
+ const Icon = icons.sortAsc;
31
+ return /* @__PURE__ */ jsx(MenuItem, {
32
+ value: "sort_asc",
33
+ children: /* @__PURE__ */ jsxs(HStack, {
34
+ gap: "sm",
35
+ w: "full",
36
+ children: [/* @__PURE__ */ jsx(Icon, {}), "Sort ASC"]
37
+ })
38
+ });
44
39
  }
45
40
  function SortDesc() {
46
- const { icons } = useCerberusContext();
47
- const Icon = icons.sortDesc;
48
- return /* @__PURE__ */ jsx(MenuItem, { value: "sort_desc", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", w: "full", children: [
49
- /* @__PURE__ */ jsx(Icon, {}),
50
- "Sort DESC"
51
- ] }) });
41
+ const { icons } = useCerberusContext();
42
+ const Icon = icons.sortDesc;
43
+ return /* @__PURE__ */ jsx(MenuItem, {
44
+ value: "sort_desc",
45
+ children: /* @__PURE__ */ jsxs(HStack, {
46
+ gap: "sm",
47
+ w: "full",
48
+ children: [/* @__PURE__ */ jsx(Icon, {}), "Sort DESC"]
49
+ })
50
+ });
52
51
  }
53
-
52
+ //#endregion
54
53
  export { MatchSortItems };
package/dist/const.cjs CHANGED
@@ -1,49 +1,38 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const SCOPE = "data-grid";
7
- const PARTS = {
8
- TOOLBAR: "toolbar",
9
- ROOT: "root",
10
- VIEWPORT: "viewport",
11
- HEAD_CELL: "head-cell",
12
- ROW: "row",
13
- CELL: "row-cell",
14
- FOOTER: "footer"
1
+ "use client";
2
+ //#region src/const.ts
3
+ var SCOPE = "data-grid";
4
+ var PARTS = {
5
+ TOOLBAR: "toolbar",
6
+ ROOT: "root",
7
+ VIEWPORT: "viewport",
8
+ HEAD_CELL: "head-cell",
9
+ ROW: "row",
10
+ CELL: "row-cell",
11
+ FOOTER: "footer"
15
12
  };
16
- const DEFAULT_PAGE_IDX = 1;
17
- const SM_PAGE_SIZE = 25;
18
- const MD_PAGE_SIZE = 50;
19
- const LG_PAGE_SIZE = 100;
20
- const DEFAULT_PAGE_SIZES = [SM_PAGE_SIZE, MD_PAGE_SIZE, LG_PAGE_SIZE];
21
- const XS = "xs";
22
- const SM = "sm";
23
- const MD = "md";
24
- const LG = "lg";
25
- const XL = "xl";
26
- const ROW_SIZES = {
27
- items: [XS, SM, MD, LG, XL],
28
- results: {
29
- [XS]: 32,
30
- [SM]: 40,
31
- [MD]: 48,
32
- [LG]: 56,
33
- [XL]: 64
34
- }
13
+ var DEFAULT_PAGE_SIZES = [
14
+ 25,
15
+ 50,
16
+ 100
17
+ ];
18
+ var ROW_SIZES = {
19
+ items: [
20
+ "xs",
21
+ "sm",
22
+ "md",
23
+ "lg",
24
+ "xl"
25
+ ],
26
+ results: {
27
+ ["xs"]: 32,
28
+ ["sm"]: 40,
29
+ ["md"]: 48,
30
+ ["lg"]: 56,
31
+ ["xl"]: 64
32
+ }
35
33
  };
36
-
37
- exports.DEFAULT_PAGE_IDX = DEFAULT_PAGE_IDX;
34
+ //#endregion
38
35
  exports.DEFAULT_PAGE_SIZES = DEFAULT_PAGE_SIZES;
39
- exports.LG = LG;
40
- exports.LG_PAGE_SIZE = LG_PAGE_SIZE;
41
- exports.MD = MD;
42
- exports.MD_PAGE_SIZE = MD_PAGE_SIZE;
43
36
  exports.PARTS = PARTS;
44
37
  exports.ROW_SIZES = ROW_SIZES;
45
38
  exports.SCOPE = SCOPE;
46
- exports.SM = SM;
47
- exports.SM_PAGE_SIZE = SM_PAGE_SIZE;
48
- exports.XL = XL;
49
- exports.XS = XS;
package/dist/const.js CHANGED
@@ -1,33 +1,35 @@
1
- 'use client';
2
- const SCOPE = "data-grid";
3
- const PARTS = {
4
- TOOLBAR: "toolbar",
5
- ROOT: "root",
6
- VIEWPORT: "viewport",
7
- HEAD_CELL: "head-cell",
8
- ROW: "row",
9
- CELL: "row-cell",
10
- FOOTER: "footer"
1
+ "use client";
2
+ //#region src/const.ts
3
+ var SCOPE = "data-grid";
4
+ var PARTS = {
5
+ TOOLBAR: "toolbar",
6
+ ROOT: "root",
7
+ VIEWPORT: "viewport",
8
+ HEAD_CELL: "head-cell",
9
+ ROW: "row",
10
+ CELL: "row-cell",
11
+ FOOTER: "footer"
11
12
  };
12
- const DEFAULT_PAGE_IDX = 1;
13
- const SM_PAGE_SIZE = 25;
14
- const MD_PAGE_SIZE = 50;
15
- const LG_PAGE_SIZE = 100;
16
- const DEFAULT_PAGE_SIZES = [SM_PAGE_SIZE, MD_PAGE_SIZE, LG_PAGE_SIZE];
17
- const XS = "xs";
18
- const SM = "sm";
19
- const MD = "md";
20
- const LG = "lg";
21
- const XL = "xl";
22
- const ROW_SIZES = {
23
- items: [XS, SM, MD, LG, XL],
24
- results: {
25
- [XS]: 32,
26
- [SM]: 40,
27
- [MD]: 48,
28
- [LG]: 56,
29
- [XL]: 64
30
- }
13
+ var DEFAULT_PAGE_SIZES = [
14
+ 25,
15
+ 50,
16
+ 100
17
+ ];
18
+ var ROW_SIZES = {
19
+ items: [
20
+ "xs",
21
+ "sm",
22
+ "md",
23
+ "lg",
24
+ "xl"
25
+ ],
26
+ results: {
27
+ ["xs"]: 32,
28
+ ["sm"]: 40,
29
+ ["md"]: 48,
30
+ ["lg"]: 56,
31
+ ["xl"]: 64
32
+ }
31
33
  };
32
-
33
- export { DEFAULT_PAGE_IDX, DEFAULT_PAGE_SIZES, LG, LG_PAGE_SIZE, MD, MD_PAGE_SIZE, PARTS, ROW_SIZES, SCOPE, SM, SM_PAGE_SIZE, XL, XS };
34
+ //#endregion
35
+ export { DEFAULT_PAGE_SIZES, PARTS, ROW_SIZES, SCOPE };
@@ -1,18 +1,18 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const jsxRuntime = require('react/jsx-runtime');
7
- const signals = require('@cerberus-design/signals');
8
-
9
- const { StoreProvider: BaseProvider, useStore: useBaseStore } = signals.createStoreContext();
1
+ "use client";
2
+ "use client";
3
+ let _cerberus_design_signals = require("@cerberus-design/signals");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ //#region src/context.client.tsx
6
+ var { StoreProvider: BaseProvider, useStore: useBaseStore } = (0, _cerberus_design_signals.createStoreContext)();
10
7
  function DataGridProvider(props) {
11
- return /* @__PURE__ */ jsxRuntime.jsx(BaseProvider, { createStore: props.createStore, children: props.children });
8
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BaseProvider, {
9
+ createStore: props.createStore,
10
+ children: props.children
11
+ });
12
12
  }
13
13
  function useDataGridContext() {
14
- return useBaseStore();
14
+ return useBaseStore();
15
15
  }
16
-
16
+ //#endregion
17
17
  exports.DataGridProvider = DataGridProvider;
18
18
  exports.useDataGridContext = useDataGridContext;
@@ -1,13 +1,17 @@
1
- 'use client';
2
- import { jsx } from 'react/jsx-runtime';
3
- import { createStoreContext } from '@cerberus-design/signals';
4
-
5
- const { StoreProvider: BaseProvider, useStore: useBaseStore } = createStoreContext();
1
+ "use client";
2
+ "use client";
3
+ import { createStoreContext } from "@cerberus-design/signals";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/context.client.tsx
6
+ var { StoreProvider: BaseProvider, useStore: useBaseStore } = createStoreContext();
6
7
  function DataGridProvider(props) {
7
- return /* @__PURE__ */ jsx(BaseProvider, { createStore: props.createStore, children: props.children });
8
+ return /* @__PURE__ */ jsx(BaseProvider, {
9
+ createStore: props.createStore,
10
+ children: props.children
11
+ });
8
12
  }
9
13
  function useDataGridContext() {
10
- return useBaseStore();
14
+ return useBaseStore();
11
15
  }
12
-
16
+ //#endregion
13
17
  export { DataGridProvider, useDataGridContext };
@@ -1,29 +1,22 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const react = require('react');
7
-
1
+ "use client";
2
+ "use client";
3
+ let react = require("react");
4
+ //#region src/hooks.client.ts
8
5
  function usePinnedState(pinned) {
9
- return pinned ? "pinned" : "unpinned";
6
+ return pinned ? "pinned" : "unpinned";
10
7
  }
11
8
  function usePinnedAttribute(pinned) {
12
- return pinned ? { "data-pinned": pinned } : void 0;
9
+ return pinned ? { "data-pinned": pinned } : void 0;
13
10
  }
14
11
  function useColumnStyles(column, pinnedVal) {
15
- const styles = react.useMemo(
16
- () => ({
17
- order: `var(--col-${column.id}-order)`,
18
- left: pinnedVal === "left" ? `var(--col-${column.id}-left)` : void 0,
19
- right: pinnedVal === "right" ? `var(--col-${column.id}-right)` : void 0,
20
- width: `var(--col-${column.id}-width)`
21
- }),
22
- [column.id, pinnedVal]
23
- );
24
- return styles;
12
+ return (0, react.useMemo)(() => ({
13
+ order: `var(--col-${column.id}-order)`,
14
+ left: pinnedVal === "left" ? `var(--col-${column.id}-left)` : void 0,
15
+ right: pinnedVal === "right" ? `var(--col-${column.id}-right)` : void 0,
16
+ width: `var(--col-${column.id}-width)`
17
+ }), [column.id, pinnedVal]);
25
18
  }
26
-
19
+ //#endregion
27
20
  exports.useColumnStyles = useColumnStyles;
28
21
  exports.usePinnedAttribute = usePinnedAttribute;
29
22
  exports.usePinnedState = usePinnedState;
@@ -1,23 +1,20 @@
1
- 'use client';
2
- import { useMemo } from 'react';
3
-
1
+ "use client";
2
+ "use client";
3
+ import { useMemo } from "react";
4
+ //#region src/hooks.client.ts
4
5
  function usePinnedState(pinned) {
5
- return pinned ? "pinned" : "unpinned";
6
+ return pinned ? "pinned" : "unpinned";
6
7
  }
7
8
  function usePinnedAttribute(pinned) {
8
- return pinned ? { "data-pinned": pinned } : void 0;
9
+ return pinned ? { "data-pinned": pinned } : void 0;
9
10
  }
10
11
  function useColumnStyles(column, pinnedVal) {
11
- const styles = useMemo(
12
- () => ({
13
- order: `var(--col-${column.id}-order)`,
14
- left: pinnedVal === "left" ? `var(--col-${column.id}-left)` : void 0,
15
- right: pinnedVal === "right" ? `var(--col-${column.id}-right)` : void 0,
16
- width: `var(--col-${column.id}-width)`
17
- }),
18
- [column.id, pinnedVal]
19
- );
20
- return styles;
12
+ return useMemo(() => ({
13
+ order: `var(--col-${column.id}-order)`,
14
+ left: pinnedVal === "left" ? `var(--col-${column.id}-left)` : void 0,
15
+ right: pinnedVal === "right" ? `var(--col-${column.id}-right)` : void 0,
16
+ width: `var(--col-${column.id}-width)`
17
+ }), [column.id, pinnedVal]);
21
18
  }
22
-
19
+ //#endregion
23
20
  export { useColumnStyles, usePinnedAttribute, usePinnedState };
package/dist/index.cjs CHANGED
@@ -1,15 +1,9 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- const dataGrid_client = require('./components/data-grid.client.cjs');
6
- const cerbyDataGrid_client = require('./components/cerby-data-grid.client.cjs');
7
- const context_client = require('./context.client.cjs');
8
- const columnHelpers = require('./column-helpers.cjs');
9
-
10
-
11
-
12
- exports.DataGrid = dataGrid_client.DataGrid;
13
- exports.CerberusDataGrid = cerbyDataGrid_client.CerberusDataGrid;
14
- exports.useDataGridContext = context_client.useDataGridContext;
15
- exports.createColumnHelper = columnHelpers.createColumnHelper;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_context_client = require("./context.client.cjs");
3
+ const require_data_grid_client = require("./components/data-grid.client.cjs");
4
+ const require_cerby_data_grid_client = require("./components/cerby-data-grid.client.cjs");
5
+ const require_column_helpers = require("./column-helpers.cjs");
6
+ exports.CerberusDataGrid = require_cerby_data_grid_client.CerberusDataGrid;
7
+ exports.DataGrid = require_data_grid_client.DataGrid;
8
+ exports.createColumnHelper = require_column_helpers.createColumnHelper;
9
+ exports.useDataGridContext = require_context_client.useDataGridContext;