@hybr1d-tech/charizard 1.1.76 → 1.1.78

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
@@ -9562,33 +9562,43 @@ S1.Item = Sm;
9562
9562
  S1.DragHandle = Rm;
9563
9563
  const I2 = "select", $2 = "dropdown-actions", G2 = "select-radio";
9564
9564
  function Gm({ checkedState: e, setCheckedState: l, search: n }) {
9565
- const c = q.useMemo(() => {
9566
- const s = {};
9567
- return e.forEach((r) => {
9568
- const i = r.group || "Ungrouped";
9569
- s[i] || (s[i] = []), s[i].push(r);
9570
- }), s;
9571
- }, [e]), t = q.useMemo(() => {
9572
- const s = {};
9573
- return Object.entries(c).forEach(([r, i]) => {
9574
- const o = i.filter(
9575
- (u) => u.label.toLowerCase().includes(n.toLowerCase())
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;
9573
+ },
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())
9576
9586
  );
9577
- o.length > 0 && (s[r] = o);
9578
- }), s;
9579
- }, [c, n]);
9580
- return /* @__PURE__ */ a.jsx(a.Fragment, { children: Object.entries(t).map(([s, r]) => /* @__PURE__ */ a.jsxs("div", { children: [
9581
- /* @__PURE__ */ a.jsx("h3", { className: e2.groupTitle, children: s }),
9582
- r.map((i) => /* @__PURE__ */ a.jsx("div", { className: e2.option, children: /* @__PURE__ */ a.jsx(
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(
9583
9593
  E1,
9584
9594
  {
9585
- label: i.label,
9586
- id: i.id,
9587
- checked: i.checked,
9588
- setCheckedState: l
9595
+ label: d.label,
9596
+ id: d.id,
9597
+ checked: d.checked,
9598
+ setCheckedState: r
9589
9599
  }
9590
- ) }, i.id))
9591
- ] }, s)) });
9600
+ ) }, d.id))
9601
+ ] }, u)) });
9592
9602
  }
9593
9603
  function Fm({
9594
9604
  customColumnConfig: e,