@ethanhann/mantine-dataview 0.4.0 → 0.4.2
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 +72 -82
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -81,16 +81,28 @@ 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 =
|
|
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(), c = i.current;
|
|
85
95
|
if (t && r.current) {
|
|
86
96
|
let e = n.current, t = new Set(e);
|
|
87
|
-
if (
|
|
88
|
-
else for (let e of
|
|
97
|
+
if (o.length !== e.length || o.some((t, n) => t !== e[n])) if (c = i.current + 1, 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
|
|
100
|
+
return V(() => {
|
|
101
|
+
n.current = o, r.current = !0, i.current = c;
|
|
102
|
+
}), {
|
|
91
103
|
rows: e,
|
|
92
|
-
entering:
|
|
93
|
-
generation:
|
|
104
|
+
entering: s,
|
|
105
|
+
generation: c
|
|
94
106
|
};
|
|
95
107
|
}
|
|
96
108
|
//#endregion
|