@3sc/common-component 0.0.110 → 0.0.111

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
@@ -28576,18 +28576,31 @@ const sl = {
28576
28576
  let d = jo.GRID_SETTINGS || { platform: { theme: "light" }, grid: {} };
28577
28577
  d.grid = d.grid || {}, d.grid[o] = u, localStorage.setItem(fo.SETTINGS, JSON.stringify(d)), await al({ baseUrl: n, payload: d }), c();
28578
28578
  } };
28579
- }, Uk = ({ columns: e, gridPath: t, baseUrl: n }) => {
28579
+ }, Uk = ({
28580
+ columns: e,
28581
+ gridPath: t,
28582
+ baseUrl: n,
28583
+ isDefaultConfig: o
28584
+ }) => {
28580
28585
  var p, f;
28581
- const o = (f = (p = jo.GRID_SETTINGS) == null ? void 0 : p.grid) == null ? void 0 : f[t];
28582
28586
  let { definitions: r, defaultUserSettings: s, labels: a } = e;
28583
- s = o ?? s ?? Yk({ definitions: r }), (!o || !s) && (async () => {
28584
- try {
28585
- let m = jo.GRID_SETTINGS || { platform: { theme: "light" }, grid: {} };
28586
- m.grid = m.grid || {}, m.grid[t] = s, localStorage.setItem(fo.SETTINGS, JSON.stringify(m)), await al({ baseUrl: n, payload: m });
28587
- } catch (m) {
28588
- console.error(m);
28589
- }
28590
- })();
28587
+ if (!o) {
28588
+ const m = (f = (p = jo.GRID_SETTINGS) == null ? void 0 : p.grid) == null ? void 0 : f[t];
28589
+ s = m ?? s ?? Yk({ definitions: r }), (!m || !s) && (async () => {
28590
+ try {
28591
+ let g = jo.GRID_SETTINGS || {
28592
+ platform: { theme: "light" },
28593
+ grid: {}
28594
+ };
28595
+ g.grid = g.grid || {}, g.grid[t] = s, localStorage.setItem(
28596
+ fo.SETTINGS,
28597
+ JSON.stringify(g)
28598
+ ), await al({ baseUrl: n, payload: g });
28599
+ } catch (g) {
28600
+ console.error(g);
28601
+ }
28602
+ })();
28603
+ }
28591
28604
  const c = s.reduce((m, g) => (m[g.id] = g, m), {}), l = a.reduce((m, g) => (m[g.id] = g, m), {}), u = [];
28592
28605
  for (const m of r) {
28593
28606
  const { id: g } = m, h = c[g], y = l[g];
@@ -29564,9 +29577,7 @@ wy.propTypes = {
29564
29577
  };
29565
29578
  const Sy = ({ defaultTools: e, isManageable: t, customTools: n, baseUrl: o, gridPath: r }) => {
29566
29579
  var d, p, f, m, g, h, y;
29567
- const s = qe(Ui), { visibleGridColumns: a, triggerApi: c } = qe(Qa);
29568
- console.log({ triggerApi: c });
29569
- const l = async (b) => {
29580
+ const s = qe(Ui), { visibleGridColumns: a, triggerApi: c } = qe(Qa), l = async (b) => {
29570
29581
  try {
29571
29582
  await cM({ baseUrl: o, gridPath: r, gridSetting: b });
29572
29583
  } catch (I) {
@@ -29687,17 +29698,31 @@ Sy.propTypes = {
29687
29698
  baseUrl: i.string,
29688
29699
  gridPath: i.gridPath
29689
29700
  };
29690
- function pM({ tableProps: e, toolbarProps: t }) {
29691
- var s;
29692
- const n = (s = e.columns) == null ? void 0 : s.isManageable, { columns: o } = e, r = Uk({ columns: o, gridPath: t.gridPath, baseUrl: t.baseUrl });
29701
+ function pM({ tableProps: e, toolbarProps: t, isDefaultConfig: n }) {
29702
+ var a;
29703
+ const o = (a = e.columns) == null ? void 0 : a.isManageable, { columns: r } = e, s = Uk({
29704
+ columns: r,
29705
+ gridPath: t.gridPath,
29706
+ baseUrl: t.baseUrl,
29707
+ isDefaultConfig: n
29708
+ });
29693
29709
  return /* @__PURE__ */ v.jsxs(Hv, { children: [
29694
- /* @__PURE__ */ v.jsx(Sy, { ...t, isManageable: n }),
29695
- /* @__PURE__ */ v.jsx(Iy, { tableProps: e, mergedColumns: r, gridPath: t.gridPath, baseUrl: t.baseUrl })
29710
+ /* @__PURE__ */ v.jsx(Sy, { ...t, isManageable: o }),
29711
+ /* @__PURE__ */ v.jsx(
29712
+ Iy,
29713
+ {
29714
+ tableProps: e,
29715
+ mergedColumns: s,
29716
+ gridPath: t.gridPath,
29717
+ baseUrl: t.baseUrl
29718
+ }
29719
+ )
29696
29720
  ] });
29697
29721
  }
29698
29722
  pM.propTypes = {
29699
29723
  tableProps: i.object.isRequired,
29700
- toolbarProps: i.object.isRequired
29724
+ toolbarProps: i.object.isRequired,
29725
+ isDefaultConfig: i.bool
29701
29726
  };
29702
29727
  const Ry = ({ list: e, handleLinkClick: t }) => {
29703
29728
  const n = ot(), o = ({ list: r }) => {