@rpcbase/ui 0.252.0 → 0.254.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/components/Notifications/types.d.ts +2 -0
- package/dist/components/Notifications/types.d.ts.map +1 -1
- package/dist/index10.js +2 -2
- package/dist/index106.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index12.js +3 -3
- package/dist/index120.js +10 -10
- package/dist/index122.js +2 -2
- package/dist/index123.js +3 -3
- package/dist/index13.js +2 -2
- package/dist/index14.js +2 -2
- package/dist/index15.js +2 -2
- package/dist/index16.js +8 -8
- package/dist/index167.js +3 -3
- package/dist/index17.js +1 -1
- package/dist/index172.js +3 -3
- package/dist/index175.js +1 -1
- package/dist/index176.js +4 -4
- package/dist/index18.js +7 -7
- package/dist/index182.js +2 -2
- package/dist/index184.js +4 -4
- package/dist/index185.js +14 -14
- package/dist/index186.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index188.js +6 -6
- package/dist/index189.js +2 -2
- package/dist/index19.js +16 -16
- package/dist/index192.js +2 -2
- package/dist/index193.js +6 -6
- package/dist/index21.js +1 -1
- package/dist/index22.js +2 -2
- package/dist/index23.js +1 -1
- package/dist/index235.js +27 -14
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +12 -7
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +24 -9
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +5 -10
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +15 -20
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index240.js +7 -8
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +10 -9
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +10 -9
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +21 -4
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +8 -5
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +9 -16
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +8 -8
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +4 -18
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +5 -20
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +16 -12
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +1 -1
- package/dist/index250.js +9 -29
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +18 -12
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +20 -25
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +12 -5
- package/dist/index253.js.map +1 -1
- package/dist/index260.js +2 -2
- package/dist/index273.js +1 -1
- package/dist/index277.js +25 -20
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +24 -62
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +16 -6
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +1 -1
- package/dist/index280.js +20 -6
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +66 -11
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +6 -3
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +5 -50
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +12 -4
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +3 -29
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +49 -15
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +4 -6
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +28 -20
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +15 -52
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +3 -56
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +5 -20
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +21 -41
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +53 -39
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +21 -46
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +40 -19
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +38 -69
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +46 -18
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +20 -3
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +69 -10
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +16 -12
- package/dist/index299.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.js +242 -3
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +3 -18
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +11 -36
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +12 -238
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +15 -249
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +35 -67
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +233 -93
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +243 -74
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +68 -3
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +96 -26
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +83 -16
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +21 -239
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +4 -35
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +28 -16
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +16 -3
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +35 -27
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +17 -28
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +4 -4
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +23 -75
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +25 -269
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +4 -12
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +79 -11
- package/dist/index319.js.map +1 -1
- package/dist/index32.js +4 -23
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +270 -23
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +11 -16
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +10 -125
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +24 -4
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +16 -65
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +125 -13
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +5 -7
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +65 -5
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +14 -4
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +7 -10
- package/dist/index329.js.map +1 -1
- package/dist/index33.js +6 -3
- package/dist/index33.js.map +1 -1
- package/dist/index330.js +5 -7
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +3 -133
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +9 -398
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +8 -5
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +131 -50
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +399 -11
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +5 -28
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +52 -11
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +11 -24
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +27 -28
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +38 -8
- package/dist/index34.js.map +1 -1
- package/dist/index340.js +11 -16
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +1 -1
- package/dist/index348.js +5 -51
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +51 -5
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +74 -35
- package/dist/index35.js.map +1 -1
- package/dist/index350.js +3 -3
- package/dist/index358.js +5 -5
- package/dist/index359.js +1 -1
- package/dist/index36.js +20 -74
- package/dist/index36.js.map +1 -1
- package/dist/index363.js +5 -5
- package/dist/index368.js +11 -5
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +6 -3
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +33 -18
- package/dist/index37.js.map +1 -1
- package/dist/index370.js +3 -12
- package/dist/index370.js.map +1 -1
- package/dist/index372.js +1 -1
- package/dist/index375.js +2 -2
- package/dist/index376.js +3 -3
- package/dist/index377.js +8 -8
- package/dist/index379.js +5 -5
- package/dist/index38.js +26 -36
- package/dist/index38.js.map +1 -1
- package/dist/index380.js +3 -3
- package/dist/index382.js +1 -1
- package/dist/index384.js +1 -1
- package/dist/index385.js +2 -2
- package/dist/index386.js +1 -1
- package/dist/index388.js +2 -2
- package/dist/index389.js +2 -2
- package/dist/index39.js +21 -26
- package/dist/index39.js.map +1 -1
- package/dist/index399.js +2 -2
- package/dist/index4.js +2 -2
- package/dist/index40.js +56 -20
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +51 -59
- package/dist/index41.js.map +1 -1
- package/dist/index411.js +3 -15
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +15 -3
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +1 -1
- package/dist/index414.js +68 -5
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +30 -55
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +9 -68
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +148 -26
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +108 -9
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +5 -153
- package/dist/index419.js.map +1 -1
- package/dist/index42.js +21 -50
- package/dist/index42.js.map +1 -1
- package/dist/index420.js +54 -106
- package/dist/index420.js.map +1 -1
- package/dist/index43.js +127 -18
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +39 -122
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +85 -42
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +123 -87
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +5 -126
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +332 -5
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +245 -320
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +2 -2
- package/dist/index50.js +23 -254
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +129 -25
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +24 -129
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +19 -22
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +134 -19
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +30 -133
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +24 -30
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +38 -26
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +19 -39
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +133 -18
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +4 -4
- package/dist/index60.js +49 -134
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +25 -48
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +57 -28
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +56 -57
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +5 -5
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +23 -11
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +232 -17
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +5 -5
- package/dist/index68.js.map +1 -1
- package/dist/index7.js +11 -11
- package/dist/index70.js +11 -23
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +17 -232
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +6 -2
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +8 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +6 -2
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +2 -2
- package/dist/index76.js +2 -6
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +2 -8
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +2 -6
- package/dist/index78.js.map +1 -1
- package/dist/index8.js +2 -2
- package/dist/index9.js +1 -1
- package/package.json +1 -1
package/dist/index59.js
CHANGED
|
@@ -1,24 +1,139 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { inertValue as ue } from "./index186.js";
|
|
3
|
+
import { useIsoLayoutEffect as M } from "./index287.js";
|
|
4
|
+
import { useStableCallback as O } from "./index288.js";
|
|
5
|
+
import { useSelectRootContext as fe, useSelectFloatingContext as me } from "./index291.js";
|
|
6
|
+
import { CompositeList as de } from "./index319.js";
|
|
7
|
+
import { useAnchorPositioning as pe } from "./index320.js";
|
|
8
|
+
import { SelectPositionerContext as ge } from "./index321.js";
|
|
9
|
+
import { InternalBackdrop as he } from "./index187.js";
|
|
10
|
+
import { DROPDOWN_COLLISION_AVOIDANCE as Ie } from "./index191.js";
|
|
11
|
+
import { clearStyles as k } from "./index322.js";
|
|
12
|
+
import { selectors as t } from "./index296.js";
|
|
13
|
+
import { createChangeEventDetails as Ae } from "./index175.js";
|
|
14
|
+
import { findItemIndex as S, selectedValueIncludes as Re } from "./index299.js";
|
|
15
|
+
import { usePositioner as Se } from "./index323.js";
|
|
16
|
+
import { useAnchoredPopupScrollLock as Ve } from "./index324.js";
|
|
17
|
+
import { j as V } from "./index28.js";
|
|
18
|
+
import { useStore as o } from "./index303.js";
|
|
19
|
+
import { none as xe } from "./index177.js";
|
|
20
|
+
const be = {
|
|
21
|
+
position: "fixed"
|
|
22
|
+
}, Ee = /* @__PURE__ */ l.forwardRef(function(x, N) {
|
|
9
23
|
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
anchor: W,
|
|
25
|
+
positionMethod: j = "absolute",
|
|
26
|
+
className: we,
|
|
27
|
+
render: Ce,
|
|
28
|
+
side: z = "bottom",
|
|
29
|
+
align: L = "center",
|
|
30
|
+
sideOffset: U = 0,
|
|
31
|
+
alignOffset: H = 0,
|
|
32
|
+
collisionBoundary: _ = "clipping-ancestors",
|
|
33
|
+
collisionPadding: q,
|
|
34
|
+
arrowPadding: B = 5,
|
|
35
|
+
sticky: F = !1,
|
|
36
|
+
disableAnchorTracking: X,
|
|
37
|
+
alignItemWithTrigger: g = !0,
|
|
38
|
+
collisionAvoidance: G = Ie,
|
|
39
|
+
style: ye,
|
|
40
|
+
...J
|
|
41
|
+
} = x, {
|
|
42
|
+
store: e,
|
|
43
|
+
listRef: K,
|
|
44
|
+
labelsRef: Q,
|
|
45
|
+
alignItemWithTriggerActiveRef: Y,
|
|
46
|
+
selectedItemTextRef: b,
|
|
47
|
+
valuesRef: d,
|
|
48
|
+
initialValueRef: Z,
|
|
49
|
+
popupRef: $,
|
|
50
|
+
setValue: E
|
|
51
|
+
} = fe(), ee = me(), u = o(e, t.open), r = o(e, t.mounted), v = o(e, t.modal), c = o(e, t.value), w = o(e, t.openMethod), C = o(e, t.positionerElement), y = o(e, t.triggerElement), p = o(e, t.isItemEqualToValue), te = o(e, t.transitionStatus), oe = l.useRef(null), ne = l.useRef(null), [P, h] = l.useState(g), n = r && P && w !== "touch";
|
|
52
|
+
!r && P !== g && h(g), M(() => {
|
|
53
|
+
r || (t.scrollUpArrowVisible(e.state) && e.set("scrollUpArrowVisible", !1), t.scrollDownArrowVisible(e.state) && e.set("scrollDownArrowVisible", !1));
|
|
54
|
+
}, [e, r]), l.useImperativeHandle(Y, () => n), Ve((n || v) && u, w === "touch", C, y);
|
|
55
|
+
const i = pe({
|
|
56
|
+
anchor: W,
|
|
57
|
+
floatingRootContext: ee,
|
|
58
|
+
positionMethod: j,
|
|
59
|
+
mounted: r,
|
|
60
|
+
side: z,
|
|
61
|
+
sideOffset: U,
|
|
62
|
+
align: L,
|
|
63
|
+
alignOffset: H,
|
|
64
|
+
arrowPadding: B,
|
|
65
|
+
collisionBoundary: _,
|
|
66
|
+
collisionPadding: q,
|
|
67
|
+
sticky: F,
|
|
68
|
+
disableAnchorTracking: X ?? n,
|
|
69
|
+
collisionAvoidance: G,
|
|
70
|
+
keepMounted: !0
|
|
71
|
+
}), I = n ? "none" : i.side, ie = n ? be : i.positionerStyles, se = {
|
|
72
|
+
open: u,
|
|
73
|
+
side: I,
|
|
74
|
+
align: i.align,
|
|
75
|
+
anchorHidden: i.anchorHidden
|
|
76
|
+
};
|
|
77
|
+
M(() => {
|
|
78
|
+
e.set("popupSide", i.side);
|
|
79
|
+
}, [e, i.side]);
|
|
80
|
+
const re = O((f) => {
|
|
81
|
+
e.set("positionerElement", f);
|
|
82
|
+
}), le = Se(x, se, {
|
|
83
|
+
styles: ie,
|
|
84
|
+
transitionStatus: te,
|
|
85
|
+
props: J,
|
|
86
|
+
refs: [N, re],
|
|
87
|
+
hidden: !r,
|
|
88
|
+
inert: !u
|
|
89
|
+
}), A = l.useRef(0), ce = O((f) => {
|
|
90
|
+
if (f.size === 0 && A.current === 0 || d.current.length === 0)
|
|
91
|
+
return;
|
|
92
|
+
const R = A.current;
|
|
93
|
+
if (A.current = f.size, f.size === R)
|
|
94
|
+
return;
|
|
95
|
+
const D = Ae(xe);
|
|
96
|
+
if (R !== 0 && !e.state.multiple && c !== null && S(d.current, c, p) === -1) {
|
|
97
|
+
const s = Z.current, T = s != null && S(d.current, s, p) !== -1 ? s : null;
|
|
98
|
+
E(T, D), T === null && (e.set("selectedIndex", null), b.current = null);
|
|
99
|
+
}
|
|
100
|
+
if (R !== 0 && e.state.multiple && Array.isArray(c)) {
|
|
101
|
+
const m = (a) => S(d.current, a, p) !== -1, s = c.filter((a) => m(a));
|
|
102
|
+
(s.length !== c.length || s.some((a) => !Re(c, a, p))) && (E(s, D), s.length === 0 && (e.set("selectedIndex", null), b.current = null));
|
|
103
|
+
}
|
|
104
|
+
if (u && n) {
|
|
105
|
+
e.update({
|
|
106
|
+
scrollUpArrowVisible: !1,
|
|
107
|
+
scrollDownArrowVisible: !1
|
|
108
|
+
});
|
|
109
|
+
const m = {
|
|
110
|
+
height: ""
|
|
111
|
+
};
|
|
112
|
+
k(C, m), k($.current, m);
|
|
113
|
+
}
|
|
114
|
+
}), ae = l.useMemo(() => ({
|
|
115
|
+
...i,
|
|
116
|
+
side: I,
|
|
117
|
+
alignItemWithTriggerActive: n,
|
|
118
|
+
setControlledAlignItemWithTrigger: h,
|
|
119
|
+
scrollUpArrowRef: oe,
|
|
120
|
+
scrollDownArrowRef: ne
|
|
121
|
+
}), [i, I, n, h]);
|
|
122
|
+
return /* @__PURE__ */ V.jsx(de, {
|
|
123
|
+
elementsRef: K,
|
|
124
|
+
labelsRef: Q,
|
|
125
|
+
onMapChange: ce,
|
|
126
|
+
children: /* @__PURE__ */ V.jsxs(ge.Provider, {
|
|
127
|
+
value: ae,
|
|
128
|
+
children: [r && v && /* @__PURE__ */ V.jsx(he, {
|
|
129
|
+
inert: ue(!u),
|
|
130
|
+
cutout: y
|
|
131
|
+
}), le]
|
|
17
132
|
})
|
|
18
|
-
})
|
|
133
|
+
});
|
|
19
134
|
});
|
|
20
|
-
process.env.NODE_ENV !== "production" && (
|
|
135
|
+
process.env.NODE_ENV !== "production" && (Ee.displayName = "SelectPositioner");
|
|
21
136
|
export {
|
|
22
|
-
|
|
137
|
+
Ee as SelectPositioner
|
|
23
138
|
};
|
|
24
139
|
//# sourceMappingURL=index59.js.map
|
package/dist/index59.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index59.js","sources":["../../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { SelectPortalContext } from \"./SelectPortalContext.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectPortal = /*#__PURE__*/React.forwardRef(function SelectPortal(portalProps, forwardedRef) {\n const {\n store\n } = useSelectRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMount = useStore(store, selectors.forceMount);\n const shouldRender = mounted || forceMount;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(SelectPortalContext.Provider, {\n value: true,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPortal.displayName = \"SelectPortal\";"],"names":["SelectPortal","React","portalProps","forwardedRef","store","useSelectRootContext","mounted","useStore","selectors","forceMount","_jsx","SelectPortalContext","FloatingPortal"],"mappings":";;;;;;;AAiBY,MAACA,IAA4B,gBAAAC,EAAM,WAAW,SAAsBC,GAAaC,GAAc;AACzG,QAAM;AAAA,IACJ,OAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClBC,IAAUC,EAASH,GAAOI,EAAU,OAAO,GAC3CC,IAAaF,EAASH,GAAOI,EAAU,UAAU;AAEvD,SADqBF,KAAWG,IAIZC,gBAAAA,EAAAA,IAAKC,EAAoB,UAAU;AAAA,IACrD,OAAO;AAAA,IACP,UAAuBD,gBAAAA,EAAAA,IAAKE,GAAgB;AAAA,MAC1C,KAAKT;AAAA,MACL,GAAGD;AAAA,IACT,CAAK;AAAA,EACL,CAAG,IARQ;AASX,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcF,EAAa,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index59.js","sources":["../../../node_modules/@base-ui/react/select/positioner/SelectPositioner.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext, useSelectFloatingContext } from \"../root/SelectRootContext.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.mjs\";\nimport { SelectPositionerContext } from \"./SelectPositionerContext.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { clearStyles } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { findItemIndex, selectedValueIncludes } from \"../../internals/itemEquality.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst FIXED = {\n position: 'fixed'\n};\n\n/**\n * Positions the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPositioner = /*#__PURE__*/React.forwardRef(function SelectPositioner(componentProps, forwardedRef) {\n const {\n anchor,\n positionMethod = 'absolute',\n className,\n render,\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking,\n alignItemWithTrigger = true,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n listRef,\n labelsRef,\n alignItemWithTriggerActiveRef,\n selectedItemTextRef,\n valuesRef,\n initialValueRef,\n popupRef,\n setValue\n } = useSelectRootContext();\n const floatingRootContext = useSelectFloatingContext();\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const modal = useStore(store, selectors.modal);\n const value = useStore(store, selectors.value);\n const openMethod = useStore(store, selectors.openMethod);\n const positionerElement = useStore(store, selectors.positionerElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const scrollUpArrowRef = React.useRef(null);\n const scrollDownArrowRef = React.useRef(null);\n const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React.useState(alignItemWithTrigger);\n const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== 'touch';\n if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) {\n setControlledAlignItemWithTrigger(alignItemWithTrigger);\n }\n useIsoLayoutEffect(() => {\n if (!mounted) {\n if (selectors.scrollUpArrowVisible(store.state)) {\n store.set('scrollUpArrowVisible', false);\n }\n if (selectors.scrollDownArrowVisible(store.state)) {\n store.set('scrollDownArrowVisible', false);\n }\n }\n }, [store, mounted]);\n React.useImperativeHandle(alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);\n useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === 'touch', positionerElement, triggerElement);\n const positioning = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking: disableAnchorTracking ?? alignItemWithTriggerActive,\n collisionAvoidance,\n keepMounted: true\n });\n const renderedSide = alignItemWithTriggerActive ? 'none' : positioning.side;\n const positionerStyles = alignItemWithTriggerActive ? FIXED : positioning.positionerStyles;\n const state = {\n open,\n side: renderedSide,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const element = usePositioner(componentProps, state, {\n styles: positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n const prevMapSizeRef = React.useRef(0);\n const onMapChange = useStableCallback(map => {\n if (map.size === 0 && prevMapSizeRef.current === 0) {\n return;\n }\n if (valuesRef.current.length === 0) {\n return;\n }\n const prevSize = prevMapSizeRef.current;\n prevMapSizeRef.current = map.size;\n if (map.size === prevSize) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.none);\n if (prevSize !== 0 && !store.state.multiple && value !== null) {\n const selectedValueIndex = findItemIndex(valuesRef.current, value, isItemEqualToValue);\n if (selectedValueIndex === -1) {\n const initialSelectedValue = initialValueRef.current;\n const hasInitial = initialSelectedValue != null && findItemIndex(valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1;\n const nextValue = hasInitial ? initialSelectedValue : null;\n setValue(nextValue, eventDetails);\n if (nextValue === null) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {\n const hasVisibleItem = selectedItemValue => findItemIndex(valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1;\n const nextValue = value.filter(selectedItemValue => hasVisibleItem(selectedItemValue));\n if (nextValue.length !== value.length || nextValue.some(selectedItemValue => !selectedValueIncludes(value, selectedItemValue, isItemEqualToValue))) {\n setValue(nextValue, eventDetails);\n if (nextValue.length === 0) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (open && alignItemWithTriggerActive) {\n store.update({\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false\n });\n const stylesToClear = {\n height: ''\n };\n clearStyles(positionerElement, stylesToClear);\n clearStyles(popupRef.current, stylesToClear);\n }\n });\n const contextValue = React.useMemo(() => ({\n ...positioning,\n side: renderedSide,\n alignItemWithTriggerActive,\n setControlledAlignItemWithTrigger,\n scrollUpArrowRef,\n scrollDownArrowRef\n }), [positioning, renderedSide, alignItemWithTriggerActive, setControlledAlignItemWithTrigger]);\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: listRef,\n labelsRef: labelsRef,\n onMapChange: onMapChange,\n children: /*#__PURE__*/_jsxs(SelectPositionerContext.Provider, {\n value: contextValue,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: triggerElement\n }), element]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPositioner.displayName = \"SelectPositioner\";"],"names":["FIXED","SelectPositioner","React","componentProps","forwardedRef","anchor","positionMethod","className","render","side","align","sideOffset","alignOffset","collisionBoundary","collisionPadding","arrowPadding","sticky","disableAnchorTracking","alignItemWithTrigger","collisionAvoidance","DROPDOWN_COLLISION_AVOIDANCE","style","elementProps","store","listRef","labelsRef","alignItemWithTriggerActiveRef","selectedItemTextRef","valuesRef","initialValueRef","popupRef","setValue","useSelectRootContext","floatingRootContext","useSelectFloatingContext","open","useStore","selectors","mounted","modal","value","openMethod","positionerElement","triggerElement","isItemEqualToValue","transitionStatus","scrollUpArrowRef","scrollDownArrowRef","controlledAlignItemWithTrigger","setControlledAlignItemWithTrigger","alignItemWithTriggerActive","useIsoLayoutEffect","useAnchoredPopupScrollLock","positioning","useAnchorPositioning","renderedSide","positionerStyles","state","setPositionerElement","useStableCallback","element","usePositioner","prevMapSizeRef","onMapChange","map","prevSize","eventDetails","createChangeEventDetails","REASONS.none","findItemIndex","initialSelectedValue","nextValue","hasVisibleItem","selectedItemValue","selectedValueIncludes","stylesToClear","clearStyles","contextValue","_jsx","CompositeList","_jsxs","SelectPositionerContext","InternalBackdrop","inertValue"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,KAAQ;AAAA,EACZ,UAAU;AACZ,GAQaC,KAAgC,gBAAAC,EAAM,WAAW,SAA0BC,GAAgBC,GAAc;AACpH,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,YAAAC,IAAa;AAAA,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Aa;AAAA,IAC7C;AAAA,EACF,CAAC,GACKE,KAAe3E,EAAM,QAAQ,OAAO;AAAA,IACxC,GAAGmD;AAAA,IACH,MAAME;AAAA,IACN,4BAAAL;AAAA,IACA,mCAAAD;AAAA,IACA,kBAAAH;AAAA,IACA,oBAAAC;AAAA,EACJ,IAAM,CAACM,GAAaE,GAAcL,GAA4BD,CAAiC,CAAC;AAC9F,SAAoB6B,gBAAAA,EAAAA,IAAKC,IAAe;AAAA,IACtC,aAAavD;AAAA,IACb,WAAWC;AAAA,IACX,aAAasC;AAAA,IACb,UAAuBiB,gBAAAA,EAAAA,KAAMC,GAAwB,UAAU;AAAA,MAC7D,OAAOJ;AAAA,MACP,UAAU,CAACvC,KAAWC,KAAsBuC,gBAAAA,EAAAA,IAAKI,IAAkB;AAAA,QACjE,OAAOC,GAAW,CAAChD,CAAI;AAAA,QACvB,QAAQQ;AAAA,MAChB,CAAO,GAAGiB,EAAO;AAAA,IACjB,CAAK;AAAA,EACL,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAc3D,GAAiB,cAAc;","x_google_ignoreList":[0]}
|
package/dist/index6.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as y } from "./
|
|
2
|
-
import { c as le } from "./
|
|
1
|
+
import { j as y } from "./index28.js";
|
|
2
|
+
import { c as le } from "./index29.js";
|
|
3
3
|
import { CalendarDays as pe, ChevronLeft as he, ChevronRight as ve } from "lucide-react";
|
|
4
4
|
import * as r from "react";
|
|
5
5
|
import { createPortal as me } from "react-dom";
|
|
@@ -7,8 +7,8 @@ import { IMaskInput as xe } from "react-imask";
|
|
|
7
7
|
import De, { InputMask as ke } from "imask";
|
|
8
8
|
import { useIsTouchDevice as Ne } from "./index21.js";
|
|
9
9
|
import { cn as ee } from "./index2.js";
|
|
10
|
-
import { DayPicker as Ee } from "./
|
|
11
|
-
import { dateMatchModifiers as Pe } from "./
|
|
10
|
+
import { DayPicker as Ee } from "./index30.js";
|
|
11
|
+
import { dateMatchModifiers as Pe } from "./index31.js";
|
|
12
12
|
const de = De;
|
|
13
13
|
typeof de.InputMask != "function" && (de.InputMask = ke);
|
|
14
14
|
function ce(o) {
|
package/dist/index60.js
CHANGED
|
@@ -1,139 +1,54 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import { none as xe } from "./index177.js";
|
|
20
|
-
const be = {
|
|
21
|
-
position: "fixed"
|
|
22
|
-
}, Ee = /* @__PURE__ */ l.forwardRef(function(x, N) {
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { useSelectItemContext as c } from "./index338.js";
|
|
3
|
+
import { useTransitionStatus as I } from "./index295.js";
|
|
4
|
+
import { useOpenChangeComplete as R } from "./index182.js";
|
|
5
|
+
import { useRenderElement as N } from "./index172.js";
|
|
6
|
+
import { transitionStatusMapping as S } from "./index174.js";
|
|
7
|
+
import { j as E } from "./index28.js";
|
|
8
|
+
const M = /* @__PURE__ */ n.forwardRef(function(e, r) {
|
|
9
|
+
const s = e.keepMounted ?? !1, {
|
|
10
|
+
selected: i
|
|
11
|
+
} = c();
|
|
12
|
+
return s || i ? /* @__PURE__ */ E.jsx(m, {
|
|
13
|
+
...e,
|
|
14
|
+
ref: r
|
|
15
|
+
}) : null;
|
|
16
|
+
});
|
|
17
|
+
process.env.NODE_ENV !== "production" && (M.displayName = "SelectItemIndicator");
|
|
18
|
+
const m = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef((o, e) => {
|
|
23
19
|
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
alignItemWithTriggerActiveRef: Y,
|
|
46
|
-
selectedItemTextRef: b,
|
|
47
|
-
valuesRef: d,
|
|
48
|
-
initialValueRef: Z,
|
|
49
|
-
popupRef: $,
|
|
50
|
-
setValue: E
|
|
51
|
-
} = fe(), ee = me(), u = o(e, t.open), r = o(e, t.mounted), v = o(e, t.modal), c = o(e, t.value), w = o(e, t.openMethod), C = o(e, t.positionerElement), y = o(e, t.triggerElement), p = o(e, t.isItemEqualToValue), te = o(e, t.transitionStatus), oe = l.useRef(null), ne = l.useRef(null), [P, h] = l.useState(g), n = r && P && w !== "touch";
|
|
52
|
-
!r && P !== g && h(g), M(() => {
|
|
53
|
-
r || (t.scrollUpArrowVisible(e.state) && e.set("scrollUpArrowVisible", !1), t.scrollDownArrowVisible(e.state) && e.set("scrollDownArrowVisible", !1));
|
|
54
|
-
}, [e, r]), l.useImperativeHandle(Y, () => n), Ve((n || v) && u, w === "touch", C, y);
|
|
55
|
-
const i = pe({
|
|
56
|
-
anchor: W,
|
|
57
|
-
floatingRootContext: ee,
|
|
58
|
-
positionMethod: j,
|
|
59
|
-
mounted: r,
|
|
60
|
-
side: z,
|
|
61
|
-
sideOffset: U,
|
|
62
|
-
align: L,
|
|
63
|
-
alignOffset: H,
|
|
64
|
-
arrowPadding: B,
|
|
65
|
-
collisionBoundary: _,
|
|
66
|
-
collisionPadding: q,
|
|
67
|
-
sticky: F,
|
|
68
|
-
disableAnchorTracking: X ?? n,
|
|
69
|
-
collisionAvoidance: G,
|
|
70
|
-
keepMounted: !0
|
|
71
|
-
}), I = n ? "none" : i.side, ie = n ? be : i.positionerStyles, se = {
|
|
72
|
-
open: u,
|
|
73
|
-
side: I,
|
|
74
|
-
align: i.align,
|
|
75
|
-
anchorHidden: i.anchorHidden
|
|
76
|
-
};
|
|
77
|
-
M(() => {
|
|
78
|
-
e.set("popupSide", i.side);
|
|
79
|
-
}, [e, i.side]);
|
|
80
|
-
const re = O((f) => {
|
|
81
|
-
e.set("positionerElement", f);
|
|
82
|
-
}), le = Se(x, se, {
|
|
83
|
-
styles: ie,
|
|
84
|
-
transitionStatus: te,
|
|
85
|
-
props: J,
|
|
86
|
-
refs: [N, re],
|
|
87
|
-
hidden: !r,
|
|
88
|
-
inert: !u
|
|
89
|
-
}), A = l.useRef(0), ce = O((f) => {
|
|
90
|
-
if (f.size === 0 && A.current === 0 || d.current.length === 0)
|
|
91
|
-
return;
|
|
92
|
-
const R = A.current;
|
|
93
|
-
if (A.current = f.size, f.size === R)
|
|
94
|
-
return;
|
|
95
|
-
const D = Ae(xe);
|
|
96
|
-
if (R !== 0 && !e.state.multiple && c !== null && S(d.current, c, p) === -1) {
|
|
97
|
-
const s = Z.current, T = s != null && S(d.current, s, p) !== -1 ? s : null;
|
|
98
|
-
E(T, D), T === null && (e.set("selectedIndex", null), b.current = null);
|
|
99
|
-
}
|
|
100
|
-
if (R !== 0 && e.state.multiple && Array.isArray(c)) {
|
|
101
|
-
const m = (a) => S(d.current, a, p) !== -1, s = c.filter((a) => m(a));
|
|
102
|
-
(s.length !== c.length || s.some((a) => !Re(c, a, p))) && (E(s, D), s.length === 0 && (e.set("selectedIndex", null), b.current = null));
|
|
103
|
-
}
|
|
104
|
-
if (u && n) {
|
|
105
|
-
e.update({
|
|
106
|
-
scrollUpArrowVisible: !1,
|
|
107
|
-
scrollDownArrowVisible: !1
|
|
108
|
-
});
|
|
109
|
-
const m = {
|
|
110
|
-
height: ""
|
|
111
|
-
};
|
|
112
|
-
k(C, m), k($.current, m);
|
|
113
|
-
}
|
|
114
|
-
}), ae = l.useMemo(() => ({
|
|
115
|
-
...i,
|
|
116
|
-
side: I,
|
|
117
|
-
alignItemWithTriggerActive: n,
|
|
118
|
-
setControlledAlignItemWithTrigger: h,
|
|
119
|
-
scrollUpArrowRef: oe,
|
|
120
|
-
scrollDownArrowRef: ne
|
|
121
|
-
}), [i, I, n, h]);
|
|
122
|
-
return /* @__PURE__ */ V.jsx(de, {
|
|
123
|
-
elementsRef: K,
|
|
124
|
-
labelsRef: Q,
|
|
125
|
-
onMapChange: ce,
|
|
126
|
-
children: /* @__PURE__ */ V.jsxs(ge.Provider, {
|
|
127
|
-
value: ae,
|
|
128
|
-
children: [r && v && /* @__PURE__ */ V.jsx(he, {
|
|
129
|
-
inert: ue(!u),
|
|
130
|
-
cutout: y
|
|
131
|
-
}), le]
|
|
132
|
-
})
|
|
20
|
+
render: r,
|
|
21
|
+
className: s,
|
|
22
|
+
style: i,
|
|
23
|
+
keepMounted: p,
|
|
24
|
+
...d
|
|
25
|
+
} = o, {
|
|
26
|
+
selected: t
|
|
27
|
+
} = c(), a = n.useRef(null), {
|
|
28
|
+
transitionStatus: u,
|
|
29
|
+
setMounted: l
|
|
30
|
+
} = I(t), f = N("span", o, {
|
|
31
|
+
ref: [e, a],
|
|
32
|
+
state: {
|
|
33
|
+
selected: t,
|
|
34
|
+
transitionStatus: u
|
|
35
|
+
},
|
|
36
|
+
props: [{
|
|
37
|
+
"aria-hidden": !0,
|
|
38
|
+
children: "✔️"
|
|
39
|
+
}, d],
|
|
40
|
+
stateAttributesMapping: S
|
|
133
41
|
});
|
|
134
|
-
|
|
135
|
-
|
|
42
|
+
return R({
|
|
43
|
+
open: t,
|
|
44
|
+
ref: a,
|
|
45
|
+
onComplete() {
|
|
46
|
+
t || l(!1);
|
|
47
|
+
}
|
|
48
|
+
}), f;
|
|
49
|
+
}));
|
|
50
|
+
process.env.NODE_ENV !== "production" && (m.displayName = "Inner");
|
|
136
51
|
export {
|
|
137
|
-
|
|
52
|
+
M as SelectItemIndicator
|
|
138
53
|
};
|
|
139
54
|
//# sourceMappingURL=index60.js.map
|
package/dist/index60.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index60.js","sources":["../../../node_modules/@base-ui/react/select/positioner/SelectPositioner.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext, useSelectFloatingContext } from \"../root/SelectRootContext.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.mjs\";\nimport { SelectPositionerContext } from \"./SelectPositionerContext.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { clearStyles } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { findItemIndex, selectedValueIncludes } from \"../../internals/itemEquality.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst FIXED = {\n position: 'fixed'\n};\n\n/**\n * Positions the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPositioner = /*#__PURE__*/React.forwardRef(function SelectPositioner(componentProps, forwardedRef) {\n const {\n anchor,\n positionMethod = 'absolute',\n className,\n render,\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking,\n alignItemWithTrigger = true,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n listRef,\n labelsRef,\n alignItemWithTriggerActiveRef,\n selectedItemTextRef,\n valuesRef,\n initialValueRef,\n popupRef,\n setValue\n } = useSelectRootContext();\n const floatingRootContext = useSelectFloatingContext();\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const modal = useStore(store, selectors.modal);\n const value = useStore(store, selectors.value);\n const openMethod = useStore(store, selectors.openMethod);\n const positionerElement = useStore(store, selectors.positionerElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const scrollUpArrowRef = React.useRef(null);\n const scrollDownArrowRef = React.useRef(null);\n const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React.useState(alignItemWithTrigger);\n const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== 'touch';\n if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) {\n setControlledAlignItemWithTrigger(alignItemWithTrigger);\n }\n useIsoLayoutEffect(() => {\n if (!mounted) {\n if (selectors.scrollUpArrowVisible(store.state)) {\n store.set('scrollUpArrowVisible', false);\n }\n if (selectors.scrollDownArrowVisible(store.state)) {\n store.set('scrollDownArrowVisible', false);\n }\n }\n }, [store, mounted]);\n React.useImperativeHandle(alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);\n useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === 'touch', positionerElement, triggerElement);\n const positioning = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking: disableAnchorTracking ?? alignItemWithTriggerActive,\n collisionAvoidance,\n keepMounted: true\n });\n const renderedSide = alignItemWithTriggerActive ? 'none' : positioning.side;\n const positionerStyles = alignItemWithTriggerActive ? FIXED : positioning.positionerStyles;\n const state = {\n open,\n side: renderedSide,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const element = usePositioner(componentProps, state, {\n styles: positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n const prevMapSizeRef = React.useRef(0);\n const onMapChange = useStableCallback(map => {\n if (map.size === 0 && prevMapSizeRef.current === 0) {\n return;\n }\n if (valuesRef.current.length === 0) {\n return;\n }\n const prevSize = prevMapSizeRef.current;\n prevMapSizeRef.current = map.size;\n if (map.size === prevSize) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.none);\n if (prevSize !== 0 && !store.state.multiple && value !== null) {\n const selectedValueIndex = findItemIndex(valuesRef.current, value, isItemEqualToValue);\n if (selectedValueIndex === -1) {\n const initialSelectedValue = initialValueRef.current;\n const hasInitial = initialSelectedValue != null && findItemIndex(valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1;\n const nextValue = hasInitial ? initialSelectedValue : null;\n setValue(nextValue, eventDetails);\n if (nextValue === null) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {\n const hasVisibleItem = selectedItemValue => findItemIndex(valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1;\n const nextValue = value.filter(selectedItemValue => hasVisibleItem(selectedItemValue));\n if (nextValue.length !== value.length || nextValue.some(selectedItemValue => !selectedValueIncludes(value, selectedItemValue, isItemEqualToValue))) {\n setValue(nextValue, eventDetails);\n if (nextValue.length === 0) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (open && alignItemWithTriggerActive) {\n store.update({\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false\n });\n const stylesToClear = {\n height: ''\n };\n clearStyles(positionerElement, stylesToClear);\n clearStyles(popupRef.current, stylesToClear);\n }\n });\n const contextValue = React.useMemo(() => ({\n ...positioning,\n side: renderedSide,\n alignItemWithTriggerActive,\n setControlledAlignItemWithTrigger,\n scrollUpArrowRef,\n scrollDownArrowRef\n }), [positioning, renderedSide, alignItemWithTriggerActive, setControlledAlignItemWithTrigger]);\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: listRef,\n labelsRef: labelsRef,\n onMapChange: onMapChange,\n children: /*#__PURE__*/_jsxs(SelectPositionerContext.Provider, {\n value: contextValue,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: triggerElement\n }), element]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPositioner.displayName = \"SelectPositioner\";"],"names":["FIXED","SelectPositioner","React","componentProps","forwardedRef","anchor","positionMethod","className","render","side","align","sideOffset","alignOffset","collisionBoundary","collisionPadding","arrowPadding","sticky","disableAnchorTracking","alignItemWithTrigger","collisionAvoidance","DROPDOWN_COLLISION_AVOIDANCE","style","elementProps","store","listRef","labelsRef","alignItemWithTriggerActiveRef","selectedItemTextRef","valuesRef","initialValueRef","popupRef","setValue","useSelectRootContext","floatingRootContext","useSelectFloatingContext","open","useStore","selectors","mounted","modal","value","openMethod","positionerElement","triggerElement","isItemEqualToValue","transitionStatus","scrollUpArrowRef","scrollDownArrowRef","controlledAlignItemWithTrigger","setControlledAlignItemWithTrigger","alignItemWithTriggerActive","useIsoLayoutEffect","useAnchoredPopupScrollLock","positioning","useAnchorPositioning","renderedSide","positionerStyles","state","setPositionerElement","useStableCallback","element","usePositioner","prevMapSizeRef","onMapChange","map","prevSize","eventDetails","createChangeEventDetails","REASONS.none","findItemIndex","initialSelectedValue","nextValue","hasVisibleItem","selectedItemValue","selectedValueIncludes","stylesToClear","clearStyles","contextValue","_jsx","CompositeList","_jsxs","SelectPositionerContext","InternalBackdrop","in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AU,WAAW,MACvBhD,EAAM,IAAI,iBAAiB,IAAI,GAC/BI,EAAoB,UAAU;AAAA,IAGpC;AACA,QAAIQ,KAAQe,GAA4B;AACtC,MAAA3B,EAAM,OAAO;AAAA,QACX,sBAAsB;AAAA,QACtB,wBAAwB;AAAA,MAChC,CAAO;AACD,YAAMoD,IAAgB;AAAA,QACpB,QAAQ;AAAA,MAChB;AACM,MAAAC,EAAYlC,GAAmBiC,CAAa,GAC5CC,EAAY9C,EAAS,SAAS6C,CAAa;AAAA,IAC7C;AAAA,EACF,CAAC,GACKE,KAAe3E,EAAM,QAAQ,OAAO;AAAA,IACxC,GAAGmD;AAAA,IACH,MAAME;AAAA,IACN,4BAAAL;AAAA,IACA,mCAAAD;AAAA,IACA,kBAAAH;AAAA,IACA,oBAAAC;AAAA,EACJ,IAAM,CAACM,GAAaE,GAAcL,GAA4BD,CAAiC,CAAC;AAC9F,SAAoB6B,gBAAAA,EAAAA,IAAKC,IAAe;AAAA,IACtC,aAAavD;AAAA,IACb,WAAWC;AAAA,IACX,aAAasC;AAAA,IACb,UAAuBiB,gBAAAA,EAAAA,KAAMC,GAAwB,UAAU;AAAA,MAC7D,OAAOJ;AAAA,MACP,UAAU,CAACvC,KAAWC,KAAsBuC,gBAAAA,EAAAA,IAAKI,IAAkB;AAAA,QACjE,OAAOC,GAAW,CAAChD,CAAI;AAAA,QACvB,QAAQQ;AAAA,MAChB,CAAO,GAAGiB,EAAO;AAAA,IACjB,CAAK;AAAA,EACL,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAc3D,GAAiB,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index60.js","sources":["../../../node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useSelectItemContext } from \"../item/SelectItemContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Indicates whether the select item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectItemIndicator = /*#__PURE__*/React.forwardRef(function SelectItemIndicator(componentProps, forwardedRef) {\n const keepMounted = componentProps.keepMounted ?? false;\n const {\n selected\n } = useSelectItemContext();\n const shouldRender = keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return /*#__PURE__*/_jsx(Inner, {\n ...componentProps,\n ref: forwardedRef\n });\n});\n\n// Split the core implementation to avoid paying the hook costs unless the element needs to mount.\nif (process.env.NODE_ENV !== \"production\") SelectItemIndicator.displayName = \"SelectItemIndicator\";\nconst Inner = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((componentProps, forwardedRef) => {\n const {\n render,\n className,\n style,\n keepMounted,\n ...elementProps\n } = componentProps;\n const {\n selected\n } = useSelectItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") Inner.displayName = \"Inner\";"],"names":["SelectItemIndicator","React","componentProps","forwardedRef","keepMounted","selected","useSelectItemContext","_jsx","Inner","render","className","style","elementProps","indicatorRef","transitionStatus","setMounted","useTransitionStatus","element","useRenderElement","transitionStatusMapping","useOpenChangeCom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@@ -1,54 +1,31 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { transitionStatusMapping as S } from "./index174.js";
|
|
7
|
-
import { j as E } from "./index30.js";
|
|
8
|
-
const M = /* @__PURE__ */ n.forwardRef(function(e, r) {
|
|
9
|
-
const s = e.keepMounted ?? !1, {
|
|
10
|
-
selected: i
|
|
11
|
-
} = c();
|
|
12
|
-
return s || i ? /* @__PURE__ */ E.jsx(m, {
|
|
13
|
-
...e,
|
|
14
|
-
ref: r
|
|
15
|
-
}) : null;
|
|
16
|
-
});
|
|
17
|
-
process.env.NODE_ENV !== "production" && (M.displayName = "SelectItemIndicator");
|
|
18
|
-
const m = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef((o, e) => {
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { useSelectRootContext as u } from "./index291.js";
|
|
3
|
+
import { useSelectItemContext as x } from "./index338.js";
|
|
4
|
+
import { useRenderElement as p } from "./index172.js";
|
|
5
|
+
const R = /* @__PURE__ */ r.memo(/* @__PURE__ */ r.forwardRef(function(o, l) {
|
|
19
6
|
const {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children: "✔️"
|
|
39
|
-
}, d],
|
|
40
|
-
stateAttributesMapping: S
|
|
7
|
+
index: s,
|
|
8
|
+
textRef: f,
|
|
9
|
+
selectedByFocus: c,
|
|
10
|
+
hasRegistered: e
|
|
11
|
+
} = x(), {
|
|
12
|
+
firstItemTextRef: m,
|
|
13
|
+
selectedItemTextRef: n
|
|
14
|
+
} = u(), {
|
|
15
|
+
render: I,
|
|
16
|
+
className: S,
|
|
17
|
+
style: T,
|
|
18
|
+
...i
|
|
19
|
+
} = o, a = r.useCallback((t) => {
|
|
20
|
+
t && (e && s === 0 && (m.current = t), e && c && (n.current = t));
|
|
21
|
+
}, [m, n, s, c, e]);
|
|
22
|
+
return p("div", o, {
|
|
23
|
+
ref: [a, l, f],
|
|
24
|
+
props: i
|
|
41
25
|
});
|
|
42
|
-
return R({
|
|
43
|
-
open: t,
|
|
44
|
-
ref: a,
|
|
45
|
-
onComplete() {
|
|
46
|
-
t || l(!1);
|
|
47
|
-
}
|
|
48
|
-
}), f;
|
|
49
26
|
}));
|
|
50
|
-
process.env.NODE_ENV !== "production" && (
|
|
27
|
+
process.env.NODE_ENV !== "production" && (R.displayName = "SelectItemText");
|
|
51
28
|
export {
|
|
52
|
-
|
|
29
|
+
R as SelectItemText
|
|
53
30
|
};
|
|
54
31
|
//# sourceMappingURL=index61.js.map
|
package/dist/index61.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index61.js","sources":["../../../node_modules/@base-ui/react/select/item-
|
|
1
|
+
{"version":3,"file":"index61.js","sources":["../../../node_modules/@base-ui/react/select/item-text/SelectItemText.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectItemContext } from \"../item/SelectItemContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * A text label of the select item.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectItemText = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItemText(componentProps, forwardedRef) {\n const {\n index,\n textRef,\n selectedByFocus,\n hasRegistered\n } = useSelectItemContext();\n const {\n firstItemTextRef,\n selectedItemTextRef\n } = useSelectRootContext();\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const localRef = React.useCallback(node => {\n if (!node) {\n return;\n }\n if (hasRegistered && index === 0) {\n firstItemTextRef.current = node;\n }\n if (hasRegistered && selectedByFocus) {\n selectedItemTextRef.current = node;\n }\n }, [firstItemTextRef, selectedItemTextRef, index, selectedByFocus, hasRegistered]);\n const element = useRenderElement('div', componentProps, {\n ref: [localRef, forwardedRef, textRef],\n props: elementProps\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItemText.displayName = \"SelectItemText\";"],"names":["SelectItemText","React","componentProps","forwardedRef","index","textRef","selectedByFocus","hasRegistered","useSelectItemContext","firstItemTextRef","selectedItemTextRef","useSelectRootContext","render","className","style","elementProps","localRef","node","useRenderElement"],"mappings":";;;;AAaY,MAACA,IAA8B,gBAAAC,EAAM,KAAkB,gBAAAA,EAAM,WAAW,SAAwBC,GAAgBC,GAAc;AACxI,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,eAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClB;AAAA,IACJ,kBAAAC;AAAA,IACA,qBAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClB;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAMb,GACEc,IAAWf,EAAM,YAAY,CAAAgB,MAAQ;AACzC,IAAKA,MAGDV,KAAiBH,MAAU,MAC7BK,EAAiB,UAAUQ,IAEzBV,KAAiBD,MACnBI,EAAoB,UAAUO;AAAA,EAElC,GAAG,CAACR,GAAkBC,GAAqBN,GAAOE,GAAiBC,CAAa,CAAC;AAKjF,SAJgBW,EAAiB,OAAOhB,GAAgB;AAAA,IACtD,KAAK,CAACc,GAAUb,GAAcE,CAAO;AAAA,IACrC,OAAOU;AAAA,EACX,CAAG;AAEH,CAAC,CAAC;AACE,QAAQ,IAAI,aAAa,iBAAcf,EAAe,cAAc;","x_google_ignoreList":[0]}
|