@trsys-tech/matrix-library 1.0.0-canary.3 → 1.0.0-canary.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.
- package/dist/command.es.js +17 -17
- package/dist/command.es.js.map +1 -1
- package/dist/components/command/Command.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/datagrid.es.js +15 -15
- package/dist/datagrid.es.js.map +1 -1
- package/dist/sidebar.es.js +13 -13
- package/dist/sidebar.es.js.map +1 -1
- package/dist/skeleton.es.js +1 -1
- package/dist/skeleton.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tabs.es.js +9 -9
- package/dist/tabs.es.js.map +1 -1
- package/package.json +1 -1
package/dist/command.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as r from "react";
|
|
3
3
|
import { Command as e } from "cmdk";
|
|
4
4
|
import { Magnifier as c } from "@trsys-tech/matrix-icons";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as d } from "./utils.es.js";
|
|
6
6
|
import { Dialog as u, DialogContent as f } from "./dialog.es.js";
|
|
7
|
-
const n =
|
|
7
|
+
const n = r.forwardRef(
|
|
8
8
|
({ className: m, ...t }, a) => /* @__PURE__ */ o(
|
|
9
9
|
e,
|
|
10
10
|
{
|
|
11
11
|
ref: a,
|
|
12
|
-
className:
|
|
12
|
+
className: d(
|
|
13
13
|
"mtx-flex mtx-h-full mtx-w-full mtx-flex-col mtx-overflow-hidden mtx-rounded-md mtx-bg-popover mtx-text-popover-foreground",
|
|
14
14
|
m
|
|
15
15
|
),
|
|
@@ -18,14 +18,14 @@ const n = d.forwardRef(
|
|
|
18
18
|
)
|
|
19
19
|
);
|
|
20
20
|
n.displayName = e.displayName;
|
|
21
|
-
const S = ({ children: m, ...t }) => /* @__PURE__ */ o(u, { ...t, children: /* @__PURE__ */ o(f, { className: "mtx-overflow-hidden mtx-p-0", children: /* @__PURE__ */ o(n, { className: "[&_[cmdk-group-heading]]:mtx-px-2 [&_[cmdk-group-heading]]:mtx-font-medium [&_[cmdk-group-heading]]:mtx-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:mtx-pt-0 [&_[cmdk-group]]:mtx-px-2 [&_[cmdk-input-wrapper]_svg]:mtx-h-5 [&_[cmdk-input-wrapper]_svg]:mtx-w-5 [&_[cmdk-input]]:mtx-h-12 [&_[cmdk-item]]:mtx-px-2 [&_[cmdk-item]]:mtx-py-3 [&_[cmdk-item]_svg]:mtx-h-5 [&_[cmdk-item]_svg]:mtx-w-5", children: m }) }) }), g =
|
|
22
|
-
({ className: m, ...t }, a) => /* @__PURE__ */ l("div", { className: "mtx-flex mtx-items-center mtx-border-b mtx-px-3", "cmdk-input-wrapper": "", children: [
|
|
21
|
+
const S = ({ children: m, ...t }) => /* @__PURE__ */ o(u, { ...t, children: /* @__PURE__ */ o(f, { className: "mtx-overflow-hidden mtx-p-0", children: /* @__PURE__ */ o(n, { className: "[&_[cmdk-group-heading]]:mtx-px-2 [&_[cmdk-group-heading]]:mtx-font-medium [&_[cmdk-group-heading]]:mtx-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:mtx-pt-0 [&_[cmdk-group]]:mtx-px-2 [&_[cmdk-input-wrapper]_svg]:mtx-h-5 [&_[cmdk-input-wrapper]_svg]:mtx-w-5 [&_[cmdk-input]]:mtx-h-12 [&_[cmdk-item]]:mtx-px-2 [&_[cmdk-item]]:mtx-py-3 [&_[cmdk-item]_svg]:mtx-h-5 [&_[cmdk-item]_svg]:mtx-w-5", children: m }) }) }), g = r.forwardRef(
|
|
22
|
+
({ className: m, ...t }, a) => /* @__PURE__ */ l("div", { className: "mtx-flex mtx-items-center mtx-border-b mtx-border-gray-200 mtx-px-3", "cmdk-input-wrapper": "", children: [
|
|
23
23
|
/* @__PURE__ */ o(c, { className: "mtx-mr-2 mtx-h-4 mtx-w-4 mtx-shrink-0 mtx-opacity-50" }),
|
|
24
24
|
/* @__PURE__ */ o(
|
|
25
25
|
e.Input,
|
|
26
26
|
{
|
|
27
27
|
ref: a,
|
|
28
|
-
className:
|
|
28
|
+
className: d(
|
|
29
29
|
"mtx-flex mtx-h-10 mtx-w-full mtx-rounded-md mtx-bg-transparent mtx-py-3 mtx-text-sm mtx-outline-none placeholder:mtx-text-muted-foreground disabled:mtx-cursor-not-allowed disabled:mtx-opacity-50",
|
|
30
30
|
m
|
|
31
31
|
),
|
|
@@ -35,20 +35,20 @@ const S = ({ children: m, ...t }) => /* @__PURE__ */ o(u, { ...t, children: /* @
|
|
|
35
35
|
] })
|
|
36
36
|
);
|
|
37
37
|
g.displayName = e.Input.displayName;
|
|
38
|
-
const h =
|
|
39
|
-
({ className: m, ...t }, a) => /* @__PURE__ */ o(e.List, { ref: a, className:
|
|
38
|
+
const h = r.forwardRef(
|
|
39
|
+
({ className: m, ...t }, a) => /* @__PURE__ */ o(e.List, { ref: a, className: d("mtx-max-h-[300px] mtx-overflow-y-auto mtx-overflow-x-hidden", m), ...t })
|
|
40
40
|
);
|
|
41
41
|
h.displayName = e.List.displayName;
|
|
42
|
-
const y =
|
|
42
|
+
const y = r.forwardRef(
|
|
43
43
|
(m, t) => /* @__PURE__ */ o(e.Empty, { ref: t, className: "mtx-py-6 mtx-text-center mtx-text-sm", ...m })
|
|
44
44
|
);
|
|
45
45
|
y.displayName = e.Empty.displayName;
|
|
46
|
-
const N =
|
|
46
|
+
const N = r.forwardRef(
|
|
47
47
|
({ className: m, ...t }, a) => /* @__PURE__ */ o(
|
|
48
48
|
e.Group,
|
|
49
49
|
{
|
|
50
50
|
ref: a,
|
|
51
|
-
className:
|
|
51
|
+
className: d(
|
|
52
52
|
"mtx-overflow-hidden mtx-p-1 mtx-text-foreground [&_[cmdk-group-heading]]:mtx-px-2 [&_[cmdk-group-heading]]:mtx-py-1.5 [&_[cmdk-group-heading]]:mtx-text-xs [&_[cmdk-group-heading]]:mtx-font-medium [&_[cmdk-group-heading]]:mtx-text-muted-foreground",
|
|
53
53
|
m
|
|
54
54
|
),
|
|
@@ -57,10 +57,10 @@ const N = d.forwardRef(
|
|
|
57
57
|
)
|
|
58
58
|
);
|
|
59
59
|
N.displayName = e.Group.displayName;
|
|
60
|
-
const _ =
|
|
60
|
+
const _ = r.forwardRef(({ className: m, ...t }, a) => /* @__PURE__ */ o(e.Separator, { ref: a, className: d("-mtx-mx-1 mtx-h-px mtx-bg-border", m), ...t }));
|
|
61
61
|
_.displayName = e.Separator.displayName;
|
|
62
|
-
const k =
|
|
63
|
-
const i =
|
|
62
|
+
const k = r.forwardRef(({ className: m, value: t, onSelect: a, ...s }, p) => {
|
|
63
|
+
const i = r.useCallback(
|
|
64
64
|
(x) => {
|
|
65
65
|
a?.(typeof t == "number" ? Number(x) : x);
|
|
66
66
|
},
|
|
@@ -70,7 +70,7 @@ const k = d.forwardRef(({ className: m, value: t, onSelect: a, ...s }, p) => {
|
|
|
70
70
|
e.Item,
|
|
71
71
|
{
|
|
72
72
|
ref: p,
|
|
73
|
-
className:
|
|
73
|
+
className: d(
|
|
74
74
|
"mtx-relative mtx-flex mtx-cursor-default mtx-gap-2 mtx-select-none mtx-items-center mtx-rounded-sm mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-outline-none data-[disabled=true]:mtx-pointer-events-none data-[selected=true]:mtx-bg-gray-300 data-[selected=true]:mtx-text-accent-foreground data-[disabled=true]:mtx-opacity-50 [&_svg]:mtx-pointer-events-none [&_svg]:mtx-size-4 [&_svg]:mtx-shrink-0",
|
|
75
75
|
m
|
|
76
76
|
),
|
|
@@ -81,7 +81,7 @@ const k = d.forwardRef(({ className: m, value: t, onSelect: a, ...s }, p) => {
|
|
|
81
81
|
);
|
|
82
82
|
});
|
|
83
83
|
k.displayName = e.Item.displayName;
|
|
84
|
-
const w = ({ className: m, ...t }) => /* @__PURE__ */ o("span", { className:
|
|
84
|
+
const w = ({ className: m, ...t }) => /* @__PURE__ */ o("span", { className: d("mtx-ml-auto mtx-text-xs mtx-tracking-widest mtx-text-muted-foreground", m), ...t });
|
|
85
85
|
w.displayName = "CommandShortcut";
|
|
86
86
|
export {
|
|
87
87
|
n as Command,
|
package/dist/command.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.es.js","sources":["../src/components/command/Command.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Command as CommandPrimitive } from \"cmdk\";\r\nimport { Magnifier } from \"@trsys-tech/matrix-icons\";\r\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Dialog, DialogContent } from \"../dialog/Dialog\";\r\n\r\nconst Command = React.forwardRef<React.ElementRef<typeof CommandPrimitive>, React.ComponentPropsWithoutRef<typeof CommandPrimitive>>(\r\n ({ className, ...props }, ref) => (\r\n <CommandPrimitive\r\n ref={ref}\r\n className={cn(\r\n \"mtx-flex mtx-h-full mtx-w-full mtx-flex-col mtx-overflow-hidden mtx-rounded-md mtx-bg-popover mtx-text-popover-foreground\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n ),\r\n);\r\nCommand.displayName = CommandPrimitive.displayName;\r\n\r\nconst CommandDialog = ({ children, ...props }: DialogProps) => {\r\n return (\r\n <Dialog {...props}>\r\n <DialogContent className=\"mtx-overflow-hidden mtx-p-0\">\r\n <Command className=\"[&_[cmdk-group-heading]]:mtx-px-2 [&_[cmdk-group-heading]]:mtx-font-medium [&_[cmdk-group-heading]]:mtx-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:mtx-pt-0 [&_[cmdk-group]]:mtx-px-2 [&_[cmdk-input-wrapper]_svg]:mtx-h-5 [&_[cmdk-input-wrapper]_svg]:mtx-w-5 [&_[cmdk-input]]:mtx-h-12 [&_[cmdk-item]]:mtx-px-2 [&_[cmdk-item]]:mtx-py-3 [&_[cmdk-item]_svg]:mtx-h-5 [&_[cmdk-item]_svg]:mtx-w-5\">\r\n {children}\r\n </Command>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n};\r\n\r\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>>(\r\n ({ className, ...props }, ref) => (\r\n <div className=\"mtx-flex mtx-items-center mtx-border-b mtx-px-3\" cmdk-input-wrapper=\"\">\r\n <Magnifier className=\"mtx-mr-2 mtx-h-4 mtx-w-4 mtx-shrink-0 mtx-opacity-50\" />\r\n <CommandPrimitive.Input\r\n ref={ref}\r\n className={cn(\r\n \"mtx-flex mtx-h-10 mtx-w-full mtx-rounded-md mtx-bg-transparent mtx-py-3 mtx-text-sm mtx-outline-none placeholder:mtx-text-muted-foreground disabled:mtx-cursor-not-allowed disabled:mtx-opacity-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </div>\r\n ),\r\n);\r\n\r\nCommandInput.displayName = CommandPrimitive.Input.displayName;\r\n\r\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>>(\r\n ({ className, ...props }, ref) => (\r\n <CommandPrimitive.List ref={ref} className={cn(\"mtx-max-h-[300px] mtx-overflow-y-auto mtx-overflow-x-hidden\", className)} {...props} />\r\n ),\r\n);\r\n\r\nCommandList.displayName = CommandPrimitive.List.displayName;\r\n\r\nconst CommandEmpty = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Empty>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>>(\r\n (props, ref) => <CommandPrimitive.Empty ref={ref} className=\"mtx-py-6 mtx-text-center mtx-text-sm\" {...props} />,\r\n);\r\n\r\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\r\n\r\nconst CommandGroup = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Group>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>>(\r\n ({ className, ...props }, ref) => (\r\n <CommandPrimitive.Group\r\n ref={ref}\r\n className={cn(\r\n \"mtx-overflow-hidden mtx-p-1 mtx-text-foreground [&_[cmdk-group-heading]]:mtx-px-2 [&_[cmdk-group-heading]]:mtx-py-1.5 [&_[cmdk-group-heading]]:mtx-text-xs [&_[cmdk-group-heading]]:mtx-font-medium [&_[cmdk-group-heading]]:mtx-text-muted-foreground\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n ),\r\n);\r\n\r\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\r\n\r\nconst CommandSeparator = React.forwardRef<\r\n React.ElementRef<typeof CommandPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <CommandPrimitive.Separator ref={ref} className={cn(\"-mtx-mx-1 mtx-h-px mtx-bg-border\", className)} {...props} />\r\n));\r\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\r\n\r\nconst CommandItem = React.forwardRef<\r\n React.ElementRef<typeof CommandPrimitive.Item>,\r\n Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, \"value\" | \"onSelect\"> & {\r\n value?: string | number;\r\n onSelect?: (value: string | number) => void;\r\n }\r\n>(({ className, value, onSelect, ...props }, ref) => {\r\n const handleSelect = React.useCallback(\r\n (selectedValue: string) => {\r\n if (typeof value === \"number\") {\r\n onSelect?.(Number(selectedValue));\r\n } else {\r\n onSelect?.(selectedValue);\r\n }\r\n },\r\n [value, onSelect],\r\n );\r\n return (\r\n <CommandPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"mtx-relative mtx-flex mtx-cursor-default mtx-gap-2 mtx-select-none mtx-items-center mtx-rounded-sm mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-outline-none data-[disabled=true]:mtx-pointer-events-none data-[selected=true]:mtx-bg-gray-300 data-[selected=true]:mtx-text-accent-foreground data-[disabled=true]:mtx-opacity-50 [&_svg]:mtx-pointer-events-none [&_svg]:mtx-size-4 [&_svg]:mtx-shrink-0\",\r\n className,\r\n )}\r\n value={value !== undefined ? String(value) : undefined}\r\n onSelect={handleSelect}\r\n {...props}\r\n />\r\n );\r\n});\r\n\r\nCommandItem.displayName = CommandPrimitive.Item.displayName;\r\n\r\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return <span className={cn(\"mtx-ml-auto mtx-text-xs mtx-tracking-widest mtx-text-muted-foreground\", className)} {...props} />;\r\n};\r\nCommandShortcut.displayName = \"CommandShortcut\";\r\n\r\nexport { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };\r\n"],"names":["Command","React","className","props","ref","jsx","CommandPrimitive","cn","CommandDialog","children","Dialog","DialogContent","CommandInput","jsxs","Magnifier","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","value","onSelect","handleSelect","selectedValue","CommandShortcut"],"mappings":";;;;;;AAUA,MAAMA,IAAUC,EAAM;AAAA,EACpB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAL;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AACAH,EAAQ,cAAcM,EAAiB;AAEvC,MAAME,IAAgB,CAAC,EAAE,UAAAC,GAAU,GAAGN,QAElC,gBAAAE,EAACK,GAAA,EAAQ,GAAGP,GACV,4BAACQ,GAAA,EAAc,WAAU,+BACvB,UAAA,gBAAAN,EAACL,GAAA,EAAQ,WAAU,+ZAChB,UAAAS,EAAA,CACH,GACF,GACF,GAIEG,IAAeX,EAAM;AAAA,EACzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAS,EAAC,OAAA,EAAI,WAAU,
|
|
1
|
+
{"version":3,"file":"command.es.js","sources":["../src/components/command/Command.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Command as CommandPrimitive } from \"cmdk\";\r\nimport { Magnifier } from \"@trsys-tech/matrix-icons\";\r\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Dialog, DialogContent } from \"../dialog/Dialog\";\r\n\r\nconst Command = React.forwardRef<React.ElementRef<typeof CommandPrimitive>, React.ComponentPropsWithoutRef<typeof CommandPrimitive>>(\r\n ({ className, ...props }, ref) => (\r\n <CommandPrimitive\r\n ref={ref}\r\n className={cn(\r\n \"mtx-flex mtx-h-full mtx-w-full mtx-flex-col mtx-overflow-hidden mtx-rounded-md mtx-bg-popover mtx-text-popover-foreground\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n ),\r\n);\r\nCommand.displayName = CommandPrimitive.displayName;\r\n\r\nconst CommandDialog = ({ children, ...props }: DialogProps) => {\r\n return (\r\n <Dialog {...props}>\r\n <DialogContent className=\"mtx-overflow-hidden mtx-p-0\">\r\n <Command className=\"[&_[cmdk-group-heading]]:mtx-px-2 [&_[cmdk-group-heading]]:mtx-font-medium [&_[cmdk-group-heading]]:mtx-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:mtx-pt-0 [&_[cmdk-group]]:mtx-px-2 [&_[cmdk-input-wrapper]_svg]:mtx-h-5 [&_[cmdk-input-wrapper]_svg]:mtx-w-5 [&_[cmdk-input]]:mtx-h-12 [&_[cmdk-item]]:mtx-px-2 [&_[cmdk-item]]:mtx-py-3 [&_[cmdk-item]_svg]:mtx-h-5 [&_[cmdk-item]_svg]:mtx-w-5\">\r\n {children}\r\n </Command>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n};\r\n\r\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>>(\r\n ({ className, ...props }, ref) => (\r\n <div className=\"mtx-flex mtx-items-center mtx-border-b mtx-border-gray-200 mtx-px-3\" cmdk-input-wrapper=\"\">\r\n <Magnifier className=\"mtx-mr-2 mtx-h-4 mtx-w-4 mtx-shrink-0 mtx-opacity-50\" />\r\n <CommandPrimitive.Input\r\n ref={ref}\r\n className={cn(\r\n \"mtx-flex mtx-h-10 mtx-w-full mtx-rounded-md mtx-bg-transparent mtx-py-3 mtx-text-sm mtx-outline-none placeholder:mtx-text-muted-foreground disabled:mtx-cursor-not-allowed disabled:mtx-opacity-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </div>\r\n ),\r\n);\r\n\r\nCommandInput.displayName = CommandPrimitive.Input.displayName;\r\n\r\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>>(\r\n ({ className, ...props }, ref) => (\r\n <CommandPrimitive.List ref={ref} className={cn(\"mtx-max-h-[300px] mtx-overflow-y-auto mtx-overflow-x-hidden\", className)} {...props} />\r\n ),\r\n);\r\n\r\nCommandList.displayName = CommandPrimitive.List.displayName;\r\n\r\nconst CommandEmpty = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Empty>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>>(\r\n (props, ref) => <CommandPrimitive.Empty ref={ref} className=\"mtx-py-6 mtx-text-center mtx-text-sm\" {...props} />,\r\n);\r\n\r\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\r\n\r\nconst CommandGroup = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Group>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>>(\r\n ({ className, ...props }, ref) => (\r\n <CommandPrimitive.Group\r\n ref={ref}\r\n className={cn(\r\n \"mtx-overflow-hidden mtx-p-1 mtx-text-foreground [&_[cmdk-group-heading]]:mtx-px-2 [&_[cmdk-group-heading]]:mtx-py-1.5 [&_[cmdk-group-heading]]:mtx-text-xs [&_[cmdk-group-heading]]:mtx-font-medium [&_[cmdk-group-heading]]:mtx-text-muted-foreground\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n ),\r\n);\r\n\r\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\r\n\r\nconst CommandSeparator = React.forwardRef<\r\n React.ElementRef<typeof CommandPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <CommandPrimitive.Separator ref={ref} className={cn(\"-mtx-mx-1 mtx-h-px mtx-bg-border\", className)} {...props} />\r\n));\r\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\r\n\r\nconst CommandItem = React.forwardRef<\r\n React.ElementRef<typeof CommandPrimitive.Item>,\r\n Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, \"value\" | \"onSelect\"> & {\r\n value?: string | number;\r\n onSelect?: (value: string | number) => void;\r\n }\r\n>(({ className, value, onSelect, ...props }, ref) => {\r\n const handleSelect = React.useCallback(\r\n (selectedValue: string) => {\r\n if (typeof value === \"number\") {\r\n onSelect?.(Number(selectedValue));\r\n } else {\r\n onSelect?.(selectedValue);\r\n }\r\n },\r\n [value, onSelect],\r\n );\r\n return (\r\n <CommandPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"mtx-relative mtx-flex mtx-cursor-default mtx-gap-2 mtx-select-none mtx-items-center mtx-rounded-sm mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-outline-none data-[disabled=true]:mtx-pointer-events-none data-[selected=true]:mtx-bg-gray-300 data-[selected=true]:mtx-text-accent-foreground data-[disabled=true]:mtx-opacity-50 [&_svg]:mtx-pointer-events-none [&_svg]:mtx-size-4 [&_svg]:mtx-shrink-0\",\r\n className,\r\n )}\r\n value={value !== undefined ? String(value) : undefined}\r\n onSelect={handleSelect}\r\n {...props}\r\n />\r\n );\r\n});\r\n\r\nCommandItem.displayName = CommandPrimitive.Item.displayName;\r\n\r\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return <span className={cn(\"mtx-ml-auto mtx-text-xs mtx-tracking-widest mtx-text-muted-foreground\", className)} {...props} />;\r\n};\r\nCommandShortcut.displayName = \"CommandShortcut\";\r\n\r\nexport { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };\r\n"],"names":["Command","React","className","props","ref","jsx","CommandPrimitive","cn","CommandDialog","children","Dialog","DialogContent","CommandInput","jsxs","Magnifier","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","value","onSelect","handleSelect","selectedValue","CommandShortcut"],"mappings":";;;;;;AAUA,MAAMA,IAAUC,EAAM;AAAA,EACpB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAL;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AACAH,EAAQ,cAAcM,EAAiB;AAEvC,MAAME,IAAgB,CAAC,EAAE,UAAAC,GAAU,GAAGN,QAElC,gBAAAE,EAACK,GAAA,EAAQ,GAAGP,GACV,4BAACQ,GAAA,EAAc,WAAU,+BACvB,UAAA,gBAAAN,EAACL,GAAA,EAAQ,WAAU,+ZAChB,UAAAS,EAAA,CACH,GACF,GACF,GAIEG,IAAeX,EAAM;AAAA,EACzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAS,EAAC,OAAA,EAAI,WAAU,uEAAsE,sBAAmB,IACtG,UAAA;AAAA,IAAA,gBAAAR,EAACS,GAAA,EAAU,WAAU,uDAAA,CAAuD;AAAA,IAC5E,gBAAAT;AAAA,MAACC,EAAiB;AAAA,MAAjB;AAAA,QACC,KAAAF;AAAA,QACA,WAAWG;AAAA,UACT;AAAA,UACAL;AAAA,QAAA;AAAA,QAED,GAAG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AEpBA,CAFqB;AAAA,IAIpC;AAAA,IACA,CAACH,GAAOC,CAAQ;AAAA,EAAA;AAElB,SACE,gBAAAhB;AAAA,IAACC,EAAiB;AAAA,IAAjB;AAAA,MACC,KAAAF;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAL;AAAA,MAAA;AAAA,MAEF,OAAOkB,MAAU,SAAY,OAAOA,CAAK,IAAI;AAAA,MAC7C,UAAUE;AAAA,MACT,GAAGnB;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AAEDgB,EAAY,cAAcb,EAAiB,KAAK;AAEhD,MAAMkB,IAAkB,CAAC,EAAE,WAAAtB,GAAW,GAAGC,QAChC,gBAAAE,EAAC,UAAK,WAAWE,EAAG,yEAAyEL,CAAS,GAAI,GAAGC,GAAO;AAE7HqB,EAAgB,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../src/components/command/Command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,OAAO;qBANmB,SAAS;;
|
|
1
|
+
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../src/components/command/Command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,OAAO;qBANmB,SAAS;;gBA8Hk+H,GAAG;;;;;;;;;;;;;sFA7G7gI,CAAC;AAGF,QAAA,MAAM,aAAa,2BAA4B,WAAW,4CAUzD,CAAC;AAEF,QAAA,MAAM,YAAY;gBA8Fq1O,GAAG;;;;;;0FAhFz2O,CAAC;AAIF,QAAA,MAAM,WAAW;qBAlDe,SAAS;;gBA8HsqL,GAAG;;;;;sFAxEjtL,CAAC;AAI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,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,CAAC"}
|
package/dist/datagrid.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as o, jsxs as z } from "react/jsx-runtime";
|
|
2
|
-
import t, { forwardRef as H, useMemo as
|
|
2
|
+
import t, { forwardRef as H, useMemo as G } from "react";
|
|
3
3
|
import { AgGridReact as L } from "ag-grid-react";
|
|
4
4
|
import { themeQuartz as M, ModuleRegistry as B, AllCommunityModule as Q } from "ag-grid-community";
|
|
5
|
-
import { Trashcan as O, ElipsisVertical as q, Snowflake as $, Print as j, Refresh as _, CircleXmark as U, Magnifier as
|
|
5
|
+
import { Trashcan as O, ElipsisVertical as q, Snowflake as $, Print as j, Refresh as _, CircleXmark as U, Magnifier as N } from "@trsys-tech/matrix-icons";
|
|
6
6
|
import { cn as g } from "./utils.es.js";
|
|
7
7
|
import { printHtml as V } from "./printhtml.es.js";
|
|
8
8
|
import { TextField as W } from "./textfield.es.js";
|
|
@@ -15,11 +15,11 @@ const Y = M.withParams({
|
|
|
15
15
|
fontSize: "12px",
|
|
16
16
|
headerFontSize: "12px",
|
|
17
17
|
headerFontWeight: 700,
|
|
18
|
-
headerBackgroundColor: "
|
|
19
|
-
backgroundColor: "
|
|
20
|
-
accentColor: "
|
|
21
|
-
foregroundColor: "
|
|
22
|
-
cellTextColor: "
|
|
18
|
+
headerBackgroundColor: "oklch(var(--mtx-primary-50))",
|
|
19
|
+
backgroundColor: "oklch(var(--mtx-gray-0))",
|
|
20
|
+
accentColor: "oklch(var(--mtx-primary-300))",
|
|
21
|
+
foregroundColor: "oklch(var(--mtx-text-500))",
|
|
22
|
+
cellTextColor: "oklch(var(--mtx-text-500))"
|
|
23
23
|
}), p = t.createContext(null), mt = () => {
|
|
24
24
|
const r = t.useContext(p);
|
|
25
25
|
if (!r)
|
|
@@ -53,7 +53,7 @@ const Y = M.withParams({
|
|
|
53
53
|
const u = t.useContext(p);
|
|
54
54
|
if (!u)
|
|
55
55
|
throw new Error("DataGridContent should be used within <DataGrid>");
|
|
56
|
-
const { rowData: l, setRowData: e, actionbarExists: x, setApi: h, setQuickFilterText: f, quickFilterText: R, gridId: E, actionbarHeight: C, pinnedRowIds: w } = u, b =
|
|
56
|
+
const { rowData: l, setRowData: e, actionbarExists: x, setApi: h, setQuickFilterText: f, quickFilterText: R, gridId: E, actionbarHeight: C, pinnedRowIds: w } = u, b = G(() => Y.withParams({
|
|
57
57
|
headerHeight: 40,
|
|
58
58
|
wrapperBorderRadius: x ? "0px 0px 8px 8px" : "8px"
|
|
59
59
|
}), [x]), y = (v) => {
|
|
@@ -64,14 +64,14 @@ const Y = M.withParams({
|
|
|
64
64
|
}, [n, e]), t.useEffect(() => {
|
|
65
65
|
i !== void 0 && f(i ?? "");
|
|
66
66
|
}, [i, f]);
|
|
67
|
-
const { finalRowData: F, finalPinnedTopRowData: I } =
|
|
67
|
+
const { finalRowData: F, finalPinnedTopRowData: I } = G(() => {
|
|
68
68
|
if (!l || w.size === 0)
|
|
69
69
|
return { finalRowData: l, finalPinnedTopRowData: [] };
|
|
70
|
-
const v = [],
|
|
70
|
+
const v = [], A = [];
|
|
71
71
|
return l.forEach((S) => {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
}), { finalRowData:
|
|
72
|
+
const k = c ? c({ data: S, level: 0 }) : S.id, T = k != null ? String(k) : void 0;
|
|
73
|
+
T !== void 0 && w.has(T) ? v.push(S) : A.push(S);
|
|
74
|
+
}), { finalRowData: A, finalPinnedTopRowData: v };
|
|
75
75
|
}, [l, w, c]);
|
|
76
76
|
return /* @__PURE__ */ o(
|
|
77
77
|
L,
|
|
@@ -137,10 +137,10 @@ const xt = ({ className: r, ...s }) => {
|
|
|
137
137
|
),
|
|
138
138
|
onChange: (R) => c(R.target.value),
|
|
139
139
|
value: a,
|
|
140
|
-
startAdornment: /* @__PURE__ */ o(D, { variant: "toolbar", className: "mtx-p-0.5 mtx-h-6 mtx-w-6 mtx-border-none mtx-mx-1", onClick: f, children: /* @__PURE__ */ o(
|
|
140
|
+
startAdornment: /* @__PURE__ */ o(D, { variant: "toolbar", className: "mtx-p-0.5 mtx-h-6 mtx-w-6 mtx-border-none mtx-mx-1", onClick: f, children: /* @__PURE__ */ o(N, { className: "mtx-w-5 mtx-h-5" }) }),
|
|
141
141
|
endAdornment: a && /* @__PURE__ */ o(D, { variant: "toolbar", className: "mtx-p-0.5 mtx-w-6 mtx-h-6 mtx-border-none mtx-mx-1", onClick: x, children: /* @__PURE__ */ o(U, { className: "mtx-w-5 mtx-h-5" }) })
|
|
142
142
|
}
|
|
143
|
-
) : /* @__PURE__ */ o(D, { variant: "toolbar", className: "mtx-p-0.5 mtx-w-6 mtx-h-6 mtx-m-1", onClick: h, children: /* @__PURE__ */ o(
|
|
143
|
+
) : /* @__PURE__ */ o(D, { variant: "toolbar", className: "mtx-p-0.5 mtx-w-6 mtx-h-6 mtx-m-1", onClick: h, children: /* @__PURE__ */ o(N, { className: "mtx-w-5 mtx-h-5" }) }) });
|
|
144
144
|
}, ft = ({ freezeText: r, unFreezeText: s, onClick: i, disabled: n, ...a }) => {
|
|
145
145
|
const c = t.useContext(p);
|
|
146
146
|
if (!c)
|
package/dist/datagrid.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datagrid.es.js","sources":["../src/components/data-grid/DataGrid.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { forwardRef, HTMLAttributes, useMemo } from \"react\";\r\nimport { AgGridReact, AgGridReactProps } from \"ag-grid-react\";\r\nimport { GridApi, GridReadyEvent, themeQuartz, AllCommunityModule, ModuleRegistry, Theme } from \"ag-grid-community\";\r\nimport { CircleXmark, ElipsisVertical, Magnifier, Print, Refresh, Snowflake, Trashcan } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { printHtml } from \"../../lib/printHtml\";\r\nimport { TextField } from \"../text-field/TextField\";\r\nimport { Button, ButtonProps } from \"../button/Button\";\r\nimport { IconButton, IconButtonProps } from \"../icon-botton/IconButton\";\r\nimport { Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps } from \"../popover/Popover\";\r\n\r\n// Register all Community features\r\n// Todo: Register only the required features\r\nModuleRegistry.registerModules([AllCommunityModule]);\r\n\r\nconst dataGridDefaultTheme = themeQuartz.withParams({\r\n fontFamily: \"DMSans\",\r\n fontSize: \"12px\",\r\n headerFontSize: \"12px\",\r\n headerFontWeight: 700,\r\n headerBackgroundColor: \"hsl(var(--mtx-primary-50))\",\r\n backgroundColor: \"hsl(var(--mtx-gray-0))\",\r\n accentColor: \"hsl(var(--mtx-primary-300))\",\r\n foregroundColor: \"hsl(var(--mtx-text-500))\",\r\n cellTextColor: \"hsl(var(--mtx-text-500))\",\r\n});\r\n\r\ntype DataGridContext = {\r\n api: GridApi | null;\r\n setApi: (value: GridApi) => void;\r\n rowData: any[] | null | undefined;\r\n setRowData: (value: any[] | null | undefined) => void;\r\n gridId: string;\r\n quickFilterText: string;\r\n setQuickFilterText: (value: string) => void;\r\n actionbarExists: boolean;\r\n setActionbarExists: (value: boolean) => void;\r\n actionbarHeight: number;\r\n setActionbarHeight: (value: number) => void;\r\n pinnedRowIds: Set<string>;\r\n setPinnedRowIds: (value: Set<string>) => void;\r\n};\r\n\r\nconst DataGridContext = React.createContext<DataGridContext | null>(null);\r\n\r\nconst useDataGrid = () => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDataGrid should be used within <DataGrid>\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\ntype DataGridProps = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst DataGrid: React.FC<DataGridProps> = ({ children }) => {\r\n const gridId = React.useId();\r\n const [api, setApi] = React.useState<GridApi | null>(null);\r\n const [rowData, setRowData] = React.useState<any[] | null | undefined>([]);\r\n const [actionbarHeight, setActionbarHeight] = React.useState(0);\r\n const [pinnedRowIds, setPinnedRowIds] = React.useState<Set<string>>(new Set());\r\n\r\n const [quickFilterText, setQuickFilterText] = React.useState(\"\");\r\n const [actionbarExists, setActionbarExists] = React.useState(false);\r\n return (\r\n <DataGridContext.Provider\r\n value={{\r\n api,\r\n setApi,\r\n rowData,\r\n setRowData,\r\n gridId,\r\n quickFilterText,\r\n setQuickFilterText,\r\n actionbarExists,\r\n setActionbarExists,\r\n actionbarHeight,\r\n setActionbarHeight,\r\n pinnedRowIds,\r\n setPinnedRowIds,\r\n }}\r\n >\r\n {children}\r\n </DataGridContext.Provider>\r\n );\r\n};\r\n\r\ntype DataGridContentProps = Omit<AgGridReactProps, \"theme\"> & {\r\n theme?: Theme;\r\n};\r\n\r\nconst DataGridContent = forwardRef<AgGridReact, DataGridContentProps>(\r\n ({ theme: propTheme, onGridReady, quickFilterText: quickFilterTextProps, rowData: rowDataProps, containerStyle, getRowId, ...props }, ref) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridContent should be used within <DataGrid>\");\r\n }\r\n const { rowData, setRowData, actionbarExists, setApi, setQuickFilterText, quickFilterText, gridId, actionbarHeight, pinnedRowIds } = context;\r\n\r\n const theme = useMemo(() => {\r\n return dataGridDefaultTheme.withParams({\r\n headerHeight: 40,\r\n wrapperBorderRadius: actionbarExists ? \"0px 0px 8px 8px\" : \"8px\",\r\n });\r\n }, [actionbarExists]);\r\n\r\n const handleGridReady = (e: GridReadyEvent) => {\r\n setApi(e.api);\r\n onGridReady?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n setRowData(rowDataProps);\r\n }, [rowDataProps, setRowData]);\r\n\r\n React.useEffect(() => {\r\n if (quickFilterTextProps !== undefined) {\r\n setQuickFilterText(quickFilterTextProps ?? \"\");\r\n }\r\n }, [quickFilterTextProps, setQuickFilterText]);\r\n\r\n const { finalRowData, finalPinnedTopRowData } = useMemo(() => {\r\n if (!rowData || pinnedRowIds.size === 0) {\r\n return { finalRowData: rowData, finalPinnedTopRowData: [] };\r\n }\r\n\r\n const pinned: any[] = [];\r\n const unpinned: any[] = [];\r\n\r\n rowData.forEach(data => {\r\n const id = getRowId ? getRowId({ data, level: 0 } as any) : (data as any).id;\r\n const stringId = id !== undefined && id !== null ? String(id) : undefined;\r\n\r\n if (stringId !== undefined && pinnedRowIds.has(stringId)) {\r\n pinned.push(data);\r\n } else {\r\n unpinned.push(data);\r\n }\r\n });\r\n\r\n return { finalRowData: unpinned, finalPinnedTopRowData: pinned };\r\n }, [rowData, pinnedRowIds, getRowId]);\r\n\r\n return (\r\n <AgGridReact\r\n gridId={gridId}\r\n theme={propTheme ?? theme}\r\n rowData={finalRowData}\r\n pinnedTopRowData={finalPinnedTopRowData}\r\n quickFilterText={quickFilterText}\r\n onGridReady={handleGridReady}\r\n containerStyle={{ height: `calc(100% - ${actionbarHeight}px)`, ...containerStyle }}\r\n getRowId={getRowId}\r\n {...props}\r\n ref={ref}\r\n />\r\n );\r\n },\r\n);\r\n\r\nDataGridContent.displayName = \"DataGridContent\";\r\n\r\ntype DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};\r\n\r\nconst DataGridActionBar: React.FC<DatagridActionBarProps> = ({ className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridActionBar should be used within <DataGrid>\");\r\n }\r\n const ref = React.useRef<HTMLDivElement | null>(null);\r\n const { setActionbarExists, setActionbarHeight } = context;\r\n const { children } = props;\r\n\r\n React.useEffect(() => {\r\n setActionbarExists(true);\r\n return () => setActionbarExists(false);\r\n }, [setActionbarExists]);\r\n\r\n React.useEffect(() => {\r\n if (ref.current) {\r\n setActionbarHeight(ref.current.clientHeight);\r\n }\r\n }, [setActionbarHeight]);\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"mtx-relative mtx-flex mtx-items-center mtx-p-2 mtx-h-12 mtx-w-full mtx-bg-gray-0 mtx-border mtx-border-gray-200 mtx-border-b-0 -mtx-mb-[1px] mtx-z-10 mtx-rounded-t-[8px]\",\r\n className,\r\n )}\r\n ref={ref}\r\n >\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\ntype SearchActionProps = HTMLAttributes<HTMLDivElement> & {\r\n defaultOpen?: boolean;\r\n};\r\n\r\nconst SearchAction: React.FC<SearchActionProps> = ({ defaultOpen = false, className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"SearchAction should be used within <DataGrid>\");\r\n }\r\n\r\n const { quickFilterText, setQuickFilterText } = context;\r\n\r\n const [isSearchInputOpen, setIsSearchInputOpen] = React.useState(defaultOpen);\r\n const [isClosing, setIsClosing] = React.useState(false);\r\n const inputRef = React.useRef<HTMLInputElement | null>(null);\r\n\r\n const handleClear = () => {\r\n context.setQuickFilterText(\"\");\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const handleOpen = () => {\r\n setIsSearchInputOpen(true);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isSearchInputOpen && inputRef?.current) {\r\n inputRef.current.focus();\r\n }\r\n }, [isSearchInputOpen]);\r\n\r\n const handleClose = () => {\r\n setIsClosing(true);\r\n context.setQuickFilterText(\"\");\r\n setTimeout(() => {\r\n setIsSearchInputOpen(false);\r\n setIsClosing(false);\r\n }, 200);\r\n };\r\n\r\n return (\r\n <div className={cn(\"mtx-max-w-60\", className)} {...props}>\r\n {isSearchInputOpen || isClosing ? (\r\n <TextField\r\n ref={inputRef}\r\n className={cn(\r\n \"mtx-relative mtx-h-7.5\",\r\n isSearchInputOpen && !isClosing ? \"mtx-animate-input-open\" : \"\",\r\n isClosing && \"mtx-animate-input-close\",\r\n )}\r\n onChange={e => setQuickFilterText(e.target.value)}\r\n value={quickFilterText}\r\n startAdornment={\r\n <IconButton variant=\"toolbar\" className=\"mtx-p-0.5 mtx-h-6 mtx-w-6 mtx-border-none mtx-mx-1\" onClick={handleClose}>\r\n <Magnifier className=\"mtx-w-5 mtx-h-5\" />\r\n </IconButton>\r\n }\r\n endAdornment={\r\n quickFilterText && (\r\n <IconButton variant=\"toolbar\" className=\"mtx-p-0.5 mtx-w-6 mtx-h-6 mtx-border-none mtx-mx-1\" onClick={handleClear}>\r\n <CircleXmark className=\"mtx-w-5 mtx-h-5\" />\r\n </IconButton>\r\n )\r\n }\r\n />\r\n ) : (\r\n <IconButton variant=\"toolbar\" className=\"mtx-p-0.5 mtx-w-6 mtx-h-6 mtx-m-1\" onClick={handleOpen}>\r\n <Magnifier className=\"mtx-w-5 mtx-h-5\" />\r\n </IconButton>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\ntype FreezeActionProps = ButtonProps & {\r\n freezeText?: string;\r\n unFreezeText?: string;\r\n};\r\n\r\nconst FreezeAction: React.FC<FreezeActionProps> = ({ freezeText, unFreezeText, onClick, disabled, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"FreezeAction should be used within <DataGrid>\");\r\n }\r\n\r\n const [pinnedRowCount, setPinnedRowCount] = React.useState(0);\r\n const [selectedRowsCount, setSelectedRowsCount] = React.useState(0);\r\n\r\n const { api, pinnedRowIds, setPinnedRowIds } = context;\r\n\r\n const freezeRows = () => {\r\n if (!api) return;\r\n\r\n // Get currently selected rows\r\n const selectedRows = api.getSelectedNodes();\r\n\r\n if (selectedRows.length > 0) {\r\n const newPinnedIds = new Set(pinnedRowIds);\r\n selectedRows.forEach(row => {\r\n if (row.id !== undefined) {\r\n newPinnedIds.add(row.id);\r\n }\r\n });\r\n setPinnedRowIds(newPinnedIds);\r\n api.deselectAll();\r\n }\r\n };\r\n\r\n const unfreezeRows = () => {\r\n setPinnedRowIds(new Set());\r\n };\r\n\r\n const handleFreezing = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (api) {\r\n const pinnedRowsCount = api.getPinnedTopRowCount();\r\n if (pinnedRowsCount > 0) {\r\n unfreezeRows();\r\n } else {\r\n freezeRows();\r\n }\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n api?.addEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.addEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n\r\n return () => {\r\n if (api?.isDestroyed()) return;\r\n api?.removeEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.removeEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n onClick={handleFreezing}\r\n startIcon={<Snowflake className=\"mtx-w-4.5 mtx-h-4.5\" />}\r\n disabled={(!pinnedRowCount && !selectedRowsCount) || disabled}\r\n {...props}\r\n >\r\n {pinnedRowCount ? (unFreezeText ?? \"Unfreeze\") : (freezeText ?? \"Freeze\")}\r\n </Button>\r\n );\r\n};\r\n\r\ntype PrintActionProps = IconButtonProps & {};\r\n\r\nconst PrintAction: React.FC<PrintActionProps> = ({ children, className, onClick, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"PrintAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handlePrint = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (context.api) {\r\n context.api.setGridOption(\"domLayout\", \"print\");\r\n\r\n setTimeout(() => {\r\n const element = document.querySelector(\"[grid-id='\" + context.gridId + \"']\") as HTMLElement;\r\n const header = document.head;\r\n const html = `<html>\r\n ${header.innerHTML}\r\n ${element.outerHTML}\r\n </html>`;\r\n printHtml(html);\r\n context?.api?.setGridOption(\"domLayout\", undefined);\r\n });\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n return (\r\n <IconButton variant=\"toolbar\" className={cn(\"mtx-p-0.5 mtx-w-6 mtx-h-6\", className)} onClick={handlePrint} {...props}>\r\n {children ?? <Print className=\"mtx-w-5 mtx-h-5\" />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype RefreshActionProps = Omit<IconButtonProps, \"onClick\"> & {\r\n onRefresh: () => void;\r\n};\r\n\r\nconst RefreshAction: React.FC<RefreshActionProps> = ({ className, onRefresh, children, loading, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"RefreshAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handleRefresh = () => {\r\n onRefresh();\r\n };\r\n\r\n return (\r\n <IconButton\r\n className={cn(\"mtx-p-0.5 mtx-w-6 mtx-h-6\", loading && \"disabled:mtx-bg-transparent\", className)}\r\n variant=\"toolbar\"\r\n onClick={handleRefresh}\r\n disabled={loading}\r\n {...props}\r\n >\r\n {children ?? <Refresh className={cn(\"mtx-w-4.5 mtx-h-4.5\", loading && \"mtx-animate-spin\")} />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype DeleteActionProps = Omit<ButtonProps, \"onClick\"> & {\r\n onDelete: () => void;\r\n};\r\n\r\nconst DeleteAction: React.FC<DeleteActionProps> = ({ onDelete, children, ...props }) => {\r\n const handleDelete = () => {\r\n onDelete();\r\n };\r\n\r\n return (\r\n <Button variant=\"danger\" onClick={handleDelete} startIcon={<Trashcan className=\"mtx-w-4.5 mtx-h-4.5\" />} {...props}>\r\n {children}\r\n </Button>\r\n );\r\n};\r\n\r\ntype ExtraActionsProps = PopoverContentProps & {\r\n children: React.ReactNode;\r\n slotProps?: {\r\n triggerProps?: PopoverTriggerProps;\r\n popoverProps?: PopoverProps;\r\n };\r\n};\r\n\r\nconst ExtraActions: React.FC<ExtraActionsProps> = ({ children, slotProps, className, ...props }) => {\r\n return (\r\n <Popover {...(slotProps?.popoverProps ?? {})}>\r\n <PopoverTrigger {...(slotProps?.triggerProps ?? {})}>\r\n <ElipsisVertical className=\"mtx-w-4.5 mtx-h-4.5 mtx-text-primary\" />\r\n </PopoverTrigger>\r\n <PopoverContent align=\"end\" className={cn(\"mtx-w-40\", className)} {...props}>\r\n {children}\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport {\r\n DataGrid,\r\n DataGridContent,\r\n DataGridActionBar,\r\n SearchAction,\r\n FreezeAction,\r\n PrintAction,\r\n RefreshAction,\r\n ExtraActions,\r\n DeleteAction,\r\n type DataGridProps,\r\n type DataGridContentProps,\r\n type DatagridActionBarProps,\r\n type SearchActionProps,\r\n type FreezeActionProps,\r\n type RefreshActionProps,\r\n type ExtraActionsProps,\r\n type DeleteActionProps,\r\n useDataGrid,\r\n dataGridDefaultTheme,\r\n};\r\n"],"names":["ModuleRegistry","AllCommunityModule","dataGridDefaultTheme","themeQuartz","DataGridContext","React","useDataGrid","context","DataGrid","children","gridId","api","setApi","rowData","setRowData","actionbarHeight","setActionbarHeight","pinnedRowIds","setPinnedRowIds","quickFilterText","setQuickFilterText","actionbarExists","setActionbarExists","jsx","DataGridContent","forwardRef","propTheme","onGridReady","quickFilterTextProps","rowDataProps","containerStyle","getRowId","props","ref","theme","useMemo","handleGridReady","e","finalRowData","finalPinnedTopRowData","pinned","unpinned","data","id","stringId","AgGridReact","DataGridActionBar","className","cn","SearchAction","defaultOpen","isSearchInputOpen","setIsSearchInputOpen","isClosing","setIsClosing","inputRef","handleClear","handleOpen","handleClose","TextField","IconButton","Magnifier","CircleXmark","FreezeAction","freezeText","unFreezeText","onClick","disabled","pinnedRowCount","setPinnedRowCount","selectedRowsCount","setSelectedRowsCount","freezeRows","selectedRows","newPinnedIds","row","unfreezeRows","handleFreezing","Button","Snowflake","PrintAction","handlePrint","element","html","printHtml","Print","RefreshAction","onRefresh","loading","handleRefresh","Refresh","DeleteAction","onDelete","Trashcan","ExtraActions","slotProps","Popover","PopoverTrigger","ElipsisVertical","PopoverContent"],"mappings":";;;;;;;;;;;AAgBA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E,GAAA,EAAS,GAAID,GAAW,gBAAgB,CAAA,GACvC,UAAA;AAAA,EAAA,gBAAAxE,EAAC0E,GAAA,EAAgB,GAAIF,GAAW,gBAAgB,CAAA,GAC9C,UAAA,gBAAAxE,EAAC2E,GAAA,EAAgB,WAAU,uCAAA,CAAuC,EAAA,CACpE;AAAA,EACA,gBAAA3E,EAAC4E,GAAA,EAAe,OAAM,OAAM,WAAWnD,EAAG,YAAYD,CAAS,GAAI,GAAGf,GACnE,UAAAvB,EAAA,CACH;AAAA,GACF;"}
|
|
1
|
+
{"version":3,"file":"datagrid.es.js","sources":["../src/components/data-grid/DataGrid.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { forwardRef, HTMLAttributes, useMemo } from \"react\";\r\nimport { AgGridReact, AgGridReactProps } from \"ag-grid-react\";\r\nimport { GridApi, GridReadyEvent, themeQuartz, AllCommunityModule, ModuleRegistry, Theme } from \"ag-grid-community\";\r\nimport { CircleXmark, ElipsisVertical, Magnifier, Print, Refresh, Snowflake, Trashcan } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { printHtml } from \"../../lib/printHtml\";\r\nimport { TextField } from \"../text-field/TextField\";\r\nimport { Button, ButtonProps } from \"../button/Button\";\r\nimport { IconButton, IconButtonProps } from \"../icon-botton/IconButton\";\r\nimport { Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps } from \"../popover/Popover\";\r\n\r\n// Register all Community features\r\n// Todo: Register only the required features\r\nModuleRegistry.registerModules([AllCommunityModule]);\r\n\r\nconst dataGridDefaultTheme = themeQuartz.withParams({\r\n fontFamily: \"DMSans\",\r\n fontSize: \"12px\",\r\n headerFontSize: \"12px\",\r\n headerFontWeight: 700,\r\n headerBackgroundColor: \"oklch(var(--mtx-primary-50))\",\r\n backgroundColor: \"oklch(var(--mtx-gray-0))\",\r\n accentColor: \"oklch(var(--mtx-primary-300))\",\r\n foregroundColor: \"oklch(var(--mtx-text-500))\",\r\n cellTextColor: \"oklch(var(--mtx-text-500))\",\r\n});\r\n\r\ntype DataGridContext = {\r\n api: GridApi | null;\r\n setApi: (value: GridApi) => void;\r\n rowData: any[] | null | undefined;\r\n setRowData: (value: any[] | null | undefined) => void;\r\n gridId: string;\r\n quickFilterText: string;\r\n setQuickFilterText: (value: string) => void;\r\n actionbarExists: boolean;\r\n setActionbarExists: (value: boolean) => void;\r\n actionbarHeight: number;\r\n setActionbarHeight: (value: number) => void;\r\n pinnedRowIds: Set<string>;\r\n setPinnedRowIds: (value: Set<string>) => void;\r\n};\r\n\r\nconst DataGridContext = React.createContext<DataGridContext | null>(null);\r\n\r\nconst useDataGrid = () => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDataGrid should be used within <DataGrid>\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\ntype DataGridProps = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst DataGrid: React.FC<DataGridProps> = ({ children }) => {\r\n const gridId = React.useId();\r\n const [api, setApi] = React.useState<GridApi | null>(null);\r\n const [rowData, setRowData] = React.useState<any[] | null | undefined>([]);\r\n const [actionbarHeight, setActionbarHeight] = React.useState(0);\r\n const [pinnedRowIds, setPinnedRowIds] = React.useState<Set<string>>(new Set());\r\n\r\n const [quickFilterText, setQuickFilterText] = React.useState(\"\");\r\n const [actionbarExists, setActionbarExists] = React.useState(false);\r\n return (\r\n <DataGridContext.Provider\r\n value={{\r\n api,\r\n setApi,\r\n rowData,\r\n setRowData,\r\n gridId,\r\n quickFilterText,\r\n setQuickFilterText,\r\n actionbarExists,\r\n setActionbarExists,\r\n actionbarHeight,\r\n setActionbarHeight,\r\n pinnedRowIds,\r\n setPinnedRowIds,\r\n }}\r\n >\r\n {children}\r\n </DataGridContext.Provider>\r\n );\r\n};\r\n\r\ntype DataGridContentProps = Omit<AgGridReactProps, \"theme\"> & {\r\n theme?: Theme;\r\n};\r\n\r\nconst DataGridContent = forwardRef<AgGridReact, DataGridContentProps>(\r\n ({ theme: propTheme, onGridReady, quickFilterText: quickFilterTextProps, rowData: rowDataProps, containerStyle, getRowId, ...props }, ref) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridContent should be used within <DataGrid>\");\r\n }\r\n const { rowData, setRowData, actionbarExists, setApi, setQuickFilterText, quickFilterText, gridId, actionbarHeight, pinnedRowIds } = context;\r\n\r\n const theme = useMemo(() => {\r\n return dataGridDefaultTheme.withParams({\r\n headerHeight: 40,\r\n wrapperBorderRadius: actionbarExists ? \"0px 0px 8px 8px\" : \"8px\",\r\n });\r\n }, [actionbarExists]);\r\n\r\n const handleGridReady = (e: GridReadyEvent) => {\r\n setApi(e.api);\r\n onGridReady?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n setRowData(rowDataProps);\r\n }, [rowDataProps, setRowData]);\r\n\r\n React.useEffect(() => {\r\n if (quickFilterTextProps !== undefined) {\r\n setQuickFilterText(quickFilterTextProps ?? \"\");\r\n }\r\n }, [quickFilterTextProps, setQuickFilterText]);\r\n\r\n const { finalRowData, finalPinnedTopRowData } = useMemo(() => {\r\n if (!rowData || pinnedRowIds.size === 0) {\r\n return { finalRowData: rowData, finalPinnedTopRowData: [] };\r\n }\r\n\r\n const pinned: any[] = [];\r\n const unpinned: any[] = [];\r\n\r\n rowData.forEach(data => {\r\n const id = getRowId ? getRowId({ data, level: 0 } as any) : (data as any).id;\r\n const stringId = id !== undefined && id !== null ? String(id) : undefined;\r\n\r\n if (stringId !== undefined && pinnedRowIds.has(stringId)) {\r\n pinned.push(data);\r\n } else {\r\n unpinned.push(data);\r\n }\r\n });\r\n\r\n return { finalRowData: unpinned, finalPinnedTopRowData: pinned };\r\n }, [rowData, pinnedRowIds, getRowId]);\r\n\r\n return (\r\n <AgGridReact\r\n gridId={gridId}\r\n theme={propTheme ?? theme}\r\n rowData={finalRowData}\r\n pinnedTopRowData={finalPinnedTopRowData}\r\n quickFilterText={quickFilterText}\r\n onGridReady={handleGridReady}\r\n containerStyle={{ height: `calc(100% - ${actionbarHeight}px)`, ...containerStyle }}\r\n getRowId={getRowId}\r\n {...props}\r\n ref={ref}\r\n />\r\n );\r\n },\r\n);\r\n\r\nDataGridContent.displayName = \"DataGridContent\";\r\n\r\ntype DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};\r\n\r\nconst DataGridActionBar: React.FC<DatagridActionBarProps> = ({ className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridActionBar should be used within <DataGrid>\");\r\n }\r\n const ref = React.useRef<HTMLDivElement | null>(null);\r\n const { setActionbarExists, setActionbarHeight } = context;\r\n const { children } = props;\r\n\r\n React.useEffect(() => {\r\n setActionbarExists(true);\r\n return () => setActionbarExists(false);\r\n }, [setActionbarExists]);\r\n\r\n React.useEffect(() => {\r\n if (ref.current) {\r\n setActionbarHeight(ref.current.clientHeight);\r\n }\r\n }, [setActionbarHeight]);\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"mtx-relative mtx-flex mtx-items-center mtx-p-2 mtx-h-12 mtx-w-full mtx-bg-gray-0 mtx-border mtx-border-gray-200 mtx-border-b-0 -mtx-mb-[1px] mtx-z-10 mtx-rounded-t-[8px]\",\r\n className,\r\n )}\r\n ref={ref}\r\n >\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\ntype SearchActionProps = HTMLAttributes<HTMLDivElement> & {\r\n defaultOpen?: boolean;\r\n};\r\n\r\nconst SearchAction: React.FC<SearchActionProps> = ({ defaultOpen = false, className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"SearchAction should be used within <DataGrid>\");\r\n }\r\n\r\n const { quickFilterText, setQuickFilterText } = context;\r\n\r\n const [isSearchInputOpen, setIsSearchInputOpen] = React.useState(defaultOpen);\r\n const [isClosing, setIsClosing] = React.useState(false);\r\n const inputRef = React.useRef<HTMLInputElement | null>(null);\r\n\r\n const handleClear = () => {\r\n context.setQuickFilterText(\"\");\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const handleOpen = () => {\r\n setIsSearchInputOpen(true);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isSearchInputOpen && inputRef?.current) {\r\n inputRef.current.focus();\r\n }\r\n }, [isSearchInputOpen]);\r\n\r\n const handleClose = () => {\r\n setIsClosing(true);\r\n context.setQuickFilterText(\"\");\r\n setTimeout(() => {\r\n setIsSearchInputOpen(false);\r\n setIsClosing(false);\r\n }, 200);\r\n };\r\n\r\n return (\r\n <div className={cn(\"mtx-max-w-60\", className)} {...props}>\r\n {isSearchInputOpen || isClosing ? (\r\n <TextField\r\n ref={inputRef}\r\n className={cn(\r\n \"mtx-relative mtx-h-7.5\",\r\n isSearchInputOpen && !isClosing ? \"mtx-animate-input-open\" : \"\",\r\n isClosing && \"mtx-animate-input-close\",\r\n )}\r\n onChange={e => setQuickFilterText(e.target.value)}\r\n value={quickFilterText}\r\n startAdornment={\r\n <IconButton variant=\"toolbar\" className=\"mtx-p-0.5 mtx-h-6 mtx-w-6 mtx-border-none mtx-mx-1\" onClick={handleClose}>\r\n <Magnifier className=\"mtx-w-5 mtx-h-5\" />\r\n </IconButton>\r\n }\r\n endAdornment={\r\n quickFilterText && (\r\n <IconButton variant=\"toolbar\" className=\"mtx-p-0.5 mtx-w-6 mtx-h-6 mtx-border-none mtx-mx-1\" onClick={handleClear}>\r\n <CircleXmark className=\"mtx-w-5 mtx-h-5\" />\r\n </IconButton>\r\n )\r\n }\r\n />\r\n ) : (\r\n <IconButton variant=\"toolbar\" className=\"mtx-p-0.5 mtx-w-6 mtx-h-6 mtx-m-1\" onClick={handleOpen}>\r\n <Magnifier className=\"mtx-w-5 mtx-h-5\" />\r\n </IconButton>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\ntype FreezeActionProps = ButtonProps & {\r\n freezeText?: string;\r\n unFreezeText?: string;\r\n};\r\n\r\nconst FreezeAction: React.FC<FreezeActionProps> = ({ freezeText, unFreezeText, onClick, disabled, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"FreezeAction should be used within <DataGrid>\");\r\n }\r\n\r\n const [pinnedRowCount, setPinnedRowCount] = React.useState(0);\r\n const [selectedRowsCount, setSelectedRowsCount] = React.useState(0);\r\n\r\n const { api, pinnedRowIds, setPinnedRowIds } = context;\r\n\r\n const freezeRows = () => {\r\n if (!api) return;\r\n\r\n // Get currently selected rows\r\n const selectedRows = api.getSelectedNodes();\r\n\r\n if (selectedRows.length > 0) {\r\n const newPinnedIds = new Set(pinnedRowIds);\r\n selectedRows.forEach(row => {\r\n if (row.id !== undefined) {\r\n newPinnedIds.add(row.id);\r\n }\r\n });\r\n setPinnedRowIds(newPinnedIds);\r\n api.deselectAll();\r\n }\r\n };\r\n\r\n const unfreezeRows = () => {\r\n setPinnedRowIds(new Set());\r\n };\r\n\r\n const handleFreezing = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (api) {\r\n const pinnedRowsCount = api.getPinnedTopRowCount();\r\n if (pinnedRowsCount > 0) {\r\n unfreezeRows();\r\n } else {\r\n freezeRows();\r\n }\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n api?.addEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.addEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n\r\n return () => {\r\n if (api?.isDestroyed()) return;\r\n api?.removeEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.removeEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n onClick={handleFreezing}\r\n startIcon={<Snowflake className=\"mtx-w-4.5 mtx-h-4.5\" />}\r\n disabled={(!pinnedRowCount && !selectedRowsCount) || disabled}\r\n {...props}\r\n >\r\n {pinnedRowCount ? (unFreezeText ?? \"Unfreeze\") : (freezeText ?? \"Freeze\")}\r\n </Button>\r\n );\r\n};\r\n\r\ntype PrintActionProps = IconButtonProps & {};\r\n\r\nconst PrintAction: React.FC<PrintActionProps> = ({ children, className, onClick, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"PrintAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handlePrint = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (context.api) {\r\n context.api.setGridOption(\"domLayout\", \"print\");\r\n\r\n setTimeout(() => {\r\n const element = document.querySelector(\"[grid-id='\" + context.gridId + \"']\") as HTMLElement;\r\n const header = document.head;\r\n const html = `<html>\r\n ${header.innerHTML}\r\n ${element.outerHTML}\r\n </html>`;\r\n printHtml(html);\r\n context?.api?.setGridOption(\"domLayout\", undefined);\r\n });\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n return (\r\n <IconButton variant=\"toolbar\" className={cn(\"mtx-p-0.5 mtx-w-6 mtx-h-6\", className)} onClick={handlePrint} {...props}>\r\n {children ?? <Print className=\"mtx-w-5 mtx-h-5\" />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype RefreshActionProps = Omit<IconButtonProps, \"onClick\"> & {\r\n onRefresh: () => void;\r\n};\r\n\r\nconst RefreshAction: React.FC<RefreshActionProps> = ({ className, onRefresh, children, loading, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"RefreshAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handleRefresh = () => {\r\n onRefresh();\r\n };\r\n\r\n return (\r\n <IconButton\r\n className={cn(\"mtx-p-0.5 mtx-w-6 mtx-h-6\", loading && \"disabled:mtx-bg-transparent\", className)}\r\n variant=\"toolbar\"\r\n onClick={handleRefresh}\r\n disabled={loading}\r\n {...props}\r\n >\r\n {children ?? <Refresh className={cn(\"mtx-w-4.5 mtx-h-4.5\", loading && \"mtx-animate-spin\")} />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype DeleteActionProps = Omit<ButtonProps, \"onClick\"> & {\r\n onDelete: () => void;\r\n};\r\n\r\nconst DeleteAction: React.FC<DeleteActionProps> = ({ onDelete, children, ...props }) => {\r\n const handleDelete = () => {\r\n onDelete();\r\n };\r\n\r\n return (\r\n <Button variant=\"danger\" onClick={handleDelete} startIcon={<Trashcan className=\"mtx-w-4.5 mtx-h-4.5\" />} {...props}>\r\n {children}\r\n </Button>\r\n );\r\n};\r\n\r\ntype ExtraActionsProps = PopoverContentProps & {\r\n children: React.ReactNode;\r\n slotProps?: {\r\n triggerProps?: PopoverTriggerProps;\r\n popoverProps?: PopoverProps;\r\n };\r\n};\r\n\r\nconst ExtraActions: React.FC<ExtraActionsProps> = ({ children, slotProps, className, ...props }) => {\r\n return (\r\n <Popover {...(slotProps?.popoverProps ?? {})}>\r\n <PopoverTrigger {...(slotProps?.triggerProps ?? {})}>\r\n <ElipsisVertical className=\"mtx-w-4.5 mtx-h-4.5 mtx-text-primary\" />\r\n </PopoverTrigger>\r\n <PopoverContent align=\"end\" className={cn(\"mtx-w-40\", className)} {...props}>\r\n {children}\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport {\r\n DataGrid,\r\n DataGridContent,\r\n DataGridActionBar,\r\n SearchAction,\r\n FreezeAction,\r\n PrintAction,\r\n RefreshAction,\r\n ExtraActions,\r\n DeleteAction,\r\n type DataGridProps,\r\n type DataGridContentProps,\r\n type DatagridActionBarProps,\r\n type SearchActionProps,\r\n type FreezeActionProps,\r\n type RefreshActionProps,\r\n type ExtraActionsProps,\r\n type DeleteActionProps,\r\n useDataGrid,\r\n dataGridDefaultTheme,\r\n};\r\n"],"names":["ModuleRegistry","AllCommunityModule","dataGridDefaultTheme","themeQuartz","DataGridContext","React","useDataGrid","context","DataGrid","children","gridId","api","setApi","rowData","setRowData","actionbarHeight","setActionbarHeight","pinnedRowIds","setPinnedRowIds","quickFilterText","setQuickFilterText","actionbarExists","setActionbarExists","jsx","DataGridContent","forwardRef","propTheme","onGridReady","quickFilterTextProps","rowDataProps","containerStyle","getRowId","props","ref","theme","useMemo","handleGridReady","e","finalRowData","finalPinnedTopRowData","pinned","unpinned","data","id","stringId","AgGridReact","DataGridActionBar","className","cn","SearchAction","defaultOpen","isSearchInputOpen","setIsSearchInputOpen","isClosing","setIsClosing","inputRef","handleClear","handleOpen","handleClose","TextField","IconButton","Magnifier","CircleXmark","FreezeAction","freezeText","unFreezeText","onClick","disabled","pinnedRowCount","setPinnedRowCount","selectedRowsCount","setSelectedRowsCount","freezeRows","selectedRows","newPinnedIds","row","unfreezeRows","handleFreezing","Button","Snowflake","PrintAction","handlePrint","element","html","printHtml","Print","RefreshAction","onRefresh","loading","handleRefresh","Refresh","DeleteAction","onDelete","Trashcan","ExtraActions","slotProps","Popover","PopoverTrigger","ElipsisVertical","PopoverContent"],"mappings":";;;;;;;;;;;AAgBAA,EAAe,gBAAgB,CAACC,CAAkB,CAAC;AAEnD,MAAMC,IAAuBC,EAAY,WAAW;AAAA,EAClD,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,eAAe;AACjB,CAAC,GAkBKC,IAAkBC,EAAM,cAAsC,IAAI,GAElEC,KAAc,MAAM;AACxB,QAAMC,IAAUF,EAAM,WAAWD,CAAe;AAEhD,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8CAA8C;AAGhE,SAAOA;AACT,GAMMC,KAAoC,CAAC,EAAE,UAAAC,QAAe;AAC1D,QAAMC,IAASL,EAAM,MAAA,GACf,CAACM,GAAKC,CAAM,IAAIP,EAAM,SAAyB,IAAI,GACn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AMqF,IAAgB,MAAM;AAC1B,IAAAF,EAAA;AAAA,EACF;AAEA,SACE,gBAAAhE;AAAA,IAACqC;AAAA,IAAA;AAAA,MACC,WAAWZ,EAAG,6BAA6BwC,KAAW,+BAA+BzC,CAAS;AAAA,MAC9F,SAAQ;AAAA,MACR,SAAS0C;AAAA,MACT,UAAUD;AAAA,MACT,GAAGxD;AAAA,MAEH,UAAAvB,uBAAaiF,GAAA,EAAQ,WAAW1C,EAAG,uBAAuBwC,KAAW,kBAAkB,EAAA,CAAG;AAAA,IAAA;AAAA,EAAA;AAGjG,GAMMG,KAA4C,CAAC,EAAE,UAAAC,GAAU,UAAAnF,GAAU,GAAGuB,QAMxE,gBAAAT,EAACuD,GAAA,EAAO,SAAQ,UAAS,SALN,MAAM;AACzB,EAAAc,EAAA;AACF,GAGkD,WAAW,gBAAArE,EAACsE,GAAA,EAAS,WAAU,sBAAA,CAAsB,GAAK,GAAG7D,GAC1G,UAAAvB,GACH,GAYEqF,KAA4C,CAAC,EAAE,UAAArF,GAAU,WAAAsF,GAAW,WAAAhD,GAAW,GAAGf,0BAEnFgE,GAAA,EAAS,GAAID,GAAW,gBAAgB,CAAA,GACvC,UAAA;AAAA,EAAA,gBAAAxE,EAAC0E,GAAA,EAAgB,GAAIF,GAAW,gBAAgB,CAAA,GAC9C,UAAA,gBAAAxE,EAAC2E,GAAA,EAAgB,WAAU,uCAAA,CAAuC,EAAA,CACpE;AAAA,EACA,gBAAA3E,EAAC4E,GAAA,EAAe,OAAM,OAAM,WAAWnD,EAAG,YAAYD,CAAS,GAAI,GAAGf,GACnE,UAAAvB,EAAA,CACH;AAAA,GACF;"}
|
package/dist/sidebar.es.js
CHANGED
|
@@ -4,13 +4,13 @@ import { Slot as w } from "@radix-ui/react-slot";
|
|
|
4
4
|
import { tv as z } from "tailwind-variants";
|
|
5
5
|
import { VisuallyHidden as I } from "@radix-ui/react-visually-hidden";
|
|
6
6
|
import { cn as d } from "./utils.es.js";
|
|
7
|
-
import { Skeleton as
|
|
7
|
+
import { Skeleton as C } from "./skeleton.es.js";
|
|
8
8
|
import { Separator as E } from "./separator.es.js";
|
|
9
9
|
import { useIsMobile as B } from "./use-mobile.es.js";
|
|
10
10
|
import { Tooltip as T, TooltipTrigger as A, TooltipContent as D, TooltipProvider as O } from "./tooltip.es.js";
|
|
11
11
|
import { Sheet as G, SheetContent as H, SheetHeader as j, SheetTitle as K, SheetDescription as L } from "./sheet.es.js";
|
|
12
|
-
const V = "sidebar:state", $ = 3600 * 24 * 7, y = "16rem",
|
|
13
|
-
function
|
|
12
|
+
const V = "sidebar:state", $ = 3600 * 24 * 7, y = "16rem", _ = "18rem", N = "4rem", P = "b", M = i.createContext(null);
|
|
13
|
+
function R() {
|
|
14
14
|
const t = i.useContext(M);
|
|
15
15
|
if (!t)
|
|
16
16
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
@@ -53,7 +53,7 @@ const W = i.forwardRef(({ defaultOpen: t = !0, open: e, onOpenChange: a, classNa
|
|
|
53
53
|
});
|
|
54
54
|
W.displayName = "SidebarProvider";
|
|
55
55
|
const q = i.forwardRef(({ side: t = "left", variant: e = "sidebar", collapsible: a = "offcanvas", className: m, children: o, width: s, widthIcon: n, widthMobile: x, style: p, ...f }, g) => {
|
|
56
|
-
const { isMobile: l, state: b, open: h, setOpen: S } =
|
|
56
|
+
const { isMobile: l, state: b, open: h, setOpen: S } = R();
|
|
57
57
|
return a === "none" ? /* @__PURE__ */ r(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
@@ -85,9 +85,9 @@ const q = i.forwardRef(({ side: t = "left", variant: e = "sidebar", collapsible:
|
|
|
85
85
|
className: "data-[side=left]:mtx-w-[--sidebar-left-width] data-[side=right]:mtx-w-[--sidebar-right-width] mtx-bg-gray-50 mtx-p-0 [&>button]:mtx-hidden",
|
|
86
86
|
style: {
|
|
87
87
|
...t === "left" ? {
|
|
88
|
-
"--sidebar-left-width": x ??
|
|
88
|
+
"--sidebar-left-width": x ?? _
|
|
89
89
|
} : {
|
|
90
|
-
"--sidebar-right-width": x ??
|
|
90
|
+
"--sidebar-right-width": x ?? _
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
side: t,
|
|
@@ -158,7 +158,7 @@ const q = i.forwardRef(({ side: t = "left", variant: e = "sidebar", collapsible:
|
|
|
158
158
|
q.displayName = "Sidebar";
|
|
159
159
|
const F = i.forwardRef(
|
|
160
160
|
({ className: t, onClick: e, asChild: a, ...m }, o) => {
|
|
161
|
-
const { toggleSidebar: s } =
|
|
161
|
+
const { toggleSidebar: s } = R();
|
|
162
162
|
return /* @__PURE__ */ r(
|
|
163
163
|
a ? w : "button",
|
|
164
164
|
{
|
|
@@ -175,7 +175,7 @@ const F = i.forwardRef(
|
|
|
175
175
|
);
|
|
176
176
|
F.displayName = "SidebarTrigger";
|
|
177
177
|
const U = i.forwardRef(({ className: t, ...e }, a) => {
|
|
178
|
-
const { toggleSidebar: m } =
|
|
178
|
+
const { toggleSidebar: m } = R();
|
|
179
179
|
return /* @__PURE__ */ r(
|
|
180
180
|
"button",
|
|
181
181
|
{
|
|
@@ -286,7 +286,7 @@ const mt = z({
|
|
|
286
286
|
variants: {
|
|
287
287
|
variant: {
|
|
288
288
|
default: "hover:mtx-bg-gray-50",
|
|
289
|
-
outline: "mtx-bg-background mtx-shadow-[
|
|
289
|
+
outline: "mtx-bg-background mtx-shadow-[oklch(var(--gray--300))] hover:mtx-bg-gray-50 hover:mtx-shadow-[oklch(var(--gray-400))]"
|
|
290
290
|
},
|
|
291
291
|
size: {
|
|
292
292
|
default: "mtx-h-10 mtx-text-sm",
|
|
@@ -299,7 +299,7 @@ const mt = z({
|
|
|
299
299
|
size: "default"
|
|
300
300
|
}
|
|
301
301
|
}), ot = i.forwardRef(({ asChild: t = !1, isActive: e = !1, variant: a = "default", size: m = "default", tooltip: o, className: s, ...n }, x) => {
|
|
302
|
-
const p = t ? w : "button", { isMobile: f, state: g } =
|
|
302
|
+
const p = t ? w : "button", { isMobile: f, state: g } = R(), l = /* @__PURE__ */ r(
|
|
303
303
|
p,
|
|
304
304
|
{
|
|
305
305
|
ref: x,
|
|
@@ -365,9 +365,9 @@ const lt = i.forwardRef(({ className: t, showIcon: e = !1, ...a }, m) => {
|
|
|
365
365
|
className: d("mtx-rounded-md mtx-h-8 mtx-flex mtx-gap-2 mtx-px-2 mtx-items-center", t),
|
|
366
366
|
...a,
|
|
367
367
|
children: [
|
|
368
|
-
e && /* @__PURE__ */ r(
|
|
368
|
+
e && /* @__PURE__ */ r(C, { className: "mtx-size-4 mtx-rounded-md", "data-sidebar": "menu-skeleton-icon" }),
|
|
369
369
|
/* @__PURE__ */ r(
|
|
370
|
-
|
|
370
|
+
C,
|
|
371
371
|
{
|
|
372
372
|
className: "mtx-h-4 mtx-flex-1 mtx-max-w-[--skeleton-width]",
|
|
373
373
|
"data-sidebar": "menu-skeleton-text",
|
|
@@ -435,6 +435,6 @@ export {
|
|
|
435
435
|
U as SidebarRail,
|
|
436
436
|
Q as SidebarSeparator,
|
|
437
437
|
F as SidebarTrigger,
|
|
438
|
-
|
|
438
|
+
R as useSidebar
|
|
439
439
|
};
|
|
440
440
|
//# sourceMappingURL=sidebar.es.js.map
|