@hybr1d-tech/charizard 1.1.90 → 1.1.91

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,33 +9561,39 @@ function S1({ items: e, onChange: l, renderItem: n }) {
9561
9561
  S1.Item = Sm;
9562
9562
  S1.DragHandle = Rm;
9563
9563
  function Gm({ checkedState: e, setCheckedState: l, search: n }) {
9564
- const c = g.useMemo(() => {
9565
- const s = {};
9566
- return e.forEach((r) => {
9567
- const i = r.group || "Ungrouped";
9568
- s[i] || (s[i] = []), s[i].push(r);
9569
- }), s;
9570
- }, [e]), t = g.useMemo(() => {
9571
- const s = {};
9572
- return Object.entries(c).forEach(([r, i]) => {
9573
- const o = i.filter(
9574
- (u) => u.label.toLowerCase().includes(n.toLowerCase())
9564
+ const c = g.useRef([]);
9565
+ g.useEffect(() => {
9566
+ if (!(e != null && e.length)) return;
9567
+ const r = new Set(c.current.map((u) => u.id)), i = new Set(e.map((u) => u.id));
9568
+ (c.current.length !== e.length || ![...i].every((u) => r.has(u))) && (c.current = structuredClone(e));
9569
+ }, [e]);
9570
+ const t = g.useMemo(() => {
9571
+ const r = {};
9572
+ return e.forEach((i) => {
9573
+ const o = i.group || "Ungrouped";
9574
+ r[o] || (r[o] = []), r[o].push(i);
9575
+ }), r;
9576
+ }, [e]), s = g.useMemo(() => {
9577
+ const r = {};
9578
+ return Object.entries(t).forEach(([i, o]) => {
9579
+ const u = o.filter(
9580
+ (m) => m.label.toLowerCase().includes(n.toLowerCase())
9575
9581
  );
9576
- o.length > 0 && (s[r] = o);
9577
- }), s;
9578
- }, [c, n]);
9579
- return /* @__PURE__ */ a.jsx(a.Fragment, { children: Object.entries(t).map(([s, r]) => /* @__PURE__ */ a.jsxs("div", { children: [
9580
- /* @__PURE__ */ a.jsx("h3", { className: l2.groupTitle, children: s }),
9581
- r.map((i) => /* @__PURE__ */ a.jsx("div", { className: l2.option, children: /* @__PURE__ */ a.jsx(
9582
+ u.length > 0 && (r[i] = u);
9583
+ }), r;
9584
+ }, [t, n]);
9585
+ return /* @__PURE__ */ a.jsx(a.Fragment, { children: Object.entries(s).map(([r, i]) => /* @__PURE__ */ a.jsxs("div", { children: [
9586
+ /* @__PURE__ */ a.jsx("h3", { className: l2.groupTitle, children: r }),
9587
+ i.map((o) => /* @__PURE__ */ a.jsx("div", { className: l2.option, children: /* @__PURE__ */ a.jsx(
9582
9588
  E1,
9583
9589
  {
9584
- label: i.label,
9585
- id: i.id,
9586
- checked: i.checked,
9590
+ label: o.label,
9591
+ id: o.id,
9592
+ checked: o.checked,
9587
9593
  setCheckedState: l
9588
9594
  }
9589
- ) }, i.id))
9590
- ] }, s)) });
9595
+ ) }, o.id))
9596
+ ] }, r)) });
9591
9597
  }
9592
9598
  function Fm({
9593
9599
  customColumnConfig: e,