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