@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.
- package/dist/column-helpers.cjs +55 -21
- package/dist/column-helpers.js +55 -17
- package/dist/components/cerby-data-grid.client.cjs +12 -11
- package/dist/components/cerby-data-grid.client.js +12 -7
- package/dist/components/count-menu.client.cjs +46 -49
- package/dist/components/count-menu.client.js +46 -45
- package/dist/components/data-grid.client.cjs +89 -82
- package/dist/components/data-grid.client.js +89 -78
- package/dist/components/features.client.cjs +72 -76
- package/dist/components/features.client.js +72 -72
- package/dist/components/grid.client.cjs +280 -309
- package/dist/components/grid.client.js +281 -303
- package/dist/components/pagination.client.cjs +90 -113
- package/dist/components/pagination.client.js +90 -109
- package/dist/components/pinned-items.client.cjs +60 -59
- package/dist/components/pinned-items.client.js +60 -55
- package/dist/components/sort-items.client.cjs +44 -49
- package/dist/components/sort-items.client.js +44 -45
- package/dist/const.cjs +32 -43
- package/dist/const.js +33 -31
- package/dist/context.client.cjs +12 -12
- package/dist/context.client.js +12 -8
- package/dist/hooks.client.cjs +13 -20
- package/dist/hooks.client.js +13 -16
- package/dist/index.cjs +9 -15
- package/dist/index.js +5 -4
- package/dist/panda.buildinfo.json +23 -0
- package/dist/store.cjs +241 -284
- package/dist/store.js +241 -280
- package/dist/utils.cjs +23 -45
- package/dist/utils.js +23 -41
- package/dist/virtualizer.client.cjs +63 -53
- package/dist/virtualizer.client.js +63 -49
- package/package.json +33 -27
|
@@ -1,66 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useRead } from
|
|
5
|
-
import { HStack } from
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { HStack, Square } from
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 {
|
|
34
|
+
//#endregion
|
|
35
|
+
export { DEFAULT_PAGE_SIZES, PARTS, ROW_SIZES, SCOPE };
|
package/dist/context.client.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14
|
+
return useBaseStore();
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
//#endregion
|
|
17
17
|
exports.DataGridProvider = DataGridProvider;
|
|
18
18
|
exports.useDataGridContext = useDataGridContext;
|
package/dist/context.client.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { createStoreContext } from
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
+
return /* @__PURE__ */ jsx(BaseProvider, {
|
|
9
|
+
createStore: props.createStore,
|
|
10
|
+
children: props.children
|
|
11
|
+
});
|
|
8
12
|
}
|
|
9
13
|
function useDataGridContext() {
|
|
10
|
-
|
|
14
|
+
return useBaseStore();
|
|
11
15
|
}
|
|
12
|
-
|
|
16
|
+
//#endregion
|
|
13
17
|
export { DataGridProvider, useDataGridContext };
|
package/dist/hooks.client.cjs
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
6
|
+
return pinned ? "pinned" : "unpinned";
|
|
10
7
|
}
|
|
11
8
|
function usePinnedAttribute(pinned) {
|
|
12
|
-
|
|
9
|
+
return pinned ? { "data-pinned": pinned } : void 0;
|
|
13
10
|
}
|
|
14
11
|
function useColumnStyles(column, pinnedVal) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
package/dist/hooks.client.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
//#region src/hooks.client.ts
|
|
4
5
|
function usePinnedState(pinned) {
|
|
5
|
-
|
|
6
|
+
return pinned ? "pinned" : "unpinned";
|
|
6
7
|
}
|
|
7
8
|
function usePinnedAttribute(pinned) {
|
|
8
|
-
|
|
9
|
+
return pinned ? { "data-pinned": pinned } : void 0;
|
|
9
10
|
}
|
|
10
11
|
function useColumnStyles(column, pinnedVal) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|