bitboss-ui 3.0.0-beta.74 → 3.0.0-beta.76
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/README.md +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +3 -3
- package/dist/ai/BbButton.md +4 -4
- package/dist/ai/BbCalendar.md +5 -2
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +13 -1
- package/dist/ai/BbColorPalette.md +12 -7
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +13 -1
- package/dist/ai/BbDatePickerInput.md +18 -2
- package/dist/ai/BbDialog.md +6 -3
- package/dist/ai/BbDropdown.md +174 -77
- package/dist/ai/BbDropdownButton.md +37 -16
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbNumberInput.md +3 -1
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +227 -105
- package/dist/ai/BbSelectPopover.md +139 -14
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +18 -17
- package/dist/ai/BbTimePicker.md +13 -1
- package/dist/ai/BbTimePickerInput.md +16 -2
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTree.md +5 -1
- package/dist/ai/CommonPopover.md +1 -0
- package/dist/ai/FlatListBox.md +1 -0
- package/dist/ai/GroupedListBox.md +3 -2
- package/dist/ai/ListBox.md +4 -2
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +310 -7
- package/dist/ai/components.json +33 -35
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +9 -5
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/design-tokens.md +13 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/components/bb-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +70 -24
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +1 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCarousel.json +0 -3
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbColorInput.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbDatePicker.json +3 -0
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +3 -1
- package/dist/ai/manifest/components/BbDropdown.json +36 -28
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +21 -11
- package/dist/ai/manifest/components/BbDropdownButton.json +24 -16
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +4 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +3 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbSelect.json +47 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +14 -7
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +9 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbTable.json +6 -6
- package/dist/ai/manifest/components/BbTable.tree.json +9 -1
- package/dist/ai/manifest/components/BbTimePicker.json +5 -2
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +1 -0
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +3 -2
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +3 -2
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +0 -3
- package/dist/ai/manifest/types.advanced.json +6 -6
- package/dist/ai/manifest/types.api.json +1 -3
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +128 -11
- package/dist/ai/source/BbBadge.md +18 -7
- package/dist/ai/source/BbBreadcrumbs.md +57 -56
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +41 -34
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +23 -2
- package/dist/ai/source/BbDatePicker.md +18 -0
- package/dist/ai/source/BbDatePickerInput.md +47 -3
- package/dist/ai/source/BbDialog.md +14 -1
- package/dist/ai/source/BbDropdown.md +296 -99
- package/dist/ai/source/BbDropdownButton.md +61 -19
- package/dist/ai/source/BbDropdownGroup.md +189 -98
- package/dist/ai/source/BbGallery.md +82 -60
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbNumberInput.md +17 -10
- package/dist/ai/source/BbOffCanvas.md +14 -1
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRadioGroup.md +12 -5
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +151 -112
- package/dist/ai/source/BbSelectPopover.md +244 -29
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +114 -35
- package/dist/ai/source/BbTimePicker.md +19 -0
- package/dist/ai/source/BbTimePickerInput.md +21 -2
- package/dist/ai/source/BbToast.md +2 -2
- package/dist/ai/source/BbToastPortal.md +2 -2
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/CommonPopover.md +24 -1
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +33 -7
- package/dist/ai/source/GroupedListBox.md +85 -14
- package/dist/ai/source/ListBox.md +11 -1
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +62 -43
- package/dist/components/BbAvatar/avatarIdentity.js +25 -0
- package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
- package/dist/components/BbAvatar/types.d.ts +24 -5
- package/dist/components/BbAvatar/types.js +5 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +66 -64
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +141 -146
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +503 -502
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
- package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
- package/dist/components/BbColorInput/types.d.ts +7 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +208 -196
- package/dist/components/BbColorPalette/types.d.ts +7 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
- package/dist/components/BbDatePicker/types.d.ts +7 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +4 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +496 -510
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
- package/dist/components/BbDialog/leaveGhost.js +22 -17
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +106 -100
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +416 -369
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +404 -354
- package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
- package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +117 -102
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +67 -38
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +44 -20
- package/dist/components/BbDropdown/types.d.ts +109 -87
- package/dist/components/BbDropdown/types.js +3 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +101 -65
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +153 -57
- package/dist/components/BbDropdownButton/types.d.ts +23 -10
- package/dist/components/BbDropdownButton/types.js +4 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +335 -312
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +32 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +217 -196
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +110 -111
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +8 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +728 -653
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +32 -17
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
- package/dist/components/BbSwitchGroup/types.d.ts +3 -6
- package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1171 -1152
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
- package/dist/components/BbTimePicker/types.d.ts +7 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +4 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +290 -280
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -78
- package/dist/components/BbToast/types.d.ts +2 -2
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
- package/dist/components/BbTree/types.d.ts +1 -1
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +122 -102
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +182 -153
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/locales/ar.json +2 -0
- package/dist/i18n/locales/cs.json +2 -0
- package/dist/i18n/locales/da.json +2 -0
- package/dist/i18n/locales/de-CH.json +2 -0
- package/dist/i18n/locales/de.json +2 -0
- package/dist/i18n/locales/el.json +2 -0
- package/dist/i18n/locales/en-GB.json +2 -0
- package/dist/i18n/locales/en.json +2 -0
- package/dist/i18n/locales/es-MX.json +2 -0
- package/dist/i18n/locales/es.json +2 -0
- package/dist/i18n/locales/fa.json +2 -0
- package/dist/i18n/locales/fi.json +2 -0
- package/dist/i18n/locales/fr.json +2 -0
- package/dist/i18n/locales/he.json +2 -0
- package/dist/i18n/locales/hu.json +2 -0
- package/dist/i18n/locales/it.json +2 -0
- package/dist/i18n/locales/ja.json +2 -0
- package/dist/i18n/locales/ko.json +2 -0
- package/dist/i18n/locales/nb.json +2 -0
- package/dist/i18n/locales/nl.json +2 -0
- package/dist/i18n/locales/pl.json +2 -0
- package/dist/i18n/locales/pt-BR.json +2 -0
- package/dist/i18n/locales/pt-PT.json +2 -0
- package/dist/i18n/locales/ro.json +2 -0
- package/dist/i18n/locales/ru.json +2 -0
- package/dist/i18n/locales/sv.json +2 -0
- package/dist/i18n/locales/tr.json +2 -0
- package/dist/i18n/locales/uk.json +2 -0
- package/dist/i18n/locales/zh-CN.json +2 -0
- package/dist/i18n/locales/zh-HK.json +2 -0
- package/dist/i18n/locales/zh-TW.json +2 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +2 -2
- package/dist/llms-full.txt +1038 -451
- package/dist/llms-medium.txt +33 -28
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -3
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +5 -5
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +323 -307
- package/llms.txt +2 -2
- package/package.json +3 -1
- package/scripts/README.md +2 -0
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/agent-setup.mjs +44 -26
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +93 -12
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -1,47 +1,50 @@
|
|
|
1
1
|
import { closeOnRelease as e } from "../../utils/releasedActivator.js";
|
|
2
2
|
import { asSheetAttrs as t } from "../BbOffCanvas/sheetAttrs.js";
|
|
3
3
|
import { useId as n } from "../../composables/useId.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { useOwnModel as r } from "../../composables/useOwnModel.js";
|
|
5
|
+
import { isTopEscapeEntry as i, pushEscapeEntry as a, removeEscapeEntry as o } from "../../utils/overlayEscapeStack.js";
|
|
6
|
+
import { useBbDropdownHost as s } from "../../composables/useBbDropdown.js";
|
|
7
|
+
import { useLogger as c } from "../../composables/useLogger.js";
|
|
7
8
|
import { useMobile as ee } from "../../composables/useMobile.js";
|
|
8
9
|
import { provideSheetSurface as te } from "../../composables/useSheetSurface.js";
|
|
9
10
|
import { useUntil as ne } from "../../composables/useUntil.js";
|
|
10
11
|
import { useClosingInert as re } from "../../composables/useClosingInert.js";
|
|
11
12
|
import { useConfigDefaults as ie, useConfigSetting as ae } from "../../composables/useConfigDefaults.js";
|
|
12
|
-
import { wait as
|
|
13
|
+
import { wait as l } from "../../utilities/functions/wait.js";
|
|
13
14
|
import { registerDropdownHandle as oe } from "./dropdownHandle.js";
|
|
14
15
|
import { focusQuietly as se } from "../../utils/focusVisibility.js";
|
|
15
16
|
import ce from "../CommonPopover/CommonPopover.vue.js";
|
|
16
17
|
import le from "./BbDropdownList.vue.js";
|
|
17
|
-
import ue from "./
|
|
18
|
-
import de from "
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
18
|
+
import ue from "./DropdownFailures.vue.js";
|
|
19
|
+
import { runRetry as de } from "../../utils/loadRetry.js";
|
|
20
|
+
import fe from "./AdaptiveDropdown.vue.js";
|
|
21
|
+
import pe from "./DropdownPipelineResolver.vue.js";
|
|
22
|
+
import { hash as me } from "../../utilities/functions/hash.js";
|
|
23
|
+
import { readableValue as he } from "../../utilities/functions/readableValue.js";
|
|
24
|
+
import { settlesVisible as ge } from "../../utilities/functions/settlesVisible.js";
|
|
25
|
+
import { domElement as _e, extractDomContainer as ve } from "../../utilities/functions/extractDomContainer.js";
|
|
26
|
+
import { parseWidthString as ye } from "../../utilities/functions/parseWidthString.js";
|
|
27
|
+
import { levelHasSearch as be, normalizeGroups as xe } from "./normalizeGroups.js";
|
|
28
|
+
import { provideDropdownContext as Se } from "./useDropdownContext.js";
|
|
29
|
+
import { provideDropdownGroupRegistry as Ce } from "./useDropdownGroupRegistry.js";
|
|
30
|
+
import { BB_DROPDOWN_PT as we, groupItemsAsArray as u, isGroup as d, isPrimitiveRow as f, isSelectableGroup as Te } from "./types.js";
|
|
31
|
+
import { usePassthrough as Ee, variantPt as p } from "../../composables/usePassthrough.js";
|
|
32
|
+
import { withoutClass as De } from "../../utils/passthrough.js";
|
|
33
|
+
import { transitions as Oe } from "../../utilities/misc/transitions.js";
|
|
34
|
+
import { removedPropsFor as ke } from "../../deprecation/removedProps.js";
|
|
35
|
+
import { warnRemovedAttrs as Ae } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
36
|
+
import { Fragment as je, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as Me, createVNode as Ne, defineComponent as v, getCurrentInstance as Pe, guardReactiveProps as Fe, mergeProps as y, normalizeProps as Ie, onBeforeUnmount as Le, onDeactivated as Re, onMounted as ze, openBlock as b, reactive as x, ref as S, renderList as Be, renderSlot as Ve, shallowRef as He, toDisplayString as Ue, unref as C, useSlots as We, useTemplateRef as Ge, watch as w, withCtx as Ke } from "vue";
|
|
37
|
+
import { useElementSize as qe, useIntersectionObserver as Je } from "@vueuse/core";
|
|
35
38
|
// src/components/BbDropdown/BbDropdown.vue?vue&type=script&setup=true&lang.ts
|
|
36
|
-
var
|
|
39
|
+
var Ye = [
|
|
37
40
|
"id",
|
|
38
41
|
"aria-labelledby",
|
|
39
42
|
"role"
|
|
40
|
-
],
|
|
43
|
+
], Xe = {
|
|
41
44
|
class: "bb-sr-only",
|
|
42
45
|
role: "status"
|
|
43
|
-
},
|
|
44
|
-
mixins: [
|
|
46
|
+
}, Ze = "bb-dropdown:open", Qe = 500, $e = 10, T = /*@__PURE__*/ v({
|
|
47
|
+
mixins: [p(we)],
|
|
45
48
|
inheritAttrs: !1,
|
|
46
49
|
__name: "BbDropdown",
|
|
47
50
|
props: {
|
|
@@ -55,10 +58,16 @@ var We = [
|
|
|
55
58
|
"pt:header:open": {},
|
|
56
59
|
"pt:footer": {},
|
|
57
60
|
"pt:footer:open": {},
|
|
61
|
+
"pt:box": {},
|
|
62
|
+
"pt:box:open": {},
|
|
58
63
|
"pt:input": {},
|
|
59
64
|
"pt:input:open": {},
|
|
60
65
|
"pt:list": {},
|
|
61
66
|
"pt:list:open": {},
|
|
67
|
+
"pt:groupLabel": {},
|
|
68
|
+
"pt:groupLabel:open": {},
|
|
69
|
+
"pt:groupHeader": {},
|
|
70
|
+
"pt:groupHeader:open": {},
|
|
62
71
|
"pt:item": {},
|
|
63
72
|
"pt:item:activeLink": {},
|
|
64
73
|
"pt:item:exactActiveLink": {},
|
|
@@ -116,6 +125,10 @@ var We = [
|
|
|
116
125
|
default: void 0
|
|
117
126
|
},
|
|
118
127
|
anchor: {},
|
|
128
|
+
modelValue: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: void 0
|
|
131
|
+
},
|
|
119
132
|
boundary: {},
|
|
120
133
|
disabled: { type: Boolean },
|
|
121
134
|
eager: { type: Boolean },
|
|
@@ -131,11 +144,12 @@ var We = [
|
|
|
131
144
|
padding: { default: 10 },
|
|
132
145
|
placement: { default: "bottom" },
|
|
133
146
|
queryDebounceTime: { default: 300 },
|
|
134
|
-
transitionDuration: { default:
|
|
147
|
+
transitionDuration: { default: Oe.fast },
|
|
135
148
|
trigger: { default: "click" },
|
|
136
149
|
width: { default: "auto" }
|
|
137
150
|
},
|
|
138
151
|
emits: [
|
|
152
|
+
"update:modelValue",
|
|
139
153
|
"show",
|
|
140
154
|
"shown",
|
|
141
155
|
"hide",
|
|
@@ -143,56 +157,56 @@ var We = [
|
|
|
143
157
|
"item:selected",
|
|
144
158
|
"item:unselected"
|
|
145
159
|
],
|
|
146
|
-
setup(
|
|
147
|
-
let
|
|
160
|
+
setup(p, { emit: Oe }) {
|
|
161
|
+
let v = p, T = Oe, et = ae(null, "popoverOffset"), E = Ee({
|
|
148
162
|
component: "BbDropdown",
|
|
149
|
-
props:
|
|
150
|
-
parts:
|
|
151
|
-
states:
|
|
152
|
-
active: { open: () =>
|
|
153
|
-
variant:
|
|
163
|
+
props: v,
|
|
164
|
+
parts: we.parts,
|
|
165
|
+
states: we.states,
|
|
166
|
+
active: { open: () => A.value },
|
|
167
|
+
variant: we.variant
|
|
154
168
|
});
|
|
155
|
-
process.env.NODE_ENV !== "production" &&
|
|
156
|
-
let
|
|
157
|
-
onShow: () =>
|
|
158
|
-
onShown: () =>
|
|
159
|
-
onHide: () =>
|
|
160
|
-
onHidden: () =>
|
|
161
|
-
},
|
|
162
|
-
id: z.value ? `dialog_${
|
|
169
|
+
process.env.NODE_ENV !== "production" && Ae("BbDropdown", ke("BbDropdown"));
|
|
170
|
+
let tt = c(), nt = n().id.value, D = v.id ?? `bb_${nt}`, rt = Symbol("bb-dropdown-escape"), O = S(D), k = S(), it = m(() => ve(k.value)), at = m(() => v.activator != null), A = S(!1), ot = {
|
|
171
|
+
onShow: () => T("show"),
|
|
172
|
+
onShown: () => T("shown"),
|
|
173
|
+
onHide: () => T("hide"),
|
|
174
|
+
onHidden: () => T("hidden")
|
|
175
|
+
}, st = ne(A, { initialValue: v.eager }), ct = re(A, () => v.transitionDuration), lt = m(() => v.eager || !ct.value), ut = ({ availableHeight: e }) => y({
|
|
176
|
+
id: z.value ? `dialog_${D}` : void 0,
|
|
163
177
|
"aria-labelledby": z.value ? O.value : void 0,
|
|
164
|
-
class: ["bb-dropdown__panel", { "bb-dropdown__panel--reserve-check":
|
|
165
|
-
"data-bb-dropdown-surface":
|
|
166
|
-
inert:
|
|
178
|
+
class: ["bb-dropdown__panel", { "bb-dropdown__panel--reserve-check": Ln.value }],
|
|
179
|
+
"data-bb-dropdown-surface": D,
|
|
180
|
+
inert: ct.value,
|
|
167
181
|
role: z.value ? "dialog" : void 0,
|
|
168
182
|
style: {
|
|
169
|
-
"--w":
|
|
183
|
+
"--w": zn.value,
|
|
170
184
|
"--max-h": e == null ? void 0 : `${e}px`
|
|
171
185
|
}
|
|
172
|
-
},
|
|
186
|
+
}, E.panel), dt = x({}), ft = x(/* @__PURE__ */ new Set()), { isMobile: pt } = ee(), mt = ie("BbDropdown", v, {
|
|
173
187
|
adaptive: !0,
|
|
174
188
|
compact: !1
|
|
175
|
-
}),
|
|
176
|
-
|
|
177
|
-
() =>
|
|
178
|
-
|
|
179
|
-
|
|
189
|
+
}), ht = () => mt.adaptive && pt.value ? "canvas" : "popover", gt = S(ht()), j = m(() => gt.value === "canvas");
|
|
190
|
+
w([
|
|
191
|
+
() => mt.adaptive,
|
|
192
|
+
pt,
|
|
193
|
+
A
|
|
180
194
|
], () => {
|
|
181
|
-
|
|
182
|
-
}), te(
|
|
183
|
-
let
|
|
195
|
+
A.value || (gt.value = ht());
|
|
196
|
+
}), te(j);
|
|
197
|
+
let _t = m(() => ({
|
|
184
198
|
side: "bottom",
|
|
185
199
|
size: "auto",
|
|
186
200
|
draggable: !0,
|
|
187
|
-
eager:
|
|
188
|
-
transitionDuration:
|
|
201
|
+
eager: v.eager,
|
|
202
|
+
transitionDuration: v.transitionDuration,
|
|
189
203
|
hideClose: !0,
|
|
190
|
-
...
|
|
191
|
-
})),
|
|
192
|
-
let e =
|
|
204
|
+
...v.offCanvasProps
|
|
205
|
+
})), vt = m(() => {
|
|
206
|
+
let e = v.trigger;
|
|
193
207
|
return new Set(Array.isArray(e) ? e : [e]);
|
|
194
|
-
}),
|
|
195
|
-
let n =
|
|
208
|
+
}), yt = (e, t) => {
|
|
209
|
+
let n = it.value, r = n?.getBoundingClientRect(), i = r ? e - r.left : 0, a = r ? t - r.top : 0;
|
|
196
210
|
return {
|
|
197
211
|
contextElement: n ?? void 0,
|
|
198
212
|
getBoundingClientRect: () => {
|
|
@@ -212,56 +226,58 @@ var We = [
|
|
|
212
226
|
};
|
|
213
227
|
}
|
|
214
228
|
};
|
|
215
|
-
},
|
|
216
|
-
|
|
229
|
+
}, M = S(null), bt = m(() => v.anchor ?? k.value), xt = m(() => ve(bt.value)), St = Pe(), Ct = He(null);
|
|
230
|
+
ze(() => Ct.value = St?.vnode.el?.parentElement ?? null);
|
|
231
|
+
let wt = m(() => (xt.value ?? Ct.value)?.closest(".bb-table") ?? void 0), Tt = m(() => v.placement === "cursor" && M.value ? M.value : bt.value), Et = (e) => {
|
|
232
|
+
let t = ve(e);
|
|
217
233
|
t && (k.value = t);
|
|
218
|
-
},
|
|
219
|
-
if (
|
|
220
|
-
|
|
234
|
+
}, Dt = !1, { resume: Ot, pause: kt } = Je(() => _e(it.value), async ([{ intersectionRatio: e }]) => {
|
|
235
|
+
if (Dt) {
|
|
236
|
+
Dt = !1;
|
|
221
237
|
return;
|
|
222
238
|
}
|
|
223
|
-
if (e >= .99 || !
|
|
224
|
-
let t =
|
|
225
|
-
t && await
|
|
239
|
+
if (e >= .99 || !A.value) return;
|
|
240
|
+
let t = it.value;
|
|
241
|
+
t && await ge(t) || A.value && await $();
|
|
226
242
|
}, {
|
|
227
243
|
threshold: [0, 1],
|
|
228
244
|
immediate: !1
|
|
229
|
-
}),
|
|
245
|
+
}), N = x({}), At = x(/* @__PURE__ */ new Map()), P = x(/* @__PURE__ */ new Map()), F = /* @__PURE__ */ new Map(), jt = /* @__PURE__ */ new Map(), Mt = !1, Nt = (e) => !!F.get(e)?.controlled(), I = (e, t) => F.get(e)?.request(t), L = (e, t) => {
|
|
230
246
|
for (let n of e) {
|
|
231
|
-
if (
|
|
232
|
-
if (
|
|
247
|
+
if (f(n)) continue;
|
|
248
|
+
if (d(n)) {
|
|
233
249
|
if (n.id === t) return n;
|
|
234
|
-
for (let e of
|
|
250
|
+
for (let e of u(n.items)) {
|
|
235
251
|
let n = Array.isArray(e) ? e : [e];
|
|
236
252
|
for (let e of n) {
|
|
237
|
-
let n = e.items ?
|
|
253
|
+
let n = e.items ? L(e.items, t) : void 0;
|
|
238
254
|
if (n) return n;
|
|
239
255
|
}
|
|
240
256
|
}
|
|
241
257
|
continue;
|
|
242
258
|
}
|
|
243
259
|
if (Array.isArray(n)) {
|
|
244
|
-
let e =
|
|
260
|
+
let e = L(n, t);
|
|
245
261
|
if (e) return e;
|
|
246
262
|
continue;
|
|
247
263
|
}
|
|
248
|
-
let e = n.items ?
|
|
264
|
+
let e = n.items ? L(n.items, t) : void 0;
|
|
249
265
|
if (e) return e;
|
|
250
266
|
}
|
|
251
|
-
},
|
|
252
|
-
for (let n of e) if (
|
|
267
|
+
}, R = (e, t) => {
|
|
268
|
+
for (let n of e) if (f(n)) {
|
|
253
269
|
if (n === t) return "item";
|
|
254
270
|
} else if (Array.isArray(n)) {
|
|
255
|
-
let e =
|
|
271
|
+
let e = R(n, t);
|
|
256
272
|
if (e) return e;
|
|
257
|
-
} else if (
|
|
273
|
+
} else if (d(n)) {
|
|
258
274
|
if (n.id === t) return "group";
|
|
259
|
-
for (let e of
|
|
275
|
+
for (let e of u(n.items)) {
|
|
260
276
|
let n = Array.isArray(e) ? e : [e];
|
|
261
277
|
for (let e of n) {
|
|
262
278
|
if (e.value === t) return "item";
|
|
263
279
|
if (e.items) {
|
|
264
|
-
let n =
|
|
280
|
+
let n = R(e.items, t);
|
|
265
281
|
if (n) return n;
|
|
266
282
|
}
|
|
267
283
|
}
|
|
@@ -269,11 +285,11 @@ var We = [
|
|
|
269
285
|
} else {
|
|
270
286
|
if (n.value === t) return "item";
|
|
271
287
|
if (n.items) {
|
|
272
|
-
let e =
|
|
288
|
+
let e = R(n.items, t);
|
|
273
289
|
if (e) return e;
|
|
274
290
|
}
|
|
275
291
|
}
|
|
276
|
-
},
|
|
292
|
+
}, Pt = m(() => Array.from(At.values()).map((e) => e.value).sort((e, t) => e.order - t.order)), Ft = (e, t) => ({
|
|
277
293
|
...e,
|
|
278
294
|
group: !0,
|
|
279
295
|
id: e.id,
|
|
@@ -287,7 +303,7 @@ var We = [
|
|
|
287
303
|
"append:icon": t["append:icon"] ?? e["append:icon"],
|
|
288
304
|
variant: t.variant ?? e.variant,
|
|
289
305
|
onClick: t.onClick ?? e.onClick
|
|
290
|
-
}),
|
|
306
|
+
}), It = (e, t) => ({
|
|
291
307
|
group: !0,
|
|
292
308
|
id: e.key,
|
|
293
309
|
label: e.label ?? t?.label,
|
|
@@ -300,10 +316,10 @@ var We = [
|
|
|
300
316
|
"append:icon": e["append:icon"] ?? t?.["append:icon"],
|
|
301
317
|
variant: e.variant ?? t?.variant,
|
|
302
318
|
onClick: e.onClick ?? t?.onClick
|
|
303
|
-
}),
|
|
319
|
+
}), Lt = (e, t) => {
|
|
304
320
|
let n = !1, r = (e) => {
|
|
305
321
|
if (!e.items) return e;
|
|
306
|
-
let r =
|
|
322
|
+
let r = Lt(e.items, t);
|
|
307
323
|
return r.found ? (n = !0, {
|
|
308
324
|
...e,
|
|
309
325
|
items: r.items
|
|
@@ -311,57 +327,57 @@ var We = [
|
|
|
311
327
|
};
|
|
312
328
|
return {
|
|
313
329
|
items: e.map((e) => {
|
|
314
|
-
if (
|
|
315
|
-
if (e.id === t.id) return n = !0,
|
|
330
|
+
if (d(e)) {
|
|
331
|
+
if (e.id === t.id) return n = !0, Ft(e, t);
|
|
316
332
|
if (typeof e.items == "function") return e;
|
|
317
|
-
let i =
|
|
333
|
+
let i = u(e.items).map((e) => Array.isArray(e) ? e.map((e) => r(e)) : r(e));
|
|
318
334
|
return {
|
|
319
335
|
...e,
|
|
320
336
|
items: i
|
|
321
337
|
};
|
|
322
338
|
}
|
|
323
339
|
if (Array.isArray(e)) {
|
|
324
|
-
let r =
|
|
340
|
+
let r = Lt(e, t);
|
|
325
341
|
return r.found && (n = !0), r.items;
|
|
326
342
|
}
|
|
327
|
-
return
|
|
343
|
+
return f(e) ? e : r(e);
|
|
328
344
|
}),
|
|
329
345
|
found: n
|
|
330
346
|
};
|
|
331
|
-
},
|
|
332
|
-
let e = [...
|
|
333
|
-
for (let t of
|
|
334
|
-
let n =
|
|
335
|
-
!n && !t.items?.length && (
|
|
336
|
-
let r =
|
|
347
|
+
}, Rt = m(() => {
|
|
348
|
+
let e = [...v.items ?? []];
|
|
349
|
+
for (let t of Pt.value) {
|
|
350
|
+
let n = L(e, t.key);
|
|
351
|
+
!n && !t.items?.length && (R(e, t.key) === "item" && tt.throw(`[BbDropdownGroup] "${t.key}" refers to a menu item, not a selectable group. \`<BbDropdownGroup>\` can only attach to a group (an entry with \`selectable\`, \`multiple\`, or \`group: true\`). Point \`id\` at a group \`id\`.`), tt.throw(`[BbDropdownGroup] Missing minimum config for group "${t.key}". Provide \`items\`, \`selectable\`, \`multiple\`, or \`group\` keys in order to identify a group or define a baseline group with the same \`id\` in \`BbDropdown.items\`.`));
|
|
352
|
+
let r = It(t, n), i = Lt(e, r);
|
|
337
353
|
e = i.found ? i.items : [...i.items, r];
|
|
338
354
|
}
|
|
339
355
|
return e;
|
|
340
|
-
}),
|
|
341
|
-
let t =
|
|
356
|
+
}), zt = (e) => {
|
|
357
|
+
let t = N[e.id ?? ""] ?? [];
|
|
342
358
|
if (e.multiple || t.length || !e.id) return t;
|
|
343
|
-
let n =
|
|
359
|
+
let n = B.value.includes(e.id), r = e.items.find((t) => !t.keyless && !t.placeholder && (n ? V[e.id]?.valueByKey.get(t.rowKey) === null : t.value === null));
|
|
344
360
|
return r ? [r.rowKey] : t;
|
|
345
|
-
},
|
|
361
|
+
}, Bt = m(() => xe(Rt.value)), Vt = m(() => Bt.value.map((e) => e.selectable ? {
|
|
346
362
|
...e,
|
|
347
|
-
selected:
|
|
348
|
-
} : e)), z =
|
|
349
|
-
for (let n of e) if (!
|
|
350
|
-
if (
|
|
351
|
-
n.id &&
|
|
352
|
-
for (let e of
|
|
353
|
-
} else Array.isArray(n) ?
|
|
363
|
+
selected: zt(e)
|
|
364
|
+
} : e)), z = m(() => be(Vt.value)), Ht = S(), Ut = m(() => z.value || j.value ? "dialog" : "menu"), Wt = m(() => z.value && !j.value ? `dialog_${D}` : `menu_${D}`), Gt = (e) => typeof e.items == "function" || e.itemText != null || e.itemProps != null || e.itemValue != null || e.max != null, Kt = (e, t = []) => {
|
|
365
|
+
for (let n of e) if (!f(n)) {
|
|
366
|
+
if (d(n)) {
|
|
367
|
+
n.id && Gt(n) && t.push(n.id);
|
|
368
|
+
for (let e of u(n.items)) for (let n of Array.isArray(e) ? e : [e]) n.items && Kt(n.items, t);
|
|
369
|
+
} else Array.isArray(n) ? Kt(n, t) : n.items && Kt(n.items, t);
|
|
354
370
|
}
|
|
355
371
|
return t;
|
|
356
|
-
},
|
|
357
|
-
let t =
|
|
372
|
+
}, B = m(() => Kt(v.items ?? [])), qt = m(() => (v.items ?? []).filter((e) => d(e) && !!e.id && Gt(e)).map((e) => e.id)), V = x({}), Jt = x({}), Yt = x({}), Xt = x({}), H = (e, t) => B.value.includes(e) ? V[e]?.valueByKey.get(t) : U(e)?.items.find((e) => e.rowKey === t && !e.keyless)?.value, Zt = (e) => {
|
|
373
|
+
let t = L(v.items ?? [], e);
|
|
358
374
|
if (t) return {
|
|
359
375
|
multiple: t.multiple ?? !1,
|
|
360
|
-
selectable:
|
|
376
|
+
selectable: Te(t)
|
|
361
377
|
};
|
|
362
|
-
},
|
|
378
|
+
}, U = (e) => {
|
|
363
379
|
let t = (n) => {
|
|
364
|
-
for (let r of
|
|
380
|
+
for (let r of xe(n)) {
|
|
365
381
|
if (r.id === e) return r;
|
|
366
382
|
for (let e of r.items) if (e.items) {
|
|
367
383
|
let n = t(e.items);
|
|
@@ -369,77 +385,80 @@ var We = [
|
|
|
369
385
|
}
|
|
370
386
|
}
|
|
371
387
|
};
|
|
372
|
-
return t(
|
|
373
|
-
},
|
|
374
|
-
if (
|
|
375
|
-
let t = (
|
|
376
|
-
return
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
bindController: (e, t) =>
|
|
380
|
-
unbindController: (e, t) =>
|
|
388
|
+
return t(Rt.value);
|
|
389
|
+
}, Qt = (e, t) => me(t), $t = (e) => {
|
|
390
|
+
if (P.has(e)) return P.get(e);
|
|
391
|
+
let t = (N[e] ?? []).map((t) => H(e, t));
|
|
392
|
+
return Zt(e)?.multiple ? t : t[0] ?? null;
|
|
393
|
+
}, en = (e, t) => [].concat(P.get(e) ?? []).find((n) => Qt(e, n) === t);
|
|
394
|
+
Ce({
|
|
395
|
+
bindController: (e, t) => F.set(e, t),
|
|
396
|
+
unbindController: (e, t) => F.get(e) === t && (F.delete(e), !0),
|
|
381
397
|
onPick: (e, t) => {
|
|
382
|
-
t ?
|
|
398
|
+
t ? jt.set(e, t) : jt.delete(e);
|
|
383
399
|
},
|
|
384
|
-
isControlled:
|
|
385
|
-
request:
|
|
386
|
-
register: (e, t) =>
|
|
387
|
-
unregister: (e) =>
|
|
400
|
+
isControlled: Nt,
|
|
401
|
+
request: I,
|
|
402
|
+
register: (e, t) => At.set(e, t),
|
|
403
|
+
unregister: (e) => At.delete(e),
|
|
388
404
|
seed: (e, t) => {
|
|
389
|
-
e in
|
|
405
|
+
e in N || (N[e] = t);
|
|
390
406
|
},
|
|
391
407
|
setSelection: (e, t) => {
|
|
392
|
-
|
|
408
|
+
Mt = !0;
|
|
393
409
|
try {
|
|
394
|
-
|
|
410
|
+
N[e] = t;
|
|
395
411
|
} finally {
|
|
396
|
-
|
|
412
|
+
Mt = !1;
|
|
397
413
|
}
|
|
398
414
|
},
|
|
399
|
-
isAppWrite: () =>
|
|
400
|
-
selectionFor: (e) =>
|
|
401
|
-
isPipeline: (e) =>
|
|
415
|
+
isAppWrite: () => Mt,
|
|
416
|
+
selectionFor: (e) => N[e] ?? [],
|
|
417
|
+
isPipeline: (e) => B.value.includes(e),
|
|
402
418
|
publishPipeline: (e, t) => {
|
|
403
|
-
t ?
|
|
419
|
+
t ? V[e] = t : delete V[e];
|
|
404
420
|
},
|
|
405
421
|
publishLoading: (e, t) => {
|
|
406
|
-
t ?
|
|
422
|
+
t ? Jt[e] = !0 : delete Jt[e];
|
|
407
423
|
},
|
|
408
424
|
publishFetching: (e, t) => {
|
|
409
|
-
t ?
|
|
425
|
+
t ? Yt[e] = !0 : delete Yt[e];
|
|
426
|
+
},
|
|
427
|
+
publishFailure: (e, t) => {
|
|
428
|
+
t ? Xt[e] = t : delete Xt[e];
|
|
410
429
|
},
|
|
411
430
|
publishModel: (e, t) => {
|
|
412
|
-
t === void 0 ?
|
|
431
|
+
t === void 0 ? P.delete(e) : P.set(e, t);
|
|
413
432
|
},
|
|
414
|
-
modelValueFor:
|
|
415
|
-
valueForKey:
|
|
416
|
-
keyForValue:
|
|
417
|
-
itemForKey: (e, t) =>
|
|
418
|
-
configFor: (e) =>
|
|
419
|
-
itemsFor: (e) =>
|
|
420
|
-
selectableFor: (e) =>
|
|
421
|
-
multipleFor: (e) =>
|
|
433
|
+
modelValueFor: $t,
|
|
434
|
+
valueForKey: H,
|
|
435
|
+
keyForValue: Qt,
|
|
436
|
+
itemForKey: (e, t) => V[e]?.itemByKey.get(t) ?? U(e)?.items.find((e) => e.rowKey === t),
|
|
437
|
+
configFor: (e) => L(v.items ?? [], e),
|
|
438
|
+
itemsFor: (e) => U(e)?.items ?? [],
|
|
439
|
+
selectableFor: (e) => Zt(e)?.selectable,
|
|
440
|
+
multipleFor: (e) => Zt(e)?.multiple
|
|
422
441
|
});
|
|
423
|
-
let
|
|
424
|
-
|
|
425
|
-
let
|
|
426
|
-
|
|
442
|
+
let tn = S(!!We().default);
|
|
443
|
+
ze(() => tn.value = !1);
|
|
444
|
+
let nn = m(() => B.value.some((e) => !Pt.value.some((t) => t.key === e && Array.isArray(t.items)))), W = m(() => !tn.value && !nn.value && !Bt.value.length), rn = m(() => !!v.keepActivator || vt.value.has("contextMenu")), an = S(!1), on = m(() => !W.value || rn.value || an.value);
|
|
445
|
+
w(W, (e) => {
|
|
427
446
|
if (!e) {
|
|
428
|
-
|
|
447
|
+
an.value = !1;
|
|
429
448
|
return;
|
|
430
449
|
}
|
|
431
|
-
if (
|
|
432
|
-
let e = !!document.activeElement?.closest(`[data-bb-dropdown-surface="${CSS.escape(
|
|
433
|
-
$(), e &&
|
|
450
|
+
if (A.value) {
|
|
451
|
+
let e = !!document.activeElement?.closest(`[data-bb-dropdown-surface="${CSS.escape(D)}"]`);
|
|
452
|
+
$(), e && q();
|
|
434
453
|
}
|
|
435
|
-
let t =
|
|
436
|
-
if (
|
|
437
|
-
|
|
454
|
+
let t = it.value;
|
|
455
|
+
if (rn.value || !(t instanceof HTMLElement) || !t.contains(document.activeElement)) return;
|
|
456
|
+
an.value = !0;
|
|
438
457
|
let n = (e) => {
|
|
439
|
-
t.contains(e.relatedTarget) || (t.removeEventListener("focusout", n),
|
|
458
|
+
t.contains(e.relatedTarget) || (t.removeEventListener("focusout", n), an.value = !1);
|
|
440
459
|
};
|
|
441
460
|
t.addEventListener("focusout", n);
|
|
442
|
-
}),
|
|
461
|
+
}), w([k, () => at.value && !on.value], ([e, t], n, r) => {
|
|
443
462
|
if (!t || !e) return;
|
|
444
463
|
let { style: i } = e;
|
|
445
464
|
if (!i) return;
|
|
@@ -448,27 +467,27 @@ var We = [
|
|
|
448
467
|
i.getPropertyValue("display") === "none" && (a ? i.setProperty("display", a, o) : i.removeProperty("display"));
|
|
449
468
|
});
|
|
450
469
|
}, { immediate: !0 });
|
|
451
|
-
let
|
|
452
|
-
for (let n of e) if (!
|
|
453
|
-
if (
|
|
454
|
-
n.id &&
|
|
455
|
-
for (let e of
|
|
456
|
-
} else Array.isArray(n) ?
|
|
470
|
+
let sn = (e, t = []) => {
|
|
471
|
+
for (let n of e) if (!f(n)) {
|
|
472
|
+
if (d(n)) {
|
|
473
|
+
n.id && Te(n) && t.push(n.id);
|
|
474
|
+
for (let e of u(n.items)) for (let n of Array.isArray(e) ? e : [e]) n.items && sn(n.items, t);
|
|
475
|
+
} else Array.isArray(n) ? sn(n, t) : n.items && sn(n.items, t);
|
|
457
476
|
}
|
|
458
477
|
return t;
|
|
459
|
-
},
|
|
478
|
+
}, cn = m(() => {
|
|
460
479
|
let e = {};
|
|
461
|
-
for (let t of
|
|
462
|
-
let n =
|
|
480
|
+
for (let t of sn(Rt.value)) {
|
|
481
|
+
let n = $t(t), r = (Zt(t)?.multiple ? [].concat(n) : [n]).filter((e) => e != null), i = V[t], a = U(t), o = L(Rt.value, t), { items: s, ...c } = o ?? {};
|
|
463
482
|
e[t] = {
|
|
464
|
-
...
|
|
483
|
+
...c,
|
|
465
484
|
id: t,
|
|
466
485
|
value: n,
|
|
467
486
|
multiple: o?.multiple ?? !1,
|
|
468
|
-
selectable: o ?
|
|
469
|
-
loading: !!
|
|
487
|
+
selectable: o ? Te(o) : !1,
|
|
488
|
+
loading: !!Yt[t],
|
|
470
489
|
selectedOptions: r.map((e) => {
|
|
471
|
-
let n =
|
|
490
|
+
let n = Qt(t, e), r = a?.items.find((e) => e.rowKey === n);
|
|
472
491
|
return {
|
|
473
492
|
value: e,
|
|
474
493
|
label: i?.textByKey.get(n) ?? r?.label,
|
|
@@ -480,312 +499,340 @@ var We = [
|
|
|
480
499
|
}
|
|
481
500
|
return e;
|
|
482
501
|
});
|
|
483
|
-
|
|
484
|
-
open: () =>
|
|
485
|
-
empty: () =>
|
|
486
|
-
groups: () =>
|
|
502
|
+
s(() => v.id, {
|
|
503
|
+
open: () => A.value,
|
|
504
|
+
empty: () => W.value,
|
|
505
|
+
groups: () => cn.value
|
|
487
506
|
});
|
|
488
|
-
let
|
|
507
|
+
let ln = (e, t) => {
|
|
489
508
|
let n = e.id;
|
|
490
509
|
if (!n) return;
|
|
491
|
-
let r =
|
|
510
|
+
let r = zt(e), i = new Set(r);
|
|
492
511
|
e.multiple ? i.has(t.rowKey) ? i.delete(t.rowKey) : i.add(t.rowKey) : i.has(t.rowKey) ? e.clearable && i.clear() : (i.clear(), i.add(t.rowKey));
|
|
493
|
-
let a = [...i], o = a.filter((e) => !r.includes(e)), s = r.filter((e) => !a.includes(e)),
|
|
494
|
-
if (
|
|
495
|
-
let r =
|
|
496
|
-
o.length &&
|
|
497
|
-
} else
|
|
498
|
-
let
|
|
512
|
+
let a = [...i], o = a.filter((e) => !r.includes(e)), s = r.filter((e) => !a.includes(e)), c = Nt(n);
|
|
513
|
+
if (c) {
|
|
514
|
+
let r = H(n, t.rowKey);
|
|
515
|
+
o.length && jt.get(n)?.(t.rowKey), e.multiple ? o.length ? I(n, { add: r }) : s.length && I(n, { remove: r }) : o.length ? I(n, { replace: r }) : s.length && I(n, { clear: !0 });
|
|
516
|
+
} else N[n] = a;
|
|
517
|
+
let ee = (t) => e.items.find((e) => e.rowKey === t);
|
|
499
518
|
o.forEach((e) => {
|
|
500
|
-
|
|
519
|
+
ee(e) && T("item:selected", H(n, e));
|
|
501
520
|
}), s.forEach((e) => {
|
|
502
|
-
|
|
503
|
-
}), (o.length > 0 || s.length > 0 || r.includes(t.rowKey) && a.includes(t.rowKey)) && (
|
|
504
|
-
},
|
|
521
|
+
ee(e) ? T("item:unselected", H(n, e)) : c && T("item:unselected", en(n, e));
|
|
522
|
+
}), (o.length > 0 || s.length > 0 || r.includes(t.rowKey) && a.includes(t.rowKey)) && (v.closeOnSelect ?? !e.multiple) && mn();
|
|
523
|
+
}, un = x(/* @__PURE__ */ new Set()), dn = (e) => un.has(e), fn = m(() => un.size > 0), pn = (e) => e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function", mn = async () => {
|
|
505
524
|
await $();
|
|
506
525
|
let e = document.activeElement;
|
|
507
|
-
e instanceof HTMLElement && e !== document.body && !e.closest(`[data-bb-dropdown-surface="${
|
|
508
|
-
},
|
|
526
|
+
e instanceof HTMLElement && e !== document.body && !e.closest(`[data-bb-dropdown-surface="${D}"]`) || q();
|
|
527
|
+
}, hn = async (e, t, { close: n = !1 } = {}) => {
|
|
509
528
|
let r = e.onClick?.(t);
|
|
510
|
-
if (n && await
|
|
511
|
-
|
|
529
|
+
if (n && await mn(), pn(r)) {
|
|
530
|
+
un.add(e.rowKey);
|
|
512
531
|
try {
|
|
513
532
|
await r;
|
|
514
533
|
} finally {
|
|
515
|
-
|
|
534
|
+
un.delete(e.rowKey);
|
|
516
535
|
}
|
|
517
536
|
}
|
|
518
|
-
},
|
|
519
|
-
(k.value ?? (O.value ? document.getElementById(O.value) : null) ??
|
|
520
|
-
},
|
|
521
|
-
|
|
522
|
-
passthrough:
|
|
523
|
-
rootId:
|
|
537
|
+
}, G = Ge("root-list"), K, q = () => {
|
|
538
|
+
((k.value?.isConnected ? k.value : void 0) ?? (O.value ? document.getElementById(O.value) : null) ?? gn)?.focus();
|
|
539
|
+
}, gn = null;
|
|
540
|
+
Se({
|
|
541
|
+
passthrough: E,
|
|
542
|
+
rootId: D,
|
|
524
543
|
activatorId: O,
|
|
525
544
|
setStatus: (e) => {
|
|
526
|
-
|
|
545
|
+
Ht.value = e;
|
|
546
|
+
},
|
|
547
|
+
status: Ht,
|
|
548
|
+
failures: m(() => Object.entries(Xt).filter(([e]) => qt.value.includes(e)).map(([e, { text: t }]) => ({
|
|
549
|
+
key: e,
|
|
550
|
+
text: t
|
|
551
|
+
}))),
|
|
552
|
+
retryFailure: (e, t) => {
|
|
553
|
+
let n = Xt[e];
|
|
554
|
+
if (!n) return;
|
|
555
|
+
let r = t.currentTarget?.closest("[data-bb-dropdown-surface], dialog");
|
|
556
|
+
de(t, n.retry, () => r?.querySelector(".bb-dropdown__search-input") ?? r);
|
|
527
557
|
},
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
queryFor: (e) => it[e] ?? "",
|
|
558
|
+
open: A,
|
|
559
|
+
queryFor: (e) => dt[e] ?? "",
|
|
531
560
|
setQuery: (e, t) => {
|
|
532
|
-
|
|
561
|
+
dt[e] = t;
|
|
533
562
|
},
|
|
534
563
|
activateGroup: (e) => {
|
|
535
|
-
|
|
564
|
+
ft.has(e) || ft.add(e);
|
|
536
565
|
},
|
|
537
|
-
isActivated: (e) =>
|
|
538
|
-
isPipelineGroup: (e) =>
|
|
539
|
-
isGroupLoading: (e) => !!
|
|
540
|
-
isTopLevelPipeline: (e) =>
|
|
541
|
-
queryDebounceTime:
|
|
566
|
+
isActivated: (e) => ft.has(e),
|
|
567
|
+
isPipelineGroup: (e) => B.value.includes(e),
|
|
568
|
+
isGroupLoading: (e) => !!Jt[e],
|
|
569
|
+
isTopLevelPipeline: (e) => qt.value.includes(e),
|
|
570
|
+
queryDebounceTime: m(() => v.queryDebounceTime ?? 300),
|
|
542
571
|
selectedFor: (e) => {
|
|
543
|
-
let t =
|
|
544
|
-
return t ?
|
|
572
|
+
let t = U(e);
|
|
573
|
+
return t ? zt(t) : N[e] ?? [];
|
|
545
574
|
},
|
|
546
|
-
loadingText:
|
|
547
|
-
emptyText:
|
|
548
|
-
failedText:
|
|
549
|
-
enforceCoherence:
|
|
550
|
-
placement:
|
|
551
|
-
disabled:
|
|
575
|
+
loadingText: m(() => v.loadingText),
|
|
576
|
+
emptyText: m(() => v.emptyText),
|
|
577
|
+
failedText: m(() => v.failedText),
|
|
578
|
+
enforceCoherence: m(() => v.enforceCoherence),
|
|
579
|
+
placement: m(() => v.placement),
|
|
580
|
+
disabled: m(() => !!v.disabled),
|
|
552
581
|
selectedChipsFor: (e) => {
|
|
553
|
-
let t =
|
|
554
|
-
return (
|
|
582
|
+
let t = U(e), n = V[e];
|
|
583
|
+
return (N[e] ?? []).map((r) => ({
|
|
555
584
|
key: r,
|
|
556
|
-
text: n?.textByKey.get(r) ?? t?.items.find((e) => e.rowKey === r)?.label ??
|
|
585
|
+
text: n?.textByKey.get(r) ?? t?.items.find((e) => e.rowKey === r)?.label ?? he(H(e, r) ?? en(e, r))
|
|
557
586
|
}));
|
|
558
587
|
},
|
|
559
588
|
deselect: (e, t) => {
|
|
560
|
-
let n =
|
|
589
|
+
let n = N[e] ?? [];
|
|
561
590
|
if (n.includes(t)) {
|
|
562
|
-
if (
|
|
563
|
-
let n =
|
|
564
|
-
|
|
565
|
-
} else
|
|
591
|
+
if (Nt(e)) {
|
|
592
|
+
let n = H(e, t) ?? en(e, t);
|
|
593
|
+
I(e, { remove: n }), T("item:unselected", n);
|
|
594
|
+
} else N[e] = n.filter((e) => e !== t), T("item:unselected", H(e, t));
|
|
566
595
|
}
|
|
567
596
|
},
|
|
568
597
|
close: () => $(),
|
|
569
|
-
focusActivator:
|
|
570
|
-
ownsEscape: () =>
|
|
571
|
-
openModality: () =>
|
|
572
|
-
toggleSelect:
|
|
573
|
-
isItemLoading:
|
|
574
|
-
runItemAction:
|
|
575
|
-
slots:
|
|
598
|
+
focusActivator: q,
|
|
599
|
+
ownsEscape: () => i(rt),
|
|
600
|
+
openModality: () => K,
|
|
601
|
+
toggleSelect: ln,
|
|
602
|
+
isItemLoading: dn,
|
|
603
|
+
runItemAction: hn,
|
|
604
|
+
slots: We()
|
|
576
605
|
});
|
|
577
|
-
let
|
|
578
|
-
if (
|
|
579
|
-
if (
|
|
580
|
-
|
|
606
|
+
let _n = (e) => {
|
|
607
|
+
if (v.disabled || W.value) return;
|
|
608
|
+
if (Y) {
|
|
609
|
+
Y = !1, e.preventDefault(), e.stopPropagation();
|
|
581
610
|
return;
|
|
582
611
|
}
|
|
583
|
-
e.stopPropagation(),
|
|
584
|
-
let t =
|
|
585
|
-
|
|
586
|
-
},
|
|
612
|
+
e.stopPropagation(), v.placement === "cursor" && (M.value = yt(e.clientX, e.clientY));
|
|
613
|
+
let t = A.value;
|
|
614
|
+
vn(e), K = e.detail ? "pointer" : void 0, t ? $() : Q();
|
|
615
|
+
}, vn = (e) => {
|
|
587
616
|
let t = e.currentTarget;
|
|
588
617
|
e.detail && t instanceof HTMLElement && (t.contains(document.activeElement) || se(t, { preventScroll: !0 }));
|
|
589
|
-
},
|
|
590
|
-
if (!(
|
|
591
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
592
|
-
let t =
|
|
593
|
-
if (
|
|
594
|
-
await $(), await
|
|
618
|
+
}, yn = async (e) => {
|
|
619
|
+
if (!(v.disabled || W.value)) {
|
|
620
|
+
if (e.preventDefault(), e.stopPropagation(), v.placement === "cursor") {
|
|
621
|
+
let t = yt(e.clientX, e.clientY);
|
|
622
|
+
if (A.value) {
|
|
623
|
+
await $(), await l(v.transitionDuration), M.value = t, await Q();
|
|
595
624
|
return;
|
|
596
625
|
}
|
|
597
|
-
|
|
626
|
+
M.value = t;
|
|
598
627
|
}
|
|
599
|
-
|
|
628
|
+
A.value ? $() : Q();
|
|
600
629
|
}
|
|
601
|
-
},
|
|
602
|
-
clearTimeout(
|
|
603
|
-
},
|
|
604
|
-
|
|
630
|
+
}, bn, J = null, Y = !1, xn = () => {
|
|
631
|
+
clearTimeout(bn), J = null;
|
|
632
|
+
}, Sn = (e) => {
|
|
633
|
+
v.disabled || W.value || e.pointerType === "mouse" || (Y = !1, J = {
|
|
605
634
|
x: e.clientX,
|
|
606
635
|
y: e.clientY
|
|
607
|
-
},
|
|
608
|
-
|
|
609
|
-
},
|
|
610
|
-
},
|
|
611
|
-
if (!
|
|
612
|
-
let t = e.clientX -
|
|
613
|
-
Math.sqrt(t * t + n * n) >
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
|
|
620
|
-
},
|
|
621
|
-
|
|
636
|
+
}, bn = setTimeout(() => {
|
|
637
|
+
Y = !0, v.placement === "cursor" && J && (M.value = yt(J.x, J.y)), J = null, K = "pointer", Q();
|
|
638
|
+
}, Qe));
|
|
639
|
+
}, Cn = (e) => {
|
|
640
|
+
if (!J) return;
|
|
641
|
+
let t = e.clientX - J.x, n = e.clientY - J.y;
|
|
642
|
+
Math.sqrt(t * t + n * n) > $e && xn();
|
|
643
|
+
}, X = () => {
|
|
644
|
+
xn();
|
|
645
|
+
}, wn = (e) => {
|
|
646
|
+
Y && e.cancelable && (e.preventDefault(), Y = !1);
|
|
647
|
+
}, Tn = async (e) => {
|
|
648
|
+
v.disabled || W.value || (e.key === "ArrowDown" ? (e.preventDefault(), A.value || (K = "keyboard", await Q()), await l(0), G.value?.focusFirst(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), A.value || (K = "keyboard", await Q()), await l(0), G.value?.focusLast(!0)) : e.key === "Tab" && A.value && !e.shiftKey && (e.preventDefault(), G.value?.focusFirst(!0)));
|
|
649
|
+
}, En = !1, Dn = () => {
|
|
650
|
+
En = !0, setTimeout(() => En = !1, 0);
|
|
622
651
|
}, Z = (e) => {
|
|
623
652
|
let t = e.target;
|
|
624
|
-
if (!(t instanceof HTMLElement) || e.type === "focusin" &&
|
|
653
|
+
if (!(t instanceof HTMLElement) || e.type === "focusin" && En && k.value?.contains(t) || t.closest(`[data-bb-dropdown-surface="${D}"]`) || e.type === "focusin" && t.querySelector(`[data-bb-dropdown-surface="${D}"]`) || e.type !== "focusin" && k.value?.contains(t) || ($(), e.type === "focusin")) return;
|
|
625
654
|
let n = document.activeElement, r = k.value;
|
|
626
655
|
r?.isConnected && n && n !== document.body && n !== r && n.contains(r) && r.focus({ preventScroll: !0 });
|
|
627
|
-
},
|
|
656
|
+
}, On = (e) => {
|
|
628
657
|
let t = e.detail;
|
|
629
|
-
t && t.surfaceId !==
|
|
630
|
-
},
|
|
658
|
+
t && t.surfaceId !== D && (t.activator?.closest(`[data-bb-dropdown-surface="${D}"]`) || $());
|
|
659
|
+
}, kn = () => {
|
|
631
660
|
let e = document.activeElement?.closest("[data-bb-dropdown-surface]");
|
|
632
|
-
return e?.getAttribute("data-bb-dropdown-surface") ===
|
|
633
|
-
},
|
|
634
|
-
|
|
661
|
+
return e?.getAttribute("data-bb-dropdown-surface") === D && !!e.closest(".bb-dropdown--submenu");
|
|
662
|
+
}, An = (e) => {
|
|
663
|
+
A.value && e.key === "Escape" && i(rt) && (kn() || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement !== k.value && q(), $()));
|
|
635
664
|
}, Q = async () => {
|
|
636
|
-
|
|
637
|
-
surfaceId:
|
|
665
|
+
W.value || (gt.value = ht(), Dt = !0, A.value = !0, document.dispatchEvent(new CustomEvent(Ze, { detail: {
|
|
666
|
+
surfaceId: D,
|
|
638
667
|
activator: k.value
|
|
639
|
-
} })),
|
|
668
|
+
} })), j.value || (Ot(), a(rt, { element: () => document.querySelector(`[data-bb-dropdown-surface="${CSS.escape(String(D))}"]`) }), document.addEventListener("click", Z, {
|
|
640
669
|
passive: !0,
|
|
641
670
|
capture: !0
|
|
642
671
|
}), document.addEventListener("contextmenu", Z, {
|
|
643
672
|
passive: !0,
|
|
644
673
|
capture: !0
|
|
645
|
-
}), document.addEventListener("focusin", Z, { passive: !0 }), document.addEventListener("keydown",
|
|
674
|
+
}), document.addEventListener("focusin", Z, { passive: !0 }), document.addEventListener("keydown", An, { capture: !0 }), document.addEventListener(Ze, On)));
|
|
646
675
|
}, $ = async () => {
|
|
647
|
-
|
|
676
|
+
A.value = !1, kt();
|
|
677
|
+
}, { model: jn, set: Mn } = r(v, "modelValue", T, () => !1), Nn = async () => {
|
|
678
|
+
if (await l(0), !jn.value || A.value) return;
|
|
679
|
+
let e = document.activeElement;
|
|
680
|
+
gn = e instanceof HTMLElement ? e : null, K = "keyboard", await Q(), A.value ? j.value || (await l(0), G.value?.focusFirst(!0)) : Mn(!1);
|
|
681
|
+
};
|
|
682
|
+
w(A, (e) => {
|
|
683
|
+
jn.value !== e && Mn(e);
|
|
684
|
+
});
|
|
685
|
+
let Pn = () => {
|
|
686
|
+
let e = !!document.activeElement?.closest(`[data-bb-dropdown-surface="${CSS.escape(D)}"]`);
|
|
687
|
+
$(), e && q();
|
|
648
688
|
};
|
|
649
|
-
|
|
689
|
+
w(jn, (e) => {
|
|
690
|
+
e !== A.value && (e ? Nn() : Pn());
|
|
691
|
+
}), ze(() => {
|
|
692
|
+
jn.value && !A.value && Nn();
|
|
693
|
+
}), oe({
|
|
650
694
|
open: async (e, t, n) => {
|
|
651
|
-
|
|
695
|
+
A.value && (await $(), await l(v.transitionDuration)), M.value = e, gn = n ?? null, K = t, await Q(), t === "keyboard" && A.value && (await l(0), G.value?.focusFirst(!0));
|
|
652
696
|
},
|
|
653
697
|
close: $,
|
|
654
|
-
isOpen: () =>
|
|
698
|
+
isOpen: () => A.value
|
|
655
699
|
});
|
|
656
|
-
let
|
|
657
|
-
|
|
700
|
+
let Fn = () => {
|
|
701
|
+
o(rt), document.removeEventListener("click", Z, { capture: !0 }), document.removeEventListener("contextmenu", Z, { capture: !0 }), document.removeEventListener("focusin", Z), document.removeEventListener("keydown", An, { capture: !0 }), document.removeEventListener(Ze, On);
|
|
658
702
|
};
|
|
659
|
-
|
|
703
|
+
w(A, (e) => {
|
|
660
704
|
if (!e) {
|
|
661
|
-
|
|
662
|
-
for (let e of Object.keys(
|
|
705
|
+
K = void 0, Fn();
|
|
706
|
+
for (let e of Object.keys(dt)) dt[e] = "";
|
|
663
707
|
}
|
|
664
|
-
}),
|
|
708
|
+
}), w(() => v.activator, (t, n) => {
|
|
665
709
|
let r = k.value;
|
|
666
|
-
t ? k.value =
|
|
667
|
-
inPanel: (e) => !!e.closest(`[data-bb-dropdown-surface="${
|
|
710
|
+
t ? k.value = ve(t) ?? void 0 : n && (k.value = void 0), r && !k.value && A.value && e({
|
|
711
|
+
inPanel: (e) => !!e.closest(`[data-bb-dropdown-surface="${D}"]`),
|
|
668
712
|
close: $,
|
|
669
713
|
activator: () => k.value
|
|
670
714
|
});
|
|
671
715
|
}, { immediate: !0 });
|
|
672
|
-
let
|
|
673
|
-
|
|
674
|
-
if (
|
|
716
|
+
let In = null;
|
|
717
|
+
w([k, vt], ([e, t]) => {
|
|
718
|
+
if (In &&= (In(), null), !e) return;
|
|
675
719
|
let n = !1;
|
|
676
|
-
e.id || (e.id =
|
|
720
|
+
e.id || (e.id = D, n = !0), O.value = e.id;
|
|
677
721
|
let r = [];
|
|
678
|
-
t.has("click") && (e.addEventListener("click",
|
|
679
|
-
e.removeEventListener("click",
|
|
680
|
-
})), t.has("contextMenu") && (e.addEventListener("contextmenu",
|
|
681
|
-
e.removeEventListener("contextmenu",
|
|
682
|
-
})), e.addEventListener("keydown",
|
|
722
|
+
t.has("click") && (e.addEventListener("click", _n), e.addEventListener("mousedown", Dn), r.push(() => {
|
|
723
|
+
e.removeEventListener("click", _n), e.removeEventListener("mousedown", Dn);
|
|
724
|
+
})), t.has("contextMenu") && (e.addEventListener("contextmenu", yn), e.addEventListener("pointerdown", Sn), e.addEventListener("pointermove", Cn), e.addEventListener("pointerup", X), e.addEventListener("pointercancel", X), e.addEventListener("touchend", wn), r.push(() => {
|
|
725
|
+
e.removeEventListener("contextmenu", yn), e.removeEventListener("pointerdown", Sn), e.removeEventListener("pointermove", Cn), e.removeEventListener("pointerup", X), e.removeEventListener("pointercancel", X), e.removeEventListener("touchend", wn), xn();
|
|
726
|
+
})), e.addEventListener("keydown", Tn), r.push(() => e.removeEventListener("keydown", Tn)), In = () => {
|
|
683
727
|
r.forEach((e) => e()), n && e.removeAttribute("id"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls");
|
|
684
728
|
};
|
|
685
|
-
}, { immediate: !0 }),
|
|
729
|
+
}, { immediate: !0 }), w([
|
|
686
730
|
k,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
731
|
+
A,
|
|
732
|
+
st,
|
|
733
|
+
Ut,
|
|
734
|
+
Wt,
|
|
735
|
+
W
|
|
692
736
|
], ([e, t, n, r, i, a]) => {
|
|
693
737
|
e && (a ? (e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls")) : (e.setAttribute("aria-haspopup", r), e.setAttribute("aria-expanded", n ? String(t) : "false"), n ? e.setAttribute("aria-controls", i) : e.removeAttribute("aria-controls")));
|
|
694
|
-
}, { immediate: !0 }),
|
|
695
|
-
|
|
738
|
+
}, { immediate: !0 }), Le(() => {
|
|
739
|
+
xn(), In?.(), Fn();
|
|
696
740
|
});
|
|
697
|
-
let
|
|
741
|
+
let Ln = m(() => v.width === "auto"), { width: Rn } = qe(m(() => _e(A.value ? xt.value : null)), {
|
|
698
742
|
width: 0,
|
|
699
743
|
height: 0
|
|
700
|
-
}, { box: "border-box" }),
|
|
701
|
-
if (
|
|
702
|
-
if (
|
|
703
|
-
let { value: e, unit: t } =
|
|
704
|
-
return t === "%" ?
|
|
744
|
+
}, { box: "border-box" }), zn = m(() => {
|
|
745
|
+
if (v.width !== "auto") {
|
|
746
|
+
if (v.width) {
|
|
747
|
+
let { value: e, unit: t } = ye(v.width);
|
|
748
|
+
return t === "%" ? xt.value ? `${Rn.value * (e / 100)}px` : "0px" : `${e}px`;
|
|
705
749
|
}
|
|
706
750
|
return "0px";
|
|
707
751
|
}
|
|
708
752
|
});
|
|
709
|
-
return
|
|
753
|
+
return Re(() => {
|
|
710
754
|
$();
|
|
711
|
-
}), (e, n) => (
|
|
712
|
-
!
|
|
713
|
-
props: { ref:
|
|
714
|
-
disabled:
|
|
715
|
-
empty:
|
|
716
|
-
loading:
|
|
717
|
-
open:
|
|
718
|
-
placement:
|
|
719
|
-
})), void 0, void 0, 0) :
|
|
720
|
-
|
|
721
|
-
(
|
|
755
|
+
}), (e, n) => (b(), _(je, null, [
|
|
756
|
+
!at.value && on.value ? Ve(e.$slots, "activator", Ie(Fe({
|
|
757
|
+
props: { ref: Et },
|
|
758
|
+
disabled: p.disabled,
|
|
759
|
+
empty: W.value,
|
|
760
|
+
loading: fn.value,
|
|
761
|
+
open: A.value,
|
|
762
|
+
placement: p.placement
|
|
763
|
+
})), void 0, void 0, 0) : g("", !0),
|
|
764
|
+
Ve(e.$slots, "default"),
|
|
765
|
+
(b(!0), _(je, null, Be(B.value, (e) => (b(), h(pe, {
|
|
722
766
|
id: e,
|
|
723
767
|
key: e
|
|
724
768
|
}, null, 8, ["id"]))), 128)),
|
|
725
|
-
|
|
769
|
+
j.value ? (b(), h(fe, y({
|
|
726
770
|
key: 1,
|
|
727
|
-
modelValue:
|
|
728
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
729
|
-
compact:
|
|
730
|
-
"off-canvas-props":
|
|
731
|
-
"root-groups":
|
|
732
|
-
},
|
|
771
|
+
modelValue: A.value,
|
|
772
|
+
"onUpdate:modelValue": n[0] ||= (e) => A.value = e,
|
|
773
|
+
compact: C(mt).compact,
|
|
774
|
+
"off-canvas-props": _t.value,
|
|
775
|
+
"root-groups": Vt.value
|
|
776
|
+
}, y(ot, C(t)(C(De)(e.$attrs)))), null, 16, [
|
|
733
777
|
"modelValue",
|
|
734
778
|
"compact",
|
|
735
779
|
"off-canvas-props",
|
|
736
780
|
"root-groups"
|
|
737
|
-
])) : (
|
|
781
|
+
])) : (b(), h(ce, y({
|
|
738
782
|
key: 2,
|
|
739
|
-
modelValue:
|
|
740
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
741
|
-
anchor:
|
|
742
|
-
boundary:
|
|
743
|
-
"
|
|
783
|
+
modelValue: A.value,
|
|
784
|
+
"onUpdate:modelValue": n[1] ||= (e) => A.value = e,
|
|
785
|
+
anchor: Tt.value,
|
|
786
|
+
boundary: p.boundary,
|
|
787
|
+
"boundary-x": p.boundary ? void 0 : wt.value,
|
|
788
|
+
"bubble-attrs": ut,
|
|
744
789
|
class: ["bb-dropdown", {
|
|
745
|
-
"bb-dropdown--mobile":
|
|
746
|
-
"bb-dropdown--compact":
|
|
790
|
+
"bb-dropdown--mobile": C(pt),
|
|
791
|
+
"bb-dropdown--compact": C(mt).compact
|
|
747
792
|
}],
|
|
748
|
-
eager:
|
|
793
|
+
eager: p.eager,
|
|
749
794
|
"hide-arrow": "",
|
|
750
|
-
offset:
|
|
751
|
-
padding:
|
|
752
|
-
placement:
|
|
753
|
-
"transition-duration":
|
|
754
|
-
},
|
|
755
|
-
default:
|
|
756
|
-
e.$slots.header ? (
|
|
795
|
+
offset: p.offset ?? C(et)() ?? 4,
|
|
796
|
+
padding: p.padding,
|
|
797
|
+
placement: p.placement === "cursor" ? "bottom-start" : p.placement,
|
|
798
|
+
"transition-duration": p.transitionDuration
|
|
799
|
+
}, y(ot, e.$attrs, C(E).root)), {
|
|
800
|
+
default: Ke(() => [
|
|
801
|
+
e.$slots.header ? (b(), _("div", y({
|
|
757
802
|
key: 0,
|
|
758
803
|
class: "bb-dropdown__header"
|
|
759
|
-
},
|
|
760
|
-
disabled:
|
|
761
|
-
open:
|
|
762
|
-
placement:
|
|
763
|
-
})], 16)) :
|
|
764
|
-
|
|
765
|
-
id: `menu_${
|
|
804
|
+
}, C(E).header), [Ve(e.$slots, "header", {
|
|
805
|
+
disabled: p.disabled,
|
|
806
|
+
open: A.value,
|
|
807
|
+
placement: p.placement
|
|
808
|
+
})], 16)) : g("", !0),
|
|
809
|
+
Me("span", y({
|
|
810
|
+
id: `menu_${C(D)}`,
|
|
766
811
|
"aria-labelledby": z.value ? void 0 : O.value,
|
|
767
812
|
class: "bb-dropdown__list scrollbar-border",
|
|
768
813
|
role: z.value ? "none" : "menu"
|
|
769
|
-
},
|
|
814
|
+
}, C(E).list), [lt.value ? (b(), h(le, {
|
|
770
815
|
key: 0,
|
|
771
816
|
ref: "root-list",
|
|
772
|
-
groups:
|
|
773
|
-
}, null, 8, ["groups"])) :
|
|
774
|
-
|
|
775
|
-
|
|
817
|
+
groups: Vt.value
|
|
818
|
+
}, null, 8, ["groups"])) : g("", !0)], 16, Ye),
|
|
819
|
+
Me("span", Xe, Ue(Ht.value), 1),
|
|
820
|
+
Ne(ue),
|
|
821
|
+
e.$slots.footer ? (b(), _("div", y({
|
|
776
822
|
key: 1,
|
|
777
823
|
class: "bb-dropdown__footer"
|
|
778
|
-
},
|
|
779
|
-
disabled:
|
|
780
|
-
open:
|
|
781
|
-
placement:
|
|
782
|
-
})], 16)) :
|
|
824
|
+
}, C(E).footer), [Ve(e.$slots, "footer", {
|
|
825
|
+
disabled: p.disabled,
|
|
826
|
+
open: A.value,
|
|
827
|
+
placement: p.placement
|
|
828
|
+
})], 16)) : g("", !0)
|
|
783
829
|
]),
|
|
784
830
|
_: 3
|
|
785
831
|
}, 16, [
|
|
786
832
|
"modelValue",
|
|
787
833
|
"anchor",
|
|
788
834
|
"boundary",
|
|
835
|
+
"boundary-x",
|
|
789
836
|
"class",
|
|
790
837
|
"eager",
|
|
791
838
|
"offset",
|
|
@@ -796,4 +843,4 @@ var We = [
|
|
|
796
843
|
], 64));
|
|
797
844
|
}
|
|
798
845
|
});
|
|
799
|
-
export {
|
|
846
|
+
export { T as default };
|