@ethanhann/mantine-dataview 0.4.0 → 0.4.1

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.js CHANGED
@@ -81,15 +81,25 @@ function ue(e, t = {}) {
81
81
  //#endregion
82
82
  //#region src/core/useRowTransition.ts
83
83
  function q(e, t) {
84
- let n = U([]), r = U(!1), i = U(0), a = e.map((e) => e.id), o = /* @__PURE__ */ new Set();
84
+ let n = U([]), r = U(!1), i = U(0), a = U(!1);
85
+ V(() => {
86
+ t && !a.current && typeof document < "u" && process.env.NODE_ENV !== "production" && (Array.from(document.styleSheets).some((e) => {
87
+ try {
88
+ return Array.from(e.cssRules).some((e) => e instanceof CSSKeyframesRule && e.name === "dataview-row-enter");
89
+ } catch {
90
+ return !1;
91
+ }
92
+ }) || console.warn("[@ethanhann/mantine-dataview] animateRows is enabled but the CSS keyframes are missing. Import \"@ethanhann/mantine-dataview/styles.css\" in your app entry."), a.current = !0);
93
+ }, [t]);
94
+ let o = e.map((e) => e.id), s = /* @__PURE__ */ new Set();
85
95
  if (t && r.current) {
86
96
  let e = n.current, t = new Set(e);
87
- if (a.length !== e.length || a.some((t, n) => t !== e[n])) if (i.current++, a.length === e.length && a.every((e) => t.has(e))) for (let e of a) o.add(e);
88
- else for (let e of a) t.has(e) || o.add(e);
97
+ if (o.length !== e.length || o.some((t, n) => t !== e[n])) if (i.current++, o.length === e.length && o.every((e) => t.has(e))) for (let e of o) s.add(e);
98
+ else for (let e of o) t.has(e) || s.add(e);
89
99
  }
90
- return n.current = a, r.current = !0, {
100
+ return n.current = o, r.current = !0, {
91
101
  rows: e,
92
- entering: o,
102
+ entering: s,
93
103
  generation: i.current
94
104
  };
95
105
  }