@3sc/common-component 0.0.23 → 0.0.25

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # React + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
1
+ # React + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
package/dist/index.es.js CHANGED
@@ -18874,7 +18874,15 @@ Ep.propTypes = {
18874
18874
  handleRead: i.func,
18875
18875
  handleShowDetails: i.func
18876
18876
  };
18877
- const kI = ne(Yx)(({ theme: e }) => ({
18877
+ var ua = {}, kI = zo;
18878
+ Object.defineProperty(ua, "__esModule", {
18879
+ value: !0
18880
+ });
18881
+ var da = ua.default = void 0, MI = kI(Ho()), jI = x;
18882
+ da = ua.default = (0, MI.default)(/* @__PURE__ */ (0, jI.jsx)("path", {
18883
+ d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
18884
+ }), "Search");
18885
+ const VI = ne(Yx)(({ theme: e }) => ({
18878
18886
  "& .MuiInputBase-root": {
18879
18887
  height: "3.52rem"
18880
18888
  },
@@ -18905,23 +18913,14 @@ const kI = ne(Yx)(({ theme: e }) => ({
18905
18913
  }
18906
18914
  }
18907
18915
  })), Rp = ({ adornmentIcon: e, ...t }) => /* @__PURE__ */ x.jsx(
18908
- kI,
18916
+ VI,
18909
18917
  {
18910
18918
  ...t,
18911
18919
  InputProps: {
18912
18920
  ...e || {}
18913
18921
  }
18914
18922
  }
18915
- );
18916
- var ua = {}, MI = zo;
18917
- Object.defineProperty(ua, "__esModule", {
18918
- value: !0
18919
- });
18920
- var da = ua.default = void 0, jI = MI(Ho()), VI = x;
18921
- da = ua.default = (0, jI.default)(/* @__PURE__ */ (0, VI.jsx)("path", {
18922
- d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
18923
- }), "Search");
18924
- const Tp = ({ start: e, end: t, total: n, title: r }) => /* @__PURE__ */ x.jsxs(pt, { component: "h1", sx: { fontSize: "1.5rem", fontWeight: 500 }, children: [
18923
+ ), Tp = ({ start: e, end: t, total: n, title: r }) => /* @__PURE__ */ x.jsxs(pt, { component: "h1", sx: { fontSize: "1.5rem", fontWeight: 500 }, children: [
18925
18924
  e,
18926
18925
  " - ",
18927
18926
  t,
@@ -21922,7 +21921,9 @@ const Qp = ({ option: e, value: t, handleSelectChange: n, ...r }) => /* @__PURE_
21922
21921
  subTitle: fp(S.createdAt),
21923
21922
  isRead: S.isRead,
21924
21923
  handleShowDetails: () => r(S.id),
21925
- handleRead: () => o([S.id]),
21924
+ handleRead: () => {
21925
+ o([S.id]), y([]);
21926
+ },
21926
21927
  subType: S.sub_type,
21927
21928
  isSubType: !0,
21928
21929
  selectedAlert: f,
@@ -21957,29 +21958,43 @@ const Qp = ({ option: e, value: t, handleSelectChange: n, ...r }) => /* @__PURE_
21957
21958
  }, IT = ({ sortKey: e, sortDir: t, column: n }) => /* @__PURE__ */ x.jsx(x.Fragment, { children: e === n ? t ? /* @__PURE__ */ x.jsx("i", { className: "fa fa-arrow-down", "aria-hidden": "true" }) : /* @__PURE__ */ x.jsx("i", { className: "fa fa-arrow-up", "aria-hidden": "true" }) : /* @__PURE__ */ x.jsx(x.Fragment, { children: /* @__PURE__ */ x.jsx("i", { className: "fa fa-sort", "aria-hidden": "true" }) }) }), ET = ({ data: e, handleSort: t, sortDir: n, sortKey: r }) => {
21958
21959
  const o = Ke(() => {
21959
21960
  let s = {}, a = ["channel_id", "node_id", "sku_id"];
21960
- return (e == null ? void 0 : e.length) > 0 && e.map((c) => {
21961
- Object.keys(c).filter((l) => !a.includes(l)).map((l) => {
21962
- l === "custom" ? c[l] && Object.keys(c[l]).map((u) => {
21961
+ return (e == null ? void 0 : e.length) > 0 && e.forEach((c) => {
21962
+ Object.keys(c).filter((l) => !a.includes(l)).forEach((l) => {
21963
+ l === "custom" ? c[l] && Object.keys(c[l]).forEach((u) => {
21963
21964
  typeof c[l][u] == "object" ? u in s ? Object.keys(c[l][u]).map((d) => {
21964
- s[u][d] = d;
21965
- }) : (s[u] = {}, Object.keys(c[l][u]).map((d) => {
21966
- s[u][d] = d;
21967
- })) : u in s || (s[u] = u);
21965
+ typeof c[l][u][d] != "object" && (s[u][d] = d);
21966
+ }) : Object.keys(c[l][u]).forEach((d) => {
21967
+ typeof c[l][u][d] != "object" ? (s[u] = {}, s[u][d] = d) : Array.isArray(c[l][u][d]) && (s[u] = [
21968
+ .../* @__PURE__ */ new Set([
21969
+ ...s[u] ?? [],
21970
+ ...c[l][u][d]
21971
+ ])
21972
+ ]);
21973
+ }) : u in s || (s[u] = u);
21968
21974
  }) : l in s || (s[l] = l);
21969
21975
  });
21970
21976
  }), /* @__PURE__ */ x.jsxs(x.Fragment, { children: [
21971
21977
  /* @__PURE__ */ x.jsxs("thead", { children: [
21972
- /* @__PURE__ */ x.jsx("tr", { children: Object.keys(s).map((c) => typeof s[c] == "object" ? /* @__PURE__ */ x.jsx("th", { colSpan: Object.keys(s[c]).length, children: Ai(c) }) : /* @__PURE__ */ x.jsx("th", { rowSpan: 2, children: /* @__PURE__ */ x.jsxs("span", { onClick: () => t(c), children: [
21973
- Ai(c),
21974
- /* @__PURE__ */ x.jsx(
21975
- IT,
21976
- {
21977
- column: c,
21978
- sortKey: r,
21979
- sortDir: n
21980
- }
21981
- )
21982
- ] }) })) }),
21978
+ /* @__PURE__ */ x.jsxs("tr", { children: [
21979
+ Object.keys(s).map((c) => {
21980
+ if (typeof s[c] != "object")
21981
+ return /* @__PURE__ */ x.jsx("th", { rowSpan: 2, children: /* @__PURE__ */ x.jsxs("span", { onClick: () => t(c), children: [
21982
+ Ai(c),
21983
+ /* @__PURE__ */ x.jsx(
21984
+ IT,
21985
+ {
21986
+ column: c,
21987
+ sortKey: r,
21988
+ sortDir: n
21989
+ }
21990
+ )
21991
+ ] }) });
21992
+ }),
21993
+ Object.keys(s).map((c) => {
21994
+ if (typeof s[c] == "object")
21995
+ return /* @__PURE__ */ x.jsx("th", { colSpan: Object.keys(s[c]).length, children: Ai(c) });
21996
+ })
21997
+ ] }),
21983
21998
  /* @__PURE__ */ x.jsx("tr", { children: Object.keys(s).map((c) => {
21984
21999
  if (typeof s[c] == "object")
21985
22000
  return Object.keys(s[c]).map((l) => /* @__PURE__ */ x.jsx("th", { children: Ai(s[c][l]) }));
@@ -21992,7 +22007,10 @@ const Qp = ({ option: e, value: t, handleSelectChange: n, ...r }) => /* @__PURE_
21992
22007
  (c == null ? void 0 : c.custom) && Object.keys(s).map((u) => {
21993
22008
  var d;
21994
22009
  if (!["sku_name", "node", "channel_name"].includes(u))
21995
- return typeof s[u] == "object" ? u in (c == null ? void 0 : c.custom) ? Object.keys(s[u]).map(
22010
+ return typeof s[u] == "object" ? u in (c == null ? void 0 : c.custom) ? Array.isArray(s[u]) ? s[u].map((p) => {
22011
+ var m, h, b, g, f;
22012
+ return /* @__PURE__ */ x.jsx(x.Fragment, { children: p in ((h = (m = c == null ? void 0 : c.custom) == null ? void 0 : m[u]) == null ? void 0 : h.data) ? /* @__PURE__ */ x.jsx("td", { children: (f = (g = (b = c == null ? void 0 : c.custom) == null ? void 0 : b[u]) == null ? void 0 : g.data) == null ? void 0 : f[p] }) : /* @__PURE__ */ x.jsx("td", { children: "—" }) });
22013
+ }) : Object.keys(s[u]).map(
21996
22014
  (p) => {
21997
22015
  var m, h, b;
21998
22016
  return /* @__PURE__ */ x.jsx(x.Fragment, { children: p in ((m = c == null ? void 0 : c.custom) == null ? void 0 : m[u]) ? /* @__PURE__ */ x.jsx("td", { children: (b = (h = c == null ? void 0 : c.custom) == null ? void 0 : h[u]) == null ? void 0 : b[p] }) : /* @__PURE__ */ x.jsx("td", { children: "—" }) });
@@ -22001,7 +22019,7 @@ const Qp = ({ option: e, value: t, handleSelectChange: n, ...r }) => /* @__PURE_
22001
22019
  (p) => /* @__PURE__ */ x.jsx(x.Fragment, { children: /* @__PURE__ */ x.jsx("td", { children: "—" }) })
22002
22020
  ) : /* @__PURE__ */ x.jsx(x.Fragment, { children: u in (c == null ? void 0 : c.custom) ? /* @__PURE__ */ x.jsx("td", { children: (d = c == null ? void 0 : c.custom) == null ? void 0 : d[u] }) : /* @__PURE__ */ x.jsx("td", { children: "—" }) });
22003
22021
  })
22004
- ] })) }) })
22022
+ ] }, l)) }) })
22005
22023
  ] });
22006
22024
  }, [e]);
22007
22025
  return /* @__PURE__ */ x.jsx("table", { className: "table-notification", children: o() });