@conboai/storybook.components 0.3.61 → 0.3.63

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.
@@ -14,6 +14,8 @@ export interface ImagePlayerProps {
14
14
  disabled?: boolean;
15
15
  sx?: SxProps;
16
16
  shapes: Shape[];
17
+ selectedShape?: Shape;
18
+ onShapeSelect?: (selectedShape: Shape | null, shapesList: Shape[]) => void;
17
19
  }
18
20
  declare const ImagePlayer: React.FC<ImagePlayerProps>;
19
21
  export default ImagePlayer;
@@ -96972,34 +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
+ ...A
96976
96977
  }) => {
96977
- const [A, p] = Ye({
96978
+ const [p, w] = Ye({
96978
96979
  page: 0,
96979
96980
  pageSize: s[0]
96980
- }), [w, C] = Ye([]), [y, D] = Ye(null), v = Sr(
96981
- (L) => {
96982
- C(L), u && u(L);
96981
+ }), [C, y] = Ye([]), [D, v] = Ye(null), B = Sr(
96982
+ (j) => {
96983
+ y(j), u && u(j);
96983
96984
  },
96984
96985
  [u]
96985
- ), B = Sr(
96986
- (L) => {
96987
- if (p(L), d) {
96988
- const j = {
96989
- previousPage: A.page
96986
+ ), M = Sr(
96987
+ (j) => {
96988
+ if (w(j), d) {
96989
+ const I = {
96990
+ previousPage: p.page
96990
96991
  };
96991
- d(L, j);
96992
+ d(j, I);
96992
96993
  }
96993
96994
  },
96994
- [d, A.page]
96995
- ), M = () => {
96996
- const L = "data:text/csv;charset=utf-8," + e.map((E) => E.headerName).join(",") + `
96997
- ` + t.map((E) => e.map((x) => E[x.field]).join(",")).join(`
96998
- `), j = encodeURI(L), I = document.createElement("a");
96999
- I.setAttribute("href", j), I.setAttribute("download", "table_data.csv"), document.body.appendChild(I), I.click();
97000
- }, H = (L) => {
97001
- D(L.id), f && f(L, event);
97002
- }, Q = () => !g && /* @__PURE__ */ N.jsxs(
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(
97003
97004
  ey,
97004
97005
  {
97005
97006
  sx: {
@@ -97013,7 +97014,7 @@ const Dve = (e, t) => ({
97013
97014
  Dr,
97014
97015
  {
97015
97016
  variant: "text",
97016
- onClick: M,
97017
+ onClick: H,
97017
97018
  disabled: !t.length,
97018
97019
  children: /* @__PURE__ */ N.jsxs(
97019
97020
  _t,
@@ -97052,12 +97053,12 @@ const Dve = (e, t) => ({
97052
97053
  {
97053
97054
  rowsPerPageOptions: s,
97054
97055
  count: c,
97055
- page: A.page,
97056
- onPageChange: (L, j) => p((I) => ({ ...I, page: j })),
97057
- rowsPerPage: A.pageSize,
97058
- onRowsPerPageChange: (L) => p((j) => ({
97059
- ...j,
97060
- pageSize: parseInt(L.target.value, 10)
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)
97061
97062
  }))
97062
97063
  }
97063
97064
  ) : /* @__PURE__ */ N.jsxs(
@@ -97081,26 +97082,27 @@ const Dve = (e, t) => ({
97081
97082
  return /* @__PURE__ */ N.jsx(mo, { sx: Dve(a, l), children: /* @__PURE__ */ N.jsx(
97082
97083
  Pve,
97083
97084
  {
97085
+ ...A,
97084
97086
  rows: t,
97085
97087
  rowHeight: 35,
97086
97088
  columns: e,
97087
97089
  paginationMode: r ? "server" : void 0,
97088
97090
  sortingMode: "server",
97089
- paginationModel: A,
97091
+ paginationModel: p,
97090
97092
  rowCount: c,
97091
97093
  pagination: r,
97092
- onPaginationModelChange: r ? B : void 0,
97093
- sortModel: w,
97094
+ onPaginationModelChange: r ? M : void 0,
97095
+ sortModel: C,
97094
97096
  disableRowSelectionOnClick: !0,
97095
- onSortModelChange: v,
97096
- onRowClick: H,
97097
+ onSortModelChange: B,
97098
+ onRowClick: Q,
97097
97099
  slots: {
97098
- footer: Q
97100
+ footer: L
97099
97101
  },
97100
97102
  loading: n,
97101
97103
  sx: Bve(a, l),
97102
97104
  onRowsScrollEnd: r ? void 0 : h,
97103
- getRowClassName: (L) => L.id === y ? "Mui-selected" : ""
97105
+ getRowClassName: (j) => j.id === D ? "Mui-selected" : ""
97104
97106
  }
97105
97107
  ) });
97106
97108
  }, Iye = ({
@@ -97207,16 +97209,18 @@ const Dve = (e, t) => ({
97207
97209
  loading: o = !1,
97208
97210
  disabled: s = !1,
97209
97211
  shapes: a,
97210
- sx: l
97212
+ sx: l,
97213
+ selectedShape: c,
97214
+ onShapeSelect: u
97211
97215
  }) => {
97212
- const [c, u] = Ye(0), d = Ove(s), f = Lve(s), h = (p, w) => {
97213
- typeof w == "number" && u(w);
97216
+ const [d, f] = Ye(0), h = Ove(s), m = Lve(s), g = (C, y) => {
97217
+ typeof y == "number" && f(y);
97214
97218
  };
97215
97219
  Me(() => {
97216
- r && r(e[c]);
97217
- }, [c, r, e]);
97218
- const m = (p) => {
97219
- const w = {
97220
+ r && r(e[d]);
97221
+ }, [d, r, e]);
97222
+ const A = (C) => {
97223
+ const y = {
97220
97224
  year: "numeric",
97221
97225
  month: "long",
97222
97226
  day: "numeric",
@@ -97224,17 +97228,17 @@ const Dve = (e, t) => ({
97224
97228
  minute: "2-digit",
97225
97229
  second: "2-digit"
97226
97230
  };
97227
- return new Date(p).toLocaleDateString(void 0, w);
97228
- }, g = (p) => {
97229
- u((w) => {
97230
- const C = w + p;
97231
- return C < 0 ? 0 : C >= e.length ? e.length - 1 : C;
97231
+ return new Date(C).toLocaleDateString(void 0, y);
97232
+ }, p = (C) => {
97233
+ f((y) => {
97234
+ const D = y + C;
97235
+ return D < 0 ? 0 : D >= e.length ? e.length - 1 : D;
97232
97236
  });
97233
- }, A = {
97237
+ }, w = {
97234
97238
  ...Sve,
97235
97239
  ...l
97236
97240
  };
97237
- return /* @__PURE__ */ N.jsxs(Dt, { sx: A, children: [
97241
+ return /* @__PURE__ */ N.jsxs(Dt, { sx: w, children: [
97238
97242
  /* @__PURE__ */ N.jsxs(Dt, { sx: Fve, children: [
97239
97243
  /* @__PURE__ */ N.jsx(
97240
97244
  FO,
@@ -97244,13 +97248,15 @@ const Dve = (e, t) => ({
97244
97248
  menu: { show: !1 },
97245
97249
  showId: !1,
97246
97250
  showPoints: !1,
97251
+ selected: c,
97252
+ onShapeSelect: u,
97247
97253
  children: /* @__PURE__ */ N.jsx(
97248
97254
  Hh,
97249
97255
  {
97250
97256
  sx: { ...jve, objectFit: "contain" },
97251
97257
  component: "img",
97252
- image: e.length > 0 ? t(e[c]) : zve,
97253
- alt: e.length > 0 ? `Snapshot ${c}` : "No Data"
97258
+ image: e.length > 0 ? t(e[d]) : zve,
97259
+ alt: e.length > 0 ? `Snapshot ${d}` : "No Data"
97254
97260
  }
97255
97261
  )
97256
97262
  }
@@ -97259,21 +97265,21 @@ const Dve = (e, t) => ({
97259
97265
  ] }),
97260
97266
  /* @__PURE__ */ N.jsx(v1, { children: /* @__PURE__ */ N.jsxs(Dt, { sx: Tve, children: [
97261
97267
  /* @__PURE__ */ N.jsxs(Dt, { display: "flex", justifyContent: "space-between", children: [
97262
- /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: f, children: e.length ? m(n(e[0])) : "Start time" }),
97263
- /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: f, children: e.length ? m(n(e[c])) : "Current time" }),
97264
- /* @__PURE__ */ N.jsx(Xt, { variant: "body2", "aria-disabled": s, sx: f, children: e.length ? m(n(e[e.length - 1])) : "End time" })
97268
+ /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: m, children: e.length ? A(n(e[0])) : "Start time" }),
97269
+ /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: m, children: e.length ? A(n(e[d])) : "Current time" }),
97270
+ /* @__PURE__ */ N.jsx(Xt, { variant: "body2", "aria-disabled": s, sx: m, children: e.length ? A(n(e[e.length - 1])) : "End time" })
97265
97271
  ] }),
97266
97272
  /* @__PURE__ */ N.jsx(
97267
97273
  Tx,
97268
97274
  {
97269
97275
  disabled: s,
97270
- value: c,
97276
+ value: d,
97271
97277
  min: 0,
97272
97278
  max: e.length - 1,
97273
- onChange: h,
97279
+ onChange: g,
97274
97280
  "aria-labelledby": "image-slider",
97275
97281
  valueLabelDisplay: "auto",
97276
- valueLabelFormat: (p) => m(n(e[p]))
97282
+ valueLabelFormat: (C) => A(n(e[C]))
97277
97283
  }
97278
97284
  ),
97279
97285
  /* @__PURE__ */ N.jsxs(
@@ -97283,14 +97289,14 @@ const Dve = (e, t) => ({
97283
97289
  justifyContent: "center",
97284
97290
  alignItems: "center",
97285
97291
  mb: 2,
97286
- sx: d,
97292
+ sx: h,
97287
97293
  gap: "12px",
97288
97294
  children: [
97289
97295
  /* @__PURE__ */ N.jsxs(Dt, { display: "flex", gap: "12px", children: [
97290
97296
  /* @__PURE__ */ N.jsx(
97291
97297
  Mo,
97292
97298
  {
97293
- onClick: () => g(-10),
97299
+ onClick: () => p(-10),
97294
97300
  variant: "action",
97295
97301
  disabled: s || e.length === 0,
97296
97302
  children: /* @__PURE__ */ N.jsx(kve, {})
@@ -97299,7 +97305,7 @@ const Dve = (e, t) => ({
97299
97305
  /* @__PURE__ */ N.jsx(
97300
97306
  Mo,
97301
97307
  {
97302
- onClick: () => g(-1),
97308
+ onClick: () => p(-1),
97303
97309
  variant: "action",
97304
97310
  disabled: s || e.length === 0,
97305
97311
  children: /* @__PURE__ */ N.jsx(Mve, {})
@@ -97310,7 +97316,7 @@ const Dve = (e, t) => ({
97310
97316
  /* @__PURE__ */ N.jsx(
97311
97317
  Mo,
97312
97318
  {
97313
- onClick: () => g(1),
97319
+ onClick: () => p(1),
97314
97320
  variant: "action",
97315
97321
  disabled: s || e.length === 0,
97316
97322
  children: /* @__PURE__ */ N.jsx(Eve, {})
@@ -97319,7 +97325,7 @@ const Dve = (e, t) => ({
97319
97325
  /* @__PURE__ */ N.jsx(
97320
97326
  Mo,
97321
97327
  {
97322
- onClick: () => g(10),
97328
+ onClick: () => p(10),
97323
97329
  variant: "action",
97324
97330
  disabled: s || e.length === 0,
97325
97331
  children: /* @__PURE__ */ N.jsx(Ive, {})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conboai/storybook.components",
3
- "version": "0.3.61",
3
+ "version": "0.3.63",
4
4
  "main": "dist/storybook.components.mjs",
5
5
  "types": "dist/build/index.d.ts",
6
6
  "files": [