@3sc/common-component 0.0.336 → 0.0.338

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
@@ -44630,43 +44630,23 @@ Ow.propTypes = {
44630
44630
  nested: s.object
44631
44631
  };
44632
44632
  function kw({ tableProps: e, isDefaultConfig: t, gridPath: n, baseUrl: r }) {
44633
- var d;
44634
- const { columns: o } = e, { visibleGridColumns: i = [], prevGridColumns: a } = gt(Oa) ?? {}, l = gt(ka), c = RW({
44635
- columns: o,
44636
- gridPath: n,
44637
- baseUrl: r,
44638
- isDefaultConfig: t,
44639
- pageSize: (d = e == null ? void 0 : e.pagination) == null ? void 0 : d.rowPerPage
44640
- }), u = Qn(() => {
44641
- const f = new Map(i.map((h) => [h.key, h])), p = /* @__PURE__ */ new Map();
44642
- if (a.size > 0)
44643
- for (const [h, g] of a == null ? void 0 : a.entries()) {
44644
- const m = f.get(h);
44645
- m && g.isHidden !== m.isHidden && p.set(h, !0);
44646
- }
44647
- return c.map((h) => {
44648
- const g = f.get(h.key), m = p.has(h.key);
44649
- return {
44650
- ...h,
44651
- ...g && {
44652
- ...m && { isHidden: g.isHidden }
44653
- // sequenceId: visibleCol.sequenceId,
44654
- }
44655
- };
44656
- }).sort((h, g) => h.sequenceId - g.sequenceId);
44657
- }, [a, i]);
44658
- return console.log({ mergedColumns: c, visibleGridColumns: i, columns: o, finalColumns: u, prevGridColumns: a }), yt(() => {
44659
- if (c != null && c.length) {
44660
- const f = new Map(c.map((p) => [p.key, p]));
44661
- l({
44662
- type: qe.PREV_GRID_DEF,
44663
- payload: { prevGridColumns: f }
44664
- }), l({
44665
- type: qe.SET_GRID_DATA,
44666
- payload: { visibleGridColumns: c }
44667
- });
44668
- }
44669
- }, [c]), /* @__PURE__ */ y.jsx(
44633
+ var c;
44634
+ const { columns: o } = e, { visibleGridColumns: i = [] } = gt(Oa) ?? {}, a = gt(ka), l = Qn(() => {
44635
+ var u;
44636
+ return RW({
44637
+ columns: o,
44638
+ gridPath: n,
44639
+ baseUrl: r,
44640
+ isDefaultConfig: t,
44641
+ pageSize: (u = e == null ? void 0 : e.pagination) == null ? void 0 : u.rowPerPage
44642
+ });
44643
+ }, [o, n, r, t, (c = e == null ? void 0 : e.pagination) == null ? void 0 : c.rowPerPage]);
44644
+ return yt(() => {
44645
+ l != null && l.length && (a == null || a({
44646
+ type: qe.SET_GRID_DATA,
44647
+ payload: { visibleGridColumns: l }
44648
+ }));
44649
+ }, [l, a]), /* @__PURE__ */ y.jsx(
44670
44650
  Ow,
44671
44651
  {
44672
44652
  ...e,