@hot-updater/console 1.0.0-rc.1 → 1.0.0-rc.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 +1 -1
- package/.output/public/assets/HashValueDisplay-CB0Eskit.js +1 -0
- package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +1 -0
- package/.output/public/assets/api-keys-BzKocqRy.js +1 -0
- package/.output/public/assets/api-keys-api-BHcODB7q.js +1 -0
- package/.output/public/assets/card-Dhr_eFYj.js +1 -0
- package/.output/public/assets/{chart-no-axes-combined-FaYMGmQS.js → chart-no-axes-combined-Dy4WJv2U.js} +1 -1
- package/.output/public/assets/composite-Bp98A0Ld.js +1 -0
- package/.output/public/assets/createServerFn-CA8fs7QD.js +3 -0
- package/.output/public/assets/dialog-CUTrcPlB.js +1 -0
- package/.output/public/assets/dist-C_NydL0e.js +1 -0
- package/.output/public/assets/index-DdAz-CXv.js +10 -0
- package/.output/public/assets/input-group-cSOG4wh_.js +1 -0
- package/.output/public/assets/insights-C0PBSZ-n.js +1 -0
- package/.output/public/assets/installations-CE33wgbY.js +2 -0
- package/.output/public/assets/installations-CStZja8x.js +1 -0
- package/.output/public/assets/lazyRouteComponent-Ccp3bwBY.js +1 -0
- package/.output/public/assets/link-CI8idAUi.js +1 -0
- package/.output/public/assets/loader-circle-BoxLrsOu.js +1 -0
- package/.output/public/assets/{refresh-cw-BkbfZ62O.js → refresh-cw-Bqc72UZG.js} +1 -1
- package/.output/public/assets/{routes-BuoI5-Cr.js → routes-DGVXdzpw.js} +2 -2
- package/.output/public/assets/routes-DTlwOr8I.js +1 -0
- package/.output/public/assets/{shield-check-DE_hVuHu.js → shield-check-uK3MHWJZ.js} +1 -1
- package/.output/public/assets/signing-CMf4aqDO.js +1 -0
- package/.output/public/assets/styles-BCvbtKsm.css +2 -0
- package/.output/public/assets/table-2vcV89QB.js +1 -0
- package/.output/public/assets/useCompositeListItem-CHLITE_4.js +1 -0
- package/.output/public/assets/x-DCd0j8c6.js +1 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-Dftxlm2E.mjs → __23tanstack-start-server-fn-resolver-B7ioJhtE.mjs} +46 -54
- package/.output/server/_libs/@base-ui/react+[...].mjs +283 -2417
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +52 -4
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +2 -2
- package/.output/server/_libs/lucide-react.mjs +36 -3
- package/.output/server/_libs/next-themes.mjs +2 -2
- package/.output/server/_libs/sonner.mjs +2 -2
- package/.output/server/_libs/tanstack__react-query.mjs +2 -2
- package/.output/server/_libs/verkit.mjs +20 -15
- package/.output/server/_runtime.mjs +1 -10
- package/.output/server/_ssr/HashValueDisplay-DwpGLfrl.mjs +55 -0
- package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +484 -0
- package/.output/server/_ssr/{api-keys-CpBqHpuC.mjs → api-keys-CZeTPQys.mjs} +9 -11
- package/.output/server/_ssr/{api-keys-api-Czkp57UV.mjs → api-keys-api-BUPQVSpk.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-BTtMDSoR.mjs → api-keys-rpc-Cs7tS5_j.mjs} +5 -5
- package/.output/server/_ssr/{api-rpc-BEX8ISai.mjs → api-rpc-tAupfGQm.mjs} +73 -142
- package/.output/server/_ssr/{auth-rpc-BFMEC-TT.mjs → auth-rpc-DUaeOWKK.mjs} +2 -2
- package/.output/server/_ssr/{bundle-signing-rpc-BbCFUQSu.mjs → bundle-signing-rpc-BhnBw0-d.mjs} +2 -2
- package/.output/server/_ssr/{card-Bsc8mRis.mjs → card-BRiPmi0C.mjs} +25 -3
- package/.output/server/_ssr/{config.server-DQYEr_5X.mjs → config.server-afDuAwaG.mjs} +14 -7
- package/.output/server/_ssr/{createSsrRpc-DhfrxEjg.mjs → createSsrRpc-DjWNJ0uc.mjs} +6 -6
- package/.output/server/_ssr/databaseJsonValue-d6I3nAS4.mjs +45 -0
- package/.output/server/_ssr/{databaseRows-QlCYLi0H.mjs → databaseRows-5bCRTxm-.mjs} +4 -44
- package/.output/server/_ssr/{deleteBundle-Cu_XOMt0.mjs → deleteBundle-BTGwBgzx.mjs} +2 -2
- package/.output/server/_ssr/{dialog-C0vKUp8R.mjs → dialog-DS-nw-pA.mjs} +2 -2
- package/.output/server/_ssr/{dist-BVSLTpoP.mjs → dist-CyzPaI5v.mjs} +2 -2
- package/.output/server/_ssr/{getBundleChildren-BcRMFoDF.mjs → getBundleChildren-C0vh4ZvE.mjs} +2 -2
- package/.output/server/_ssr/input-group-BpsnmvZw.mjs +70 -0
- package/.output/server/_ssr/insights-BdS364Xu.mjs +460 -0
- package/.output/server/_ssr/insights-rpc-38DujK0G.mjs +57 -0
- package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +303 -0
- package/.output/server/_ssr/installations-CtA59MQG.mjs +29 -0
- package/.output/server/_ssr/installations-DiVKEF5T.mjs +627 -0
- package/.output/server/_ssr/{router-BxBEvtF1.mjs → router-B9wG_9f8.mjs} +23 -32
- package/.output/server/_ssr/{routes-BC7rn-tf.mjs → routes-CKrrS2q2.mjs} +3 -3
- package/.output/server/_ssr/{routes-CM5KAwpB.mjs → routes-D7Yh_jfj.mjs} +402 -389
- package/.output/server/_ssr/runtime.server-DacU1TBV.mjs +438 -0
- package/.output/server/_ssr/{server-CpzW--lT.mjs → server-D_C2rMzf.mjs} +5 -5
- package/.output/server/_ssr/{signing-jk4HANnl.mjs → signing-Dz1WkZOf.mjs} +5 -6
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{field-DASCh-5d.mjs → table-CnZmon_Z.mjs} +51 -5
- package/.output/server/_ssr/{uuidv7-CaKuKXrV.mjs → uuidv7-D0QFkPL_.mjs} +3 -3
- package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +97 -0
- package/.output/server/index.mjs +164 -178
- package/lib/index.d.mts +4 -3
- package/lib/vite-internal.mjs +1 -1
- package/lib/vite.d.mts +0 -1
- package/package.json +8 -8
- package/src/components/AppSidebar.tsx +10 -14
- package/src/components/ConsoleAccessPage.tsx +1 -1
- package/src/components/HashValueDisplay.tsx +11 -2
- package/src/components/features/bundles/BundleChildrenPanel.tsx +7 -6
- package/src/components/features/bundles/BundleMetadata.tsx +1 -20
- package/src/components/features/channels/ChannelManagementDialog.tsx +1 -1
- package/src/components/features/insights/EventDetails.tsx +151 -0
- package/src/components/features/insights/EventHistoryCard.tsx +245 -0
- package/src/components/features/insights/EventHistoryList.tsx +63 -0
- package/src/components/features/insights/InsightsBundleReports.tsx +51 -0
- package/src/components/features/insights/InsightsControls.tsx +82 -76
- package/src/components/features/insights/InsightsErrorAlert.tsx +5 -5
- package/src/components/features/insights/InsightsOverview.tsx +156 -161
- package/src/components/features/insights/InsightsPageHeader.tsx +48 -0
- package/src/components/features/insights/InsightsPagination.tsx +52 -0
- package/src/components/features/insights/InstallationHistoryCard.tsx +178 -176
- package/src/components/features/insights/InstallationMatchesCard.tsx +111 -65
- package/src/components/features/insights/InstallationPageHeader.tsx +57 -105
- package/src/components/features/releases/ReleaseEditorSheet.tsx +24 -24
- package/src/components/ui/badge.tsx +2 -0
- package/src/components/ui/combobox.tsx +1 -0
- package/src/components/ui/skeleton.tsx +4 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/index.ts +7 -2
- package/src/lib/api-rpc.ts +19 -90
- package/src/lib/api.ts +0 -99
- package/src/lib/insights-api.ts +93 -137
- package/src/lib/insights-rpc.ts +69 -199
- package/src/lib/insights-view.ts +15 -0
- package/src/lib/public-bundle-error.ts +19 -0
- package/src/lib/server/releaseReachability.ts +1 -4
- package/src/lib/server/runtime.server.ts +5 -141
- package/src/router.tsx +3 -0
- package/src/routes/-installations-search.ts +25 -12
- package/src/routes/__root.tsx +6 -16
- package/src/routes/index.tsx +21 -81
- package/src/routes/insights.tsx +50 -105
- package/src/routes/installations.tsx +290 -138
- package/src/styles.css +6 -0
- package/.output/public/assets/BundleIdDisplay-D4ErdU5_.js +0 -1
- package/.output/public/assets/InsightsCapabilityContext-B42VqvP6.js +0 -1
- package/.output/public/assets/api-keys-api-DGVTTvTJ.js +0 -1
- package/.output/public/assets/api-keys-z16OZIP4.js +0 -1
- package/.output/public/assets/badge-Br_KDO0J.js +0 -1
- package/.output/public/assets/card-DzuEXvyJ.js +0 -1
- package/.output/public/assets/createServerFn-gM2-LFBy.js +0 -3
- package/.output/public/assets/dialog-BeAENgez.js +0 -1
- package/.output/public/assets/dist-Bssh_cv0.js +0 -1
- package/.output/public/assets/field-Buq148-A.js +0 -1
- package/.output/public/assets/index-uOpQAIC4.js +0 -10
- package/.output/public/assets/input-group-B3p5UpyW.js +0 -1
- package/.output/public/assets/insights-DJTr7Ozn.js +0 -1
- package/.output/public/assets/insights-api-DVMOoRMS.js +0 -1
- package/.output/public/assets/installations-BY64iIAK.js +0 -2
- package/.output/public/assets/installations-D5v9i3AL.js +0 -1
- package/.output/public/assets/lazyRouteComponent-DKYu5cZJ.js +0 -1
- package/.output/public/assets/routes-C8fvgETO.js +0 -1
- package/.output/public/assets/search-qsIDvS2I.js +0 -1
- package/.output/public/assets/signing-mJD88Y4C.js +0 -1
- package/.output/public/assets/styles-BZIG7t42.css +0 -2
- package/.output/public/assets/table-RamFEclP.js +0 -1
- package/.output/public/assets/useCompositeListItem-ChzDqdpc.js +0 -42
- package/.output/public/assets/useMutation-JsGVjQMY.js +0 -1
- package/.output/public/assets/useOpenInteractionType-Dwfy-SpA.js +0 -1
- package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +0 -1554
- package/.output/server/_libs/d3-array.mjs +0 -231
- package/.output/server/_libs/d3-color.mjs +0 -330
- package/.output/server/_libs/d3-format.mjs +0 -252
- package/.output/server/_libs/d3-interpolate.mjs +0 -207
- package/.output/server/_libs/d3-path.mjs +0 -77
- package/.output/server/_libs/d3-scale+[...].mjs +0 -1907
- package/.output/server/_libs/d3-shape.mjs +0 -818
- package/.output/server/_libs/decimal.js-light.mjs +0 -884
- package/.output/server/_libs/es-toolkit.mjs +0 -1134
- package/.output/server/_libs/eventemitter3.mjs +0 -236
- package/.output/server/_libs/immer.mjs +0 -532
- package/.output/server/_libs/react-redux+[...].mjs +0 -205
- package/.output/server/_libs/recharts+[...].mjs +0 -14117
- package/.output/server/_ssr/BundleActivityChart-CWcdPuUn.mjs +0 -288
- package/.output/server/_ssr/BundleIdDisplay-BEvB3MvA.mjs +0 -13
- package/.output/server/_ssr/InsightsCapabilityContext-Cx8fjm2s.mjs +0 -15
- package/.output/server/_ssr/badge-CpWXQwyF.mjs +0 -26
- package/.output/server/_ssr/input-group-etIsBUqv.mjs +0 -288
- package/.output/server/_ssr/insights-api-C1F7UreR.mjs +0 -71
- package/.output/server/_ssr/insights-input-9fEJF-ZG.mjs +0 -96
- package/.output/server/_ssr/insights-rpc-C-8R6kED.mjs +0 -155
- package/.output/server/_ssr/insights-ygT_aIfo.mjs +0 -858
- package/.output/server/_ssr/installations-DqRT1QTd.mjs +0 -535
- package/.output/server/_ssr/installations-K8TCYTYh.mjs +0 -19
- package/.output/server/_ssr/runtime.server-la7TRAH_.mjs +0 -527
- package/.output/server/_ssr/table-CU58HeI7.mjs +0 -53
- package/.output/server/_tanstack-start-manifest_v-Mz9MmSlD.mjs +0 -103
- package/src/components/features/bundles/BundleActivityChart.tsx +0 -193
- package/src/components/features/bundles/BundleInsightsSummary.tsx +0 -123
- package/src/components/features/insights/ActivityChart.tsx +0 -150
- package/src/components/features/insights/BundleDistribution.tsx +0 -133
- package/src/components/features/insights/BundleSelector.tsx +0 -114
- package/src/components/features/insights/InsightsCapabilityContext.tsx +0 -24
- package/src/components/features/insights/InstallationPagination.tsx +0 -48
- package/src/components/features/insights/InstallationSearch.tsx +0 -230
- package/src/components/features/insights/UpdateOutcomes.tsx +0 -147
- package/src/lib/insights-error.ts +0 -19
- package/src/lib/insights-input.ts +0 -187
- package/src/lib/insights-overview.ts +0 -170
- package/src/lib/server/releaseActivity.ts +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "../../_runtime.mjs";
|
|
2
2
|
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.production.js
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -1287,7 +1287,7 @@ var platform$1 = getPlatform();
|
|
|
1287
1287
|
var userAgent = getUserAgent();
|
|
1288
1288
|
var isWebKit = typeof CSS === "undefined" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter:none");
|
|
1289
1289
|
var isIOS = nav.platform === "MacIntel" && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform);
|
|
1290
|
-
|
|
1290
|
+
hasNavigator && /firefox/i.test(userAgent);
|
|
1291
1291
|
var isSafari = hasNavigator && /apple/i.test(navigator.vendor);
|
|
1292
1292
|
hasNavigator && /Edg/i.test(userAgent);
|
|
1293
1293
|
var isAndroid = hasNavigator && /android/i.test(platform$1) || /android/i.test(userAgent);
|
|
@@ -1450,11 +1450,8 @@ var triggerFocus = "trigger-focus";
|
|
|
1450
1450
|
var outsidePress = "outside-press";
|
|
1451
1451
|
var itemPress = "item-press";
|
|
1452
1452
|
var closePress = "close-press";
|
|
1453
|
-
var clearPress = "clear-press";
|
|
1454
1453
|
var trackPress = "track-press";
|
|
1455
1454
|
var inputChange = "input-change";
|
|
1456
|
-
var inputClear = "input-clear";
|
|
1457
|
-
var inputPress = "input-press";
|
|
1458
1455
|
var focusOut = "focus-out";
|
|
1459
1456
|
var escapeKey = "escape-key";
|
|
1460
1457
|
var listNavigation = "list-navigation";
|
|
@@ -5702,7 +5699,7 @@ var ReactStore = class extends Store {
|
|
|
5702
5699
|
};
|
|
5703
5700
|
//#endregion
|
|
5704
5701
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingRootStore.js
|
|
5705
|
-
var selectors$
|
|
5702
|
+
var selectors$3 = {
|
|
5706
5703
|
open: createSelector((state) => state.open),
|
|
5707
5704
|
transitionStatus: createSelector((state) => state.transitionStatus),
|
|
5708
5705
|
domReferenceElement: createSelector((state) => state.domReferenceElement),
|
|
@@ -5723,7 +5720,7 @@ var FloatingRootStore = class extends ReactStore {
|
|
|
5723
5720
|
events: createEventEmitter(),
|
|
5724
5721
|
nested,
|
|
5725
5722
|
triggerElements
|
|
5726
|
-
}, selectors$
|
|
5723
|
+
}, selectors$3);
|
|
5727
5724
|
this.syncOnly = syncOnly;
|
|
5728
5725
|
}
|
|
5729
5726
|
/**
|
|
@@ -7769,7 +7766,7 @@ function safePolygon(options = {}) {
|
|
|
7769
7766
|
}
|
|
7770
7767
|
//#endregion
|
|
7771
7768
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/tooltip/store/TooltipStore.js
|
|
7772
|
-
var selectors$
|
|
7769
|
+
var selectors$2 = {
|
|
7773
7770
|
...popupStoreSelectors,
|
|
7774
7771
|
disabled: createSelector((state) => state.disabled),
|
|
7775
7772
|
instantType: createSelector((state) => state.instantType),
|
|
@@ -7794,7 +7791,7 @@ var TooltipStore = class TooltipStore extends ReactStore {
|
|
|
7794
7791
|
onOpenChange: void 0,
|
|
7795
7792
|
onOpenChangeComplete: void 0,
|
|
7796
7793
|
triggerElements
|
|
7797
|
-
}, selectors$
|
|
7794
|
+
}, selectors$2);
|
|
7798
7795
|
}
|
|
7799
7796
|
setOpen = (nextOpen, eventDetails) => {
|
|
7800
7797
|
const reason = eventDetails.reason;
|
|
@@ -8821,7 +8818,7 @@ var TooltipPositioner = /* @__PURE__ */ import_react.forwardRef(function Tooltip
|
|
|
8821
8818
|
});
|
|
8822
8819
|
//#endregion
|
|
8823
8820
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/tooltip/popup/TooltipPopup.js
|
|
8824
|
-
var stateAttributesMapping$
|
|
8821
|
+
var stateAttributesMapping$7 = {
|
|
8825
8822
|
...popupStateMapping,
|
|
8826
8823
|
...transitionStatusMapping
|
|
8827
8824
|
};
|
|
@@ -8872,7 +8869,7 @@ var TooltipPopup = /* @__PURE__ */ import_react.forwardRef(function TooltipPopup
|
|
|
8872
8869
|
getDisabledMountTransitionStyles(transitionStatus),
|
|
8873
8870
|
elementProps
|
|
8874
8871
|
],
|
|
8875
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
8872
|
+
stateAttributesMapping: stateAttributesMapping$7
|
|
8876
8873
|
});
|
|
8877
8874
|
});
|
|
8878
8875
|
//#endregion
|
|
@@ -9225,7 +9222,7 @@ function useDialogRootContext(optional) {
|
|
|
9225
9222
|
}
|
|
9226
9223
|
//#endregion
|
|
9227
9224
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/dialog/store/DialogStore.js
|
|
9228
|
-
var selectors$
|
|
9225
|
+
var selectors$1 = {
|
|
9229
9226
|
...popupStoreSelectors,
|
|
9230
9227
|
modal: createSelector((state) => state.modal),
|
|
9231
9228
|
nested: createSelector((state) => state.nested),
|
|
@@ -9251,7 +9248,7 @@ var DialogStore = class DialogStore extends ReactStore {
|
|
|
9251
9248
|
triggerElements,
|
|
9252
9249
|
onOpenChange: void 0,
|
|
9253
9250
|
onOpenChangeComplete: void 0
|
|
9254
|
-
}, selectors$
|
|
9251
|
+
}, selectors$1);
|
|
9255
9252
|
}
|
|
9256
9253
|
setOpen = (nextOpen, eventDetails) => {
|
|
9257
9254
|
eventDetails.preventUnmountOnClose = () => {
|
|
@@ -9360,7 +9357,7 @@ function AlertDialogRoot(props) {
|
|
|
9360
9357
|
}
|
|
9361
9358
|
//#endregion
|
|
9362
9359
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/dialog/backdrop/DialogBackdrop.js
|
|
9363
|
-
var stateAttributesMapping$
|
|
9360
|
+
var stateAttributesMapping$6 = {
|
|
9364
9361
|
...popupStateMapping,
|
|
9365
9362
|
...transitionStatusMapping
|
|
9366
9363
|
};
|
|
@@ -9382,7 +9379,7 @@ var DialogBackdrop = /* @__PURE__ */ import_react.forwardRef(function DialogBack
|
|
|
9382
9379
|
transitionStatus: store.useState("transitionStatus")
|
|
9383
9380
|
},
|
|
9384
9381
|
ref: [store.context.backdropRef, forwardedRef],
|
|
9385
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
9382
|
+
stateAttributesMapping: stateAttributesMapping$6,
|
|
9386
9383
|
props: [{
|
|
9387
9384
|
role: "presentation",
|
|
9388
9385
|
hidden: !mounted,
|
|
@@ -9589,7 +9586,7 @@ function getStyles(element) {
|
|
|
9589
9586
|
}
|
|
9590
9587
|
//#endregion
|
|
9591
9588
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/dialog/popup/DialogPopup.js
|
|
9592
|
-
var stateAttributesMapping$
|
|
9589
|
+
var stateAttributesMapping$5 = {
|
|
9593
9590
|
...popupStateMapping,
|
|
9594
9591
|
...transitionStatusMapping,
|
|
9595
9592
|
nestedDialogOpen(value) {
|
|
@@ -9663,7 +9660,7 @@ var DialogPopup = /* @__PURE__ */ import_react.forwardRef(function DialogPopup(c
|
|
|
9663
9660
|
store.context.popupRef,
|
|
9664
9661
|
setPopupElement
|
|
9665
9662
|
],
|
|
9666
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
9663
|
+
stateAttributesMapping: stateAttributesMapping$5
|
|
9667
9664
|
});
|
|
9668
9665
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingFocusManager, {
|
|
9669
9666
|
context: floatingRootContext,
|
|
@@ -10493,7 +10490,7 @@ var ToggleGroupDataAttributes = /* @__PURE__ */ function(ToggleGroupDataAttribut
|
|
|
10493
10490
|
}({});
|
|
10494
10491
|
//#endregion
|
|
10495
10492
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle-group/ToggleGroup.js
|
|
10496
|
-
var stateAttributesMapping$
|
|
10493
|
+
var stateAttributesMapping$4 = { multiple(value) {
|
|
10497
10494
|
if (value) return { [ToggleGroupDataAttributes.multiple]: "" };
|
|
10498
10495
|
return null;
|
|
10499
10496
|
} };
|
|
@@ -10548,7 +10545,7 @@ var ToggleGroup = /* @__PURE__ */ import_react.forwardRef(function ToggleGroup(c
|
|
|
10548
10545
|
state,
|
|
10549
10546
|
ref: forwardedRef,
|
|
10550
10547
|
props: [defaultProps, elementProps],
|
|
10551
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
10548
|
+
stateAttributesMapping: stateAttributesMapping$4
|
|
10552
10549
|
});
|
|
10553
10550
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupContext.Provider, {
|
|
10554
10551
|
value: contextValue,
|
|
@@ -10559,7 +10556,7 @@ var ToggleGroup = /* @__PURE__ */ import_react.forwardRef(function ToggleGroup(c
|
|
|
10559
10556
|
state,
|
|
10560
10557
|
refs: [forwardedRef],
|
|
10561
10558
|
props: [defaultProps, elementProps],
|
|
10562
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
10559
|
+
stateAttributesMapping: stateAttributesMapping$4,
|
|
10563
10560
|
loopFocus,
|
|
10564
10561
|
enableHomeAndEndKeys: true,
|
|
10565
10562
|
orientation
|
|
@@ -10567,185 +10564,19 @@ var ToggleGroup = /* @__PURE__ */ import_react.forwardRef(function ToggleGroup(c
|
|
|
10567
10564
|
});
|
|
10568
10565
|
});
|
|
10569
10566
|
//#endregion
|
|
10570
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/
|
|
10571
|
-
var
|
|
10572
|
-
var
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
const context = import_react.useContext(ComboboxRootContext);
|
|
10577
|
-
if (!context) throw new Error(formatErrorMessage(22));
|
|
10578
|
-
return context;
|
|
10579
|
-
}
|
|
10580
|
-
function useComboboxFloatingContext() {
|
|
10581
|
-
const context = import_react.useContext(ComboboxFloatingContext);
|
|
10582
|
-
if (!context) throw new Error(formatErrorMessage(23));
|
|
10567
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/root/SelectRootContext.js
|
|
10568
|
+
var SelectRootContext = /* @__PURE__ */ import_react.createContext(null);
|
|
10569
|
+
var SelectFloatingContext = /* @__PURE__ */ import_react.createContext(null);
|
|
10570
|
+
function useSelectRootContext() {
|
|
10571
|
+
const context = import_react.useContext(SelectRootContext);
|
|
10572
|
+
if (context === null) throw new Error(formatErrorMessage(60));
|
|
10583
10573
|
return context;
|
|
10584
10574
|
}
|
|
10585
|
-
function
|
|
10586
|
-
const context = import_react.useContext(
|
|
10587
|
-
if (
|
|
10575
|
+
function useSelectFloatingContext() {
|
|
10576
|
+
const context = import_react.useContext(SelectFloatingContext);
|
|
10577
|
+
if (context === null) throw new Error(formatErrorMessage(61));
|
|
10588
10578
|
return context;
|
|
10589
10579
|
}
|
|
10590
|
-
function useComboboxInputValueContext() {
|
|
10591
|
-
return import_react.useContext(ComboboxInputValueContext);
|
|
10592
|
-
}
|
|
10593
|
-
//#endregion
|
|
10594
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/itemEquality.js
|
|
10595
|
-
var defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
|
|
10596
|
-
function compareItemEquality(itemValue, selectedValue, comparer) {
|
|
10597
|
-
if (itemValue == null || selectedValue == null) return Object.is(itemValue, selectedValue);
|
|
10598
|
-
return comparer(itemValue, selectedValue);
|
|
10599
|
-
}
|
|
10600
|
-
function selectedValueIncludes(selectedValues, itemValue, comparer) {
|
|
10601
|
-
if (!selectedValues || selectedValues.length === 0) return false;
|
|
10602
|
-
return selectedValues.some((selectedValue) => {
|
|
10603
|
-
if (selectedValue === void 0) return false;
|
|
10604
|
-
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
10605
|
-
});
|
|
10606
|
-
}
|
|
10607
|
-
function findItemIndex(itemValues, selectedValue, comparer) {
|
|
10608
|
-
if (!itemValues || itemValues.length === 0) return -1;
|
|
10609
|
-
return itemValues.findIndex((itemValue) => {
|
|
10610
|
-
if (itemValue === void 0) return false;
|
|
10611
|
-
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
10612
|
-
});
|
|
10613
|
-
}
|
|
10614
|
-
function removeItem(selectedValues, itemValue, comparer) {
|
|
10615
|
-
return selectedValues.filter((selectedValue) => !compareItemEquality(itemValue, selectedValue, comparer));
|
|
10616
|
-
}
|
|
10617
|
-
//#endregion
|
|
10618
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/serializeValue.js
|
|
10619
|
-
function serializeValue(value) {
|
|
10620
|
-
if (value == null) return "";
|
|
10621
|
-
if (typeof value === "string") return value;
|
|
10622
|
-
try {
|
|
10623
|
-
return JSON.stringify(value);
|
|
10624
|
-
} catch {
|
|
10625
|
-
return String(value);
|
|
10626
|
-
}
|
|
10627
|
-
}
|
|
10628
|
-
//#endregion
|
|
10629
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/resolveValueLabel.js
|
|
10630
|
-
function isGroupedItems(items) {
|
|
10631
|
-
return items != null && items.length > 0 && typeof items[0] === "object" && items[0] != null && "items" in items[0];
|
|
10632
|
-
}
|
|
10633
|
-
/**
|
|
10634
|
-
* Checks if the items array contains an item with a null value that has a non-null label.
|
|
10635
|
-
*/
|
|
10636
|
-
function hasNullItemLabel(items) {
|
|
10637
|
-
if (!Array.isArray(items)) return items != null && "null" in items;
|
|
10638
|
-
const arrayItems = items;
|
|
10639
|
-
if (isGroupedItems(arrayItems)) {
|
|
10640
|
-
for (const group of arrayItems) for (const item of group.items) if (item && item.value == null && item.label != null) return true;
|
|
10641
|
-
return false;
|
|
10642
|
-
}
|
|
10643
|
-
for (const item of arrayItems) if (item && item.value == null && item.label != null) return true;
|
|
10644
|
-
return false;
|
|
10645
|
-
}
|
|
10646
|
-
function stringifyAsLabel(item, itemToStringLabel) {
|
|
10647
|
-
if (itemToStringLabel && item != null) return itemToStringLabel(item) ?? "";
|
|
10648
|
-
if (item && typeof item === "object") {
|
|
10649
|
-
if ("label" in item && item.label != null) return String(item.label);
|
|
10650
|
-
if ("value" in item) return String(item.value);
|
|
10651
|
-
}
|
|
10652
|
-
return serializeValue(item);
|
|
10653
|
-
}
|
|
10654
|
-
function stringifyAsValue(item, itemToStringValue) {
|
|
10655
|
-
if (itemToStringValue && item != null) return itemToStringValue(item) ?? "";
|
|
10656
|
-
if (item && typeof item === "object" && "value" in item && "label" in item) return serializeValue(item.value);
|
|
10657
|
-
return serializeValue(item);
|
|
10658
|
-
}
|
|
10659
|
-
function resolveSelectedLabel(value, items, itemToStringLabel) {
|
|
10660
|
-
function fallback() {
|
|
10661
|
-
return stringifyAsLabel(value, itemToStringLabel);
|
|
10662
|
-
}
|
|
10663
|
-
if (itemToStringLabel && value != null) return itemToStringLabel(value);
|
|
10664
|
-
if (value && typeof value === "object" && "label" in value && value.label != null) return value.label;
|
|
10665
|
-
if (items && !Array.isArray(items)) return items[value] ?? fallback();
|
|
10666
|
-
if (Array.isArray(items)) {
|
|
10667
|
-
const arrayItems = items;
|
|
10668
|
-
const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap((group) => group.items) : arrayItems;
|
|
10669
|
-
if (value == null || typeof value !== "object") {
|
|
10670
|
-
const match = flatItems.find((item) => item.value === value);
|
|
10671
|
-
if (match && match.label != null) return match.label;
|
|
10672
|
-
return fallback();
|
|
10673
|
-
}
|
|
10674
|
-
if ("value" in value) {
|
|
10675
|
-
const match = flatItems.find((item) => item && item.value === value.value);
|
|
10676
|
-
if (match && match.label != null) return match.label;
|
|
10677
|
-
}
|
|
10678
|
-
}
|
|
10679
|
-
return fallback();
|
|
10680
|
-
}
|
|
10681
|
-
function resolveMultipleLabels(values, items, itemToStringLabel) {
|
|
10682
|
-
return values.reduce((acc, value, index) => {
|
|
10683
|
-
if (index > 0) acc.push(", ");
|
|
10684
|
-
acc.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: resolveSelectedLabel(value, items, itemToStringLabel) }, index));
|
|
10685
|
-
return acc;
|
|
10686
|
-
}, []);
|
|
10687
|
-
}
|
|
10688
|
-
//#endregion
|
|
10689
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/store.js
|
|
10690
|
-
var selectors$1 = {
|
|
10691
|
-
id: createSelector((state) => state.id),
|
|
10692
|
-
labelId: createSelector((state) => state.labelId),
|
|
10693
|
-
items: createSelector((state) => state.items),
|
|
10694
|
-
selectedValue: createSelector((state) => state.selectedValue),
|
|
10695
|
-
hasSelectionChips: createSelector((state) => {
|
|
10696
|
-
const selectedValue = state.selectedValue;
|
|
10697
|
-
return Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
10698
|
-
}),
|
|
10699
|
-
hasSelectedValue: createSelector((state) => {
|
|
10700
|
-
const { selectedValue, selectionMode } = state;
|
|
10701
|
-
if (selectedValue == null) return false;
|
|
10702
|
-
if (selectionMode === "multiple" && Array.isArray(selectedValue)) return selectedValue.length > 0;
|
|
10703
|
-
return true;
|
|
10704
|
-
}),
|
|
10705
|
-
hasNullItemLabel: createSelector((state, enabled) => {
|
|
10706
|
-
return enabled ? hasNullItemLabel(state.items) : false;
|
|
10707
|
-
}),
|
|
10708
|
-
open: createSelector((state) => state.open),
|
|
10709
|
-
mounted: createSelector((state) => state.mounted),
|
|
10710
|
-
forceMounted: createSelector((state) => state.forceMounted),
|
|
10711
|
-
inline: createSelector((state) => state.inline),
|
|
10712
|
-
activeIndex: createSelector((state) => state.activeIndex),
|
|
10713
|
-
selectedIndex: createSelector((state) => state.selectedIndex),
|
|
10714
|
-
isActive: createSelector((state, index) => state.activeIndex === index),
|
|
10715
|
-
isSelected: createSelector((state, itemValue) => {
|
|
10716
|
-
const comparer = state.isItemEqualToValue;
|
|
10717
|
-
const selectedValue = state.selectedValue;
|
|
10718
|
-
if (Array.isArray(selectedValue)) return selectedValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
|
|
10719
|
-
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
10720
|
-
}),
|
|
10721
|
-
transitionStatus: createSelector((state) => state.transitionStatus),
|
|
10722
|
-
popupProps: createSelector((state) => state.popupProps),
|
|
10723
|
-
inputProps: createSelector((state) => state.inputProps),
|
|
10724
|
-
triggerProps: createSelector((state) => state.triggerProps),
|
|
10725
|
-
itemProps: createSelector((state) => state.itemProps),
|
|
10726
|
-
positionerElement: createSelector((state) => state.positionerElement),
|
|
10727
|
-
listElement: createSelector((state) => state.listElement),
|
|
10728
|
-
triggerElement: createSelector((state) => state.triggerElement),
|
|
10729
|
-
inputElement: createSelector((state) => state.inputElement),
|
|
10730
|
-
inputGroupElement: createSelector((state) => state.inputGroupElement),
|
|
10731
|
-
popupSide: createSelector((state) => state.popupSide),
|
|
10732
|
-
openMethod: createSelector((state) => state.openMethod),
|
|
10733
|
-
inputInsidePopup: createSelector((state) => state.inputInsidePopup),
|
|
10734
|
-
inputOwnsFormValue: createSelector((state) => state.inputOwnsFormValue),
|
|
10735
|
-
selectionMode: createSelector((state) => state.selectionMode),
|
|
10736
|
-
name: createSelector((state) => state.name),
|
|
10737
|
-
form: createSelector((state) => state.form),
|
|
10738
|
-
disabled: createSelector((state) => state.disabled),
|
|
10739
|
-
readOnly: createSelector((state) => state.readOnly),
|
|
10740
|
-
required: createSelector((state) => state.required),
|
|
10741
|
-
grid: createSelector((state) => state.grid),
|
|
10742
|
-
virtualized: createSelector((state) => state.virtualized),
|
|
10743
|
-
itemToStringLabel: createSelector((state) => state.itemToStringLabel),
|
|
10744
|
-
isItemEqualToValue: createSelector((state) => state.isItemEqualToValue),
|
|
10745
|
-
modal: createSelector((state) => state.modal),
|
|
10746
|
-
autoHighlight: createSelector((state) => state.autoHighlight),
|
|
10747
|
-
submitOnItemClick: createSelector((state) => state.submitOnItemClick)
|
|
10748
|
-
};
|
|
10749
10580
|
//#endregion
|
|
10750
10581
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/field/control/FieldControlDataAttributes.js
|
|
10751
10582
|
var FieldControlDataAttributes = /* @__PURE__ */ function(FieldControlDataAttributes) {
|
|
@@ -10880,18 +10711,6 @@ function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, en
|
|
|
10880
10711
|
]);
|
|
10881
10712
|
}
|
|
10882
10713
|
//#endregion
|
|
10883
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/form-context/FormContext.js
|
|
10884
|
-
var FormContext = /* @__PURE__ */ import_react.createContext({
|
|
10885
|
-
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
|
10886
|
-
errors: {},
|
|
10887
|
-
clearErrors: NOOP,
|
|
10888
|
-
validationMode: "onSubmit",
|
|
10889
|
-
submitAttemptedRef: { current: false }
|
|
10890
|
-
});
|
|
10891
|
-
function useFormContext() {
|
|
10892
|
-
return import_react.useContext(FormContext);
|
|
10893
|
-
}
|
|
10894
|
-
//#endregion
|
|
10895
10714
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/labelable-provider/LabelableContext.js
|
|
10896
10715
|
/**
|
|
10897
10716
|
* A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\
|
|
@@ -10961,2228 +10780,99 @@ function useLabelableId(params = {}) {
|
|
|
10961
10780
|
return controlId ?? defaultId;
|
|
10962
10781
|
}
|
|
10963
10782
|
//#endregion
|
|
10964
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
* • When `item` is a primitive (e.g. `string`), it is used directly.
|
|
10970
|
-
*/
|
|
10971
|
-
function createCollatorItemFilter(collatorFilter, itemToStringLabel) {
|
|
10972
|
-
return (item, query) => {
|
|
10973
|
-
if (item == null) return false;
|
|
10974
|
-
const itemString = stringifyAsLabel(item, itemToStringLabel);
|
|
10975
|
-
return collatorFilter.contains(itemString, query);
|
|
10976
|
-
};
|
|
10783
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/itemEquality.js
|
|
10784
|
+
var defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
|
|
10785
|
+
function compareItemEquality(itemValue, selectedValue, comparer) {
|
|
10786
|
+
if (itemValue == null || selectedValue == null) return Object.is(itemValue, selectedValue);
|
|
10787
|
+
return comparer(itemValue, selectedValue);
|
|
10977
10788
|
}
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
if (item == null) return false;
|
|
10985
|
-
if (!query) return true;
|
|
10986
|
-
const itemString = stringifyAsLabel(item, itemToStringLabel);
|
|
10987
|
-
const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, itemToStringLabel) : "";
|
|
10988
|
-
if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) return true;
|
|
10989
|
-
return collatorFilter.contains(itemString, query);
|
|
10990
|
-
};
|
|
10789
|
+
function selectedValueIncludes(selectedValues, itemValue, comparer) {
|
|
10790
|
+
if (!selectedValues || selectedValues.length === 0) return false;
|
|
10791
|
+
return selectedValues.some((selectedValue) => {
|
|
10792
|
+
if (selectedValue === void 0) return false;
|
|
10793
|
+
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
10794
|
+
});
|
|
10991
10795
|
}
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
sensitivity: "base",
|
|
10999
|
-
ignorePunctuation: true,
|
|
11000
|
-
...options
|
|
11001
|
-
};
|
|
11002
|
-
const cacheKey = `${stringifyLocale(options.locale)}|${JSON.stringify(mergedOptions)}`;
|
|
11003
|
-
const cachedFilter = filterCache.get(cacheKey);
|
|
11004
|
-
if (cachedFilter) return cachedFilter;
|
|
11005
|
-
const collator = new Intl.Collator(options.locale, mergedOptions);
|
|
11006
|
-
const filter = {
|
|
11007
|
-
contains(item, query, itemToString) {
|
|
11008
|
-
if (!query) return true;
|
|
11009
|
-
const itemString = stringifyAsLabel(item, itemToString);
|
|
11010
|
-
for (let i = 0; i <= itemString.length - query.length; i += 1) if (collator.compare(itemString.slice(i, i + query.length), query) === 0) return true;
|
|
11011
|
-
return false;
|
|
11012
|
-
},
|
|
11013
|
-
startsWith(item, query, itemToString) {
|
|
11014
|
-
if (!query) return true;
|
|
11015
|
-
const itemString = stringifyAsLabel(item, itemToString);
|
|
11016
|
-
return collator.compare(itemString.slice(0, query.length), query) === 0;
|
|
11017
|
-
},
|
|
11018
|
-
endsWith(item, query, itemToString) {
|
|
11019
|
-
if (!query) return true;
|
|
11020
|
-
const itemString = stringifyAsLabel(item, itemToString);
|
|
11021
|
-
const queryLength = query.length;
|
|
11022
|
-
return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;
|
|
11023
|
-
}
|
|
11024
|
-
};
|
|
11025
|
-
filterCache.set(cacheKey, filter);
|
|
11026
|
-
return filter;
|
|
10796
|
+
function findItemIndex(itemValues, selectedValue, comparer) {
|
|
10797
|
+
if (!itemValues || itemValues.length === 0) return -1;
|
|
10798
|
+
return itemValues.findIndex((itemValue) => {
|
|
10799
|
+
if (itemValue === void 0) return false;
|
|
10800
|
+
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
10801
|
+
});
|
|
11027
10802
|
}
|
|
11028
|
-
function
|
|
11029
|
-
|
|
11030
|
-
if (locale == null) return "";
|
|
11031
|
-
return String(locale);
|
|
10803
|
+
function removeItem(selectedValues, itemValue, comparer) {
|
|
10804
|
+
return selectedValues.filter((selectedValue) => !compareItemEquality(itemValue, selectedValue, comparer));
|
|
11032
10805
|
}
|
|
11033
10806
|
//#endregion
|
|
11034
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
index: -1
|
|
11045
|
-
};
|
|
10807
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/serializeValue.js
|
|
10808
|
+
function serializeValue(value) {
|
|
10809
|
+
if (value == null) return "";
|
|
10810
|
+
if (typeof value === "string") return value;
|
|
10811
|
+
try {
|
|
10812
|
+
return JSON.stringify(value);
|
|
10813
|
+
} catch {
|
|
10814
|
+
return String(value);
|
|
10815
|
+
}
|
|
10816
|
+
}
|
|
11046
10817
|
//#endregion
|
|
11047
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/
|
|
10818
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/resolveValueLabel.js
|
|
10819
|
+
function isGroupedItems(items) {
|
|
10820
|
+
return items != null && items.length > 0 && typeof items[0] === "object" && items[0] != null && "items" in items[0];
|
|
10821
|
+
}
|
|
11048
10822
|
/**
|
|
11049
|
-
*
|
|
10823
|
+
* Checks if the items array contains an item with a null value that has a non-null label.
|
|
11050
10824
|
*/
|
|
11051
|
-
function
|
|
11052
|
-
|
|
11053
|
-
const
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
const
|
|
11059
|
-
|
|
11060
|
-
const listRef = import_react.useRef([]);
|
|
11061
|
-
const labelsRef = import_react.useRef([]);
|
|
11062
|
-
const popupRef = import_react.useRef(null);
|
|
11063
|
-
const inputRef = import_react.useRef(null);
|
|
11064
|
-
const startDismissRef = import_react.useRef(null);
|
|
11065
|
-
const endDismissRef = import_react.useRef(null);
|
|
11066
|
-
const emptyRef = import_react.useRef(null);
|
|
11067
|
-
const keyboardActiveRef = import_react.useRef(true);
|
|
11068
|
-
const hadInputClearRef = import_react.useRef(false);
|
|
11069
|
-
const chipsContainerRef = import_react.useRef(null);
|
|
11070
|
-
const clearRef = import_react.useRef(null);
|
|
11071
|
-
const selectionEventRef = import_react.useRef(null);
|
|
11072
|
-
const lastHighlightRef = import_react.useRef(INITIAL_LAST_HIGHLIGHT);
|
|
11073
|
-
const pendingQueryHighlightRef = import_react.useRef(null);
|
|
11074
|
-
/**
|
|
11075
|
-
* Contains the currently visible list of item values post-filtering.
|
|
11076
|
-
*/
|
|
11077
|
-
const valuesRef = import_react.useRef([]);
|
|
11078
|
-
/**
|
|
11079
|
-
* Contains all item values in a stable, unfiltered order.
|
|
11080
|
-
* This is only used when `items` prop is not provided.
|
|
11081
|
-
* It accumulates values on first mount and does not remove them on unmount due to
|
|
11082
|
-
* filtering, providing a stable index for selected value tracking.
|
|
11083
|
-
*/
|
|
11084
|
-
const allValuesRef = import_react.useRef([]);
|
|
11085
|
-
const disabled = fieldDisabled || disabledProp;
|
|
11086
|
-
const name = fieldName ?? nameProp;
|
|
11087
|
-
const multiple = selectionMode === "multiple";
|
|
11088
|
-
const single = selectionMode === "single";
|
|
11089
|
-
const hasInputValue = inputValueProp !== void 0 || defaultInputValueProp !== void 0;
|
|
11090
|
-
const hasItems = items !== void 0;
|
|
11091
|
-
const hasFilteredItemsProp = filteredItemsProp !== void 0;
|
|
11092
|
-
let autoHighlightMode;
|
|
11093
|
-
if (autoHighlight === "always") autoHighlightMode = "always";
|
|
11094
|
-
else autoHighlightMode = autoHighlight ? "input-change" : false;
|
|
11095
|
-
const [selectedValue, setSelectedValueUnwrapped] = useControlled({
|
|
11096
|
-
controlled: selectedValueProp,
|
|
11097
|
-
default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY$1 : defaultSelectedValue,
|
|
11098
|
-
name: "Combobox",
|
|
11099
|
-
state: "selectedValue"
|
|
11100
|
-
});
|
|
11101
|
-
const filter = import_react.useMemo(() => {
|
|
11102
|
-
if (filterProp === null) return () => true;
|
|
11103
|
-
if (filterProp !== void 0) return filterProp;
|
|
11104
|
-
if (single && !queryChangedAfterOpen) return createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue);
|
|
11105
|
-
return createCollatorItemFilter(collatorFilter, itemToStringLabel);
|
|
11106
|
-
}, [
|
|
11107
|
-
filterProp,
|
|
11108
|
-
single,
|
|
11109
|
-
selectedValue,
|
|
11110
|
-
queryChangedAfterOpen,
|
|
11111
|
-
collatorFilter,
|
|
11112
|
-
itemToStringLabel
|
|
11113
|
-
]);
|
|
11114
|
-
const initialDefaultInputValue = useRefWithInit(() => {
|
|
11115
|
-
if (hasInputValue) return defaultInputValueProp ?? "";
|
|
11116
|
-
if (single) return stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
11117
|
-
return "";
|
|
11118
|
-
}).current;
|
|
11119
|
-
const [inputValue, setInputValueUnwrapped] = useControlled({
|
|
11120
|
-
controlled: inputValueProp,
|
|
11121
|
-
default: initialDefaultInputValue,
|
|
11122
|
-
name: "Combobox",
|
|
11123
|
-
state: "inputValue"
|
|
11124
|
-
});
|
|
11125
|
-
const [open, setOpenUnwrapped] = useControlled({
|
|
11126
|
-
controlled: openProp,
|
|
11127
|
-
default: defaultOpen,
|
|
11128
|
-
name: "Combobox",
|
|
11129
|
-
state: "open"
|
|
11130
|
-
});
|
|
11131
|
-
const isGrouped = isGroupedItems(items);
|
|
11132
|
-
const query = closeQuery ?? (inputValue === "" ? "" : String(inputValue).trim());
|
|
11133
|
-
const selectedLabelString = single ? stringifyAsLabel(selectedValue, itemToStringLabel) : "";
|
|
11134
|
-
const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
|
|
11135
|
-
const filterQuery = shouldBypassFiltering ? "" : query;
|
|
11136
|
-
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering;
|
|
11137
|
-
const flatItems = import_react.useMemo(() => {
|
|
11138
|
-
if (!items) return EMPTY_ARRAY$1;
|
|
11139
|
-
if (isGrouped) return items.flatMap((group) => group.items);
|
|
11140
|
-
return items;
|
|
11141
|
-
}, [items, isGrouped]);
|
|
11142
|
-
const filteredItems = import_react.useMemo(() => {
|
|
11143
|
-
if (filteredItemsProp && !shouldIgnoreExternalFiltering) return filteredItemsProp;
|
|
11144
|
-
if (!items) return EMPTY_ARRAY$1;
|
|
11145
|
-
if (isGrouped) {
|
|
11146
|
-
const groupedItems = items;
|
|
11147
|
-
const resultingGroups = [];
|
|
11148
|
-
let currentCount = 0;
|
|
11149
|
-
for (const group of groupedItems) {
|
|
11150
|
-
if (limit > -1 && currentCount >= limit) break;
|
|
11151
|
-
const candidateItems = filterQuery === "" ? group.items : group.items.filter((item) => filter(item, filterQuery, itemToStringLabel));
|
|
11152
|
-
if (candidateItems.length === 0) continue;
|
|
11153
|
-
const remainingLimit = limit > -1 ? limit - currentCount : Infinity;
|
|
11154
|
-
const itemsToTake = candidateItems.slice(0, remainingLimit);
|
|
11155
|
-
if (itemsToTake.length > 0) {
|
|
11156
|
-
const newGroup = {
|
|
11157
|
-
...group,
|
|
11158
|
-
items: itemsToTake
|
|
11159
|
-
};
|
|
11160
|
-
resultingGroups.push(newGroup);
|
|
11161
|
-
currentCount += itemsToTake.length;
|
|
11162
|
-
}
|
|
11163
|
-
}
|
|
11164
|
-
return resultingGroups;
|
|
11165
|
-
}
|
|
11166
|
-
if (filterQuery === "") return limit > -1 ? flatItems.slice(0, limit) : flatItems;
|
|
11167
|
-
const limitedItems = [];
|
|
11168
|
-
for (const item of flatItems) {
|
|
11169
|
-
if (limit > -1 && limitedItems.length >= limit) break;
|
|
11170
|
-
if (filter(item, filterQuery, itemToStringLabel)) limitedItems.push(item);
|
|
11171
|
-
}
|
|
11172
|
-
return limitedItems;
|
|
11173
|
-
}, [
|
|
11174
|
-
filteredItemsProp,
|
|
11175
|
-
shouldIgnoreExternalFiltering,
|
|
11176
|
-
items,
|
|
11177
|
-
isGrouped,
|
|
11178
|
-
filterQuery,
|
|
11179
|
-
limit,
|
|
11180
|
-
filter,
|
|
11181
|
-
itemToStringLabel,
|
|
11182
|
-
flatItems
|
|
11183
|
-
]);
|
|
11184
|
-
const flatFilteredItems = import_react.useMemo(() => {
|
|
11185
|
-
if (isGrouped) return filteredItems.flatMap((g) => g.items);
|
|
11186
|
-
return filteredItems;
|
|
11187
|
-
}, [filteredItems, isGrouped]);
|
|
11188
|
-
const store = useRefWithInit(() => new Store({
|
|
11189
|
-
id,
|
|
11190
|
-
labelId: void 0,
|
|
11191
|
-
selectedValue,
|
|
11192
|
-
open,
|
|
11193
|
-
filter,
|
|
11194
|
-
query,
|
|
11195
|
-
items,
|
|
11196
|
-
selectionMode,
|
|
11197
|
-
listRef,
|
|
11198
|
-
labelsRef,
|
|
11199
|
-
popupRef,
|
|
11200
|
-
emptyRef,
|
|
11201
|
-
inputRef,
|
|
11202
|
-
startDismissRef,
|
|
11203
|
-
endDismissRef,
|
|
11204
|
-
keyboardActiveRef,
|
|
11205
|
-
chipsContainerRef,
|
|
11206
|
-
clearRef,
|
|
11207
|
-
valuesRef,
|
|
11208
|
-
allValuesRef,
|
|
11209
|
-
selectionEventRef,
|
|
11210
|
-
name,
|
|
11211
|
-
form,
|
|
11212
|
-
disabled,
|
|
11213
|
-
readOnly,
|
|
11214
|
-
required,
|
|
11215
|
-
grid,
|
|
11216
|
-
isGrouped,
|
|
11217
|
-
virtualized,
|
|
11218
|
-
openOnInputClick,
|
|
11219
|
-
itemToStringLabel,
|
|
11220
|
-
isItemEqualToValue,
|
|
11221
|
-
modal,
|
|
11222
|
-
autoHighlight: autoHighlightMode,
|
|
11223
|
-
submitOnItemClick,
|
|
11224
|
-
hasInputValue,
|
|
11225
|
-
mounted: false,
|
|
11226
|
-
forceMounted: false,
|
|
11227
|
-
transitionStatus: "idle",
|
|
11228
|
-
inline: inlineProp,
|
|
11229
|
-
activeIndex: null,
|
|
11230
|
-
selectedIndex: null,
|
|
11231
|
-
popupProps: {},
|
|
11232
|
-
inputProps: {},
|
|
11233
|
-
triggerProps: {},
|
|
11234
|
-
itemProps: EMPTY_OBJECT,
|
|
11235
|
-
positionerElement: null,
|
|
11236
|
-
listElement: null,
|
|
11237
|
-
triggerElement: null,
|
|
11238
|
-
inputElement: null,
|
|
11239
|
-
inputGroupElement: null,
|
|
11240
|
-
popupSide: null,
|
|
11241
|
-
openMethod: null,
|
|
11242
|
-
inputInsidePopup: true,
|
|
11243
|
-
inputOwnsFormValue: selectionMode === "none",
|
|
11244
|
-
onOpenChangeComplete: onOpenChangeCompleteProp || NOOP,
|
|
11245
|
-
setOpen: NOOP,
|
|
11246
|
-
setInputValue: NOOP,
|
|
11247
|
-
setSelectedValue: NOOP,
|
|
11248
|
-
setIndices: NOOP,
|
|
11249
|
-
onItemHighlighted: NOOP,
|
|
11250
|
-
handleSelection: NOOP,
|
|
11251
|
-
forceMount: NOOP,
|
|
11252
|
-
requestSubmit: NOOP
|
|
11253
|
-
})).current;
|
|
11254
|
-
const fieldRawValue = selectionMode === "none" ? inputValue : selectedValue;
|
|
11255
|
-
const fieldStringValue = import_react.useMemo(() => {
|
|
11256
|
-
if (selectionMode === "none") return fieldRawValue;
|
|
11257
|
-
if (Array.isArray(selectedValue)) return selectedValue.map((value) => stringifyAsValue(value, itemToStringValue));
|
|
11258
|
-
return stringifyAsValue(selectedValue, itemToStringValue);
|
|
11259
|
-
}, [
|
|
11260
|
-
fieldRawValue,
|
|
11261
|
-
itemToStringValue,
|
|
11262
|
-
selectionMode,
|
|
11263
|
-
selectedValue
|
|
11264
|
-
]);
|
|
11265
|
-
const onItemHighlighted = useStableCallback(onItemHighlightedProp);
|
|
11266
|
-
const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);
|
|
11267
|
-
const activeIndex = useStore(store, selectors$1.activeIndex);
|
|
11268
|
-
const selectedIndex = useStore(store, selectors$1.selectedIndex);
|
|
11269
|
-
const positionerElement = useStore(store, selectors$1.positionerElement);
|
|
11270
|
-
const listElement = useStore(store, selectors$1.listElement);
|
|
11271
|
-
const triggerElement = useStore(store, selectors$1.triggerElement);
|
|
11272
|
-
const inputElement = useStore(store, selectors$1.inputElement);
|
|
11273
|
-
const inputGroupElement = useStore(store, selectors$1.inputGroupElement);
|
|
11274
|
-
const inline = useStore(store, selectors$1.inline);
|
|
11275
|
-
const inputInsidePopup = useStore(store, selectors$1.inputInsidePopup);
|
|
11276
|
-
const inputOwnsFormValue = useStore(store, selectors$1.inputOwnsFormValue);
|
|
11277
|
-
const triggerRef = useValueAsRef(triggerElement);
|
|
11278
|
-
const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
|
|
11279
|
-
const { openMethod, triggerProps } = useOpenInteractionType(open);
|
|
11280
|
-
const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
|
|
11281
|
-
useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm);
|
|
11282
|
-
const forceMount = useStableCallback(() => {
|
|
11283
|
-
if (items) labelsRef.current = flatFilteredItems.map((item) => stringifyAsLabel(item, itemToStringLabel));
|
|
11284
|
-
else store.set("forceMounted", true);
|
|
11285
|
-
});
|
|
11286
|
-
const initialSelectedValueRef = import_react.useRef(selectedValue);
|
|
11287
|
-
useIsoLayoutEffect(() => {
|
|
11288
|
-
if (selectedValue !== initialSelectedValueRef.current) forceMount();
|
|
11289
|
-
}, [forceMount, selectedValue]);
|
|
11290
|
-
const setIndices = useStableCallback((options) => {
|
|
11291
|
-
store.update(options);
|
|
11292
|
-
const type = options.type || "none";
|
|
11293
|
-
if (options.activeIndex === void 0) return;
|
|
11294
|
-
if (options.activeIndex === null) {
|
|
11295
|
-
if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
|
|
11296
|
-
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
11297
|
-
onItemHighlighted(void 0, createGenericEventDetails(type, void 0, { index: -1 }));
|
|
11298
|
-
}
|
|
11299
|
-
} else {
|
|
11300
|
-
const activeValue = valuesRef.current[options.activeIndex];
|
|
11301
|
-
lastHighlightRef.current = {
|
|
11302
|
-
value: activeValue,
|
|
11303
|
-
index: options.activeIndex
|
|
11304
|
-
};
|
|
11305
|
-
onItemHighlighted(activeValue, createGenericEventDetails(type, void 0, { index: options.activeIndex }));
|
|
11306
|
-
}
|
|
11307
|
-
});
|
|
11308
|
-
const setInputValue = useStableCallback((next, eventDetails) => {
|
|
11309
|
-
hadInputClearRef.current = eventDetails.reason === inputClear;
|
|
11310
|
-
props.onInputValueChange?.(next, eventDetails);
|
|
11311
|
-
if (eventDetails.isCanceled) return;
|
|
11312
|
-
if (eventDetails.reason === "input-change") {
|
|
11313
|
-
const event = eventDetails.event;
|
|
11314
|
-
const inputType = event.inputType;
|
|
11315
|
-
if (event.type === "compositionend" || inputType != null && inputType !== "" && inputType !== "insertReplacementText") {
|
|
11316
|
-
const hasQuery = next.trim() !== "";
|
|
11317
|
-
if (hasQuery) setQueryChangedAfterOpen(true);
|
|
11318
|
-
pendingQueryHighlightRef.current = { hasQuery };
|
|
11319
|
-
if (hasQuery && autoHighlightMode && store.state.activeIndex == null) store.set("activeIndex", 0);
|
|
11320
|
-
}
|
|
11321
|
-
}
|
|
11322
|
-
setInputValueUnwrapped(next);
|
|
11323
|
-
});
|
|
11324
|
-
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
11325
|
-
if (open === nextOpen) return;
|
|
11326
|
-
if (eventDetails.reason === "escape-key" && hasItems && flatFilteredItems.length === 0 && !store.state.emptyRef.current) eventDetails.allowPropagation();
|
|
11327
|
-
props.onOpenChange?.(nextOpen, eventDetails);
|
|
11328
|
-
if (eventDetails.isCanceled) return;
|
|
11329
|
-
if (nextOpen && multiple && inputInsidePopup && !inline && closeQuery !== null) {
|
|
11330
|
-
setQueryChangedAfterOpen(false);
|
|
11331
|
-
setCloseQuery(null);
|
|
11332
|
-
if (inputValue !== "") setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
11333
|
-
}
|
|
11334
|
-
if (!nextOpen && queryChangedAfterOpen) {
|
|
11335
|
-
if (single) {
|
|
11336
|
-
if (!inline) setCloseQuery(query);
|
|
11337
|
-
if (query === "") setQueryChangedAfterOpen(false);
|
|
11338
|
-
} else if (multiple) {
|
|
11339
|
-
if (!inline) setCloseQuery(query);
|
|
11340
|
-
if (inputInsidePopup) setIndices({ activeIndex: null });
|
|
11341
|
-
if (!inputInsidePopup || inline) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
11342
|
-
}
|
|
11343
|
-
}
|
|
11344
|
-
setOpenUnwrapped(nextOpen);
|
|
11345
|
-
if (!nextOpen && inputInsidePopup && (eventDetails.reason === "focus-out" || eventDetails.reason === "outside-press")) {
|
|
11346
|
-
setTouched(true);
|
|
11347
|
-
setFocused(false);
|
|
11348
|
-
if (validationMode === "onBlur") {
|
|
11349
|
-
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
11350
|
-
validation.commit(valueToValidate);
|
|
11351
|
-
}
|
|
11352
|
-
}
|
|
11353
|
-
});
|
|
11354
|
-
const setSelectedValue = useStableCallback((nextValue, eventDetails) => {
|
|
11355
|
-
onSelectedValueChange?.(nextValue, eventDetails);
|
|
11356
|
-
if (eventDetails.isCanceled) return;
|
|
11357
|
-
setSelectedValueUnwrapped(nextValue);
|
|
11358
|
-
if (selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup) setInputValue(stringifyAsLabel(nextValue, itemToStringLabel), createChangeEventDetails(eventDetails.reason, eventDetails.event));
|
|
11359
|
-
if (single && nextValue != null && eventDetails.reason !== "input-change" && queryChangedAfterOpen && !inline) setCloseQuery(query);
|
|
11360
|
-
});
|
|
11361
|
-
const handleSelection = useStableCallback((event, passedValue) => {
|
|
11362
|
-
let itemValue = passedValue;
|
|
11363
|
-
if (itemValue === void 0) {
|
|
11364
|
-
if (activeIndex === null) return;
|
|
11365
|
-
itemValue = valuesRef.current[activeIndex];
|
|
11366
|
-
}
|
|
11367
|
-
const targetEl = getTarget(event);
|
|
11368
|
-
const overrideEvent = selectionEventRef.current ?? event;
|
|
11369
|
-
selectionEventRef.current = null;
|
|
11370
|
-
const eventDetails = createChangeEventDetails(itemPress, overrideEvent);
|
|
11371
|
-
const href = targetEl?.closest("a")?.getAttribute("href");
|
|
11372
|
-
if (href) {
|
|
11373
|
-
if (href.startsWith("#")) setOpen(false, eventDetails);
|
|
11374
|
-
return;
|
|
11375
|
-
}
|
|
11376
|
-
if (multiple) {
|
|
11377
|
-
const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
11378
|
-
setSelectedValue(selectedValueIncludes(currentSelectedValue, itemValue, store.state.isItemEqualToValue) ? removeItem(currentSelectedValue, itemValue, store.state.isItemEqualToValue) : [...currentSelectedValue, itemValue], eventDetails);
|
|
11379
|
-
if (!(inputRef.current ? inputRef.current.value.trim() !== "" : false)) return;
|
|
11380
|
-
if (store.state.inputInsidePopup) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
11381
|
-
else setOpen(false, eventDetails);
|
|
11382
|
-
} else {
|
|
11383
|
-
setSelectedValue(itemValue, eventDetails);
|
|
11384
|
-
setOpen(false, eventDetails);
|
|
11385
|
-
}
|
|
11386
|
-
});
|
|
11387
|
-
const requestSubmit = useStableCallback(() => {
|
|
11388
|
-
if (!store.state.submitOnItemClick) return;
|
|
11389
|
-
const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;
|
|
11390
|
-
if (formElement && typeof formElement.requestSubmit === "function") formElement.requestSubmit();
|
|
11391
|
-
});
|
|
11392
|
-
const handleUnmount = useStableCallback(() => {
|
|
11393
|
-
setMounted(false);
|
|
11394
|
-
onOpenChangeComplete?.(false);
|
|
11395
|
-
setQueryChangedAfterOpen(false);
|
|
11396
|
-
setCloseQuery(null);
|
|
11397
|
-
if (selectionMode === "none") setIndices({
|
|
11398
|
-
activeIndex: null,
|
|
11399
|
-
selectedIndex: null
|
|
11400
|
-
});
|
|
11401
|
-
else setIndices({ activeIndex: null });
|
|
11402
|
-
if (multiple && inputRef.current && inputRef.current.value !== "" && !hadInputClearRef.current) setInputValue("", createChangeEventDetails(inputClear));
|
|
11403
|
-
if (single) if (store.state.inputInsidePopup) {
|
|
11404
|
-
if (inputRef.current && inputRef.current.value !== "") setInputValue("", createChangeEventDetails(inputClear));
|
|
11405
|
-
} else {
|
|
11406
|
-
const stringVal = stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
11407
|
-
if (inputRef.current && inputRef.current.value !== stringVal) setInputValue(stringVal, createChangeEventDetails(stringVal === "" ? inputClear : none));
|
|
11408
|
-
}
|
|
11409
|
-
});
|
|
11410
|
-
const resolvedPopupRef = import_react.useMemo(() => {
|
|
11411
|
-
if (inline && positionerElement) return { current: positionerElement.closest("[role=\"dialog\"]") };
|
|
11412
|
-
return popupRef;
|
|
11413
|
-
}, [inline, positionerElement]);
|
|
11414
|
-
useOpenChangeComplete({
|
|
11415
|
-
enabled: !props.actionsRef,
|
|
11416
|
-
open,
|
|
11417
|
-
ref: resolvedPopupRef,
|
|
11418
|
-
onComplete() {
|
|
11419
|
-
if (!open) handleUnmount();
|
|
11420
|
-
}
|
|
11421
|
-
});
|
|
11422
|
-
import_react.useImperativeHandle(props.actionsRef, () => ({ unmount: handleUnmount }), [handleUnmount]);
|
|
11423
|
-
useIsoLayoutEffect(function syncSelectedIndex() {
|
|
11424
|
-
if (open || selectionMode === "none") return;
|
|
11425
|
-
const registry = items ? flatItems : allValuesRef.current;
|
|
11426
|
-
if (multiple) {
|
|
11427
|
-
const currentValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
11428
|
-
const lastValue = currentValue[currentValue.length - 1];
|
|
11429
|
-
const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);
|
|
11430
|
-
setIndices({ selectedIndex: lastIndex === -1 ? null : lastIndex });
|
|
11431
|
-
} else {
|
|
11432
|
-
const index = findItemIndex(registry, selectedValue, isItemEqualToValue);
|
|
11433
|
-
setIndices({ selectedIndex: index === -1 ? null : index });
|
|
11434
|
-
}
|
|
11435
|
-
}, [
|
|
11436
|
-
open,
|
|
11437
|
-
selectedValue,
|
|
11438
|
-
items,
|
|
11439
|
-
selectionMode,
|
|
11440
|
-
flatItems,
|
|
11441
|
-
multiple,
|
|
11442
|
-
isItemEqualToValue,
|
|
11443
|
-
setIndices
|
|
11444
|
-
]);
|
|
11445
|
-
useIsoLayoutEffect(() => {
|
|
11446
|
-
if (items) {
|
|
11447
|
-
valuesRef.current = flatFilteredItems;
|
|
11448
|
-
listRef.current.length = flatFilteredItems.length;
|
|
11449
|
-
}
|
|
11450
|
-
}, [items, flatFilteredItems]);
|
|
11451
|
-
useIsoLayoutEffect(() => {
|
|
11452
|
-
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
11453
|
-
if (pendingHighlight) {
|
|
11454
|
-
if (pendingHighlight.hasQuery) {
|
|
11455
|
-
if (autoHighlightMode) store.set("activeIndex", 0);
|
|
11456
|
-
} else if (autoHighlightMode === "always") store.set("activeIndex", 0);
|
|
11457
|
-
pendingQueryHighlightRef.current = null;
|
|
11458
|
-
}
|
|
11459
|
-
if (!open && !inline) return;
|
|
11460
|
-
const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredItems : valuesRef.current;
|
|
11461
|
-
const storeActiveIndex = store.state.activeIndex;
|
|
11462
|
-
if (storeActiveIndex == null) {
|
|
11463
|
-
if (autoHighlightMode === "always" && candidateItems.length > 0) {
|
|
11464
|
-
store.set("activeIndex", 0);
|
|
11465
|
-
return;
|
|
11466
|
-
}
|
|
11467
|
-
if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
|
|
11468
|
-
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
11469
|
-
store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
|
|
11470
|
-
}
|
|
11471
|
-
return;
|
|
11472
|
-
}
|
|
11473
|
-
if (storeActiveIndex >= candidateItems.length) {
|
|
11474
|
-
if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
|
|
11475
|
-
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
11476
|
-
store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
|
|
11477
|
-
}
|
|
11478
|
-
store.set("activeIndex", null);
|
|
11479
|
-
return;
|
|
11480
|
-
}
|
|
11481
|
-
const itemValue = candidateItems[storeActiveIndex];
|
|
11482
|
-
const previouslyHighlightedItemValue = lastHighlightRef.current.value;
|
|
11483
|
-
const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);
|
|
11484
|
-
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {
|
|
11485
|
-
lastHighlightRef.current = {
|
|
11486
|
-
value: itemValue,
|
|
11487
|
-
index: storeActiveIndex
|
|
11488
|
-
};
|
|
11489
|
-
store.state.onItemHighlighted(itemValue, createGenericEventDetails(none, void 0, { index: storeActiveIndex }));
|
|
11490
|
-
}
|
|
11491
|
-
}, [
|
|
11492
|
-
activeIndex,
|
|
11493
|
-
autoHighlightMode,
|
|
11494
|
-
hasFilteredItemsProp,
|
|
11495
|
-
hasItems,
|
|
11496
|
-
flatFilteredItems,
|
|
11497
|
-
inline,
|
|
11498
|
-
open,
|
|
11499
|
-
store
|
|
11500
|
-
]);
|
|
11501
|
-
useIsoLayoutEffect(() => {
|
|
11502
|
-
if (selectionMode === "none") {
|
|
11503
|
-
setFilled(String(inputValue) !== "");
|
|
11504
|
-
return;
|
|
11505
|
-
}
|
|
11506
|
-
setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);
|
|
11507
|
-
}, [
|
|
11508
|
-
setFilled,
|
|
11509
|
-
selectionMode,
|
|
11510
|
-
inputValue,
|
|
11511
|
-
selectedValue,
|
|
11512
|
-
multiple
|
|
11513
|
-
]);
|
|
11514
|
-
import_react.useEffect(() => {
|
|
11515
|
-
if (hasItems && autoHighlightMode && flatFilteredItems.length === 0) setIndices({ activeIndex: null });
|
|
11516
|
-
}, [
|
|
11517
|
-
hasItems,
|
|
11518
|
-
autoHighlightMode,
|
|
11519
|
-
flatFilteredItems.length,
|
|
11520
|
-
setIndices
|
|
11521
|
-
]);
|
|
11522
|
-
useValueChanged(query, () => {
|
|
11523
|
-
if (!open || query === "" || query === String(initialDefaultInputValue)) return;
|
|
11524
|
-
setQueryChangedAfterOpen(true);
|
|
11525
|
-
});
|
|
11526
|
-
useValueChanged(selectedValue, () => {
|
|
11527
|
-
if (selectionMode === "none") return;
|
|
11528
|
-
clearErrors(name);
|
|
11529
|
-
setDirty(selectedValue !== validityData.initialValue);
|
|
11530
|
-
if (shouldValidateOnChange()) validation.commit(selectedValue);
|
|
11531
|
-
else validation.commit(selectedValue, true);
|
|
11532
|
-
if (single && !hasInputValue && !inputInsidePopup) {
|
|
11533
|
-
const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
11534
|
-
if (inputValue !== nextInputValue) setInputValue(nextInputValue, createChangeEventDetails(none));
|
|
11535
|
-
}
|
|
11536
|
-
});
|
|
11537
|
-
useValueChanged(inputValue, () => {
|
|
11538
|
-
if (selectionMode !== "none") return;
|
|
11539
|
-
clearErrors(name);
|
|
11540
|
-
setDirty(inputValue !== validityData.initialValue);
|
|
11541
|
-
if (shouldValidateOnChange()) validation.commit(inputValue);
|
|
11542
|
-
else validation.commit(inputValue, true);
|
|
11543
|
-
});
|
|
11544
|
-
useValueChanged(items, () => {
|
|
11545
|
-
if (!single || hasInputValue || inputInsidePopup || queryChangedAfterOpen) return;
|
|
11546
|
-
const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
11547
|
-
if (inputValue !== nextInputValue) setInputValue(nextInputValue, createChangeEventDetails(none));
|
|
11548
|
-
});
|
|
11549
|
-
const floatingRootContext = useFloatingRootContext({
|
|
11550
|
-
open: inline ? true : open,
|
|
11551
|
-
onOpenChange: setOpen,
|
|
11552
|
-
elements: {
|
|
11553
|
-
reference: inputInsidePopup ? triggerElement : inputElement,
|
|
11554
|
-
floating: positionerElement
|
|
11555
|
-
}
|
|
11556
|
-
});
|
|
11557
|
-
let ariaHasPopup;
|
|
11558
|
-
let ariaExpanded;
|
|
11559
|
-
if (!inline) {
|
|
11560
|
-
ariaHasPopup = grid ? "grid" : "listbox";
|
|
11561
|
-
ariaExpanded = open ? "true" : "false";
|
|
11562
|
-
}
|
|
11563
|
-
const role = import_react.useMemo(() => {
|
|
11564
|
-
const isPlainInput = inputElement?.tagName === "INPUT";
|
|
11565
|
-
const shouldTreatAsInput = inputElement == null || isPlainInput;
|
|
11566
|
-
const shouldApplyAria = shouldTreatAsInput || open;
|
|
11567
|
-
const reference = shouldTreatAsInput ? {
|
|
11568
|
-
autoComplete: "off",
|
|
11569
|
-
spellCheck: "false",
|
|
11570
|
-
autoCorrect: "off",
|
|
11571
|
-
autoCapitalize: "none"
|
|
11572
|
-
} : {};
|
|
11573
|
-
if (shouldApplyAria) {
|
|
11574
|
-
reference.role = "combobox";
|
|
11575
|
-
reference["aria-expanded"] = ariaExpanded;
|
|
11576
|
-
reference["aria-haspopup"] = ariaHasPopup;
|
|
11577
|
-
reference["aria-controls"] = open ? listElement?.id : void 0;
|
|
11578
|
-
reference["aria-autocomplete"] = autoComplete;
|
|
11579
|
-
}
|
|
11580
|
-
return {
|
|
11581
|
-
reference,
|
|
11582
|
-
floating: { role: "presentation" }
|
|
11583
|
-
};
|
|
11584
|
-
}, [
|
|
11585
|
-
inputElement,
|
|
11586
|
-
open,
|
|
11587
|
-
ariaExpanded,
|
|
11588
|
-
ariaHasPopup,
|
|
11589
|
-
listElement?.id,
|
|
11590
|
-
autoComplete
|
|
11591
|
-
]);
|
|
11592
|
-
const click = useClick(floatingRootContext, {
|
|
11593
|
-
enabled: !readOnly && !disabled && openOnInputClick,
|
|
11594
|
-
event: "mousedown-only",
|
|
11595
|
-
toggle: false,
|
|
11596
|
-
touchOpenDelay: inputInsidePopup ? 0 : 100,
|
|
11597
|
-
reason: inputPress
|
|
11598
|
-
});
|
|
11599
|
-
const dismiss = useDismiss(floatingRootContext, {
|
|
11600
|
-
enabled: !readOnly && !disabled && !inline,
|
|
11601
|
-
outsidePressEvent: {
|
|
11602
|
-
mouse: "sloppy",
|
|
11603
|
-
touch: "intentional"
|
|
11604
|
-
},
|
|
11605
|
-
bubbles: inline ? true : void 0,
|
|
11606
|
-
outsidePress(event) {
|
|
11607
|
-
const target = getTarget(event);
|
|
11608
|
-
return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);
|
|
11609
|
-
}
|
|
11610
|
-
});
|
|
11611
|
-
const listNavigation = useListNavigation(floatingRootContext, {
|
|
11612
|
-
enabled: !readOnly && !disabled,
|
|
11613
|
-
id,
|
|
11614
|
-
listRef,
|
|
11615
|
-
activeIndex,
|
|
11616
|
-
selectedIndex,
|
|
11617
|
-
virtual: true,
|
|
11618
|
-
loopFocus,
|
|
11619
|
-
allowEscape: loopFocus && !autoHighlightMode,
|
|
11620
|
-
focusItemOnOpen: queryChangedAfterOpen || selectionMode === "none" && !autoHighlightMode ? false : "auto",
|
|
11621
|
-
focusItemOnHover: highlightItemOnHover,
|
|
11622
|
-
resetOnPointerLeave: !keepHighlight,
|
|
11623
|
-
cols: grid ? 2 : 1,
|
|
11624
|
-
orientation: grid ? "horizontal" : void 0,
|
|
11625
|
-
rtl: direction === "rtl",
|
|
11626
|
-
disabledIndices: EMPTY_ARRAY$1,
|
|
11627
|
-
onNavigate(nextActiveIndex, event) {
|
|
11628
|
-
if (!event && !open || transitionStatus === "ending") return;
|
|
11629
|
-
if (!event) setIndices({ activeIndex: nextActiveIndex });
|
|
11630
|
-
else setIndices({
|
|
11631
|
-
activeIndex: nextActiveIndex,
|
|
11632
|
-
type: keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
11633
|
-
});
|
|
11634
|
-
}
|
|
11635
|
-
});
|
|
11636
|
-
const inputProps = import_react.useMemo(() => mergeProps(listNavigation.reference, dismiss.reference, click.reference, role.reference), [
|
|
11637
|
-
listNavigation.reference,
|
|
11638
|
-
dismiss.reference,
|
|
11639
|
-
click.reference,
|
|
11640
|
-
role.reference
|
|
11641
|
-
]);
|
|
11642
|
-
const popupProps = import_react.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, listNavigation.floating, dismiss.floating, role.floating), [
|
|
11643
|
-
listNavigation.floating,
|
|
11644
|
-
dismiss.floating,
|
|
11645
|
-
role.floating
|
|
11646
|
-
]);
|
|
11647
|
-
const itemProps = import_react.useMemo(() => {
|
|
11648
|
-
const listNavigationItemProps = listNavigation.item;
|
|
11649
|
-
if (!listNavigationItemProps) return EMPTY_OBJECT;
|
|
11650
|
-
return {
|
|
11651
|
-
...listNavigationItemProps,
|
|
11652
|
-
onFocus: void 0
|
|
11653
|
-
};
|
|
11654
|
-
}, [listNavigation.item]);
|
|
11655
|
-
useOnFirstRender(() => {
|
|
11656
|
-
store.update({
|
|
11657
|
-
inline: inlineProp,
|
|
11658
|
-
popupProps,
|
|
11659
|
-
inputProps,
|
|
11660
|
-
triggerProps,
|
|
11661
|
-
itemProps,
|
|
11662
|
-
setOpen,
|
|
11663
|
-
setInputValue,
|
|
11664
|
-
setSelectedValue,
|
|
11665
|
-
setIndices,
|
|
11666
|
-
onItemHighlighted,
|
|
11667
|
-
handleSelection,
|
|
11668
|
-
forceMount,
|
|
11669
|
-
requestSubmit
|
|
11670
|
-
});
|
|
11671
|
-
});
|
|
11672
|
-
useIsoLayoutEffect(() => {
|
|
11673
|
-
store.update({
|
|
11674
|
-
id,
|
|
11675
|
-
selectedValue,
|
|
11676
|
-
open,
|
|
11677
|
-
mounted,
|
|
11678
|
-
transitionStatus,
|
|
11679
|
-
items,
|
|
11680
|
-
inline: inlineProp,
|
|
11681
|
-
popupProps,
|
|
11682
|
-
inputProps,
|
|
11683
|
-
triggerProps,
|
|
11684
|
-
openMethod,
|
|
11685
|
-
itemProps,
|
|
11686
|
-
selectionMode,
|
|
11687
|
-
name,
|
|
11688
|
-
form,
|
|
11689
|
-
disabled,
|
|
11690
|
-
readOnly,
|
|
11691
|
-
required,
|
|
11692
|
-
grid,
|
|
11693
|
-
isGrouped,
|
|
11694
|
-
virtualized,
|
|
11695
|
-
onOpenChangeComplete,
|
|
11696
|
-
openOnInputClick,
|
|
11697
|
-
itemToStringLabel,
|
|
11698
|
-
modal,
|
|
11699
|
-
autoHighlight: autoHighlightMode,
|
|
11700
|
-
isItemEqualToValue,
|
|
11701
|
-
submitOnItemClick,
|
|
11702
|
-
hasInputValue,
|
|
11703
|
-
requestSubmit,
|
|
11704
|
-
inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
|
|
11705
|
-
});
|
|
11706
|
-
}, [
|
|
11707
|
-
store,
|
|
11708
|
-
id,
|
|
11709
|
-
selectedValue,
|
|
11710
|
-
open,
|
|
11711
|
-
mounted,
|
|
11712
|
-
transitionStatus,
|
|
11713
|
-
items,
|
|
11714
|
-
popupProps,
|
|
11715
|
-
inputProps,
|
|
11716
|
-
itemProps,
|
|
11717
|
-
openMethod,
|
|
11718
|
-
triggerProps,
|
|
11719
|
-
selectionMode,
|
|
11720
|
-
name,
|
|
11721
|
-
disabled,
|
|
11722
|
-
readOnly,
|
|
11723
|
-
required,
|
|
11724
|
-
validation,
|
|
11725
|
-
grid,
|
|
11726
|
-
isGrouped,
|
|
11727
|
-
virtualized,
|
|
11728
|
-
onOpenChangeComplete,
|
|
11729
|
-
openOnInputClick,
|
|
11730
|
-
itemToStringLabel,
|
|
11731
|
-
modal,
|
|
11732
|
-
isItemEqualToValue,
|
|
11733
|
-
submitOnItemClick,
|
|
11734
|
-
hasInputValue,
|
|
11735
|
-
inlineProp,
|
|
11736
|
-
requestSubmit,
|
|
11737
|
-
autoHighlightMode,
|
|
11738
|
-
form
|
|
11739
|
-
]);
|
|
11740
|
-
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
|
|
11741
|
-
const itemsContextValue = import_react.useMemo(() => ({
|
|
11742
|
-
query,
|
|
11743
|
-
hasItems,
|
|
11744
|
-
filteredItems,
|
|
11745
|
-
flatFilteredItems
|
|
11746
|
-
}), [
|
|
11747
|
-
query,
|
|
11748
|
-
hasItems,
|
|
11749
|
-
filteredItems,
|
|
11750
|
-
flatFilteredItems
|
|
11751
|
-
]);
|
|
11752
|
-
const serializedValue = import_react.useMemo(() => {
|
|
11753
|
-
if (Array.isArray(fieldRawValue)) return "";
|
|
11754
|
-
return stringifyAsValue(fieldRawValue, itemToStringValue);
|
|
11755
|
-
}, [fieldRawValue, itemToStringValue]);
|
|
11756
|
-
const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
11757
|
-
const hiddenInputName = multiple || selectionMode === "none" && inputOwnsFormValue ? void 0 : name;
|
|
11758
|
-
const hiddenInputs = import_react.useMemo(() => {
|
|
11759
|
-
if (!multiple || !Array.isArray(selectedValue) || !name) return null;
|
|
11760
|
-
return selectedValue.map((value) => {
|
|
11761
|
-
const currentSerializedValue = stringifyAsValue(value, itemToStringValue);
|
|
11762
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
11763
|
-
type: "hidden",
|
|
11764
|
-
form,
|
|
11765
|
-
name,
|
|
11766
|
-
value: currentSerializedValue
|
|
11767
|
-
}, currentSerializedValue);
|
|
11768
|
-
});
|
|
11769
|
-
}, [
|
|
11770
|
-
multiple,
|
|
11771
|
-
selectedValue,
|
|
11772
|
-
form,
|
|
11773
|
-
name,
|
|
11774
|
-
itemToStringValue
|
|
11775
|
-
]);
|
|
11776
|
-
const children = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
11777
|
-
props.children,
|
|
11778
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
11779
|
-
...validation.getInputValidationProps({
|
|
11780
|
-
onFocus() {
|
|
11781
|
-
if (inputInsidePopup) {
|
|
11782
|
-
triggerElement?.focus();
|
|
11783
|
-
return;
|
|
11784
|
-
}
|
|
11785
|
-
(inputRef.current || triggerElement)?.focus();
|
|
11786
|
-
},
|
|
11787
|
-
onChange(event) {
|
|
11788
|
-
if (event.nativeEvent.defaultPrevented || disabled || readOnly) {
|
|
11789
|
-
event.preventBaseUIHandler?.();
|
|
11790
|
-
return;
|
|
11791
|
-
}
|
|
11792
|
-
const nextValue = event.currentTarget.value;
|
|
11793
|
-
const details = createChangeEventDetails(none, event.nativeEvent);
|
|
11794
|
-
function handleChange() {
|
|
11795
|
-
if (multiple) return;
|
|
11796
|
-
if (selectionMode === "none") {
|
|
11797
|
-
setDirty(nextValue !== validityData.initialValue);
|
|
11798
|
-
setInputValue(nextValue, details);
|
|
11799
|
-
if (shouldValidateOnChange()) validation.commit(nextValue);
|
|
11800
|
-
return;
|
|
11801
|
-
}
|
|
11802
|
-
const matchingValue = valuesRef.current.find((v) => {
|
|
11803
|
-
if (stringifyAsValue(v, itemToStringValue).toLowerCase() === nextValue.toLowerCase()) return true;
|
|
11804
|
-
if (stringifyAsLabel(v, itemToStringLabel).toLowerCase() === nextValue.toLowerCase()) return true;
|
|
11805
|
-
return false;
|
|
11806
|
-
});
|
|
11807
|
-
if (matchingValue != null) {
|
|
11808
|
-
setDirty(matchingValue !== validityData.initialValue);
|
|
11809
|
-
setSelectedValue?.(matchingValue, details);
|
|
11810
|
-
if (shouldValidateOnChange()) validation.commit(matchingValue);
|
|
11811
|
-
}
|
|
11812
|
-
}
|
|
11813
|
-
if (items) handleChange();
|
|
11814
|
-
else {
|
|
11815
|
-
forceMount();
|
|
11816
|
-
queueMicrotask(handleChange);
|
|
11817
|
-
}
|
|
11818
|
-
}
|
|
11819
|
-
}),
|
|
11820
|
-
id: id && hiddenInputName == null ? `${id}-hidden-input` : void 0,
|
|
11821
|
-
form,
|
|
11822
|
-
name: hiddenInputName,
|
|
11823
|
-
autoComplete: formAutoComplete,
|
|
11824
|
-
disabled,
|
|
11825
|
-
required: required && !hasMultipleSelection,
|
|
11826
|
-
readOnly,
|
|
11827
|
-
value: serializedValue,
|
|
11828
|
-
ref: hiddenInputRef,
|
|
11829
|
-
style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,
|
|
11830
|
-
tabIndex: -1,
|
|
11831
|
-
"aria-hidden": true,
|
|
11832
|
-
suppressHydrationWarning: true
|
|
11833
|
-
}),
|
|
11834
|
-
hiddenInputs
|
|
11835
|
-
] });
|
|
11836
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxRootContext.Provider, {
|
|
11837
|
-
value: store,
|
|
11838
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxFloatingContext.Provider, {
|
|
11839
|
-
value: floatingRootContext,
|
|
11840
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxDerivedItemsContext.Provider, {
|
|
11841
|
-
value: itemsContextValue,
|
|
11842
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxInputValueContext.Provider, {
|
|
11843
|
-
value: inputValue,
|
|
11844
|
-
children
|
|
11845
|
-
})
|
|
11846
|
-
})
|
|
11847
|
-
})
|
|
11848
|
-
});
|
|
11849
|
-
}
|
|
11850
|
-
//#endregion
|
|
11851
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/utils/stateAttributesMapping.js
|
|
11852
|
-
var triggerStateAttributesMapping = {
|
|
11853
|
-
...pressableTriggerOpenStateMapping,
|
|
11854
|
-
...fieldValidityMapping,
|
|
11855
|
-
popupSide: (side) => side ? { "data-popup-side": side } : null,
|
|
11856
|
-
listEmpty: (empty) => empty ? { "data-list-empty": "" } : null
|
|
11857
|
-
};
|
|
11858
|
-
//#endregion
|
|
11859
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/getPseudoElementBounds.js
|
|
11860
|
-
function getPseudoElementBounds(element) {
|
|
11861
|
-
const elementRect = element.getBoundingClientRect();
|
|
11862
|
-
const win = getWindow(element);
|
|
11863
|
-
const beforeStyles = win.getComputedStyle(element, "::before");
|
|
11864
|
-
const afterStyles = win.getComputedStyle(element, "::after");
|
|
11865
|
-
if (!(beforeStyles.content !== "none" || afterStyles.content !== "none")) return elementRect;
|
|
11866
|
-
const beforeWidth = parseFloat(beforeStyles.width) || 0;
|
|
11867
|
-
const beforeHeight = parseFloat(beforeStyles.height) || 0;
|
|
11868
|
-
const afterWidth = parseFloat(afterStyles.width) || 0;
|
|
11869
|
-
const afterHeight = parseFloat(afterStyles.height) || 0;
|
|
11870
|
-
const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);
|
|
11871
|
-
const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);
|
|
11872
|
-
const widthDiff = totalWidth - elementRect.width;
|
|
11873
|
-
const heightDiff = totalHeight - elementRect.height;
|
|
11874
|
-
return {
|
|
11875
|
-
left: elementRect.left - widthDiff / 2,
|
|
11876
|
-
right: elementRect.right + widthDiff / 2,
|
|
11877
|
-
top: elementRect.top - heightDiff / 2,
|
|
11878
|
-
bottom: elementRect.bottom + heightDiff / 2
|
|
11879
|
-
};
|
|
11880
|
-
}
|
|
11881
|
-
//#endregion
|
|
11882
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/resolveAriaLabelledBy.js
|
|
11883
|
-
function getDefaultLabelId(id) {
|
|
11884
|
-
return id == null ? void 0 : `${id}-label`;
|
|
11885
|
-
}
|
|
11886
|
-
function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
|
|
11887
|
-
return fieldLabelId ?? localLabelId;
|
|
11888
|
-
}
|
|
11889
|
-
//#endregion
|
|
11890
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/trigger/ComboboxTrigger.js
|
|
11891
|
-
var BOUNDARY_OFFSET$1 = 2;
|
|
11892
|
-
/**
|
|
11893
|
-
* A button that opens the popup.
|
|
11894
|
-
* Renders a `<button>` element.
|
|
11895
|
-
*
|
|
11896
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
11897
|
-
*/
|
|
11898
|
-
var ComboboxTrigger = /* @__PURE__ */ import_react.forwardRef(function ComboboxTrigger(componentProps, forwardedRef) {
|
|
11899
|
-
const { render, className, nativeButton = true, disabled: disabledProp = false, id: idProp, style, ...elementProps } = componentProps;
|
|
11900
|
-
const { state: fieldState, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
|
|
11901
|
-
const { labelId: fieldLabelId } = useLabelableContext();
|
|
11902
|
-
const store = useComboboxRootContext();
|
|
11903
|
-
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
11904
|
-
const selectionMode = useStore(store, selectors$1.selectionMode);
|
|
11905
|
-
const comboboxDisabled = useStore(store, selectors$1.disabled);
|
|
11906
|
-
const readOnly = useStore(store, selectors$1.readOnly);
|
|
11907
|
-
const required = useStore(store, selectors$1.required);
|
|
11908
|
-
const mounted = useStore(store, selectors$1.mounted);
|
|
11909
|
-
const popupSideValue = useStore(store, selectors$1.popupSide);
|
|
11910
|
-
const positionerElement = useStore(store, selectors$1.positionerElement);
|
|
11911
|
-
const listElement = useStore(store, selectors$1.listElement);
|
|
11912
|
-
const triggerProps = useStore(store, selectors$1.triggerProps);
|
|
11913
|
-
const triggerElement = useStore(store, selectors$1.triggerElement);
|
|
11914
|
-
const inputInsidePopup = useStore(store, selectors$1.inputInsidePopup);
|
|
11915
|
-
const rootId = useStore(store, selectors$1.id);
|
|
11916
|
-
const comboboxLabelId = useStore(store, selectors$1.labelId);
|
|
11917
|
-
const open = useStore(store, selectors$1.open);
|
|
11918
|
-
const selectedValue = useStore(store, selectors$1.selectedValue);
|
|
11919
|
-
const activeIndex = useStore(store, selectors$1.activeIndex);
|
|
11920
|
-
const selectedIndex = useStore(store, selectors$1.selectedIndex);
|
|
11921
|
-
const hasSelectedValue = useStore(store, selectors$1.hasSelectedValue);
|
|
11922
|
-
const floatingRootContext = useComboboxFloatingContext();
|
|
11923
|
-
const inputValue = useComboboxInputValueContext();
|
|
11924
|
-
const focusTimeout = useTimeout();
|
|
11925
|
-
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
11926
|
-
const listEmpty = filteredItems.length === 0;
|
|
11927
|
-
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
11928
|
-
useLabelableId({ id: inputInsidePopup ? idProp : void 0 });
|
|
11929
|
-
const id = inputInsidePopup ? idProp ?? rootId : idProp;
|
|
11930
|
-
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, comboboxLabelId);
|
|
11931
|
-
const currentPointerTypeRef = import_react.useRef("");
|
|
11932
|
-
function trackPointerType(event) {
|
|
11933
|
-
currentPointerTypeRef.current = event.pointerType;
|
|
11934
|
-
}
|
|
11935
|
-
const domReference = floatingRootContext.useState("domReferenceElement");
|
|
11936
|
-
import_react.useEffect(() => {
|
|
11937
|
-
if (!inputInsidePopup) return;
|
|
11938
|
-
if (triggerElement && triggerElement !== domReference) floatingRootContext.set("domReferenceElement", triggerElement);
|
|
11939
|
-
}, [
|
|
11940
|
-
triggerElement,
|
|
11941
|
-
domReference,
|
|
11942
|
-
floatingRootContext,
|
|
11943
|
-
inputInsidePopup
|
|
11944
|
-
]);
|
|
11945
|
-
const { reference: triggerTypeaheadProps } = useTypeahead(floatingRootContext, {
|
|
11946
|
-
enabled: !open && !readOnly && !comboboxDisabled && selectionMode === "single",
|
|
11947
|
-
listRef: store.state.labelsRef,
|
|
11948
|
-
activeIndex,
|
|
11949
|
-
selectedIndex,
|
|
11950
|
-
onMatch(index) {
|
|
11951
|
-
const nextSelectedValue = store.state.valuesRef.current[index];
|
|
11952
|
-
if (nextSelectedValue !== void 0) store.state.setSelectedValue(nextSelectedValue, createChangeEventDetails("none"));
|
|
11953
|
-
}
|
|
11954
|
-
});
|
|
11955
|
-
const { reference: triggerClickProps } = useClick(floatingRootContext, {
|
|
11956
|
-
enabled: !readOnly && !comboboxDisabled,
|
|
11957
|
-
event: "mousedown"
|
|
11958
|
-
});
|
|
11959
|
-
const { buttonRef, getButtonProps } = useButton({
|
|
11960
|
-
native: nativeButton,
|
|
11961
|
-
disabled
|
|
11962
|
-
});
|
|
11963
|
-
const state = {
|
|
11964
|
-
...fieldState,
|
|
11965
|
-
open,
|
|
11966
|
-
disabled,
|
|
11967
|
-
popupSide,
|
|
11968
|
-
listEmpty,
|
|
11969
|
-
placeholder: selectionMode === "none" ? false : !hasSelectedValue
|
|
11970
|
-
};
|
|
11971
|
-
return useRenderElement("button", componentProps, {
|
|
11972
|
-
ref: [
|
|
11973
|
-
forwardedRef,
|
|
11974
|
-
buttonRef,
|
|
11975
|
-
useStableCallback((element) => {
|
|
11976
|
-
store.set("triggerElement", element);
|
|
11977
|
-
})
|
|
11978
|
-
],
|
|
11979
|
-
state,
|
|
11980
|
-
props: [
|
|
11981
|
-
triggerProps,
|
|
11982
|
-
triggerClickProps,
|
|
11983
|
-
triggerTypeaheadProps,
|
|
11984
|
-
{
|
|
11985
|
-
id,
|
|
11986
|
-
tabIndex: inputInsidePopup ? 0 : -1,
|
|
11987
|
-
role: inputInsidePopup ? "combobox" : void 0,
|
|
11988
|
-
"aria-expanded": open ? "true" : "false",
|
|
11989
|
-
"aria-haspopup": inputInsidePopup ? "dialog" : "listbox",
|
|
11990
|
-
"aria-controls": open ? listElement?.id : void 0,
|
|
11991
|
-
"aria-required": inputInsidePopup ? required || void 0 : void 0,
|
|
11992
|
-
"aria-labelledby": ariaLabelledBy,
|
|
11993
|
-
onPointerDown: trackPointerType,
|
|
11994
|
-
onPointerEnter: trackPointerType,
|
|
11995
|
-
onFocus() {
|
|
11996
|
-
setFocused(true);
|
|
11997
|
-
if (disabled || readOnly) return;
|
|
11998
|
-
focusTimeout.start(0, store.state.forceMount);
|
|
11999
|
-
},
|
|
12000
|
-
onBlur(event) {
|
|
12001
|
-
if (contains(positionerElement, event.relatedTarget)) return;
|
|
12002
|
-
setTouched(true);
|
|
12003
|
-
setFocused(false);
|
|
12004
|
-
if (validationMode === "onBlur") {
|
|
12005
|
-
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
12006
|
-
validation.commit(valueToValidate);
|
|
12007
|
-
}
|
|
12008
|
-
},
|
|
12009
|
-
onMouseDown(event) {
|
|
12010
|
-
if (disabled || readOnly) return;
|
|
12011
|
-
if (!inputInsidePopup) floatingRootContext.set("domReferenceElement", event.currentTarget);
|
|
12012
|
-
store.state.forceMount();
|
|
12013
|
-
if (currentPointerTypeRef.current !== "touch") {
|
|
12014
|
-
store.state.inputRef.current?.focus();
|
|
12015
|
-
if (!inputInsidePopup) event.preventDefault();
|
|
12016
|
-
}
|
|
12017
|
-
if (open) return;
|
|
12018
|
-
const doc = ownerDocument(event.currentTarget);
|
|
12019
|
-
function handleMouseUp(mouseEvent) {
|
|
12020
|
-
if (!triggerElement) return;
|
|
12021
|
-
const mouseUpTarget = getTarget(mouseEvent);
|
|
12022
|
-
const positioner = store.state.positionerElement;
|
|
12023
|
-
const list = store.state.listElement;
|
|
12024
|
-
if (contains(triggerElement, mouseUpTarget) || contains(positioner, mouseUpTarget) || contains(list, mouseUpTarget) || mouseUpTarget === triggerElement) return;
|
|
12025
|
-
const bounds = getPseudoElementBounds(triggerElement);
|
|
12026
|
-
const withinHorizontal = mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET$1 && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET$1;
|
|
12027
|
-
const withinVertical = mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET$1 && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET$1;
|
|
12028
|
-
if (withinHorizontal && withinVertical) return;
|
|
12029
|
-
store.state.setOpen(false, createChangeEventDetails("cancel-open", mouseEvent));
|
|
12030
|
-
}
|
|
12031
|
-
if (inputInsidePopup) doc.addEventListener("mouseup", handleMouseUp, { once: true });
|
|
12032
|
-
},
|
|
12033
|
-
onKeyDown(event) {
|
|
12034
|
-
if (disabled || readOnly) return;
|
|
12035
|
-
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
12036
|
-
stopEvent(event);
|
|
12037
|
-
store.state.setOpen(true, createChangeEventDetails(listNavigation, event.nativeEvent));
|
|
12038
|
-
store.state.inputRef.current?.focus();
|
|
12039
|
-
}
|
|
12040
|
-
}
|
|
12041
|
-
},
|
|
12042
|
-
validation ? validation.getValidationProps(elementProps) : elementProps,
|
|
12043
|
-
getButtonProps
|
|
12044
|
-
],
|
|
12045
|
-
stateAttributesMapping: triggerStateAttributesMapping
|
|
12046
|
-
});
|
|
12047
|
-
});
|
|
12048
|
-
//#endregion
|
|
12049
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/chips/ComboboxChipsContext.js
|
|
12050
|
-
var ComboboxChipsContext = /* @__PURE__ */ import_react.createContext(void 0);
|
|
12051
|
-
function useComboboxChipsContext() {
|
|
12052
|
-
return import_react.useContext(ComboboxChipsContext);
|
|
12053
|
-
}
|
|
12054
|
-
//#endregion
|
|
12055
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositionerContext.js
|
|
12056
|
-
var ComboboxPositionerContext = /* @__PURE__ */ import_react.createContext(void 0);
|
|
12057
|
-
function useComboboxPositionerContext(optional) {
|
|
12058
|
-
const context = import_react.useContext(ComboboxPositionerContext);
|
|
12059
|
-
if (context === void 0 && !optional) throw new Error(formatErrorMessage(21));
|
|
12060
|
-
return context;
|
|
12061
|
-
}
|
|
12062
|
-
//#endregion
|
|
12063
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/utils/ComboboxInternalDismissButton.js
|
|
12064
|
-
/**
|
|
12065
|
-
* @internal
|
|
12066
|
-
*/
|
|
12067
|
-
var ComboboxInternalDismissButton = /* @__PURE__ */ import_react.forwardRef(function ComboboxInternalDismissButton(_, forwardedRef) {
|
|
12068
|
-
const store = useComboboxRootContext();
|
|
12069
|
-
const { buttonRef, getButtonProps } = useButton({ native: false });
|
|
12070
|
-
const mergedRef = useMergedRefs(forwardedRef, buttonRef);
|
|
12071
|
-
function handleDismiss(event) {
|
|
12072
|
-
store.state.setOpen(false, createChangeEventDetails(closePress, event.nativeEvent, event.currentTarget));
|
|
12073
|
-
}
|
|
12074
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
12075
|
-
ref: mergedRef,
|
|
12076
|
-
...getButtonProps({ onClick: handleDismiss }),
|
|
12077
|
-
"aria-label": "Dismiss",
|
|
12078
|
-
tabIndex: void 0,
|
|
12079
|
-
style: visuallyHiddenInput
|
|
12080
|
-
});
|
|
12081
|
-
});
|
|
12082
|
-
//#endregion
|
|
12083
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/input/ComboboxInput.js
|
|
12084
|
-
/**
|
|
12085
|
-
* A text input to search for items in the list.
|
|
12086
|
-
* Renders an `<input>` element.
|
|
12087
|
-
*
|
|
12088
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12089
|
-
*/
|
|
12090
|
-
var ComboboxInput = /* @__PURE__ */ import_react.forwardRef(function ComboboxInput(componentProps, forwardedRef) {
|
|
12091
|
-
const { render, className, disabled: disabledProp = false, id: idProp, style, ...elementProps } = componentProps;
|
|
12092
|
-
const { state: fieldState, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
|
|
12093
|
-
const { labelId: fieldLabelId } = useLabelableContext();
|
|
12094
|
-
const comboboxChipsContext = useComboboxChipsContext();
|
|
12095
|
-
const positioning = useComboboxPositionerContext(true);
|
|
12096
|
-
const hasPositionerParent = Boolean(positioning);
|
|
12097
|
-
const store = useComboboxRootContext();
|
|
12098
|
-
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
12099
|
-
const inputValue = useComboboxInputValueContext();
|
|
12100
|
-
const direction = useDirection();
|
|
12101
|
-
const required = useStore(store, selectors$1.required);
|
|
12102
|
-
const comboboxDisabled = useStore(store, selectors$1.disabled);
|
|
12103
|
-
const readOnly = useStore(store, selectors$1.readOnly);
|
|
12104
|
-
const name = useStore(store, selectors$1.name);
|
|
12105
|
-
const form = useStore(store, selectors$1.form);
|
|
12106
|
-
const selectionMode = useStore(store, selectors$1.selectionMode);
|
|
12107
|
-
const autoHighlightMode = useStore(store, selectors$1.autoHighlight);
|
|
12108
|
-
const inputProps = useStore(store, selectors$1.inputProps);
|
|
12109
|
-
const triggerProps = useStore(store, selectors$1.triggerProps);
|
|
12110
|
-
const open = useStore(store, selectors$1.open);
|
|
12111
|
-
const mounted = useStore(store, selectors$1.mounted);
|
|
12112
|
-
const selectedValue = useStore(store, selectors$1.selectedValue);
|
|
12113
|
-
const popupSideValue = useStore(store, selectors$1.popupSide);
|
|
12114
|
-
const positionerElement = useStore(store, selectors$1.positionerElement);
|
|
12115
|
-
const rootId = useStore(store, selectors$1.id);
|
|
12116
|
-
const inline = useStore(store, selectors$1.inline);
|
|
12117
|
-
const modal = useStore(store, selectors$1.modal);
|
|
12118
|
-
const autoHighlightEnabled = Boolean(autoHighlightMode);
|
|
12119
|
-
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
12120
|
-
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
12121
|
-
const listEmpty = filteredItems.length === 0;
|
|
12122
|
-
const isInsidePopup = hasPositionerParent || inline;
|
|
12123
|
-
const focusManagerModal = !isInsidePopup || modal;
|
|
12124
|
-
const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : void 0));
|
|
12125
|
-
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, void 0);
|
|
12126
|
-
const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;
|
|
12127
|
-
const [composingValue, setComposingValue] = import_react.useState(null);
|
|
12128
|
-
const isComposingRef = import_react.useRef(false);
|
|
12129
|
-
const lastActiveIndexRef = import_react.useRef(null);
|
|
12130
|
-
const shouldRestoreActiveIndexRef = import_react.useRef(false);
|
|
12131
|
-
const inputOwnsFormValue = selectionMode === "none" && !hasPositionerParent;
|
|
12132
|
-
const setInputElement = useStableCallback((element) => {
|
|
12133
|
-
const nextIsInsidePopup = hasPositionerParent || store.state.inline;
|
|
12134
|
-
if (nextIsInsidePopup && !store.state.hasInputValue) store.state.setInputValue("", createChangeEventDetails(none));
|
|
12135
|
-
store.update({
|
|
12136
|
-
inputElement: element,
|
|
12137
|
-
inputInsidePopup: nextIsInsidePopup,
|
|
12138
|
-
inputOwnsFormValue
|
|
12139
|
-
});
|
|
12140
|
-
});
|
|
12141
|
-
const validationProps = hasPositionerParent || !validation ? elementProps : validation.getValidationProps(elementProps);
|
|
12142
|
-
const state = {
|
|
12143
|
-
...fieldStateForInput,
|
|
12144
|
-
open,
|
|
12145
|
-
disabled,
|
|
12146
|
-
readOnly,
|
|
12147
|
-
popupSide,
|
|
12148
|
-
listEmpty
|
|
12149
|
-
};
|
|
12150
|
-
function handleKeyDown(event) {
|
|
12151
|
-
if (!comboboxChipsContext) return;
|
|
12152
|
-
let nextIndex;
|
|
12153
|
-
const { highlightedChipIndex } = comboboxChipsContext;
|
|
12154
|
-
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
12155
|
-
const isRtl = direction === "rtl";
|
|
12156
|
-
const previousChipKey = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
12157
|
-
const nextChipKey = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
12158
|
-
if (highlightedChipIndex !== void 0) {
|
|
12159
|
-
if (event.key === previousChipKey) {
|
|
12160
|
-
event.preventDefault();
|
|
12161
|
-
if (highlightedChipIndex > 0) nextIndex = highlightedChipIndex - 1;
|
|
12162
|
-
else nextIndex = void 0;
|
|
12163
|
-
} else if (event.key === nextChipKey) {
|
|
12164
|
-
event.preventDefault();
|
|
12165
|
-
if (highlightedChipIndex < renderedChipsCount - 1) nextIndex = highlightedChipIndex + 1;
|
|
12166
|
-
else nextIndex = void 0;
|
|
12167
|
-
} else if (event.key === "Backspace" || event.key === "Delete") {
|
|
12168
|
-
event.preventDefault();
|
|
12169
|
-
const computedNextIndex = highlightedChipIndex >= selectedValue.length - 1 ? selectedValue.length - 2 : highlightedChipIndex;
|
|
12170
|
-
nextIndex = computedNextIndex >= 0 ? computedNextIndex : void 0;
|
|
12171
|
-
store.state.setIndices({
|
|
12172
|
-
activeIndex: null,
|
|
12173
|
-
selectedIndex: null,
|
|
12174
|
-
type: "keyboard"
|
|
12175
|
-
});
|
|
12176
|
-
}
|
|
12177
|
-
return nextIndex;
|
|
12178
|
-
}
|
|
12179
|
-
if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {
|
|
12180
|
-
event.preventDefault();
|
|
12181
|
-
nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : void 0;
|
|
12182
|
-
} else if (event.key === "Backspace" && event.currentTarget.value === "" && selectedValue.length > 0) {
|
|
12183
|
-
store.state.setIndices({
|
|
12184
|
-
activeIndex: null,
|
|
12185
|
-
selectedIndex: null,
|
|
12186
|
-
type: "keyboard"
|
|
12187
|
-
});
|
|
12188
|
-
event.preventDefault();
|
|
12189
|
-
}
|
|
12190
|
-
return nextIndex;
|
|
12191
|
-
}
|
|
12192
|
-
const element = useRenderElement("input", componentProps, {
|
|
12193
|
-
state,
|
|
12194
|
-
ref: [
|
|
12195
|
-
forwardedRef,
|
|
12196
|
-
store.state.inputRef,
|
|
12197
|
-
setInputElement
|
|
12198
|
-
],
|
|
12199
|
-
props: [
|
|
12200
|
-
inputProps,
|
|
12201
|
-
triggerProps,
|
|
12202
|
-
{
|
|
12203
|
-
type: "text",
|
|
12204
|
-
value: componentProps.value ?? composingValue ?? inputValue,
|
|
12205
|
-
"aria-readonly": readOnly || void 0,
|
|
12206
|
-
"aria-required": required || void 0,
|
|
12207
|
-
"aria-labelledby": ariaLabelledBy,
|
|
12208
|
-
disabled,
|
|
12209
|
-
readOnly,
|
|
12210
|
-
required: selectionMode === "none" ? required : void 0,
|
|
12211
|
-
form,
|
|
12212
|
-
...inputOwnsFormValue && name && { name },
|
|
12213
|
-
id,
|
|
12214
|
-
onFocus() {
|
|
12215
|
-
setFocused(true);
|
|
12216
|
-
if (!inline || !shouldRestoreActiveIndexRef.current) return;
|
|
12217
|
-
shouldRestoreActiveIndexRef.current = false;
|
|
12218
|
-
const nextActiveIndex = lastActiveIndexRef.current;
|
|
12219
|
-
if (nextActiveIndex == null || !Object.hasOwn(store.state.valuesRef.current, nextActiveIndex)) return;
|
|
12220
|
-
store.state.setIndices({ activeIndex: nextActiveIndex });
|
|
12221
|
-
},
|
|
12222
|
-
onBlur() {
|
|
12223
|
-
setTouched(true);
|
|
12224
|
-
setFocused(false);
|
|
12225
|
-
const activeIndex = store.state.activeIndex;
|
|
12226
|
-
if (inline && activeIndex !== null && autoHighlightMode !== "always") {
|
|
12227
|
-
lastActiveIndexRef.current = activeIndex;
|
|
12228
|
-
shouldRestoreActiveIndexRef.current = true;
|
|
12229
|
-
store.state.setIndices({ activeIndex: null });
|
|
12230
|
-
}
|
|
12231
|
-
if (validationMode === "onBlur") {
|
|
12232
|
-
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
12233
|
-
validation.commit(valueToValidate);
|
|
12234
|
-
}
|
|
12235
|
-
},
|
|
12236
|
-
onCompositionStart(event) {
|
|
12237
|
-
if (isAndroid) return;
|
|
12238
|
-
isComposingRef.current = true;
|
|
12239
|
-
setComposingValue(event.currentTarget.value);
|
|
12240
|
-
},
|
|
12241
|
-
onCompositionEnd(event) {
|
|
12242
|
-
isComposingRef.current = false;
|
|
12243
|
-
const next = event.currentTarget.value;
|
|
12244
|
-
setComposingValue(null);
|
|
12245
|
-
store.state.setInputValue(next, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
12246
|
-
},
|
|
12247
|
-
onChange(event) {
|
|
12248
|
-
const inputType = event.nativeEvent.inputType;
|
|
12249
|
-
const autofillLikeInput = !inputType || inputType === "insertReplacementText";
|
|
12250
|
-
const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;
|
|
12251
|
-
if (isComposingRef.current) {
|
|
12252
|
-
const nextVal = event.currentTarget.value;
|
|
12253
|
-
setComposingValue(nextVal);
|
|
12254
|
-
if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) store.state.setOpen(false, createChangeEventDetails(inputClear, event.nativeEvent));
|
|
12255
|
-
const trimmed = nextVal.trim();
|
|
12256
|
-
const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== "";
|
|
12257
|
-
if (!readOnly && !disabled && trimmed) {
|
|
12258
|
-
if (shouldOpenOnInput) {
|
|
12259
|
-
store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
12260
|
-
if (!autoHighlightEnabled) store.state.setIndices({
|
|
12261
|
-
activeIndex: null,
|
|
12262
|
-
selectedIndex: null,
|
|
12263
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
12264
|
-
});
|
|
12265
|
-
}
|
|
12266
|
-
}
|
|
12267
|
-
if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) store.state.setIndices({
|
|
12268
|
-
activeIndex: null,
|
|
12269
|
-
selectedIndex: null,
|
|
12270
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
12271
|
-
});
|
|
12272
|
-
return;
|
|
12273
|
-
}
|
|
12274
|
-
store.state.setInputValue(event.currentTarget.value, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
12275
|
-
const empty = event.currentTarget.value === "";
|
|
12276
|
-
const clearDetails = createChangeEventDetails(inputClear, event.nativeEvent);
|
|
12277
|
-
if (empty && !store.state.inputInsidePopup) {
|
|
12278
|
-
if (selectionMode === "single") store.state.setSelectedValue(null, clearDetails);
|
|
12279
|
-
if (!store.state.openOnInputClick) store.state.setOpen(false, clearDetails);
|
|
12280
|
-
}
|
|
12281
|
-
const trimmed = event.currentTarget.value.trim();
|
|
12282
|
-
if (!readOnly && !disabled && trimmed) {
|
|
12283
|
-
if (shouldOpenOnInput) {
|
|
12284
|
-
store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
12285
|
-
if (!autoHighlightEnabled) store.state.setIndices({
|
|
12286
|
-
activeIndex: null,
|
|
12287
|
-
selectedIndex: null,
|
|
12288
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
12289
|
-
});
|
|
12290
|
-
}
|
|
12291
|
-
}
|
|
12292
|
-
if (open && store.state.activeIndex !== null && !autoHighlightEnabled) store.state.setIndices({
|
|
12293
|
-
activeIndex: null,
|
|
12294
|
-
selectedIndex: null,
|
|
12295
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
12296
|
-
});
|
|
12297
|
-
},
|
|
12298
|
-
onKeyDown(event) {
|
|
12299
|
-
if (disabled || readOnly) return;
|
|
12300
|
-
if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) return;
|
|
12301
|
-
store.state.keyboardActiveRef.current = true;
|
|
12302
|
-
const input = event.currentTarget;
|
|
12303
|
-
const scrollAmount = input.scrollWidth - input.clientWidth;
|
|
12304
|
-
const isRTL = direction === "rtl";
|
|
12305
|
-
if (event.key === "Home") {
|
|
12306
|
-
stopEvent(event);
|
|
12307
|
-
const cursor = isFirefox && isRTL ? input.value.length : 0;
|
|
12308
|
-
input.setSelectionRange(cursor, cursor);
|
|
12309
|
-
input.scrollLeft = 0;
|
|
12310
|
-
return;
|
|
12311
|
-
}
|
|
12312
|
-
if (event.key === "End") {
|
|
12313
|
-
stopEvent(event);
|
|
12314
|
-
const cursor = isFirefox && isRTL ? 0 : input.value.length;
|
|
12315
|
-
input.setSelectionRange(cursor, cursor);
|
|
12316
|
-
input.scrollLeft = isRTL ? -scrollAmount : scrollAmount;
|
|
12317
|
-
return;
|
|
12318
|
-
}
|
|
12319
|
-
if (!mounted && event.key === "Escape") {
|
|
12320
|
-
const isClear = selectionMode === "multiple" && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;
|
|
12321
|
-
const details = createChangeEventDetails(escapeKey, event.nativeEvent);
|
|
12322
|
-
const value = selectionMode === "multiple" ? [] : null;
|
|
12323
|
-
store.state.setInputValue("", details);
|
|
12324
|
-
store.state.setSelectedValue(value, details);
|
|
12325
|
-
if (!isClear && !store.state.inline && !details.isPropagationAllowed) event.stopPropagation();
|
|
12326
|
-
return;
|
|
12327
|
-
}
|
|
12328
|
-
if (comboboxChipsContext && event.key === "Backspace" && input.value === "" && comboboxChipsContext.highlightedChipIndex === void 0 && Array.isArray(selectedValue) && selectedValue.length > 0) {
|
|
12329
|
-
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
12330
|
-
const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;
|
|
12331
|
-
const newValue = selectedValue.filter((_, index) => index !== removalIndex);
|
|
12332
|
-
store.state.setIndices({
|
|
12333
|
-
activeIndex: null,
|
|
12334
|
-
selectedIndex: null,
|
|
12335
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
12336
|
-
});
|
|
12337
|
-
store.state.setSelectedValue(newValue, createChangeEventDetails(none, event.nativeEvent));
|
|
12338
|
-
return;
|
|
12339
|
-
}
|
|
12340
|
-
const hadHighlightedChip = comboboxChipsContext?.highlightedChipIndex !== void 0;
|
|
12341
|
-
const nextIndex = handleKeyDown(event);
|
|
12342
|
-
comboboxChipsContext?.setHighlightedChipIndex(nextIndex);
|
|
12343
|
-
if (nextIndex !== void 0) comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();
|
|
12344
|
-
else if (hadHighlightedChip) store.state.inputRef.current?.focus();
|
|
12345
|
-
if (event.which === 229) return;
|
|
12346
|
-
if (event.key === "Enter" && open) {
|
|
12347
|
-
const activeIndex = store.state.activeIndex;
|
|
12348
|
-
const nativeEvent = event.nativeEvent;
|
|
12349
|
-
if (activeIndex === null) {
|
|
12350
|
-
if (inline) return;
|
|
12351
|
-
store.state.setOpen(false, createChangeEventDetails(none, nativeEvent));
|
|
12352
|
-
return;
|
|
12353
|
-
}
|
|
12354
|
-
stopEvent(event);
|
|
12355
|
-
const listItem = store.state.listRef.current[activeIndex];
|
|
12356
|
-
if (listItem) {
|
|
12357
|
-
store.state.selectionEventRef.current = nativeEvent;
|
|
12358
|
-
listItem.click();
|
|
12359
|
-
store.state.selectionEventRef.current = null;
|
|
12360
|
-
}
|
|
12361
|
-
}
|
|
12362
|
-
},
|
|
12363
|
-
onPointerMove() {
|
|
12364
|
-
store.state.keyboardActiveRef.current = false;
|
|
12365
|
-
},
|
|
12366
|
-
onPointerDown() {
|
|
12367
|
-
store.state.keyboardActiveRef.current = false;
|
|
12368
|
-
}
|
|
12369
|
-
},
|
|
12370
|
-
validationProps
|
|
12371
|
-
],
|
|
12372
|
-
stateAttributesMapping: triggerStateAttributesMapping
|
|
12373
|
-
});
|
|
12374
|
-
const renderedInput = hasPositionerParent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldRootContext.Provider, {
|
|
12375
|
-
value: DEFAULT_FIELD_ROOT_CONTEXT,
|
|
12376
|
-
children: element
|
|
12377
|
-
}) : element;
|
|
12378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [open && focusManagerModal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxInternalDismissButton, { ref: store.state.startDismissRef }), renderedInput] });
|
|
12379
|
-
});
|
|
12380
|
-
//#endregion
|
|
12381
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/clear/ComboboxClear.js
|
|
12382
|
-
var stateAttributesMapping$5 = {
|
|
12383
|
-
...transitionStatusMapping,
|
|
12384
|
-
...triggerOpenStateMapping
|
|
12385
|
-
};
|
|
12386
|
-
/**
|
|
12387
|
-
* Clears the value when clicked.
|
|
12388
|
-
* Renders a `<button>` element.
|
|
12389
|
-
*
|
|
12390
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12391
|
-
*/
|
|
12392
|
-
var ComboboxClear = /* @__PURE__ */ import_react.forwardRef(function ComboboxClear(componentProps, forwardedRef) {
|
|
12393
|
-
const { render, className, disabled: disabledProp = false, nativeButton = true, keepMounted = false, style, ...elementProps } = componentProps;
|
|
12394
|
-
const { disabled: fieldDisabled } = useFieldRootContext();
|
|
12395
|
-
const store = useComboboxRootContext();
|
|
12396
|
-
const selectionMode = useStore(store, selectors$1.selectionMode);
|
|
12397
|
-
const comboboxDisabled = useStore(store, selectors$1.disabled);
|
|
12398
|
-
const readOnly = useStore(store, selectors$1.readOnly);
|
|
12399
|
-
const open = useStore(store, selectors$1.open);
|
|
12400
|
-
const selectedValue = useStore(store, selectors$1.selectedValue);
|
|
12401
|
-
const hasSelectionChips = useStore(store, selectors$1.hasSelectionChips);
|
|
12402
|
-
const inputValue = useComboboxInputValueContext();
|
|
12403
|
-
let visible = false;
|
|
12404
|
-
if (selectionMode === "none") visible = inputValue !== "";
|
|
12405
|
-
else if (selectionMode === "single") visible = selectedValue != null;
|
|
12406
|
-
else visible = hasSelectionChips;
|
|
12407
|
-
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
12408
|
-
const { buttonRef, getButtonProps } = useButton({
|
|
12409
|
-
native: nativeButton,
|
|
12410
|
-
disabled
|
|
12411
|
-
});
|
|
12412
|
-
const { mounted, transitionStatus, setMounted } = useTransitionStatus(visible);
|
|
12413
|
-
const state = {
|
|
12414
|
-
disabled,
|
|
12415
|
-
visible,
|
|
12416
|
-
open,
|
|
12417
|
-
transitionStatus
|
|
12418
|
-
};
|
|
12419
|
-
useOpenChangeComplete({
|
|
12420
|
-
open: visible,
|
|
12421
|
-
ref: store.state.clearRef,
|
|
12422
|
-
onComplete() {
|
|
12423
|
-
if (!visible) setMounted(false);
|
|
12424
|
-
}
|
|
12425
|
-
});
|
|
12426
|
-
const element = useRenderElement("button", componentProps, {
|
|
12427
|
-
state,
|
|
12428
|
-
ref: [
|
|
12429
|
-
forwardedRef,
|
|
12430
|
-
buttonRef,
|
|
12431
|
-
store.state.clearRef
|
|
12432
|
-
],
|
|
12433
|
-
props: [
|
|
12434
|
-
{
|
|
12435
|
-
tabIndex: -1,
|
|
12436
|
-
children: "x",
|
|
12437
|
-
onMouseDown(event) {
|
|
12438
|
-
event.preventDefault();
|
|
12439
|
-
},
|
|
12440
|
-
onClick(event) {
|
|
12441
|
-
if (disabled || readOnly) return;
|
|
12442
|
-
const keyboardActiveRef = store.state.keyboardActiveRef;
|
|
12443
|
-
store.state.setInputValue("", createChangeEventDetails(clearPress, event.nativeEvent));
|
|
12444
|
-
if (selectionMode !== "none") {
|
|
12445
|
-
store.state.setSelectedValue(Array.isArray(selectedValue) ? [] : null, createChangeEventDetails(clearPress, event.nativeEvent));
|
|
12446
|
-
store.state.setIndices({
|
|
12447
|
-
activeIndex: null,
|
|
12448
|
-
selectedIndex: null,
|
|
12449
|
-
type: keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
12450
|
-
});
|
|
12451
|
-
} else store.state.setIndices({
|
|
12452
|
-
activeIndex: null,
|
|
12453
|
-
type: keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
12454
|
-
});
|
|
12455
|
-
store.state.inputRef.current?.focus();
|
|
12456
|
-
}
|
|
12457
|
-
},
|
|
12458
|
-
elementProps,
|
|
12459
|
-
getButtonProps
|
|
12460
|
-
],
|
|
12461
|
-
stateAttributesMapping: stateAttributesMapping$5
|
|
12462
|
-
});
|
|
12463
|
-
if (!(keepMounted || mounted)) return null;
|
|
12464
|
-
return element;
|
|
12465
|
-
});
|
|
12466
|
-
//#endregion
|
|
12467
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/collection/GroupCollectionContext.js
|
|
12468
|
-
var GroupCollectionContext = /* @__PURE__ */ import_react.createContext(null);
|
|
12469
|
-
function useGroupCollectionContext() {
|
|
12470
|
-
return import_react.useContext(GroupCollectionContext);
|
|
12471
|
-
}
|
|
12472
|
-
//#endregion
|
|
12473
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js
|
|
12474
|
-
/**
|
|
12475
|
-
* Renders filtered list items.
|
|
12476
|
-
* Doesn't render its own HTML element.
|
|
12477
|
-
*
|
|
12478
|
-
* If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.
|
|
12479
|
-
*
|
|
12480
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12481
|
-
*/
|
|
12482
|
-
function ComboboxCollection(props) {
|
|
12483
|
-
const { children } = props;
|
|
12484
|
-
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
12485
|
-
const groupContext = useGroupCollectionContext();
|
|
12486
|
-
const itemsToRender = groupContext ? groupContext.items : filteredItems;
|
|
12487
|
-
if (!itemsToRender) return null;
|
|
12488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: itemsToRender.map(children) });
|
|
12489
|
-
}
|
|
12490
|
-
//#endregion
|
|
12491
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/list/ComboboxList.js
|
|
12492
|
-
/**
|
|
12493
|
-
* A list container for the items.
|
|
12494
|
-
* Renders a `<div>` element.
|
|
12495
|
-
*
|
|
12496
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12497
|
-
*/
|
|
12498
|
-
var ComboboxList = /* @__PURE__ */ import_react.forwardRef(function ComboboxList(componentProps, forwardedRef) {
|
|
12499
|
-
var _ComboboxCollection;
|
|
12500
|
-
const { render, className, style, children, ...elementProps } = componentProps;
|
|
12501
|
-
const store = useComboboxRootContext();
|
|
12502
|
-
const floatingRootContext = useComboboxFloatingContext();
|
|
12503
|
-
const hasPositionerContext = Boolean(useComboboxPositionerContext(true));
|
|
12504
|
-
const { filteredItems, hasItems } = useComboboxDerivedItemsContext();
|
|
12505
|
-
const selectionMode = useStore(store, selectors$1.selectionMode);
|
|
12506
|
-
const grid = useStore(store, selectors$1.grid);
|
|
12507
|
-
const popupProps = useStore(store, selectors$1.popupProps);
|
|
12508
|
-
const virtualized = useStore(store, selectors$1.virtualized);
|
|
12509
|
-
const multiple = selectionMode === "multiple";
|
|
12510
|
-
const empty = filteredItems.length === 0;
|
|
12511
|
-
const setPositionerElement = useStableCallback((element) => {
|
|
12512
|
-
store.set("positionerElement", element);
|
|
12513
|
-
});
|
|
12514
|
-
const setListElement = useStableCallback((element) => {
|
|
12515
|
-
store.set("listElement", element);
|
|
12516
|
-
});
|
|
12517
|
-
const resolvedChildren = import_react.useMemo(() => {
|
|
12518
|
-
if (typeof children === "function") return _ComboboxCollection || (_ComboboxCollection = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxCollection, { children }));
|
|
12519
|
-
return children;
|
|
12520
|
-
}, [children]);
|
|
12521
|
-
const state = { empty };
|
|
12522
|
-
const floatingId = floatingRootContext.useState("floatingId");
|
|
12523
|
-
const element = useRenderElement("div", componentProps, {
|
|
12524
|
-
state,
|
|
12525
|
-
ref: [
|
|
12526
|
-
forwardedRef,
|
|
12527
|
-
setListElement,
|
|
12528
|
-
hasPositionerContext ? null : setPositionerElement
|
|
12529
|
-
],
|
|
12530
|
-
props: [
|
|
12531
|
-
popupProps,
|
|
12532
|
-
{
|
|
12533
|
-
children: resolvedChildren,
|
|
12534
|
-
tabIndex: -1,
|
|
12535
|
-
id: floatingId,
|
|
12536
|
-
role: grid ? "grid" : "listbox",
|
|
12537
|
-
"aria-multiselectable": multiple ? "true" : void 0,
|
|
12538
|
-
onKeyDown(event) {
|
|
12539
|
-
if (store.state.disabled || store.state.readOnly) return;
|
|
12540
|
-
if (event.key === "Enter") {
|
|
12541
|
-
const activeIndex = store.state.activeIndex;
|
|
12542
|
-
if (activeIndex == null) return;
|
|
12543
|
-
stopEvent(event);
|
|
12544
|
-
const nativeEvent = event.nativeEvent;
|
|
12545
|
-
const listItem = store.state.listRef.current[activeIndex];
|
|
12546
|
-
if (listItem) {
|
|
12547
|
-
store.state.selectionEventRef.current = nativeEvent;
|
|
12548
|
-
listItem.click();
|
|
12549
|
-
store.state.selectionEventRef.current = null;
|
|
12550
|
-
}
|
|
12551
|
-
}
|
|
12552
|
-
},
|
|
12553
|
-
onKeyDownCapture() {
|
|
12554
|
-
store.state.keyboardActiveRef.current = true;
|
|
12555
|
-
},
|
|
12556
|
-
onPointerMoveCapture() {
|
|
12557
|
-
store.state.keyboardActiveRef.current = false;
|
|
12558
|
-
}
|
|
12559
|
-
},
|
|
12560
|
-
elementProps
|
|
12561
|
-
]
|
|
12562
|
-
});
|
|
12563
|
-
if (virtualized) return element;
|
|
12564
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeList, {
|
|
12565
|
-
elementsRef: store.state.listRef,
|
|
12566
|
-
labelsRef: hasItems ? void 0 : store.state.labelsRef,
|
|
12567
|
-
children: element
|
|
12568
|
-
});
|
|
12569
|
-
});
|
|
12570
|
-
//#endregion
|
|
12571
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/utils/useInitialLiveRegionTextMutation.js
|
|
12572
|
-
var LIVE_REGION_MARKER = "";
|
|
12573
|
-
function findLastTextNode(root) {
|
|
12574
|
-
const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
12575
|
-
let lastTextNode = null;
|
|
12576
|
-
while (walker.nextNode()) {
|
|
12577
|
-
const textNode = walker.currentNode;
|
|
12578
|
-
if (textNode.nodeValue !== "") lastTextNode = textNode;
|
|
12579
|
-
}
|
|
12580
|
-
return lastTextNode;
|
|
12581
|
-
}
|
|
12582
|
-
function useInitialLiveRegionTextMutation() {
|
|
12583
|
-
const timeout = useTimeout();
|
|
12584
|
-
const rootRef = import_react.useRef(null);
|
|
12585
|
-
import_react.useEffect(() => {
|
|
12586
|
-
if (isIOS) return;
|
|
12587
|
-
const root = rootRef.current;
|
|
12588
|
-
if (root == null) return;
|
|
12589
|
-
const textNode = findLastTextNode(root);
|
|
12590
|
-
if (textNode == null) return;
|
|
12591
|
-
const originalValue = textNode.nodeValue ?? "";
|
|
12592
|
-
const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;
|
|
12593
|
-
textNode.nodeValue = markedValue;
|
|
12594
|
-
timeout.start(200, () => {
|
|
12595
|
-
if (textNode.nodeValue === markedValue) textNode.nodeValue = originalValue;
|
|
12596
|
-
});
|
|
12597
|
-
return () => {
|
|
12598
|
-
timeout.clear();
|
|
12599
|
-
if (textNode.nodeValue === markedValue) textNode.nodeValue = originalValue;
|
|
12600
|
-
};
|
|
12601
|
-
}, [rootRef, timeout]);
|
|
12602
|
-
return rootRef;
|
|
12603
|
-
}
|
|
12604
|
-
//#endregion
|
|
12605
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortalContext.js
|
|
12606
|
-
var ComboboxPortalContext = /* @__PURE__ */ import_react.createContext(void 0);
|
|
12607
|
-
function useComboboxPortalContext() {
|
|
12608
|
-
const context = import_react.useContext(ComboboxPortalContext);
|
|
12609
|
-
if (context === void 0) throw new Error(formatErrorMessage(20));
|
|
12610
|
-
return context;
|
|
12611
|
-
}
|
|
12612
|
-
//#endregion
|
|
12613
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortal.js
|
|
12614
|
-
/**
|
|
12615
|
-
* A portal element that moves the popup to a different part of the DOM.
|
|
12616
|
-
* By default, the portal element is appended to `<body>`.
|
|
12617
|
-
* Renders a `<div>` element.
|
|
12618
|
-
*
|
|
12619
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12620
|
-
*/
|
|
12621
|
-
var ComboboxPortal = /* @__PURE__ */ import_react.forwardRef(function ComboboxPortal(props, forwardedRef) {
|
|
12622
|
-
const { keepMounted = false, ...portalProps } = props;
|
|
12623
|
-
const store = useComboboxRootContext();
|
|
12624
|
-
const mounted = useStore(store, selectors$1.mounted);
|
|
12625
|
-
const forceMounted = useStore(store, selectors$1.forceMounted);
|
|
12626
|
-
if (!(mounted || keepMounted || forceMounted)) return null;
|
|
12627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxPortalContext.Provider, {
|
|
12628
|
-
value: keepMounted,
|
|
12629
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingPortal, {
|
|
12630
|
-
ref: forwardedRef,
|
|
12631
|
-
...portalProps
|
|
12632
|
-
})
|
|
12633
|
-
});
|
|
12634
|
-
});
|
|
12635
|
-
//#endregion
|
|
12636
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/useAnchoredPopupScrollLock.js
|
|
12637
|
-
var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
|
|
12638
|
-
/**
|
|
12639
|
-
* Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when
|
|
12640
|
-
* enabled. For touch opens, scroll lock is applied only when the positioner width is effectively
|
|
12641
|
-
* viewport-sized.
|
|
12642
|
-
*/
|
|
12643
|
-
function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
|
|
12644
|
-
const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = import_react.useState(false);
|
|
12645
|
-
useIsoLayoutEffect(() => {
|
|
12646
|
-
if (!enabled || !touchOpen || positionerElement == null) {
|
|
12647
|
-
setTouchOpenShouldLockScroll(false);
|
|
12648
|
-
return;
|
|
12649
|
-
}
|
|
12650
|
-
const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;
|
|
12651
|
-
const popupWidth = positionerElement.offsetWidth;
|
|
12652
|
-
setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);
|
|
12653
|
-
}, [
|
|
12654
|
-
enabled,
|
|
12655
|
-
touchOpen,
|
|
12656
|
-
positionerElement
|
|
12657
|
-
]);
|
|
12658
|
-
useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
|
|
12659
|
-
}
|
|
12660
|
-
//#endregion
|
|
12661
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositioner.js
|
|
12662
|
-
/**
|
|
12663
|
-
* Positions the popup against the trigger.
|
|
12664
|
-
* Renders a `<div>` element.
|
|
12665
|
-
*
|
|
12666
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12667
|
-
*/
|
|
12668
|
-
var ComboboxPositioner = /* @__PURE__ */ import_react.forwardRef(function ComboboxPositioner(componentProps, forwardedRef) {
|
|
12669
|
-
const { render, className, anchor, positionMethod = "absolute", side = "bottom", align = "center", sideOffset = 0, alignOffset = 0, collisionBoundary = "clipping-ancestors", collisionPadding = 5, arrowPadding = 5, sticky = false, disableAnchorTracking = false, collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE, style: styleProp, ...elementProps } = componentProps;
|
|
12670
|
-
const store = useComboboxRootContext();
|
|
12671
|
-
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
12672
|
-
const floatingRootContext = useComboboxFloatingContext();
|
|
12673
|
-
const keepMounted = useComboboxPortalContext();
|
|
12674
|
-
const modal = useStore(store, selectors$1.modal);
|
|
12675
|
-
const open = useStore(store, selectors$1.open);
|
|
12676
|
-
const mounted = useStore(store, selectors$1.mounted);
|
|
12677
|
-
const openMethod = useStore(store, selectors$1.openMethod);
|
|
12678
|
-
const positionerElement = useStore(store, selectors$1.positionerElement);
|
|
12679
|
-
const triggerElement = useStore(store, selectors$1.triggerElement);
|
|
12680
|
-
const inputElement = useStore(store, selectors$1.inputElement);
|
|
12681
|
-
const inputGroupElement = useStore(store, selectors$1.inputGroupElement);
|
|
12682
|
-
const inputInsidePopup = useStore(store, selectors$1.inputInsidePopup);
|
|
12683
|
-
const transitionStatus = useStore(store, selectors$1.transitionStatus);
|
|
12684
|
-
const empty = filteredItems.length === 0;
|
|
12685
|
-
const positioning = useAnchorPositioning({
|
|
12686
|
-
anchor: anchor ?? (inputInsidePopup ? triggerElement : inputGroupElement ?? inputElement),
|
|
12687
|
-
floatingRootContext,
|
|
12688
|
-
positionMethod,
|
|
12689
|
-
mounted,
|
|
12690
|
-
side,
|
|
12691
|
-
sideOffset,
|
|
12692
|
-
align,
|
|
12693
|
-
alignOffset,
|
|
12694
|
-
arrowPadding,
|
|
12695
|
-
collisionBoundary,
|
|
12696
|
-
collisionPadding,
|
|
12697
|
-
sticky,
|
|
12698
|
-
disableAnchorTracking,
|
|
12699
|
-
keepMounted,
|
|
12700
|
-
collisionAvoidance,
|
|
12701
|
-
lazyFlip: true
|
|
12702
|
-
});
|
|
12703
|
-
useAnchoredPopupScrollLock(open && modal, openMethod === "touch", positionerElement, triggerElement);
|
|
12704
|
-
const state = {
|
|
12705
|
-
open,
|
|
12706
|
-
side: positioning.side,
|
|
12707
|
-
align: positioning.align,
|
|
12708
|
-
anchorHidden: positioning.anchorHidden,
|
|
12709
|
-
empty
|
|
12710
|
-
};
|
|
12711
|
-
useIsoLayoutEffect(() => {
|
|
12712
|
-
store.set("popupSide", positioning.side);
|
|
12713
|
-
}, [store, positioning.side]);
|
|
12714
|
-
const setPositionerElement = useStableCallback((element) => {
|
|
12715
|
-
store.set("positionerElement", element);
|
|
12716
|
-
});
|
|
12717
|
-
const element = usePositioner(componentProps, state, {
|
|
12718
|
-
styles: positioning.positionerStyles,
|
|
12719
|
-
transitionStatus,
|
|
12720
|
-
props: elementProps,
|
|
12721
|
-
refs: [forwardedRef, setPositionerElement],
|
|
12722
|
-
hidden: !mounted,
|
|
12723
|
-
inert: !open
|
|
12724
|
-
});
|
|
12725
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ComboboxPositionerContext.Provider, {
|
|
12726
|
-
value: positioning,
|
|
12727
|
-
children: [mounted && modal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InternalBackdrop, {
|
|
12728
|
-
inert: inertValue(!open),
|
|
12729
|
-
cutout: inputGroupElement ?? inputElement ?? triggerElement
|
|
12730
|
-
}), element]
|
|
12731
|
-
});
|
|
12732
|
-
});
|
|
12733
|
-
//#endregion
|
|
12734
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/popup/ComboboxPopup.js
|
|
12735
|
-
var stateAttributesMapping$4 = {
|
|
12736
|
-
...popupStateMapping,
|
|
12737
|
-
...transitionStatusMapping
|
|
12738
|
-
};
|
|
12739
|
-
/**
|
|
12740
|
-
* A container for the list.
|
|
12741
|
-
* Renders a `<div>` element.
|
|
12742
|
-
*
|
|
12743
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12744
|
-
*/
|
|
12745
|
-
var ComboboxPopup = /* @__PURE__ */ import_react.forwardRef(function ComboboxPopup(componentProps, forwardedRef) {
|
|
12746
|
-
const { render, className, style, initialFocus, finalFocus, ...elementProps } = componentProps;
|
|
12747
|
-
const store = useComboboxRootContext();
|
|
12748
|
-
const positioning = useComboboxPositionerContext();
|
|
12749
|
-
const floatingRootContext = useComboboxFloatingContext();
|
|
12750
|
-
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
12751
|
-
const mounted = useStore(store, selectors$1.mounted);
|
|
12752
|
-
const open = useStore(store, selectors$1.open);
|
|
12753
|
-
const openMethod = useStore(store, selectors$1.openMethod);
|
|
12754
|
-
const transitionStatus = useStore(store, selectors$1.transitionStatus);
|
|
12755
|
-
const inputInsidePopup = useStore(store, selectors$1.inputInsidePopup);
|
|
12756
|
-
const inputElement = useStore(store, selectors$1.inputElement);
|
|
12757
|
-
const modal = useStore(store, selectors$1.modal);
|
|
12758
|
-
const empty = filteredItems.length === 0;
|
|
12759
|
-
useOpenChangeComplete({
|
|
12760
|
-
open,
|
|
12761
|
-
ref: store.state.popupRef,
|
|
12762
|
-
onComplete() {
|
|
12763
|
-
if (open) store.state.onOpenChangeComplete(true);
|
|
12764
|
-
}
|
|
12765
|
-
});
|
|
12766
|
-
const element = useRenderElement("div", componentProps, {
|
|
12767
|
-
state: {
|
|
12768
|
-
open,
|
|
12769
|
-
side: positioning.side,
|
|
12770
|
-
align: positioning.align,
|
|
12771
|
-
anchorHidden: positioning.anchorHidden,
|
|
12772
|
-
transitionStatus,
|
|
12773
|
-
empty
|
|
12774
|
-
},
|
|
12775
|
-
ref: [forwardedRef, store.state.popupRef],
|
|
12776
|
-
props: [
|
|
12777
|
-
{
|
|
12778
|
-
role: inputInsidePopup ? "dialog" : "presentation",
|
|
12779
|
-
tabIndex: -1,
|
|
12780
|
-
onFocus(event) {
|
|
12781
|
-
const target = getTarget(event.nativeEvent);
|
|
12782
|
-
if (openMethod !== "touch" && (contains(store.state.listElement, target) || target === event.currentTarget)) store.state.inputRef.current?.focus();
|
|
12783
|
-
}
|
|
12784
|
-
},
|
|
12785
|
-
getDisabledMountTransitionStyles(transitionStatus),
|
|
12786
|
-
elementProps
|
|
12787
|
-
],
|
|
12788
|
-
stateAttributesMapping: stateAttributesMapping$4
|
|
12789
|
-
});
|
|
12790
|
-
const resolvedInitialFocus = initialFocus === void 0 ? inputInsidePopup ? (interactionType) => interactionType === "touch" ? store.state.popupRef.current : inputElement : false : initialFocus;
|
|
12791
|
-
let resolvedFinalFocus;
|
|
12792
|
-
if (finalFocus != null) resolvedFinalFocus = finalFocus;
|
|
12793
|
-
else resolvedFinalFocus = inputInsidePopup ? void 0 : false;
|
|
12794
|
-
const focusManagerModal = !inputInsidePopup || modal;
|
|
12795
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingFocusManager, {
|
|
12796
|
-
context: floatingRootContext,
|
|
12797
|
-
disabled: !mounted,
|
|
12798
|
-
modal: focusManagerModal,
|
|
12799
|
-
openInteractionType: openMethod,
|
|
12800
|
-
initialFocus: resolvedInitialFocus,
|
|
12801
|
-
returnFocus: resolvedFinalFocus,
|
|
12802
|
-
getInsideElements: () => [store.state.startDismissRef.current, store.state.endDismissRef.current],
|
|
12803
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [element, focusManagerModal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxInternalDismissButton, { ref: store.state.endDismissRef })] })
|
|
12804
|
-
});
|
|
12805
|
-
});
|
|
12806
|
-
//#endregion
|
|
12807
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/item/ComboboxItemContext.js
|
|
12808
|
-
var ComboboxItemContext = /* @__PURE__ */ import_react.createContext(void 0);
|
|
12809
|
-
function useComboboxItemContext() {
|
|
12810
|
-
const context = import_react.useContext(ComboboxItemContext);
|
|
12811
|
-
if (!context) throw new Error(formatErrorMessage(19));
|
|
12812
|
-
return context;
|
|
12813
|
-
}
|
|
12814
|
-
//#endregion
|
|
12815
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/row/ComboboxRowContext.js
|
|
12816
|
-
var ComboboxRowContext = /* @__PURE__ */ import_react.createContext(false);
|
|
12817
|
-
function useComboboxRowContext() {
|
|
12818
|
-
return import_react.useContext(ComboboxRowContext);
|
|
12819
|
-
}
|
|
12820
|
-
//#endregion
|
|
12821
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/item/ComboboxItem.js
|
|
12822
|
-
/**
|
|
12823
|
-
* An individual item in the list.
|
|
12824
|
-
* Renders a `<div>` element.
|
|
12825
|
-
*
|
|
12826
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12827
|
-
*/
|
|
12828
|
-
var ComboboxItem = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef(function ComboboxItem(componentProps, forwardedRef) {
|
|
12829
|
-
const { render, className, style, value: itemValue = null, index: indexProp, disabled = false, nativeButton = false, ...elementProps } = componentProps;
|
|
12830
|
-
const didPointerDownRef = import_react.useRef(false);
|
|
12831
|
-
const textRef = import_react.useRef(null);
|
|
12832
|
-
const listItem = useCompositeListItem({
|
|
12833
|
-
index: indexProp,
|
|
12834
|
-
textRef,
|
|
12835
|
-
indexGuessBehavior: IndexGuessBehavior.GuessFromOrder
|
|
12836
|
-
});
|
|
12837
|
-
const store = useComboboxRootContext();
|
|
12838
|
-
const isRow = useComboboxRowContext();
|
|
12839
|
-
const { flatFilteredItems, hasItems } = useComboboxDerivedItemsContext();
|
|
12840
|
-
const open = useStore(store, selectors$1.open);
|
|
12841
|
-
const selectionMode = useStore(store, selectors$1.selectionMode);
|
|
12842
|
-
const readOnly = useStore(store, selectors$1.readOnly);
|
|
12843
|
-
const virtualized = useStore(store, selectors$1.virtualized);
|
|
12844
|
-
const isItemEqualToValue = useStore(store, selectors$1.isItemEqualToValue);
|
|
12845
|
-
const selectable = selectionMode !== "none";
|
|
12846
|
-
const index = indexProp ?? (virtualized ? findItemIndex(flatFilteredItems, itemValue, isItemEqualToValue) : listItem.index);
|
|
12847
|
-
const hasRegistered = listItem.index !== -1;
|
|
12848
|
-
const rootId = useStore(store, selectors$1.id);
|
|
12849
|
-
const highlighted = useStore(store, selectors$1.isActive, index);
|
|
12850
|
-
const matchesSelectedValue = useStore(store, selectors$1.isSelected, itemValue);
|
|
12851
|
-
const itemProps = useStore(store, selectors$1.itemProps);
|
|
12852
|
-
const itemRef = import_react.useRef(null);
|
|
12853
|
-
const id = rootId != null && hasRegistered ? `${rootId}-${index}` : void 0;
|
|
12854
|
-
const selected = matchesSelectedValue && selectable;
|
|
12855
|
-
useIsoLayoutEffect(() => {
|
|
12856
|
-
if (!(hasRegistered && (virtualized || indexProp != null))) return;
|
|
12857
|
-
const list = store.state.listRef.current;
|
|
12858
|
-
list[index] = itemRef.current;
|
|
12859
|
-
return () => {
|
|
12860
|
-
delete list[index];
|
|
12861
|
-
};
|
|
12862
|
-
}, [
|
|
12863
|
-
hasRegistered,
|
|
12864
|
-
virtualized,
|
|
12865
|
-
index,
|
|
12866
|
-
indexProp,
|
|
12867
|
-
store
|
|
12868
|
-
]);
|
|
12869
|
-
useIsoLayoutEffect(() => {
|
|
12870
|
-
if (!hasRegistered || hasItems) return;
|
|
12871
|
-
const visibleMap = store.state.valuesRef.current;
|
|
12872
|
-
visibleMap[index] = itemValue;
|
|
12873
|
-
if (selectionMode !== "none") store.state.allValuesRef.current.push(itemValue);
|
|
12874
|
-
return () => {
|
|
12875
|
-
delete visibleMap[index];
|
|
12876
|
-
};
|
|
12877
|
-
}, [
|
|
12878
|
-
hasRegistered,
|
|
12879
|
-
hasItems,
|
|
12880
|
-
index,
|
|
12881
|
-
itemValue,
|
|
12882
|
-
store,
|
|
12883
|
-
selectionMode
|
|
12884
|
-
]);
|
|
12885
|
-
useIsoLayoutEffect(() => {
|
|
12886
|
-
if (!open) {
|
|
12887
|
-
didPointerDownRef.current = false;
|
|
12888
|
-
return;
|
|
12889
|
-
}
|
|
12890
|
-
if (!hasRegistered || hasItems) return;
|
|
12891
|
-
const selectedValue = store.state.selectedValue;
|
|
12892
|
-
if (compareItemEquality(itemValue, Array.isArray(selectedValue) ? selectedValue[selectedValue.length - 1] : selectedValue, isItemEqualToValue)) store.set("selectedIndex", index);
|
|
12893
|
-
}, [
|
|
12894
|
-
hasRegistered,
|
|
12895
|
-
hasItems,
|
|
12896
|
-
open,
|
|
12897
|
-
store,
|
|
12898
|
-
index,
|
|
12899
|
-
itemValue,
|
|
12900
|
-
isItemEqualToValue
|
|
12901
|
-
]);
|
|
12902
|
-
const { getButtonProps, buttonRef } = useButton({
|
|
12903
|
-
disabled,
|
|
12904
|
-
focusableWhenDisabled: true,
|
|
12905
|
-
native: nativeButton,
|
|
12906
|
-
composite: true
|
|
12907
|
-
});
|
|
12908
|
-
const state = {
|
|
12909
|
-
disabled,
|
|
12910
|
-
selected,
|
|
12911
|
-
highlighted
|
|
12912
|
-
};
|
|
12913
|
-
function commitSelection(nativeEvent) {
|
|
12914
|
-
function selectItem() {
|
|
12915
|
-
store.state.handleSelection(nativeEvent, itemValue);
|
|
12916
|
-
}
|
|
12917
|
-
if (store.state.submitOnItemClick) {
|
|
12918
|
-
import_react_dom.flushSync(selectItem);
|
|
12919
|
-
store.state.requestSubmit();
|
|
12920
|
-
} else selectItem();
|
|
12921
|
-
}
|
|
12922
|
-
const defaultProps = {
|
|
12923
|
-
id,
|
|
12924
|
-
role: isRow ? "gridcell" : "option",
|
|
12925
|
-
"aria-selected": selectable ? selected : void 0,
|
|
12926
|
-
tabIndex: void 0,
|
|
12927
|
-
onPointerDownCapture(event) {
|
|
12928
|
-
didPointerDownRef.current = true;
|
|
12929
|
-
event.preventDefault();
|
|
12930
|
-
},
|
|
12931
|
-
onMouseDown(event) {
|
|
12932
|
-
event.preventDefault();
|
|
12933
|
-
},
|
|
12934
|
-
onClick(event) {
|
|
12935
|
-
if (disabled || readOnly) return;
|
|
12936
|
-
commitSelection(event.nativeEvent);
|
|
12937
|
-
},
|
|
12938
|
-
onMouseUp(event) {
|
|
12939
|
-
const pointerStartedOnItem = didPointerDownRef.current;
|
|
12940
|
-
didPointerDownRef.current = false;
|
|
12941
|
-
if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) return;
|
|
12942
|
-
commitSelection(event.nativeEvent);
|
|
12943
|
-
}
|
|
12944
|
-
};
|
|
12945
|
-
const element = useRenderElement("div", componentProps, {
|
|
12946
|
-
ref: [
|
|
12947
|
-
buttonRef,
|
|
12948
|
-
forwardedRef,
|
|
12949
|
-
listItem.ref,
|
|
12950
|
-
itemRef
|
|
12951
|
-
],
|
|
12952
|
-
state,
|
|
12953
|
-
props: [
|
|
12954
|
-
itemProps,
|
|
12955
|
-
defaultProps,
|
|
12956
|
-
elementProps,
|
|
12957
|
-
getButtonProps
|
|
12958
|
-
]
|
|
12959
|
-
});
|
|
12960
|
-
const contextValue = import_react.useMemo(() => ({
|
|
12961
|
-
selected,
|
|
12962
|
-
textRef
|
|
12963
|
-
}), [selected, textRef]);
|
|
12964
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxItemContext.Provider, {
|
|
12965
|
-
value: contextValue,
|
|
12966
|
-
children: element
|
|
12967
|
-
});
|
|
12968
|
-
}));
|
|
12969
|
-
//#endregion
|
|
12970
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/empty/ComboboxEmpty.js
|
|
12971
|
-
/**
|
|
12972
|
-
* Renders its children only when the list is empty.
|
|
12973
|
-
* Requires the `items` prop on the root component.
|
|
12974
|
-
* Announces changes politely to screen readers.
|
|
12975
|
-
* This component's root element must remain mounted in the DOM to announce
|
|
12976
|
-
* changes consistently across screen readers. Avoid hiding or removing the
|
|
12977
|
-
* component itself with `display: none`, `hidden`, `aria-hidden`, or conditional
|
|
12978
|
-
* rendering. Prefer updating or conditionally rendering its children instead.
|
|
12979
|
-
* Renders a `<div>` element.
|
|
12980
|
-
*
|
|
12981
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
12982
|
-
*/
|
|
12983
|
-
var ComboboxEmpty = /* @__PURE__ */ import_react.forwardRef(function ComboboxEmpty(componentProps, forwardedRef) {
|
|
12984
|
-
const { render, className, style, children: childrenProp, ...elementProps } = componentProps;
|
|
12985
|
-
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
12986
|
-
const store = useComboboxRootContext();
|
|
12987
|
-
const emptyRef = useInitialLiveRegionTextMutation();
|
|
12988
|
-
const children = filteredItems.length === 0 ? childrenProp : null;
|
|
12989
|
-
return useRenderElement("div", componentProps, {
|
|
12990
|
-
ref: [
|
|
12991
|
-
forwardedRef,
|
|
12992
|
-
store.state.emptyRef,
|
|
12993
|
-
emptyRef
|
|
12994
|
-
],
|
|
12995
|
-
props: [{
|
|
12996
|
-
children,
|
|
12997
|
-
role: "status",
|
|
12998
|
-
"aria-live": "polite",
|
|
12999
|
-
"aria-atomic": true
|
|
13000
|
-
}, elementProps]
|
|
13001
|
-
});
|
|
13002
|
-
});
|
|
13003
|
-
//#endregion
|
|
13004
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/labelable-provider/useAriaLabelledBy.js
|
|
13005
|
-
/**
|
|
13006
|
-
* @internal
|
|
13007
|
-
*/
|
|
13008
|
-
function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
|
|
13009
|
-
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = import_react.useState();
|
|
13010
|
-
const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
|
|
13011
|
-
const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;
|
|
13012
|
-
useIsoLayoutEffect(() => {
|
|
13013
|
-
const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
|
|
13014
|
-
if (fallbackAriaLabelledBy !== nextAriaLabelledBy) setFallbackAriaLabelledBy(nextAriaLabelledBy);
|
|
13015
|
-
});
|
|
13016
|
-
return ariaLabelledBy;
|
|
13017
|
-
}
|
|
13018
|
-
function getAriaLabelledBy(labelSource, generatedLabelId) {
|
|
13019
|
-
const label = findAssociatedLabel(labelSource);
|
|
13020
|
-
if (!label) return;
|
|
13021
|
-
if (!label.id && generatedLabelId) label.id = generatedLabelId;
|
|
13022
|
-
return label.id || void 0;
|
|
13023
|
-
}
|
|
13024
|
-
function findAssociatedLabel(labelSource) {
|
|
13025
|
-
if (!labelSource) return;
|
|
13026
|
-
const parent = labelSource.parentElement;
|
|
13027
|
-
if (parent && parent.tagName === "LABEL") return parent;
|
|
13028
|
-
const controlId = labelSource.id;
|
|
13029
|
-
if (controlId) {
|
|
13030
|
-
const nextSibling = labelSource.nextElementSibling;
|
|
13031
|
-
if (nextSibling && nextSibling.htmlFor === controlId) return nextSibling;
|
|
13032
|
-
}
|
|
13033
|
-
const labels = labelSource.labels;
|
|
13034
|
-
return labels && labels[0];
|
|
13035
|
-
}
|
|
13036
|
-
//#endregion
|
|
13037
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/areArraysEqual.js
|
|
13038
|
-
function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
|
|
13039
|
-
return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));
|
|
13040
|
-
}
|
|
13041
|
-
//#endregion
|
|
13042
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/root/ComboboxRoot.js
|
|
13043
|
-
/**
|
|
13044
|
-
* Groups all parts of the combobox.
|
|
13045
|
-
* Doesn't render its own HTML element.
|
|
13046
|
-
*
|
|
13047
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
13048
|
-
*/
|
|
13049
|
-
function ComboboxRoot(props) {
|
|
13050
|
-
const { multiple = false, defaultValue, value, onValueChange, autoComplete, ...other } = props;
|
|
13051
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AriaCombobox, {
|
|
13052
|
-
...other,
|
|
13053
|
-
selectionMode: multiple ? "multiple" : "single",
|
|
13054
|
-
selectedValue: value,
|
|
13055
|
-
defaultSelectedValue: defaultValue,
|
|
13056
|
-
onSelectedValueChange: onValueChange,
|
|
13057
|
-
formAutoComplete: autoComplete
|
|
13058
|
-
});
|
|
13059
|
-
}
|
|
13060
|
-
//#endregion
|
|
13061
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/combobox/item-indicator/ComboboxItemIndicator.js
|
|
13062
|
-
/**
|
|
13063
|
-
* Indicates whether the item is selected.
|
|
13064
|
-
* Renders a `<span>` element.
|
|
13065
|
-
*
|
|
13066
|
-
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
13067
|
-
*/
|
|
13068
|
-
var ComboboxItemIndicator = /* @__PURE__ */ import_react.forwardRef(function ComboboxItemIndicator(componentProps, forwardedRef) {
|
|
13069
|
-
const keepMounted = componentProps.keepMounted ?? false;
|
|
13070
|
-
const { selected } = useComboboxItemContext();
|
|
13071
|
-
if (!(keepMounted || selected)) return null;
|
|
13072
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Inner$1, {
|
|
13073
|
-
...componentProps,
|
|
13074
|
-
ref: forwardedRef
|
|
13075
|
-
});
|
|
13076
|
-
});
|
|
13077
|
-
var Inner$1 = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef((componentProps, forwardedRef) => {
|
|
13078
|
-
const { render, className, style, keepMounted, ...elementProps } = componentProps;
|
|
13079
|
-
const { selected } = useComboboxItemContext();
|
|
13080
|
-
const indicatorRef = import_react.useRef(null);
|
|
13081
|
-
const { transitionStatus, setMounted } = useTransitionStatus(selected);
|
|
13082
|
-
const element = useRenderElement("span", componentProps, {
|
|
13083
|
-
ref: [forwardedRef, indicatorRef],
|
|
13084
|
-
state: {
|
|
13085
|
-
selected,
|
|
13086
|
-
transitionStatus
|
|
13087
|
-
},
|
|
13088
|
-
props: [{
|
|
13089
|
-
"aria-hidden": true,
|
|
13090
|
-
children: "✔️"
|
|
13091
|
-
}, elementProps],
|
|
13092
|
-
stateAttributesMapping: transitionStatusMapping
|
|
13093
|
-
});
|
|
13094
|
-
useOpenChangeComplete({
|
|
13095
|
-
open: selected,
|
|
13096
|
-
ref: indicatorRef,
|
|
13097
|
-
onComplete() {
|
|
13098
|
-
if (!selected) setMounted(false);
|
|
13099
|
-
}
|
|
13100
|
-
});
|
|
13101
|
-
return element;
|
|
13102
|
-
}));
|
|
13103
|
-
//#endregion
|
|
13104
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/csp-context/CSPContext.js
|
|
13105
|
-
/**
|
|
13106
|
-
* @internal
|
|
13107
|
-
*/
|
|
13108
|
-
var CSPContext = /* @__PURE__ */ import_react.createContext(void 0);
|
|
13109
|
-
var DEFAULT_CSP_CONTEXT_VALUE = { disableStyleElements: false };
|
|
13110
|
-
/**
|
|
13111
|
-
* @internal
|
|
13112
|
-
*/
|
|
13113
|
-
function useCSPContext() {
|
|
13114
|
-
return import_react.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
|
|
13115
|
-
}
|
|
13116
|
-
//#endregion
|
|
13117
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/clamp.js
|
|
13118
|
-
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
13119
|
-
return Math.max(min, Math.min(val, max));
|
|
13120
|
-
}
|
|
13121
|
-
//#endregion
|
|
13122
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/formatNumber.js
|
|
13123
|
-
var cache = /* @__PURE__ */ new Map();
|
|
13124
|
-
function getFormatter(locale, options) {
|
|
13125
|
-
const optionsString = JSON.stringify({
|
|
13126
|
-
locale,
|
|
13127
|
-
options
|
|
13128
|
-
});
|
|
13129
|
-
const cachedFormatter = cache.get(optionsString);
|
|
13130
|
-
if (cachedFormatter) return cachedFormatter;
|
|
13131
|
-
const formatter = new Intl.NumberFormat(locale, options);
|
|
13132
|
-
cache.set(optionsString, formatter);
|
|
13133
|
-
return formatter;
|
|
13134
|
-
}
|
|
13135
|
-
function formatNumber(value, locale, options) {
|
|
13136
|
-
if (value == null) return "";
|
|
13137
|
-
return getFormatter(locale, options).format(value);
|
|
13138
|
-
}
|
|
13139
|
-
//#endregion
|
|
13140
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/valueToPercent.js
|
|
13141
|
-
function valueToPercent(value, min, max) {
|
|
13142
|
-
return (value - min) * 100 / (max - min);
|
|
10825
|
+
function hasNullItemLabel(items) {
|
|
10826
|
+
if (!Array.isArray(items)) return items != null && "null" in items;
|
|
10827
|
+
const arrayItems = items;
|
|
10828
|
+
if (isGroupedItems(arrayItems)) {
|
|
10829
|
+
for (const group of arrayItems) for (const item of group.items) if (item && item.value == null && item.label != null) return true;
|
|
10830
|
+
return false;
|
|
10831
|
+
}
|
|
10832
|
+
for (const item of arrayItems) if (item && item.value == null && item.label != null) return true;
|
|
10833
|
+
return false;
|
|
13143
10834
|
}
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
getElement(nonce) {
|
|
13150
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
13151
|
-
nonce,
|
|
13152
|
-
href: DISABLE_SCROLLBAR_CLASS_NAME,
|
|
13153
|
-
precedence: "base-ui:low",
|
|
13154
|
-
children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`
|
|
13155
|
-
});
|
|
10835
|
+
function stringifyAsLabel(item, itemToStringLabel) {
|
|
10836
|
+
if (itemToStringLabel && item != null) return itemToStringLabel(item) ?? "";
|
|
10837
|
+
if (item && typeof item === "object") {
|
|
10838
|
+
if ("label" in item && item.label != null) return String(item.label);
|
|
10839
|
+
if ("value" in item) return String(item.value);
|
|
13156
10840
|
}
|
|
13157
|
-
|
|
13158
|
-
function getMaxScrollOffset(scrollSize, clientSize) {
|
|
13159
|
-
return Math.max(0, scrollSize - clientSize);
|
|
10841
|
+
return serializeValue(item);
|
|
13160
10842
|
}
|
|
13161
|
-
function
|
|
13162
|
-
if (
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
const endDistance = max - clamped;
|
|
13166
|
-
const withinStartTolerance = startDistance <= 1;
|
|
13167
|
-
const withinEndTolerance = endDistance <= 1;
|
|
13168
|
-
if (withinStartTolerance && withinEndTolerance) return startDistance <= endDistance ? 0 : max;
|
|
13169
|
-
if (withinStartTolerance) return 0;
|
|
13170
|
-
if (withinEndTolerance) return max;
|
|
13171
|
-
return clamped;
|
|
10843
|
+
function stringifyAsValue(item, itemToStringValue) {
|
|
10844
|
+
if (itemToStringValue && item != null) return itemToStringValue(item) ?? "";
|
|
10845
|
+
if (item && typeof item === "object" && "value" in item && "label" in item) return serializeValue(item.value);
|
|
10846
|
+
return serializeValue(item);
|
|
13172
10847
|
}
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
if (
|
|
13180
|
-
|
|
10848
|
+
function resolveSelectedLabel(value, items, itemToStringLabel) {
|
|
10849
|
+
function fallback() {
|
|
10850
|
+
return stringifyAsLabel(value, itemToStringLabel);
|
|
10851
|
+
}
|
|
10852
|
+
if (itemToStringLabel && value != null) return itemToStringLabel(value);
|
|
10853
|
+
if (value && typeof value === "object" && "label" in value && value.label != null) return value.label;
|
|
10854
|
+
if (items && !Array.isArray(items)) return items[value] ?? fallback();
|
|
10855
|
+
if (Array.isArray(items)) {
|
|
10856
|
+
const arrayItems = items;
|
|
10857
|
+
const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap((group) => group.items) : arrayItems;
|
|
10858
|
+
if (value == null || typeof value !== "object") {
|
|
10859
|
+
const match = flatItems.find((item) => item.value === value);
|
|
10860
|
+
if (match && match.label != null) return match.label;
|
|
10861
|
+
return fallback();
|
|
10862
|
+
}
|
|
10863
|
+
if ("value" in value) {
|
|
10864
|
+
const match = flatItems.find((item) => item && item.value === value.value);
|
|
10865
|
+
if (match && match.label != null) return match.label;
|
|
10866
|
+
}
|
|
10867
|
+
}
|
|
10868
|
+
return fallback();
|
|
13181
10869
|
}
|
|
13182
|
-
function
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
10870
|
+
function resolveMultipleLabels(values, items, itemToStringLabel) {
|
|
10871
|
+
return values.reduce((acc, value, index) => {
|
|
10872
|
+
if (index > 0) acc.push(", ");
|
|
10873
|
+
acc.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: resolveSelectedLabel(value, items, itemToStringLabel) }, index));
|
|
10874
|
+
return acc;
|
|
10875
|
+
}, []);
|
|
13186
10876
|
}
|
|
13187
10877
|
//#endregion
|
|
13188
10878
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/store.js
|
|
@@ -13234,6 +10924,38 @@ var selectors = {
|
|
|
13234
10924
|
hasScrollArrows: createSelector((state) => state.hasScrollArrows)
|
|
13235
10925
|
};
|
|
13236
10926
|
//#endregion
|
|
10927
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/form-context/FormContext.js
|
|
10928
|
+
var FormContext = /* @__PURE__ */ import_react.createContext({
|
|
10929
|
+
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
|
10930
|
+
errors: {},
|
|
10931
|
+
clearErrors: NOOP,
|
|
10932
|
+
validationMode: "onSubmit",
|
|
10933
|
+
submitAttemptedRef: { current: false }
|
|
10934
|
+
});
|
|
10935
|
+
function useFormContext() {
|
|
10936
|
+
return import_react.useContext(FormContext);
|
|
10937
|
+
}
|
|
10938
|
+
//#endregion
|
|
10939
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/clamp.js
|
|
10940
|
+
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
10941
|
+
return Math.max(min, Math.min(val, max));
|
|
10942
|
+
}
|
|
10943
|
+
function getMaxScrollOffset(scrollSize, clientSize) {
|
|
10944
|
+
return Math.max(0, scrollSize - clientSize);
|
|
10945
|
+
}
|
|
10946
|
+
function normalizeScrollOffset(value, max) {
|
|
10947
|
+
if (max <= 0) return 0;
|
|
10948
|
+
const clamped = clamp(value, 0, max);
|
|
10949
|
+
const startDistance = clamped;
|
|
10950
|
+
const endDistance = max - clamped;
|
|
10951
|
+
const withinStartTolerance = startDistance <= 1;
|
|
10952
|
+
const withinEndTolerance = endDistance <= 1;
|
|
10953
|
+
if (withinStartTolerance && withinEndTolerance) return startDistance <= endDistance ? 0 : max;
|
|
10954
|
+
if (withinStartTolerance) return 0;
|
|
10955
|
+
if (withinEndTolerance) return max;
|
|
10956
|
+
return clamped;
|
|
10957
|
+
}
|
|
10958
|
+
//#endregion
|
|
13237
10959
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/root/SelectRoot.js
|
|
13238
10960
|
/**
|
|
13239
10961
|
* Groups all parts of the select.
|
|
@@ -13636,6 +11358,37 @@ function SelectRoot(props) {
|
|
|
13636
11358
|
});
|
|
13637
11359
|
}
|
|
13638
11360
|
//#endregion
|
|
11361
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/resolveAriaLabelledBy.js
|
|
11362
|
+
function getDefaultLabelId(id) {
|
|
11363
|
+
return id == null ? void 0 : `${id}-label`;
|
|
11364
|
+
}
|
|
11365
|
+
function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
|
|
11366
|
+
return fieldLabelId ?? localLabelId;
|
|
11367
|
+
}
|
|
11368
|
+
//#endregion
|
|
11369
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/getPseudoElementBounds.js
|
|
11370
|
+
function getPseudoElementBounds(element) {
|
|
11371
|
+
const elementRect = element.getBoundingClientRect();
|
|
11372
|
+
const win = getWindow(element);
|
|
11373
|
+
const beforeStyles = win.getComputedStyle(element, "::before");
|
|
11374
|
+
const afterStyles = win.getComputedStyle(element, "::after");
|
|
11375
|
+
if (!(beforeStyles.content !== "none" || afterStyles.content !== "none")) return elementRect;
|
|
11376
|
+
const beforeWidth = parseFloat(beforeStyles.width) || 0;
|
|
11377
|
+
const beforeHeight = parseFloat(beforeStyles.height) || 0;
|
|
11378
|
+
const afterWidth = parseFloat(afterStyles.width) || 0;
|
|
11379
|
+
const afterHeight = parseFloat(afterStyles.height) || 0;
|
|
11380
|
+
const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);
|
|
11381
|
+
const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);
|
|
11382
|
+
const widthDiff = totalWidth - elementRect.width;
|
|
11383
|
+
const heightDiff = totalHeight - elementRect.height;
|
|
11384
|
+
return {
|
|
11385
|
+
left: elementRect.left - widthDiff / 2,
|
|
11386
|
+
right: elementRect.right + widthDiff / 2,
|
|
11387
|
+
top: elementRect.top - heightDiff / 2,
|
|
11388
|
+
bottom: elementRect.bottom + heightDiff / 2
|
|
11389
|
+
};
|
|
11390
|
+
}
|
|
11391
|
+
//#endregion
|
|
13639
11392
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/trigger/SelectTrigger.js
|
|
13640
11393
|
var BOUNDARY_OFFSET = 2;
|
|
13641
11394
|
var SELECTED_DELAY = 400;
|
|
@@ -13869,6 +11622,31 @@ var LIST_FUNCTIONAL_STYLES = {
|
|
|
13869
11622
|
overflowY: "auto"
|
|
13870
11623
|
};
|
|
13871
11624
|
//#endregion
|
|
11625
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/useAnchoredPopupScrollLock.js
|
|
11626
|
+
var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
|
|
11627
|
+
/**
|
|
11628
|
+
* Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when
|
|
11629
|
+
* enabled. For touch opens, scroll lock is applied only when the positioner width is effectively
|
|
11630
|
+
* viewport-sized.
|
|
11631
|
+
*/
|
|
11632
|
+
function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
|
|
11633
|
+
const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = import_react.useState(false);
|
|
11634
|
+
useIsoLayoutEffect(() => {
|
|
11635
|
+
if (!enabled || !touchOpen || positionerElement == null) {
|
|
11636
|
+
setTouchOpenShouldLockScroll(false);
|
|
11637
|
+
return;
|
|
11638
|
+
}
|
|
11639
|
+
const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;
|
|
11640
|
+
const popupWidth = positionerElement.offsetWidth;
|
|
11641
|
+
setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);
|
|
11642
|
+
}, [
|
|
11643
|
+
enabled,
|
|
11644
|
+
touchOpen,
|
|
11645
|
+
positionerElement
|
|
11646
|
+
]);
|
|
11647
|
+
useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
|
|
11648
|
+
}
|
|
11649
|
+
//#endregion
|
|
13872
11650
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/positioner/SelectPositioner.js
|
|
13873
11651
|
var FIXED = { position: "fixed" };
|
|
13874
11652
|
/**
|
|
@@ -14008,6 +11786,33 @@ var SelectPositioner = /* @__PURE__ */ import_react.forwardRef(function SelectPo
|
|
|
14008
11786
|
});
|
|
14009
11787
|
});
|
|
14010
11788
|
//#endregion
|
|
11789
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/styles.js
|
|
11790
|
+
var DISABLE_SCROLLBAR_CLASS_NAME = "base-ui-disable-scrollbar";
|
|
11791
|
+
var styleDisableScrollbar = {
|
|
11792
|
+
className: DISABLE_SCROLLBAR_CLASS_NAME,
|
|
11793
|
+
getElement(nonce) {
|
|
11794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
11795
|
+
nonce,
|
|
11796
|
+
href: DISABLE_SCROLLBAR_CLASS_NAME,
|
|
11797
|
+
precedence: "base-ui:low",
|
|
11798
|
+
children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`
|
|
11799
|
+
});
|
|
11800
|
+
}
|
|
11801
|
+
};
|
|
11802
|
+
//#endregion
|
|
11803
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/csp-context/CSPContext.js
|
|
11804
|
+
/**
|
|
11805
|
+
* @internal
|
|
11806
|
+
*/
|
|
11807
|
+
var CSPContext = /* @__PURE__ */ import_react.createContext(void 0);
|
|
11808
|
+
var DEFAULT_CSP_CONTEXT_VALUE = { disableStyleElements: false };
|
|
11809
|
+
/**
|
|
11810
|
+
* @internal
|
|
11811
|
+
*/
|
|
11812
|
+
function useCSPContext() {
|
|
11813
|
+
return import_react.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
|
|
11814
|
+
}
|
|
11815
|
+
//#endregion
|
|
14011
11816
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/popup/SelectPopup.js
|
|
14012
11817
|
var stateAttributesMapping$1 = {
|
|
14013
11818
|
...popupStateMapping,
|
|
@@ -14789,6 +12594,11 @@ var SelectGroup = /* @__PURE__ */ import_react.forwardRef(function SelectGroup(c
|
|
|
14789
12594
|
});
|
|
14790
12595
|
});
|
|
14791
12596
|
//#endregion
|
|
12597
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/areArraysEqual.js
|
|
12598
|
+
function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
|
|
12599
|
+
return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));
|
|
12600
|
+
}
|
|
12601
|
+
//#endregion
|
|
14792
12602
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/slider/utils/asc.js
|
|
14793
12603
|
function asc(a, b) {
|
|
14794
12604
|
return a - b;
|
|
@@ -15077,6 +12887,24 @@ var SliderRoot = /* @__PURE__ */ import_react.forwardRef(function SliderRoot(com
|
|
|
15077
12887
|
});
|
|
15078
12888
|
});
|
|
15079
12889
|
//#endregion
|
|
12890
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/formatNumber.js
|
|
12891
|
+
var cache = /* @__PURE__ */ new Map();
|
|
12892
|
+
function getFormatter(locale, options) {
|
|
12893
|
+
const optionsString = JSON.stringify({
|
|
12894
|
+
locale,
|
|
12895
|
+
options
|
|
12896
|
+
});
|
|
12897
|
+
const cachedFormatter = cache.get(optionsString);
|
|
12898
|
+
if (cachedFormatter) return cachedFormatter;
|
|
12899
|
+
const formatter = new Intl.NumberFormat(locale, options);
|
|
12900
|
+
cache.set(optionsString, formatter);
|
|
12901
|
+
return formatter;
|
|
12902
|
+
}
|
|
12903
|
+
function formatNumber(value, locale, options) {
|
|
12904
|
+
if (value == null) return "";
|
|
12905
|
+
return getFormatter(locale, options).format(value);
|
|
12906
|
+
}
|
|
12907
|
+
//#endregion
|
|
15080
12908
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/slider/utils/getMidpoint.js
|
|
15081
12909
|
function getMidpoint(element) {
|
|
15082
12910
|
const rect = element.getBoundingClientRect();
|
|
@@ -15529,6 +13357,11 @@ function useIsHydrating() {
|
|
|
15529
13357
|
return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
|
|
15530
13358
|
}
|
|
15531
13359
|
//#endregion
|
|
13360
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/utils/valueToPercent.js
|
|
13361
|
+
function valueToPercent(value, min, max) {
|
|
13362
|
+
return (value - min) * 100 / (max - min);
|
|
13363
|
+
}
|
|
13364
|
+
//#endregion
|
|
15532
13365
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/slider/thumb/SliderThumbDataAttributes.js
|
|
15533
13366
|
var SliderThumbDataAttributes = /* @__PURE__ */ function(SliderThumbDataAttributes) {
|
|
15534
13367
|
/**
|
|
@@ -15953,6 +13786,39 @@ var stateAttributesMapping = {
|
|
|
15953
13786
|
}
|
|
15954
13787
|
};
|
|
15955
13788
|
//#endregion
|
|
13789
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/labelable-provider/useAriaLabelledBy.js
|
|
13790
|
+
/**
|
|
13791
|
+
* @internal
|
|
13792
|
+
*/
|
|
13793
|
+
function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
|
|
13794
|
+
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = import_react.useState();
|
|
13795
|
+
const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
|
|
13796
|
+
const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;
|
|
13797
|
+
useIsoLayoutEffect(() => {
|
|
13798
|
+
const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
|
|
13799
|
+
if (fallbackAriaLabelledBy !== nextAriaLabelledBy) setFallbackAriaLabelledBy(nextAriaLabelledBy);
|
|
13800
|
+
});
|
|
13801
|
+
return ariaLabelledBy;
|
|
13802
|
+
}
|
|
13803
|
+
function getAriaLabelledBy(labelSource, generatedLabelId) {
|
|
13804
|
+
const label = findAssociatedLabel(labelSource);
|
|
13805
|
+
if (!label) return;
|
|
13806
|
+
if (!label.id && generatedLabelId) label.id = generatedLabelId;
|
|
13807
|
+
return label.id || void 0;
|
|
13808
|
+
}
|
|
13809
|
+
function findAssociatedLabel(labelSource) {
|
|
13810
|
+
if (!labelSource) return;
|
|
13811
|
+
const parent = labelSource.parentElement;
|
|
13812
|
+
if (parent && parent.tagName === "LABEL") return parent;
|
|
13813
|
+
const controlId = labelSource.id;
|
|
13814
|
+
if (controlId) {
|
|
13815
|
+
const nextSibling = labelSource.nextElementSibling;
|
|
13816
|
+
if (nextSibling && nextSibling.htmlFor === controlId) return nextSibling;
|
|
13817
|
+
}
|
|
13818
|
+
const labels = labelSource.labels;
|
|
13819
|
+
return labels && labels[0];
|
|
13820
|
+
}
|
|
13821
|
+
//#endregion
|
|
15956
13822
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/switch/root/SwitchRoot.js
|
|
15957
13823
|
/**
|
|
15958
13824
|
* Represents the switch itself.
|
|
@@ -16121,4 +13987,4 @@ var SwitchThumb = /* @__PURE__ */ import_react.forwardRef(function SwitchThumb(c
|
|
|
16121
13987
|
});
|
|
16122
13988
|
});
|
|
16123
13989
|
//#endregion
|
|
16124
|
-
export {
|
|
13990
|
+
export { DialogDescription as A, TooltipRoot as B, Toggle as C, DialogTitle as D, DialogTrigger as E, TooltipArrow as F, useRender as G, require_react_dom as H, TooltipPopup as I, require_react as J, mergeProps as K, TooltipPositioner as L, DialogBackdrop as M, AlertDialogRoot as N, DialogPortal as O, TooltipProvider as P, TooltipPortal as R, ToggleGroup as S, AlertDialogTrigger as T, Separator as U, require_with_selector as V, Button as W, SelectPortal as _, SliderTrack as a, SelectTrigger as b, SelectGroup as c, SelectItemText as d, SelectItemIndicator as f, SelectPositioner as g, SelectPopup as h, SliderThumb as i, DialogClose as j, DialogPopup as k, SelectScrollUpArrow as l, SelectList as m, SwitchRoot as n, SliderControl as o, SelectItem as p, require_jsx_runtime as q, SliderIndicator as r, SliderRoot as s, SwitchThumb as t, SelectScrollDownArrow as u, SelectIcon as v, DialogRoot as w, SelectRoot as x, SelectValue as y, TooltipTrigger as z };
|