bitboss-ui 3.0.0-beta.67 → 3.0.0-beta.68
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 +1 -1
- package/bin/bitboss-ui-mcp.mjs +87 -19
- package/bin/bitboss-ui.mjs +6 -2
- package/dist/ai/BbAlert.md +15 -11
- package/dist/ai/BbAsterisk.md +1 -1
- package/dist/ai/BbAvatar.md +2 -2
- package/dist/ai/BbBadge.md +4 -4
- package/dist/ai/BbBaseCheckboxIcon.md +4 -0
- package/dist/ai/BbBaseRadioIcon.md +7 -3
- package/dist/ai/BbBaseSwitchIcon.md +11 -2
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +62 -9
- package/dist/ai/BbCalendar.md +1 -1
- package/dist/ai/BbCheckbox.md +23 -5
- package/dist/ai/BbCheckboxGroup.md +52 -25
- package/dist/ai/BbColorInput.md +13 -12
- package/dist/ai/BbColorPalette.md +5 -5
- package/dist/ai/BbConfigScope.md +218 -0
- package/dist/ai/BbConfirm.md +24 -21
- package/dist/ai/BbDatePicker.md +4 -4
- package/dist/ai/BbDatePickerInput.md +16 -15
- package/dist/ai/BbDialog.md +10 -9
- package/dist/ai/BbDropdown.md +26 -16
- package/dist/ai/BbDropdownButton.md +18 -18
- package/dist/ai/BbDropzone.md +1 -1
- package/dist/ai/BbForm.md +6 -4
- package/dist/ai/BbHost.md +19 -13
- package/dist/ai/BbIcon.md +3 -3
- package/dist/ai/BbIndicator.md +4 -4
- package/dist/ai/BbNumberInput.md +17 -13
- package/dist/ai/BbOffCanvas.md +4 -3
- package/dist/ai/BbPagination.md +10 -2
- package/dist/ai/BbPopover.md +5 -5
- package/dist/ai/BbRadio.md +23 -4
- package/dist/ai/BbRadioGroup.md +69 -30
- package/dist/ai/BbRating.md +5 -5
- package/dist/ai/BbSelect.md +74 -39
- package/dist/ai/BbSelectPopover.md +28 -26
- package/dist/ai/BbSlider.md +258 -61
- package/dist/ai/BbSpinner.md +2 -2
- package/dist/ai/BbSwitch.md +27 -4
- package/dist/ai/BbSwitchGroup.md +22 -13
- package/dist/ai/BbTable.md +10 -5
- package/dist/ai/BbTabs.md +6 -6
- package/dist/ai/BbTabsRoot.md +1 -1
- package/dist/ai/BbTag.md +12 -11
- package/dist/ai/BbTextInput.md +25 -17
- package/dist/ai/BbTextarea.md +15 -14
- package/dist/ai/BbTimePicker.md +3 -3
- package/dist/ai/BbTimePickerInput.md +12 -11
- package/dist/ai/BbToast.md +65 -26
- package/dist/ai/BbTooltip.md +2 -2
- package/dist/ai/CommonField.md +2 -2
- package/dist/ai/CommonFieldInput.md +2 -1
- package/dist/ai/FlatListBox.md +4 -3
- package/dist/ai/GroupedListBox.md +4 -3
- package/dist/ai/ListBox.md +5 -4
- package/dist/ai/OptionsContainer.md +17 -1
- package/dist/ai/changelog.json +454 -7
- package/dist/ai/components.json +77 -69
- package/dist/ai/composables/useBbConfig.md +3 -3
- package/dist/ai/composables/useBbDialog.md +1 -1
- package/dist/ai/composables/useBbFormField.md +1 -1
- package/dist/ai/composables/useConfirm.md +1 -1
- package/dist/ai/composables/useToast.md +16 -16
- package/dist/ai/design-tokens.json +10 -5
- package/dist/ai/guides/agent-contract.md +8 -8
- package/dist/ai/guides/ai-router.md +1 -1
- package/dist/ai/guides/app-layout.md +1 -1
- package/dist/ai/guides/design-language.md +17 -13
- package/dist/ai/guides/design-tokens.md +81 -42
- package/dist/ai/guides/eslint-rules.md +3 -1
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/icons-policy.md +1 -1
- package/dist/ai/guides/inline-edit-playbook.md +1 -1
- package/dist/ai/guides/installation-and-plugin-setup.md +335 -161
- package/dist/ai/guides/migration/adoption-checklist.md +5 -5
- package/dist/ai/guides/migration/components/bb-alert.md +2 -2
- package/dist/ai/guides/migration/components/bb-badge.md +1 -1
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +15 -15
- package/dist/ai/guides/migration/components/bb-dialog.md +2 -2
- package/dist/ai/guides/migration/components/bb-dropdown.md +1 -1
- package/dist/ai/guides/migration/components/bb-host.md +10 -8
- package/dist/ai/guides/migration/components/bb-offcanvas.md +1 -1
- package/dist/ai/guides/migration/components/bb-select-popover.md +2 -2
- package/dist/ai/guides/migration/components/bb-select.md +3 -3
- package/dist/ai/guides/migration/components/bb-slider.md +17 -2
- package/dist/ai/guides/migration/components/bb-tabs.md +1 -1
- package/dist/ai/guides/migration/components/bb-toast.md +6 -6
- package/dist/ai/guides/migration/components/use-confirm.md +1 -1
- package/dist/ai/guides/migration/v2-to-v3.md +191 -56
- package/dist/ai/guides/migration/v3-beta-tooling.md +2 -2
- package/dist/ai/guides/passthrough.md +140 -131
- package/dist/ai/guides/typescript-generic-components.md +7 -7
- package/dist/ai/guides/validated-forms.md +5 -5
- package/dist/ai/guides/validation-libraries.md +4 -4
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +3 -3
- package/dist/ai/manifest/common.json +9 -11
- package/dist/ai/manifest/components/BbAlert.json +3 -2
- package/dist/ai/manifest/components/BbAvatar.json +2 -1
- package/dist/ai/manifest/components/BbBadge.json +3 -2
- package/dist/ai/manifest/components/BbBaseCheckboxIcon.tree.json +5 -1
- package/dist/ai/manifest/components/BbBaseRadioIcon.tree.json +7 -3
- package/dist/ai/manifest/components/BbBaseSwitchIcon.tree.json +9 -1
- package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +1 -1
- package/dist/ai/manifest/components/BbButton.json +4 -3
- package/dist/ai/manifest/components/BbButton.tree.json +3 -1
- package/dist/ai/manifest/components/BbCalendar.tree.json +1 -0
- package/dist/ai/manifest/components/BbCheckbox.json +4 -3
- package/dist/ai/manifest/components/BbCheckbox.tree.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +17 -14
- package/dist/ai/manifest/components/BbCheckboxGroup.removed.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +25 -4
- package/dist/ai/manifest/components/BbColorInput.json +6 -5
- package/dist/ai/manifest/components/BbColorInput.tree.json +4 -3
- package/dist/ai/manifest/components/BbColorPalette.json +2 -1
- package/dist/ai/manifest/components/BbColorPalette.tree.json +2 -1
- package/dist/ai/manifest/components/BbConfigScope.json +23 -0
- package/dist/ai/manifest/components/BbConfirm.json +2 -1
- package/dist/ai/manifest/components/BbConfirm.tree.json +2 -2
- package/dist/ai/manifest/components/BbDatePicker.json +2 -1
- package/dist/ai/manifest/components/BbDatePicker.tree.json +2 -2
- package/dist/ai/manifest/components/BbDatePickerInput.json +6 -5
- package/dist/ai/manifest/components/BbDatePickerInput.tree.json +6 -4
- package/dist/ai/manifest/components/BbDialog.json +3 -2
- package/dist/ai/manifest/components/BbDialog.tree.json +2 -2
- package/dist/ai/manifest/components/BbDropdown.json +7 -4
- package/dist/ai/manifest/components/BbDropdown.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdownButton.json +11 -8
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +3 -3
- package/dist/ai/manifest/components/BbDropzone.json +1 -0
- package/dist/ai/manifest/components/BbForm.json +1 -1
- package/dist/ai/manifest/components/BbHost.tree.json +1 -1
- package/dist/ai/manifest/components/BbIcon.json +2 -1
- package/dist/ai/manifest/components/BbIndicator.json +2 -1
- package/dist/ai/manifest/components/BbNumberInput.json +5 -4
- package/dist/ai/manifest/components/BbNumberInput.tree.json +3 -2
- package/dist/ai/manifest/components/BbOffCanvas.json +2 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbPagination.json +1 -1
- package/dist/ai/manifest/components/BbPagination.tree.json +2 -1
- package/dist/ai/manifest/components/BbPopover.json +2 -1
- package/dist/ai/manifest/components/BbPopover.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadio.json +3 -2
- package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +21 -18
- package/dist/ai/manifest/components/BbRadioGroup.removed.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +25 -4
- package/dist/ai/manifest/components/BbRating.json +3 -2
- package/dist/ai/manifest/components/BbSelect.json +11 -9
- package/dist/ai/manifest/components/BbSelect.tree.json +7 -5
- package/dist/ai/manifest/components/BbSelectPopover.json +11 -9
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +5 -2
- package/dist/ai/manifest/components/BbSlider.json +20 -18
- package/dist/ai/manifest/components/BbSlider.removed.json +3 -0
- package/dist/ai/manifest/components/BbSlider.tree.json +4 -2
- package/dist/ai/manifest/components/BbSwitch.json +2 -1
- package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.json +7 -5
- package/dist/ai/manifest/components/BbSwitchGroup.removed.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +6 -2
- package/dist/ai/manifest/components/BbTable.json +3 -2
- package/dist/ai/manifest/components/BbTable.tree.json +4 -3
- package/dist/ai/manifest/components/BbTabs.json +3 -2
- package/dist/ai/manifest/components/BbTabsRoot.json +2 -2
- package/dist/ai/manifest/components/BbTag.json +6 -5
- package/dist/ai/manifest/components/BbTag.tree.json +3 -2
- package/dist/ai/manifest/components/BbTextInput.json +5 -4
- package/dist/ai/manifest/components/BbTextInput.tree.json +3 -2
- package/dist/ai/manifest/components/BbTextarea.json +6 -5
- package/dist/ai/manifest/components/BbTextarea.tree.json +3 -2
- package/dist/ai/manifest/components/BbTimePicker.json +2 -1
- package/dist/ai/manifest/components/BbTimePicker.tree.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +6 -5
- package/dist/ai/manifest/components/BbTimePickerInput.tree.json +5 -3
- package/dist/ai/manifest/components/BbToast.json +2 -1
- package/dist/ai/manifest/components/BbToast.tree.json +6 -1
- package/dist/ai/manifest/components/BbTooltip.json +1 -0
- package/dist/ai/manifest/components/CommonField.json +2 -2
- package/dist/ai/manifest/components/CommonFieldInput.json +2 -2
- package/dist/ai/manifest/components/CommonFieldInput.tree.json +2 -0
- package/dist/ai/manifest/components/FlatListBox.json +1 -1
- package/dist/ai/manifest/components/FlatListBox.tree.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +1 -1
- package/dist/ai/manifest/components/GroupedListBox.tree.json +2 -1
- package/dist/ai/manifest/components/ListBox.json +1 -1
- package/dist/ai/manifest/components/ListBox.tree.json +2 -2
- package/dist/ai/manifest/components/OptionsContainer.json +3 -2
- package/dist/ai/manifest/components/OptionsContainer.tree.json +16 -1
- package/dist/ai/manifest/index.json +3 -3
- package/dist/ai/manifest/meta.json +16 -7
- package/dist/ai/manifest/types.advanced.json +5 -6
- package/dist/ai/manifest/types.api.json +15 -6
- package/dist/ai/manifest/types.wrapper.json +2 -2
- package/dist/ai/recipes/inertia/approvals-inbox.md +2 -2
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +13 -9
- package/dist/ai/recipes/inertia/onboarding.md +2 -2
- package/dist/ai/recipes/inertia/ownership-atlas.md +2 -2
- package/dist/ai/recipes/inertia/record-form.md +2 -2
- package/dist/ai/recipes/inertia/records-workspace.md +2 -2
- package/dist/ai/recipes/inertia/settings-workspace.md +5 -4
- package/dist/ai/recipes/inertia/upload-center.md +3 -3
- package/dist/ai/recipes/inertia/wizard-form.md +2 -2
- package/dist/ai/recipes/nuxt/approvals-inbox.md +2 -2
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +13 -9
- package/dist/ai/recipes/nuxt/onboarding.md +2 -2
- package/dist/ai/recipes/nuxt/ownership-atlas.md +2 -2
- package/dist/ai/recipes/nuxt/record-form.md +2 -2
- package/dist/ai/recipes/nuxt/records-workspace.md +2 -2
- package/dist/ai/recipes/nuxt/settings-workspace.md +5 -4
- package/dist/ai/recipes/nuxt/upload-center.md +4 -4
- package/dist/ai/recipes/nuxt/wizard-form.md +2 -2
- package/dist/ai/recipes/vue/approvals-inbox.md +2 -2
- package/dist/ai/recipes/vue/inline-edit-workspace.md +13 -9
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/recipes/vue/ownership-atlas.md +2 -2
- package/dist/ai/recipes/vue/record-form.md +2 -2
- package/dist/ai/recipes/vue/records-workspace.md +2 -2
- package/dist/ai/recipes/vue/settings-workspace.md +5 -4
- package/dist/ai/recipes/vue/upload-center.md +4 -4
- package/dist/ai/recipes/vue/wizard-form.md +2 -2
- package/dist/ai/source/BbAlert.md +10 -4
- package/dist/ai/source/BbAvatar.md +5 -4
- package/dist/ai/source/BbBadge.md +16 -9
- package/dist/ai/source/BbBadgeButton.md +1 -1
- package/dist/ai/source/BbBaseCheckboxIcon.md +7 -5
- package/dist/ai/source/BbBaseRadioIcon.md +17 -11
- package/dist/ai/source/BbBaseSwitchIcon.md +14 -9
- package/dist/ai/source/BbButton.md +38 -22
- package/dist/ai/source/BbCalendar.md +5 -30
- package/dist/ai/source/BbCheckbox.md +20 -7
- package/dist/ai/source/BbCheckboxGroup.md +66 -27
- package/dist/ai/source/BbColorInput.md +29 -22
- package/dist/ai/source/BbColorPalette.md +23 -22
- package/dist/ai/source/BbConfigScope.md +123 -0
- package/dist/ai/source/BbConfirm.md +5 -3
- package/dist/ai/source/BbDatePicker.md +18 -8
- package/dist/ai/source/BbDatePickerInput.md +44 -27
- package/dist/ai/source/BbDialog.md +23 -13
- package/dist/ai/source/BbDropdown.md +61 -25
- package/dist/ai/source/BbDropdownButton.md +67 -25
- package/dist/ai/source/BbDropdownGroup.md +38 -15
- package/dist/ai/source/BbForm.md +1 -1
- package/dist/ai/source/BbHost.md +4 -4
- package/dist/ai/source/BbHoverCard.md +6 -2
- package/dist/ai/source/BbIcon.md +5 -4
- package/dist/ai/source/BbIndicator.md +1 -1
- package/dist/ai/source/BbNumberInput.md +44 -30
- package/dist/ai/source/BbOffCanvas.md +17 -10
- package/dist/ai/source/BbPagination.md +10 -18
- package/dist/ai/source/BbPopover.md +17 -9
- package/dist/ai/source/BbPopoverPortal.md +2 -2
- package/dist/ai/source/BbRadio.md +18 -7
- package/dist/ai/source/BbRadioGroup.md +67 -27
- package/dist/ai/source/BbRating.md +21 -11
- package/dist/ai/source/BbSelect.md +51 -32
- package/dist/ai/source/BbSelectPopover.md +81 -38
- package/dist/ai/source/BbSlider.md +929 -565
- package/dist/ai/source/BbSwitchGroup.md +28 -9
- package/dist/ai/source/BbTable.md +17 -30
- package/dist/ai/source/BbTabs.md +5 -2
- package/dist/ai/source/BbTabsList.md +1 -1
- package/dist/ai/source/BbTabsPanels.md +1 -1
- package/dist/ai/source/BbTabsRoot.md +1 -1
- package/dist/ai/source/BbTag.md +27 -20
- package/dist/ai/source/BbTextInput.md +29 -26
- package/dist/ai/source/BbTextarea.md +53 -45
- package/dist/ai/source/BbTimePicker.md +19 -7
- package/dist/ai/source/BbTimePickerInput.md +34 -21
- package/dist/ai/source/BbToast.md +18 -9
- package/dist/ai/source/BbToastPortal.md +14 -6
- package/dist/ai/source/BbTooltip.md +1 -1
- package/dist/ai/source/CommonFieldInput.md +9 -4
- package/dist/ai/source/FlatListBox.md +11 -1
- package/dist/ai/source/GroupedListBox.md +12 -1
- package/dist/ai/source/ListBox.md +1 -1
- package/dist/ai/source/OptionsContainer.md +48 -1
- package/dist/assets/svgs/arrow_up.svg_raw.js +3 -0
- package/dist/assets/svgs/caret_down.svg_raw.js +3 -0
- package/dist/assets/svgs/chevron_left_small.svg_raw.js +3 -0
- package/dist/assets/svgs/chevron_right_small.svg_raw.js +3 -0
- package/dist/assets/svgs/close.svg_raw.js +3 -0
- package/dist/assets/svgs/eyedropper.svg_raw.js +3 -0
- package/dist/assets/svgs/move.svg_raw.js +3 -0
- package/dist/assets/svgs/x.svg_raw.js +3 -0
- package/dist/components/BbAlert/BbAlert.vue.d.ts +1 -0
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +48 -44
- package/dist/components/BbAlert/types.d.ts +1 -1
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -1
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +54 -53
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +60 -56
- package/dist/components/BbBadge/types.d.ts +1 -1
- package/dist/components/BbButton/BbButton.vue.d.ts +2 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +110 -98
- package/dist/components/BbButton/types.d.ts +12 -10
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +17 -17
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +298 -313
- package/dist/components/BbCalendar/useCalendarGrid.js +3 -2
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +4 -2
- package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +94 -82
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +78 -55
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +184 -151
- package/dist/components/BbCheckboxGroup/types.d.ts +10 -5
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +1 -1
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +13 -11
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +82 -71
- package/dist/components/BbColorInput/types.d.ts +8 -8
- package/dist/components/BbColorInput/types.js +1 -1
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -2
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +180 -182
- package/dist/components/BbColorPalette/types.d.ts +2 -2
- package/dist/components/BbConfigScope/BbConfigScope.vue.d.ts +12 -0
- package/dist/components/BbConfigScope/BbConfigScope.vue.js +4 -0
- package/dist/components/BbConfigScope/BbConfigScope.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/BbConfigScope/types.d.ts +20 -0
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +31 -31
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +171 -170
- package/dist/components/BbDatePicker/types.d.ts +2 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +110 -110
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +457 -441
- package/dist/components/BbDatePickerInput/types.d.ts +8 -8
- package/dist/components/BbDatePickerInput/types.js +1 -1
- package/dist/components/BbDialog/BbDialog.vue.d.ts +4 -3
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +204 -197
- package/dist/components/BbDialog/types.d.ts +2 -2
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +5 -4
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +302 -286
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +348 -344
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +97 -97
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +1 -1
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbDropdown/pointerTrail.d.ts +5 -0
- package/dist/components/BbDropdown/pointerTrail.js +26 -0
- package/dist/components/BbDropdown/types.d.ts +25 -13
- package/dist/components/BbDropdown/types.js +11 -2
- package/dist/components/BbDropdown/useDropdownContext.d.ts +1 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +4 -3
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +93 -69
- package/dist/components/BbDropdownButton/types.d.ts +30 -13
- package/dist/components/BbDropdownButton/types.js +7 -3
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +5 -5
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -2
- package/dist/components/BbForm/BbFormCustomField.js +2 -2
- package/dist/components/BbForm/bindFormField.js +66 -66
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbHost/BbHostOpening.d.ts +1 -1
- package/dist/components/BbHost/types.d.ts +2 -2
- package/dist/components/BbHoverCard/BbHoverCard.vue.d.ts +2 -2
- package/dist/components/BbHoverCard/BbHoverCard.vue_vue_type_script_setup_true_lang.js +158 -157
- package/dist/components/BbIcon/BbIcon.vue.d.ts +1 -1
- package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +41 -40
- package/dist/components/BbIndicator/types.d.ts +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +12 -9
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +248 -232
- package/dist/components/BbNumberInput/types.d.ts +12 -11
- package/dist/components/BbNumberInput/types.js +1 -1
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +2 -2
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +275 -274
- package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +104 -108
- package/dist/components/BbPopover/BbPopover.vue.d.ts +2 -2
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +90 -90
- package/dist/components/BbPopover/types.d.ts +2 -2
- package/dist/components/BbRadio/BbRadio.vue.d.ts +4 -2
- package/dist/components/BbRadio/BbRadio.vue_vue_type_script_setup_true_lang.js +105 -93
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +72 -49
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +214 -181
- package/dist/components/BbRadioGroup/types.d.ts +11 -5
- package/dist/components/BbRating/BbRating.vue.d.ts +7 -5
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +139 -128
- package/dist/components/BbSelect/BbSelect.vue.d.ts +174 -155
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +179 -158
- package/dist/components/BbSelect/types.d.ts +23 -19
- package/dist/components/BbSelect/types.js +4 -2
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +21 -16
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +637 -623
- package/dist/components/BbSelectPopover/reclickClears.d.ts +17 -0
- package/dist/components/BbSelectPopover/reclickClears.js +4 -0
- package/dist/components/BbSelectPopover/types.d.ts +21 -16
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSlider/BbSlider.vue.d.ts +22 -15
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +382 -315
- package/dist/components/BbSlider/types.d.ts +136 -47
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -2
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +28 -27
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/components/BbTable/BbTable.vue.d.ts +4 -4
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1128 -1135
- package/dist/components/BbTable/BbTableSelectToggle.d.ts +1 -1
- package/dist/components/BbTabs/BbTabs.vue.d.ts +21 -21
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/components/BbTabs/types.d.ts +1 -1
- package/dist/components/BbTag/BbTag.vue.d.ts +15 -13
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +196 -185
- package/dist/components/BbTag/types.d.ts +7 -7
- package/dist/components/BbTag/types.js +1 -1
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +30 -30
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +66 -55
- package/dist/components/BbTextInput/types.d.ts +9 -9
- package/dist/components/BbTextInput/types.js +1 -1
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +30 -30
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +96 -86
- package/dist/components/BbTextarea/types.d.ts +8 -8
- package/dist/components/BbTextarea/types.js +1 -1
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +12 -12
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +131 -130
- package/dist/components/BbTimePicker/types.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +73 -73
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +286 -273
- package/dist/components/BbTimePickerInput/types.d.ts +8 -8
- package/dist/components/BbTimePickerInput/types.js +1 -1
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +75 -80
- package/dist/components/BbToast/types.d.ts +2 -2
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +3 -3
- package/dist/components/BbTooltip/types.d.ts +1 -1
- package/dist/components/BbTree/BbTree.vue.d.ts +1 -1
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +11 -16
- package/dist/components/CommonFieldInput/types.d.ts +1 -1
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/components/FlatListBox/types.d.ts +1 -1
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/components/GroupedListBox/types.d.ts +1 -1
- package/dist/components/ListBox/types.d.ts +1 -1
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +87 -69
- package/dist/components/OptionsContainer/types.d.ts +5 -0
- package/dist/components/Transitions/Slide.vue.d.ts +1 -1
- package/dist/composables/useBbTabs.js +94 -90
- package/dist/composables/useConfig.js +2 -9
- package/dist/composables/useConfigDefaults.d.ts +54 -0
- package/dist/composables/useConfigDefaults.js +56 -0
- package/dist/composables/useConfirm.d.ts +7 -7
- package/dist/composables/useFormBinding.d.ts +1 -1
- package/dist/composables/useFormBinding.js +3 -3
- package/dist/composables/usePassthrough.d.ts +7 -5
- package/dist/composables/usePassthrough.js +137 -133
- package/dist/composables/useToast.d.ts +5 -4
- package/dist/composables/useToast.js +47 -37
- package/dist/deprecation/ai-deprecations.json.d.ts +44 -15
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.js +7 -7
- package/dist/i18n/locales/cs.json +2 -1
- package/dist/i18n/locales/da.json +2 -1
- package/dist/i18n/locales/de-CH.json +2 -1
- package/dist/i18n/locales/de.json +2 -1
- package/dist/i18n/locales/el.json +2 -1
- package/dist/i18n/locales/en-GB.json +2 -1
- package/dist/i18n/locales/en.json +2 -1
- package/dist/i18n/locales/es-MX.json +2 -1
- package/dist/i18n/locales/es.json +2 -1
- package/dist/i18n/locales/fi.json +2 -1
- package/dist/i18n/locales/fr.json +2 -1
- package/dist/i18n/locales/hu.json +2 -1
- package/dist/i18n/locales/it.json +2 -1
- package/dist/i18n/locales/ja.json +2 -1
- package/dist/i18n/locales/ko.json +2 -1
- package/dist/i18n/locales/nb.json +2 -1
- package/dist/i18n/locales/nl.json +2 -1
- package/dist/i18n/locales/pl.json +2 -1
- package/dist/i18n/locales/pt-BR.json +2 -1
- package/dist/i18n/locales/pt-PT.json +2 -1
- package/dist/i18n/locales/ro.json +2 -1
- package/dist/i18n/locales/ru.json +2 -1
- package/dist/i18n/locales/sv.json +2 -1
- package/dist/i18n/locales/tr.json +2 -1
- package/dist/i18n/locales/uk.json +2 -1
- package/dist/i18n/locales/zh-CN.json +2 -1
- package/dist/i18n/locales/zh-HK.json +2 -1
- package/dist/i18n/locales/zh-TW.json +2 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/llms-full.txt +2273 -1243
- package/dist/llms-medium.txt +362 -184
- package/dist/llms.txt +4 -4
- package/dist/locale-blueprint.json +2 -1
- package/dist/nuxt-auto-imports.js +1 -1
- package/dist/nuxt-module.d.ts +1 -1
- package/dist/nuxt.js +17 -17
- package/dist/project-dts.d.ts +72 -10
- package/dist/project-dts.js +69 -21
- package/dist/styles.css +2 -2
- package/dist/types/AlertVariant.d.ts +1 -1
- package/dist/types/BadgeVariant.d.ts +1 -1
- package/dist/types/ButtonVariant.d.ts +1 -1
- package/dist/types/CheckboxVariant.d.ts +7 -4
- package/dist/types/CheckboxVariant.js +5 -1
- package/dist/types/Config.d.ts +17 -103
- package/dist/types/ConfigDefaults.d.ts +352 -0
- package/dist/types/ConfigDefaults.js +115 -0
- package/dist/types/ConfirmVariant.d.ts +1 -1
- package/dist/types/DropdownItemVariant.d.ts +1 -1
- package/dist/types/FieldLayout.d.ts +3 -3
- package/dist/types/IndicatorVariant.d.ts +1 -1
- package/dist/types/InputVariant.d.ts +57 -24
- package/dist/types/RadioVariant.d.ts +7 -4
- package/dist/types/RadioVariant.js +5 -1
- package/dist/types/SizeScale.d.ts +4 -0
- package/dist/types/SizeScale.js +17 -0
- package/dist/types/TabsVariant.d.ts +1 -1
- package/dist/types/ToastVariant.d.ts +1 -1
- package/dist/types/TooltipVariant.d.ts +1 -1
- package/dist/types/passthrough.d.ts +6 -6
- package/dist/types/ptComponentMap.d.ts +14 -14
- package/dist/utilities/functions/searchRank.d.ts +19 -0
- package/dist/utilities/functions/searchRank.js +76 -0
- package/dist/utilities/misc/listboxMetrics.d.ts +1 -1
- package/dist/utils/configDefaults.d.ts +33 -0
- package/dist/utils/configDefaults.js +140 -0
- package/dist/utils/configScope.d.ts +43 -0
- package/dist/utils/configScope.js +13 -0
- package/dist/utils/passthrough.d.ts +4 -7
- package/dist/utils/passthrough.js +31 -29
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +54 -191
- package/dist/vite.js +318 -367
- package/llms.txt +4 -4
- package/package.json +3 -3
- package/scripts/lib/adoption-checklist.json +2 -2
- package/scripts/lib/agent-manifest.mjs +2 -0
- package/scripts/lib/eslint-disable.mjs +2 -0
- package/scripts/lib/eslint-plugin.d.ts +4 -2
- package/scripts/lib/eslint-plugin.mjs +67 -0
- package/scripts/lib/idiom-scan.mjs +8 -7
- package/scripts/lib/project-variant-dts.mjs +105 -36
- package/scripts/lib/validate-bb-markup.mjs +73 -13
- package/dist/ai/BbPtScope.md +0 -138
- package/dist/ai/manifest/components/BbPtScope.json +0 -21
- package/dist/ai/source/BbPtScope.md +0 -54
- package/dist/components/BbPtScope/BbPtScope.vue.d.ts +0 -12
- package/dist/components/BbPtScope/BbPtScope.vue.js +0 -4
- package/dist/components/BbPtScope/BbPtScope.vue_vue_type_script_setup_true_lang.js +0 -12
- package/dist/components/BbPtScope/types.d.ts +0 -15
- package/dist/types/PtScope.d.ts +0 -15
- package/dist/utilities/functions/head.js +0 -3
- package/dist/utilities/functions/matchAnyKey.d.ts +0 -8
- package/dist/utilities/functions/matchAnyKey.js +0 -14
- package/dist/utils/ptScope.d.ts +0 -8
- package/dist/utils/ptScope.js +0 -3
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<CommonField
|
|
10
10
|
:id="id"
|
|
11
11
|
class="bb-checkbox"
|
|
12
|
-
:compact="compact"
|
|
12
|
+
:compact="configDefaults.compact"
|
|
13
13
|
:description="description"
|
|
14
14
|
:disabled="disabled"
|
|
15
15
|
:errors="fieldErrors"
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
:hide-label="hideLabel"
|
|
19
19
|
:hint="hint"
|
|
20
20
|
:input-align="inputAlign"
|
|
21
|
-
:input-position="inputPosition"
|
|
21
|
+
:input-position="configDefaults.inputPosition"
|
|
22
22
|
:label="label"
|
|
23
23
|
:label-align="labelAlign"
|
|
24
24
|
:label-position="labelPosition"
|
|
25
25
|
label-tag="span"
|
|
26
|
-
:layout="withResponsiveDefault(layout, 'auto')"
|
|
26
|
+
:layout="withResponsiveDefault(configDefaults.layout, 'auto')"
|
|
27
27
|
:name="name"
|
|
28
28
|
:passthrough="passthrough"
|
|
29
29
|
:readonly="fieldReadonly"
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
</template>
|
|
83
83
|
|
|
84
84
|
<script setup lang="ts">
|
|
85
|
+
import { useConfigDefaults } from '@/composables/useConfigDefaults';
|
|
85
86
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
86
87
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
87
88
|
import { withResponsiveDefault } from '@/utilities/functions/responsiveDefault';
|
|
@@ -137,13 +138,25 @@ const declaredProps = withDefaults(
|
|
|
137
138
|
// boolean `checked` — default: undefined so an unset prop isn't coerced to
|
|
138
139
|
// `false`; the checked state then derives from `modelValue`.
|
|
139
140
|
checked: undefined,
|
|
140
|
-
layout:
|
|
141
|
-
inputPosition:
|
|
141
|
+
layout: undefined,
|
|
142
|
+
inputPosition: undefined,
|
|
143
|
+
// Tri-state: unset lets the components map show through.
|
|
144
|
+
compact: undefined,
|
|
145
|
+
// Tri-state: unset lets the components map show through.
|
|
146
|
+
reverse: undefined,
|
|
142
147
|
}
|
|
143
148
|
);
|
|
144
|
-
|
|
145
149
|
const declaredEmit = defineEmits<BbCheckboxEvents>();
|
|
150
|
+
|
|
146
151
|
defineSlots<BbCheckboxSlots>();
|
|
152
|
+
|
|
153
|
+
const configDefaults = useConfigDefaults('BbCheckbox', declaredProps, {
|
|
154
|
+
layout: 'auto',
|
|
155
|
+
inputPosition: 'left',
|
|
156
|
+
compact: false,
|
|
157
|
+
reverse: false,
|
|
158
|
+
});
|
|
159
|
+
|
|
147
160
|
// Inside a BbForm the field joins it (Q54.4): `props` / `emit` are bound.
|
|
148
161
|
const {
|
|
149
162
|
props,
|
|
@@ -181,7 +194,7 @@ const checkboxInput = ref<HTMLInputElement | null>(null);
|
|
|
181
194
|
const { focused, focusVisible, onFocus, onBlur } = useToggleFocus();
|
|
182
195
|
const showHint = computed(() => props.persistentHint || focused.value);
|
|
183
196
|
// We use the negative to avoid the awkward syntax of :reverse="false" from outside
|
|
184
|
-
const reverse = computed(() => !
|
|
197
|
+
const reverse = computed(() => !configDefaults.reverse);
|
|
185
198
|
|
|
186
199
|
/**
|
|
187
200
|
* The checked state the control PAINTS. Controlled (a `modelValue` or
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<CommonField
|
|
10
10
|
:id="id"
|
|
11
11
|
class="bb-checkbox-group"
|
|
12
|
-
:compact="compact"
|
|
12
|
+
:compact="configDefaults.compact"
|
|
13
13
|
:description="description"
|
|
14
14
|
:disabled="disabled"
|
|
15
15
|
:errors="fieldErrors"
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
:hide-label="hideLegend"
|
|
20
20
|
:hint="hint"
|
|
21
21
|
:input-align="inputAlign"
|
|
22
|
-
:input-position="inputPosition"
|
|
22
|
+
:input-position="configDefaults.inputPosition"
|
|
23
23
|
:label="legend"
|
|
24
24
|
:label-align="labelAlign"
|
|
25
25
|
:label-mode="legendMode"
|
|
26
26
|
:label-position="legendPosition"
|
|
27
27
|
label-tag="legend"
|
|
28
|
-
:layout="layout"
|
|
28
|
+
:layout="configDefaults.layout"
|
|
29
29
|
:loading="loading"
|
|
30
30
|
:name="name"
|
|
31
31
|
:passthrough="containerPassthrough"
|
|
32
32
|
:readonly="fieldReadonly"
|
|
33
|
-
:reverse="reverse"
|
|
33
|
+
:reverse="configDefaults.reverse"
|
|
34
34
|
:show-asterisk="showAsterisk"
|
|
35
35
|
:show-hint="showHint"
|
|
36
36
|
:ssr-marker="ssrMarker"
|
|
@@ -62,9 +62,10 @@
|
|
|
62
62
|
:indicator-ready="indicatorReady"
|
|
63
63
|
:item-input-align="itemInputAlign"
|
|
64
64
|
:item-label-align="itemLabelAlign"
|
|
65
|
-
:item-layout="itemLayout"
|
|
66
|
-
:item-reverse="itemReverse"
|
|
67
|
-
:list-
|
|
65
|
+
:item-layout="configDefaults.itemLayout"
|
|
66
|
+
:item-reverse="configDefaults.itemReverse"
|
|
67
|
+
:list-block="configDefaults.block"
|
|
68
|
+
:list-layout="configDefaults.listLayout"
|
|
68
69
|
:loading="!!loading"
|
|
69
70
|
:loading-text="loadingText"
|
|
70
71
|
:options="options"
|
|
@@ -141,6 +142,7 @@
|
|
|
141
142
|
</template>
|
|
142
143
|
|
|
143
144
|
<script setup lang="ts" generic="T = any">
|
|
145
|
+
import { useConfigDefaults } from '@/composables/useConfigDefaults';
|
|
144
146
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
145
147
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
146
148
|
import CommonField from '../CommonField/CommonField.vue';
|
|
@@ -213,15 +215,31 @@ const declaredProps = withDefaults(
|
|
|
213
215
|
>
|
|
214
216
|
>(),
|
|
215
217
|
{
|
|
216
|
-
inputPosition:
|
|
218
|
+
inputPosition: undefined,
|
|
217
219
|
multiple: true,
|
|
218
220
|
selectable: true,
|
|
221
|
+
// Tri-state: unset lets the components map show through.
|
|
222
|
+
compact: undefined,
|
|
223
|
+
// Tri-state: unset lets the components map show through.
|
|
224
|
+
itemReverse: undefined,
|
|
225
|
+
// Tri-state: unset lets the components map show through.
|
|
226
|
+
reverse: undefined,
|
|
227
|
+
// Tri-state: unset lets the components map show through.
|
|
228
|
+
block: undefined,
|
|
219
229
|
}
|
|
220
230
|
);
|
|
221
|
-
|
|
222
231
|
const declaredEmit = defineEmits<BbCheckboxGroupEvents>();
|
|
223
232
|
|
|
224
233
|
defineSlots<BbCheckboxGroupSlots<T>>();
|
|
234
|
+
|
|
235
|
+
const configDefaults = useConfigDefaults('BbCheckboxGroup', declaredProps, {
|
|
236
|
+
inputPosition: 'left',
|
|
237
|
+
compact: false,
|
|
238
|
+
itemReverse: false,
|
|
239
|
+
reverse: false,
|
|
240
|
+
block: false,
|
|
241
|
+
});
|
|
242
|
+
|
|
225
243
|
// Inside a BbForm the field joins it (Q54.4): `props` / `emit` are bound.
|
|
226
244
|
const {
|
|
227
245
|
props,
|
|
@@ -441,11 +459,8 @@ const passthrough = usePassthrough({
|
|
|
441
459
|
* BbTabs' look (`variant`, Q76.11 d): the indicators under the checked rows,
|
|
442
460
|
* measured on the list. A pill per run of adjacent picks (`pill`), a bar per pick (`line`).
|
|
443
461
|
*/
|
|
444
|
-
/** `list-layout="vertical"`
|
|
445
|
-
const stripVertical = computed(
|
|
446
|
-
() =>
|
|
447
|
-
props.listLayout === 'vertical' || props.listLayout === 'vertical-stretch'
|
|
448
|
-
);
|
|
462
|
+
/** `list-layout="vertical"` stacks the strip into a column. */
|
|
463
|
+
const stripVertical = computed(() => configDefaults.listLayout === 'vertical');
|
|
449
464
|
const {
|
|
450
465
|
boxes: indicatorBoxes,
|
|
451
466
|
ready: indicatorReady,
|
|
@@ -882,14 +897,20 @@ export type BbCheckboxGroupBaseProps<T> = {
|
|
|
882
897
|
|
|
883
898
|
/**
|
|
884
899
|
* How the rows sit in the list: `'horizontal'` (on a line, wrapping),
|
|
885
|
-
* `'vertical'` (stacked)
|
|
886
|
-
* list
|
|
887
|
-
* narrowest).
|
|
900
|
+
* `'vertical'` (stacked) or `'tiles'` (equal boxes; `--tile-min-width` on
|
|
901
|
+
* `pt:list` sets the narrowest). `block` makes the rows full width.
|
|
888
902
|
*
|
|
889
903
|
* @defaultValue `'horizontal'`
|
|
890
904
|
*/
|
|
891
905
|
listLayout?: ListLayout;
|
|
892
906
|
|
|
907
|
+
/**
|
|
908
|
+
* The rows take the list's full width: on a line (`horizontal`, a
|
|
909
|
+
* `variant` strip) they share it equally, stacked (`vertical`) each row is
|
|
910
|
+
* full width. Every look: plain rows, `pill`, `line`, `outline`.
|
|
911
|
+
*/
|
|
912
|
+
block?: boolean;
|
|
913
|
+
|
|
893
914
|
/**
|
|
894
915
|
* String displayed while items are being loaded.
|
|
895
916
|
*/
|
|
@@ -1038,7 +1059,7 @@ export type BbCheckboxGroupProps<T> = BbCheckboxGroupBaseProps<T> & {
|
|
|
1038
1059
|
/**
|
|
1039
1060
|
* A tab-strip look: `'pill'` (a pill per run of adjacent picks)
|
|
1040
1061
|
* or `'line'` (a bar under each pick). `list-layout="vertical"` stacks it.
|
|
1041
|
-
* Register more with `
|
|
1062
|
+
* Register more with `components.BbCheckboxGroup.variants`. Unset: the group's own rows.
|
|
1042
1063
|
*/
|
|
1043
1064
|
variant?: CheckboxVariantType;
|
|
1044
1065
|
};
|
|
@@ -1192,8 +1213,9 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1192
1213
|
*
|
|
1193
1214
|
* `listLayout` picks the arrangement (`--<listLayout>`): `horizontal` puts
|
|
1194
1215
|
* the rows on a line and wraps, `vertical` stacks them at their own width,
|
|
1195
|
-
* `
|
|
1196
|
-
*
|
|
1216
|
+
* `tiles` makes equal-size boxes that wrap as the field narrows. `block`
|
|
1217
|
+
* (`--block`) gives the rows the list's width: equal shares on a line, full
|
|
1218
|
+
* width stacked (the whole row is the hit area).
|
|
1197
1219
|
* A row never takes layout from an ancestor, which is what lets `pt:list`
|
|
1198
1220
|
* re-lay the rows without reaching into them.
|
|
1199
1221
|
*/
|
|
@@ -1218,8 +1240,10 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1218
1240
|
flex-direction: column;
|
|
1219
1241
|
}
|
|
1220
1242
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1243
|
+
/* `block` stacked: every row as wide as the list. `:where` keeps it at
|
|
1244
|
+
one class. */
|
|
1245
|
+
&--block:where(.bb-checkbox-group__list--vertical) {
|
|
1246
|
+
align-items: stretch;
|
|
1223
1247
|
}
|
|
1224
1248
|
|
|
1225
1249
|
/* Equal columns that wrap: as many `--tile-min-width` tracks as fit, and
|
|
@@ -1240,6 +1264,13 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1240
1264
|
}
|
|
1241
1265
|
}
|
|
1242
1266
|
|
|
1267
|
+
/* `block` on a line: the rows share the list's width equally (and still
|
|
1268
|
+
wrap once a row reaches its content's width). At the row's one class. */
|
|
1269
|
+
:where(.bb-checkbox-group__list--block.bb-checkbox-group__list--horizontal)
|
|
1270
|
+
> .bb-checkbox-group__item {
|
|
1271
|
+
flex: 1 1 0;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1243
1274
|
/* A per-breakpoint `layout` (Q67.3) places the list per tier, as
|
|
1244
1275
|
`--right` / `--center` do above: `--ly-lj` / `--ly-ls` from CommonField, at
|
|
1245
1276
|
the list's own one-class weight; a left tier sets neither (`initial`), so
|
|
@@ -1303,7 +1334,7 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1303
1334
|
}
|
|
1304
1335
|
|
|
1305
1336
|
/* One side takes the free space — only visible once the row is wider than
|
|
1306
|
-
its content (`
|
|
1337
|
+
its content (`block`, `tiles`, a `pt:item` width). */
|
|
1307
1338
|
&--label-fill {
|
|
1308
1339
|
grid-template-columns: auto minmax(0, 1fr);
|
|
1309
1340
|
justify-content: stretch;
|
|
@@ -1543,8 +1574,10 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1543
1574
|
* A row is one label line (`--bb-label-lh`, 18px) and the rows sit
|
|
1544
1575
|
* `--row-gap` (10px) apart. On a coarse pointer only, each row gets an
|
|
1545
1576
|
* invisible 44px `::after`, and the stacked (or wrapped) rows open to exactly
|
|
1546
|
-
* the gap that keeps those areas apart: `44px - the
|
|
1547
|
-
* `--row-gap` when wider.
|
|
1577
|
+
* the gap that keeps those areas apart: `44px - the row's height`, or the
|
|
1578
|
+
* consumer's `--row-gap` when wider. The height is the shortest row's, as
|
|
1579
|
+
* measured (`--row-h`, set by the list after mount), so a 32px `pt:item`
|
|
1580
|
+
* pill opens 12px, not 26px; until then one label line is assumed. That gap is the one visual change, and the least
|
|
1548
1581
|
* that fits a full target per row; a list of rows at a 44px pitch is the
|
|
1549
1582
|
* platform's own list rhythm. Sideways the area stops at half `--gap`, so
|
|
1550
1583
|
* rows on one line never overlap either. A described row is already taller,
|
|
@@ -1553,11 +1586,17 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1553
1586
|
@media (pointer: coarse) {
|
|
1554
1587
|
.bb-checkbox-group__list {
|
|
1555
1588
|
--hit: 44px;
|
|
1556
|
-
--tap-row-gap: max(
|
|
1589
|
+
--tap-row-gap: max(
|
|
1590
|
+
var(--row-gap),
|
|
1591
|
+
calc(var(--hit) - var(--row-h, var(--bb-label-lh)))
|
|
1592
|
+
);
|
|
1557
1593
|
row-gap: var(--tap-row-gap);
|
|
1558
1594
|
|
|
1559
1595
|
&:has(.bb-checkbox-group__item--description) {
|
|
1560
|
-
--tap-row-gap: max(
|
|
1596
|
+
--tap-row-gap: max(
|
|
1597
|
+
var(--row-gap),
|
|
1598
|
+
calc(var(--hit) - var(--row-h, calc(var(--hit) - 8px)))
|
|
1599
|
+
);
|
|
1561
1600
|
}
|
|
1562
1601
|
|
|
1563
1602
|
&.bb-checkbox-group__list--tiles {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:id="id"
|
|
11
11
|
class="bb-color-input"
|
|
12
12
|
:clearable="clearable && hasValue"
|
|
13
|
-
:compact="compact"
|
|
13
|
+
:compact="configDefaults.compact"
|
|
14
14
|
:description="description"
|
|
15
15
|
:disabled="disabled"
|
|
16
16
|
:errors="fieldErrors"
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
:label-align="labelAlign"
|
|
25
25
|
:label-mode="resolvedLabelMode"
|
|
26
26
|
:label-position="labelPosition"
|
|
27
|
-
:layout="layout"
|
|
27
|
+
:layout="configDefaults.layout"
|
|
28
28
|
:loading="loading"
|
|
29
29
|
:name="name"
|
|
30
30
|
:passthrough="passthrough"
|
|
31
31
|
:readonly="fieldReadonly"
|
|
32
|
-
:reverse="reverse"
|
|
32
|
+
:reverse="configDefaults.reverse"
|
|
33
33
|
:show-asterisk="showAsterisk"
|
|
34
34
|
:show-hint="showHint"
|
|
35
35
|
:warnings="warnings"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
:append:icon="props['append:icon']"
|
|
54
54
|
class="bb-color-input__field"
|
|
55
55
|
:clearable="clearable && hasValue && !fieldReadonly && !disabled"
|
|
56
|
-
:compact="compact"
|
|
56
|
+
:compact="configDefaults.compact"
|
|
57
57
|
:disabled="disabled"
|
|
58
58
|
:has-errors="fieldHasErrors"
|
|
59
59
|
:has-value="hasValue"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
:aria-labelledby="ariaLabelledby"
|
|
80
80
|
:aria-readonly="fieldReadonly || undefined"
|
|
81
81
|
:aria-required="fieldAriaRequired"
|
|
82
|
-
:autocomplete="autocomplete"
|
|
82
|
+
:autocomplete="configDefaults.autocomplete"
|
|
83
83
|
:autofocus="autofocus"
|
|
84
84
|
class="bb-color-input__input"
|
|
85
85
|
:disabled="disabled"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
control's own suffix span (the row's `suffix` slot is not used). -->
|
|
98
98
|
<template #append>
|
|
99
99
|
<BbColorPalette
|
|
100
|
-
:adaptive="adaptive"
|
|
100
|
+
:adaptive="configDefaults.adaptive"
|
|
101
101
|
:alpha="alpha"
|
|
102
102
|
:anchor="wrapperRef"
|
|
103
103
|
:disabled="disabled || fieldReadonly"
|
|
@@ -156,7 +156,7 @@ import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
|
156
156
|
import { computed, mergeProps, ref, useAttrs, watch } from 'vue';
|
|
157
157
|
import { vMaska } from 'maska/vue';
|
|
158
158
|
import type { MaskaDetail, MaskInputOptions } from 'maska';
|
|
159
|
-
import {
|
|
159
|
+
import { useConfigDefaults } from '@/composables/useConfigDefaults';
|
|
160
160
|
import { useFormBinding } from '@/composables/useFormBinding';
|
|
161
161
|
import { useLocale } from '@/composables/useLocale';
|
|
162
162
|
import {
|
|
@@ -201,11 +201,15 @@ const declaredProps = withDefaults(
|
|
|
201
201
|
{
|
|
202
202
|
// `undefined` (declared, not omitted) keeps `adaptive` three-state: it
|
|
203
203
|
// disables Vue's absent→`false` Boolean cast so BbColorPalette's
|
|
204
|
-
// `props.adaptive ??
|
|
204
|
+
// `props.adaptive ?? all.adaptive` can reach the config default, while
|
|
205
205
|
// keeping the Boolean type so the valueless `adaptive` shorthand → `true`.
|
|
206
206
|
adaptive: undefined,
|
|
207
207
|
alpha: false,
|
|
208
|
-
autocomplete:
|
|
208
|
+
autocomplete: undefined,
|
|
209
|
+
// Tri-state: unset lets the components map show through.
|
|
210
|
+
compact: undefined,
|
|
211
|
+
// Tri-state: unset lets the components map show through.
|
|
212
|
+
reverse: undefined,
|
|
209
213
|
}
|
|
210
214
|
);
|
|
211
215
|
const declaredEmit = defineEmits<BbColorInputEvents>();
|
|
@@ -225,7 +229,6 @@ const {
|
|
|
225
229
|
identifierFallback: () => declaredProps.label,
|
|
226
230
|
leaveOn: 'blur',
|
|
227
231
|
});
|
|
228
|
-
const config = useConfig();
|
|
229
232
|
export type { BbColorInputProps, BbColorInputEvents, BbColorInputSlots };
|
|
230
233
|
|
|
231
234
|
if (process.env.NODE_ENV !== 'production')
|
|
@@ -237,9 +240,13 @@ const showHint = computed(() => props.persistentHint || active.value);
|
|
|
237
240
|
// frame's has-value chrome, the box row and the clear button alike.
|
|
238
241
|
const hasValue = computed(() => isNotNil(props.modelValue));
|
|
239
242
|
// Honor the label-mode prop, else the library default (matches the other inputs).
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
const configDefaults = useConfigDefaults('BbColorInput', props, {
|
|
244
|
+
labelMode: 'outside',
|
|
245
|
+
autocomplete: 'off',
|
|
246
|
+
compact: false,
|
|
247
|
+
reverse: false,
|
|
248
|
+
});
|
|
249
|
+
const resolvedLabelMode = computed(() => configDefaults.labelMode);
|
|
243
250
|
|
|
244
251
|
/**
|
|
245
252
|
* Sheet chrome: default the adaptive sheet's title to the field label.
|
|
@@ -420,8 +427,8 @@ import type { BbOffCanvasProps } from '../BbOffCanvas/types';
|
|
|
420
427
|
import {
|
|
421
428
|
INPUT_VARIANTS,
|
|
422
429
|
type InputVariantBuiltIn,
|
|
423
|
-
type
|
|
424
|
-
type
|
|
430
|
+
type ColorInputVariantRegistry,
|
|
431
|
+
type InputVariantOf,
|
|
425
432
|
} from '@/types/InputVariant';
|
|
426
433
|
import type { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
|
427
434
|
import type { FieldCrossAlign, FieldLayout } from '@/types/FieldLayout';
|
|
@@ -524,7 +531,7 @@ export const BB_COLOR_INPUT_PT = {
|
|
|
524
531
|
// the real states; a picker's panel and rows are not the field's.
|
|
525
532
|
variant: {
|
|
526
533
|
names: INPUT_VARIANTS,
|
|
527
|
-
option: '
|
|
534
|
+
option: 'colorInputVariants',
|
|
528
535
|
parts: TEXT_CONTROL_PT_PARTS,
|
|
529
536
|
},
|
|
530
537
|
} as const satisfies {
|
|
@@ -554,7 +561,7 @@ export type BbColorInputProps = {
|
|
|
554
561
|
| `pt:${TextControlPtPart}:${InputVariantBuiltIn}`]?: PtValue;
|
|
555
562
|
} & /* @vue-ignore */ PtCompoundProps<
|
|
556
563
|
typeof BB_COLOR_INPUT_PT,
|
|
557
|
-
PtVariantAttrs<TextControlPtPart, keyof
|
|
564
|
+
PtVariantAttrs<TextControlPtPart, keyof ColorInputVariantRegistry>
|
|
558
565
|
> & {
|
|
559
566
|
/**
|
|
560
567
|
* Passthrough, object form: `{ box: '…', 'box:errors': '…' }` — the same
|
|
@@ -564,7 +571,7 @@ export type BbColorInputProps = {
|
|
|
564
571
|
pt?: {
|
|
565
572
|
[K in BbColorInputPtKey]?: PtValue;
|
|
566
573
|
} & {
|
|
567
|
-
[K in `${TextControlPtPart}:${InputVariantBuiltIn | keyof
|
|
574
|
+
[K in `${TextControlPtPart}:${InputVariantBuiltIn | keyof ColorInputVariantRegistry}`]?: PtValue;
|
|
568
575
|
};
|
|
569
576
|
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
570
577
|
/**
|
|
@@ -572,8 +579,8 @@ export type BbColorInputProps = {
|
|
|
572
579
|
* viewports instead of a floating popover; on desktop it stays a popover.
|
|
573
580
|
* Mirrors the adaptive behaviour of `BbSelect`/`BbDatePickerInput`.
|
|
574
581
|
*
|
|
575
|
-
* When unset, falls back to the global `
|
|
576
|
-
* @defaultValue `
|
|
582
|
+
* When unset, falls back to the global `all.adaptive`.
|
|
583
|
+
* @defaultValue `all.adaptive` (`true`)
|
|
577
584
|
*/
|
|
578
585
|
adaptive?: boolean;
|
|
579
586
|
/**
|
|
@@ -622,11 +629,11 @@ export type BbColorInputProps = {
|
|
|
622
629
|
* The field box's look, with `BbButton`'s names and tokens. Colours only,
|
|
623
630
|
* so a form never reflows; `'ghost'` has no border in any state, `'none'`
|
|
624
631
|
* no look at all (you own hover, focus and the states). Register more with
|
|
625
|
-
* the plugin's `
|
|
632
|
+
* the plugin's `components.BbColorInput.variants`.
|
|
626
633
|
*
|
|
627
634
|
* @defaultValue `'outline'`
|
|
628
635
|
*/
|
|
629
|
-
variant?:
|
|
636
|
+
variant?: InputVariantOf<ColorInputVariantRegistry>;
|
|
630
637
|
/**
|
|
631
638
|
* Text between the label and the input. Unlike the hint it is always
|
|
632
639
|
* visible; it joins the input's `aria-describedby` after any `errors` /
|
|
@@ -150,18 +150,7 @@
|
|
|
150
150
|
type="button"
|
|
151
151
|
@click="onEyeDropper"
|
|
152
152
|
>
|
|
153
|
-
<
|
|
154
|
-
aria-hidden="true"
|
|
155
|
-
fill="currentColor"
|
|
156
|
-
height="16"
|
|
157
|
-
viewBox="0 0 24 24"
|
|
158
|
-
width="16"
|
|
159
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
-
>
|
|
161
|
-
<path
|
|
162
|
-
d="M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L13.71,3.71L12.29,5.12L13.41,6.24L3,16.59V21H7.41L17.76,10.59L18.88,11.71L20.29,10.29L18.88,8.88L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63M6.58,19H5V17.42L13.29,9.12L14.88,10.71L6.58,19Z"
|
|
163
|
-
/>
|
|
164
|
-
</svg>
|
|
153
|
+
<BbIcon :icon="eyedropperSvg" size="16" />
|
|
165
154
|
</button>
|
|
166
155
|
</div>
|
|
167
156
|
|
|
@@ -241,7 +230,7 @@
|
|
|
241
230
|
:disable-flip="disableFlip"
|
|
242
231
|
:eager="eager"
|
|
243
232
|
hide-arrow
|
|
244
|
-
:offset="offset"
|
|
233
|
+
:offset="offset ?? popoverOffset() ?? 4"
|
|
245
234
|
:padding="padding"
|
|
246
235
|
:placement="placement"
|
|
247
236
|
:transition-duration="transitionDuration"
|
|
@@ -257,6 +246,8 @@
|
|
|
257
246
|
</template>
|
|
258
247
|
|
|
259
248
|
<script setup lang="ts">
|
|
249
|
+
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
250
|
+
import eyedropperSvg from '@/assets/svgs/eyedropper.svg?raw';
|
|
260
251
|
import { asSheetAttrs } from '../BbOffCanvas/sheetAttrs';
|
|
261
252
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
262
253
|
import {
|
|
@@ -269,7 +260,10 @@ import {
|
|
|
269
260
|
useAttrs,
|
|
270
261
|
watch,
|
|
271
262
|
} from 'vue';
|
|
272
|
-
import {
|
|
263
|
+
import {
|
|
264
|
+
useConfigDefaults,
|
|
265
|
+
useConfigSetting,
|
|
266
|
+
} from '@/composables/useConfigDefaults';
|
|
273
267
|
import { createReusableTemplate } from '@vueuse/core';
|
|
274
268
|
import {
|
|
275
269
|
extractDomContainer,
|
|
@@ -314,20 +308,25 @@ const props = withDefaults(
|
|
|
314
308
|
>(),
|
|
315
309
|
{
|
|
316
310
|
// `undefined` (declared, not omitted) keeps `adaptive` three-state: it disables
|
|
317
|
-
// Vue's absent→`false` Boolean cast so `props.adaptive ??
|
|
311
|
+
// Vue's absent→`false` Boolean cast so `props.adaptive ?? all.adaptive` can
|
|
318
312
|
// reach the config default, while keeping the Boolean type so the valueless
|
|
319
313
|
// `adaptive` shorthand still resolves to `true`.
|
|
320
314
|
adaptive: undefined,
|
|
321
315
|
alpha: false,
|
|
322
|
-
|
|
316
|
+
// Unset: `all.popoverOffset`, else 4 px.
|
|
317
|
+
offset: undefined,
|
|
323
318
|
padding: 6,
|
|
324
319
|
eyeDropper: false,
|
|
325
320
|
transitionDuration: transitions.medium,
|
|
326
321
|
}
|
|
327
322
|
);
|
|
328
|
-
|
|
329
323
|
const emit = defineEmits<BbColorPaletteEvents>();
|
|
324
|
+
|
|
330
325
|
defineSlots<BbColorPaletteSlots>();
|
|
326
|
+
|
|
327
|
+
/** `all.popoverOffset`: the app's or the scope's gap, read per render. */
|
|
328
|
+
const popoverOffset = useConfigSetting<number>(null, 'popoverOffset');
|
|
329
|
+
|
|
331
330
|
/**
|
|
332
331
|
* Passthrough (plans/passthrough/BbColorPalette.md). `root` binds on the
|
|
333
332
|
* floating popover, where a consumer `class` lands too (no node on the phone
|
|
@@ -343,7 +342,6 @@ const passthrough = usePassthrough({
|
|
|
343
342
|
active: { open: () => isOpen.value },
|
|
344
343
|
attrs: useAttrs(),
|
|
345
344
|
});
|
|
346
|
-
const config = useConfig();
|
|
347
345
|
export type { BbColorPaletteProps, BbColorPaletteEvents, BbColorPaletteSlots };
|
|
348
346
|
|
|
349
347
|
if (process.env.NODE_ENV !== 'production')
|
|
@@ -449,14 +447,17 @@ watch(isOpen, async (val) => {
|
|
|
449
447
|
// resize never swaps a live popover into a sheet (or vice-versa) — mirroring
|
|
450
448
|
// BbPopover/BbDropdown/BbDatePicker.
|
|
451
449
|
|
|
450
|
+
const configDefaults = useConfigDefaults('BbColorPalette', props, {
|
|
451
|
+
adaptive: true,
|
|
452
|
+
});
|
|
452
453
|
const resolveSurface = (): 'popover' | 'canvas' =>
|
|
453
|
-
|
|
454
|
+
configDefaults.adaptive && isMobile.value ? 'canvas' : 'popover';
|
|
454
455
|
const surface = ref<'popover' | 'canvas'>(resolveSurface());
|
|
455
456
|
const useOffcanvas = computed(() => surface.value === 'canvas');
|
|
456
457
|
|
|
457
458
|
// While closed, keep tracking the viewport so the next open resolves correctly;
|
|
458
459
|
// while open the surface stays frozen.
|
|
459
|
-
watch([() =>
|
|
460
|
+
watch([() => configDefaults.adaptive, isMobile, isOpen], () => {
|
|
460
461
|
if (!isOpen.value) surface.value = resolveSurface();
|
|
461
462
|
});
|
|
462
463
|
|
|
@@ -1262,8 +1263,8 @@ export type BbColorPaletteProps = {
|
|
|
1262
1263
|
* viewports instead of a floating popover; on desktop it stays a popover.
|
|
1263
1264
|
* Mirrors the adaptive behaviour of `BbPopover`/`BbDropdown`/`BbDatePicker`.
|
|
1264
1265
|
*
|
|
1265
|
-
* When unset, falls back to the global `
|
|
1266
|
-
* @defaultValue `
|
|
1266
|
+
* When unset, falls back to the global `all.adaptive`.
|
|
1267
|
+
* @defaultValue `all.adaptive` (`true`)
|
|
1267
1268
|
*/
|
|
1268
1269
|
adaptive?: boolean;
|
|
1269
1270
|
/**
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# BbConfigScope — Implementation Source
|
|
2
|
+
|
|
3
|
+
> Full implementation for deep dives. For everyday usage read the typed contract: [../BbConfigScope.md](../BbConfigScope.md).
|
|
4
|
+
|
|
5
|
+
## Template & Script
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<slot />
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
// Renderless: it only provides the scope chain `usePassthrough` and
|
|
14
|
+
// `useConfigDefaults` read. No element, so it can sit anywhere — a layout
|
|
15
|
+
// root, around a table cell — and `provide` follows the component tree, so
|
|
16
|
+
// dialogs, popovers and pickers opened inside resolve the scope wherever they
|
|
17
|
+
// paint.
|
|
18
|
+
import { computed, inject, provide, toRaw } from 'vue';
|
|
19
|
+
import { useLogger } from '@/composables/useLogger';
|
|
20
|
+
import { GLOBAL_ONLY_DEFAULTS } from '@/types/ConfigDefaults';
|
|
21
|
+
import {
|
|
22
|
+
CONFIG_SCOPE_KEY,
|
|
23
|
+
markScopeMounted,
|
|
24
|
+
namedScopes,
|
|
25
|
+
type ConfigLayer,
|
|
26
|
+
type ConfigMap,
|
|
27
|
+
} from '@/utils/configScope';
|
|
28
|
+
import type { BbConfigScopeProps, BbConfigScopeSlots } from './types';
|
|
29
|
+
export type { BbConfigScopeProps, BbConfigScopeSlots };
|
|
30
|
+
|
|
31
|
+
const props = defineProps<BbConfigScopeProps>();
|
|
32
|
+
defineSlots<BbConfigScopeSlots>();
|
|
33
|
+
|
|
34
|
+
markScopeMounted();
|
|
35
|
+
const parent = inject(CONFIG_SCOPE_KEY, null);
|
|
36
|
+
|
|
37
|
+
const globalOnly = GLOBAL_ONLY_DEFAULTS as Record<string, readonly string[]>;
|
|
38
|
+
const logger = process.env.NODE_ENV !== 'production' ? useLogger() : null;
|
|
39
|
+
const warned = new Set<string>();
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The inline map, by content: a template literal `:config="{ … }"` is a new
|
|
43
|
+
* object on every parent render, so the layer is rebuilt only when the
|
|
44
|
+
* serialised map differs, and the subtree re-resolves only then.
|
|
45
|
+
*/
|
|
46
|
+
let lastKey: string | undefined;
|
|
47
|
+
let lastLayer: ConfigLayer | undefined;
|
|
48
|
+
const inlineLayer = (): ConfigLayer | undefined => {
|
|
49
|
+
const map = props.config;
|
|
50
|
+
if (!map) return (lastKey = lastLayer = undefined);
|
|
51
|
+
const key = JSON.stringify(toRaw(map));
|
|
52
|
+
if (key === lastKey && lastLayer) return lastLayer;
|
|
53
|
+
if (logger)
|
|
54
|
+
for (const [component, entry] of Object.entries(map))
|
|
55
|
+
for (const prop of Object.keys(entry ?? {}))
|
|
56
|
+
if (
|
|
57
|
+
(prop === 'variants' || globalOnly[component]?.includes(prop)) &&
|
|
58
|
+
!warned.has(`${component}.${prop}`)
|
|
59
|
+
) {
|
|
60
|
+
warned.add(`${component}.${prop}`);
|
|
61
|
+
logger.warn(
|
|
62
|
+
`BbConfigScope: \`config.${component}.${prop}\` is app-wide only and is ignored here. Set it in the plugin's \`components\` map.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
lastKey = key;
|
|
66
|
+
lastLayer = {
|
|
67
|
+
source: '<BbConfigScope :config>',
|
|
68
|
+
map: JSON.parse(key) as ConfigMap,
|
|
69
|
+
};
|
|
70
|
+
return lastLayer;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// The same layer object comes back while the content is unchanged, so this
|
|
74
|
+
// computed does not trigger, and the chain below (and every reader) stays put.
|
|
75
|
+
const inline = computed(inlineLayer);
|
|
76
|
+
|
|
77
|
+
provide(
|
|
78
|
+
CONFIG_SCOPE_KEY,
|
|
79
|
+
computed((): readonly ConfigLayer[] => {
|
|
80
|
+
const out = [...(parent?.value ?? [])];
|
|
81
|
+
if (props.name)
|
|
82
|
+
out.push({
|
|
83
|
+
source: `configScopes.${props.name}`,
|
|
84
|
+
map: namedScopes.value[props.name] ?? {},
|
|
85
|
+
});
|
|
86
|
+
const own = inline.value;
|
|
87
|
+
if (own) out.push(own);
|
|
88
|
+
return out;
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
</script>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Types
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import type {
|
|
98
|
+
BbComponentsMap,
|
|
99
|
+
BbConfigScopeName,
|
|
100
|
+
} from '@/types/ConfigDefaults';
|
|
101
|
+
|
|
102
|
+
export type { BbComponentsMap, BbConfigScopeName };
|
|
103
|
+
|
|
104
|
+
export type BbConfigScopeProps = {
|
|
105
|
+
/**
|
|
106
|
+
* The named scope to switch on inside: a key of the plugin's
|
|
107
|
+
* `configScopes` (typed from your config). Nested scopes: `pt` merges outer
|
|
108
|
+
* first, a default comes from the nearest scope that sets it. Reactive.
|
|
109
|
+
*/
|
|
110
|
+
name?: BbConfigScopeName;
|
|
111
|
+
/**
|
|
112
|
+
* An inline scope: the same map as a `configScopes` entry, minus the
|
|
113
|
+
* app-wide `variants` and `nullValue`. With `name`, it applies on top.
|
|
114
|
+
* Re-resolved only when its content changes: keep it static or hoisted.
|
|
115
|
+
*/
|
|
116
|
+
config?: BbComponentsMap<'scope'>;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export type BbConfigScopeSlots = {
|
|
120
|
+
/** The subtree the scope applies to. Rendered as is — no wrapper element. */
|
|
121
|
+
default?: () => unknown;
|
|
122
|
+
};
|
|
123
|
+
```
|