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