@hot-updater/console 0.33.0 → 0.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +3 -3
- package/.output/public/assets/dist-DJX53faP.js +3 -0
- package/.output/public/assets/index-CCUspZZV.js +10 -0
- package/.output/public/assets/routes-D0t6y5Fr.js +54 -0
- package/.output/public/assets/styles-C0q26dS-.css +2 -0
- package/.output/server/{__tanstack-start-server-fn-resolver-ySzPUDlM.mjs → __23tanstack-start-server-fn-resolver-B12pVvhf.mjs} +32 -39
- package/.output/server/_chunks/ssr-renderer.mjs +14 -3
- package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +7 -7
- package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +142 -93
- package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +32 -11
- package/.output/server/_libs/@radix-ui/react-select+[...].mjs +130 -95
- package/.output/server/_libs/@tanstack/form-core+[...].mjs +1138 -306
- package/.output/server/_libs/@tanstack/react-form+[...].mjs +156 -24
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +2658 -1395
- package/.output/server/_libs/@tanstack/react-table+[...].mjs +1 -1
- package/.output/server/_libs/dayjs.mjs +6 -6
- package/.output/server/_libs/h3+rou3+srvx.mjs +30 -42
- package/.output/server/_libs/lucide-react.mjs +8 -8
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/radix-ui__number.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-arrow.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-collection.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-direction.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-label.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-separator.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-slider.mjs +103 -44
- package/.output/server/_libs/radix-ui__react-switch.mjs +88 -49
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +6 -4
- package/.output/server/_libs/semver.mjs +97 -52
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tailwind-merge.mjs +51 -3
- package/.output/server/_libs/tanstack__history.mjs +28 -8
- package/.output/server/_libs/tanstack__query-core.mjs +200 -174
- package/.output/server/_libs/tanstack__react-query.mjs +14 -13
- package/.output/server/_ssr/{api-rpc-Bwustks9.mjs → api-rpc-ORImfBFu.mjs} +18 -18
- package/.output/server/_ssr/{config.server-xu3W-WAK.mjs → config.server-BSS366KT.mjs} +2 -2
- package/.output/server/_ssr/{createServerFn-CdeRXnVy.mjs → createServerFn-DzU0k62V.mjs} +129 -90
- package/.output/server/_ssr/{deleteBundle-CXxwjwEZ.mjs → deleteBundle-CuujBAH8.mjs} +2 -2
- package/.output/server/_ssr/{dist-CRiLZLfa.mjs → dist-KboydRVk.mjs} +1 -1
- package/.output/server/_ssr/empty-plugin-adapters-B4HCzgmM.mjs +5 -0
- package/.output/server/_ssr/{getBundleChildren-DFqZ6XMp.mjs → getBundleChildren-CVtSiH5t.mjs} +2 -2
- package/.output/server/_ssr/{router-1tw3jh6y.mjs → router-DmdnzGpe.mjs} +7 -8
- package/.output/server/_ssr/{routes-D5CmWxI7.mjs → routes-Be7gDfJS.mjs} +36 -39
- package/.output/server/_ssr/{sidebar-CgbtXkE2.mjs → sidebar-Cv_H0_Jv.mjs} +5 -5
- package/.output/server/_ssr/ssr.mjs +4222 -3153
- package/.output/server/_ssr/start-D4SBEASt.mjs +4 -0
- package/.output/server/_ssr/{storageProfile-wICk5nZZ.mjs → storageProfile-FVkjPoGb.mjs} +1 -1
- package/.output/server/_tanstack-start-manifest_v-BroBMdSR.mjs +20 -0
- package/.output/server/index.mjs +128 -172
- package/package.json +12 -9
- package/.output/public/assets/BaseTanStackRouterDevtoolsPanel-Bmws3ikM-q5p5qKUx.js +0 -486
- package/.output/public/assets/FloatingTanStackRouterDevtools-B7vy70jP-Bzs2Gthe.js +0 -1
- package/.output/public/assets/clsx-CbprLf2V.js +0 -1
- package/.output/public/assets/dist-BzU1qUss.js +0 -9
- package/.output/public/assets/main-CmNeAg9B.js +0 -10
- package/.output/public/assets/preload-helper-C5ST2IKa.js +0 -1
- package/.output/public/assets/routes-wJZuGodi.js +0 -54
- package/.output/public/assets/styles-DEbMLh52.css +0 -2
- package/.output/server/_libs/hookable.mjs +0 -41
- package/.output/server/_libs/tanstack__router-core.mjs +0 -6
- package/.output/server/_libs/unctx.mjs +0 -82
- package/.output/server/_ssr/start-CoRKunFF.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-AftZl081.mjs +0 -22
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as __toESM } from "../../_runtime.mjs";
|
|
2
|
-
import { C as useCallbackRef, D as useLayoutEffect2, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, k as Primitive } from "./react-alert-dialog+[...].mjs";
|
|
3
2
|
import { a as offset, c as useFloating, i as limitShift, n as flip, o as shift, r as hide, s as size, t as arrow, u as require_react } from "../@floating-ui/react-dom+[...].mjs";
|
|
3
|
+
import { C as useCallbackRef, D as useLayoutEffect2, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, k as Primitive } from "./react-alert-dialog+[...].mjs";
|
|
4
4
|
import { n as autoUpdate } from "../@floating-ui/dom+[...].mjs";
|
|
5
5
|
import { t as Root } from "../radix-ui__react-arrow.mjs";
|
|
6
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-use-size@1.1.
|
|
6
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-size@1.1.2_@types+react@19.2.15_react@19.2.6/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
7
7
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
8
8
|
function useSize(element) {
|
|
9
9
|
const [size, setSize] = import_react.useState(void 0);
|
|
@@ -40,7 +40,7 @@ function useSize(element) {
|
|
|
40
40
|
return size;
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-popper@1.
|
|
43
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-popper@1.3.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+react_dda64ff0e3d08442360b0a4fed563fd9/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
44
44
|
var import_jsx_runtime = require_jsx_runtime();
|
|
45
45
|
var POPPER_NAME = "Popper";
|
|
46
46
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
@@ -48,10 +48,13 @@ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
|
48
48
|
var Popper = (props) => {
|
|
49
49
|
const { __scopePopper, children } = props;
|
|
50
50
|
const [anchor, setAnchor] = import_react.useState(null);
|
|
51
|
+
const [placementState, setPlacementState] = import_react.useState(void 0);
|
|
51
52
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperProvider, {
|
|
52
53
|
scope: __scopePopper,
|
|
53
54
|
anchor,
|
|
54
55
|
onAnchorChange: setAnchor,
|
|
56
|
+
placementState,
|
|
57
|
+
setPlacementState,
|
|
55
58
|
children
|
|
56
59
|
});
|
|
57
60
|
};
|
|
@@ -61,14 +64,24 @@ var PopperAnchor = import_react.forwardRef((props, forwardedRef) => {
|
|
|
61
64
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
62
65
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
63
66
|
const ref = import_react.useRef(null);
|
|
64
|
-
const
|
|
67
|
+
const onAnchorChange = context.onAnchorChange;
|
|
68
|
+
const composedRefs = useComposedRefs(forwardedRef, import_react.useCallback((node) => {
|
|
69
|
+
ref.current = node;
|
|
70
|
+
if (node) onAnchorChange(node);
|
|
71
|
+
}, [onAnchorChange]));
|
|
65
72
|
const anchorRef = import_react.useRef(null);
|
|
66
73
|
import_react.useEffect(() => {
|
|
74
|
+
if (!virtualRef) return;
|
|
67
75
|
const previousAnchor = anchorRef.current;
|
|
68
|
-
anchorRef.current = virtualRef
|
|
69
|
-
if (previousAnchor !== anchorRef.current)
|
|
76
|
+
anchorRef.current = virtualRef.current;
|
|
77
|
+
if (previousAnchor !== anchorRef.current) onAnchorChange(anchorRef.current);
|
|
70
78
|
});
|
|
79
|
+
const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState);
|
|
80
|
+
const placedSide = sideAndAlign?.[0];
|
|
81
|
+
const placedAlign = sideAndAlign?.[1];
|
|
71
82
|
return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
83
|
+
"data-radix-popper-side": placedSide,
|
|
84
|
+
"data-radix-popper-align": placedAlign,
|
|
72
85
|
...anchorProps,
|
|
73
86
|
ref: composedRefs
|
|
74
87
|
});
|
|
@@ -77,7 +90,7 @@ PopperAnchor.displayName = ANCHOR_NAME;
|
|
|
77
90
|
var CONTENT_NAME = "PopperContent";
|
|
78
91
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
79
92
|
var PopperContent = import_react.forwardRef((props, forwardedRef) => {
|
|
80
|
-
const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary
|
|
93
|
+
const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary, collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
|
|
81
94
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
82
95
|
const [content, setContent] = import_react.useState(null);
|
|
83
96
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
@@ -93,11 +106,11 @@ var PopperContent = import_react.forwardRef((props, forwardedRef) => {
|
|
|
93
106
|
left: 0,
|
|
94
107
|
...collisionPaddingProp
|
|
95
108
|
};
|
|
96
|
-
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
|
97
|
-
const hasExplicitBoundaries = boundary.length > 0;
|
|
109
|
+
const boundary = collisionBoundary ? Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary] : void 0;
|
|
110
|
+
const hasExplicitBoundaries = boundary !== void 0 && boundary.length > 0;
|
|
98
111
|
const detectOverflowOptions = {
|
|
99
112
|
padding: collisionPadding,
|
|
100
|
-
boundary: boundary
|
|
113
|
+
boundary: boundary?.filter(isNotNull),
|
|
101
114
|
altBoundary: hasExplicitBoundaries
|
|
102
115
|
};
|
|
103
116
|
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
@@ -144,6 +157,13 @@ var PopperContent = import_react.forwardRef((props, forwardedRef) => {
|
|
|
144
157
|
})
|
|
145
158
|
]
|
|
146
159
|
});
|
|
160
|
+
const setPlacementState = context.setPlacementState;
|
|
161
|
+
useLayoutEffect2(() => {
|
|
162
|
+
setPlacementState(placement);
|
|
163
|
+
return () => {
|
|
164
|
+
setPlacementState(void 0);
|
|
165
|
+
};
|
|
166
|
+
}, [placement, setPlacementState]);
|
|
147
167
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
148
168
|
const handlePlaced = useCallbackRef(onPlaced);
|
|
149
169
|
useLayoutEffect2(() => {
|
|
@@ -164,7 +184,7 @@ var PopperContent = import_react.forwardRef((props, forwardedRef) => {
|
|
|
164
184
|
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
165
185
|
minWidth: "max-content",
|
|
166
186
|
zIndex: contentZIndex,
|
|
167
|
-
|
|
187
|
+
"--radix-popper-transform-origin": [middlewareData.transformOrigin?.x, middlewareData.transformOrigin?.y].join(" "),
|
|
168
188
|
...middlewareData.hide?.referenceHidden && {
|
|
169
189
|
visibility: "hidden",
|
|
170
190
|
pointerEvents: "none"
|
|
@@ -174,6 +194,7 @@ var PopperContent = import_react.forwardRef((props, forwardedRef) => {
|
|
|
174
194
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperContentProvider, {
|
|
175
195
|
scope: __scopePopper,
|
|
176
196
|
placedSide,
|
|
197
|
+
placedAlign,
|
|
177
198
|
onArrowChange: setArrow,
|
|
178
199
|
arrowX,
|
|
179
200
|
arrowY,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as __toESM } from "../../_runtime.mjs";
|
|
2
|
-
import { C as useCallbackRef, D as useLayoutEffect2, E as useControllableState, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, S as DismissableLayer, _ as hideOthers, b as Portal$1, j as createSlot, k as Primitive, v as ReactRemoveScroll, w as useId, x as FocusScope, y as useFocusGuards } from "./react-alert-dialog+[...].mjs";
|
|
3
2
|
import { l as require_react_dom, u as require_react } from "../@floating-ui/react-dom+[...].mjs";
|
|
3
|
+
import { C as useCallbackRef, D as useLayoutEffect2, E as useControllableState, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, S as DismissableLayer, T as Presence, _ as hideOthers, b as Portal, j as createSlot, k as Primitive, v as ReactRemoveScroll, w as useId, x as FocusScope, y as useFocusGuards } from "./react-alert-dialog+[...].mjs";
|
|
4
4
|
import { t as createCollection } from "../radix-ui__react-collection.mjs";
|
|
5
5
|
import { t as composeEventHandlers } from "../radix-ui__primitive.mjs";
|
|
6
6
|
import { t as useDirection } from "../radix-ui__react-direction.mjs";
|
|
7
|
-
import { a as createPopperScope, i as Root2
|
|
7
|
+
import { a as createPopperScope, i as Root2, n as Arrow, r as Content, t as Anchor } from "./react-popper+[...].mjs";
|
|
8
8
|
import { t as clamp } from "../radix-ui__number.mjs";
|
|
9
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.
|
|
9
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.5_@types+react-dom@19.2.3_@types+react@19.2.15__@ty_57907524451428ebc21a88670ca0b799/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
10
10
|
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
|
|
11
11
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
12
12
|
var import_jsx_runtime = require_jsx_runtime();
|
|
@@ -36,7 +36,7 @@ var VisuallyHidden = import_react.forwardRef((props, forwardedRef) => {
|
|
|
36
36
|
VisuallyHidden.displayName = NAME;
|
|
37
37
|
var Root = VisuallyHidden;
|
|
38
38
|
//#endregion
|
|
39
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-use-previous@1.1.
|
|
39
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-previous@1.1.2_@types+react@19.2.15_react@19.2.6/node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
40
40
|
function usePrevious(value) {
|
|
41
41
|
const ref = import_react.useRef({
|
|
42
42
|
value,
|
|
@@ -51,7 +51,7 @@ function usePrevious(value) {
|
|
|
51
51
|
}, [value]);
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-select@2.
|
|
54
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-select@2.3.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+react_ac7eb800be9df7939f38bd342d4df42b/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
55
55
|
var OPEN_KEYS = [
|
|
56
56
|
" ",
|
|
57
57
|
"Enter",
|
|
@@ -63,10 +63,11 @@ var SELECT_NAME = "Select";
|
|
|
63
63
|
var [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);
|
|
64
64
|
var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [createCollectionScope, createPopperScope]);
|
|
65
65
|
var usePopperScope = createPopperScope();
|
|
66
|
-
var [
|
|
66
|
+
var [SelectProviderImpl, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
67
67
|
var [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME);
|
|
68
|
-
var
|
|
69
|
-
|
|
68
|
+
var PROVIDER_NAME = "SelectProvider";
|
|
69
|
+
function SelectProvider(props) {
|
|
70
|
+
const { __scopeSelect, children, open: openProp, defaultOpen, onOpenChange, value: valueProp, defaultValue, onValueChange, dir, name, autoComplete, disabled, required, form, internal_do_not_use_render } = props;
|
|
70
71
|
const popperScope = usePopperScope(__scopeSelect);
|
|
71
72
|
const [trigger, setTrigger] = import_react.useState(null);
|
|
72
73
|
const [valueNode, setValueNode] = import_react.useState(null);
|
|
@@ -85,58 +86,68 @@ var Select = (props) => {
|
|
|
85
86
|
caller: SELECT_NAME
|
|
86
87
|
});
|
|
87
88
|
const triggerPointerDownPosRef = import_react.useRef(null);
|
|
88
|
-
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
89
|
+
const isFormControl = trigger ? !!form || !!trigger.closest("form") : true;
|
|
89
90
|
const [nativeOptionsSet, setNativeOptionsSet] = import_react.useState(/* @__PURE__ */ new Set());
|
|
91
|
+
const contentId = useId();
|
|
90
92
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
91
|
-
|
|
93
|
+
const handleNativeOptionAdd = import_react.useCallback((option) => {
|
|
94
|
+
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
95
|
+
}, []);
|
|
96
|
+
const handleNativeOptionRemove = import_react.useCallback((option) => {
|
|
97
|
+
setNativeOptionsSet((prev) => {
|
|
98
|
+
const optionsSet = new Set(prev);
|
|
99
|
+
optionsSet.delete(option);
|
|
100
|
+
return optionsSet;
|
|
101
|
+
});
|
|
102
|
+
}, []);
|
|
103
|
+
const context = {
|
|
104
|
+
required,
|
|
105
|
+
trigger,
|
|
106
|
+
onTriggerChange: setTrigger,
|
|
107
|
+
valueNode,
|
|
108
|
+
onValueNodeChange: setValueNode,
|
|
109
|
+
valueNodeHasChildren,
|
|
110
|
+
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
|
111
|
+
contentId,
|
|
112
|
+
value,
|
|
113
|
+
onValueChange: setValue,
|
|
114
|
+
open,
|
|
115
|
+
onOpenChange: setOpen,
|
|
116
|
+
dir: direction,
|
|
117
|
+
triggerPointerDownPosRef,
|
|
118
|
+
disabled,
|
|
119
|
+
name,
|
|
120
|
+
autoComplete,
|
|
121
|
+
form,
|
|
122
|
+
nativeOptions: nativeOptionsSet,
|
|
123
|
+
nativeSelectKey,
|
|
124
|
+
isFormControl
|
|
125
|
+
};
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2, {
|
|
92
127
|
...popperScope,
|
|
93
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
94
|
-
required,
|
|
128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectProviderImpl, {
|
|
95
129
|
scope: __scopeSelect,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
valueNode,
|
|
99
|
-
onValueNodeChange: setValueNode,
|
|
100
|
-
valueNodeHasChildren,
|
|
101
|
-
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
|
102
|
-
contentId: useId(),
|
|
103
|
-
value,
|
|
104
|
-
onValueChange: setValue,
|
|
105
|
-
open,
|
|
106
|
-
onOpenChange: setOpen,
|
|
107
|
-
dir: direction,
|
|
108
|
-
triggerPointerDownPosRef,
|
|
109
|
-
disabled,
|
|
110
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
|
|
130
|
+
...context,
|
|
131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
|
|
111
132
|
scope: __scopeSelect,
|
|
112
133
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectNativeOptionsProvider, {
|
|
113
|
-
scope:
|
|
114
|
-
onNativeOptionAdd:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
onNativeOptionRemove: import_react.useCallback((option) => {
|
|
118
|
-
setNativeOptionsSet((prev) => {
|
|
119
|
-
const optionsSet = new Set(prev);
|
|
120
|
-
optionsSet.delete(option);
|
|
121
|
-
return optionsSet;
|
|
122
|
-
});
|
|
123
|
-
}, []),
|
|
124
|
-
children
|
|
134
|
+
scope: __scopeSelect,
|
|
135
|
+
onNativeOptionAdd: handleNativeOptionAdd,
|
|
136
|
+
onNativeOptionRemove: handleNativeOptionRemove,
|
|
137
|
+
children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
|
|
125
138
|
})
|
|
126
|
-
})
|
|
127
|
-
"aria-hidden": true,
|
|
128
|
-
required,
|
|
129
|
-
tabIndex: -1,
|
|
130
|
-
name,
|
|
131
|
-
autoComplete,
|
|
132
|
-
value,
|
|
133
|
-
onChange: (event) => setValue(event.target.value),
|
|
134
|
-
disabled,
|
|
135
|
-
form,
|
|
136
|
-
children: [value === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(nativeOptionsSet)]
|
|
137
|
-
}, nativeSelectKey) : null]
|
|
139
|
+
})
|
|
138
140
|
})
|
|
139
141
|
});
|
|
142
|
+
}
|
|
143
|
+
SelectProvider.displayName = PROVIDER_NAME;
|
|
144
|
+
var Select = (props) => {
|
|
145
|
+
const { __scopeSelect, children, ...providerProps } = props;
|
|
146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectProvider, {
|
|
147
|
+
__scopeSelect,
|
|
148
|
+
...providerProps,
|
|
149
|
+
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [children, isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectBubbleInput, { __scopeSelect }) : null] })
|
|
150
|
+
});
|
|
140
151
|
};
|
|
141
152
|
Select.displayName = SELECT_NAME;
|
|
142
153
|
var TRIGGER_NAME = "SelectTrigger";
|
|
@@ -169,7 +180,7 @@ var SelectTrigger = import_react.forwardRef((props, forwardedRef) => {
|
|
|
169
180
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
|
|
170
181
|
type: "button",
|
|
171
182
|
role: "combobox",
|
|
172
|
-
"aria-controls": context.contentId,
|
|
183
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
173
184
|
"aria-expanded": context.open,
|
|
174
185
|
"aria-required": context.required,
|
|
175
186
|
"aria-autocomplete": "none",
|
|
@@ -216,11 +227,13 @@ var SelectValue = import_react.forwardRef((props, forwardedRef) => {
|
|
|
216
227
|
useLayoutEffect2(() => {
|
|
217
228
|
onValueNodeHasChildrenChange(hasChildren);
|
|
218
229
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
230
|
+
const showPlaceholder = shouldShowPlaceholder(context.value);
|
|
219
231
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
220
232
|
...valueProps,
|
|
233
|
+
asChild: showPlaceholder ? false : valueProps.asChild,
|
|
221
234
|
ref: composedRefs,
|
|
222
235
|
style: { pointerEvents: "none" },
|
|
223
|
-
children:
|
|
236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: showPlaceholder ? placeholder : children }, showPlaceholder ? "placeholder" : "value")
|
|
224
237
|
});
|
|
225
238
|
});
|
|
226
239
|
SelectValue.displayName = VALUE_NAME;
|
|
@@ -236,42 +249,62 @@ var SelectIcon = import_react.forwardRef((props, forwardedRef) => {
|
|
|
236
249
|
});
|
|
237
250
|
SelectIcon.displayName = ICON_NAME;
|
|
238
251
|
var PORTAL_NAME = "SelectPortal";
|
|
252
|
+
var [PortalProvider, usePortalContext] = createSelectContext(PORTAL_NAME, { forceMount: void 0 });
|
|
239
253
|
var SelectPortal = (props) => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
254
|
+
const { __scopeSelect, forceMount, ...portalProps } = props;
|
|
255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, {
|
|
256
|
+
scope: props.__scopeSelect,
|
|
257
|
+
forceMount,
|
|
258
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
|
|
259
|
+
asChild: true,
|
|
260
|
+
...portalProps
|
|
261
|
+
})
|
|
243
262
|
});
|
|
244
263
|
};
|
|
245
264
|
SelectPortal.displayName = PORTAL_NAME;
|
|
246
265
|
var CONTENT_NAME = "SelectContent";
|
|
247
266
|
var SelectContent = import_react.forwardRef((props, forwardedRef) => {
|
|
267
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeSelect);
|
|
268
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
248
269
|
const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);
|
|
249
270
|
const [fragment, setFragment] = import_react.useState();
|
|
250
271
|
useLayoutEffect2(() => {
|
|
251
272
|
setFragment(new DocumentFragment());
|
|
252
273
|
}, []);
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
})
|
|
262
|
-
}
|
|
263
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentImpl, {
|
|
264
|
-
...props,
|
|
265
|
-
ref: forwardedRef
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
275
|
+
present: forceMount || context.open,
|
|
276
|
+
children: ({ present }) => present ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentImpl, {
|
|
277
|
+
...contentProps,
|
|
278
|
+
ref: forwardedRef
|
|
279
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentFragment, {
|
|
280
|
+
...contentProps,
|
|
281
|
+
fragment
|
|
282
|
+
})
|
|
266
283
|
});
|
|
267
284
|
});
|
|
268
285
|
SelectContent.displayName = CONTENT_NAME;
|
|
286
|
+
var SelectContentFragment = import_react.forwardRef((props, forwardedRef) => {
|
|
287
|
+
const { __scopeSelect, children, fragment } = props;
|
|
288
|
+
if (!fragment) return null;
|
|
289
|
+
return import_react_dom.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, {
|
|
290
|
+
scope: __scopeSelect,
|
|
291
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
|
|
292
|
+
scope: __scopeSelect,
|
|
293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
294
|
+
ref: forwardedRef,
|
|
295
|
+
children
|
|
296
|
+
})
|
|
297
|
+
})
|
|
298
|
+
}), fragment);
|
|
299
|
+
});
|
|
300
|
+
SelectContentFragment.displayName = "SelectContentFragment";
|
|
269
301
|
var CONTENT_MARGIN = 10;
|
|
270
302
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME);
|
|
271
303
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
272
304
|
var Slot = createSlot("SelectContent.RemoveScroll");
|
|
273
305
|
var SelectContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
274
|
-
const { __scopeSelect
|
|
306
|
+
const { __scopeSelect } = props;
|
|
307
|
+
const { position = "item-aligned", onCloseAutoFocus, onEscapeKeyDown, onPointerDownOutside, side, sideOffset, align, alignOffset, arrowPadding, collisionBoundary, collisionPadding, sticky, hideWhenDetached, avoidCollisions, ...contentProps } = props;
|
|
275
308
|
const context = useSelectContext(CONTENT_NAME, __scopeSelect);
|
|
276
309
|
const [content, setContent] = import_react.useState(null);
|
|
277
310
|
const [viewport, setViewport] = import_react.useState(null);
|
|
@@ -321,7 +354,7 @@ var SelectContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
321
354
|
};
|
|
322
355
|
const handlePointerUp = (event) => {
|
|
323
356
|
if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) event.preventDefault();
|
|
324
|
-
else if (!
|
|
357
|
+
else if (!event.composedPath().includes(content)) onOpenChange(false);
|
|
325
358
|
document.removeEventListener("pointermove", handlePointerMove);
|
|
326
359
|
triggerPointerDownPosRef.current = null;
|
|
327
360
|
};
|
|
@@ -911,9 +944,7 @@ var ARROW_NAME = "SelectArrow";
|
|
|
911
944
|
var SelectArrow = import_react.forwardRef((props, forwardedRef) => {
|
|
912
945
|
const { __scopeSelect, ...arrowProps } = props;
|
|
913
946
|
const popperScope = usePopperScope(__scopeSelect);
|
|
914
|
-
|
|
915
|
-
const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);
|
|
916
|
-
return context.open && contentContext.position === "popper" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow, {
|
|
947
|
+
return useSelectContentContext(ARROW_NAME, __scopeSelect).position === "popper" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow, {
|
|
917
948
|
...popperScope,
|
|
918
949
|
...arrowProps,
|
|
919
950
|
ref: forwardedRef
|
|
@@ -921,32 +952,48 @@ var SelectArrow = import_react.forwardRef((props, forwardedRef) => {
|
|
|
921
952
|
});
|
|
922
953
|
SelectArrow.displayName = ARROW_NAME;
|
|
923
954
|
var BUBBLE_INPUT_NAME = "SelectBubbleInput";
|
|
924
|
-
var SelectBubbleInput = import_react.forwardRef(({ __scopeSelect,
|
|
955
|
+
var SelectBubbleInput = import_react.forwardRef(({ __scopeSelect, ...props }, forwardedRef) => {
|
|
956
|
+
const context = useSelectContext(BUBBLE_INPUT_NAME, __scopeSelect);
|
|
957
|
+
const { value, onValueChange, required, disabled, name, autoComplete, form } = context;
|
|
958
|
+
const { nativeOptions, nativeSelectKey } = context;
|
|
925
959
|
const ref = import_react.useRef(null);
|
|
926
960
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
927
|
-
const
|
|
961
|
+
const selectValue = value ?? "";
|
|
962
|
+
const prevValue = usePrevious(selectValue);
|
|
928
963
|
import_react.useEffect(() => {
|
|
929
964
|
const select = ref.current;
|
|
930
965
|
if (!select) return;
|
|
931
966
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
932
967
|
const setValue = Object.getOwnPropertyDescriptor(selectProto, "value").set;
|
|
933
|
-
if (prevValue !==
|
|
968
|
+
if (prevValue !== selectValue && setValue) {
|
|
934
969
|
const event = new Event("change", { bubbles: true });
|
|
935
|
-
setValue.call(select,
|
|
970
|
+
setValue.call(select, selectValue);
|
|
936
971
|
select.dispatchEvent(event);
|
|
937
972
|
}
|
|
938
|
-
}, [prevValue,
|
|
939
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
973
|
+
}, [prevValue, selectValue]);
|
|
974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Primitive.select, {
|
|
975
|
+
"aria-hidden": true,
|
|
976
|
+
required,
|
|
977
|
+
tabIndex: -1,
|
|
978
|
+
name,
|
|
979
|
+
autoComplete,
|
|
980
|
+
disabled,
|
|
981
|
+
form,
|
|
982
|
+
onChange: (event) => onValueChange(event.target.value),
|
|
940
983
|
...props,
|
|
941
984
|
style: {
|
|
942
985
|
...VISUALLY_HIDDEN_STYLES,
|
|
943
986
|
...props.style
|
|
944
987
|
},
|
|
945
988
|
ref: composedRefs,
|
|
946
|
-
defaultValue:
|
|
947
|
-
|
|
989
|
+
defaultValue: selectValue,
|
|
990
|
+
children: [shouldShowPlaceholder(value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(nativeOptions)]
|
|
991
|
+
}, nativeSelectKey);
|
|
948
992
|
});
|
|
949
993
|
SelectBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
994
|
+
function isFunction(value) {
|
|
995
|
+
return typeof value === "function";
|
|
996
|
+
}
|
|
950
997
|
function shouldShowPlaceholder(value) {
|
|
951
998
|
return value === "" || value === void 0;
|
|
952
999
|
}
|
|
@@ -987,17 +1034,5 @@ function findNextItem(items, search, currentItem) {
|
|
|
987
1034
|
function wrapArray(array, startIndex) {
|
|
988
1035
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
989
1036
|
}
|
|
990
|
-
var Root2 = Select;
|
|
991
|
-
var Trigger = SelectTrigger;
|
|
992
|
-
var Value = SelectValue;
|
|
993
|
-
var Icon = SelectIcon;
|
|
994
|
-
var Portal = SelectPortal;
|
|
995
|
-
var Content2 = SelectContent;
|
|
996
|
-
var Viewport = SelectViewport;
|
|
997
|
-
var Item = SelectItem;
|
|
998
|
-
var ItemText = SelectItemText;
|
|
999
|
-
var ItemIndicator = SelectItemIndicator;
|
|
1000
|
-
var ScrollUpButton = SelectScrollUpButton;
|
|
1001
|
-
var ScrollDownButton = SelectScrollDownButton;
|
|
1002
1037
|
//#endregion
|
|
1003
|
-
export {
|
|
1038
|
+
export { SelectItemIndicator as a, SelectScrollDownButton as c, SelectValue as d, SelectViewport as f, SelectItem as i, SelectScrollUpButton as l, Root as m, SelectContent as n, SelectItemText as o, usePrevious as p, SelectIcon as r, SelectPortal as s, Select as t, SelectTrigger as u };
|