@conboai/storybook.components 0.3.63 → 0.3.64

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.
@@ -17,6 +17,8 @@ export interface CustomDataGridProps {
17
17
  onRowsScrollEnd?: () => void;
18
18
  total?: number;
19
19
  hideFooter?: boolean;
20
+ selectedRowId?: string | number;
21
+ onRowIdSelect?: (value: number | null | string) => void;
20
22
  }
21
23
  declare const CustomDataGrid: FC<CustomDataGridProps>;
22
24
  export default CustomDataGrid;
@@ -96973,34 +96973,35 @@ const Dve = (e, t) => ({
96973
96973
  onRowsScrollEnd: h,
96974
96974
  total: m,
96975
96975
  hideFooter: g = !1,
96976
- ...A
96976
+ selectedRowId: A,
96977
+ onRowIdSelect: p
96977
96978
  }) => {
96978
- const [p, w] = Ye({
96979
+ const [w, C] = Ye({
96979
96980
  page: 0,
96980
96981
  pageSize: s[0]
96981
- }), [C, y] = Ye([]), [D, v] = Ye(null), B = Sr(
96982
- (j) => {
96983
- y(j), u && u(j);
96982
+ }), [y, D] = Ye([]), v = Sr(
96983
+ (L) => {
96984
+ D(L), u && u(L);
96984
96985
  },
96985
96986
  [u]
96986
- ), M = Sr(
96987
- (j) => {
96988
- if (w(j), d) {
96989
- const I = {
96990
- previousPage: p.page
96987
+ ), B = Sr(
96988
+ (L) => {
96989
+ if (C(L), d) {
96990
+ const j = {
96991
+ previousPage: w.page
96991
96992
  };
96992
- d(j, I);
96993
+ d(L, j);
96993
96994
  }
96994
96995
  },
96995
- [d, p.page]
96996
- ), H = () => {
96997
- const j = "data:text/csv;charset=utf-8," + e.map((x) => x.headerName).join(",") + `
96998
- ` + t.map((x) => e.map((P) => x[P.field]).join(",")).join(`
96999
- `), I = encodeURI(j), E = document.createElement("a");
97000
- E.setAttribute("href", I), E.setAttribute("download", "table_data.csv"), document.body.appendChild(E), E.click();
97001
- }, Q = (j) => {
97002
- v(j.id), f && f(j, event);
97003
- }, L = () => !g && /* @__PURE__ */ N.jsxs(
96996
+ [d, w.page]
96997
+ ), M = () => {
96998
+ const L = "data:text/csv;charset=utf-8," + e.map((E) => E.headerName).join(",") + `
96999
+ ` + t.map((E) => e.map((x) => E[x.field]).join(",")).join(`
97000
+ `), j = encodeURI(L), I = document.createElement("a");
97001
+ I.setAttribute("href", j), I.setAttribute("download", "table_data.csv"), document.body.appendChild(I), I.click();
97002
+ }, H = (L) => {
97003
+ p && p(null), f && f(L, event);
97004
+ }, Q = () => !g && /* @__PURE__ */ N.jsxs(
97004
97005
  ey,
97005
97006
  {
97006
97007
  sx: {
@@ -97014,7 +97015,7 @@ const Dve = (e, t) => ({
97014
97015
  Dr,
97015
97016
  {
97016
97017
  variant: "text",
97017
- onClick: H,
97018
+ onClick: M,
97018
97019
  disabled: !t.length,
97019
97020
  children: /* @__PURE__ */ N.jsxs(
97020
97021
  _t,
@@ -97053,12 +97054,12 @@ const Dve = (e, t) => ({
97053
97054
  {
97054
97055
  rowsPerPageOptions: s,
97055
97056
  count: c,
97056
- page: p.page,
97057
- onPageChange: (j, I) => w((E) => ({ ...E, page: I })),
97058
- rowsPerPage: p.pageSize,
97059
- onRowsPerPageChange: (j) => w((I) => ({
97060
- ...I,
97061
- pageSize: parseInt(j.target.value, 10)
97057
+ page: w.page,
97058
+ onPageChange: (L, j) => C((I) => ({ ...I, page: j })),
97059
+ rowsPerPage: w.pageSize,
97060
+ onRowsPerPageChange: (L) => C((j) => ({
97061
+ ...j,
97062
+ pageSize: parseInt(L.target.value, 10)
97062
97063
  }))
97063
97064
  }
97064
97065
  ) : /* @__PURE__ */ N.jsxs(
@@ -97082,27 +97083,27 @@ const Dve = (e, t) => ({
97082
97083
  return /* @__PURE__ */ N.jsx(mo, { sx: Dve(a, l), children: /* @__PURE__ */ N.jsx(
97083
97084
  Pve,
97084
97085
  {
97085
- ...A,
97086
97086
  rows: t,
97087
+ rowSelection: !0,
97087
97088
  rowHeight: 35,
97088
97089
  columns: e,
97089
97090
  paginationMode: r ? "server" : void 0,
97090
97091
  sortingMode: "server",
97091
- paginationModel: p,
97092
+ paginationModel: w,
97092
97093
  rowCount: c,
97093
97094
  pagination: r,
97094
- onPaginationModelChange: r ? M : void 0,
97095
- sortModel: C,
97095
+ onPaginationModelChange: r ? B : void 0,
97096
+ sortModel: y,
97096
97097
  disableRowSelectionOnClick: !0,
97097
- onSortModelChange: B,
97098
- onRowClick: Q,
97098
+ onSortModelChange: v,
97099
+ onRowClick: H,
97099
97100
  slots: {
97100
- footer: L
97101
+ footer: Q
97101
97102
  },
97102
97103
  loading: n,
97103
97104
  sx: Bve(a, l),
97104
97105
  onRowsScrollEnd: r ? void 0 : h,
97105
- getRowClassName: (j) => j.id === D ? "Mui-selected" : ""
97106
+ getRowClassName: (L) => L.id === A ? "Mui-selected" : ""
97106
97107
  }
97107
97108
  ) });
97108
97109
  }, Iye = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conboai/storybook.components",
3
- "version": "0.3.63",
3
+ "version": "0.3.64",
4
4
  "main": "dist/storybook.components.mjs",
5
5
  "types": "dist/build/index.d.ts",
6
6
  "files": [