@sia.soul/sia-react-ui 0.1.43 → 0.1.45
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/{chunk-ORLXJLLW.js → chunk-KXPNW4E6.js} +3 -3
- package/dist/{chunk-3Q3S6CDZ.js → chunk-NYJSSPIX.js} +16 -3
- package/dist/{chunk-LWVZEUGJ.js → chunk-QIXU7N4X.js} +1 -1
- package/dist/core.cjs +18 -5
- package/dist/core.js +2 -2
- package/dist/index.cjs +1712 -1515
- package/dist/index.css +12 -0
- package/dist/index.d.cts +18 -5
- package/dist/index.d.ts +18 -5
- package/dist/index.js +385 -201
- package/dist/select-date-range.cjs +16 -3
- package/dist/select-date-range.js +2 -2
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Popover,
|
|
6
6
|
Tooltip,
|
|
7
7
|
useOverlayLifecycle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NYJSSPIX.js";
|
|
9
9
|
import {
|
|
10
10
|
Dropdown,
|
|
11
11
|
Icon
|
|
@@ -1815,13 +1815,13 @@ function TypographyContent({
|
|
|
1815
1815
|
useEffect5(() => () => clearTimeout(timer.current), []);
|
|
1816
1816
|
useLayoutEffect3(() => {
|
|
1817
1817
|
const element = contentRef.current;
|
|
1818
|
-
if (!element || !ellipsis || editing || expanded) return;
|
|
1818
|
+
if (!element || !ellipsis || !expandable || editing || expanded) return;
|
|
1819
1819
|
const measure = () => setOverflow(element.scrollHeight > element.clientHeight + 1 || element.scrollWidth > element.clientWidth + 1);
|
|
1820
1820
|
measure();
|
|
1821
1821
|
const observer = new ResizeObserver(measure);
|
|
1822
1822
|
observer.observe(element);
|
|
1823
1823
|
return () => observer.disconnect();
|
|
1824
|
-
}, [content, ellipsis, rows, editing, expanded]);
|
|
1824
|
+
}, [content, ellipsis, rows, expandable, editing, expanded]);
|
|
1825
1825
|
async function copy() {
|
|
1826
1826
|
try {
|
|
1827
1827
|
const text = typeof copyable === "object" ? copyable.text ?? contentRef.current?.textContent ?? "" : contentRef.current?.textContent ?? "";
|
|
@@ -1294,7 +1294,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1294
1294
|
};
|
|
1295
1295
|
const scanTargets = () => {
|
|
1296
1296
|
scanFrame = 0;
|
|
1297
|
-
const
|
|
1297
|
+
const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
|
|
1298
|
+
const discovered = [];
|
|
1299
|
+
if (!targetRef) {
|
|
1300
|
+
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT, {
|
|
1301
|
+
acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
1302
|
+
});
|
|
1303
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
1304
|
+
if (node instanceof HTMLElement) discovered.push(node);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
|
|
1298
1308
|
const nextTargets = /* @__PURE__ */ new Set();
|
|
1299
1309
|
candidates.forEach((target) => {
|
|
1300
1310
|
if (canScroll(target, "horizontal") || canScroll(target, "vertical")) {
|
|
@@ -1312,9 +1322,12 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1312
1322
|
scanFrame = window.requestAnimationFrame(scanTargets);
|
|
1313
1323
|
};
|
|
1314
1324
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
1315
|
-
if (mutations.some((mutation) =>
|
|
1325
|
+
if (mutations.some((mutation) => {
|
|
1326
|
+
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
1327
|
+
return target && !layer.contains(target) && !target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track");
|
|
1328
|
+
})) scheduleScan();
|
|
1316
1329
|
});
|
|
1317
|
-
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true });
|
|
1330
|
+
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
|
|
1318
1331
|
window.addEventListener("resize", scheduleScan);
|
|
1319
1332
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
1320
1333
|
scheduleScan();
|
package/dist/core.cjs
CHANGED
|
@@ -3457,7 +3457,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3457
3457
|
};
|
|
3458
3458
|
const scanTargets = () => {
|
|
3459
3459
|
scanFrame = 0;
|
|
3460
|
-
const
|
|
3460
|
+
const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
|
|
3461
|
+
const discovered = [];
|
|
3462
|
+
if (!targetRef) {
|
|
3463
|
+
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT, {
|
|
3464
|
+
acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
3465
|
+
});
|
|
3466
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
3467
|
+
if (node instanceof HTMLElement) discovered.push(node);
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
|
|
3461
3471
|
const nextTargets = /* @__PURE__ */ new Set();
|
|
3462
3472
|
candidates.forEach((target) => {
|
|
3463
3473
|
if (canScroll(target, "horizontal") || canScroll(target, "vertical")) {
|
|
@@ -3475,9 +3485,12 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3475
3485
|
scanFrame = window.requestAnimationFrame(scanTargets);
|
|
3476
3486
|
};
|
|
3477
3487
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
3478
|
-
if (mutations.some((mutation) =>
|
|
3488
|
+
if (mutations.some((mutation) => {
|
|
3489
|
+
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
3490
|
+
return target && !layer.contains(target) && !target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track");
|
|
3491
|
+
})) scheduleScan();
|
|
3479
3492
|
});
|
|
3480
|
-
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true });
|
|
3493
|
+
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
|
|
3481
3494
|
window.addEventListener("resize", scheduleScan);
|
|
3482
3495
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
3483
3496
|
scheduleScan();
|
|
@@ -4947,13 +4960,13 @@ function TypographyContent({
|
|
|
4947
4960
|
(0, import_react26.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
4948
4961
|
(0, import_react26.useLayoutEffect)(() => {
|
|
4949
4962
|
const element = contentRef.current;
|
|
4950
|
-
if (!element || !ellipsis || editing || expanded) return;
|
|
4963
|
+
if (!element || !ellipsis || !expandable || editing || expanded) return;
|
|
4951
4964
|
const measure = () => setOverflow(element.scrollHeight > element.clientHeight + 1 || element.scrollWidth > element.clientWidth + 1);
|
|
4952
4965
|
measure();
|
|
4953
4966
|
const observer = new ResizeObserver(measure);
|
|
4954
4967
|
observer.observe(element);
|
|
4955
4968
|
return () => observer.disconnect();
|
|
4956
|
-
}, [content, ellipsis, rows, editing, expanded]);
|
|
4969
|
+
}, [content, ellipsis, rows, expandable, editing, expanded]);
|
|
4957
4970
|
async function copy() {
|
|
4958
4971
|
try {
|
|
4959
4972
|
const text = typeof copyable === "object" ? copyable.text ?? contentRef.current?.textContent ?? "" : contentRef.current?.textContent ?? "";
|
package/dist/core.js
CHANGED
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
Typography,
|
|
11
11
|
Upload,
|
|
12
12
|
message
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KXPNW4E6.js";
|
|
14
14
|
import "./chunk-SMCYEPBL.js";
|
|
15
15
|
import {
|
|
16
16
|
Modal,
|
|
17
17
|
Select
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NYJSSPIX.js";
|
|
19
19
|
import {
|
|
20
20
|
Icon,
|
|
21
21
|
Input,
|