@trsys-tech/matrix-library 0.4.8 → 0.5.0-alpha.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/calendar.es.js +38 -38
- package/dist/calendar.es.js.map +1 -1
- package/dist/components/data-grid/DataGrid.d.ts +6 -3
- package/dist/components/data-grid/DataGrid.d.ts.map +1 -1
- package/dist/components/date-picker/DesktopDatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DesktopDateRangePicker.d.ts.map +1 -1
- package/dist/components/date-picker/MobileDatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/MobileDateRangePicker.d.ts.map +1 -1
- package/dist/components/date-picker/calendar.d.ts.map +1 -1
- package/dist/datagrid.es.js +104 -97
- package/dist/datagrid.es.js.map +1 -1
- package/dist/desktopdatepicker.es.js +27 -24
- package/dist/desktopdatepicker.es.js.map +1 -1
- package/dist/desktopdaterangepicker.es.js +24 -12
- package/dist/desktopdaterangepicker.es.js.map +1 -1
- package/dist/mobiledatepicker.es.js +37 -25
- package/dist/mobiledatepicker.es.js.map +1 -1
- package/dist/mobiledaterangepicker.es.js +54 -42
- package/dist/mobiledaterangepicker.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/calendar.es.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "react";
|
|
3
|
-
import { DayPicker as
|
|
4
|
-
import { ChevronLeft as
|
|
5
|
-
import { Collapsible as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Button as
|
|
8
|
-
function
|
|
9
|
-
const n = d.useRef(null), [s,
|
|
3
|
+
import { DayPicker as g, Chevron as p } from "react-day-picker";
|
|
4
|
+
import { ChevronLeft as x, ChevronRight as w, ChevronDown as y } from "@trsys-tech/matrix-icons";
|
|
5
|
+
import { Collapsible as v, CollapsibleTrigger as u, CollapsibleContent as C } from "@radix-ui/react-collapsible";
|
|
6
|
+
import { cn as o } from "./utils.es.js";
|
|
7
|
+
import { Button as N } from "./button.es.js";
|
|
8
|
+
function _({ className: c, classNames: f, showOutsideDays: m = !0, ...a }) {
|
|
9
|
+
const n = d.useRef(null), [s, b] = d.useState({ width: 0, height: 0 });
|
|
10
10
|
return d.useEffect(() => {
|
|
11
11
|
if (n.current) {
|
|
12
12
|
const { width: e, height: l } = n.current.parentElement?.parentElement?.parentElement?.getBoundingClientRect() ?? {
|
|
13
13
|
width: 0,
|
|
14
14
|
height: 0
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
b({ width: e, height: l });
|
|
17
17
|
}
|
|
18
|
-
}, []), /* @__PURE__ */
|
|
19
|
-
|
|
18
|
+
}, []), /* @__PURE__ */ r(
|
|
19
|
+
g,
|
|
20
20
|
{
|
|
21
|
-
showOutsideDays:
|
|
22
|
-
className:
|
|
21
|
+
showOutsideDays: m,
|
|
22
|
+
className: o("p-3 relative w-full max-w-sm group/root z-10", c),
|
|
23
23
|
classNames: {
|
|
24
|
-
months:
|
|
24
|
+
months: o("relative flex flex-col", a.mode === "range" && "md:flex-row md:space-x-4 md:space-y-2"),
|
|
25
25
|
month: "space-y-4 peer md:flex-1",
|
|
26
26
|
month_caption: "flex justify-center pt-1 relative items-center",
|
|
27
27
|
dropdowns: "flex gap-2",
|
|
28
28
|
caption_label: "text-sm font-bold",
|
|
29
|
-
nav:
|
|
30
|
-
button_previous:
|
|
29
|
+
nav: o("space-x-1 flex items-center group-has-[[data-state=open]]/root:hidden", a.mode !== "range" && "relative"),
|
|
30
|
+
button_previous: o(
|
|
31
31
|
"h-7 w-7 bg-transparent p-0 text-primary hover:opacity-100 absolute left-2 top-0 md:top-0.5 z-10",
|
|
32
|
-
|
|
32
|
+
a.mode === "range" && "md:left-8 md:top-2"
|
|
33
33
|
),
|
|
34
|
-
button_next:
|
|
34
|
+
button_next: o(
|
|
35
35
|
"h-7 w-7 bg-transparent p-0 text-primary hover:opacity-100 absolute right-2 top-0 md:top-0.5 z-10",
|
|
36
|
-
|
|
36
|
+
a.mode === "range" && "md:top-2"
|
|
37
37
|
),
|
|
38
|
-
month_grid:
|
|
38
|
+
month_grid: o("w-full border-collapse space-y-1"),
|
|
39
39
|
weekdays: "grid grid-cols-7 justify-items-center",
|
|
40
40
|
weekday: "text-text rounded-md w-8 font-bold text-sm",
|
|
41
41
|
week: "mt-2 h-11 grid grid-cols-7 items-center",
|
|
@@ -52,43 +52,43 @@ function N({ className: m, classNames: f, showOutsideDays: u = !0, ...o }) {
|
|
|
52
52
|
...f
|
|
53
53
|
},
|
|
54
54
|
components: {
|
|
55
|
-
Chevron: (e) => e.orientation === "left" ? /* @__PURE__ */
|
|
55
|
+
Chevron: (e) => e.orientation === "left" ? /* @__PURE__ */ r(x, { ...e, className: "h-6 w-6" }) : e.orientation === "right" ? /* @__PURE__ */ r(w, { ...e, className: "h-6 w-6" }) : /* @__PURE__ */ r(p, { ...e }),
|
|
56
56
|
YearsDropdown: (e) => {
|
|
57
|
-
const l = (
|
|
58
|
-
e.onChange?.({ target: { value:
|
|
57
|
+
const l = (t) => {
|
|
58
|
+
e.onChange?.({ target: { value: t } });
|
|
59
59
|
};
|
|
60
|
-
return /* @__PURE__ */ i(
|
|
61
|
-
/* @__PURE__ */ i(
|
|
60
|
+
return /* @__PURE__ */ i(v, { ref: n, children: [
|
|
61
|
+
/* @__PURE__ */ i(u, { className: "group flex items-center gap-1", children: [
|
|
62
62
|
e.value,
|
|
63
63
|
" ",
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ r(y, { className: "text-primary w-5 h-5 group-data-[state='open']:rotate-180 transition-transform ms-auto" })
|
|
65
65
|
] }),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
66
|
+
/* @__PURE__ */ r(
|
|
67
|
+
C,
|
|
68
68
|
{
|
|
69
69
|
className: "overflow-auto z-50 absolute bg-popover left-2 top-11 p-1",
|
|
70
70
|
style: { width: s.width, height: s.height - 44 },
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
|
|
71
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-row flex-wrap gap-4", children: e.options ? [...e.options].sort((t, h) => Number(h.value) - Number(t.value)).map((t) => /* @__PURE__ */ r(u, { asChild: !0, children: /* @__PURE__ */ r(
|
|
72
|
+
N,
|
|
73
73
|
{
|
|
74
|
-
"data-value":
|
|
74
|
+
"data-value": t.value,
|
|
75
75
|
variant: "text",
|
|
76
|
-
className:
|
|
77
|
-
onClick: () => l(
|
|
78
|
-
children:
|
|
76
|
+
className: o("h-6 w-14 py-1 px-3 rounded-full font-bold", e.value === t.value && "bg-secondary"),
|
|
77
|
+
onClick: () => l(t.value.toString()),
|
|
78
|
+
children: t.label
|
|
79
79
|
}
|
|
80
|
-
) },
|
|
80
|
+
) }, t.label)) : null })
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
] });
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
...
|
|
86
|
+
...a
|
|
87
87
|
}
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
_.displayName = "Calendar";
|
|
91
91
|
export {
|
|
92
|
-
|
|
92
|
+
_ as Calendar
|
|
93
93
|
};
|
|
94
94
|
//# sourceMappingURL=calendar.es.js.map
|
package/dist/calendar.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.es.js","sources":["../src/components/date-picker/calendar.tsx"],"sourcesContent":["\"use client\";\n\n/* eslint-disable camelcase */\nimport * as React from \"react\";\nimport { Chevron, DayPicker, DayPickerProps } from \"react-day-picker\";\nimport { ChevronDown, ChevronLeft, ChevronRight } from \"@trsys-tech/matrix-icons\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"@radix-ui/react-collapsible\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button/Button\";\n\nexport type CalendarProps = DayPickerProps & {};\n\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {\n const yearCollapseRef = React.useRef<HTMLDivElement>(null);\n const [size, setSize] = React.useState({ width: 0, height: 0 });\n\n React.useEffect(() => {\n if (yearCollapseRef.current) {\n const { width, height } = yearCollapseRef.current.parentElement?.parentElement?.parentElement?.getBoundingClientRect() ?? {\n width: 0,\n height: 0,\n };\n setSize({ width, height });\n }\n }, []);\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3 relative w-full max-w-sm group/root z-10\", className)}\n classNames={{\n months: cn(\"relative flex flex-col\", props.mode === \"range\" && \"md:flex-row md:space-x-4 md:space-y-2\"),\n month: \"space-y-4 peer md:flex-1\",\n month_caption: \"flex justify-center pt-1 relative items-center\",\n dropdowns: \"flex gap-2\",\n caption_label: \"text-sm font-bold\",\n nav: cn(\"space-x-1 flex items-center group-has-[[data-state=open]]/root:hidden\", props.mode !== \"range\" && \"relative\"),\n button_previous: cn(\n \"h-7 w-7 bg-transparent p-0 text-primary hover:opacity-100 absolute left-2 top-0 md:top-0.5 z-10\",\n props.mode === \"range\" && \"md:left-8 md:top-2\",\n ),\n button_next: cn(\n \"h-7 w-7 bg-transparent p-0 text-primary hover:opacity-100 absolute right-2 top-0 md:top-0.5 z-10\",\n props.mode === \"range\" && \"md:top-2\",\n ),\n month_grid: cn(\"w-full border-collapse space-y-1\"),\n weekdays: \"grid grid-cols-7 justify-items-center\",\n weekday: \"text-text rounded-md w-8 font-bold text-sm\",\n week: \"mt-2 h-11 grid grid-cols-7 items-center\",\n day: \"relative p-0 text-center text-sm h-11 min-w-11 md:min-w-9 md:h-9\",\n day_button: \"w-11 md:w-9 h-full p-0 text-sm\",\n range_start:\n \"before:block before:absolute before:-z-10 before:content-[''] before:w-1/2 before:end-0 before:h-full before:bg-secondary/50 after:!w-0\",\n range_end:\n \"after:block after:absolute after:top-0 after:-z-10 after:content-[''] after:w-1/2 after:start-0 after:h-full after:bg-secondary/50 before:!w-0\",\n selected:\n \"[&>button]:bg-secondary [&>button]:rounded-full text-text font-bold [&>button]:hover:bg-secondary [&>button]:hover:text-text [&>button]:focus:bg-secondary [&>button]:focus:text-text [&>button]:text-xs\",\n today: \"text-primary font-bold [&>button]:text-xs\",\n outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n range_middle: \"bg-secondary/50 [&>button]:data-[selected='true']:bg-secondary/0 data-[selected='true']:rounded-none text-accent-foreground\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: props => {\n if (props.orientation === \"left\") {\n return <ChevronLeft {...props} className=\"h-6 w-6\" />;\n } else if (props.orientation === \"right\") {\n return <ChevronRight {...props} className=\"h-6 w-6\" />;\n }\n return <Chevron {...props} />;\n },\n YearsDropdown:
|
|
1
|
+
{"version":3,"file":"calendar.es.js","sources":["../src/components/date-picker/calendar.tsx"],"sourcesContent":["\"use client\";\n\n/* eslint-disable camelcase */\nimport * as React from \"react\";\nimport { Chevron, DayPicker, DayPickerProps } from \"react-day-picker\";\nimport { ChevronDown, ChevronLeft, ChevronRight } from \"@trsys-tech/matrix-icons\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"@radix-ui/react-collapsible\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button/Button\";\n\nexport type CalendarProps = DayPickerProps & {};\n\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {\n const yearCollapseRef = React.useRef<HTMLDivElement>(null);\n const [size, setSize] = React.useState({ width: 0, height: 0 });\n\n React.useEffect(() => {\n if (yearCollapseRef.current) {\n const { width, height } = yearCollapseRef.current.parentElement?.parentElement?.parentElement?.getBoundingClientRect() ?? {\n width: 0,\n height: 0,\n };\n setSize({ width, height });\n }\n }, []);\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3 relative w-full max-w-sm group/root z-10\", className)}\n classNames={{\n months: cn(\"relative flex flex-col\", props.mode === \"range\" && \"md:flex-row md:space-x-4 md:space-y-2\"),\n month: \"space-y-4 peer md:flex-1\",\n month_caption: \"flex justify-center pt-1 relative items-center\",\n dropdowns: \"flex gap-2\",\n caption_label: \"text-sm font-bold\",\n nav: cn(\"space-x-1 flex items-center group-has-[[data-state=open]]/root:hidden\", props.mode !== \"range\" && \"relative\"),\n button_previous: cn(\n \"h-7 w-7 bg-transparent p-0 text-primary hover:opacity-100 absolute left-2 top-0 md:top-0.5 z-10\",\n props.mode === \"range\" && \"md:left-8 md:top-2\",\n ),\n button_next: cn(\n \"h-7 w-7 bg-transparent p-0 text-primary hover:opacity-100 absolute right-2 top-0 md:top-0.5 z-10\",\n props.mode === \"range\" && \"md:top-2\",\n ),\n month_grid: cn(\"w-full border-collapse space-y-1\"),\n weekdays: \"grid grid-cols-7 justify-items-center\",\n weekday: \"text-text rounded-md w-8 font-bold text-sm\",\n week: \"mt-2 h-11 grid grid-cols-7 items-center\",\n day: \"relative p-0 text-center text-sm h-11 min-w-11 md:min-w-9 md:h-9\",\n day_button: \"w-11 md:w-9 h-full p-0 text-sm\",\n range_start:\n \"before:block before:absolute before:-z-10 before:content-[''] before:w-1/2 before:end-0 before:h-full before:bg-secondary/50 after:!w-0\",\n range_end:\n \"after:block after:absolute after:top-0 after:-z-10 after:content-[''] after:w-1/2 after:start-0 after:h-full after:bg-secondary/50 before:!w-0\",\n selected:\n \"[&>button]:bg-secondary [&>button]:rounded-full text-text font-bold [&>button]:hover:bg-secondary [&>button]:hover:text-text [&>button]:focus:bg-secondary [&>button]:focus:text-text [&>button]:text-xs\",\n today: \"text-primary font-bold [&>button]:text-xs\",\n outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n range_middle: \"bg-secondary/50 [&>button]:data-[selected='true']:bg-secondary/0 data-[selected='true']:rounded-none text-accent-foreground\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: props => {\n if (props.orientation === \"left\") {\n return <ChevronLeft {...props} className=\"h-6 w-6\" />;\n } else if (props.orientation === \"right\") {\n return <ChevronRight {...props} className=\"h-6 w-6\" />;\n }\n return <Chevron {...props} />;\n },\n YearsDropdown: params => {\n const handleChange = (value: string) => {\n params.onChange?.({ target: { value: value } } as unknown as React.ChangeEvent<HTMLSelectElement>);\n };\n return (\n <Collapsible ref={yearCollapseRef}>\n <CollapsibleTrigger className=\"group flex items-center gap-1\">\n {params.value} <ChevronDown className=\"text-primary w-5 h-5 group-data-[state='open']:rotate-180 transition-transform ms-auto\" />\n </CollapsibleTrigger>\n <CollapsibleContent\n className=\"overflow-auto z-50 absolute bg-popover left-2 top-11 p-1\"\n style={{ width: size.width, height: size.height - 44 }}\n >\n <div className=\"flex flex-row flex-wrap gap-4\">\n {params.options\n ? [...params.options]\n .sort((a, b) => Number(b.value) - Number(a.value)) // Sort in descending order (newest year first)\n .map(option => (\n <CollapsibleTrigger asChild key={option.label}>\n <Button\n data-value={option.value}\n variant=\"text\"\n className={cn(\"h-6 w-14 py-1 px-3 rounded-full font-bold\", params.value === option.value && \"bg-secondary\")}\n onClick={() => handleChange(option.value.toString())}\n >\n {option.label}\n </Button>\n </CollapsibleTrigger>\n ))\n : null}\n </div>\n </CollapsibleContent>\n </Collapsible>\n );\n },\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n"],"names":["Calendar","className","classNames","showOutsideDays","props","yearCollapseRef","React","size","setSize","width","height","jsx","DayPicker","cn","ChevronLeft","ChevronRight","Chevron","params","handleChange","value","jsxs","Collapsible","CollapsibleTrigger","ChevronDown","CollapsibleContent","a","b","option","Button"],"mappings":";;;;;;;AAaA,SAASA,EAAS,EAAE,WAAAC,GAAW,YAAAC,GAAY,iBAAAC,IAAkB,IAAM,GAAGC,KAAwB;AACtF,QAAAC,IAAkBC,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;AAAA,QAAA;AAAA,MAGN;AAAA,MACC,GAAGvB;AAAA,IAAA;AAAA,EACN;AAEJ;AACAJ,EAAS,cAAc;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes } from 'react';
|
|
2
2
|
import { AgGridReactProps } from 'ag-grid-react';
|
|
3
|
-
import { GridApi } from 'ag-grid-community';
|
|
3
|
+
import { GridApi, Theme, ThemeDefaultParams } from 'ag-grid-community';
|
|
4
4
|
import { ButtonProps } from '../button/Button';
|
|
5
5
|
import { IconButtonProps } from '../icon-botton/IconButton';
|
|
6
6
|
import { PopoverContentProps, PopoverProps, PopoverTriggerProps } from '../popover/Popover';
|
|
7
|
+
declare const defaultTheme: Theme< ThemeDefaultParams>;
|
|
7
8
|
type DataGridContext = {
|
|
8
9
|
api: GridApi | null;
|
|
9
10
|
setApi: (value: GridApi) => void;
|
|
@@ -23,7 +24,9 @@ type DataGridProps = {
|
|
|
23
24
|
children: React.ReactNode;
|
|
24
25
|
};
|
|
25
26
|
declare const DataGrid: React.FC<DataGridProps>;
|
|
26
|
-
type DataGridContentProps = AgGridReactProps & {
|
|
27
|
+
type DataGridContentProps = Omit<AgGridReactProps, "theme"> & {
|
|
28
|
+
theme?: Theme;
|
|
29
|
+
};
|
|
27
30
|
declare const DataGridContent: React.FC<DataGridContentProps>;
|
|
28
31
|
type DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};
|
|
29
32
|
declare const DataGridActionBar: React.FC<DatagridActionBarProps>;
|
|
@@ -54,5 +57,5 @@ type ExtraActionsProps = PopoverContentProps & {
|
|
|
54
57
|
};
|
|
55
58
|
};
|
|
56
59
|
declare const ExtraActions: React.FC<ExtraActionsProps>;
|
|
57
|
-
export { DataGrid, DataGridContent, DataGridActionBar, SearchAction, FreezeAction, PrintAction, RefreshAction, ExtraActions, DeleteAction, type DataGridProps, type DataGridContentProps, type DatagridActionBarProps, type SearchActionProps, type FreezeActionProps, type RefreshActionProps, type ExtraActionsProps, type DeleteActionProps, useDataGrid, };
|
|
60
|
+
export { DataGrid, DataGridContent, DataGridActionBar, SearchAction, FreezeAction, PrintAction, RefreshAction, ExtraActions, DeleteAction, type DataGridProps, type DataGridContentProps, type DatagridActionBarProps, type SearchActionProps, type FreezeActionProps, type RefreshActionProps, type ExtraActionsProps, type DeleteActionProps, useDataGrid, defaultTheme, };
|
|
58
61
|
//# sourceMappingURL=DataGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAW,MAAM,OAAO,CAAC;AACvD,OAAO,EAAe,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAmE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAMpH,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAc,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAA2B,mBAAmB,EAAE,YAAY,EAAkB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAMrI,QAAA,MAAM,YAAY,uDAUhB,CAAC;AAEH,KAAK,eAAe,GAAG;IACrB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,UAAU,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,eAA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AAK,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesktopDateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DesktopDateRangePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQpE,KAAK,2BAA2B,GAAG,SAAS,GAC1C,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,
|
|
1
|
+
{"version":3,"file":"DesktopDateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DesktopDateRangePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQpE,KAAK,2BAA2B,GAAG,SAAS,GAC1C,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAwFjE,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,KAAK,2BAA2B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileDatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/MobileDatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAS1D,KAAK,qBAAqB,GAAG,SAAS,GACpC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"MobileDatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/MobileDatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,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CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,
|
|
1
|
+
{"version":3,"file":"MobileDateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/MobileDateRangePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AAOrF,KAAK,0BAA0B,GAAG,SAAS,GACzC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA6H/D,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/calendar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAsB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOtE,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,EAAE,CAAC;AAEhD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,eAAsB,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/calendar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAsB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOtE,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,EAAE,CAAC;AAEhD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,eAAsB,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAqG3F;kBArGQ,QAAQ;;;AAwGjB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/datagrid.es.js
CHANGED
|
@@ -1,84 +1,90 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import t from "react";
|
|
3
|
-
import { AgGridReact as
|
|
4
|
-
import { themeQuartz as
|
|
5
|
-
import { Magnifier as G, CircleXmark as
|
|
1
|
+
import { jsx as r, jsxs as A } from "react/jsx-runtime";
|
|
2
|
+
import t, { useMemo as N } from "react";
|
|
3
|
+
import { AgGridReact as T } from "ag-grid-react";
|
|
4
|
+
import { ModuleRegistry as k, AllCommunityModule as y, themeQuartz as F } from "ag-grid-community";
|
|
5
|
+
import { Magnifier as G, CircleXmark as P, Snowflake as z, Print as I, Refresh as H, Trashcan as O, ElipsisVertical as L } from "@trsys-tech/matrix-icons";
|
|
6
6
|
import { cn as w } from "./utils.es.js";
|
|
7
|
-
import { printHtml as
|
|
8
|
-
import { TextField as
|
|
7
|
+
import { printHtml as M } from "./printhtml.es.js";
|
|
8
|
+
import { TextField as B } from "./textfield.es.js";
|
|
9
9
|
import { Button as E } from "./button.es.js";
|
|
10
|
-
import { IconButton as
|
|
11
|
-
import { Popover as
|
|
12
|
-
|
|
10
|
+
import { IconButton as v } from "./iconbutton.es.js";
|
|
11
|
+
import { Popover as Q, PopoverTrigger as q, PopoverContent as $ } from "./popover.es.js";
|
|
12
|
+
k.registerModules([y]);
|
|
13
|
+
const j = F.withParams({
|
|
13
14
|
fontFamily: "DMSans",
|
|
14
15
|
fontSize: "12px",
|
|
15
16
|
headerFontSize: "12px",
|
|
16
|
-
headerFontWeight: 700
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
}), p = t.createContext(null), ne = () => {
|
|
24
|
+
const o = t.useContext(p);
|
|
19
25
|
if (!o)
|
|
20
26
|
throw new Error("useDataGrid should be used within <DataGrid>");
|
|
21
27
|
return o;
|
|
22
|
-
},
|
|
23
|
-
const
|
|
28
|
+
}, re = ({ children: o }) => {
|
|
29
|
+
const i = t.useId(), [a, n] = t.useState(null), [s, d] = t.useState([]), [c, u] = t.useState(0), [h, l] = t.useState(""), [e, m] = t.useState(!1);
|
|
24
30
|
return /* @__PURE__ */ r(
|
|
25
|
-
|
|
31
|
+
p.Provider,
|
|
26
32
|
{
|
|
27
33
|
value: {
|
|
28
34
|
api: a,
|
|
29
35
|
setApi: n,
|
|
30
|
-
rowData:
|
|
36
|
+
rowData: s,
|
|
31
37
|
setRowData: d,
|
|
32
|
-
gridId:
|
|
33
|
-
quickFilterText:
|
|
34
|
-
setQuickFilterText:
|
|
38
|
+
gridId: i,
|
|
39
|
+
quickFilterText: h,
|
|
40
|
+
setQuickFilterText: l,
|
|
35
41
|
actionbarExists: e,
|
|
36
|
-
setActionbarExists:
|
|
42
|
+
setActionbarExists: m,
|
|
37
43
|
actionbarHeight: c,
|
|
38
|
-
setActionbarHeight:
|
|
44
|
+
setActionbarHeight: u
|
|
39
45
|
},
|
|
40
46
|
children: o
|
|
41
47
|
}
|
|
42
48
|
);
|
|
43
|
-
},
|
|
49
|
+
}, oe = ({
|
|
44
50
|
theme: o,
|
|
45
|
-
onGridReady:
|
|
51
|
+
onGridReady: i,
|
|
46
52
|
quickFilterText: a,
|
|
47
53
|
rowData: n,
|
|
48
|
-
containerStyle:
|
|
54
|
+
containerStyle: s,
|
|
49
55
|
...d
|
|
50
56
|
}) => {
|
|
51
|
-
const c = t.useContext(
|
|
57
|
+
const c = t.useContext(p);
|
|
52
58
|
if (!c)
|
|
53
59
|
throw new Error("DataGridContent should be used within <DataGrid>");
|
|
54
|
-
const { rowData:
|
|
60
|
+
const { rowData: u, setRowData: h, actionbarExists: l, setApi: e, setQuickFilterText: m, quickFilterText: x, gridId: g, actionbarHeight: C } = c, f = N(() => j.withParams({
|
|
55
61
|
headerHeight: 40,
|
|
56
|
-
wrapperBorderRadius:
|
|
57
|
-
}),
|
|
58
|
-
e(
|
|
62
|
+
wrapperBorderRadius: l ? "0px 0px 8px 8px" : "8px"
|
|
63
|
+
}), [l]), R = (D) => {
|
|
64
|
+
e(D.api), i?.(D);
|
|
59
65
|
};
|
|
60
66
|
return t.useEffect(() => {
|
|
61
|
-
|
|
62
|
-
}, [n,
|
|
63
|
-
a !== void 0 &&
|
|
64
|
-
}, [a,
|
|
65
|
-
|
|
67
|
+
h(n);
|
|
68
|
+
}, [n, h]), t.useEffect(() => {
|
|
69
|
+
a !== void 0 && m(a ?? "");
|
|
70
|
+
}, [a, m]), /* @__PURE__ */ r(
|
|
71
|
+
T,
|
|
66
72
|
{
|
|
67
73
|
gridId: g,
|
|
68
74
|
theme: o ?? f,
|
|
69
|
-
rowData:
|
|
75
|
+
rowData: u,
|
|
70
76
|
quickFilterText: x,
|
|
71
|
-
onGridReady:
|
|
72
|
-
containerStyle: { height: `calc(100% - ${C}px)`, ...
|
|
77
|
+
onGridReady: R,
|
|
78
|
+
containerStyle: { height: `calc(100% - ${C}px)`, ...s },
|
|
73
79
|
...d
|
|
74
80
|
}
|
|
75
81
|
);
|
|
76
|
-
},
|
|
77
|
-
const a = t.useContext(
|
|
82
|
+
}, ae = ({ className: o, ...i }) => {
|
|
83
|
+
const a = t.useContext(p);
|
|
78
84
|
if (!a)
|
|
79
85
|
throw new Error("DataGridActionBar should be used within <DataGrid>");
|
|
80
|
-
const n = t.useRef(null), { setActionbarExists:
|
|
81
|
-
return t.useEffect(() => (
|
|
86
|
+
const n = t.useRef(null), { setActionbarExists: s, setActionbarHeight: d } = a, { children: c } = i;
|
|
87
|
+
return t.useEffect(() => (s(!0), () => s(!1)), [s]), t.useEffect(() => {
|
|
82
88
|
n.current && d(n.current.clientHeight);
|
|
83
89
|
}, [d]), /* @__PURE__ */ r(
|
|
84
90
|
"div",
|
|
@@ -91,39 +97,39 @@ const M = T.withParams({
|
|
|
91
97
|
children: c
|
|
92
98
|
}
|
|
93
99
|
);
|
|
94
|
-
},
|
|
95
|
-
const n = t.useContext(
|
|
100
|
+
}, se = ({ defaultOpen: o = !1, className: i, ...a }) => {
|
|
101
|
+
const n = t.useContext(p);
|
|
96
102
|
if (!n)
|
|
97
103
|
throw new Error("SearchAction should be used within <DataGrid>");
|
|
98
|
-
const { quickFilterText:
|
|
104
|
+
const { quickFilterText: s, setQuickFilterText: d } = n, [c, u] = t.useState(o), [h, l] = t.useState(!1), e = t.useRef(null), m = () => {
|
|
99
105
|
n.setQuickFilterText(""), e.current && e.current.focus();
|
|
100
106
|
}, x = () => {
|
|
101
|
-
|
|
107
|
+
u(!0);
|
|
102
108
|
};
|
|
103
109
|
t.useEffect(() => {
|
|
104
110
|
c && e?.current && e.current.focus();
|
|
105
111
|
}, [c]);
|
|
106
112
|
const g = () => {
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
l(!0), n.setQuickFilterText(""), setTimeout(() => {
|
|
114
|
+
u(!1), l(!1);
|
|
109
115
|
}, 200);
|
|
110
116
|
};
|
|
111
|
-
return /* @__PURE__ */ r("div", { className: w("max-w-60",
|
|
112
|
-
|
|
117
|
+
return /* @__PURE__ */ r("div", { className: w("max-w-60", i), ...a, children: c || h ? /* @__PURE__ */ r(
|
|
118
|
+
B,
|
|
113
119
|
{
|
|
114
120
|
ref: e,
|
|
115
|
-
className: w("relative h-7.5", c && !
|
|
121
|
+
className: w("relative h-7.5", c && !h ? "animate-input-open" : "", h && "animate-input-close"),
|
|
116
122
|
onChange: (C) => d(C.target.value),
|
|
117
|
-
value:
|
|
118
|
-
startAdornment: /* @__PURE__ */ r(
|
|
119
|
-
endAdornment:
|
|
123
|
+
value: s,
|
|
124
|
+
startAdornment: /* @__PURE__ */ r(v, { variant: "toolbar", className: "p-0.5 h-6 w-6 border-none mx-1", onClick: g, children: /* @__PURE__ */ r(G, { className: "w-5 h-5" }) }),
|
|
125
|
+
endAdornment: s && /* @__PURE__ */ r(v, { variant: "toolbar", className: "p-0.5 w-6 h-6 border-none mx-1", onClick: m, children: /* @__PURE__ */ r(P, { className: "w-5 h-5" }) })
|
|
120
126
|
}
|
|
121
|
-
) : /* @__PURE__ */ r(
|
|
122
|
-
},
|
|
123
|
-
const d = t.useContext(
|
|
127
|
+
) : /* @__PURE__ */ r(v, { variant: "toolbar", className: "p-0.5 w-6 h-6 m-1", onClick: x, children: /* @__PURE__ */ r(G, { className: "w-5 h-5" }) }) });
|
|
128
|
+
}, ie = ({ freezeText: o, unFreezeText: i, onClick: a, disabled: n, ...s }) => {
|
|
129
|
+
const d = t.useContext(p);
|
|
124
130
|
if (!d)
|
|
125
131
|
throw new Error("FreezeAction should be used within <DataGrid>");
|
|
126
|
-
const [c,
|
|
132
|
+
const [c, u] = t.useState(0), [h, l] = t.useState(0), { api: e, rowData: m } = d, x = () => {
|
|
127
133
|
if (!e) return;
|
|
128
134
|
const f = e.getSelectedNodes();
|
|
129
135
|
if (f.length > 0) {
|
|
@@ -131,85 +137,86 @@ const M = T.withParams({
|
|
|
131
137
|
"pinnedTopRowData",
|
|
132
138
|
f.map((b) => b.data)
|
|
133
139
|
);
|
|
134
|
-
const
|
|
140
|
+
const D = e.getRenderedNodes().filter((b) => !f.some((S) => S.id === b.id));
|
|
135
141
|
e.setGridOption(
|
|
136
142
|
"rowData",
|
|
137
|
-
|
|
143
|
+
D.map((b) => b.data)
|
|
138
144
|
);
|
|
139
145
|
}
|
|
140
146
|
}, g = () => {
|
|
141
|
-
e && (e.setGridOption("pinnedTopRowData", []), e.setGridOption("rowData",
|
|
147
|
+
e && (e.setGridOption("pinnedTopRowData", []), e.setGridOption("rowData", m));
|
|
142
148
|
}, C = (f) => {
|
|
143
149
|
e && (e.getPinnedTopRowCount() > 0 ? g() : x()), a?.(f);
|
|
144
150
|
};
|
|
145
151
|
return t.useEffect(() => (e?.addEventListener("pinnedRowDataChanged", () => {
|
|
146
|
-
|
|
152
|
+
u(e.getPinnedTopRowCount());
|
|
147
153
|
}), e?.addEventListener("selectionChanged", () => {
|
|
148
|
-
|
|
154
|
+
l(e.getSelectedNodes().length);
|
|
149
155
|
}), () => {
|
|
150
156
|
e?.removeEventListener("pinnedRowDataChanged", () => {
|
|
151
|
-
|
|
157
|
+
u(e.getPinnedTopRowCount());
|
|
152
158
|
}), e?.removeEventListener("selectionChanged", () => {
|
|
153
|
-
|
|
159
|
+
l(e.getSelectedNodes().length);
|
|
154
160
|
});
|
|
155
161
|
}), [e]), /* @__PURE__ */ r(
|
|
156
162
|
E,
|
|
157
163
|
{
|
|
158
164
|
variant: "text",
|
|
159
165
|
onClick: C,
|
|
160
|
-
startIcon: /* @__PURE__ */ r(
|
|
161
|
-
disabled: !c && !
|
|
162
|
-
...
|
|
163
|
-
children: c ?
|
|
166
|
+
startIcon: /* @__PURE__ */ r(z, { className: "w-4.5 h-4.5" }),
|
|
167
|
+
disabled: !c && !h || n,
|
|
168
|
+
...s,
|
|
169
|
+
children: c ? i ?? "Unfreeze" : o ?? "Freeze"
|
|
164
170
|
}
|
|
165
171
|
);
|
|
166
|
-
},
|
|
167
|
-
const
|
|
168
|
-
if (!
|
|
172
|
+
}, ce = ({ children: o, className: i, onClick: a, ...n }) => {
|
|
173
|
+
const s = t.useContext(p);
|
|
174
|
+
if (!s)
|
|
169
175
|
throw new Error("PrintAction should be used within <DataGrid>");
|
|
170
176
|
const d = (c) => {
|
|
171
|
-
|
|
172
|
-
const
|
|
177
|
+
s.api && (s.api.setGridOption("domLayout", "print"), setTimeout(() => {
|
|
178
|
+
const u = document.querySelector("[grid-id='" + s.gridId + "']"), l = `<html>
|
|
173
179
|
${document.head.innerHTML}
|
|
174
|
-
${
|
|
180
|
+
${u.outerHTML}
|
|
175
181
|
</html>`;
|
|
176
|
-
|
|
182
|
+
M(l), s?.api?.setGridOption("domLayout", void 0);
|
|
177
183
|
})), a?.(c);
|
|
178
184
|
};
|
|
179
|
-
return /* @__PURE__ */ r(
|
|
180
|
-
},
|
|
181
|
-
if (!t.useContext(
|
|
185
|
+
return /* @__PURE__ */ r(v, { variant: "toolbar", className: w("p-0.5 w-6 h-6", i), onClick: d, ...n, children: o ?? /* @__PURE__ */ r(I, { className: "w-5 h-5" }) });
|
|
186
|
+
}, de = ({ className: o, onRefresh: i, children: a, loading: n, ...s }) => {
|
|
187
|
+
if (!t.useContext(p))
|
|
182
188
|
throw new Error("RefreshAction should be used within <DataGrid>");
|
|
183
189
|
const c = () => {
|
|
184
|
-
|
|
190
|
+
i();
|
|
185
191
|
};
|
|
186
192
|
return /* @__PURE__ */ r(
|
|
187
|
-
|
|
193
|
+
v,
|
|
188
194
|
{
|
|
189
195
|
className: w("p-0.5 w-6 h-6", n && "disabled:bg-transparent", o),
|
|
190
196
|
variant: "toolbar",
|
|
191
197
|
onClick: c,
|
|
192
198
|
disabled: n,
|
|
193
|
-
...
|
|
194
|
-
children: a ?? /* @__PURE__ */ r(
|
|
199
|
+
...s,
|
|
200
|
+
children: a ?? /* @__PURE__ */ r(H, { className: w("w-4.5 h-4.5", n && "animate-spin") })
|
|
195
201
|
}
|
|
196
202
|
);
|
|
197
|
-
},
|
|
203
|
+
}, le = ({ onDelete: o, children: i, ...a }) => /* @__PURE__ */ r(E, { variant: "danger", onClick: () => {
|
|
198
204
|
o();
|
|
199
|
-
}, startIcon: /* @__PURE__ */ r(
|
|
200
|
-
/* @__PURE__ */ r(
|
|
201
|
-
/* @__PURE__ */ r(
|
|
205
|
+
}, startIcon: /* @__PURE__ */ r(O, { className: "w-4.5 h-4.5" }), ...a, children: i }), ue = ({ children: o, slotProps: i, className: a, ...n }) => /* @__PURE__ */ A(Q, { ...i?.popoverProps ?? {}, children: [
|
|
206
|
+
/* @__PURE__ */ r(q, { ...i?.triggerProps ?? {}, children: /* @__PURE__ */ r(L, { className: "w-4.5 h-4.5 text-primary" }) }),
|
|
207
|
+
/* @__PURE__ */ r($, { align: "end", className: w("w-40", a), ...n, children: o })
|
|
202
208
|
] });
|
|
203
209
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
re as DataGrid,
|
|
211
|
+
ae as DataGridActionBar,
|
|
212
|
+
oe as DataGridContent,
|
|
213
|
+
le as DeleteAction,
|
|
214
|
+
ue as ExtraActions,
|
|
215
|
+
ie as FreezeAction,
|
|
216
|
+
ce as PrintAction,
|
|
217
|
+
de as RefreshAction,
|
|
218
|
+
se as SearchAction,
|
|
219
|
+
j as defaultTheme,
|
|
220
|
+
ne as useDataGrid
|
|
214
221
|
};
|
|
215
222
|
//# sourceMappingURL=datagrid.es.js.map
|