@conboai/storybook.components 0.3.99 → 0.4.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.
|
@@ -19,6 +19,8 @@ export interface CustomDataGridProps {
|
|
|
19
19
|
hideFooter?: boolean;
|
|
20
20
|
selectedRowId?: string | number;
|
|
21
21
|
onRowIdSelect?: (value: number | null | string) => void;
|
|
22
|
+
csvFileName?: string;
|
|
23
|
+
csvHeaders?: string[];
|
|
22
24
|
}
|
|
23
25
|
declare const CustomDataGrid: FC<CustomDataGridProps>;
|
|
24
26
|
export default CustomDataGrid;
|
|
@@ -97135,34 +97135,36 @@ const A3e = $me, D3e = (e, t) => ({
|
|
|
97135
97135
|
total: b,
|
|
97136
97136
|
hideFooter: g = !1,
|
|
97137
97137
|
selectedRowId: p,
|
|
97138
|
-
onRowIdSelect: m
|
|
97138
|
+
onRowIdSelect: m,
|
|
97139
|
+
csvFileName: v = "table_data.csv",
|
|
97140
|
+
csvHeaders: y
|
|
97139
97141
|
}) => {
|
|
97140
|
-
const [
|
|
97142
|
+
const [C, E] = $e({
|
|
97141
97143
|
page: 0,
|
|
97142
97144
|
pageSize: i[0]
|
|
97143
|
-
}), [
|
|
97144
|
-
(
|
|
97145
|
-
|
|
97145
|
+
}), [w, k] = $e([]), L = A3e(), _ = Tr(
|
|
97146
|
+
(M) => {
|
|
97147
|
+
k(M), u && u(M);
|
|
97146
97148
|
},
|
|
97147
97149
|
[u]
|
|
97148
|
-
),
|
|
97149
|
-
(
|
|
97150
|
-
if (
|
|
97151
|
-
const
|
|
97152
|
-
previousPage:
|
|
97150
|
+
), B = Tr(
|
|
97151
|
+
(M) => {
|
|
97152
|
+
if (E(M), d) {
|
|
97153
|
+
const x = {
|
|
97154
|
+
previousPage: C.page
|
|
97153
97155
|
};
|
|
97154
|
-
d(
|
|
97156
|
+
d(M, x);
|
|
97155
97157
|
}
|
|
97156
97158
|
},
|
|
97157
|
-
[d,
|
|
97158
|
-
),
|
|
97159
|
-
const
|
|
97160
|
-
` + t.map((
|
|
97161
|
-
`),
|
|
97162
|
-
|
|
97163
|
-
},
|
|
97164
|
-
m && m(null), h && h(
|
|
97165
|
-
},
|
|
97159
|
+
[d, C.page]
|
|
97160
|
+
), O = () => {
|
|
97161
|
+
const x = "data:text/csv;charset=utf-8," + (y || e.map((P) => P.headerName)).join(",") + `
|
|
97162
|
+
` + t.map((P) => e.map((V) => P[V.field]).join(",")).join(`
|
|
97163
|
+
`), T = encodeURI(x), R = document.createElement("a");
|
|
97164
|
+
R.setAttribute("href", T), R.setAttribute("download", v), document.body.appendChild(R), R.click();
|
|
97165
|
+
}, D = (M) => {
|
|
97166
|
+
m && m(null), h && h(M, event);
|
|
97167
|
+
}, I = () => !g && /* @__PURE__ */ H.jsxs(
|
|
97166
97168
|
ey,
|
|
97167
97169
|
{
|
|
97168
97170
|
sx: {
|
|
@@ -97176,7 +97178,7 @@ const A3e = $me, D3e = (e, t) => ({
|
|
|
97176
97178
|
Rr,
|
|
97177
97179
|
{
|
|
97178
97180
|
variant: "text",
|
|
97179
|
-
onClick:
|
|
97181
|
+
onClick: O,
|
|
97180
97182
|
disabled: !t.length,
|
|
97181
97183
|
children: /* @__PURE__ */ H.jsxs(
|
|
97182
97184
|
en,
|
|
@@ -97215,12 +97217,12 @@ const A3e = $me, D3e = (e, t) => ({
|
|
|
97215
97217
|
{
|
|
97216
97218
|
rowsPerPageOptions: i,
|
|
97217
97219
|
count: c,
|
|
97218
|
-
page:
|
|
97219
|
-
onPageChange: (
|
|
97220
|
-
rowsPerPage:
|
|
97221
|
-
onRowsPerPageChange: (
|
|
97222
|
-
...
|
|
97223
|
-
pageSize: parseInt(
|
|
97220
|
+
page: C.page,
|
|
97221
|
+
onPageChange: (M, x) => E((T) => ({ ...T, page: x })),
|
|
97222
|
+
rowsPerPage: C.pageSize,
|
|
97223
|
+
onRowsPerPageChange: (M) => E((x) => ({
|
|
97224
|
+
...x,
|
|
97225
|
+
pageSize: parseInt(M.target.value, 10)
|
|
97224
97226
|
}))
|
|
97225
97227
|
}
|
|
97226
97228
|
) : /* @__PURE__ */ H.jsxs(
|
|
@@ -97243,10 +97245,10 @@ const A3e = $me, D3e = (e, t) => ({
|
|
|
97243
97245
|
);
|
|
97244
97246
|
return Pe(() => {
|
|
97245
97247
|
if (p) {
|
|
97246
|
-
const
|
|
97247
|
-
|
|
97248
|
+
const M = t.findIndex((x) => x.id === p);
|
|
97249
|
+
M >= 0 && L.current.scrollToIndexes({ rowIndex: M });
|
|
97248
97250
|
}
|
|
97249
|
-
}, [p, t,
|
|
97251
|
+
}, [p, t, L]), /* @__PURE__ */ H.jsx(bo, { sx: D3e(a, l), children: /* @__PURE__ */ H.jsx(
|
|
97250
97252
|
R3e,
|
|
97251
97253
|
{
|
|
97252
97254
|
rows: t,
|
|
@@ -97255,22 +97257,22 @@ const A3e = $me, D3e = (e, t) => ({
|
|
|
97255
97257
|
columns: e,
|
|
97256
97258
|
paginationMode: r ? "server" : void 0,
|
|
97257
97259
|
sortingMode: "server",
|
|
97258
|
-
paginationModel:
|
|
97260
|
+
paginationModel: C,
|
|
97259
97261
|
rowCount: c,
|
|
97260
97262
|
pagination: r,
|
|
97261
|
-
onPaginationModelChange: r ?
|
|
97262
|
-
sortModel:
|
|
97263
|
+
onPaginationModelChange: r ? B : void 0,
|
|
97264
|
+
sortModel: w,
|
|
97263
97265
|
disableRowSelectionOnClick: !0,
|
|
97264
|
-
onSortModelChange:
|
|
97265
|
-
onRowClick:
|
|
97266
|
+
onSortModelChange: _,
|
|
97267
|
+
onRowClick: D,
|
|
97266
97268
|
slots: {
|
|
97267
|
-
footer:
|
|
97269
|
+
footer: I
|
|
97268
97270
|
},
|
|
97269
97271
|
loading: n,
|
|
97270
97272
|
sx: O3e(a, l),
|
|
97271
97273
|
onRowsScrollEnd: r ? void 0 : f,
|
|
97272
|
-
getRowClassName: (
|
|
97273
|
-
apiRef:
|
|
97274
|
+
getRowClassName: (M) => M.id === p ? "Mui-selected" : "",
|
|
97275
|
+
apiRef: L
|
|
97274
97276
|
}
|
|
97275
97277
|
) });
|
|
97276
97278
|
}, Oye = ({
|