@floegence/floe-webapp-core 0.91.0 → 0.91.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.
|
@@ -22,12 +22,12 @@ const ee = {
|
|
|
22
22
|
function ne(L) {
|
|
23
23
|
const [r, N] = I(L, ["value", "onChange", "options", "size", "disabled", "class"]);
|
|
24
24
|
let d, c;
|
|
25
|
-
const
|
|
26
|
-
let f, u,
|
|
25
|
+
const h = /* @__PURE__ */ new Map(), [s, S] = J();
|
|
26
|
+
let f, u, b;
|
|
27
27
|
const y = () => {
|
|
28
|
-
const o =
|
|
28
|
+
const o = h.get(r.value);
|
|
29
29
|
if (!d || !o) {
|
|
30
|
-
u?.cancel(), S(void 0),
|
|
30
|
+
u?.cancel(), S(void 0), b = void 0;
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
if (!o.offsetWidth || !d.getClientRects().length) return;
|
|
@@ -37,19 +37,21 @@ function ne(L) {
|
|
|
37
37
|
width: o.offsetWidth,
|
|
38
38
|
height: o.offsetHeight
|
|
39
39
|
}, v = X(s);
|
|
40
|
-
if (v && Object.keys(n).every((a) => n[a] === v[a]) &&
|
|
41
|
-
const e = v &&
|
|
40
|
+
if (v && Object.keys(n).every((a) => n[a] === v[a]) && b === r.value) return;
|
|
41
|
+
const e = v && b !== r.value && c && !window.matchMedia("(prefers-reduced-motion: reduce), (forced-colors: active)").matches ? getComputedStyle(c) : void 0, l = e ? {
|
|
42
42
|
transform: e.transform,
|
|
43
43
|
width: e.width
|
|
44
44
|
} : void 0;
|
|
45
|
-
if (u?.cancel(), S(n),
|
|
45
|
+
if (u?.cancel(), S(n), b = r.value, l && c) {
|
|
46
46
|
const a = getComputedStyle(d);
|
|
47
47
|
u = c.animate([l, {
|
|
48
48
|
transform: `translate(${n.x}px, ${n.y}px)`,
|
|
49
49
|
width: `${n.width}px`
|
|
50
50
|
}], {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// Position changes need visible travel: the fast entrance curve
|
|
52
|
+
// covers almost 90% of this short rail in its first 60ms.
|
|
53
|
+
duration: parseFloat(a.getPropertyValue("--floe-duration-slow")) || 280,
|
|
54
|
+
easing: a.getPropertyValue("--floe-ease-in-out").trim() || "ease-in-out"
|
|
53
55
|
}), u.id = "floe-segmented-selection";
|
|
54
56
|
}
|
|
55
57
|
};
|
|
@@ -58,7 +60,7 @@ function ne(L) {
|
|
|
58
60
|
}), Q(() => {
|
|
59
61
|
if (typeof ResizeObserver < "u") {
|
|
60
62
|
f = new ResizeObserver(y), f.observe(d);
|
|
61
|
-
for (const o of
|
|
63
|
+
for (const o of h.values()) f.observe(o);
|
|
62
64
|
}
|
|
63
65
|
y();
|
|
64
66
|
}), D(() => {
|
|
@@ -90,8 +92,8 @@ function ne(L) {
|
|
|
90
92
|
return (() => {
|
|
91
93
|
var i = Z(), g = i.firstChild, m = g.firstChild;
|
|
92
94
|
return i.$$click = () => T(e.value, e.disabled), $((t) => {
|
|
93
|
-
|
|
94
|
-
f?.unobserve(t),
|
|
95
|
+
h.set(e.value, t), f?.observe(t), D(() => {
|
|
96
|
+
f?.unobserve(t), h.delete(e.value);
|
|
95
97
|
});
|
|
96
98
|
}, i), k(g, (() => {
|
|
97
99
|
var t = B(() => !!e.icon);
|