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