@slotted/react 0.1.0-beta.2 → 0.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accordion-D-YuMJzk.js → accordion-lCqrmQ3w.js} +43 -43
- package/dist/accordion.js +1 -1
- package/dist/{action-bar-C7cGnEyJ.js → action-bar-OACchRZw.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{action-sheet-DgwzC3iY.js → action-sheet-C60BWUW8.js} +1 -1
- package/dist/action-sheet.js +1 -1
- package/dist/{app-shell-CXwma4XA.js → app-shell-CmYvnu_7.js} +310 -310
- package/dist/app-shell.js +1 -1
- package/dist/button-Db9f3Bxn.js +99 -0
- package/dist/button.js +2 -2
- package/dist/calendar-BZ6PP7Ke.js +436 -0
- package/dist/calendar.js +1 -1
- package/dist/cascader-D1AhTyBL.js +1097 -0
- package/dist/cascader.js +1 -1
- package/dist/{chart-Gb_P3Kdq.js → chart-O0ZhkzJe.js} +381 -374
- package/dist/chart.js +1 -1
- package/dist/{checkbox-CwUOc-3u.js → checkbox-DfxFHZaU.js} +3 -3
- package/dist/{checkbox-group-BYTjgAcX.js → checkbox-group-9sDgrV5Z.js} +2 -2
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{collapsible-CGo49NNW.js → collapsible-F-K36XbF.js} +17 -17
- package/dist/collapsible.js +1 -1
- package/dist/{color-picker-BlPR4g4H.js → color-picker-CwbWzCKg.js} +4 -4
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-B7_a_jDK.js → column-manager-CTtizVhm.js} +6 -6
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-C66dNlMR.js → combobox-BVMI9lg8.js} +266 -266
- package/dist/combobox.js +1 -1
- package/dist/{command-palette-BqRyNR9Y.js → command-palette-DFLbSOiv.js} +1 -1
- package/dist/command-palette.js +1 -1
- package/dist/{context-menu-DMiHdggw.js → context-menu-BuST6W94.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/currency-field-DD9A5U3D.js +455 -0
- package/dist/currency-field.js +1 -1
- package/dist/{dashboard-grid-CKdyO4j6.js → dashboard-grid-CBMP_-JV.js} +2 -2
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-rWMDNl-6.js → data-grid-Eb-a4jg3.js} +19 -19
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-2xfDpHVC.js → data-list-oICmxGkA.js} +5 -5
- package/dist/data-list.js +1 -1
- package/dist/date-field-Hr-OCU-H.js +290 -0
- package/dist/date-field.js +1 -1
- package/dist/date-picker-D3-y2Jxw.js +295 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-y3b82Wmf.js +471 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-field-T1gNdJ7t.js → datetime-field-B8TrmsDK.js} +1 -1
- package/dist/datetime-field.js +1 -1
- package/dist/datetime-picker-CIRHVLQp.js +629 -0
- package/dist/datetime-picker.js +1 -1
- package/dist/datetime-range-picker-DM-1m98z.js +994 -0
- package/dist/datetime-range-picker.js +1 -1
- package/dist/{detail-panel-qOJiNuzr.js → detail-panel-CW53lUjp.js} +3 -3
- package/dist/detail-panel.js +1 -1
- package/dist/{dialog-Dmy-m_pe.js → dialog-BHYDDj1S.js} +112 -113
- package/dist/dialog.js +1 -1
- package/dist/docs/app-shell.json +1 -1
- package/dist/docs/button-group.json +1 -0
- package/dist/docs/button-group.md +1 -1
- package/dist/docs/button.json +45 -11
- package/dist/docs/button.md +10 -6
- package/dist/docs/calendar.json +7 -0
- package/dist/docs/calendar.md +1 -0
- package/dist/docs/chart.json +7 -0
- package/dist/docs/chart.md +1 -0
- package/dist/docs/collapsible.json +1 -1
- package/dist/docs/collapsible.md +1 -1
- package/dist/docs/currency-field.json +32 -1
- package/dist/docs/currency-field.md +4 -1
- package/dist/docs/date-field.json +8 -1
- package/dist/docs/date-field.md +2 -1
- package/dist/docs/date-picker.examples.md +29 -0
- package/dist/docs/date-picker.json +16 -1
- package/dist/docs/date-picker.md +2 -1
- package/dist/docs/dialog.examples.md +26 -0
- package/dist/docs/dialog.json +14 -2
- package/dist/docs/dialog.md +1 -1
- package/dist/docs/guidelines/composition.md +10 -0
- package/dist/docs/guidelines/index.md +2 -0
- package/dist/docs/guidelines/list-pages.md +12 -1
- package/dist/docs/list.json +26 -1
- package/dist/docs/list.md +4 -1
- package/dist/docs/page.json +1 -0
- package/dist/docs/page.md +1 -0
- package/dist/docs/popover.json +1 -1
- package/dist/docs/segmented-control.json +29 -1
- package/dist/docs/segmented-control.md +17 -1
- package/dist/docs/select.json +1 -1
- package/dist/docs/select.md +1 -1
- package/dist/docs/side-navigation.json +2 -2
- package/dist/docs/side-navigation.md +19 -4
- package/dist/docs/skills/compose-screen/SKILL.md +7 -0
- package/dist/docs/skills/theme-app/SKILL.md +5 -0
- package/dist/docs/split-button.json +1 -0
- package/dist/docs/split-button.md +1 -1
- package/dist/docs/stat-card.json +1 -0
- package/dist/docs/stat-card.md +1 -1
- package/dist/docs/table.examples.md +1 -1
- package/dist/docs/table.json +91 -2
- package/dist/docs/table.md +14 -1
- package/dist/docs/tabs.examples.md +1 -1
- package/dist/docs/tabs.json +10 -2
- package/dist/docs/tabs.md +3 -1
- package/dist/docs/text-field.json +1 -1
- package/dist/docs/text-field.md +1 -1
- package/dist/docs/toggle-group.json +14 -3
- package/dist/docs/toggle-group.md +3 -3
- package/dist/docs/toggle.json +12 -3
- package/dist/docs/toggle.md +3 -3
- package/dist/docs/tokens.md +25 -1
- package/dist/docs/top-navigation.examples.md +23 -5
- package/dist/docs/top-navigation.json +2 -2
- package/dist/docs/tour.json +1 -1
- package/dist/drawer-LXM44eso.js +757 -0
- package/dist/drawer.js +1 -1
- package/dist/entity-picker-Dn1T7JCq.js +1110 -0
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-DYjVwTI6.js → event-calendar-CnF3iIZD.js} +5 -5
- package/dist/event-calendar.js +1 -1
- package/dist/{field-BJh5HI7w.js → field-NJaCxl2h.js} +1 -1
- package/dist/{field-group-BDaspQPh.js → field-group-hAzVa2O9.js} +1 -1
- package/dist/field-group.js +1 -1
- package/dist/field.js +1 -1
- package/dist/{filter-bar-Bh7cbqDE.js → filter-bar-CHyy1o--.js} +20 -20
- package/dist/filter-bar.js +1 -1
- package/dist/{hover-card-CSDbA6zd.js → hover-card-BJE5dtaQ.js} +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/{icon-button-TnvMhK4o.js → icon-button-CCWkCDMs.js} +26 -24
- package/dist/import-export-center-jF37b909.js +813 -0
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +92 -91
- package/dist/{list-C1Y8MWp2.js → list-WsQ6ZzCa.js} +16 -12
- package/dist/{list-item-DN_mcouU.js → list-item-DpCwZIrd.js} +1 -1
- package/dist/list-item.js +1 -1
- package/dist/list.js +1 -1
- package/dist/{listbox-4WvqR0JF.js → listbox-Dv856z9I.js} +1 -1
- package/dist/listbox.js +1 -1
- package/dist/{loading-overlay-B83XFctM.js → loading-overlay-COfnckse.js} +73 -73
- package/dist/loading-overlay.js +1 -1
- package/dist/{markdown-CpfDn1LF.js → markdown-CeG8mUbI.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/menu-parts-W58pVNUt.js +786 -0
- package/dist/menu.js +1 -1
- package/dist/{menubar-CtGavUTO.js → menubar-b2CruimJ.js} +1 -1
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-B-tuIwAu.js → multi-select-DQ5ds0fX.js} +390 -390
- package/dist/multi-select.js +1 -1
- package/dist/{notification-center-C4pEHJ3h.js → notification-center-C1iWWl5Y.js} +3 -3
- package/dist/notification-center.js +1 -1
- package/dist/{number-field-J_koud1r.js → number-field-BFIAmv-z.js} +1 -1
- package/dist/number-field.js +1 -1
- package/dist/{otp-input-Bf8JUiVR.js → otp-input-BNQhuKaT.js} +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/{page-kQgLctsA.js → page-IiYXk1sz.js} +32 -32
- package/dist/{page-header-CWEBfMGq.js → page-header-Bn4nIGfF.js} +1 -1
- package/dist/page-header.js +1 -1
- package/dist/page.js +1 -1
- package/dist/popover-Be7JWbGJ.js +475 -0
- package/dist/popover.js +1 -1
- package/dist/press-selection-DjOllE2B.js +29 -0
- package/dist/press-selection.js +2 -0
- package/dist/{prompt-composer-B7MMcER0.js → prompt-composer-BxpdkTpZ.js} +1 -1
- package/dist/prompt-composer.js +1 -1
- package/dist/{radio-group-BFpjhDkV.js → radio-group-BaVIP9UH.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{rating-D1EsADFM.js → rating-DYBQBzwB.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{saved-views-BueW-Lyb.js → saved-views-DlE_--Z9.js} +5 -5
- package/dist/saved-views.js +1 -1
- package/dist/{segmented-control-Cy_5D3Nj.js → segmented-control-DmuOGiu6.js} +28 -24
- package/dist/segmented-control.js +1 -1
- package/dist/{select-hRFp8nCj.js → select-M7Io4UL9.js} +278 -265
- package/dist/select.js +1 -1
- package/dist/{side-navigation-YUiJRpng.js → side-navigation-CBLtCzuJ.js} +186 -187
- package/dist/side-navigation.js +1 -1
- package/dist/{slider-B432T6nD.js → slider-DTes4HLF.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{split-button-DHF3v3PJ.js → split-button-CPgHiy9G.js} +2 -2
- package/dist/split-button.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{switch-4MHwKmkz.js → switch-DQzuIhPX.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-Bd79IwDC.js → table-U9eJYCuB.js} +327 -292
- package/dist/table.js +2 -2
- package/dist/tabs-BtHmjlnM.js +348 -0
- package/dist/tabs.js +1 -1
- package/dist/{tags-input-DLdHLWrH.js → tags-input-CcOkm0AW.js} +1 -1
- package/dist/tags-input.js +1 -1
- package/dist/{text-field-BktZbmzD.js → text-field-DLfIZ0fk.js} +1 -1
- package/dist/text-field.js +1 -1
- package/dist/{textarea-JAK2RJl0.js → textarea-CBJBJBi6.js} +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-field-DCG_VtGO.js → time-field-DrhiCtUl.js} +1 -1
- package/dist/time-field.js +1 -1
- package/dist/{time-picker-DuT1tf5-.js → time-picker-CRQsMJbQ.js} +102 -102
- package/dist/time-picker.js +1 -1
- package/dist/{time-range-picker-HwBvrrXN.js → time-range-picker-DlZJsj1e.js} +202 -202
- package/dist/time-range-picker.js +1 -1
- package/dist/{toast-wI8BtPY5.js → toast-Bf3e0AgC.js} +157 -157
- package/dist/toast.js +1 -1
- package/dist/toggle-group-7iBR9Rn1.js +142 -0
- package/dist/toggle-group.js +1 -1
- package/dist/{toolbar-CDQTydDx.js → toolbar-DDZpEftQ.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/{tooltip-BggqPDcW.js → tooltip-DbKTPe_i.js} +108 -109
- package/dist/tooltip.js +1 -1
- package/dist/{top-navigation-COQZsNqW.js → top-navigation-e-tWMGNr.js} +255 -256
- package/dist/top-navigation.js +1 -1
- package/dist/{tour-C11DmYTC.js → tour-BTdt716T.js} +180 -180
- package/dist/tour.js +1 -1
- package/dist/{transfer-JA9TWjAw.js → transfer-CqZOTLMP.js} +6 -6
- package/dist/transfer.js +1 -1
- package/dist/types/accordion/accordion.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell.d.ts.map +1 -1
- package/dist/types/button/button-link.d.ts +1 -1
- package/dist/types/button/button-link.d.ts.map +1 -1
- package/dist/types/button/button-root.d.ts +5 -3
- package/dist/types/button/button-root.d.ts.map +1 -1
- package/dist/types/button/button.constants.d.ts +2 -1
- package/dist/types/button/button.constants.d.ts.map +1 -1
- package/dist/types/button/button.d.ts +1 -1
- package/dist/types/button/button.d.ts.map +1 -1
- package/dist/types/button/button.types.d.ts +9 -2
- package/dist/types/button/button.types.d.ts.map +1 -1
- package/dist/types/button/index.d.ts +1 -1
- package/dist/types/button/index.d.ts.map +1 -1
- package/dist/types/button/toggle-button.d.ts +1 -1
- package/dist/types/button/toggle-button.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts +1 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/calendar.types.d.ts +9 -0
- package/dist/types/calendar/calendar.types.d.ts.map +1 -1
- package/dist/types/calendar/index.d.ts +1 -1
- package/dist/types/calendar/index.d.ts.map +1 -1
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/collapsible/collapsible-parts.d.ts.map +1 -1
- package/dist/types/currency-field/currency-field.d.ts +1 -1
- package/dist/types/currency-field/currency-field.d.ts.map +1 -1
- package/dist/types/currency-field/currency-field.types.d.ts +14 -0
- package/dist/types/currency-field/currency-field.types.d.ts.map +1 -1
- package/dist/types/currency-field/index.d.ts +1 -1
- package/dist/types/currency-field/index.d.ts.map +1 -1
- package/dist/types/date-field/date-field.d.ts +1 -1
- package/dist/types/date-field/date-field.d.ts.map +1 -1
- package/dist/types/date-field/date-field.types.d.ts +7 -0
- package/dist/types/date-field/date-field.types.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.d.ts +5 -1
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.types.d.ts +20 -2
- package/dist/types/date-picker/date-picker.types.d.ts.map +1 -1
- package/dist/types/date-picker/index.d.ts +1 -1
- package/dist/types/date-picker/index.d.ts.map +1 -1
- package/dist/types/dialog/dialog-demo.d.ts +8 -0
- package/dist/types/dialog/dialog-demo.d.ts.map +1 -1
- package/dist/types/filter-bar/filter-bar.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/list/index.d.ts +1 -1
- package/dist/types/list/index.d.ts.map +1 -1
- package/dist/types/list/list-parts.d.ts +1 -1
- package/dist/types/list/list-parts.d.ts.map +1 -1
- package/dist/types/list/list.types.d.ts +12 -0
- package/dist/types/list/list.types.d.ts.map +1 -1
- package/dist/types/page/page.d.ts.map +1 -1
- package/dist/types/press-selection/index.d.ts +3 -0
- package/dist/types/press-selection/index.d.ts.map +1 -0
- package/dist/types/press-selection/press-selection.d.ts +23 -0
- package/dist/types/press-selection/press-selection.d.ts.map +1 -0
- package/dist/types/segmented-control/index.d.ts +1 -1
- package/dist/types/segmented-control/index.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control-defaults.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control.d.ts +1 -1
- package/dist/types/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control.types.d.ts +10 -0
- package/dist/types/segmented-control/segmented-control.types.d.ts.map +1 -1
- package/dist/types/select/select-items.d.ts.map +1 -1
- package/dist/types/select/select-parts.d.ts.map +1 -1
- package/dist/types/select/select.d.ts.map +1 -1
- package/dist/types/table/index.d.ts +2 -2
- package/dist/types/table/index.d.ts.map +1 -1
- package/dist/types/table/table-defaults.d.ts.map +1 -1
- package/dist/types/table/table-parts.d.ts +8 -2
- package/dist/types/table/table-parts.d.ts.map +1 -1
- package/dist/types/table/table.d.ts +1 -1
- package/dist/types/table/table.d.ts.map +1 -1
- package/dist/types/table/table.types.d.ts +43 -1
- package/dist/types/table/table.types.d.ts.map +1 -1
- package/dist/types/tabs/tabs-parts.d.ts.map +1 -1
- package/dist/types/tabs/tabs.d.ts +1 -1
- package/dist/types/tabs/tabs.d.ts.map +1 -1
- package/dist/types/tabs/tabs.types.d.ts +18 -0
- package/dist/types/tabs/tabs.types.d.ts.map +1 -1
- package/dist/types/toggle/toggle.types.d.ts +1 -1
- package/dist/types/toggle/toggle.types.d.ts.map +1 -1
- package/dist/types/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/types/toggle-group/toggle-group.types.d.ts +6 -1
- package/dist/types/toggle-group/toggle-group.types.d.ts.map +1 -1
- package/dist/{upload-Bq_UiyMr.js → upload-DjnlVR8y.js} +2 -2
- package/dist/upload.js +1 -1
- package/dist/{wizard-B4GrlEqh.js → wizard-BxA08vXt.js} +1 -1
- package/dist/wizard.js +1 -1
- package/package.json +12 -7
- package/dist/button-DakQ-7Tm.js +0 -97
- package/dist/calendar-B3mio8iQ.js +0 -387
- package/dist/cascader-CARCYdHh.js +0 -1097
- package/dist/currency-field-B7OZ0hk7.js +0 -436
- package/dist/date-field-D_kLLTfL.js +0 -279
- package/dist/date-picker-DQ5SIhdA.js +0 -264
- package/dist/date-range-picker-lpB08hK_.js +0 -471
- package/dist/datetime-picker-0F0kDW-8.js +0 -629
- package/dist/datetime-range-picker-ClnEleth.js +0 -994
- package/dist/drawer-Dtospdqk.js +0 -758
- package/dist/entity-picker-Dm-y0RNE.js +0 -1111
- package/dist/import-export-center-CkZ_Ar9w.js +0 -813
- package/dist/menu-parts-BQej6eU9.js +0 -787
- package/dist/popover-DE22lSpV.js +0 -476
- package/dist/react-dom-DzrKNxo6.js +0 -273
- package/dist/tabs-DQ36APY-.js +0 -343
- package/dist/toggle-group-DQBlI1TV.js +0 -140
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as o } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { createContext as u, useCallback as d, useContext as f, useEffect as p, useId as m, useImperativeHandle as ee, useLayoutEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
1
|
+
import { n as e, t } from "./icon-T9Yt4tnm.js";
|
|
2
|
+
import { n, r } from "./i18n-DpW8lqJ1.js";
|
|
3
|
+
import { b as i } from "./field-NJaCxl2h.js";
|
|
4
|
+
import { t as a } from "./select-tags-CQMcHIQN.js";
|
|
5
|
+
import { t as o } from "./highlight-0Qw23QPp.js";
|
|
6
|
+
import { tabbables as s } from "@slotted/core/focus";
|
|
7
|
+
import { createControllable as c } from "@slotted/core/state";
|
|
8
|
+
import { createContext as l, useCallback as u, useContext as d, useEffect as f, useId as p, useImperativeHandle as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
10
9
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
-
import { createPresence as
|
|
12
|
-
import { createPortalRoot as
|
|
10
|
+
import { createPresence as S } from "@slotted/core/presence";
|
|
11
|
+
import { createPortalRoot as ee, setPortalContainer as C } from "@slotted/core/portal";
|
|
13
12
|
import { createDismissableLayer as w } from "@slotted/core/dismissable-layer";
|
|
14
13
|
import { createPositioner as T } from "@slotted/core/positioner";
|
|
15
|
-
import { createTypeahead as
|
|
14
|
+
import { createTypeahead as te, isPrintable as E } from "@slotted/core/typeahead";
|
|
15
|
+
import { createPortal as D } from "react-dom";
|
|
16
16
|
import { selectMessages as O } from "@slotted/core/i18n";
|
|
17
|
-
import { createFilter as
|
|
18
|
-
import { matchRanges as
|
|
17
|
+
import { createFilter as ne, moveIndex as k, revealWithin as A } from "@slotted/core/collection";
|
|
18
|
+
import { matchRanges as j } from "@slotted/core/highlight";
|
|
19
19
|
//#region src/select/select-defaults.tsx
|
|
20
|
-
var
|
|
20
|
+
var M = {
|
|
21
21
|
align: "start",
|
|
22
22
|
alignOffset: 0,
|
|
23
23
|
clearable: !1,
|
|
@@ -48,13 +48,13 @@ var N = {
|
|
|
48
48
|
typeaheadTimeout: 500,
|
|
49
49
|
variant: "outline",
|
|
50
50
|
width: "content"
|
|
51
|
-
},
|
|
52
|
-
function
|
|
53
|
-
return
|
|
51
|
+
}, N = l(M);
|
|
52
|
+
function P() {
|
|
53
|
+
return d(N);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
let r =
|
|
57
|
-
|
|
55
|
+
function F({ children: e, container: t, ...n }) {
|
|
56
|
+
let r = P();
|
|
57
|
+
f(() => {
|
|
58
58
|
if (t !== void 0) return C(t), () => C(null);
|
|
59
59
|
}, [t]);
|
|
60
60
|
let i = {
|
|
@@ -89,43 +89,43 @@ function I({ children: e, container: t, ...n }) {
|
|
|
89
89
|
variant: n.variant ?? r.variant,
|
|
90
90
|
width: n.width ?? r.width
|
|
91
91
|
};
|
|
92
|
-
return /* @__PURE__ */ b(
|
|
92
|
+
return /* @__PURE__ */ b(N.Provider, {
|
|
93
93
|
value: i,
|
|
94
94
|
children: e
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/select/select.tsx
|
|
99
|
-
var
|
|
100
|
-
function
|
|
101
|
-
let e =
|
|
99
|
+
var I = l(void 0);
|
|
100
|
+
function L() {
|
|
101
|
+
let e = d(I);
|
|
102
102
|
if (e === void 0) throw Error("SelectTrigger, SelectContent and every option have to be inside a Select.");
|
|
103
103
|
return e;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function re(e) {
|
|
106
106
|
return e == null ? [] : typeof e == "string" ? [e] : e;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function ie(e, t) {
|
|
109
109
|
return t ? e : e[0] ?? null;
|
|
110
110
|
}
|
|
111
|
-
var
|
|
112
|
-
function
|
|
113
|
-
return e === void 0 ? [] : e.flatMap((e) =>
|
|
111
|
+
var ae = (e) => "options" in e;
|
|
112
|
+
function oe(e) {
|
|
113
|
+
return e === void 0 ? [] : e.flatMap((e) => ae(e) ? e.options : [e]);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
let q =
|
|
115
|
+
function se({ align: e, alignOffset: t, children: a, clearable: o, closeOnEscape: s, closeOnOutsidePress: l, closeOnSelect: d, collisionPadding: f, defaultHighlightedValue: h = null, defaultOpen: y = !1, defaultSearchValue: x = "", defaultValue: S, disabled: ee, filter: C, flip: w, form: T, fullWidth: te, hideWhenDetached: E, highlightedValue: D, highlightMatch: k, invalid: j, items: M, loading: N, locale: F, loop: L, messages: ae, mount: se, multiple: R, name: z, onHighlightedValueChange: B, onOpenChange: V, onSearchValueChange: H, onValueChange: U, open: W, portal: ce, readOnly: le, ref: G, required: ue, search: de, searchValue: K, shift: fe, side: pe, sideOffset: me, size: he, strategy: ge, total: _e, typeahead: ve, typeaheadTimeout: ye, value: be, variant: xe, width: Se }) {
|
|
116
|
+
let q = P(), J = i(), Ce = r(O, ae), we = n(), Te = F ?? we, Y = p(), Ee = `${Y}listbox`, De = `${Y}list`, Oe = `${Y}search`, ke = J?.ids.control ?? `${Y}trigger`, [Ae, je] = v(y), [Me] = v(() => re(S)), [Ne, Pe] = v(Me), [Fe, Ie] = v(h), [Le, Re] = v(x), [ze, Be] = v(null), [X, Ve] = v(null), [He, Ue] = v(null), We = R ?? q.multiple, Ge = ee ?? J?.disabled ?? q.disabled, Ke = le ?? J?.readOnly ?? q.readOnly, qe = (W ?? Ae) && !Ge, Je = be === void 0 ? Ne : re(be), Ye = D === void 0 ? Fe : D, Xe = de ?? q.search, Z = Xe ? K === void 0 ? Le : K : "", Ze = _(qe);
|
|
117
117
|
qe && (Ze.current = !0);
|
|
118
118
|
let Qe = _("selected"), $e = _(/* @__PURE__ */ new Map()), [et, tt] = v(0), nt = g(() => {
|
|
119
119
|
let e = /* @__PURE__ */ new Map();
|
|
120
|
-
for (let t of
|
|
120
|
+
for (let t of oe(M)) e.set(t.value, t.label);
|
|
121
121
|
return e;
|
|
122
|
-
}, [
|
|
122
|
+
}, [M]), rt = u((e, t) => {
|
|
123
123
|
$e.current.get(e) !== t && ($e.current.set(e, t), tt((e) => e + 1));
|
|
124
|
-
}, []), it =
|
|
124
|
+
}, []), it = u((e) => nt.get(e) ?? $e.current.get(e), [nt, et]), at = g(() => ne({ locale: Te }), [Te]), ot = u((e) => Z === "" || C === null ? !0 : C === void 0 ? at.contains(e, Z) : C(e, Z), [
|
|
125
125
|
Z,
|
|
126
126
|
at,
|
|
127
|
-
|
|
128
|
-
]), st =
|
|
127
|
+
C
|
|
128
|
+
]), st = u((e) => `${Y}option-${encodeURIComponent(e)}`, [Y]), ct = {
|
|
129
129
|
currentHighlighted: Ye,
|
|
130
130
|
currentOpen: qe,
|
|
131
131
|
currentQuery: Z,
|
|
@@ -134,8 +134,8 @@ function z({ align: e, alignOffset: t, children: n, clearable: o, closeOnEscape:
|
|
|
134
134
|
onHighlightedValueChange: B,
|
|
135
135
|
onOpenChange: V,
|
|
136
136
|
onSearchValueChange: H,
|
|
137
|
-
onValueChange:
|
|
138
|
-
open:
|
|
137
|
+
onValueChange: U,
|
|
138
|
+
open: W,
|
|
139
139
|
resolvedMultiple: We,
|
|
140
140
|
resolvedSearch: Xe,
|
|
141
141
|
searchNode: He,
|
|
@@ -144,36 +144,36 @@ function z({ align: e, alignOffset: t, children: n, clearable: o, closeOnEscape:
|
|
|
144
144
|
value: be
|
|
145
145
|
}, Q = _(ct);
|
|
146
146
|
Q.current = ct;
|
|
147
|
-
let lt =
|
|
147
|
+
let lt = u((e, t, n) => {
|
|
148
148
|
let r = Q.current;
|
|
149
|
-
e !== r.currentQuery &&
|
|
149
|
+
e !== r.currentQuery && c({
|
|
150
150
|
controlled: r.searchValue,
|
|
151
151
|
initial: r.currentQuery,
|
|
152
152
|
onRequest: (e) => r.onSearchValueChange?.(e.value, e)
|
|
153
153
|
}).request(e, t, n) && Re(e);
|
|
154
|
-
}, []), ut =
|
|
154
|
+
}, []), ut = u((e, t, n) => {
|
|
155
155
|
let r = Q.current;
|
|
156
|
-
e !== r.currentOpen &&
|
|
156
|
+
e !== r.currentOpen && c({
|
|
157
157
|
controlled: r.open,
|
|
158
158
|
initial: r.currentOpen,
|
|
159
159
|
onRequest: (e) => r.onOpenChange?.(e.value, e)
|
|
160
160
|
}).request(e, t, n) && (je(e), e || (Ie(null), Qe.current = "selected", lt("", "clear", n)));
|
|
161
|
-
}, [lt]), dt =
|
|
161
|
+
}, [lt]), dt = u((e, t, n) => {
|
|
162
162
|
let r = Q.current;
|
|
163
|
-
e !== r.currentHighlighted &&
|
|
163
|
+
e !== r.currentHighlighted && c({
|
|
164
164
|
controlled: r.highlightedValue,
|
|
165
165
|
initial: r.currentHighlighted,
|
|
166
166
|
onRequest: (e) => r.onHighlightedValueChange?.(e.value, e)
|
|
167
167
|
}).request(e, t, n) && Ie(e);
|
|
168
|
-
}, []), $ =
|
|
168
|
+
}, []), $ = u((e, t, n) => {
|
|
169
169
|
let r = Q.current;
|
|
170
|
-
e.length === r.currentSelection.length && e.every((e, t) => e === r.currentSelection[t]) ||
|
|
170
|
+
e.length === r.currentSelection.length && e.every((e, t) => e === r.currentSelection[t]) || c({
|
|
171
171
|
controlled: r.value,
|
|
172
|
-
initial:
|
|
172
|
+
initial: ie(r.currentSelection, r.resolvedMultiple),
|
|
173
173
|
equals: () => !1,
|
|
174
174
|
onRequest: (e) => r.onValueChange?.(e.value, e)
|
|
175
|
-
}).request(
|
|
176
|
-
}, []), ft =
|
|
175
|
+
}).request(ie(e, r.resolvedMultiple), t, n) && Pe(e);
|
|
176
|
+
}, []), ft = u((e, t, n) => {
|
|
177
177
|
let r = Q.current;
|
|
178
178
|
if (!r.resolvedMultiple) {
|
|
179
179
|
$([e], t, n);
|
|
@@ -181,8 +181,8 @@ function z({ align: e, alignOffset: t, children: n, clearable: o, closeOnEscape:
|
|
|
181
181
|
}
|
|
182
182
|
let i = r.currentSelection.includes(e);
|
|
183
183
|
$(i ? r.currentSelection.filter((t) => t !== e) : [...r.currentSelection, e], t, n);
|
|
184
|
-
}, [$]), pt =
|
|
185
|
-
|
|
184
|
+
}, [$]), pt = u((e, t) => $([], e, t), [$]), mt = u((e) => $(Me, "programmatic", e), [$, Me]);
|
|
185
|
+
m(G, () => ({
|
|
186
186
|
close: () => ut(!1, "programmatic"),
|
|
187
187
|
focus: () => Q.current.triggerNode?.focus({ preventScroll: !0 }),
|
|
188
188
|
focusSearch: () => {
|
|
@@ -192,7 +192,7 @@ function z({ align: e, alignOffset: t, children: n, clearable: o, closeOnEscape:
|
|
|
192
192
|
open: () => ut(!0, "programmatic"),
|
|
193
193
|
scrollToKey: (e) => {
|
|
194
194
|
let t = X?.querySelector(`[data-part='item'][data-value="${CSS.escape(e)}"]`);
|
|
195
|
-
t != null && X !== null &&
|
|
195
|
+
t != null && X !== null && A(t, X);
|
|
196
196
|
}
|
|
197
197
|
}), [X, ut]);
|
|
198
198
|
let ht = {
|
|
@@ -201,36 +201,36 @@ function z({ align: e, alignOffset: t, children: n, clearable: o, closeOnEscape:
|
|
|
201
201
|
clear: pt,
|
|
202
202
|
clearable: o ?? q.clearable,
|
|
203
203
|
closeOnEscape: s ?? q.closeOnEscape,
|
|
204
|
-
closeOnOutsidePress:
|
|
205
|
-
closeOnSelect:
|
|
204
|
+
closeOnOutsidePress: l ?? q.closeOnOutsidePress,
|
|
205
|
+
closeOnSelect: d ?? q.closeOnSelect,
|
|
206
206
|
collisionPadding: f ?? q.collisionPadding,
|
|
207
207
|
contentId: Ee,
|
|
208
208
|
contentNode: X,
|
|
209
209
|
disabled: Ge,
|
|
210
210
|
entry: Qe,
|
|
211
|
-
flip:
|
|
212
|
-
form:
|
|
213
|
-
fullWidth:
|
|
211
|
+
flip: w ?? q.flip,
|
|
212
|
+
form: T,
|
|
213
|
+
fullWidth: te ?? q.fullWidth,
|
|
214
214
|
hideWhenDetached: E ?? q.hideWhenDetached,
|
|
215
215
|
highlighted: Ye,
|
|
216
|
-
highlightMatch:
|
|
217
|
-
invalid:
|
|
216
|
+
highlightMatch: k ?? q.highlightMatch,
|
|
217
|
+
invalid: j ?? J?.invalid ?? q.invalid,
|
|
218
218
|
labelFor: it,
|
|
219
219
|
listId: De,
|
|
220
|
-
loading:
|
|
220
|
+
loading: N ?? q.loading,
|
|
221
221
|
locale: Te,
|
|
222
|
-
loop:
|
|
222
|
+
loop: L ?? q.loop,
|
|
223
223
|
matches: ot,
|
|
224
|
-
mount:
|
|
224
|
+
mount: se ?? q.mount,
|
|
225
225
|
multiple: We,
|
|
226
|
-
name:
|
|
226
|
+
name: z,
|
|
227
227
|
open: qe,
|
|
228
228
|
optionId: st,
|
|
229
|
-
portal:
|
|
229
|
+
portal: ce ?? q.portal,
|
|
230
230
|
query: Z,
|
|
231
231
|
readOnly: Ke,
|
|
232
232
|
registerLabel: rt,
|
|
233
|
-
required:
|
|
233
|
+
required: ue ?? J?.required ?? q.required,
|
|
234
234
|
restore: mt,
|
|
235
235
|
search: Xe,
|
|
236
236
|
searchId: Oe,
|
|
@@ -258,48 +258,48 @@ function z({ align: e, alignOffset: t, children: n, clearable: o, closeOnEscape:
|
|
|
258
258
|
variant: xe ?? q.variant,
|
|
259
259
|
width: Se ?? q.width
|
|
260
260
|
};
|
|
261
|
-
return /* @__PURE__ */ b(
|
|
261
|
+
return /* @__PURE__ */ b(I.Provider, {
|
|
262
262
|
value: ht,
|
|
263
|
-
children:
|
|
263
|
+
children: a
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
//#endregion
|
|
267
267
|
//#region src/select/select-collection.ts
|
|
268
|
-
var
|
|
269
|
-
function
|
|
270
|
-
return e === null ? [] : [...e.querySelectorAll(
|
|
268
|
+
var R = "[data-part='item']";
|
|
269
|
+
function z(e) {
|
|
270
|
+
return e === null ? [] : [...e.querySelectorAll(R)];
|
|
271
271
|
}
|
|
272
|
-
var
|
|
272
|
+
var B = (e) => e.dataset.value ?? "", V = (e) => e.dataset.disabled === void 0, H = (e) => e.dataset.textValue ?? e.querySelector("[data-part='label']")?.textContent?.trim() ?? e.textContent?.trim() ?? "";
|
|
273
273
|
function U(e) {
|
|
274
|
-
let t =
|
|
274
|
+
let t = z(e).filter(V);
|
|
275
275
|
return {
|
|
276
276
|
elements: t,
|
|
277
|
-
labels: t.map(
|
|
277
|
+
labels: t.map(H)
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
280
|
function W(e, t, n, r) {
|
|
281
|
-
let i =
|
|
281
|
+
let i = z(e);
|
|
282
282
|
if (i.length === 0) return null;
|
|
283
|
-
let a =
|
|
284
|
-
enabled: i.map(
|
|
285
|
-
from: t === null ? -1 : i.findIndex((e) =>
|
|
283
|
+
let a = k({
|
|
284
|
+
enabled: i.map(V),
|
|
285
|
+
from: t === null ? -1 : i.findIndex((e) => B(e) === t),
|
|
286
286
|
intent: n,
|
|
287
287
|
loop: r
|
|
288
288
|
});
|
|
289
|
-
return a === -1 ? null :
|
|
289
|
+
return a === -1 ? null : B(i[a]);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function ce(e, t, n, r) {
|
|
292
292
|
if (n === "none") return null;
|
|
293
293
|
if (n === "selected") {
|
|
294
|
-
let n =
|
|
295
|
-
return n === void 0 ? W(e, null, "first", r) :
|
|
294
|
+
let n = z(e).find((e) => t.includes(B(e)) && V(e));
|
|
295
|
+
return n === void 0 ? W(e, null, "first", r) : B(n);
|
|
296
296
|
}
|
|
297
297
|
return W(e, null, n, r);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function le(e, t) {
|
|
300
300
|
if (e === null || t === null) return;
|
|
301
|
-
let n =
|
|
302
|
-
n !== void 0 &&
|
|
301
|
+
let n = z(e).find((e) => B(e) === t);
|
|
302
|
+
n !== void 0 && A(n, e);
|
|
303
303
|
}
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region src/select/select-parts.tsx
|
|
@@ -308,44 +308,44 @@ function G(e, t) {
|
|
|
308
308
|
e?.(n), n.defaultPrevented || t(n);
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function ue(e, t, n) {
|
|
312
312
|
if (e === null) return;
|
|
313
|
-
let r =
|
|
313
|
+
let r = s(document.body).filter((e) => t === null || !t.contains(e)), i = r.indexOf(e);
|
|
314
314
|
((i === -1 ? void 0 : r[i + (n ? -1 : 1)]) ?? e).focus({ preventScroll: !0 });
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function de(e, t, n) {
|
|
317
317
|
let r = (e.parentElement ?? e).getBoundingClientRect();
|
|
318
318
|
return t >= r.left && t <= r.right && n >= r.top && n <= r.bottom;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function K(e, ...t) {
|
|
321
321
|
for (let n of t) typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
let c =
|
|
325
|
-
|
|
326
|
-
let [
|
|
327
|
-
|
|
328
|
-
c.setTriggerNode(
|
|
329
|
-
}, [
|
|
323
|
+
function fe({ children: n, ref: r, render: o, ...s }) {
|
|
324
|
+
let c = L(), l = i(), d = l?.registerControl;
|
|
325
|
+
f(() => d?.(), [d]);
|
|
326
|
+
let [p, m] = v(null), [h, g] = v(null), [S, ee] = v(!1), C = _(null), w = _(null);
|
|
327
|
+
f(() => {
|
|
328
|
+
c.setTriggerNode(p);
|
|
329
|
+
}, [p, c]), f(() => {
|
|
330
330
|
if (!c.typeahead) return;
|
|
331
|
-
let e =
|
|
332
|
-
return
|
|
333
|
-
e.destroy(),
|
|
331
|
+
let e = te({ timeout: c.typeaheadTimeout });
|
|
332
|
+
return w.current = e, () => {
|
|
333
|
+
e.destroy(), w.current = null;
|
|
334
334
|
};
|
|
335
|
-
}, [c.typeahead, c.typeaheadTimeout]),
|
|
335
|
+
}, [c.typeahead, c.typeaheadTimeout]), f(() => {
|
|
336
336
|
if (!c.open || c.contentNode === null) return;
|
|
337
|
-
let e =
|
|
338
|
-
if (
|
|
339
|
-
let { elements: t, labels: n } = U(c.contentNode), r =
|
|
340
|
-
r !== -1 && c.setHighlighted(
|
|
337
|
+
let e = C.current;
|
|
338
|
+
if (C.current = null, e === null || w.current === null) return;
|
|
339
|
+
let { elements: t, labels: n } = U(c.contentNode), r = w.current.match(e, n, -1);
|
|
340
|
+
r !== -1 && c.setHighlighted(B(t[r]), "keyboard");
|
|
341
341
|
}, [
|
|
342
342
|
c,
|
|
343
343
|
c.contentNode,
|
|
344
344
|
c.open
|
|
345
345
|
]);
|
|
346
|
-
let
|
|
346
|
+
let T = (e, t) => {
|
|
347
347
|
c.entry.current = e, c.setOpen(!0, "keyboard", t);
|
|
348
|
-
},
|
|
348
|
+
}, D = (e, t) => {
|
|
349
349
|
let n = W(c.contentNode, c.highlighted, e, c.loop);
|
|
350
350
|
n !== null && c.setHighlighted(n, "keyboard", t);
|
|
351
351
|
}, O = (e, t) => {
|
|
@@ -354,55 +354,55 @@ function pe({ children: e, ref: r, render: i, ...s }) {
|
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
356
|
c.toggle(c.highlighted, "keyboard", e), t && c.setOpen(!1, "select", e);
|
|
357
|
-
},
|
|
357
|
+
}, ne = (e) => {
|
|
358
358
|
if (c.disabled || c.readOnly) return;
|
|
359
359
|
let t = e.altKey;
|
|
360
360
|
if (!c.open) {
|
|
361
361
|
switch (e.key) {
|
|
362
362
|
case "ArrowDown":
|
|
363
|
-
e.preventDefault(),
|
|
363
|
+
e.preventDefault(), T(t ? "none" : "selected", e.nativeEvent);
|
|
364
364
|
return;
|
|
365
365
|
case "ArrowUp":
|
|
366
|
-
e.preventDefault(),
|
|
366
|
+
e.preventDefault(), T("last", e.nativeEvent);
|
|
367
367
|
return;
|
|
368
368
|
case "Enter":
|
|
369
369
|
case " ":
|
|
370
|
-
e.preventDefault(),
|
|
370
|
+
e.preventDefault(), T("selected", e.nativeEvent);
|
|
371
371
|
return;
|
|
372
372
|
case "Home":
|
|
373
|
-
e.preventDefault(),
|
|
373
|
+
e.preventDefault(), T("first", e.nativeEvent);
|
|
374
374
|
return;
|
|
375
375
|
case "End":
|
|
376
|
-
e.preventDefault(),
|
|
376
|
+
e.preventDefault(), T("last", e.nativeEvent);
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
|
-
if (!e.ctrlKey && !e.metaKey && !t &&
|
|
379
|
+
if (!e.ctrlKey && !e.metaKey && !t && E(e.key)) {
|
|
380
380
|
if (c.search) {
|
|
381
|
-
e.preventDefault(), c.setQuery(e.key, "keyboard", e.nativeEvent),
|
|
381
|
+
e.preventDefault(), c.setQuery(e.key, "keyboard", e.nativeEvent), T("first", e.nativeEvent);
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
|
-
c.typeahead && (e.preventDefault(),
|
|
384
|
+
c.typeahead && (e.preventDefault(), C.current = e.key, T("none", e.nativeEvent));
|
|
385
385
|
}
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
388
|
switch (e.key) {
|
|
389
389
|
case "ArrowDown":
|
|
390
|
-
e.preventDefault(),
|
|
390
|
+
e.preventDefault(), D("next", e.nativeEvent);
|
|
391
391
|
return;
|
|
392
392
|
case "ArrowUp":
|
|
393
|
-
e.preventDefault(), t ? O(e.nativeEvent, !0) :
|
|
393
|
+
e.preventDefault(), t ? O(e.nativeEvent, !0) : D("previous", e.nativeEvent);
|
|
394
394
|
return;
|
|
395
395
|
case "Home":
|
|
396
|
-
e.preventDefault(),
|
|
396
|
+
e.preventDefault(), D("first", e.nativeEvent);
|
|
397
397
|
return;
|
|
398
398
|
case "End":
|
|
399
|
-
e.preventDefault(),
|
|
399
|
+
e.preventDefault(), D("last", e.nativeEvent);
|
|
400
400
|
return;
|
|
401
401
|
case "PageDown":
|
|
402
|
-
e.preventDefault(),
|
|
402
|
+
e.preventDefault(), D("pageDown", e.nativeEvent);
|
|
403
403
|
return;
|
|
404
404
|
case "PageUp":
|
|
405
|
-
e.preventDefault(),
|
|
405
|
+
e.preventDefault(), D("pageUp", e.nativeEvent);
|
|
406
406
|
return;
|
|
407
407
|
case "Enter":
|
|
408
408
|
e.preventDefault(), O(e.nativeEvent, c.closeOnSelect);
|
|
@@ -417,21 +417,21 @@ function pe({ children: e, ref: r, render: i, ...s }) {
|
|
|
417
417
|
O(e.nativeEvent, !0);
|
|
418
418
|
return;
|
|
419
419
|
}
|
|
420
|
-
if (!c.typeahead ||
|
|
420
|
+
if (!c.typeahead || w.current === null || e.ctrlKey || e.metaKey || t || !E(e.key, w.current.query.length > 0)) return;
|
|
421
421
|
e.preventDefault();
|
|
422
|
-
let { elements: n, labels: r } = U(c.contentNode), i = n.findIndex((e) =>
|
|
423
|
-
a !== -1 && c.setHighlighted(
|
|
424
|
-
},
|
|
425
|
-
if (e.detail > 0 && !
|
|
422
|
+
let { elements: n, labels: r } = U(c.contentNode), i = n.findIndex((e) => B(e) === c.highlighted), a = w.current.match(e.key, r, i);
|
|
423
|
+
a !== -1 && c.setHighlighted(B(n[a]), "keyboard");
|
|
424
|
+
}, k = (e) => {
|
|
425
|
+
if (e.detail > 0 && !de(e.currentTarget, e.clientX, e.clientY)) {
|
|
426
426
|
e.currentTarget.focus({ preventScroll: !0 });
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
429
|
c.disabled || c.readOnly || (c.entry.current = "selected", c.setOpen(!c.open, "pointer", e.nativeEvent));
|
|
430
|
-
},
|
|
431
|
-
c.clear("clear", e.nativeEvent),
|
|
432
|
-
},
|
|
433
|
-
m(e),
|
|
434
|
-
}, [r]),
|
|
430
|
+
}, A = (e) => {
|
|
431
|
+
c.clear("clear", e.nativeEvent), p?.focus({ preventScroll: !0 });
|
|
432
|
+
}, j = u((e) => {
|
|
433
|
+
m(e), K(e, r);
|
|
434
|
+
}, [r]), M = [s["aria-describedby"], l?.describedBy].filter(Boolean).join(" "), N = c.clearable && c.selection.length > 0 && !c.disabled && !c.readOnly, P = {
|
|
435
435
|
"data-part": "root",
|
|
436
436
|
"data-size": c.size,
|
|
437
437
|
"data-ui": "select",
|
|
@@ -444,23 +444,23 @@ function pe({ children: e, ref: r, render: i, ...s }) {
|
|
|
444
444
|
...c.invalid ? { "data-invalid": "" } : {},
|
|
445
445
|
...c.required ? { "data-required": "" } : {},
|
|
446
446
|
...c.loading ? { "data-loading": "" } : {},
|
|
447
|
-
...
|
|
448
|
-
},
|
|
447
|
+
...S ? { "data-narrow": "" } : {}
|
|
448
|
+
}, F = c.multiple && c.selection.length > 0 ? /* @__PURE__ */ b(a, {
|
|
449
449
|
disabled: c.disabled || c.readOnly,
|
|
450
|
-
frame:
|
|
450
|
+
frame: h,
|
|
451
451
|
labelFor: c.labelFor,
|
|
452
|
-
onNarrow:
|
|
452
|
+
onNarrow: ee,
|
|
453
453
|
onRemove: (e, t) => {
|
|
454
|
-
c.toggle(e, "select", t.nativeEvent),
|
|
454
|
+
c.toggle(e, "select", t.nativeEvent), p?.focus({ preventScroll: !0 });
|
|
455
455
|
},
|
|
456
456
|
removeLabel: (e) => c.t("remove", { label: e }),
|
|
457
457
|
values: c.selection
|
|
458
|
-
}) : null,
|
|
458
|
+
}) : null, I = /* @__PURE__ */ x(y, { children: [
|
|
459
459
|
/* @__PURE__ */ b("button", {
|
|
460
460
|
...s,
|
|
461
461
|
"aria-activedescendant": c.open && !c.search && c.highlighted !== null ? c.optionId(c.highlighted) : void 0,
|
|
462
462
|
"aria-controls": c.open ? c.contentId : void 0,
|
|
463
|
-
"aria-describedby":
|
|
463
|
+
"aria-describedby": M === "" ? void 0 : M,
|
|
464
464
|
"aria-expanded": c.open,
|
|
465
465
|
"aria-haspopup": c.search ? "dialog" : "listbox",
|
|
466
466
|
"aria-invalid": c.invalid ? !0 : void 0,
|
|
@@ -470,20 +470,20 @@ function pe({ children: e, ref: r, render: i, ...s }) {
|
|
|
470
470
|
"data-part": "trigger",
|
|
471
471
|
disabled: c.disabled,
|
|
472
472
|
id: c.triggerId,
|
|
473
|
-
onClick: G(s.onClick,
|
|
474
|
-
onKeyDown: G(s.onKeyDown,
|
|
475
|
-
ref:
|
|
473
|
+
onClick: G(s.onClick, k),
|
|
474
|
+
onKeyDown: G(s.onKeyDown, ne),
|
|
475
|
+
ref: j,
|
|
476
476
|
role: "combobox",
|
|
477
477
|
type: "button",
|
|
478
|
-
children:
|
|
478
|
+
children: n
|
|
479
479
|
}),
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
F,
|
|
481
|
+
N ? /* @__PURE__ */ b("button", {
|
|
482
482
|
"aria-label": c.t("clear"),
|
|
483
483
|
"data-part": "clear",
|
|
484
|
-
onClick:
|
|
484
|
+
onClick: A,
|
|
485
485
|
type: "button",
|
|
486
|
-
children: /* @__PURE__ */ b(
|
|
486
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "x" }) })
|
|
487
487
|
}) : null,
|
|
488
488
|
c.loading ? /* @__PURE__ */ b("span", {
|
|
489
489
|
"aria-hidden": "true",
|
|
@@ -491,22 +491,22 @@ function pe({ children: e, ref: r, render: i, ...s }) {
|
|
|
491
491
|
"data-ui": "spinner"
|
|
492
492
|
}) : /* @__PURE__ */ b("span", {
|
|
493
493
|
"data-part": "arrow",
|
|
494
|
-
children: /* @__PURE__ */ b(
|
|
494
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "chevron-down" }) })
|
|
495
495
|
}),
|
|
496
|
-
/* @__PURE__ */ b(
|
|
496
|
+
/* @__PURE__ */ b(pe, {})
|
|
497
497
|
] });
|
|
498
|
-
return
|
|
499
|
-
...
|
|
500
|
-
ref:
|
|
501
|
-
children:
|
|
502
|
-
}) :
|
|
503
|
-
...
|
|
504
|
-
children:
|
|
498
|
+
return o === void 0 ? /* @__PURE__ */ b("div", {
|
|
499
|
+
...P,
|
|
500
|
+
ref: g,
|
|
501
|
+
children: I
|
|
502
|
+
}) : o({
|
|
503
|
+
...P,
|
|
504
|
+
children: I
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
let e =
|
|
509
|
-
return
|
|
507
|
+
function pe() {
|
|
508
|
+
let e = L(), [t, n] = v(null), { restore: r } = e;
|
|
509
|
+
return f(() => {
|
|
510
510
|
let e = t?.form;
|
|
511
511
|
if (e == null) return;
|
|
512
512
|
let n = (e) => r(e);
|
|
@@ -543,8 +543,8 @@ function me() {
|
|
|
543
543
|
}, t))]
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
let r =
|
|
546
|
+
function me({ children: e, placeholder: t, ...n }) {
|
|
547
|
+
let r = L(), i = r.selection.map((e) => r.labelFor(e)), a = i.filter((e) => e !== void 0), o = r.selection.length > 0 && a.length < r.selection.length, s = (() => {
|
|
548
548
|
if (e !== void 0) return e(r.selection, a);
|
|
549
549
|
if (r.selection.length === 0) return t;
|
|
550
550
|
let n = i[0] ?? r.selection[0];
|
|
@@ -561,8 +561,8 @@ function he({ children: e, placeholder: t, ...n }) {
|
|
|
561
561
|
children: s
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
let o =
|
|
564
|
+
function he({ icon: n, ref: r, render: i, ...a }) {
|
|
565
|
+
let o = L(), s = (e, t) => {
|
|
566
566
|
let n = W(o.contentNode, o.highlighted, e, o.loop);
|
|
567
567
|
n !== null && o.setHighlighted(n, "keyboard", t);
|
|
568
568
|
}, c = (e, t) => {
|
|
@@ -593,13 +593,13 @@ function ge({ icon: e, ref: r, render: i, ...a }) {
|
|
|
593
593
|
e.preventDefault(), o.query !== "" && o.setQuery("", "clear", e.nativeEvent);
|
|
594
594
|
return;
|
|
595
595
|
case "Tab":
|
|
596
|
-
e.preventDefault(), c(e.nativeEvent, !0),
|
|
596
|
+
e.preventDefault(), c(e.nativeEvent, !0), ue(o.triggerNode, e.currentTarget.closest("[data-part='positioner']"), e.shiftKey);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
|
-
}, u = { "data-part": "search" }, d = /* @__PURE__ */ x(y, { children: [
|
|
599
|
+
}, u = { "data-part": "search" }, d = /* @__PURE__ */ x(y, { children: [n === null ? null : n ?? /* @__PURE__ */ b("span", {
|
|
600
600
|
"aria-hidden": "true",
|
|
601
601
|
"data-part": "search-icon",
|
|
602
|
-
children: /* @__PURE__ */ b(
|
|
602
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "search" }) })
|
|
603
603
|
}), /* @__PURE__ */ b("input", {
|
|
604
604
|
...a,
|
|
605
605
|
"aria-activedescendant": o.highlighted === null ? void 0 : o.optionId(o.highlighted),
|
|
@@ -614,7 +614,7 @@ function ge({ icon: e, ref: r, render: i, ...a }) {
|
|
|
614
614
|
onKeyDown: G(a.onKeyDown, l),
|
|
615
615
|
placeholder: a.placeholder ?? o.t("searchPlaceholder"),
|
|
616
616
|
ref: (e) => {
|
|
617
|
-
o.setSearchNode(e),
|
|
617
|
+
o.setSearchNode(e), K(e, r);
|
|
618
618
|
},
|
|
619
619
|
role: "combobox",
|
|
620
620
|
spellCheck: !1,
|
|
@@ -629,24 +629,24 @@ function ge({ icon: e, ref: r, render: i, ...a }) {
|
|
|
629
629
|
children: d
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
let s =
|
|
634
|
-
A.current = s,
|
|
635
|
-
let e =
|
|
632
|
+
function ge({ children: e, empty: t, ref: n, render: r, searchProps: i, status: a, ...o }) {
|
|
633
|
+
let s = L(), [c, l] = v(null), [u, d] = v(null), [p, m] = v(null), [g, C] = v("unmounted"), [te, E] = v(!1), [O, ne] = v(0), k = _(null), A = _(s);
|
|
634
|
+
A.current = s, f(() => {
|
|
635
|
+
let e = S({
|
|
636
636
|
present: A.current.open,
|
|
637
|
-
onStatusChange:
|
|
637
|
+
onStatusChange: C
|
|
638
638
|
});
|
|
639
|
-
return k.current = e,
|
|
639
|
+
return k.current = e, C(e.status), () => {
|
|
640
640
|
e.destroy(), k.current = null;
|
|
641
641
|
};
|
|
642
|
-
}, []),
|
|
643
|
-
let j = s.mount === "eager" || s.mount === "lazy" && s.seen ||
|
|
644
|
-
|
|
642
|
+
}, []), f(() => k.current?.sync(s.open), [s.open]), f(() => k.current?.setNode(c), [c]), f(() => s.setContentNode(u), [s, u]);
|
|
643
|
+
let j = s.mount === "eager" || s.mount === "lazy" && s.seen || g !== "unmounted";
|
|
644
|
+
f(() => {
|
|
645
645
|
if (!j) {
|
|
646
646
|
m(null);
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
let e =
|
|
649
|
+
let e = ee({
|
|
650
650
|
origin: s.triggerNode,
|
|
651
651
|
disabled: !s.portal
|
|
652
652
|
});
|
|
@@ -656,8 +656,8 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
656
656
|
s.portal,
|
|
657
657
|
s.triggerNode
|
|
658
658
|
]);
|
|
659
|
-
let { align: M, alignOffset: N, collisionPadding: P, flip: F, hideWhenDetached: I, shift:
|
|
660
|
-
|
|
659
|
+
let { align: M, alignOffset: N, collisionPadding: P, flip: F, hideWhenDetached: I, shift: re, side: ie, sideOffset: ae, strategy: oe, width: se } = s;
|
|
660
|
+
f(() => {
|
|
661
661
|
if (c === null || s.triggerNode === null) return;
|
|
662
662
|
let e = !0, t = s.triggerNode.closest("[data-part='root']") ?? s.triggerNode, n = T(t, c, {
|
|
663
663
|
align: M,
|
|
@@ -665,11 +665,11 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
665
665
|
boundaryPadding: P,
|
|
666
666
|
flip: F,
|
|
667
667
|
hideWhenDetached: I,
|
|
668
|
-
matchWidth:
|
|
669
|
-
shift:
|
|
670
|
-
side:
|
|
671
|
-
sideOffset:
|
|
672
|
-
strategy:
|
|
668
|
+
matchWidth: se === "anchor",
|
|
669
|
+
shift: re,
|
|
670
|
+
side: ie,
|
|
671
|
+
sideOffset: ae,
|
|
672
|
+
strategy: oe
|
|
673
673
|
});
|
|
674
674
|
return n.update().then(() => {
|
|
675
675
|
e && E(!0);
|
|
@@ -684,12 +684,12 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
684
684
|
I,
|
|
685
685
|
c,
|
|
686
686
|
s.triggerNode,
|
|
687
|
-
L,
|
|
688
|
-
ne,
|
|
689
687
|
re,
|
|
690
688
|
ie,
|
|
691
|
-
ae
|
|
692
|
-
|
|
689
|
+
ae,
|
|
690
|
+
oe,
|
|
691
|
+
se
|
|
692
|
+
]), f(() => {
|
|
693
693
|
if (c === null || !s.open) return;
|
|
694
694
|
let e = [s.triggerNode].filter((e) => e !== null), t = w(c, {
|
|
695
695
|
branches: e,
|
|
@@ -717,45 +717,58 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
717
717
|
]), h(() => {
|
|
718
718
|
let e = A.current;
|
|
719
719
|
if (!e.open || u === null || e.entry.current === "none") return;
|
|
720
|
-
let t =
|
|
720
|
+
let t = ce(u, e.selection, e.entry.current, e.loop);
|
|
721
721
|
t !== null && e.setHighlighted(t, "keyboard");
|
|
722
722
|
}, [s.open, u]), h(() => {
|
|
723
|
-
let e =
|
|
724
|
-
|
|
725
|
-
}),
|
|
726
|
-
|
|
723
|
+
let e = z(u).length;
|
|
724
|
+
ne((t) => t === e ? t : e);
|
|
725
|
+
}), f(() => {
|
|
726
|
+
le(u, s.highlighted);
|
|
727
727
|
}, [
|
|
728
|
-
|
|
728
|
+
te,
|
|
729
729
|
s.highlighted,
|
|
730
730
|
u
|
|
731
731
|
]);
|
|
732
|
-
let
|
|
733
|
-
|
|
734
|
-
s.open && s.search &&
|
|
732
|
+
let R = s.searchNode;
|
|
733
|
+
f(() => {
|
|
734
|
+
s.open && s.search && R !== null && R.focus({ preventScroll: !0 });
|
|
735
735
|
}, [
|
|
736
|
-
|
|
736
|
+
R,
|
|
737
737
|
s.open,
|
|
738
738
|
s.search
|
|
739
739
|
]);
|
|
740
|
-
let
|
|
741
|
-
|
|
742
|
-
s.open && s.search && u !== null &&
|
|
740
|
+
let B = _(s.query);
|
|
741
|
+
f(() => {
|
|
742
|
+
s.open && s.search && u !== null && B.current !== s.query && (B.current = s.query, A.current.setHighlighted(W(u, null, "first", !1), "keyboard"));
|
|
743
743
|
}, [
|
|
744
|
-
|
|
744
|
+
O,
|
|
745
745
|
s.open,
|
|
746
746
|
s.query,
|
|
747
747
|
s.search,
|
|
748
748
|
u
|
|
749
|
-
])
|
|
750
|
-
let V =
|
|
749
|
+
]);
|
|
750
|
+
let V = s.selection.filter((e) => s.labelFor(e) === void 0).join("\0"), [H, U] = v(null), G = _(null);
|
|
751
|
+
if (f(() => {
|
|
752
|
+
if (H !== null) {
|
|
753
|
+
U(null);
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
j || V === "" || G.current === V || (G.current = V, U((s.triggerNode?.ownerDocument ?? document).createDocumentFragment()));
|
|
757
|
+
}, [
|
|
758
|
+
H,
|
|
759
|
+
j,
|
|
760
|
+
s.triggerNode,
|
|
761
|
+
V
|
|
762
|
+
]), !j) return H === null ? null : D(e, H);
|
|
763
|
+
let ue = {
|
|
751
764
|
"data-align": M,
|
|
752
765
|
...s.open ? {} : { inert: !0 },
|
|
753
|
-
...s.open &&
|
|
766
|
+
...s.open && te ? { "data-open": "" } : {},
|
|
754
767
|
"data-part": "positioner",
|
|
755
768
|
"data-size": s.size,
|
|
756
769
|
"data-ui": "select",
|
|
757
770
|
"data-width": s.width
|
|
758
|
-
},
|
|
771
|
+
}, de = a === void 0 ? s.loading ? s.t("loading") : !s.search || O === 0 ? null : s.t("count", { count: O }) : a, fe = s.multiple && s.selection.length > 0 ? /* @__PURE__ */ b("div", {
|
|
759
772
|
"aria-hidden": "true",
|
|
760
773
|
"data-part": "chosen",
|
|
761
774
|
children: s.selection.map((e) => /* @__PURE__ */ b("span", {
|
|
@@ -771,8 +784,8 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
771
784
|
})
|
|
772
785
|
})
|
|
773
786
|
}, String(e)))
|
|
774
|
-
}) : null,
|
|
775
|
-
|
|
787
|
+
}) : null, pe = /* @__PURE__ */ x(y, { children: [
|
|
788
|
+
fe,
|
|
776
789
|
e,
|
|
777
790
|
s.loading ? /* @__PURE__ */ b("div", {
|
|
778
791
|
"aria-hidden": "true",
|
|
@@ -788,7 +801,7 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
788
801
|
"data-loading": ""
|
|
789
802
|
}) }, e))
|
|
790
803
|
}) : null,
|
|
791
|
-
!s.loading &&
|
|
804
|
+
!s.loading && O === 0 ? /* @__PURE__ */ b("div", {
|
|
792
805
|
"data-part": "empty",
|
|
793
806
|
children: t ?? s.t("empty")
|
|
794
807
|
}) : null,
|
|
@@ -797,19 +810,19 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
797
810
|
"data-part": "status",
|
|
798
811
|
...s.loading ? { "data-loading": "" } : {},
|
|
799
812
|
role: "status",
|
|
800
|
-
children:
|
|
813
|
+
children: de
|
|
801
814
|
}) : null
|
|
802
|
-
] }),
|
|
815
|
+
] }), me = {
|
|
803
816
|
"aria-busy": s.loading ? !0 : void 0,
|
|
804
817
|
"aria-multiselectable": s.multiple ? !0 : void 0
|
|
805
|
-
},
|
|
806
|
-
...
|
|
818
|
+
}, ge = /* @__PURE__ */ b("div", {
|
|
819
|
+
...ue,
|
|
807
820
|
ref: (e) => {
|
|
808
|
-
l(e),
|
|
821
|
+
l(e), K(e, n);
|
|
809
822
|
},
|
|
810
823
|
children: /* @__PURE__ */ b("div", {
|
|
811
824
|
...o,
|
|
812
|
-
...s.search ? {} :
|
|
825
|
+
...s.search ? {} : me,
|
|
813
826
|
"aria-labelledby": o["aria-label"] === void 0 ? s.triggerId : void 0,
|
|
814
827
|
"data-loading": s.loading ? "" : void 0,
|
|
815
828
|
"data-part": "content",
|
|
@@ -817,82 +830,82 @@ function _e({ children: e, empty: t, ref: n, render: r, searchProps: i, status:
|
|
|
817
830
|
id: s.contentId,
|
|
818
831
|
ref: d,
|
|
819
832
|
role: s.search ? "dialog" : "listbox",
|
|
820
|
-
children: s.search ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(
|
|
821
|
-
...
|
|
833
|
+
children: s.search ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(he, { ...i }), /* @__PURE__ */ b("div", {
|
|
834
|
+
...me,
|
|
822
835
|
"aria-labelledby": s.triggerId,
|
|
823
836
|
"data-part": "list",
|
|
824
837
|
id: s.listId,
|
|
825
838
|
role: "listbox",
|
|
826
|
-
children:
|
|
827
|
-
})] }) :
|
|
839
|
+
children: pe
|
|
840
|
+
})] }) : pe
|
|
828
841
|
})
|
|
829
|
-
}),
|
|
830
|
-
...
|
|
842
|
+
}), _e = r === void 0 ? ge : r({
|
|
843
|
+
...ue,
|
|
831
844
|
children: e
|
|
832
845
|
});
|
|
833
|
-
return
|
|
846
|
+
return p === null ? _e : D(_e, p);
|
|
834
847
|
}
|
|
835
848
|
//#endregion
|
|
836
849
|
//#region src/select/select-items.tsx
|
|
837
|
-
function
|
|
838
|
-
let
|
|
839
|
-
|
|
840
|
-
if (m === null) return;
|
|
841
|
-
let e = l ?? m.querySelector("[data-part='label']")?.textContent?.trim() ?? "";
|
|
842
|
-
e !== "" && e !== h.current && (h.current = e,
|
|
850
|
+
function _e({ children: n, description: r, disabled: i = !1, icon: a, position: s, ref: c, textValue: l, value: u, ...d }) {
|
|
851
|
+
let p = L(), m = _(null), h = _(null);
|
|
852
|
+
f(() => {
|
|
853
|
+
if (m.current === null) return;
|
|
854
|
+
let e = l ?? m.current.querySelector("[data-part='label']")?.textContent?.trim() ?? "";
|
|
855
|
+
e !== "" && e !== h.current && (h.current = e, p.registerLabel(u, e));
|
|
843
856
|
}, [
|
|
844
|
-
|
|
845
|
-
|
|
857
|
+
n,
|
|
858
|
+
p,
|
|
846
859
|
l,
|
|
847
860
|
u
|
|
848
861
|
]);
|
|
849
|
-
let
|
|
850
|
-
if (!
|
|
851
|
-
let
|
|
852
|
-
return
|
|
853
|
-
ranges:
|
|
854
|
-
text:
|
|
862
|
+
let v = l ?? (typeof n == "string" ? n : void 0), y = g(() => {
|
|
863
|
+
if (!p.search || !p.highlightMatch || p.query === "" || v === void 0) return n;
|
|
864
|
+
let e = j(v, p.query, { locale: p.locale });
|
|
865
|
+
return e.length === 0 ? n : /* @__PURE__ */ b(o, {
|
|
866
|
+
ranges: e,
|
|
867
|
+
text: v
|
|
855
868
|
});
|
|
856
869
|
}, [
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
870
|
+
n,
|
|
871
|
+
p.highlightMatch,
|
|
872
|
+
p.locale,
|
|
873
|
+
p.query,
|
|
874
|
+
p.search,
|
|
875
|
+
v
|
|
863
876
|
]);
|
|
864
|
-
if (
|
|
865
|
-
let S =
|
|
866
|
-
i ||
|
|
867
|
-
},
|
|
877
|
+
if (v !== void 0 && !p.matches(v)) return null;
|
|
878
|
+
let S = p.selection.includes(u), ee = p.highlighted === u, C = (e) => {
|
|
879
|
+
i || p.setHighlighted(u, "pointer", e.nativeEvent);
|
|
880
|
+
}, w = (e) => {
|
|
868
881
|
d.onPointerDown?.(e), !e.defaultPrevented && e.preventDefault();
|
|
869
|
-
},
|
|
882
|
+
}, T = (e) => {
|
|
870
883
|
if (!i) {
|
|
871
|
-
if (
|
|
872
|
-
|
|
884
|
+
if (p.toggle(u, "pointer", e.nativeEvent), p.closeOnSelect && !p.multiple) {
|
|
885
|
+
p.setOpen(!1, "select", e.nativeEvent);
|
|
873
886
|
return;
|
|
874
887
|
}
|
|
875
|
-
|
|
888
|
+
p.setQuery("", "select", e.nativeEvent), p.searchNode?.focus({ preventScroll: !0 });
|
|
876
889
|
}
|
|
877
890
|
};
|
|
878
891
|
return /* @__PURE__ */ x("div", {
|
|
879
892
|
...d,
|
|
880
893
|
"aria-disabled": i ? !0 : void 0,
|
|
881
|
-
"aria-posinset":
|
|
882
|
-
"aria-setsize":
|
|
894
|
+
"aria-posinset": s,
|
|
895
|
+
"aria-setsize": s === void 0 ? void 0 : p.total,
|
|
883
896
|
"aria-selected": S,
|
|
884
897
|
"data-part": "item",
|
|
885
898
|
"data-value": u,
|
|
886
|
-
id: d.id ??
|
|
887
|
-
...
|
|
899
|
+
id: d.id ?? p.optionId(u),
|
|
900
|
+
...v === void 0 ? {} : { "data-text-value": v },
|
|
888
901
|
...i ? { "data-disabled": "" } : {},
|
|
889
902
|
...S ? { "data-selected": "" } : {},
|
|
890
|
-
...
|
|
891
|
-
onClick:
|
|
892
|
-
onPointerDown:
|
|
893
|
-
onPointerEnter:
|
|
903
|
+
...ee ? { "data-current": "" } : {},
|
|
904
|
+
onClick: T,
|
|
905
|
+
onPointerDown: w,
|
|
906
|
+
onPointerEnter: C,
|
|
894
907
|
ref: (e) => {
|
|
895
|
-
|
|
908
|
+
m.current = e, typeof c == "function" ? c(e) : c != null && (c.current = e);
|
|
896
909
|
},
|
|
897
910
|
role: "option",
|
|
898
911
|
children: [
|
|
@@ -902,7 +915,7 @@ function ve({ children: e, description: r, disabled: i = !1, icon: a, position:
|
|
|
902
915
|
}),
|
|
903
916
|
/* @__PURE__ */ b("span", {
|
|
904
917
|
"data-part": "label",
|
|
905
|
-
children:
|
|
918
|
+
children: y
|
|
906
919
|
}),
|
|
907
920
|
r === void 0 ? null : /* @__PURE__ */ b("span", {
|
|
908
921
|
"data-part": "description",
|
|
@@ -910,14 +923,14 @@ function ve({ children: e, description: r, disabled: i = !1, icon: a, position:
|
|
|
910
923
|
}),
|
|
911
924
|
/* @__PURE__ */ b("span", {
|
|
912
925
|
"data-part": "indicator",
|
|
913
|
-
children: /* @__PURE__ */ b(
|
|
926
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "check" }) })
|
|
914
927
|
})
|
|
915
928
|
]
|
|
916
929
|
});
|
|
917
930
|
}
|
|
918
|
-
function
|
|
919
|
-
let r = `${
|
|
920
|
-
return
|
|
931
|
+
function ve({ children: e, label: t, ...n }) {
|
|
932
|
+
let r = `${p()}group`, { query: i } = L(), [a, o] = v(null), [s, c] = v(!1);
|
|
933
|
+
return f(() => {
|
|
921
934
|
a !== null && c(a.querySelector("[data-part='item']") === null);
|
|
922
935
|
}, [a, i]), /* @__PURE__ */ x("div", {
|
|
923
936
|
...n,
|
|
@@ -933,7 +946,7 @@ function ye({ children: e, label: t, ...n }) {
|
|
|
933
946
|
}), e]
|
|
934
947
|
});
|
|
935
948
|
}
|
|
936
|
-
function
|
|
949
|
+
function ye(e) {
|
|
937
950
|
return /* @__PURE__ */ b("div", {
|
|
938
951
|
"data-part": "separator",
|
|
939
952
|
ref: e.ref,
|
|
@@ -941,4 +954,4 @@ function be(e) {
|
|
|
941
954
|
});
|
|
942
955
|
}
|
|
943
956
|
//#endregion
|
|
944
|
-
export {
|
|
957
|
+
export { he as a, se as c, F as d, P as f, ge as i, L as l, _e as n, fe as o, ye as r, me as s, ve as t, M as u };
|