@rpcbase/ui 0.261.0 → 0.262.0
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/assets/sha256.worker-BEf4_Y9w.js.map +1 -0
- package/dist/components/FilesUploadField/index.d.ts +19 -6
- package/dist/components/FilesUploadField/index.d.ts.map +1 -1
- package/dist/components/FilesUploadField/sha256.d.ts +5 -0
- package/dist/components/FilesUploadField/sha256.d.ts.map +1 -0
- package/dist/components/FilesUploadField/sha256.worker.d.ts +4 -0
- package/dist/components/FilesUploadField/sha256.worker.d.ts.map +1 -0
- package/dist/components/ImagesField/index.d.ts +4 -2
- package/dist/components/ImagesField/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index298.js +11 -803
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +865 -28
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +26 -510
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +481 -755
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +786 -7428
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7429 -7
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +6 -12
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +12 -5
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +3 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +5 -469
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +464 -32
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +36 -18
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +17 -28
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +30 -4
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +4 -59
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +59 -9
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +9 -5
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +5 -9
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +9 -12
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +13 -3
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +3 -17
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +14 -23
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +23 -39
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +41 -5
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +5 -25
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +24 -18
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +17 -32
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +34 -5
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +5 -9
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +8 -7
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +8 -9
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +9 -10
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +10 -7
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +7 -75
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +66 -153
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +147 -99
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +113 -13
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +12 -78
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +57 -23
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +45 -12
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +13 -16
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +15 -100
- package/dist/index339.js.map +1 -1
- package/dist/index340.js +95 -50
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +5 -57
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +78 -41
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +58 -100
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +104 -46
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +51 -39
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +42 -142
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +123 -120
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +108 -224
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +174 -158
- package/dist/index349.js.map +1 -1
- package/dist/index350.js +144 -213
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +309 -5
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +5 -6
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +6 -7
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +5 -4
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +4 -4
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +6 -21
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +21 -10
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +10 -128
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +122 -36
- package/dist/index359.js.map +1 -1
- package/dist/index360.js +38 -64
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +66 -115
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +112 -485
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +490 -13
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +13 -4
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +4 -47
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +44 -15
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +19 -5
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +5 -27
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +27 -48
- package/dist/index369.js.map +1 -1
- package/dist/index370.js +46 -27
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +27 -16
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +16 -41
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +42 -14
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +14 -10
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +9 -51
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +53 -43
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +43 -16
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +15 -4
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +4 -4
- package/dist/index379.js.map +1 -1
- package/dist/index380.js +4 -9
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +9 -340
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +339 -4
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +5 -16
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +16 -111
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +109 -19
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +18 -18
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +21 -5
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +5 -20
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +19 -13
- package/dist/index389.js.map +1 -1
- package/dist/index390.js +13 -84
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +84 -7
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +9 -29
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +28 -9
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +9 -5
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +6 -252
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +250 -10
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +11 -10
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +10 -6
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +6 -22
- package/dist/index399.js.map +1 -1
- package/dist/index400.js +21 -21
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +21 -107
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +109 -15
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +15 -12
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +10 -8
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +8 -242
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +238 -25
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +29 -51
- package/dist/index407.js.map +1 -1
- package/dist/index408.js +51 -10
- package/dist/index408.js.map +1 -1
- package/dist/index409.js +11 -128
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +124 -35
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +36 -23
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +26 -11
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +11 -23
- package/dist/index413.js.map +1 -1
- package/dist/index414.js +19 -13
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +14 -13
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +14 -322
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +323 -61
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +63 -4
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +4 -28
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +25 -468
- package/dist/index420.js.map +1 -1
- package/dist/index421.js +452 -250
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +272 -0
- package/dist/index422.js.map +1 -0
- package/package.json +2 -1
package/dist/index406.js
CHANGED
|
@@ -1,34 +1,247 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRenderElement as e } from "./index196.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
import { transitionStatusMapping as t } from "./index197.js";
|
|
4
|
+
import { popupStateMapping as n } from "./index198.js";
|
|
5
|
+
import { getWindow as r } from "./index200.js";
|
|
6
|
+
import { useStableCallback as i } from "./index202.js";
|
|
7
|
+
import { useIsoLayoutEffect as a } from "./index204.js";
|
|
8
|
+
import { windowResize as o } from "./index208.js";
|
|
9
|
+
import { createChangeEventDetails as s } from "./index209.js";
|
|
10
|
+
import { webkit as c } from "./index218.js";
|
|
11
|
+
import { addEventListener as l } from "./index225.js";
|
|
12
|
+
import { useAnimationFrame as u } from "./index228.js";
|
|
13
|
+
import { ownerDocument as ee } from "./index229.js";
|
|
14
|
+
import { rectToClientRect as d } from "./index232.js";
|
|
15
|
+
import { FloatingFocusManager as f } from "./index244.js";
|
|
16
|
+
import { platform as p } from "./index248.js";
|
|
17
|
+
import { useStore as m } from "./index260.js";
|
|
18
|
+
import { useOpenChangeComplete as h } from "./index267.js";
|
|
19
|
+
import { COMPOSITE_KEYS as g } from "./index279.js";
|
|
20
|
+
import { useSelectFloatingContext as _, useSelectRootContext as v } from "./index367.js";
|
|
21
|
+
import { selectors as y } from "./index377.js";
|
|
22
|
+
import { clamp as b } from "./index380.js";
|
|
23
|
+
import { getMaxScrollOffset as x } from "./index381.js";
|
|
24
|
+
import { useDirection as S } from "./index392.js";
|
|
25
|
+
import { useSelectPositionerContext as C } from "./index397.js";
|
|
26
|
+
import { LIST_FUNCTIONAL_STYLES as te, clearStyles as w } from "./index398.js";
|
|
27
|
+
import { getDisabledMountTransitionStyles as T } from "./index399.js";
|
|
28
|
+
import { styleDisableScrollbar as E } from "./index403.js";
|
|
29
|
+
import { useToolbarRootContext as D } from "./index404.js";
|
|
30
|
+
import { useCSPContext as O } from "./index405.js";
|
|
31
|
+
import * as k from "react";
|
|
32
|
+
import { jsx as ne, jsxs as A } from "react/jsx-runtime";
|
|
33
|
+
//#region ../../node_modules/@base-ui/react/select/popup/SelectPopup.mjs
|
|
34
|
+
var re = {
|
|
35
|
+
...n,
|
|
36
|
+
...t
|
|
37
|
+
}, j = /*#__PURE__*/ k.forwardRef(function(t, n) {
|
|
38
|
+
let { render: d, className: p, style: x, finalFocus: j, ...F } = t, { store: L, popupRef: R, onOpenChangeComplete: oe, setOpen: se, valueRef: ce, firstItemTextRef: z, selectedItemTextRef: le, multiple: ue, handleScrollArrowVisibility: B, scrollHandlerRef: de, listRef: V, highlightItemOnHover: H } = v(), { side: fe, align: pe, alignItemWithTriggerActive: U, isPositioned: W, setControlledAlignItemWithTrigger: me } = C(), he = D(!0) != null, ge = _(), G = S(), { nonce: _e, disableStyleElements: ve } = O(), ye = m(L, y.id), K = m(L, y.open), be = m(L, y.openMethod), xe = m(L, y.mounted), Se = m(L, y.popupProps), Ce = m(L, y.transitionStatus), q = m(L, y.triggerElement), J = m(L, y.positionerElement), Y = m(L, y.listElement), X = k.useRef(!1), Z = k.useRef(!1), Q = k.useRef({}), we = u(), $ = i((e) => {
|
|
39
|
+
if (!J || !R.current || !Z.current) return;
|
|
40
|
+
if (X.current || !U) {
|
|
41
|
+
B();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let t = J.style.top === "0px", n = J.style.bottom === "0px";
|
|
45
|
+
if (!t && !n) {
|
|
46
|
+
B();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let i = ae(J), a = N(J.getBoundingClientRect().height, "y", i), o = ee(J), s = r(J), c = s.getComputedStyle(J), l = parseFloat(c.marginTop), u = parseFloat(c.marginBottom), d = ie(s.getComputedStyle(R.current)), f = Math.min(o.documentElement.clientHeight - l - u, d), p = e.scrollTop, m = M(e), h = 0, g = null, _ = !1, v = !1, y = (e) => {
|
|
50
|
+
J.style.height = `${e}px`;
|
|
51
|
+
}, x = (t, n) => {
|
|
52
|
+
let r = b(t, 0, f - a);
|
|
53
|
+
r > 0 && y(a + r), e.scrollTop = n, f - (a + r) <= 1 && (X.current = !0), B();
|
|
54
|
+
}, S = t ? m - p : p, C = Math.min(a + S, f);
|
|
55
|
+
if (h = C, S <= 1) {
|
|
56
|
+
x(S, t ? m : 0);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (f - C > 1 ? t ? v = !0 : g = 0 : (_ = !0, n && p < m && (g = p - (S - (a + S - f)))), h = Math.ceil(h), h !== 0 && y(h), v || g != null) {
|
|
60
|
+
let t = M(e), n = v ? t : b(g, 0, t);
|
|
61
|
+
Math.abs(e.scrollTop - n) > 1 && (e.scrollTop = n);
|
|
62
|
+
}
|
|
63
|
+
(_ || h >= f - 1) && (X.current = !0), B();
|
|
64
|
+
});
|
|
65
|
+
k.useImperativeHandle(de, () => $, [$]), h({
|
|
66
|
+
open: K,
|
|
67
|
+
ref: R,
|
|
68
|
+
onComplete() {
|
|
69
|
+
K && oe?.(!0);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
let Te = {
|
|
73
|
+
open: K,
|
|
74
|
+
transitionStatus: Ce,
|
|
75
|
+
side: fe,
|
|
76
|
+
align: pe
|
|
77
|
+
};
|
|
78
|
+
a(() => {
|
|
79
|
+
!J || !R.current || Object.keys(Q.current).length || (Q.current = {
|
|
80
|
+
top: J.style.top || "0",
|
|
81
|
+
left: J.style.left || "0",
|
|
82
|
+
right: J.style.right,
|
|
83
|
+
height: J.style.height,
|
|
84
|
+
bottom: J.style.bottom,
|
|
85
|
+
minHeight: J.style.minHeight,
|
|
86
|
+
maxHeight: J.style.maxHeight,
|
|
87
|
+
marginTop: J.style.marginTop,
|
|
88
|
+
marginBottom: J.style.marginBottom
|
|
89
|
+
});
|
|
90
|
+
}, [R, J]), a(() => {
|
|
91
|
+
K || U || (Z.current = !1, X.current = !1, w(J, Q.current));
|
|
92
|
+
}, [
|
|
93
|
+
K,
|
|
94
|
+
U,
|
|
95
|
+
J,
|
|
96
|
+
R
|
|
97
|
+
]), a(() => {
|
|
98
|
+
let e = R.current;
|
|
99
|
+
if (!K || !q || !J || !e || U && !W || L.state.transitionStatus === "ending") return;
|
|
100
|
+
if (!U) {
|
|
101
|
+
Z.current = !0, we.request(B), e.style.removeProperty("--transform-origin");
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
let t = I(e);
|
|
105
|
+
e.style.removeProperty("--transform-origin");
|
|
106
|
+
try {
|
|
107
|
+
let t = le.current;
|
|
108
|
+
t?.isConnected || (t = !y.hasSelectedValue(L.state) && z.current?.isConnected ? z.current : null);
|
|
109
|
+
let n = ce.current, i = r(J), a = i.getComputedStyle(J), o = i.getComputedStyle(e), s = ee(q), l = ae(q), u = P(q.getBoundingClientRect(), l), d = P(J.getBoundingClientRect(), l), f = u.height, p = Y || e, m = p.scrollHeight, h = parseFloat(o.borderBottomWidth), g = parseFloat(a.marginTop) || 10, _ = parseFloat(a.marginBottom) || 10, v = parseFloat(a.minHeight) || 100, x = ie(o), S = s.documentElement.clientHeight - g - _, C = s.documentElement.clientWidth, te = S - u.bottom + f, T, E = G === "rtl" ? u.right - d.width : u.left, D = 0;
|
|
110
|
+
if (t && n) {
|
|
111
|
+
let e = P(n.getBoundingClientRect(), l);
|
|
112
|
+
T = P(t.getBoundingClientRect(), l), E = d.left + (G === "rtl" ? e.right - T.right : e.left - T.left);
|
|
113
|
+
let r = e.top - u.top + e.height / 2;
|
|
114
|
+
D = T.top - d.top + T.height / 2 - r;
|
|
115
|
+
}
|
|
116
|
+
let O = te + D + _ + h, k = Math.min(S, O), ne = S - g - _, A = O - k, re = C - 5;
|
|
117
|
+
J.style.left = `${b(E, 5, re - d.width)}px`, J.style.height = `${k}px`, J.style.maxHeight = "none", J.style.marginTop = `${g}px`, J.style.marginBottom = `${_}px`, e.style.height = "100%";
|
|
118
|
+
let j = M(p), N = A >= j - 1;
|
|
119
|
+
N && (k = Math.min(S, d.height) - (A - j));
|
|
120
|
+
let F = u.top < 20 || u.bottom > S - 20 || Math.ceil(k) + 1 < Math.min(m, v), I = (i.visualViewport?.scale ?? 1) !== 1 && c;
|
|
121
|
+
if (F || I) {
|
|
122
|
+
Z.current = !0, w(J, Q.current), me(!1);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
let R = Math.max(v, k);
|
|
126
|
+
if (N) {
|
|
127
|
+
let e = Math.max(0, S - O);
|
|
128
|
+
J.style.top = d.height >= ne ? "0" : `${e}px`, J.style.height = `${k}px`, p.scrollTop = M(p);
|
|
129
|
+
} else J.style.bottom = "0", p.scrollTop = A;
|
|
130
|
+
if (T) {
|
|
131
|
+
let t = d.top, n = d.height, r = T.top + T.height / 2, i = b(n > 0 ? (r - t) / n * 100 : 50, 0, 100);
|
|
132
|
+
e.style.setProperty("--transform-origin", `50% ${i}%`);
|
|
133
|
+
}
|
|
134
|
+
(R === S || k >= x) && (X.current = !0), B(), H && L.state.selectedIndex === null && L.state.activeIndex === null && V.current[0] != null && L.set("activeIndex", 0), Z.current = !0;
|
|
135
|
+
} finally {
|
|
136
|
+
t();
|
|
137
|
+
}
|
|
138
|
+
}, [
|
|
139
|
+
L,
|
|
140
|
+
K,
|
|
141
|
+
J,
|
|
142
|
+
q,
|
|
143
|
+
ce,
|
|
144
|
+
z,
|
|
145
|
+
le,
|
|
146
|
+
R,
|
|
147
|
+
B,
|
|
148
|
+
U,
|
|
149
|
+
me,
|
|
150
|
+
we,
|
|
151
|
+
Y,
|
|
152
|
+
V,
|
|
153
|
+
H,
|
|
154
|
+
G,
|
|
155
|
+
W
|
|
156
|
+
]), k.useEffect(() => {
|
|
157
|
+
if (!U || !J || !K) return;
|
|
158
|
+
let e = r(J);
|
|
159
|
+
function t(e) {
|
|
160
|
+
se(!1, s(o, e));
|
|
161
|
+
}
|
|
162
|
+
return l(e, "resize", t);
|
|
163
|
+
}, [
|
|
164
|
+
se,
|
|
165
|
+
U,
|
|
166
|
+
J,
|
|
167
|
+
K
|
|
168
|
+
]);
|
|
169
|
+
let Ee = {
|
|
170
|
+
...Y ? {
|
|
171
|
+
role: "presentation",
|
|
172
|
+
"aria-orientation": void 0
|
|
173
|
+
} : {
|
|
174
|
+
role: "listbox",
|
|
175
|
+
"aria-multiselectable": ue || void 0,
|
|
176
|
+
id: `${ye}-list`
|
|
177
|
+
},
|
|
178
|
+
onKeyDown(e) {
|
|
179
|
+
he && g.has(e.key) && e.stopPropagation();
|
|
180
|
+
},
|
|
17
181
|
onScroll(e) {
|
|
18
|
-
|
|
182
|
+
Y || $(e.currentTarget);
|
|
19
183
|
},
|
|
20
|
-
...
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
184
|
+
...U && { style: Y ? { height: "100%" } : te }
|
|
185
|
+
}, De = e("div", t, {
|
|
186
|
+
ref: [n, R],
|
|
187
|
+
state: Te,
|
|
188
|
+
stateAttributesMapping: re,
|
|
189
|
+
props: [
|
|
190
|
+
Se,
|
|
191
|
+
Ee,
|
|
192
|
+
T(Ce),
|
|
193
|
+
{ className: !Y && U ? E.className : void 0 },
|
|
194
|
+
F
|
|
195
|
+
]
|
|
28
196
|
});
|
|
197
|
+
return /*#__PURE__*/ A(k.Fragment, { children: [!ve && E.getElement(_e), /*#__PURE__*/ ne(f, {
|
|
198
|
+
context: ge,
|
|
199
|
+
modal: !1,
|
|
200
|
+
disabled: !xe,
|
|
201
|
+
openInteractionType: be,
|
|
202
|
+
returnFocus: j,
|
|
203
|
+
restoreFocus: !0,
|
|
204
|
+
children: De
|
|
205
|
+
})] });
|
|
29
206
|
});
|
|
30
|
-
process.env.NODE_ENV !== "production" && (
|
|
207
|
+
process.env.NODE_ENV !== "production" && (j.displayName = "SelectPopup");
|
|
208
|
+
function ie(e) {
|
|
209
|
+
let t = e.maxHeight || "";
|
|
210
|
+
return t.endsWith("px") && parseFloat(t) || Infinity;
|
|
211
|
+
}
|
|
212
|
+
function M(e) {
|
|
213
|
+
return x(e.scrollHeight, e.clientHeight);
|
|
214
|
+
}
|
|
215
|
+
function ae(e) {
|
|
216
|
+
return p.getScale(e);
|
|
217
|
+
}
|
|
218
|
+
function N(e, t, n) {
|
|
219
|
+
return e / n[t];
|
|
220
|
+
}
|
|
221
|
+
function P(e, t) {
|
|
222
|
+
return d({
|
|
223
|
+
x: N(e.x, "x", t),
|
|
224
|
+
y: N(e.y, "y", t),
|
|
225
|
+
width: N(e.width, "x", t),
|
|
226
|
+
height: N(e.height, "y", t)
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
var F = [
|
|
230
|
+
["transform", "none"],
|
|
231
|
+
["scale", "1"],
|
|
232
|
+
["translate", "0 0"]
|
|
233
|
+
];
|
|
234
|
+
function I(e) {
|
|
235
|
+
let { style: t } = e, n = {};
|
|
236
|
+
for (let [e, r] of F) n[e] = t.getPropertyValue(e), t.setProperty(e, r, "important");
|
|
237
|
+
return () => {
|
|
238
|
+
for (let [e] of F) {
|
|
239
|
+
let r = n[e];
|
|
240
|
+
r ? t.setProperty(e, r) : t.removeProperty(e);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
31
244
|
//#endregion
|
|
32
|
-
export {
|
|
245
|
+
export { j as SelectPopup };
|
|
33
246
|
|
|
34
247
|
//# sourceMappingURL=index406.js.map
|
package/dist/index406.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index406.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/list/SelectList.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { LIST_FUNCTIONAL_STYLES } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A container for the select items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectList = /*#__PURE__*/React.forwardRef(function SelectList(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n scrollHandlerRef\n } = useSelectRootContext();\n const {\n alignItemWithTriggerActive\n } = useSelectPositionerContext();\n const hasScrollArrows = useStore(store, selectors.hasScrollArrows);\n const openMethod = useStore(store, selectors.openMethod);\n const multiple = useStore(store, selectors.multiple);\n const id = useStore(store, selectors.id);\n const defaultProps = {\n id: `${id}-list`,\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n onScroll(event) {\n scrollHandlerRef.current?.(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: LIST_FUNCTIONAL_STYLES\n }),\n className: hasScrollArrows && openMethod !== 'touch' ? styleDisableScrollbar.className : undefined\n };\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setListElement],\n props: [defaultProps, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectList.displayName = \"SelectList\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AAkBA,IAAa,IAA0B,gBAAM,WAAW,SAAoB,GAAgB,GAAc;CACxG,IAAM,EACJ,WACA,cACA,UACA,GAAG,MACD,GACE,EACJ,UACA,wBACE,EAAqB,GACnB,EACJ,kCACE,EAA2B,GACzB,IAAkB,EAAS,GAAO,EAAU,eAAe,GAC3D,IAAa,EAAS,GAAO,EAAU,UAAU,GACjD,IAAW,EAAS,GAAO,EAAU,QAAQ,GAE7C,IAAe;EACnB,IAAI,GAFK,EAAS,GAAO,EAAU,EAE3B,EAAE;EACV,MAAM;EACN,wBAAwB,KAAY,KAAA;EACpC,SAAS,GAAO;GACd,EAAiB,UAAU,EAAM,aAAa;EAChD;EACA,GAAI,KAA8B,EAChC,OAAO,EACT;EACA,WAAW,KAAmB,MAAe,UAAU,EAAsB,YAAY,KAAA;CAC3F;CAIA,OAAO,EAAiB,OAAO,GAAgB;EAC7C,KAAK,CAAC,GAJe,GAAkB,MAAW;GAClD,EAAM,IAAI,eAAe,CAAO;EAClC,CAEmC,CAAC;EAClC,OAAO,CAAC,GAAc,CAAY;CACpC,CAAC;AACH,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"index406.js","names":["React","ownerWindow","platform.engine.webkit","REASONS.windowResize","floatingPlatform"],"sources":["../../../node_modules/@base-ui/react/select/popup/SelectPopup.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { rectToClientRect } from '@floating-ui/utils';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { platform } from '@base-ui/utils/platform';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStore } from '@base-ui/utils/store';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { FloatingFocusManager, platform as floatingPlatform } from \"../../floating-ui-react/index.mjs\";\nimport { useSelectFloatingContext, useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { clearStyles, LIST_FUNCTIONAL_STYLES } from \"./utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../utils/getDisabledMountTransitionStyles.mjs\";\nimport { clamp } from \"../../internals/clamp.mjs\";\nimport { getMaxScrollOffset, SCROLL_EDGE_TOLERANCE_PX } from \"../../utils/scrollEdges.mjs\";\nimport { useCSPContext } from \"../../internals/csp-context/CSPContext.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the select list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPopup = /*#__PURE__*/React.forwardRef(function SelectPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n ...elementProps\n } = componentProps;\n const {\n store,\n popupRef,\n onOpenChangeComplete,\n setOpen,\n valueRef,\n firstItemTextRef,\n selectedItemTextRef,\n multiple,\n handleScrollArrowVisibility,\n scrollHandlerRef,\n listRef,\n highlightItemOnHover\n } = useSelectRootContext();\n const {\n side,\n align,\n alignItemWithTriggerActive,\n isPositioned,\n setControlledAlignItemWithTrigger\n } = useSelectPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const floatingRootContext = useSelectFloatingContext();\n const direction = useDirection();\n const {\n nonce,\n disableStyleElements\n } = useCSPContext();\n const id = useStore(store, selectors.id);\n const open = useStore(store, selectors.open);\n const openMethod = useStore(store, selectors.openMethod);\n const mounted = useStore(store, selectors.mounted);\n const popupProps = useStore(store, selectors.popupProps);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const triggerElement = useStore(store, selectors.triggerElement);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const reachedMaxHeightRef = React.useRef(false);\n const initialPlacedRef = React.useRef(false);\n const originalPositionerStylesRef = React.useRef({});\n const scrollArrowFrame = useAnimationFrame();\n const handleScroll = useStableCallback(scroller => {\n if (!positionerElement || !popupRef.current || !initialPlacedRef.current) {\n return;\n }\n if (reachedMaxHeightRef.current || !alignItemWithTriggerActive) {\n handleScrollArrowVisibility();\n return;\n }\n const isTopPositioned = positionerElement.style.top === '0px';\n const isBottomPositioned = positionerElement.style.bottom === '0px';\n if (!isTopPositioned && !isBottomPositioned) {\n handleScrollArrowVisibility();\n return;\n }\n const scale = getScale(positionerElement);\n const currentHeight = normalizeSize(positionerElement.getBoundingClientRect().height, 'y', scale);\n const doc = ownerDocument(positionerElement);\n const win = ownerWindow(positionerElement);\n const positionerStyles = win.getComputedStyle(positionerElement);\n const marginTop = parseFloat(positionerStyles.marginTop);\n const marginBottom = parseFloat(positionerStyles.marginBottom);\n const maxPopupHeight = getMaxPopupHeight(win.getComputedStyle(popupRef.current));\n const maxAvailableHeight = Math.min(doc.documentElement.clientHeight - marginTop - marginBottom, maxPopupHeight);\n const scrollTop = scroller.scrollTop;\n const maxScrollTop = getMaxScrollTop(scroller);\n let nextPositionerHeight = 0;\n let nextScrollTop = null;\n let setReachedMax = false;\n let scrollToMax = false;\n const setHeight = height => {\n positionerElement.style.height = `${height}px`;\n };\n const handleSmallDiff = (diff, targetScrollTop) => {\n const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);\n if (heightDelta > 0) {\n // Consume the remaining scroll in height.\n setHeight(currentHeight + heightDelta);\n }\n scroller.scrollTop = targetScrollTop;\n if (maxAvailableHeight - (currentHeight + heightDelta) <= SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility();\n };\n const diff = isTopPositioned ? maxScrollTop - scrollTop : scrollTop;\n const nextHeight = Math.min(currentHeight + diff, maxAvailableHeight);\n nextPositionerHeight = nextHeight;\n if (diff <= SCROLL_EDGE_TOLERANCE_PX) {\n handleSmallDiff(diff, isTopPositioned ? maxScrollTop : 0);\n return;\n }\n if (maxAvailableHeight - nextHeight > SCROLL_EDGE_TOLERANCE_PX) {\n if (isTopPositioned) {\n scrollToMax = true;\n } else {\n nextScrollTop = 0;\n }\n } else {\n setReachedMax = true;\n if (isBottomPositioned && scrollTop < maxScrollTop) {\n const overshoot = currentHeight + diff - maxAvailableHeight;\n nextScrollTop = scrollTop - (diff - overshoot);\n }\n }\n nextPositionerHeight = Math.ceil(nextPositionerHeight);\n if (nextPositionerHeight !== 0) {\n setHeight(nextPositionerHeight);\n }\n if (scrollToMax || nextScrollTop != null) {\n // Recompute bounds after resizing (clientHeight likely changed).\n const nextMaxScrollTop = getMaxScrollTop(scroller);\n const target = scrollToMax ? nextMaxScrollTop : clamp(nextScrollTop, 0, nextMaxScrollTop);\n\n // Avoid adjustments that re-trigger scroll events forever.\n if (Math.abs(scroller.scrollTop - target) > SCROLL_EDGE_TOLERANCE_PX) {\n scroller.scrollTop = target;\n }\n }\n if (setReachedMax || nextPositionerHeight >= maxAvailableHeight - SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility();\n });\n React.useImperativeHandle(scrollHandlerRef, () => handleScroll, [handleScroll]);\n useOpenChangeComplete({\n open,\n ref: popupRef,\n onComplete() {\n if (open) {\n onOpenChangeComplete?.(true);\n }\n }\n });\n const state = {\n open,\n transitionStatus,\n side,\n align\n };\n useIsoLayoutEffect(() => {\n if (!positionerElement || !popupRef.current || Object.keys(originalPositionerStylesRef.current).length) {\n return;\n }\n originalPositionerStylesRef.current = {\n top: positionerElement.style.top || '0',\n left: positionerElement.style.left || '0',\n right: positionerElement.style.right,\n height: positionerElement.style.height,\n bottom: positionerElement.style.bottom,\n minHeight: positionerElement.style.minHeight,\n maxHeight: positionerElement.style.maxHeight,\n marginTop: positionerElement.style.marginTop,\n marginBottom: positionerElement.style.marginBottom\n };\n }, [popupRef, positionerElement]);\n useIsoLayoutEffect(() => {\n if (open || alignItemWithTriggerActive) {\n return;\n }\n initialPlacedRef.current = false;\n reachedMaxHeightRef.current = false;\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n }, [open, alignItemWithTriggerActive, positionerElement, popupRef]);\n useIsoLayoutEffect(() => {\n const popupElement = popupRef.current;\n\n // Wait for Floating UI's first positioning pass before reading DOM geometry.\n // We replace the final coordinates for aligned selects, but still need middleware\n // like `size()` to set CSS variables such as `--anchor-width`.\n if (!open || !triggerElement || !positionerElement || !popupElement || alignItemWithTriggerActive && !isPositioned || store.state.transitionStatus === 'ending') {\n return;\n }\n if (!alignItemWithTriggerActive) {\n initialPlacedRef.current = true;\n scrollArrowFrame.request(handleScrollArrowVisibility);\n popupElement.style.removeProperty('--transform-origin');\n return;\n }\n\n // Ensure we remove any transforms that can affect the location of the popup\n // and therefore the calculations.\n const restoreTransformStyles = unsetTransformStyles(popupElement);\n popupElement.style.removeProperty('--transform-origin');\n try {\n let textElement = selectedItemTextRef.current;\n if (!textElement?.isConnected) {\n const hasSelectedValue = selectors.hasSelectedValue(store.state);\n textElement = !hasSelectedValue && firstItemTextRef.current?.isConnected ? firstItemTextRef.current : null;\n }\n const valueElement = valueRef.current;\n const win = ownerWindow(positionerElement);\n const positionerStyles = win.getComputedStyle(positionerElement);\n const popupStyles = win.getComputedStyle(popupElement);\n const doc = ownerDocument(triggerElement);\n const scale = getScale(triggerElement);\n const triggerRect = normalizeRect(triggerElement.getBoundingClientRect(), scale);\n const positionerRect = normalizeRect(positionerElement.getBoundingClientRect(), scale);\n const triggerHeight = triggerRect.height;\n const scroller = listElement || popupElement;\n const scrollHeight = scroller.scrollHeight;\n const borderBottom = parseFloat(popupStyles.borderBottomWidth);\n // The `|| N` fallbacks cover an unset/`auto` value (parses to `NaN`). Note a literal `0`\n // also resolves to the fallback, so an explicit `margin: 0` or `min-height: 0` still takes\n // the default below.\n const marginTop = parseFloat(positionerStyles.marginTop) || 10;\n const marginBottom = parseFloat(positionerStyles.marginBottom) || 10;\n const minHeight = parseFloat(positionerStyles.minHeight) || 100;\n const maxPopupHeight = getMaxPopupHeight(popupStyles);\n const paddingLeft = 5;\n const paddingRight = 5;\n const triggerCollisionThreshold = 20;\n const viewportHeight = doc.documentElement.clientHeight - marginTop - marginBottom;\n const viewportWidth = doc.documentElement.clientWidth;\n const availableSpaceBeneathTrigger = viewportHeight - triggerRect.bottom + triggerHeight;\n let textRect;\n let alignedLeft = direction === 'rtl' ? triggerRect.right - positionerRect.width : triggerRect.left;\n let offsetY = 0;\n if (textElement && valueElement) {\n const valueRect = normalizeRect(valueElement.getBoundingClientRect(), scale);\n textRect = normalizeRect(textElement.getBoundingClientRect(), scale);\n alignedLeft = positionerRect.left + (direction === 'rtl' ? valueRect.right - textRect.right : valueRect.left - textRect.left);\n const valueCenterFromTriggerTop = valueRect.top - triggerRect.top + valueRect.height / 2;\n const textCenterFromPositionerTop = textRect.top - positionerRect.top + textRect.height / 2;\n offsetY = textCenterFromPositionerTop - valueCenterFromTriggerTop;\n }\n const idealHeight = availableSpaceBeneathTrigger + offsetY + marginBottom + borderBottom;\n let height = Math.min(viewportHeight, idealHeight);\n const maxHeight = viewportHeight - marginTop - marginBottom;\n const scrollTop = idealHeight - height;\n const maxRight = viewportWidth - paddingRight;\n positionerElement.style.left = `${clamp(alignedLeft, paddingLeft, maxRight - positionerRect.width)}px`;\n positionerElement.style.height = `${height}px`;\n // `none` (not the invalid `auto`) so the explicit height governs in align mode and isn't\n // clamped by a `max-height` from user CSS.\n positionerElement.style.maxHeight = 'none';\n positionerElement.style.marginTop = `${marginTop}px`;\n positionerElement.style.marginBottom = `${marginBottom}px`;\n popupElement.style.height = '100%';\n const maxScrollTop = getMaxScrollTop(scroller);\n const isTopPositioned = scrollTop >= maxScrollTop - SCROLL_EDGE_TOLERANCE_PX;\n if (isTopPositioned) {\n height = Math.min(viewportHeight, positionerRect.height) - (scrollTop - maxScrollTop);\n }\n\n // When the trigger is too close to the top or bottom of the viewport, or the minHeight is\n // reached, we fallback to aligning the popup to the trigger as the UX is poor otherwise.\n const fallbackToAlignPopupToTrigger = triggerRect.top < triggerCollisionThreshold || triggerRect.bottom > viewportHeight - triggerCollisionThreshold || Math.ceil(height) + SCROLL_EDGE_TOLERANCE_PX < Math.min(scrollHeight, minHeight);\n\n // Safari doesn't position the popup correctly when pinch-zoomed.\n const isPinchZoomed = (win.visualViewport?.scale ?? 1) !== 1 && platform.engine.webkit;\n if (fallbackToAlignPopupToTrigger || isPinchZoomed) {\n initialPlacedRef.current = true;\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n setControlledAlignItemWithTrigger(false);\n return;\n }\n const initialHeight = Math.max(minHeight, height);\n if (isTopPositioned) {\n const topOffset = Math.max(0, viewportHeight - idealHeight);\n positionerElement.style.top = positionerRect.height >= maxHeight ? '0' : `${topOffset}px`;\n positionerElement.style.height = `${height}px`;\n scroller.scrollTop = getMaxScrollTop(scroller);\n } else {\n positionerElement.style.bottom = '0';\n scroller.scrollTop = scrollTop;\n }\n if (textRect) {\n const popupTop = positionerRect.top;\n const popupHeight = positionerRect.height;\n const textCenterY = textRect.top + textRect.height / 2;\n const transformOriginY = popupHeight > 0 ? (textCenterY - popupTop) / popupHeight * 100 : 50;\n const clampedY = clamp(transformOriginY, 0, 100);\n popupElement.style.setProperty('--transform-origin', `50% ${clampedY}%`);\n }\n if (initialHeight === viewportHeight || height >= maxPopupHeight) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility();\n if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && listRef.current[0] != null) {\n store.set('activeIndex', 0);\n }\n initialPlacedRef.current = true;\n } finally {\n restoreTransformStyles();\n }\n }, [store, open, positionerElement, triggerElement, valueRef, firstItemTextRef, selectedItemTextRef, popupRef, handleScrollArrowVisibility, alignItemWithTriggerActive, setControlledAlignItemWithTrigger, scrollArrowFrame, listElement, listRef, highlightItemOnHover, direction, isPositioned]);\n React.useEffect(() => {\n if (!alignItemWithTriggerActive || !positionerElement || !open) {\n return undefined;\n }\n const win = ownerWindow(positionerElement);\n function handleResize(event) {\n setOpen(false, createChangeEventDetails(REASONS.windowResize, event));\n }\n return addEventListener(win, 'resize', handleResize);\n }, [setOpen, alignItemWithTriggerActive, positionerElement, open]);\n const defaultProps = {\n ...(listElement ? {\n role: 'presentation',\n 'aria-orientation': undefined\n } : {\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n id: `${id}-list`\n }),\n onKeyDown(event) {\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n onScroll(event) {\n if (listElement) {\n return;\n }\n handleScroll(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: listElement ? {\n height: '100%'\n } : LIST_FUNCTIONAL_STYLES\n })\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, popupRef],\n state,\n stateAttributesMapping,\n props: [popupProps, defaultProps, getDisabledMountTransitionStyles(transitionStatus), {\n className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : undefined\n }, elementProps]\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n modal: false,\n disabled: !mounted,\n openInteractionType: openMethod,\n returnFocus: finalFocus,\n restoreFocus: true,\n children: element\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPopup.displayName = \"SelectPopup\";\nfunction getMaxPopupHeight(popupStyles) {\n const maxHeightStyle = popupStyles.maxHeight || '';\n return maxHeightStyle.endsWith('px') ? parseFloat(maxHeightStyle) || Infinity : Infinity;\n}\nfunction getMaxScrollTop(scroller) {\n return getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n}\nfunction getScale(element) {\n // The platform API is async-capable, but the DOM platform returns a plain scale object.\n return floatingPlatform.getScale(element);\n}\nfunction normalizeSize(size, axis, scale) {\n return size / scale[axis];\n}\nfunction normalizeRect(rect, scale) {\n return rectToClientRect({\n x: normalizeSize(rect.x, 'x', scale),\n y: normalizeSize(rect.y, 'y', scale),\n width: normalizeSize(rect.width, 'x', scale),\n height: normalizeSize(rect.height, 'y', scale)\n });\n}\nconst TRANSFORM_STYLE_RESETS = [['transform', 'none'], ['scale', '1'], ['translate', '0 0']];\nfunction unsetTransformStyles(popupElement) {\n const {\n style\n } = popupElement;\n const originalStyles = {};\n for (const [property, value] of TRANSFORM_STYLE_RESETS) {\n originalStyles[property] = style.getPropertyValue(property);\n style.setProperty(property, value, 'important');\n }\n return () => {\n for (const [property] of TRANSFORM_STYLE_RESETS) {\n const originalValue = originalStyles[property];\n if (originalValue) {\n style.setProperty(property, originalValue);\n } else {\n style.removeProperty(property);\n }\n }\n };\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,KAAyB;CAC7B,GAAG;CACH,GAAG;AACL,GAQa,IAA2B,gBAAM,WAAW,SAAqB,GAAgB,GAAc;CAC1G,IAAM,EACJ,WACA,cACA,UACA,eACA,GAAG,MACD,GACE,EACJ,UACA,aACA,0BACA,aACA,cACA,qBACA,yBACA,cACA,gCACA,sBACA,YACA,4BACE,EAAqB,GACnB,EACJ,UACA,WACA,+BACA,iBACA,0CACE,EAA2B,GACzB,KAAgB,EAAsB,EAAI,KAAK,MAC/C,KAAsB,EAAyB,GAC/C,IAAY,EAAa,GACzB,EACJ,WACA,6BACE,EAAc,GACZ,KAAK,EAAS,GAAO,EAAU,EAAE,GACjC,IAAO,EAAS,GAAO,EAAU,IAAI,GACrC,KAAa,EAAS,GAAO,EAAU,UAAU,GACjD,KAAU,EAAS,GAAO,EAAU,OAAO,GAC3C,KAAa,EAAS,GAAO,EAAU,UAAU,GACjD,KAAmB,EAAS,GAAO,EAAU,gBAAgB,GAC7D,IAAiB,EAAS,GAAO,EAAU,cAAc,GACzD,IAAoB,EAAS,GAAO,EAAU,iBAAiB,GAC/D,IAAc,EAAS,GAAO,EAAU,WAAW,GACnD,IAAsBA,EAAM,OAAO,EAAK,GACxC,IAAmBA,EAAM,OAAO,EAAK,GACrC,IAA8BA,EAAM,OAAO,CAAC,CAAC,GAC7C,KAAmB,EAAkB,GACrC,IAAe,GAAkB,MAAY;EACjD,IAAI,CAAC,KAAqB,CAAC,EAAS,WAAW,CAAC,EAAiB,SAC/D;EAEF,IAAI,EAAoB,WAAW,CAAC,GAA4B;GAC9D,EAA4B;GAC5B;EACF;EACA,IAAM,IAAkB,EAAkB,MAAM,QAAQ,OAClD,IAAqB,EAAkB,MA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F,EAAM,YAAY,GAAU,CAAa,IAEzC,EAAM,eAAe,CAAQ;EAEjC;CACF;AACF"}
|
package/dist/index407.js
CHANGED
|
@@ -1,56 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_,
|
|
23
|
-
p,
|
|
24
|
-
m,
|
|
25
|
-
a,
|
|
26
|
-
s
|
|
27
|
-
]);
|
|
28
|
-
return e(() => {
|
|
29
|
-
if (l != null) return;
|
|
30
|
-
let e = y.current;
|
|
31
|
-
if (e) return u(e, o), () => {
|
|
32
|
-
d(e);
|
|
33
|
-
};
|
|
34
|
-
}, [
|
|
35
|
-
l,
|
|
36
|
-
u,
|
|
37
|
-
d,
|
|
38
|
-
o
|
|
39
|
-
]), e(() => {
|
|
40
|
-
if (l == null) return f((e) => {
|
|
41
|
-
let t = y.current ? e.get(y.current)?.index : null;
|
|
42
|
-
t != null && v(t);
|
|
43
|
-
});
|
|
44
|
-
}, [
|
|
45
|
-
l,
|
|
46
|
-
f,
|
|
47
|
-
v
|
|
48
|
-
]), {
|
|
49
|
-
ref: b,
|
|
50
|
-
index: _
|
|
2
|
+
import { useRenderElement as e } from "./index196.js";
|
|
3
|
+
import { useStableCallback as t } from "./index202.js";
|
|
4
|
+
import { useStore as n } from "./index260.js";
|
|
5
|
+
import { useSelectRootContext as r } from "./index367.js";
|
|
6
|
+
import { selectors as i } from "./index377.js";
|
|
7
|
+
import { useSelectPositionerContext as a } from "./index397.js";
|
|
8
|
+
import { LIST_FUNCTIONAL_STYLES as o } from "./index398.js";
|
|
9
|
+
import { styleDisableScrollbar as s } from "./index403.js";
|
|
10
|
+
import * as c from "react";
|
|
11
|
+
//#region ../../node_modules/@base-ui/react/select/list/SelectList.mjs
|
|
12
|
+
var l = /*#__PURE__*/ c.forwardRef(function(c, l) {
|
|
13
|
+
let { render: u, className: d, style: f, ...p } = c, { store: m, scrollHandlerRef: h } = r(), { alignItemWithTriggerActive: g } = a(), _ = n(m, i.hasScrollArrows), v = n(m, i.openMethod), y = n(m, i.multiple), b = {
|
|
14
|
+
id: `${n(m, i.id)}-list`,
|
|
15
|
+
role: "listbox",
|
|
16
|
+
"aria-multiselectable": y || void 0,
|
|
17
|
+
onScroll(e) {
|
|
18
|
+
h.current?.(e.currentTarget);
|
|
19
|
+
},
|
|
20
|
+
...g && { style: o },
|
|
21
|
+
className: _ && v !== "touch" ? s.className : void 0
|
|
51
22
|
};
|
|
52
|
-
|
|
23
|
+
return e("div", c, {
|
|
24
|
+
ref: [l, t((e) => {
|
|
25
|
+
m.set("listElement", e);
|
|
26
|
+
})],
|
|
27
|
+
props: [b, p]
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
process.env.NODE_ENV !== "production" && (l.displayName = "SelectList");
|
|
53
31
|
//#endregion
|
|
54
|
-
export {
|
|
32
|
+
export { l as SelectList };
|
|
55
33
|
|
|
56
34
|
//# sourceMappingURL=index407.js.map
|
package/dist/index407.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index407.js","names":[
|
|
1
|
+
{"version":3,"file":"index407.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/list/SelectList.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { LIST_FUNCTIONAL_STYLES } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A container for the select items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectList = /*#__PURE__*/React.forwardRef(function SelectList(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n scrollHandlerRef\n } = useSelectRootContext();\n const {\n alignItemWithTriggerActive\n } = useSelectPositionerContext();\n const hasScrollArrows = useStore(store, selectors.hasScrollArrows);\n const openMethod = useStore(store, selectors.openMethod);\n const multiple = useStore(store, selectors.multiple);\n const id = useStore(store, selectors.id);\n const defaultProps = {\n id: `${id}-list`,\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n onScroll(event) {\n scrollHandlerRef.current?.(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: LIST_FUNCTIONAL_STYLES\n }),\n className: hasScrollArrows && openMethod !== 'touch' ? styleDisableScrollbar.className : undefined\n };\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setListElement],\n props: [defaultProps, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectList.displayName = \"SelectList\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AAkBA,IAAa,IAA0B,gBAAM,WAAW,SAAoB,GAAgB,GAAc;CACxG,IAAM,EACJ,WACA,cACA,UACA,GAAG,MACD,GACE,EACJ,UACA,wBACE,EAAqB,GACnB,EACJ,kCACE,EAA2B,GACzB,IAAkB,EAAS,GAAO,EAAU,eAAe,GAC3D,IAAa,EAAS,GAAO,EAAU,UAAU,GACjD,IAAW,EAAS,GAAO,EAAU,QAAQ,GAE7C,IAAe;EACnB,IAAI,GAFK,EAAS,GAAO,EAAU,EAE3B,EAAE;EACV,MAAM;EACN,wBAAwB,KAAY,KAAA;EACpC,SAAS,GAAO;GACd,EAAiB,UAAU,EAAM,aAAa;EAChD;EACA,GAAI,KAA8B,EAChC,OAAO,EACT;EACA,WAAW,KAAmB,MAAe,UAAU,EAAsB,YAAY,KAAA;CAC3F;CAIA,OAAO,EAAiB,OAAO,GAAgB;EAC7C,KAAK,CAAC,GAJe,GAAkB,MAAW;GAClD,EAAM,IAAI,eAAe,CAAO;EAClC,CAEmC,CAAC;EAClC,OAAO,CAAC,GAAc,CAAY;CACpC,CAAC;AACH,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAW,cAAc"}
|
package/dist/index408.js
CHANGED
|
@@ -1,15 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from "./
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { useIsoLayoutEffect as e } from "./index204.js";
|
|
3
|
+
import { useCompositeListContext as t } from "./index390.js";
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
//#region ../../node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
|
|
6
|
+
var r = /*#__PURE__*/ function(e) {
|
|
7
|
+
return e[e.None = 0] = "None", e[e.GuessFromOrder = 1] = "GuessFromOrder", e;
|
|
8
|
+
}({});
|
|
9
|
+
function i(i = {}) {
|
|
10
|
+
let { label: a, metadata: o, textRef: s, indexGuessBehavior: c, index: l } = i, { register: u, unregister: d, subscribeMapChange: f, elementsRef: p, labelsRef: m, nextIndexRef: h } = t(), g = n.useRef(-1), [_, v] = n.useState(l ?? (c === r.GuessFromOrder ? () => {
|
|
11
|
+
if (g.current === -1) {
|
|
12
|
+
let e = h.current;
|
|
13
|
+
h.current += 1, g.current = e;
|
|
14
|
+
}
|
|
15
|
+
return g.current;
|
|
16
|
+
} : -1)), y = n.useRef(null), b = n.useCallback((e) => {
|
|
17
|
+
if (y.current = e, _ !== -1 && e !== null && (p.current[_] = e, m)) {
|
|
18
|
+
let t = a !== void 0;
|
|
19
|
+
m.current[_] = t ? a : s?.current?.textContent ?? e.textContent;
|
|
20
|
+
}
|
|
21
|
+
}, [
|
|
22
|
+
_,
|
|
23
|
+
p,
|
|
24
|
+
m,
|
|
25
|
+
a,
|
|
26
|
+
s
|
|
27
|
+
]);
|
|
28
|
+
return e(() => {
|
|
29
|
+
if (l != null) return;
|
|
30
|
+
let e = y.current;
|
|
31
|
+
if (e) return u(e, o), () => {
|
|
32
|
+
d(e);
|
|
33
|
+
};
|
|
34
|
+
}, [
|
|
35
|
+
l,
|
|
36
|
+
u,
|
|
37
|
+
d,
|
|
38
|
+
o
|
|
39
|
+
]), e(() => {
|
|
40
|
+
if (l == null) return f((e) => {
|
|
41
|
+
let t = y.current ? e.get(y.current)?.index : null;
|
|
42
|
+
t != null && v(t);
|
|
43
|
+
});
|
|
44
|
+
}, [
|
|
45
|
+
l,
|
|
46
|
+
f,
|
|
47
|
+
v
|
|
48
|
+
]), {
|
|
49
|
+
ref: b,
|
|
50
|
+
index: _
|
|
51
|
+
};
|
|
11
52
|
}
|
|
12
53
|
//#endregion
|
|
13
|
-
export {
|
|
54
|
+
export { r as IndexGuessBehavior, i as useCompositeListItem };
|
|
14
55
|
|
|
15
56
|
//# sourceMappingURL=index408.js.map
|
package/dist/index408.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index408.js","names":["React"
|
|
1
|
+
{"version":3,"file":"index408.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useCompositeListContext } from \"./CompositeListContext.mjs\";\nexport let IndexGuessBehavior = /*#__PURE__*/function (IndexGuessBehavior) {\n IndexGuessBehavior[IndexGuessBehavior[\"None\"] = 0] = \"None\";\n IndexGuessBehavior[IndexGuessBehavior[\"GuessFromOrder\"] = 1] = \"GuessFromOrder\";\n return IndexGuessBehavior;\n}({});\n\n/**\n * Used to register a list item and its index (DOM position) in the `CompositeList`.\n */\nexport function useCompositeListItem(params = {}) {\n const {\n label,\n metadata,\n textRef,\n indexGuessBehavior,\n index: externalIndex\n } = params;\n const {\n register,\n unregister,\n subscribeMapChange,\n elementsRef,\n labelsRef,\n nextIndexRef\n } = useCompositeListContext();\n const indexRef = React.useRef(-1);\n const [index, setIndex] = React.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {\n if (indexRef.current === -1) {\n const newIndex = nextIndexRef.current;\n nextIndexRef.current += 1;\n indexRef.current = newIndex;\n }\n return indexRef.current;\n } : -1));\n const componentRef = React.useRef(null);\n const ref = React.useCallback(node => {\n componentRef.current = node;\n if (index !== -1 && node !== null) {\n elementsRef.current[index] = node;\n if (labelsRef) {\n const isLabelDefined = label !== undefined;\n labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;\n }\n }\n }, [index, elementsRef, labelsRef, label, textRef]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n const node = componentRef.current;\n if (node) {\n register(node, metadata);\n return () => {\n unregister(node);\n };\n }\n return undefined;\n }, [externalIndex, register, unregister, metadata]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n return subscribeMapChange(map => {\n const i = componentRef.current ? map.get(componentRef.current)?.index : null;\n if (i != null) {\n setIndex(i);\n }\n });\n }, [externalIndex, subscribeMapChange, setIndex]);\n return {\n ref,\n index\n };\n}"],"x_google_ignoreList":[0],"mappings":";;;;;AAKA,IAAW,IAAkC,uBAAU,GAAoB;CAGzE,OAFA,EAAmB,EAAmB,OAAU,KAAK,QACrD,EAAmB,EAAmB,iBAAoB,KAAK,kBACxD;AACT,EAAE,CAAC,CAAC;AAKJ,SAAgB,EAAqB,IAAS,CAAC,GAAG;CAChD,IAAM,EACJ,UACA,aACA,YACA,uBACA,OAAO,MACL,GACE,EACJ,aACA,eAC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