@3sc/common-component 0.0.353 → 0.0.355

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.
package/dist/index.es.js CHANGED
@@ -41021,7 +41021,7 @@ const E8 = ({ options: e, isDraggable: t }) => {
41021
41021
  R.preventDefault(), P((N) => Math.min(N + 1, m.length - 1));
41022
41022
  else if (R.key === "ArrowUp")
41023
41023
  R.preventDefault(), P((N) => Math.max(N - 1, 0));
41024
- else if (R.key === "Enter" || R.key === " ") {
41024
+ else if (R.key === "Enter") {
41025
41025
  R.preventDefault();
41026
41026
  const N = m[E];
41027
41027
  N && $(N);
@@ -41042,9 +41042,6 @@ const E8 = ({ options: e, isDraggable: t }) => {
41042
41042
  tabIndex: 0,
41043
41043
  inputMode: "none"
41044
41044
  },
41045
- onKeyDown: (R) => {
41046
- R.key === "Enter" && d(!0);
41047
- },
41048
41045
  onChange: B,
41049
41046
  sx: {
41050
41047
  position: "sticky",
@@ -43477,39 +43474,40 @@ const ww = {
43477
43474
  const h = Sr((p == null ? void 0 : p.columns) || []);
43478
43475
  if (!r && t) {
43479
43476
  let O = (l && zu({ childUniqueKey: i })) ?? zu({ definitions: a, childUniqueKey: i });
43480
- const b = O.filter((E) => !h[E.key]), k = p && ((x = p == null ? void 0 : p.columns) == null ? void 0 : x.some(
43481
- (E) => (E == null ? void 0 : E.children) && E.children[i]
43477
+ O.filter((k) => !h[k.key]);
43478
+ const b = p && ((x = p == null ? void 0 : p.columns) == null ? void 0 : x.some(
43479
+ (k) => (k == null ? void 0 : k.children) && k.children[i]
43482
43480
  ));
43483
- if (!p || k == !1) {
43484
- if (console.log({ _localSetting: f, grid_settings: p, missing: b, _userSettings: O }), k == !1) {
43485
- const E = Sr(O);
43486
- O = (w = p == null ? void 0 : p.columns) == null ? void 0 : w.map((P) => {
43487
- var D;
43488
- return P != null && P.children && !P.children[i] ? {
43489
- ...P,
43481
+ if (!p || b == !1) {
43482
+ if (b == !1) {
43483
+ const k = Sr(O);
43484
+ O = (w = p == null ? void 0 : p.columns) == null ? void 0 : w.map((E) => {
43485
+ var P;
43486
+ return E != null && E.children && !E.children[i] ? {
43487
+ ...E,
43490
43488
  children: {
43491
- ...P.children,
43492
- [i]: (D = E == null ? void 0 : E[P == null ? void 0 : P.key]) == null ? void 0 : D.children[i]
43489
+ ...E.children,
43490
+ [i]: (P = k == null ? void 0 : k[E == null ? void 0 : E.key]) == null ? void 0 : P.children[i]
43493
43491
  }
43494
- } : P;
43492
+ } : E;
43495
43493
  });
43496
43494
  }
43497
43495
  (async () => {
43498
43496
  try {
43499
- const P = { ...f || {
43497
+ const E = { ...f || {
43500
43498
  platform: { theme: "light" }
43501
- } }, D = (p == null ? void 0 : p.pageSize) ?? o;
43502
- let A = P;
43503
- for (let j = 0; j < d.length; j++) {
43504
- const M = d[j];
43505
- j === d.length - 1 ? A[M] = {
43499
+ } }, P = (p == null ? void 0 : p.pageSize) ?? o;
43500
+ let D = E;
43501
+ for (let A = 0; A < d.length; A++) {
43502
+ const j = d[A];
43503
+ A === d.length - 1 ? D[j] = {
43506
43504
  columns: O,
43507
- pageSize: D
43508
- } : (A[M] = { ...A[M] || {} }, A = A[M]);
43505
+ pageSize: P
43506
+ } : (D[j] = { ...D[j] || {} }, D = D[j]);
43509
43507
  }
43510
- localStorage.setItem(Dr.SETTINGS, JSON.stringify(P)), await Yc({ baseUrl: n, payload: P });
43511
- } catch (E) {
43512
- console.error(E);
43508
+ localStorage.setItem(Dr.SETTINGS, JSON.stringify(E)), await Yc({ baseUrl: n, payload: E });
43509
+ } catch (k) {
43510
+ console.error(k);
43513
43511
  }
43514
43512
  })();
43515
43513
  }
@@ -43520,7 +43518,6 @@ const ww = {
43520
43518
  i
43521
43519
  )) ?? l ?? zu({ definitions: a });
43522
43520
  const g = [], m = Sr(l);
43523
- console.log({ definitions: a, hashMapUserSettings: m, hashMapLabels: u });
43524
43521
  for (const O of a) {
43525
43522
  const b = m[O.key] || {}, k = u[O.key] || {}, E = Sr(b.children || []), P = Sr(k.children || []);
43526
43523
  let D = {
@@ -43528,13 +43525,13 @@ const ww = {
43528
43525
  ...b,
43529
43526
  ...k
43530
43527
  };
43531
- console.log({ item: O, userSetting: b, label: k, obj: D }), (C = O.children) != null && C.length && (D.children = O.children.map((A) => ({
43528
+ (C = O.children) != null && C.length && (D.children = O.children.map((A) => ({
43532
43529
  ...A,
43533
43530
  ...E[A.key],
43534
43531
  ...P[A.key]
43535
43532
  }))), g.push(D);
43536
43533
  }
43537
- return console.log({ col: g }), g.sort((O, b) => O.sequenceId - b.sequenceId);
43534
+ return g.sort((O, b) => O.sequenceId - b.sequenceId);
43538
43535
  }, PW = (e) => e.sort((t, n) => t.sequenceId - n.sequenceId), ea = (e, t) => e == null ? void 0 : e.map((n) => ({
43539
43536
  id: n.id,
43540
43537
  key: n.key,
@@ -43547,26 +43544,23 @@ const ww = {
43547
43544
  [t]: ea(n.children)
43548
43545
  } : ea(n.children)
43549
43546
  }
43550
- })), Sr = (e) => Array.isArray(e) && (e == null ? void 0 : e.reduce((t, n) => (t[n.key] = n, t), {})), zu = ({ definitions: e, childUniqueKey: t }) => ea(e, t), MW = (e, t, n) => {
43551
- const r = t.map((o) => {
43552
- const i = e[o.key], a = o.children ? o.children.map((l) => {
43553
- var d;
43554
- const c = Sr(Array.isArray(i == null ? void 0 : i.children) ? i == null ? void 0 : i.children : (d = i == null ? void 0 : i.children) == null ? void 0 : d[n]), u = c == null ? void 0 : c[l.key];
43555
- return {
43556
- ...l,
43557
- sequenceId: (u == null ? void 0 : u.sequenceId) || l.sequenceId,
43558
- isHidden: (u == null ? void 0 : u.isHidden) ?? l.isHidden
43559
- };
43560
- }) : void 0;
43547
+ })), Sr = (e) => Array.isArray(e) && (e == null ? void 0 : e.reduce((t, n) => (t[n.key] = n, t), {})), zu = ({ definitions: e, childUniqueKey: t }) => ea(e, t), MW = (e, t, n) => t.map((o) => {
43548
+ const i = e[o.key], a = o.children ? o.children.map((l) => {
43549
+ var d;
43550
+ const c = Sr(Array.isArray(i == null ? void 0 : i.children) ? i == null ? void 0 : i.children : (d = i == null ? void 0 : i.children) == null ? void 0 : d[n]), u = c == null ? void 0 : c[l.key];
43561
43551
  return {
43562
- ...o,
43563
- sequenceId: (i == null ? void 0 : i.sequenceId) || o.sequenceId,
43564
- isHidden: (i == null ? void 0 : i.isHidden) ?? o.isHidden,
43565
- ...a ? { children: a } : {}
43552
+ ...l,
43553
+ sequenceId: (u == null ? void 0 : u.sequenceId) || l.sequenceId,
43554
+ isHidden: (u == null ? void 0 : u.isHidden) ?? l.isHidden
43566
43555
  };
43567
- });
43568
- return console.log({ res: r }), r;
43569
- }, DW = () => ({
43556
+ }) : void 0;
43557
+ return {
43558
+ ...o,
43559
+ sequenceId: (i == null ? void 0 : i.sequenceId) || o.sequenceId,
43560
+ isHidden: (i == null ? void 0 : i.isHidden) ?? o.isHidden,
43561
+ ...a ? { children: a } : {}
43562
+ };
43563
+ }), DW = () => ({
43570
43564
  definitions: [
43571
43565
  {
43572
43566
  id: 1,
@@ -44226,18 +44220,19 @@ const FW = q(Pl)(({ theme: e }) => ({
44226
44220
  overflow: "hidden",
44227
44221
  textOverflow: "ellipsis",
44228
44222
  whiteSpace: "nowrap",
44223
+ lineHeight: "2rem",
44229
44224
  display: "table-cell",
44230
44225
  [`&.${dd.head}`]: {
44231
44226
  color: e.palette.primary.notifyTextColor,
44232
44227
  backgroundColor: e.palette.primary.notifyBackground,
44233
44228
  borderColor: e.palette.primary.notifyBorderColor,
44234
- padding: "0.3rem 0.5rem",
44229
+ padding: "0rem",
44235
44230
  textAlign: "center"
44236
44231
  },
44237
44232
  [`&.${dd.body}`]: {
44238
44233
  color: e.palette.primary.notifyTextColor,
44239
44234
  borderColor: e.palette.primary.notifyBorderColor,
44240
- padding: "0.3rem 0.5rem",
44235
+ padding: "0rem",
44241
44236
  textAlign: "center"
44242
44237
  }
44243
44238
  }));
@@ -44559,7 +44554,7 @@ function kw({
44559
44554
  Bv,
44560
44555
  {
44561
44556
  sx: {
44562
- maxHeight: "100%",
44557
+ maxHeight: "40rem",
44563
44558
  whiteSpace: "nowrap",
44564
44559
  overflow: "auto",
44565
44560
  width: "100%",
@@ -44570,35 +44565,60 @@ function kw({
44570
44565
  Fv,
44571
44566
  {
44572
44567
  ref: O,
44568
+ stickyHeader: !0,
44573
44569
  "aria-label": "sticky table",
44574
44570
  sx: {
44575
44571
  backgroundColor: (I) => I.palette.primary.notifyBackground
44576
44572
  },
44577
44573
  children: [
44578
44574
  /* @__PURE__ */ y.jsxs(Lv, { children: [
44579
- /* @__PURE__ */ y.jsx(Yo, { children: d.map(
44580
- (I, Y) => I != null && I.isHidden || (I == null ? void 0 : I.isVisible) === !1 ? null : /* @__PURE__ */ y.jsxs(ye.Fragment, { children: [
44581
- ae(I, Y, x),
44582
- oe(I, Y, x)
44583
- ] }, Y)
44584
- ) }),
44585
- /* @__PURE__ */ y.jsx(Yo, { draggable: !1, children: d.flatMap(
44586
- (I, Y) => I != null && I.isHidden || !(I != null && I.children) || (I == null ? void 0 : I.isVisible) === !1 ? [] : I.children.map(
44587
- (Z, re) => Z != null && Z.isHidden ? null : /* @__PURE__ */ y.jsxs(ye.Fragment, { children: [
44588
- ae(
44589
- Z,
44590
- re,
44591
- x,
44592
- I
44593
- ),
44594
- w && oe(
44595
- Z,
44596
- re,
44597
- x
44575
+ /* @__PURE__ */ y.jsx(
44576
+ Yo,
44577
+ {
44578
+ sx: {
44579
+ position: "sticky",
44580
+ top: 0,
44581
+ backgroundColor: u.palette.primary.notifyBackground,
44582
+ zIndex: 3,
44583
+ maxHeight: "3.5rem"
44584
+ },
44585
+ children: d.map(
44586
+ (I, Y) => I != null && I.isHidden || (I == null ? void 0 : I.isVisible) === !1 ? null : /* @__PURE__ */ y.jsxs(ye.Fragment, { children: [
44587
+ ae(I, Y, x),
44588
+ oe(I, Y, x)
44589
+ ] }, Y)
44590
+ )
44591
+ }
44592
+ ),
44593
+ /* @__PURE__ */ y.jsx(
44594
+ Yo,
44595
+ {
44596
+ draggable: !1,
44597
+ sx: {
44598
+ position: "sticky",
44599
+ top: "2rem",
44600
+ backgroundColor: u.palette.primary.notifyBackground,
44601
+ zIndex: 2
44602
+ },
44603
+ children: d.flatMap(
44604
+ (I, Y) => I != null && I.isHidden || !(I != null && I.children) || (I == null ? void 0 : I.isVisible) === !1 ? [] : I.children.map(
44605
+ (Z, re) => Z != null && Z.isHidden ? null : /* @__PURE__ */ y.jsxs(ye.Fragment, { children: [
44606
+ ae(
44607
+ Z,
44608
+ re,
44609
+ x,
44610
+ I
44611
+ ),
44612
+ w && oe(
44613
+ Z,
44614
+ re,
44615
+ x
44616
+ )
44617
+ ] }, `${Y}-${re}`)
44598
44618
  )
44599
- ] }, `${Y}-${re}`)
44600
- )
44601
- ) })
44619
+ )
44620
+ }
44621
+ )
44602
44622
  ] }),
44603
44623
  /* @__PURE__ */ y.jsx(_v, { children: n.map((I, Y) => {
44604
44624
  const Z = I[V], re = _ == null ? void 0 : _[Z], be = (re == null ? void 0 : re.length) > 0;
@@ -44694,7 +44714,7 @@ function Ew({ tableProps: e, isDefaultConfig: t, gridPath: n, baseUrl: r, childU
44694
44714
  pageSize: (c = e == null ? void 0 : e.pagination) == null ? void 0 : c.rowPerPage
44695
44715
  });
44696
44716
  return gt(() => {
44697
- console.log({ mergedColumns: l }), l != null && l.length && (a == null || a({
44717
+ l != null && l.length && (a == null || a({
44698
44718
  type: qe.SET_GRID_DATA,
44699
44719
  payload: { visibleGridColumns: l }
44700
44720
  }));