@gears-frontx/ui-kit 0.4.7 → 0.4.9
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/chunks/data-grid-portal-container-context.js +10 -0
- package/dist/chunks/data-grid-portal-container-context.js.map +1 -0
- package/dist/components/data-grid/data-grid-types.d.ts +10 -0
- package/dist/components/data-grid/data-grid-types.d.ts.map +1 -1
- package/dist/components/data-grid/data-grid.d.ts +1 -1
- package/dist/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/filters/components/adaptive-popover.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/filters/components/all-filters-button.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/order/components/data-grid-order-button.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.d.ts.map +1 -1
- package/dist/components/data-grid/services/core/data-grid-portal-container-context.d.ts +9 -0
- package/dist/components/data-grid/services/core/data-grid-portal-container-context.d.ts.map +1 -0
- package/dist/data-grid/actions-menu.js +99 -98
- package/dist/data-grid/actions-menu.js.map +1 -1
- package/dist/data-grid/filters.js +369 -366
- package/dist/data-grid/filters.js.map +1 -1
- package/dist/data-grid/order.js +111 -110
- package/dist/data-grid/order.js.map +1 -1
- package/dist/data-grid/table-configuration.js +49 -37
- package/dist/data-grid/table-configuration.js.map +1 -1
- package/dist/data-grid.js +462 -460
- package/dist/data-grid.js.map +1 -1
- package/dist/docs/data-grid.md +29 -4
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-grid-portal-container-context.js","sources":["../../src/components/data-grid/services/core/data-grid-portal-container-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport type { PopoverContentProps } from '../../../popover/public.js';\n\ntype PortalContainer = PopoverContentProps['container'];\n\n/*\n * Where the grid's popups portal, as passed to `DataGrid`'s `portalContainer` prop. Every popup\n * the grid and its plugins open hands it to its `*Content` as `container`. A context rather than a\n * grid store for the same reason as the label: it is read at render time only, and nothing\n * loads, persists or writes it from a second place.\n *\n * `undefined` is what a grid without the prop provides, and the popups then portal to <body>,\n * as they did before the prop existed.\n */\nconst DataGridPortalContainerContext = createContext<PortalContainer>(undefined);\n\nexport const DataGridPortalContainerProvider = DataGridPortalContainerContext.Provider;\n\n/**\n * The grid's `portalContainer` prop, or `undefined` when the grid has none.\n */\nexport function useDataGridPortalContainer(): PortalContainer {\n return useContext(DataGridPortalContainerContext);\n}\n"],"names":["DataGridPortalContainerContext","createContext","DataGridPortalContainerProvider","useDataGridPortalContainer","useContext"],"mappings":";AAeA,MAAMA,IAAiCC,EAA+B,MAAS,GAElEC,IAAkCF,EAA+B;AAKvE,SAASG,IAA8C;AAC5D,SAAOC,EAAWJ,CAA8B;AAClD;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { PopoverContentProps } from '../popover/public.js';
|
|
2
3
|
import { CoreService } from './services/core/core-types';
|
|
3
4
|
import { DataGridHooked } from './services/hooked/hooked-types';
|
|
4
5
|
import { internalContextKey } from './services/internal/internal-helpers';
|
|
@@ -124,6 +125,15 @@ export interface DataGridProps<TItem extends DataGridItem> extends Pick<DataGrid
|
|
|
124
125
|
* reads as absent. It is a spoken name, not the storage key `name`, and it is never persisted.
|
|
125
126
|
*/
|
|
126
127
|
label?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Where the popups the grid and its plugins open are portaled: the filter popovers and their
|
|
130
|
+
* narrow-screen panel, the all-filters panel, the sort and table configuration popovers, and the
|
|
131
|
+
* actions menu. Defaults to <body>. Pass a node inside a shadow root when the kit's CSS is
|
|
132
|
+
* injected only there, or a themed container when the theme is scoped to a subtree, so the
|
|
133
|
+
* popups get the kit's styles and the theme's tokens. A popup a consumer component opens inside
|
|
134
|
+
* the grid, such as a row actions menu, takes its own `container`.
|
|
135
|
+
*/
|
|
136
|
+
portalContainer?: PopoverContentProps['container'];
|
|
127
137
|
children?: ReactNode;
|
|
128
138
|
}
|
|
129
139
|
export interface InternalContext<TItem extends DataGridItem> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-types.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/data-grid-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACb,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;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AI,CAAC,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CAAC,GACnD,CAAC,CAAC,KAAK,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EACtC,IAAI,EAAE,KAAK,KACR,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;CAC9C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DataGridItem, DataGridProps } from './data-grid-types';
|
|
2
|
-
export declare function DataGrid<TItem extends DataGridItem = DataGridItem>({ name, load, columns, children, persistent, persistentColumnVisibility, tableLayout, stickyHeader, loading, implicitFilterKeys, label, }: DataGridProps<TItem>): import("react").JSX.Element;
|
|
2
|
+
export declare function DataGrid<TItem extends DataGridItem = DataGridItem>({ name, load, columns, children, persistent, persistentColumnVisibility, tableLayout, stickyHeader, loading, implicitFilterKeys, label, portalContainer, }: DataGridProps<TItem>): import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=data-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/data-grid.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../src/components/data-grid/data-grid.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AASrE,wBAAgB,QAAQ,CAAC,KAAK,SAAS,YAAY,GAAG,YAAY,EAAE,EAClE,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,0BAA0B,EAC1B,WAAqB,EACrB,YAAoB,EACpB,OAAe,EACf,kBAAkB,EAClB,KAAK,EACL,eAAe,GAChB,EAAE,aAAa,CAAC,KAAK,CAAC,+BAwDtB"}
|
package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-actions-menu.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"data-grid-actions-menu.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.tsx"],"names":[],"mappings":";AAaA,wBAAgB,mBAAmB,gCAyBlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptive-popover.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/filters/components/adaptive-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"adaptive-popover.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/filters/components/adaptive-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOrD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,uEAAuE;IACvE,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,aAAa,EACb,QAAQ,GACT,EAAE,oBAAoB,+BAqBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-filters-button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/filters/components/all-filters-button.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"all-filters-button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/filters/components/all-filters-button.tsx"],"names":[],"mappings":";AAaA,wBAAgB,gBAAgB,gCAkD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-order-button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/order/components/data-grid-order-button.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"data-grid-order-button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/order/components/data-grid-order-button.tsx"],"names":[],"mappings":";AAqBA,wBAAgB,mBAAmB,uCAsGlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-table-configuration-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"data-grid-table-configuration-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.tsx"],"names":[],"mappings":";AASA,wBAAgB,iCAAiC,gCA0BhD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PopoverContentProps } from '../../../popover/public.js';
|
|
2
|
+
type PortalContainer = PopoverContentProps['container'];
|
|
3
|
+
export declare const DataGridPortalContainerProvider: import('react').Provider<HTMLElement | ShadowRoot | import('react').RefObject<HTMLElement | ShadowRoot | null> | null | undefined>;
|
|
4
|
+
/**
|
|
5
|
+
* The grid's `portalContainer` prop, or `undefined` when the grid has none.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useDataGridPortalContainer(): PortalContainer;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=data-grid-portal-container-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-grid-portal-container-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-grid/services/core/data-grid-portal-container-context.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,KAAK,eAAe,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAaxD,eAAO,MAAM,+BAA+B,oIAA0C,CAAC;AAEvF;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,eAAe,CAE5D"}
|
|
@@ -4,17 +4,18 @@ import { u as L, c as j, a as A } from "../chunks/plugins-helpers.js";
|
|
|
4
4
|
import { jsxs as M, jsx as w } from "react/jsx-runtime";
|
|
5
5
|
import { EllipsisIcon as B, ArrowDownToLineIcon as N } from "lucide-react";
|
|
6
6
|
import { m as y } from "../chunks/messages.js";
|
|
7
|
-
import {
|
|
7
|
+
import { u as $ } from "../chunks/data-grid-portal-container-context.js";
|
|
8
|
+
import { DropdownMenu as F, DropdownMenuTrigger as G, DropdownMenuContent as J, DropdownMenuItem as O } from "../dropdown-menu.js";
|
|
8
9
|
import { Button as W } from "../button.js";
|
|
9
|
-
import { useState as
|
|
10
|
-
import { a as
|
|
11
|
-
import { u as
|
|
12
|
-
import { i as
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */ M(
|
|
10
|
+
import { useState as H } from "react";
|
|
11
|
+
import { a as U } from "../chunks/table-helpers.js";
|
|
12
|
+
import { u as Q } from "../chunks/table-context.js";
|
|
13
|
+
import { i as z } from "../chunks/is-record.js";
|
|
14
|
+
function Z() {
|
|
15
|
+
const a = L().getPlugin("actionsMenu").useMenuItems(), i = $();
|
|
16
|
+
return /* @__PURE__ */ M(F, { children: [
|
|
16
17
|
/* @__PURE__ */ w(
|
|
17
|
-
|
|
18
|
+
G,
|
|
18
19
|
{
|
|
19
20
|
render: /* @__PURE__ */ w(
|
|
20
21
|
W,
|
|
@@ -27,23 +28,23 @@ function z() {
|
|
|
27
28
|
)
|
|
28
29
|
}
|
|
29
30
|
),
|
|
30
|
-
/* @__PURE__ */ w(J, { side: "bottom", align: "end", children:
|
|
31
|
+
/* @__PURE__ */ w(J, { side: "bottom", align: "end", container: i, children: a.map((u) => /* @__PURE__ */ w(u.component, { params: u.params }, u.id)) })
|
|
31
32
|
] });
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
+
const xe = j("actionsMenu", (e) => {
|
|
34
35
|
const o = T(() => ({
|
|
35
36
|
menuItems: []
|
|
36
37
|
}));
|
|
37
38
|
return e.registerSlot("top-end", {
|
|
38
39
|
id: "actionsMenu",
|
|
39
|
-
component:
|
|
40
|
+
component: Z,
|
|
40
41
|
order: 100
|
|
41
42
|
}), {
|
|
42
|
-
registerMenuItem:
|
|
43
|
+
registerMenuItem: u,
|
|
43
44
|
useMenuItems: () => o((p) => p.menuItems),
|
|
44
45
|
onPropsChange: f
|
|
45
46
|
};
|
|
46
|
-
function
|
|
47
|
+
function u(p) {
|
|
47
48
|
const g = Math.random().toString(), t = o.getState().menuItems, n = p.order ?? (t.length + 1) * 10, s = { id: g, ...p, order: n }, c = [...t, s].sort((l, r) => l.order - r.order);
|
|
48
49
|
o.setState({ menuItems: c });
|
|
49
50
|
}
|
|
@@ -56,42 +57,42 @@ const me = j("actionsMenu", (e) => {
|
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
59
|
function R(e, o) {
|
|
59
|
-
const
|
|
60
|
-
let
|
|
61
|
-
return o.formatter ?
|
|
60
|
+
const a = o.key ? e[o.key] : e[o.id];
|
|
61
|
+
let i;
|
|
62
|
+
return o.formatter ? i = o.formatter(a) : i = String(a ?? ""), { raw: a, formatted: i };
|
|
62
63
|
}
|
|
63
64
|
function C({
|
|
64
65
|
item: e,
|
|
65
66
|
column: o,
|
|
66
|
-
cellValue:
|
|
67
|
-
transformCellText:
|
|
68
|
-
gridContext:
|
|
67
|
+
cellValue: a,
|
|
68
|
+
transformCellText: i,
|
|
69
|
+
gridContext: u
|
|
69
70
|
}) {
|
|
70
|
-
const f =
|
|
71
|
+
const f = i == null ? void 0 : i[o.id];
|
|
71
72
|
return f ? f(
|
|
72
73
|
{
|
|
73
|
-
value:
|
|
74
|
-
formattedValue:
|
|
74
|
+
value: a.raw,
|
|
75
|
+
formattedValue: a.formatted,
|
|
75
76
|
row: e
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
-
) :
|
|
78
|
+
u
|
|
79
|
+
) : a.formatted;
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
-
const { data: o, columns:
|
|
81
|
+
const q = (e) => {
|
|
82
|
+
const { data: o, columns: a, options: i, gridContext: u } = e, f = i.delimiter || ",", p = i.includeHeaders ?? !0, g = [];
|
|
82
83
|
if (p) {
|
|
83
|
-
const t =
|
|
84
|
+
const t = a.map((n) => v(n.label, f)).join(f);
|
|
84
85
|
g.push(t);
|
|
85
86
|
}
|
|
86
87
|
for (const t of o) {
|
|
87
88
|
const n = [];
|
|
88
|
-
for (const s of
|
|
89
|
+
for (const s of a) {
|
|
89
90
|
const c = R(t, s), l = C({
|
|
90
91
|
item: t,
|
|
91
92
|
column: s,
|
|
92
93
|
cellValue: c,
|
|
93
|
-
transformCellText:
|
|
94
|
-
gridContext:
|
|
94
|
+
transformCellText: i.transformCellText,
|
|
95
|
+
gridContext: u
|
|
95
96
|
});
|
|
96
97
|
n.push(v(l, f));
|
|
97
98
|
}
|
|
@@ -101,40 +102,40 @@ const Z = (e) => {
|
|
|
101
102
|
`));
|
|
102
103
|
}, S = /^[=+\-@\t\r]/;
|
|
103
104
|
function v(e, o) {
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
`) ||
|
|
107
|
-
const
|
|
108
|
-
return `"${S.test(
|
|
105
|
+
const a = String(e ?? "");
|
|
106
|
+
if (a.includes(o) || a.includes(`
|
|
107
|
+
`) || a.includes('"') || S.test(a)) {
|
|
108
|
+
const u = a.replace(/"/g, '""');
|
|
109
|
+
return `"${S.test(a) ? " " : ""}${u}"`;
|
|
109
110
|
}
|
|
110
|
-
return
|
|
111
|
+
return a;
|
|
111
112
|
}
|
|
112
|
-
const
|
|
113
|
-
const { data: o, columns:
|
|
114
|
-
if (!
|
|
113
|
+
const K = async (e) => {
|
|
114
|
+
const { data: o, columns: a, options: i, gridContext: u } = e;
|
|
115
|
+
if (!i.loadExcelJs)
|
|
115
116
|
throw new Error(
|
|
116
117
|
"Exporting to Excel needs `loadExcelJs`, a function that loads the exceljs package: the grid does not import it itself."
|
|
117
118
|
);
|
|
118
|
-
const f =
|
|
119
|
+
const f = Y(await i.loadExcelJs()), p = new f.Workbook(), g = p.addWorksheet(i.sheetName), t = i.includeHeaders ?? !0;
|
|
119
120
|
let n = 1;
|
|
120
121
|
if (t) {
|
|
121
122
|
const c = g.getRow(n);
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
123
|
+
a.forEach((l, r) => {
|
|
124
|
+
const d = c.getCell(r + 1);
|
|
125
|
+
d.value = l.label;
|
|
125
126
|
}), n++;
|
|
126
127
|
}
|
|
127
128
|
for (const c of o) {
|
|
128
129
|
const l = g.getRow(n);
|
|
129
|
-
for (const [r,
|
|
130
|
-
const m = R(c,
|
|
130
|
+
for (const [r, d] of a.entries()) {
|
|
131
|
+
const m = R(c, d), x = C({
|
|
131
132
|
item: c,
|
|
132
|
-
column:
|
|
133
|
+
column: d,
|
|
133
134
|
cellValue: m,
|
|
134
|
-
transformCellText:
|
|
135
|
-
gridContext:
|
|
135
|
+
transformCellText: i.transformCellText,
|
|
136
|
+
gridContext: u
|
|
136
137
|
}), h = l.getCell(r + 1);
|
|
137
|
-
h.value =
|
|
138
|
+
h.value = _(m.raw, x);
|
|
138
139
|
}
|
|
139
140
|
n++;
|
|
140
141
|
}
|
|
@@ -143,16 +144,16 @@ const q = async (e) => {
|
|
|
143
144
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
144
145
|
});
|
|
145
146
|
};
|
|
146
|
-
function
|
|
147
|
+
function X(e) {
|
|
147
148
|
return "default" in e && !!e.default;
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
-
const o =
|
|
150
|
+
function Y(e) {
|
|
151
|
+
const o = X(e) ? e.default : e;
|
|
151
152
|
if (typeof o.Workbook != "function")
|
|
152
153
|
throw new Error("`loadExcelJs` has to resolve to the exceljs package, which exports `Workbook`.");
|
|
153
154
|
return o;
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
+
function _(e, o) {
|
|
156
157
|
if (o !== String(e ?? ""))
|
|
157
158
|
return o;
|
|
158
159
|
if (e == null)
|
|
@@ -161,33 +162,33 @@ function Y(e, o) {
|
|
|
161
162
|
return e;
|
|
162
163
|
if (typeof e == "string") {
|
|
163
164
|
if (/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e)) {
|
|
164
|
-
const
|
|
165
|
-
if (!isNaN(
|
|
166
|
-
return
|
|
165
|
+
const u = new Date(e);
|
|
166
|
+
if (!isNaN(u.getTime()))
|
|
167
|
+
return u;
|
|
167
168
|
}
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
return Number(
|
|
169
|
+
const i = e.trim();
|
|
170
|
+
if (i !== "" && !isNaN(Number(i)) && !/[eE]/.test(i) && !(i.length > 1 && i.startsWith("0") && i[1] !== "."))
|
|
171
|
+
return Number(i);
|
|
171
172
|
}
|
|
172
173
|
return String(e);
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
+
function V() {
|
|
175
176
|
return {
|
|
176
177
|
exportToCSV: e,
|
|
177
178
|
exportToExcel: o,
|
|
178
|
-
downloadFile:
|
|
179
|
-
getAllData:
|
|
179
|
+
downloadFile: a,
|
|
180
|
+
getAllData: i
|
|
180
181
|
};
|
|
181
182
|
async function e(t, n, s, c) {
|
|
182
183
|
const l = { ...s, format: "csv" };
|
|
183
184
|
try {
|
|
184
|
-
const r = await
|
|
185
|
+
const r = await q({
|
|
185
186
|
data: t,
|
|
186
187
|
columns: n,
|
|
187
188
|
options: l,
|
|
188
189
|
gridContext: c
|
|
189
|
-
}),
|
|
190
|
-
|
|
190
|
+
}), d = E(s.filename, "csv");
|
|
191
|
+
a(r, d, "text/csv");
|
|
191
192
|
} catch (r) {
|
|
192
193
|
if (s.onError)
|
|
193
194
|
s.onError(I(r));
|
|
@@ -198,15 +199,15 @@ function _() {
|
|
|
198
199
|
async function o(t, n, s, c) {
|
|
199
200
|
const l = { ...s, format: "xlsx" };
|
|
200
201
|
try {
|
|
201
|
-
const r = await
|
|
202
|
+
const r = await K({
|
|
202
203
|
data: t,
|
|
203
204
|
columns: n,
|
|
204
205
|
options: l,
|
|
205
206
|
gridContext: c
|
|
206
|
-
}),
|
|
207
|
-
|
|
207
|
+
}), d = E(s.filename, "xlsx");
|
|
208
|
+
a(
|
|
208
209
|
r,
|
|
209
|
-
|
|
210
|
+
d,
|
|
210
211
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
211
212
|
);
|
|
212
213
|
} catch (r) {
|
|
@@ -216,25 +217,25 @@ function _() {
|
|
|
216
217
|
throw r;
|
|
217
218
|
}
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
+
function a(t, n, s) {
|
|
220
221
|
const c = t instanceof Blob ? t : new Blob([t], { type: s }), l = URL.createObjectURL(c), r = document.createElement("a");
|
|
221
222
|
r.href = l, r.download = n, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(l);
|
|
222
223
|
}
|
|
223
|
-
async function
|
|
224
|
+
async function i(t) {
|
|
224
225
|
const n = t.getPlugin("pagination"), s = t.getPlugin("tableTree");
|
|
225
|
-
return s && n ? await f(t, s, n) : s ? await
|
|
226
|
+
return s && n ? await f(t, s, n) : s ? await u(t, s) : n ? await g(t, n) : t.useStore.getState().visibleRecords.map((l) => l.item);
|
|
226
227
|
}
|
|
227
|
-
async function
|
|
228
|
+
async function u(t, n) {
|
|
228
229
|
const s = [], c = /* @__PURE__ */ new Set(), l = t.useStore.getState().visibleRecords;
|
|
229
230
|
return await p(t, l, s, c, n), s;
|
|
230
231
|
}
|
|
231
232
|
async function f(t, n, s) {
|
|
232
233
|
const c = { page: s.getPage(), limit: s.getLimit() }, l = [], r = /* @__PURE__ */ new Set();
|
|
233
|
-
let
|
|
234
|
+
let d = 1, m = !0;
|
|
234
235
|
for (; m; ) {
|
|
235
236
|
const x = t.triggerLoad({
|
|
236
237
|
loadContext: {
|
|
237
|
-
pagination: { ...c, page:
|
|
238
|
+
pagination: { ...c, page: d },
|
|
238
239
|
tree: { parentId: null }
|
|
239
240
|
},
|
|
240
241
|
store: !1
|
|
@@ -248,7 +249,7 @@ function _() {
|
|
|
248
249
|
id: t.getItemId(b),
|
|
249
250
|
item: b,
|
|
250
251
|
index: P,
|
|
251
|
-
section:
|
|
252
|
+
section: ee()
|
|
252
253
|
}));
|
|
253
254
|
await p(
|
|
254
255
|
t,
|
|
@@ -256,7 +257,7 @@ function _() {
|
|
|
256
257
|
l,
|
|
257
258
|
r,
|
|
258
259
|
n
|
|
259
|
-
),
|
|
260
|
+
), d++, h.length < c.limit && (m = !1);
|
|
260
261
|
}
|
|
261
262
|
} else
|
|
262
263
|
m = !1;
|
|
@@ -286,22 +287,22 @@ function _() {
|
|
|
286
287
|
const s = { page: n.getPage(), limit: n.getLimit() }, c = [];
|
|
287
288
|
let l = 1, r = !0;
|
|
288
289
|
for (; r; ) {
|
|
289
|
-
const
|
|
290
|
+
const d = t.triggerLoad({
|
|
290
291
|
loadContext: {
|
|
291
292
|
pagination: { ...s, page: l }
|
|
292
293
|
},
|
|
293
294
|
store: !1
|
|
294
295
|
});
|
|
295
|
-
if (await
|
|
296
|
-
const m =
|
|
297
|
-
m.length === 0 ? r = !1 : (c.push(...m), l++, m.length < s.limit && (r = !1),
|
|
296
|
+
if (await d.promise, d.processResult) {
|
|
297
|
+
const m = d.processResult.results;
|
|
298
|
+
m.length === 0 ? r = !1 : (c.push(...m), l++, m.length < s.limit && (r = !1), d.processResult.total && c.length >= d.processResult.total && (r = !1));
|
|
298
299
|
} else
|
|
299
300
|
r = !1;
|
|
300
301
|
}
|
|
301
302
|
return c;
|
|
302
303
|
}
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
+
function ee() {
|
|
305
306
|
return { id: "", visible: !0, loadContext: {}, parentId: null, records: [] };
|
|
306
307
|
}
|
|
307
308
|
function I(e) {
|
|
@@ -310,27 +311,27 @@ function I(e) {
|
|
|
310
311
|
function E(e, o) {
|
|
311
312
|
return typeof e == "function" ? e() : typeof e == "string" ? e.endsWith(`.${o}`) ? e : `${e}.${o}` : `${(/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-")}.${o}`;
|
|
312
313
|
}
|
|
313
|
-
function ee(e) {
|
|
314
|
-
return e === "csv" || e === "xlsx";
|
|
315
|
-
}
|
|
316
314
|
function te(e) {
|
|
317
|
-
return
|
|
315
|
+
return e === "csv" || e === "xlsx";
|
|
318
316
|
}
|
|
319
317
|
function oe(e) {
|
|
320
|
-
|
|
318
|
+
return z(e);
|
|
319
|
+
}
|
|
320
|
+
function ne(e) {
|
|
321
|
+
if (!(!e || !te(e.type)))
|
|
321
322
|
return {
|
|
322
323
|
type: e.type,
|
|
323
|
-
exportConfig:
|
|
324
|
+
exportConfig: oe(e.exportConfig) ? e.exportConfig : void 0
|
|
324
325
|
};
|
|
325
326
|
}
|
|
326
327
|
function D({ params: e }) {
|
|
327
|
-
const o =
|
|
328
|
+
const o = ne(e), a = A(), i = Q(), [u, f] = H(!1), p = i.useVisibleColumns(), g = (o == null ? void 0 : o.type) === "csv" ? "CSV" : "Excel";
|
|
328
329
|
async function t() {
|
|
329
|
-
if (!(
|
|
330
|
+
if (!(u || !o)) {
|
|
330
331
|
f(!0);
|
|
331
332
|
try {
|
|
332
|
-
const n =
|
|
333
|
-
const x =
|
|
333
|
+
const n = V(), s = await n.getAllData(a), c = p.map((m) => {
|
|
334
|
+
const x = U(m.label);
|
|
334
335
|
return {
|
|
335
336
|
id: m.id,
|
|
336
337
|
label: x,
|
|
@@ -346,7 +347,7 @@ function D({ params: e }) {
|
|
|
346
347
|
},
|
|
347
348
|
...o.exportConfig
|
|
348
349
|
};
|
|
349
|
-
await (o.type === "csv" ? n.exportToCSV : n.exportToExcel)(s, c, r,
|
|
350
|
+
await (o.type === "csv" ? n.exportToCSV : n.exportToExcel)(s, c, r, a);
|
|
350
351
|
} catch (n) {
|
|
351
352
|
console.error("Export failed:", n);
|
|
352
353
|
} finally {
|
|
@@ -354,12 +355,12 @@ function D({ params: e }) {
|
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
357
|
}
|
|
357
|
-
return /* @__PURE__ */ M(O, { disabled:
|
|
358
|
+
return /* @__PURE__ */ M(O, { disabled: u, onClick: t, children: [
|
|
358
359
|
/* @__PURE__ */ w(N, {}),
|
|
359
360
|
y.exportMenuItem.exportAs(g)
|
|
360
361
|
] });
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
+
function he(e) {
|
|
363
364
|
const o = {
|
|
364
365
|
component: D,
|
|
365
366
|
params: { type: "csv", exportConfig: e }
|
|
@@ -367,7 +368,7 @@ function ge(e) {
|
|
|
367
368
|
return e != null && e.loadExcelJs ? [{ component: D, params: { type: "xlsx", exportConfig: e } }, o] : [o];
|
|
368
369
|
}
|
|
369
370
|
export {
|
|
370
|
-
|
|
371
|
-
|
|
371
|
+
xe as DataGridActionsMenuPlugin,
|
|
372
|
+
he as exportMenuItems
|
|
372
373
|
};
|
|
373
374
|
//# sourceMappingURL=actions-menu.js.map
|