@hybr1d-tech/charizard 1.1.78 → 1.1.80

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/hybr1d-ui.js CHANGED
@@ -9561,44 +9561,55 @@ function S1({ items: e, onChange: l, renderItem: n }) {
9561
9561
  S1.Item = Sm;
9562
9562
  S1.DragHandle = Rm;
9563
9563
  const I2 = "select", $2 = "dropdown-actions", G2 = "select-radio";
9564
- function Gm({ checkedState: e, setCheckedState: l, search: n }) {
9565
- const [c, t] = q.useState([]), s = q.useRef([]);
9566
- q.useEffect(() => {
9567
- JSON.stringify(s.current) !== JSON.stringify(e) && (t(e), s.current = e);
9568
- }, [e]);
9569
- const r = q.useCallback(
9570
- (u) => {
9571
- const m = typeof u == "function" ? u(c) : u;
9572
- t(m), l(m), s.current = m;
9564
+ function Gm({
9565
+ checkedState: e,
9566
+ setCheckedState: l,
9567
+ search: n,
9568
+ table: c
9569
+ }) {
9570
+ const t = q.useCallback(
9571
+ (i, o) => {
9572
+ l((u) => {
9573
+ const m = u.map((v) => v.id === i ? { ...v, checked: o } : v), d = c.getColumn(i);
9574
+ return d && d.toggleVisibility(o), m;
9575
+ });
9573
9576
  },
9574
- [l, c]
9575
- ), i = q.useMemo(() => {
9576
- const u = {};
9577
- return c.forEach((m) => {
9578
- const d = m.group || "Ungrouped";
9579
- u[d] || (u[d] = []), u[d].push({ ...m });
9580
- }), u;
9581
- }, [c]), o = q.useMemo(() => {
9582
- const u = {};
9583
- return Object.entries(i).forEach(([m, d]) => {
9584
- const v = d.filter(
9585
- (h) => h.label.toLowerCase().includes(n.toLowerCase())
9577
+ [c, l]
9578
+ ), s = q.useMemo(() => {
9579
+ const i = {};
9580
+ return e.forEach((o) => {
9581
+ const u = o.group || "Ungrouped";
9582
+ i[u] || (i[u] = []), i[u].push(o);
9583
+ }), i;
9584
+ }, [e]), r = q.useMemo(() => {
9585
+ const i = {};
9586
+ return Object.entries(s).forEach(([o, u]) => {
9587
+ const m = u.filter(
9588
+ (d) => d.label.toLowerCase().includes(n.toLowerCase())
9586
9589
  );
9587
- v.length > 0 && (u[m] = v);
9588
- }), u;
9589
- }, [i, n]);
9590
- return /* @__PURE__ */ a.jsx(a.Fragment, { children: Object.entries(o).map(([u, m]) => /* @__PURE__ */ a.jsxs("div", { children: [
9591
- /* @__PURE__ */ a.jsx("h3", { className: e2.groupTitle, children: u }),
9592
- m.map((d) => /* @__PURE__ */ a.jsx("div", { className: e2.option, children: /* @__PURE__ */ a.jsx(
9590
+ m.length > 0 && (i[o] = m);
9591
+ }), i;
9592
+ }, [s, n]);
9593
+ return /* @__PURE__ */ a.jsx(a.Fragment, { children: Object.entries(r).map(([i, o]) => /* @__PURE__ */ a.jsxs("div", { children: [
9594
+ /* @__PURE__ */ a.jsx("h3", { className: e2.groupTitle, children: i }),
9595
+ o.map((u) => /* @__PURE__ */ a.jsx("div", { className: e2.option, children: /* @__PURE__ */ a.jsx(
9593
9596
  E1,
9594
9597
  {
9595
- label: d.label,
9596
- id: d.id,
9597
- checked: d.checked,
9598
- setCheckedState: r
9598
+ label: u.label,
9599
+ id: u.id,
9600
+ checked: u.checked,
9601
+ setCheckedState: (m) => {
9602
+ if (typeof m == "function") {
9603
+ const v = m(e).find((h) => h.id === u.id);
9604
+ v && t(u.id, v.checked);
9605
+ } else {
9606
+ const d = [...m], v = d.findIndex((h) => h.id === u.id);
9607
+ v !== -1 && t(u.id, d[v].checked);
9608
+ }
9609
+ }
9599
9610
  }
9600
- ) }, d.id))
9601
- ] }, u)) });
9611
+ ) }, u.id))
9612
+ ] }, i)) });
9602
9613
  }
9603
9614
  function Fm({
9604
9615
  customColumnConfig: e,
@@ -9659,7 +9670,8 @@ function Fm({
9659
9670
  {
9660
9671
  checkedState: d,
9661
9672
  setCheckedState: v,
9662
- search: h
9673
+ search: h,
9674
+ table: l
9663
9675
  }
9664
9676
  ) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
9665
9677
  /* @__PURE__ */ a.jsx("div", { className: e2.option, children: /* @__PURE__ */ a.jsx(