@trsys-tech/matrix-library 0.6.1 → 1.0.0-canary.1
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/accordion.es.js +27 -27
- package/dist/accordion.es.js.map +1 -1
- package/dist/avatar.es.js +28 -14
- package/dist/avatar.es.js.map +1 -1
- package/dist/badge.es.js +24 -24
- package/dist/badge.es.js.map +1 -1
- package/dist/breadcrumb.es.js +34 -24
- package/dist/breadcrumb.es.js.map +1 -1
- package/dist/button.es.js +28 -28
- package/dist/button.es.js.map +1 -1
- package/dist/calendar.es.js +64 -61
- package/dist/calendar.es.js.map +1 -1
- package/dist/card.es.js +21 -21
- package/dist/card.es.js.map +1 -1
- package/dist/checkbox.es.js +15 -15
- package/dist/checkbox.es.js.map +1 -1
- package/dist/chip.es.js +24 -24
- package/dist/chip.es.js.map +1 -1
- package/dist/collapsible.es.js +17 -17
- package/dist/collapsible.es.js.map +1 -1
- package/dist/combobox.es.js +79 -70
- package/dist/combobox.es.js.map +1 -1
- package/dist/command.es.js +62 -59
- package/dist/command.es.js.map +1 -1
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/badge/Badge.d.ts +2 -2
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/chip/Chip.d.ts +2 -2
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/command/Command.d.ts.map +1 -1
- package/dist/components/confirm/Confirm.d.ts.map +1 -1
- package/dist/components/context-menu/ContextMenu.d.ts.map +1 -1
- package/dist/components/data-grid/DataGrid.d.ts.map +1 -1
- package/dist/components/date-picker/TimePickerContent.d.ts.map +1 -1
- package/dist/components/date-picker/calendar.d.ts.map +1 -1
- package/dist/components/dialog/Dialog.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/SwipableDrawer.d.ts.map +1 -1
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/icon-botton/IconButton.d.ts +2 -2
- package/dist/components/icon-botton/IconButton.d.ts.map +1 -1
- package/dist/components/label/Label.d.ts +1 -1
- package/dist/components/label/Label.d.ts.map +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.d.ts +2 -2
- package/dist/components/progress/Progress.d.ts.map +1 -1
- package/dist/components/rating/Rating.d.ts +2 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/sheet/Sheet.d.ts +2 -2
- package/dist/components/sheet/Sheet.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/switch/Switch.d.ts +2 -2
- package/dist/components/text-field/TextField.d.ts.map +1 -1
- package/dist/components/toast/toast-components.d.ts +4 -4
- package/dist/components/toast/toast-components.d.ts.map +1 -1
- package/dist/confirm.es.js +18 -8
- package/dist/confirm.es.js.map +1 -1
- package/dist/contextmenu.es.js +77 -70
- package/dist/contextmenu.es.js.map +1 -1
- package/dist/datagrid.es.js +101 -97
- package/dist/datagrid.es.js.map +1 -1
- package/dist/desktopdatepicker.es.js +30 -30
- package/dist/desktopdatepicker.es.js.map +1 -1
- package/dist/desktopdaterangepicker.es.js +44 -44
- package/dist/desktopdaterangepicker.es.js.map +1 -1
- package/dist/desktoptimepicker.es.js +24 -24
- package/dist/desktoptimepicker.es.js.map +1 -1
- package/dist/dialog.es.js +43 -43
- package/dist/dialog.es.js.map +1 -1
- package/dist/drawer.es.js +27 -27
- package/dist/drawer.es.js.map +1 -1
- package/dist/duration.es.js +34 -34
- package/dist/duration.es.js.map +1 -1
- package/dist/form.es.js +20 -20
- package/dist/form.es.js.map +1 -1
- package/dist/formcheckbox.es.js +13 -13
- package/dist/formcheckbox.es.js.map +1 -1
- package/dist/formcombobox.es.js +17 -17
- package/dist/formcombobox.es.js.map +1 -1
- package/dist/formdatepicker.es.js +12 -12
- package/dist/formdatepicker.es.js.map +1 -1
- package/dist/formdaterangepicker.es.js +16 -16
- package/dist/formdaterangepicker.es.js.map +1 -1
- package/dist/formduration.es.js +13 -13
- package/dist/formduration.es.js.map +1 -1
- package/dist/forminput.es.js +10 -10
- package/dist/forminput.es.js.map +1 -1
- package/dist/formmultiselect.es.js +7 -7
- package/dist/formmultiselect.es.js.map +1 -1
- package/dist/formrating.es.js +21 -21
- package/dist/formrating.es.js.map +1 -1
- package/dist/formselect.es.js +28 -28
- package/dist/formselect.es.js.map +1 -1
- package/dist/formswitch.es.js +14 -14
- package/dist/formswitch.es.js.map +1 -1
- package/dist/formtextarea.es.js +12 -12
- package/dist/formtextarea.es.js.map +1 -1
- package/dist/formtimepicker.es.js +12 -12
- package/dist/formtimepicker.es.js.map +1 -1
- package/dist/iconbutton.es.js +22 -22
- package/dist/iconbutton.es.js.map +1 -1
- package/dist/label.es.js +6 -6
- package/dist/label.es.js.map +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/mobiledatepicker.es.js +42 -42
- package/dist/mobiledatepicker.es.js.map +1 -1
- package/dist/mobiledaterangepicker.es.js +50 -50
- package/dist/mobiledaterangepicker.es.js.map +1 -1
- package/dist/mobiletimepicker.es.js +30 -30
- package/dist/mobiletimepicker.es.js.map +1 -1
- package/dist/modal.es.js +48 -44
- package/dist/modal.es.js.map +1 -1
- package/dist/multiselect.es.js +120 -120
- package/dist/multiselect.es.js.map +1 -1
- package/dist/popover.es.js +16 -16
- package/dist/popover.es.js.map +1 -1
- package/dist/progress.es.js +29 -21
- package/dist/progress.es.js.map +1 -1
- package/dist/radiogroup.es.js +16 -16
- package/dist/radiogroup.es.js.map +1 -1
- package/dist/rating.es.js +76 -76
- package/dist/rating.es.js.map +1 -1
- package/dist/select.es.js +82 -63
- package/dist/select.es.js.map +1 -1
- package/dist/separator.es.js +13 -13
- package/dist/separator.es.js.map +1 -1
- package/dist/sheet.es.js +44 -44
- package/dist/sheet.es.js.map +1 -1
- package/dist/sidebar.es.js +245 -233
- package/dist/sidebar.es.js.map +1 -1
- package/dist/skeleton.es.js +6 -6
- package/dist/skeleton.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/swipabledrawer.es.js +41 -38
- package/dist/swipabledrawer.es.js.map +1 -1
- package/dist/switch.es.js +16 -16
- package/dist/switch.es.js.map +1 -1
- package/dist/tabs.es.js +22 -22
- package/dist/tabs.es.js.map +1 -1
- package/dist/textarea.es.js +12 -12
- package/dist/textarea.es.js.map +1 -1
- package/dist/textfield.es.js +37 -37
- package/dist/textfield.es.js.map +1 -1
- package/dist/timepickercontent.es.js +63 -56
- package/dist/timepickercontent.es.js.map +1 -1
- package/dist/toast-components.es.js +47 -44
- package/dist/toast-components.es.js.map +1 -1
- package/dist/toast.es.js +24 -24
- package/dist/toast.es.js.map +1 -1
- package/dist/tooltip.es.js +16 -16
- package/dist/tooltip.es.js.map +1 -1
- package/dist/utils.es.js +6 -5
- package/dist/utils.es.js.map +1 -1
- package/package.json +1 -1
package/dist/contextmenu.es.js
CHANGED
|
@@ -1,105 +1,112 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { Check as
|
|
5
|
-
import { cn as
|
|
6
|
-
const v =
|
|
7
|
-
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-context-menu";
|
|
4
|
+
import { Check as i, Circle as l, ChevronRight as c } from "@trsys-tech/matrix-icons";
|
|
5
|
+
import { cn as n } from "./utils.es.js";
|
|
6
|
+
const v = t.Root, I = t.Trigger, S = t.Group, z = t.Portal, k = t.Sub, T = t.RadioGroup, u = s.forwardRef(({ className: e, inset: m, children: a, ...x }, d) => /* @__PURE__ */ r(
|
|
7
|
+
t.SubTrigger,
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
10
|
-
className:
|
|
11
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
ref: d,
|
|
10
|
+
className: n(
|
|
11
|
+
"mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[state=open]:mtx-bg-accent data-[state=open]:mtx-text-accent-foreground",
|
|
12
|
+
m && "mtx-pl-8",
|
|
13
|
+
e
|
|
14
14
|
),
|
|
15
|
-
...
|
|
15
|
+
...x,
|
|
16
16
|
children: [
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */
|
|
17
|
+
a,
|
|
18
|
+
/* @__PURE__ */ o(c, { className: "mtx-ml-auto mtx-h-4 mtx-w-4" })
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
));
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
22
|
+
u.displayName = t.SubTrigger.displayName;
|
|
23
|
+
const p = s.forwardRef(({ className: e, ...m }, a) => /* @__PURE__ */ o(
|
|
24
|
+
t.SubContent,
|
|
25
25
|
{
|
|
26
|
-
ref:
|
|
27
|
-
className:
|
|
28
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
29
|
-
|
|
26
|
+
ref: a,
|
|
27
|
+
className: n(
|
|
28
|
+
"mtx-z-50 mtx-min-w-[8rem] mtx-overflow-hidden mtx-rounded-md mtx-border mtx-bg-popover mtx-p-1 mtx-text-popover-foreground mtx-shadow-lg data-[state=open]:mtx-animate-in data-[state=closed]:mtx-animate-out data-[state=closed]:mtx-fade-out-0 data-[state=open]:mtx-fade-in-0 data-[state=closed]:mtx-zoom-out-95 data-[state=open]:mtx-zoom-in-95 data-[side=bottom]:mtx-slide-in-from-top-2 data-[side=left]:mtx-slide-in-from-right-2 data-[side=right]:mtx-slide-in-from-left-2 data-[side=top]:mtx-slide-in-from-bottom-2",
|
|
29
|
+
e
|
|
30
30
|
),
|
|
31
|
-
...
|
|
31
|
+
...m
|
|
32
32
|
}
|
|
33
33
|
));
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
p.displayName = t.SubContent.displayName;
|
|
35
|
+
const f = s.forwardRef(({ className: e, ...m }, a) => /* @__PURE__ */ o(t.Portal, { children: /* @__PURE__ */ o(
|
|
36
|
+
t.Content,
|
|
37
37
|
{
|
|
38
|
-
ref:
|
|
39
|
-
className:
|
|
40
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
41
|
-
|
|
38
|
+
ref: a,
|
|
39
|
+
className: n(
|
|
40
|
+
"mtx-z-50 mtx-min-w-[8rem] mtx-overflow-hidden mtx-rounded-md mtx-border mtx-bg-popover mtx-p-1 mtx-text-popover-foreground mtx-shadow-md data-[state=open]:mtx-animate-in data-[state=closed]:mtx-animate-out data-[state=closed]:mtx-fade-out-0 data-[state=open]:mtx-fade-in-0 data-[state=closed]:mtx-zoom-out-95 data-[state=open]:mtx-zoom-in-95 data-[side=bottom]:mtx-slide-in-from-top-2 data-[side=left]:mtx-slide-in-from-right-2 data-[side=right]:mtx-slide-in-from-left-2 data-[side=top]:mtx-slide-in-from-bottom-2",
|
|
41
|
+
e
|
|
42
42
|
),
|
|
43
|
-
...
|
|
43
|
+
...m
|
|
44
44
|
}
|
|
45
45
|
) }));
|
|
46
|
-
|
|
47
|
-
const b =
|
|
48
|
-
|
|
46
|
+
f.displayName = t.Content.displayName;
|
|
47
|
+
const b = s.forwardRef(({ className: e, inset: m, ...a }, x) => /* @__PURE__ */ o(
|
|
48
|
+
t.Item,
|
|
49
49
|
{
|
|
50
|
-
ref:
|
|
51
|
-
className:
|
|
52
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
ref: x,
|
|
51
|
+
className: n(
|
|
52
|
+
"mtx-relative mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[disabled]:mtx-pointer-events-none data-[disabled]:mtx-opacity-50",
|
|
53
|
+
m && "mtx-pl-8",
|
|
54
|
+
e
|
|
55
55
|
),
|
|
56
|
-
...
|
|
56
|
+
...a
|
|
57
57
|
}
|
|
58
58
|
));
|
|
59
|
-
b.displayName =
|
|
60
|
-
const g =
|
|
61
|
-
|
|
59
|
+
b.displayName = t.Item.displayName;
|
|
60
|
+
const g = s.forwardRef(({ className: e, children: m, checked: a, ...x }, d) => /* @__PURE__ */ r(
|
|
61
|
+
t.CheckboxItem,
|
|
62
62
|
{
|
|
63
|
-
ref:
|
|
64
|
-
className:
|
|
65
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
66
|
-
|
|
63
|
+
ref: d,
|
|
64
|
+
className: n(
|
|
65
|
+
"mtx-relative mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-py-1.5 mtx-pl-8 mtx-pr-2 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[disabled]:mtx-pointer-events-none data-[disabled]:mtx-opacity-50",
|
|
66
|
+
e
|
|
67
67
|
),
|
|
68
|
-
checked:
|
|
69
|
-
...
|
|
68
|
+
checked: a,
|
|
69
|
+
...x,
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
71
|
+
/* @__PURE__ */ o("span", { className: "mtx-absolute mtx-left-2 mtx-flex mtx-h-3.5 mtx-w-3.5 mtx-items-center mtx-justify-center", children: /* @__PURE__ */ o(t.ItemIndicator, { children: /* @__PURE__ */ o(i, { className: "mtx-h-4 mtx-w-4" }) }) }),
|
|
72
|
+
m
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
));
|
|
76
|
-
g.displayName =
|
|
77
|
-
const N =
|
|
78
|
-
|
|
76
|
+
g.displayName = t.CheckboxItem.displayName;
|
|
77
|
+
const N = s.forwardRef(({ className: e, children: m, ...a }, x) => /* @__PURE__ */ r(
|
|
78
|
+
t.RadioItem,
|
|
79
79
|
{
|
|
80
|
-
ref:
|
|
81
|
-
className:
|
|
82
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
83
|
-
|
|
80
|
+
ref: x,
|
|
81
|
+
className: n(
|
|
82
|
+
"mtx-relative mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-py-1.5 mtx-pl-8 mtx-pr-2 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[disabled]:mtx-pointer-events-none data-[disabled]:mtx-opacity-50",
|
|
83
|
+
e
|
|
84
84
|
),
|
|
85
|
-
...
|
|
85
|
+
...a,
|
|
86
86
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
87
|
+
/* @__PURE__ */ o("span", { className: "mtx-absolute mtx-left-2 mtx-flex mtx-h-3.5 mtx-w-3.5 mtx-items-center mtx-justify-center", children: /* @__PURE__ */ o(t.ItemIndicator, { children: /* @__PURE__ */ o(l, { className: "mtx-h-4 mtx-w-4 mtx-fill-current" }) }) }),
|
|
88
|
+
m
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
));
|
|
92
|
-
N.displayName =
|
|
93
|
-
const h =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
N.displayName = t.RadioItem.displayName;
|
|
93
|
+
const h = s.forwardRef(({ className: e, inset: m, ...a }, x) => /* @__PURE__ */ o(
|
|
94
|
+
t.Label,
|
|
95
|
+
{
|
|
96
|
+
ref: x,
|
|
97
|
+
className: n("mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-font-semibold mtx-text-foreground", m && "mtx-pl-8", e),
|
|
98
|
+
...a
|
|
99
|
+
}
|
|
100
|
+
));
|
|
101
|
+
h.displayName = t.Label.displayName;
|
|
102
|
+
const C = s.forwardRef(({ className: e, ...m }, a) => /* @__PURE__ */ o(t.Separator, { ref: a, className: n("-mtx-1 mtx-my-1 mtx-h-px mtx-bg-border", e), ...m }));
|
|
103
|
+
C.displayName = t.Separator.displayName;
|
|
104
|
+
const y = ({ className: e, ...m }) => /* @__PURE__ */ o("span", { className: n("mtx-ml-auto mtx-text-xs mtx-tracking-widest mtx-text-muted-foreground", e), ...m });
|
|
98
105
|
y.displayName = "ContextMenuShortcut";
|
|
99
106
|
export {
|
|
100
107
|
v as ContextMenu,
|
|
101
108
|
g as ContextMenuCheckboxItem,
|
|
102
|
-
|
|
109
|
+
f as ContextMenuContent,
|
|
103
110
|
S as ContextMenuGroup,
|
|
104
111
|
b as ContextMenuItem,
|
|
105
112
|
h as ContextMenuLabel,
|
|
@@ -109,8 +116,8 @@ export {
|
|
|
109
116
|
C as ContextMenuSeparator,
|
|
110
117
|
y as ContextMenuShortcut,
|
|
111
118
|
k as ContextMenuSub,
|
|
112
|
-
|
|
113
|
-
|
|
119
|
+
p as ContextMenuSubContent,
|
|
120
|
+
u as ContextMenuSubTrigger,
|
|
114
121
|
I as ContextMenuTrigger
|
|
115
122
|
};
|
|
116
123
|
//# sourceMappingURL=contextmenu.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextmenu.es.js","sources":["../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\r\nimport { Check, ChevronRight, Circle } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst ContextMenu = ContextMenuPrimitive.Root;\r\n\r\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\r\n\r\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\r\n\r\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\r\n\r\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\r\n\r\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\r\n\r\nconst ContextMenuSubTrigger = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ChevronRight className=\"ml-auto h-4 w-4\" />\r\n </ContextMenuPrimitive.SubTrigger>\r\n));\r\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst ContextMenuSubContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\r\n\r\nconst ContextMenuContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.Portal>\r\n <ContextMenuPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </ContextMenuPrimitive.Portal>\r\n));\r\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\r\n\r\nconst ContextMenuItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\r\n\r\nconst ContextMenuCheckboxItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\r\n>(({ className, children, checked, ...props }, ref) => (\r\n <ContextMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}\r\n >\r\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.CheckboxItem>\r\n));\r\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst ContextMenuRadioItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\r\n>(({ className, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Circle className=\"h-4 w-4 fill-current\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.RadioItem>\r\n));\r\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\r\n\r\nconst ContextMenuLabel = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Label ref={ref} className={cn(\"px-2 py-1.5 text-sm font-semibold text-foreground\", inset && \"pl-8\", className)} {...props} />\r\n));\r\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\r\n\r\nconst ContextMenuSeparator = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\r\n>(({ className, ...props }, ref) => <ContextMenuPrimitive.Separator ref={ref} className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props} />);\r\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\r\n\r\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return <span className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)} {...props} />;\r\n};\r\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\r\n\r\nexport {\r\n ContextMenu,\r\n ContextMenuTrigger,\r\n ContextMenuContent,\r\n ContextMenuItem,\r\n ContextMenuCheckboxItem,\r\n ContextMenuRadioItem,\r\n ContextMenuLabel,\r\n ContextMenuSeparator,\r\n ContextMenuShortcut,\r\n ContextMenuGroup,\r\n ContextMenuPortal,\r\n ContextMenuSub,\r\n ContextMenuSubContent,\r\n ContextMenuSubTrigger,\r\n ContextMenuRadioGroup,\r\n};\r\n"],"names":["ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","Check","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"contextmenu.es.js","sources":["../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\r\nimport { Check, ChevronRight, Circle } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst ContextMenu = ContextMenuPrimitive.Root;\r\n\r\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\r\n\r\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\r\n\r\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\r\n\r\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\r\n\r\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\r\n\r\nconst ContextMenuSubTrigger = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[state=open]:mtx-bg-accent data-[state=open]:mtx-text-accent-foreground\",\r\n inset && \"mtx-pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ChevronRight className=\"mtx-ml-auto mtx-h-4 mtx-w-4\" />\r\n </ContextMenuPrimitive.SubTrigger>\r\n));\r\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst ContextMenuSubContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"mtx-z-50 mtx-min-w-[8rem] mtx-overflow-hidden mtx-rounded-md mtx-border mtx-bg-popover mtx-p-1 mtx-text-popover-foreground mtx-shadow-lg data-[state=open]:mtx-animate-in data-[state=closed]:mtx-animate-out data-[state=closed]:mtx-fade-out-0 data-[state=open]:mtx-fade-in-0 data-[state=closed]:mtx-zoom-out-95 data-[state=open]:mtx-zoom-in-95 data-[side=bottom]:mtx-slide-in-from-top-2 data-[side=left]:mtx-slide-in-from-right-2 data-[side=right]:mtx-slide-in-from-left-2 data-[side=top]:mtx-slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\r\n\r\nconst ContextMenuContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.Portal>\r\n <ContextMenuPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"mtx-z-50 mtx-min-w-[8rem] mtx-overflow-hidden mtx-rounded-md mtx-border mtx-bg-popover mtx-p-1 mtx-text-popover-foreground mtx-shadow-md data-[state=open]:mtx-animate-in data-[state=closed]:mtx-animate-out data-[state=closed]:mtx-fade-out-0 data-[state=open]:mtx-fade-in-0 data-[state=closed]:mtx-zoom-out-95 data-[state=open]:mtx-zoom-in-95 data-[side=bottom]:mtx-slide-in-from-top-2 data-[side=left]:mtx-slide-in-from-right-2 data-[side=right]:mtx-slide-in-from-left-2 data-[side=top]:mtx-slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </ContextMenuPrimitive.Portal>\r\n));\r\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\r\n\r\nconst ContextMenuItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"mtx-relative mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[disabled]:mtx-pointer-events-none data-[disabled]:mtx-opacity-50\",\r\n inset && \"mtx-pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\r\n\r\nconst ContextMenuCheckboxItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\r\n>(({ className, children, checked, ...props }, ref) => (\r\n <ContextMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"mtx-relative mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-py-1.5 mtx-pl-8 mtx-pr-2 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[disabled]:mtx-pointer-events-none data-[disabled]:mtx-opacity-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}\r\n >\r\n <span className=\"mtx-absolute mtx-left-2 mtx-flex mtx-h-3.5 mtx-w-3.5 mtx-items-center mtx-justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Check className=\"mtx-h-4 mtx-w-4\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.CheckboxItem>\r\n));\r\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst ContextMenuRadioItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\r\n>(({ className, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"mtx-relative mtx-flex mtx-cursor-default mtx-select-none mtx-items-center mtx-rounded-sm mtx-py-1.5 mtx-pl-8 mtx-pr-2 mtx-text-sm mtx-outline-none focus:mtx-bg-accent focus:mtx-text-accent-foreground data-[disabled]:mtx-pointer-events-none data-[disabled]:mtx-opacity-50\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"mtx-absolute mtx-left-2 mtx-flex mtx-h-3.5 mtx-w-3.5 mtx-items-center mtx-justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Circle className=\"mtx-h-4 mtx-w-4 mtx-fill-current\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.RadioItem>\r\n));\r\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\r\n\r\nconst ContextMenuLabel = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Label\r\n ref={ref}\r\n className={cn(\"mtx-px-2 mtx-py-1.5 mtx-text-sm mtx-font-semibold mtx-text-foreground\", inset && \"mtx-pl-8\", className)}\r\n {...props}\r\n />\r\n));\r\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\r\n\r\nconst ContextMenuSeparator = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.Separator ref={ref} className={cn(\"-mtx-1 mtx-my-1 mtx-h-px mtx-bg-border\", className)} {...props} />\r\n));\r\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\r\n\r\nconst ContextMenuShortcut = ({ 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\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\r\n\r\nexport {\r\n ContextMenu,\r\n ContextMenuTrigger,\r\n ContextMenuContent,\r\n ContextMenuItem,\r\n ContextMenuCheckboxItem,\r\n ContextMenuRadioItem,\r\n ContextMenuLabel,\r\n ContextMenuSeparator,\r\n ContextMenuShortcut,\r\n ContextMenuGroup,\r\n ContextMenuPortal,\r\n ContextMenuSub,\r\n ContextMenuSubContent,\r\n ContextMenuSubTrigger,\r\n ContextMenuRadioGroup,\r\n};\r\n"],"names":["ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","Check","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":"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"}
|
package/dist/datagrid.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, jsxs as z } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import t, { forwardRef as H, useMemo as N } 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
5
|
import { Trashcan as O, ElipsisVertical as q, Snowflake as $, Print as j, Refresh as _, CircleXmark as U, Magnifier as k } from "@trsys-tech/matrix-icons";
|
|
@@ -15,20 +15,20 @@ const Y = M.withParams({
|
|
|
15
15
|
fontSize: "12px",
|
|
16
16
|
headerFontSize: "12px",
|
|
17
17
|
headerFontWeight: 700,
|
|
18
|
-
headerBackgroundColor: "hsl(var(--primary-50))",
|
|
19
|
-
backgroundColor: "hsl(var(--gray-0))",
|
|
20
|
-
accentColor: "hsl(var(--primary-300))",
|
|
21
|
-
foregroundColor: "hsl(var(--text-500))",
|
|
22
|
-
cellTextColor: "hsl(var(--text-500))"
|
|
23
|
-
}),
|
|
24
|
-
const r =
|
|
18
|
+
headerBackgroundColor: "hsl(var(--mtx-primary-50))",
|
|
19
|
+
backgroundColor: "hsl(var(--mtx-gray-0))",
|
|
20
|
+
accentColor: "hsl(var(--mtx-primary-300))",
|
|
21
|
+
foregroundColor: "hsl(var(--mtx-text-500))",
|
|
22
|
+
cellTextColor: "hsl(var(--mtx-text-500))"
|
|
23
|
+
}), p = t.createContext(null), mt = () => {
|
|
24
|
+
const r = t.useContext(p);
|
|
25
25
|
if (!r)
|
|
26
26
|
throw new Error("useDataGrid should be used within <DataGrid>");
|
|
27
27
|
return r;
|
|
28
|
-
},
|
|
29
|
-
const s =
|
|
28
|
+
}, ut = ({ children: r }) => {
|
|
29
|
+
const s = t.useId(), [i, n] = t.useState(null), [a, c] = t.useState([]), [d, m] = t.useState(0), [u, l] = t.useState(/* @__PURE__ */ new Set()), [e, x] = t.useState(""), [h, f] = t.useState(!1);
|
|
30
30
|
return /* @__PURE__ */ o(
|
|
31
|
-
|
|
31
|
+
p.Provider,
|
|
32
32
|
{
|
|
33
33
|
value: {
|
|
34
34
|
api: i,
|
|
@@ -36,43 +36,43 @@ const Y = M.withParams({
|
|
|
36
36
|
rowData: a,
|
|
37
37
|
setRowData: c,
|
|
38
38
|
gridId: s,
|
|
39
|
-
quickFilterText:
|
|
40
|
-
setQuickFilterText:
|
|
41
|
-
actionbarExists:
|
|
42
|
-
setActionbarExists:
|
|
39
|
+
quickFilterText: e,
|
|
40
|
+
setQuickFilterText: x,
|
|
41
|
+
actionbarExists: h,
|
|
42
|
+
setActionbarExists: f,
|
|
43
43
|
actionbarHeight: d,
|
|
44
|
-
setActionbarHeight:
|
|
45
|
-
pinnedRowIds:
|
|
44
|
+
setActionbarHeight: m,
|
|
45
|
+
pinnedRowIds: u,
|
|
46
46
|
setPinnedRowIds: l
|
|
47
47
|
},
|
|
48
48
|
children: r
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}, Z = H(
|
|
52
|
-
({ theme: r, onGridReady: s, quickFilterText: i, rowData: n, containerStyle: a, getRowId: c, ...d },
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
52
|
+
({ theme: r, onGridReady: s, quickFilterText: i, rowData: n, containerStyle: a, getRowId: c, ...d }, m) => {
|
|
53
|
+
const u = t.useContext(p);
|
|
54
|
+
if (!u)
|
|
55
55
|
throw new Error("DataGridContent should be used within <DataGrid>");
|
|
56
|
-
const { rowData: l, setRowData:
|
|
56
|
+
const { rowData: l, setRowData: e, actionbarExists: x, setApi: h, setQuickFilterText: f, quickFilterText: R, gridId: E, actionbarHeight: C, pinnedRowIds: w } = u, b = N(() => Y.withParams({
|
|
57
57
|
headerHeight: 40,
|
|
58
|
-
wrapperBorderRadius:
|
|
59
|
-
}), [
|
|
60
|
-
|
|
58
|
+
wrapperBorderRadius: x ? "0px 0px 8px 8px" : "8px"
|
|
59
|
+
}), [x]), y = (v) => {
|
|
60
|
+
h(v.api), s?.(v);
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, [n,
|
|
65
|
-
i !== void 0 &&
|
|
66
|
-
}, [i,
|
|
62
|
+
t.useEffect(() => {
|
|
63
|
+
e(n);
|
|
64
|
+
}, [n, e]), t.useEffect(() => {
|
|
65
|
+
i !== void 0 && f(i ?? "");
|
|
66
|
+
}, [i, f]);
|
|
67
67
|
const { finalRowData: F, finalPinnedTopRowData: I } = N(() => {
|
|
68
|
-
if (!l ||
|
|
68
|
+
if (!l || w.size === 0)
|
|
69
69
|
return { finalRowData: l, finalPinnedTopRowData: [] };
|
|
70
70
|
const v = [], T = [];
|
|
71
71
|
return l.forEach((S) => {
|
|
72
72
|
const A = c ? c({ data: S, level: 0 }) : S.id, G = A != null ? String(A) : void 0;
|
|
73
|
-
G !== void 0 &&
|
|
73
|
+
G !== void 0 && w.has(G) ? v.push(S) : T.push(S);
|
|
74
74
|
}), { finalRowData: T, finalPinnedTopRowData: v };
|
|
75
|
-
}, [l,
|
|
75
|
+
}, [l, w, c]);
|
|
76
76
|
return /* @__PURE__ */ o(
|
|
77
77
|
L,
|
|
78
78
|
{
|
|
@@ -85,113 +85,117 @@ const Y = M.withParams({
|
|
|
85
85
|
containerStyle: { height: `calc(100% - ${C}px)`, ...a },
|
|
86
86
|
getRowId: c,
|
|
87
87
|
...d,
|
|
88
|
-
ref:
|
|
88
|
+
ref: m
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
);
|
|
93
93
|
Z.displayName = "DataGridContent";
|
|
94
|
-
const
|
|
95
|
-
const i =
|
|
94
|
+
const xt = ({ className: r, ...s }) => {
|
|
95
|
+
const i = t.useContext(p);
|
|
96
96
|
if (!i)
|
|
97
97
|
throw new Error("DataGridActionBar should be used within <DataGrid>");
|
|
98
|
-
const n =
|
|
99
|
-
return
|
|
98
|
+
const n = t.useRef(null), { setActionbarExists: a, setActionbarHeight: c } = i, { children: d } = s;
|
|
99
|
+
return t.useEffect(() => (a(!0), () => a(!1)), [a]), t.useEffect(() => {
|
|
100
100
|
n.current && c(n.current.clientHeight);
|
|
101
101
|
}, [c]), /* @__PURE__ */ o(
|
|
102
102
|
"div",
|
|
103
103
|
{
|
|
104
104
|
className: g(
|
|
105
|
-
"relative flex items-center p-2 h-12 w-full bg-gray-0 border border-gray-200 border-b-0 -mb-[1px] z-10 rounded-t-[8px]",
|
|
105
|
+
"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]",
|
|
106
106
|
r
|
|
107
107
|
),
|
|
108
108
|
ref: n,
|
|
109
109
|
children: d
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
|
-
},
|
|
113
|
-
const n =
|
|
112
|
+
}, ht = ({ defaultOpen: r = !1, className: s, ...i }) => {
|
|
113
|
+
const n = t.useContext(p);
|
|
114
114
|
if (!n)
|
|
115
115
|
throw new Error("SearchAction should be used within <DataGrid>");
|
|
116
|
-
const { quickFilterText: a, setQuickFilterText: c } = n, [d,
|
|
117
|
-
n.setQuickFilterText(""),
|
|
118
|
-
},
|
|
119
|
-
|
|
116
|
+
const { quickFilterText: a, setQuickFilterText: c } = n, [d, m] = t.useState(r), [u, l] = t.useState(!1), e = t.useRef(null), x = () => {
|
|
117
|
+
n.setQuickFilterText(""), e.current && e.current.focus();
|
|
118
|
+
}, h = () => {
|
|
119
|
+
m(!0);
|
|
120
120
|
};
|
|
121
|
-
|
|
122
|
-
d &&
|
|
121
|
+
t.useEffect(() => {
|
|
122
|
+
d && e?.current && e.current.focus();
|
|
123
123
|
}, [d]);
|
|
124
|
-
const
|
|
124
|
+
const f = () => {
|
|
125
125
|
l(!0), n.setQuickFilterText(""), setTimeout(() => {
|
|
126
|
-
|
|
126
|
+
m(!1), l(!1);
|
|
127
127
|
}, 200);
|
|
128
128
|
};
|
|
129
|
-
return /* @__PURE__ */ o("div", { className: g("max-w-60", s), ...i, children: d ||
|
|
129
|
+
return /* @__PURE__ */ o("div", { className: g("mtx-max-w-60", s), ...i, children: d || u ? /* @__PURE__ */ o(
|
|
130
130
|
W,
|
|
131
131
|
{
|
|
132
|
-
ref:
|
|
133
|
-
className: g(
|
|
132
|
+
ref: e,
|
|
133
|
+
className: g(
|
|
134
|
+
"mtx-relative mtx-h-7.5",
|
|
135
|
+
d && !u ? "mtx-animate-input-open" : "",
|
|
136
|
+
u && "mtx-animate-input-close"
|
|
137
|
+
),
|
|
134
138
|
onChange: (R) => c(R.target.value),
|
|
135
139
|
value: a,
|
|
136
|
-
startAdornment: /* @__PURE__ */ o(D, { variant: "toolbar", className: "p-0.5 h-6 w-6 border-none mx-1", onClick:
|
|
137
|
-
endAdornment: a && /* @__PURE__ */ o(D, { variant: "toolbar", className: "p-0.5 w-6 h-6 border-none mx-1", onClick:
|
|
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(k, { className: "mtx-w-5 mtx-h-5" }) }),
|
|
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" }) })
|
|
138
142
|
}
|
|
139
|
-
) : /* @__PURE__ */ o(D, { variant: "toolbar", className: "p-0.5 w-6 h-6 m-1", onClick:
|
|
140
|
-
},
|
|
141
|
-
const c =
|
|
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(k, { className: "mtx-w-5 mtx-h-5" }) }) });
|
|
144
|
+
}, ft = ({ freezeText: r, unFreezeText: s, onClick: i, disabled: n, ...a }) => {
|
|
145
|
+
const c = t.useContext(p);
|
|
142
146
|
if (!c)
|
|
143
147
|
throw new Error("FreezeAction should be used within <DataGrid>");
|
|
144
|
-
const [d,
|
|
145
|
-
if (!
|
|
146
|
-
const C =
|
|
148
|
+
const [d, m] = t.useState(0), [u, l] = t.useState(0), { api: e, pinnedRowIds: x, setPinnedRowIds: h } = c, f = () => {
|
|
149
|
+
if (!e) return;
|
|
150
|
+
const C = e.getSelectedNodes();
|
|
147
151
|
if (C.length > 0) {
|
|
148
|
-
const
|
|
152
|
+
const w = new Set(x);
|
|
149
153
|
C.forEach((b) => {
|
|
150
|
-
b.id !== void 0 &&
|
|
151
|
-
}),
|
|
154
|
+
b.id !== void 0 && w.add(b.id);
|
|
155
|
+
}), h(w), e.deselectAll();
|
|
152
156
|
}
|
|
153
157
|
}, R = () => {
|
|
154
|
-
|
|
158
|
+
h(/* @__PURE__ */ new Set());
|
|
155
159
|
}, E = (C) => {
|
|
156
|
-
|
|
160
|
+
e && (e.getPinnedTopRowCount() > 0 ? R() : f()), i?.(C);
|
|
157
161
|
};
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
}),
|
|
161
|
-
l(
|
|
162
|
+
return t.useEffect(() => (e?.addEventListener("pinnedRowDataChanged", () => {
|
|
163
|
+
m(e.getPinnedTopRowCount());
|
|
164
|
+
}), e?.addEventListener("selectionChanged", () => {
|
|
165
|
+
l(e.getSelectedNodes().length);
|
|
162
166
|
}), () => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}),
|
|
166
|
-
l(
|
|
167
|
+
e?.isDestroyed() || (e?.removeEventListener("pinnedRowDataChanged", () => {
|
|
168
|
+
m(e.getPinnedTopRowCount());
|
|
169
|
+
}), e?.removeEventListener("selectionChanged", () => {
|
|
170
|
+
l(e.getSelectedNodes().length);
|
|
167
171
|
}));
|
|
168
|
-
}), [
|
|
172
|
+
}), [e]), /* @__PURE__ */ o(
|
|
169
173
|
P,
|
|
170
174
|
{
|
|
171
175
|
variant: "text",
|
|
172
176
|
onClick: E,
|
|
173
|
-
startIcon: /* @__PURE__ */ o($, { className: "w-4.5 h-4.5" }),
|
|
174
|
-
disabled: !d && !
|
|
177
|
+
startIcon: /* @__PURE__ */ o($, { className: "mtx-w-4.5 mtx-h-4.5" }),
|
|
178
|
+
disabled: !d && !u || n,
|
|
175
179
|
...a,
|
|
176
180
|
children: d ? s ?? "Unfreeze" : r ?? "Freeze"
|
|
177
181
|
}
|
|
178
182
|
);
|
|
179
|
-
},
|
|
180
|
-
const a =
|
|
183
|
+
}, pt = ({ children: r, className: s, onClick: i, ...n }) => {
|
|
184
|
+
const a = t.useContext(p);
|
|
181
185
|
if (!a)
|
|
182
186
|
throw new Error("PrintAction should be used within <DataGrid>");
|
|
183
187
|
const c = (d) => {
|
|
184
188
|
a.api && (a.api.setGridOption("domLayout", "print"), setTimeout(() => {
|
|
185
|
-
const
|
|
189
|
+
const m = document.querySelector("[grid-id='" + a.gridId + "']"), l = `<html>
|
|
186
190
|
${document.head.innerHTML}
|
|
187
|
-
${
|
|
191
|
+
${m.outerHTML}
|
|
188
192
|
</html>`;
|
|
189
193
|
V(l), a?.api?.setGridOption("domLayout", void 0);
|
|
190
194
|
})), i?.(d);
|
|
191
195
|
};
|
|
192
|
-
return /* @__PURE__ */ o(D, { variant: "toolbar", className: g("p-0.5 w-6 h-6", s), onClick: c, ...n, children: r ?? /* @__PURE__ */ o(j, { className: "w-5 h-5" }) });
|
|
193
|
-
},
|
|
194
|
-
if (!
|
|
196
|
+
return /* @__PURE__ */ o(D, { variant: "toolbar", className: g("mtx-p-0.5 mtx-w-6 mtx-h-6", s), onClick: c, ...n, children: r ?? /* @__PURE__ */ o(j, { className: "mtx-w-5 mtx-h-5" }) });
|
|
197
|
+
}, wt = ({ className: r, onRefresh: s, children: i, loading: n, ...a }) => {
|
|
198
|
+
if (!t.useContext(p))
|
|
195
199
|
throw new Error("RefreshAction should be used within <DataGrid>");
|
|
196
200
|
const d = () => {
|
|
197
201
|
s();
|
|
@@ -199,31 +203,31 @@ const fe = ({ className: r, ...s }) => {
|
|
|
199
203
|
return /* @__PURE__ */ o(
|
|
200
204
|
D,
|
|
201
205
|
{
|
|
202
|
-
className: g("p-0.5 w-6 h-6", n && "disabled:bg-transparent", r),
|
|
206
|
+
className: g("mtx-p-0.5 mtx-w-6 mtx-h-6", n && "disabled:mtx-bg-transparent", r),
|
|
203
207
|
variant: "toolbar",
|
|
204
208
|
onClick: d,
|
|
205
209
|
disabled: n,
|
|
206
210
|
...a,
|
|
207
|
-
children: i ?? /* @__PURE__ */ o(_, { className: g("w-4.5 h-4.5", n && "animate-spin") })
|
|
211
|
+
children: i ?? /* @__PURE__ */ o(_, { className: g("mtx-w-4.5 mtx-h-4.5", n && "mtx-animate-spin") })
|
|
208
212
|
}
|
|
209
213
|
);
|
|
210
|
-
},
|
|
214
|
+
}, gt = ({ onDelete: r, children: s, ...i }) => /* @__PURE__ */ o(P, { variant: "danger", onClick: () => {
|
|
211
215
|
r();
|
|
212
|
-
}, startIcon: /* @__PURE__ */ o(O, { className: "w-4.5 h-4.5" }), ...i, children: s }),
|
|
213
|
-
/* @__PURE__ */ o(J, { ...s?.triggerProps ?? {}, children: /* @__PURE__ */ o(q, { className: "w-4.5 h-4.5 text-primary" }) }),
|
|
214
|
-
/* @__PURE__ */ o(K, { align: "end", className: g("w-40", i), ...n, children: r })
|
|
216
|
+
}, startIcon: /* @__PURE__ */ o(O, { className: "mtx-w-4.5 mtx-h-4.5" }), ...i, children: s }), Ct = ({ children: r, slotProps: s, className: i, ...n }) => /* @__PURE__ */ z(X, { ...s?.popoverProps ?? {}, children: [
|
|
217
|
+
/* @__PURE__ */ o(J, { ...s?.triggerProps ?? {}, children: /* @__PURE__ */ o(q, { className: "mtx-w-4.5 mtx-h-4.5 mtx-text-primary" }) }),
|
|
218
|
+
/* @__PURE__ */ o(K, { align: "end", className: g("mtx-w-40", i), ...n, children: r })
|
|
215
219
|
] });
|
|
216
220
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
ut as DataGrid,
|
|
222
|
+
xt as DataGridActionBar,
|
|
219
223
|
Z as DataGridContent,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
gt as DeleteAction,
|
|
225
|
+
Ct as ExtraActions,
|
|
226
|
+
ft as FreezeAction,
|
|
227
|
+
pt as PrintAction,
|
|
228
|
+
wt as RefreshAction,
|
|
229
|
+
ht as SearchAction,
|
|
226
230
|
Y as dataGridDefaultTheme,
|
|
227
|
-
|
|
231
|
+
mt as useDataGrid
|
|
228
232
|
};
|
|
229
233
|
//# sourceMappingURL=datagrid.es.js.map
|