bitboss-ui 3.0.0-beta.48 → 3.0.0-beta.49
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 +24 -7
- package/bin/bitboss-ui-mcp.mjs +15 -3
- package/bin/bitboss-ui.mjs +115 -13
- package/dist/ai/BbAvatar.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +65 -65
- package/dist/ai/BbButton.md +16 -5
- package/dist/ai/BbCheckbox.md +0 -2
- package/dist/ai/BbCheckboxGroup.md +13 -20
- package/dist/ai/BbDatePickerInput.md +4 -2
- package/dist/ai/BbDialog.md +1 -8
- package/dist/ai/BbDropdown.md +231 -220
- package/dist/ai/BbDropdownButton.md +65 -65
- package/dist/ai/BbDropdownGroup.md +2 -2
- package/dist/ai/BbDropzone.md +10 -10
- package/dist/ai/BbForm.md +43 -52
- package/dist/ai/BbHoverCard.md +4 -2
- package/dist/ai/BbNumberInput.md +88 -21
- package/dist/ai/BbPopover.md +29 -23
- package/dist/ai/BbProgress.md +48 -22
- package/dist/ai/BbRadioGroup.md +13 -19
- package/dist/ai/BbSelect.md +16 -36
- package/dist/ai/BbSelectPopover.md +14 -30
- package/dist/ai/BbSmoothHeight.md +0 -2
- package/dist/ai/BbSwitchGroup.md +13 -20
- package/dist/ai/BbTable.md +11 -10
- package/dist/ai/BbTabs.md +106 -105
- package/dist/ai/BbTabsList.md +2 -2
- package/dist/ai/BbTabsPanels.md +1 -1
- package/dist/ai/BbTabsRoot.md +2 -2
- package/dist/ai/BbTooltip.md +24 -10
- package/dist/ai/BbTree.md +14 -11
- package/dist/ai/changelog.json +256 -5
- package/dist/ai/components.json +36 -34
- package/dist/ai/composables/useBbDropdownContext.md +16 -16
- package/dist/ai/composables/useBbFormField.md +5 -1
- package/dist/ai/composables/useBbTabsContext.md +14 -14
- package/dist/ai/guides/agent-contract.md +27 -27
- package/dist/ai/guides/ai-router.md +1 -1
- package/dist/ai/guides/component-picker.md +3 -3
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/icons-policy.md +10 -10
- package/dist/ai/guides/inertia-helpers.md +120 -67
- package/dist/ai/guides/installation-and-plugin-setup.md +43 -15
- package/dist/ai/guides/migration/components/bb-breadcrumbs.md +3 -2
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +16 -16
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +9 -8
- package/dist/ai/guides/migration/components/bb-dropdown.md +15 -14
- package/dist/ai/guides/migration/components/bb-radio-group.md +2 -1
- package/dist/ai/guides/migration/components/bb-select-popover.md +6 -1
- package/dist/ai/guides/migration/components/bb-select.md +10 -2
- package/dist/ai/guides/migration/components/bb-switch-group.md +2 -1
- package/dist/ai/guides/migration/components/bb-tabs.md +9 -8
- package/dist/ai/guides/migration/components/bb-tooltip.md +1 -1
- package/dist/ai/guides/migration/v2-to-v3.md +114 -17
- package/dist/ai/guides/migration/v3-beta-tooling.md +11 -0
- package/dist/ai/guides/options-items-playbook.md +30 -24
- package/dist/ai/guides/passthrough.md +2 -2
- package/dist/ai/guides/preset-components.md +18 -3
- package/dist/ai/guides/typescript-generic-components.md +1 -1
- package/dist/ai/guides/validated-forms.md +11 -22
- package/dist/ai/guides/validation-providers.md +4 -3
- package/dist/ai/helpers/inertia/manifest.json +636 -0
- package/dist/ai/helpers/inertia/types.ts +15 -0
- package/dist/ai/helpers/inertia/useAsyncFn.ts +110 -0
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +102 -0
- package/dist/ai/helpers/inertia/useDeleteCmd.ts +30 -0
- package/dist/ai/helpers/inertia/useHasChanged.ts +36 -0
- package/dist/ai/helpers/inertia/useIndexById.ts +23 -0
- package/dist/ai/helpers/inertia/useLazyProp.ts +148 -0
- package/dist/ai/helpers/inertia/useLazyPropGetter.ts +50 -0
- package/dist/ai/helpers/inertia/useLoading.ts +20 -0
- package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +88 -0
- package/dist/ai/helpers/inertia/usePromiseForm.ts +62 -0
- package/dist/ai/helpers/inertia/useProp.ts +63 -0
- package/dist/ai/helpers/inertia/useQuery.ts +19 -0
- package/dist/ai/helpers/inertia/useQueryObject.ts +116 -0
- package/dist/ai/helpers/inertia/useResourceContext.ts +69 -0
- package/dist/ai/helpers/inertia/useRouteQuery.ts +54 -0
- package/dist/ai/helpers/inertia/useScreenSizes.ts +23 -0
- package/dist/ai/helpers/inertia/useTableContext.ts +34 -0
- package/dist/ai/helpers/inertia/useTableSelectionContext.ts +48 -0
- package/dist/ai/helpers/inertia/useUntil.ts +33 -0
- package/dist/ai/helpers/inertia/utils.ts +24 -0
- package/dist/ai/index.md +6 -6
- package/dist/ai/manifest/components/BbBreadcrumbs.json +10 -6
- package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +1 -1
- package/dist/ai/manifest/components/BbButton.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbDropdown.json +23 -20
- package/dist/ai/manifest/components/BbDropdown.tree.json +2 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +22 -19
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdownGroup.json +2 -2
- package/dist/ai/manifest/components/BbForm.json +1 -0
- package/dist/ai/manifest/components/BbNumberInput.json +6 -1
- package/dist/ai/manifest/components/BbNumberInput.tree.json +2 -1
- package/dist/ai/manifest/components/BbPopover.json +1 -0
- package/dist/ai/manifest/components/BbProgress.json +6 -6
- package/dist/ai/manifest/components/BbProgress.tree.json +1 -0
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbSelect.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbTabs.json +7 -6
- package/dist/ai/manifest/components/BbTabsList.json +3 -3
- package/dist/ai/manifest/components/BbTabsPanels.json +1 -1
- package/dist/ai/manifest/components/BbTabsRoot.json +5 -4
- package/dist/ai/manifest/components/BbTooltip.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +2 -0
- package/dist/ai/manifest/types.advanced.json +10 -9
- package/dist/ai/manifest/types.api.json +5 -4
- package/dist/ai/recipes/inertia/approvals-inbox.md +16 -18
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +23 -33
- package/dist/ai/recipes/inertia/layout-scaffold.md +16 -16
- package/dist/ai/recipes/inertia/onboarding.md +6 -10
- package/dist/ai/recipes/inertia/ownership-atlas.md +15 -18
- package/dist/ai/recipes/inertia/record-form.md +11 -11
- package/dist/ai/recipes/inertia/records-workspace.md +38 -41
- package/dist/ai/recipes/inertia/settings-workspace.md +26 -38
- package/dist/ai/recipes/inertia/upload-center.md +31 -39
- package/dist/ai/recipes/inertia/wizard-form.md +10 -19
- package/dist/ai/recipes/nuxt/approvals-inbox.md +7 -8
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +14 -24
- package/dist/ai/recipes/nuxt/layout-scaffold.md +16 -16
- package/dist/ai/recipes/nuxt/onboarding.md +2 -6
- package/dist/ai/recipes/nuxt/ownership-atlas.md +7 -9
- package/dist/ai/recipes/nuxt/record-form.md +5 -5
- package/dist/ai/recipes/nuxt/records-workspace.md +29 -31
- package/dist/ai/recipes/nuxt/settings-workspace.md +22 -34
- package/dist/ai/recipes/nuxt/upload-center.md +22 -29
- package/dist/ai/recipes/nuxt/wizard-form.md +3 -11
- package/dist/ai/recipes/vue/approvals-inbox.md +7 -8
- package/dist/ai/recipes/vue/inline-edit-workspace.md +14 -24
- package/dist/ai/recipes/vue/layout-scaffold.md +16 -16
- package/dist/ai/recipes/vue/onboarding.md +2 -6
- package/dist/ai/recipes/vue/ownership-atlas.md +7 -9
- package/dist/ai/recipes/vue/record-form.md +5 -5
- package/dist/ai/recipes/vue/records-workspace.md +29 -31
- package/dist/ai/recipes/vue/settings-workspace.md +22 -34
- package/dist/ai/recipes/vue/upload-center.md +22 -29
- package/dist/ai/recipes/vue/wizard-form.md +3 -11
- package/dist/ai/source/BbAccordion.md +1 -1
- package/dist/ai/source/BbAlert.md +3 -3
- package/dist/ai/source/BbBadge.md +2 -2
- package/dist/ai/source/BbBadgeButton.md +5 -4
- package/dist/ai/source/BbBaseButton.md +1 -1
- package/dist/ai/source/BbBaseRadioIcon.md +1 -0
- package/dist/ai/source/BbBaseSwitchIcon.md +1 -0
- package/dist/ai/source/BbBreadcrumbs.md +63 -42
- package/dist/ai/source/BbButton.md +71 -33
- package/dist/ai/source/BbCalendar.md +17 -16
- package/dist/ai/source/BbCheckbox.md +3 -2
- package/dist/ai/source/BbCheckboxGroup.md +11 -4
- package/dist/ai/source/BbColorInput.md +10 -9
- package/dist/ai/source/BbConfirm.md +1 -1
- package/dist/ai/source/BbConfirmPortal.md +1 -1
- package/dist/ai/source/BbDatePicker.md +2 -2
- package/dist/ai/source/BbDatePickerInput.md +47 -20
- package/dist/ai/source/BbDialog.md +5 -5
- package/dist/ai/source/BbDropdown.md +230 -158
- package/dist/ai/source/BbDropdownButton.md +19 -12
- package/dist/ai/source/BbDropdownGroup.md +126 -93
- package/dist/ai/source/BbForm.md +25 -1
- package/dist/ai/source/BbIndicator.md +4 -0
- package/dist/ai/source/BbNumberInput.md +855 -19
- package/dist/ai/source/BbOffCanvas.md +27 -11
- package/dist/ai/source/BbPagination.md +3 -3
- package/dist/ai/source/BbPopover.md +152 -8
- package/dist/ai/source/BbPopoverPortal.md +11 -0
- package/dist/ai/source/BbProgress.md +82 -18
- package/dist/ai/source/BbRadioGroup.md +12 -5
- package/dist/ai/source/BbRating.md +11 -9
- package/dist/ai/source/BbSelect.md +16 -10
- package/dist/ai/source/BbSelectPopover.md +29 -23
- package/dist/ai/source/BbSlider.md +12 -6
- package/dist/ai/source/BbSwitch.md +3 -2
- package/dist/ai/source/BbSwitchGroup.md +5 -2
- package/dist/ai/source/BbTable.md +102 -18
- package/dist/ai/source/BbTabs.md +27 -23
- package/dist/ai/source/BbTabsList.md +26 -22
- package/dist/ai/source/BbTabsPanels.md +26 -22
- package/dist/ai/source/BbTabsRoot.md +25 -21
- package/dist/ai/source/BbTag.md +10 -9
- package/dist/ai/source/BbTextInput.md +5 -4
- package/dist/ai/source/BbTextarea.md +6 -5
- package/dist/ai/source/BbTimePicker.md +1 -1
- package/dist/ai/source/BbTimePickerInput.md +46 -9
- package/dist/ai/source/BbToast.md +10 -7
- package/dist/ai/source/BbToastPortal.md +10 -7
- package/dist/ai/source/BbTooltip.md +54 -8
- package/dist/ai/source/BbTree.md +21 -3
- package/dist/ai/source/CommonField.md +6 -4
- package/dist/ai/source/CommonFieldInput.md +15 -10
- package/dist/ai/source/CommonPopover.md +6 -0
- package/dist/ai/source/CommonTimeSelector.md +5 -4
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +10 -8
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +45 -45
- package/dist/components/BbBreadcrumbs/types.d.ts +25 -17
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +84 -71
- package/dist/components/BbButton/toggleRoving.d.ts +6 -0
- package/dist/components/BbButton/toggleRoving.js +45 -0
- package/dist/components/BbButton/types.d.ts +4 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +178 -178
- package/dist/components/BbCalendar/CalendarMonthPanel.vue_vue_type_script_setup_true_lang.js +15 -15
- package/dist/components/BbCalendar/CalendarYearPanel.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/components/BbCalendar/useCalendarGrid.js +141 -139
- package/dist/components/BbCalendar/useDayjsLocale.d.ts +38 -15
- package/dist/components/BbCalendar/useDayjsLocale.js +31 -30
- package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +48 -48
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbCheckboxGroup/types.d.ts +6 -2
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +69 -69
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +363 -349
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +91 -86
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +298 -289
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +322 -356
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +17 -15
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +40 -0
- package/dist/components/BbDropdown/DropdownRow.vue.js +5 -0
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/BbDropdown/normalizeGroups.d.ts +8 -2
- package/dist/components/BbDropdown/normalizeGroups.js +60 -46
- package/dist/components/BbDropdown/types.d.ts +119 -88
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +11 -2
- package/dist/components/BbDropdownButton/types.d.ts +2 -2
- package/dist/components/BbForm/BbForm.vue.d.ts +9 -0
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +114 -105
- package/dist/components/BbForm/BbFormCustomField.js +1 -1
- package/dist/components/BbForm/bindFormField.js +2 -1
- package/dist/components/BbForm/formFields.d.ts +5 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +0 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +452 -125
- package/dist/components/BbNumberInput/numberDisplay.d.ts +256 -0
- package/dist/components/BbNumberInput/numberDisplay.js +499 -0
- package/dist/components/BbNumberInput/types.d.ts +54 -1
- package/dist/components/BbNumberInput/warroom/corpus.d.ts +58 -0
- package/dist/components/BbNumberInput/warroom/currency-verify.rows.d.ts +28 -0
- package/dist/components/BbNumberInput/warroom/currency.rows.d.ts +2 -0
- package/dist/components/BbNumberInput/warroom/harness.d.ts +217 -0
- package/dist/components/BbNumberInput/warroom/oracle.d.ts +150 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/BbPopover/BbPopover.vue.d.ts +1 -0
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +207 -164
- package/dist/components/BbPopover/types.d.ts +11 -0
- package/dist/components/BbProgress/BbProgress.vue_vue_type_script_setup_true_lang.js +15 -7
- package/dist/components/BbProgress/types.d.ts +23 -7
- package/dist/components/BbProgress/types.js +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +102 -101
- package/dist/components/BbRadioGroup/types.d.ts +6 -2
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +63 -63
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +156 -154
- package/dist/components/BbSelect/types.d.ts +6 -2
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbSelectPopover/types.d.ts +6 -2
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +153 -153
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +62 -62
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +131 -130
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +711 -676
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTabs/types.d.ts +25 -21
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +76 -76
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +58 -58
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +82 -82
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +246 -236
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +102 -97
- package/dist/components/BbTooltip/tooltipWarmup.d.ts +23 -0
- package/dist/components/BbTooltip/tooltipWarmup.js +7 -0
- package/dist/components/BbTooltip/types.d.ts +7 -2
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +29 -21
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +10 -7
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +37 -36
- package/dist/components/CommonTimeSelector/CommonTimeSelector.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/composables/formSubmitLock.d.ts +6 -0
- package/dist/composables/formSubmitLock.js +4 -0
- package/dist/composables/useBaseOptions.d.ts +7 -1
- package/dist/composables/useBaseOptions.js +32 -32
- package/dist/composables/useBbDropdownContext.d.ts +8 -8
- package/dist/composables/useBbFormField.d.ts +9 -0
- package/dist/composables/useBbFormField.js +5 -3
- package/dist/composables/useBbTabsContext.d.ts +10 -10
- package/dist/composables/useBbTabsContext.js +18 -18
- package/dist/composables/useFormBinding.d.ts +11 -0
- package/dist/composables/useFormBinding.js +15 -13
- package/dist/composables/useItemText.d.ts +5 -1
- package/dist/composables/useItemText.js +8 -3
- package/dist/composables/useItemValue.d.ts +5 -1
- package/dist/composables/useItemValue.js +8 -3
- package/dist/composables/useLocale.js +10 -9
- package/dist/deprecation/ai-deprecations.json.d.ts +130 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/deprecation/removedProps.js +1 -1
- package/dist/directives/bbDropdown.js +1 -1
- package/dist/i18n/index.d.ts +7 -12
- package/dist/i18n/locales/cs.json +11 -14
- package/dist/i18n/locales/da.json +13 -16
- package/dist/i18n/locales/de-CH.json +137 -0
- package/dist/i18n/locales/de.json +14 -17
- package/dist/i18n/locales/el.json +10 -13
- package/dist/i18n/locales/en-GB.json +137 -0
- package/dist/i18n/locales/en.json +8 -11
- package/dist/i18n/locales/es-MX.json +137 -0
- package/dist/i18n/locales/es.json +16 -19
- package/dist/i18n/locales/fi.json +8 -11
- package/dist/i18n/locales/fr.json +23 -26
- package/dist/i18n/locales/hu.json +8 -11
- package/dist/i18n/locales/it.json +12 -15
- package/dist/i18n/locales/ja.json +13 -16
- package/dist/i18n/locales/ko.json +10 -13
- package/dist/i18n/locales/nb.json +13 -16
- package/dist/i18n/locales/nl.json +21 -24
- package/dist/i18n/locales/pl.json +10 -13
- package/dist/i18n/locales/{pt.json → pt-BR.json} +19 -22
- package/dist/i18n/locales/pt-PT.json +137 -0
- package/dist/i18n/locales/ro.json +22 -25
- package/dist/i18n/locales/ru.json +11 -14
- package/dist/i18n/locales/sv.json +16 -19
- package/dist/i18n/locales/tr.json +14 -17
- package/dist/i18n/locales/uk.json +11 -14
- package/dist/i18n/locales/{zh-cn.json → zh-CN.json} +10 -13
- package/dist/i18n/locales/zh-HK.json +137 -0
- package/dist/i18n/locales/zh-TW.json +137 -0
- package/dist/i18n/regionHints.d.ts +16 -0
- package/dist/i18n/regionHints.js +49 -0
- package/dist/i18n/regions.d.ts +286 -0
- package/dist/i18n/regions.js +265 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/llms-full.txt +1785 -1637
- package/dist/llms-medium.txt +74 -46
- package/dist/llms.txt +7 -7
- package/dist/locale-blueprint.json +16 -13
- package/dist/styles.css +2 -2
- package/dist/types/ptComponentMap.d.ts +1 -1
- package/dist/utilities/functions/slotKey.d.ts +2 -2
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +22 -19
- package/dist/vite.js +309 -297
- package/llms.txt +7 -7
- package/package.json +5 -3
- package/scripts/lib/agent-manifest.mjs +2 -1
- package/scripts/lib/eslint-disable.mjs +12 -4
- package/scripts/lib/eslint-plugin.d.ts +5 -1
- package/scripts/lib/eslint-plugin.mjs +187 -6
- package/scripts/lib/helper-canon.mjs +176 -0
- package/scripts/lib/helpers-add.mjs +1303 -0
- package/scripts/lib/local-components.mjs +33 -4
- package/scripts/lib/locale-check.mjs +165 -0
- package/scripts/lib/redundant-item-accessor.mjs +398 -0
- package/scripts/lib/renamed-item-field.mjs +343 -0
- package/scripts/lib/slot-key.mjs +2 -2
- package/scripts/lib/slot-renames.mjs +1 -1
- package/scripts/lib/validate-bb-markup.mjs +123 -56
- package/dist/i18n/index.js +0 -27
package/dist/components/CommonTimeSelector/CommonTimeSelector.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { useLocale as e } from "../../composables/useLocale.js";
|
|
2
|
+
import t from "../BbBaseButton/BbBaseButton.vue.js";
|
|
3
3
|
import { useTypeahead as n } from "../../composables/useTypeahead.js";
|
|
4
4
|
import { useMeridiem as r } from "./useMeridiem.js";
|
|
5
5
|
import { Fragment as i, computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, mergeProps as d, nextTick as f, normalizeClass as p, onMounted as m, openBlock as h, renderList as g, toDisplayString as _, watch as v, withCtx as y } from "vue";
|
|
@@ -21,7 +21,7 @@ var b = { class: "bb-time-selector" }, x = { class: "bb-time-selector__columns"
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["select"],
|
|
23
23
|
setup(u, { emit: w }) {
|
|
24
|
-
let T = u, E = w, { t: D } =
|
|
24
|
+
let T = u, E = w, { t: D } = e(), O = {}, k = (e, t) => t === "PM" ? e === 12 ? 12 : e + 12 : e === 12 ? 0 : e, A = r(), j = a(() => T.meridiem ? A.isPm(T.meridiem) ? "PM" : "AM" : T.hour && parseInt(T.hour, 10) >= 12 ? "PM" : "AM"), M = (e) => {
|
|
25
25
|
if (e === "hour") {
|
|
26
26
|
if (!T.hour) return null;
|
|
27
27
|
let e = parseInt(T.hour, 10);
|
|
@@ -193,10 +193,10 @@ var b = { class: "bb-time-selector" }, x = { class: "bb-time-selector__columns"
|
|
|
193
193
|
let n = H.value.findIndex((t) => t.unit === e.unit);
|
|
194
194
|
X[n]?.(t);
|
|
195
195
|
};
|
|
196
|
-
return (
|
|
196
|
+
return (e, n) => (h(), s("div", b, [c("div", d({
|
|
197
197
|
"aria-hidden": "true",
|
|
198
198
|
class: ["bb-time-selector__header", { "bb-time-selector__header--empty": W.value }]
|
|
199
|
-
},
|
|
199
|
+
}, e.passthrough?.header), _(U.value), 17), c("div", x, [(h(!0), s(i, null, g(H.value, (n) => (h(), s("div", {
|
|
200
200
|
key: n.unit,
|
|
201
201
|
"aria-label": n.ariaLabel,
|
|
202
202
|
class: p(["bb-time-selector__column", `bb-time-selector__column--${n.unit}`]),
|
|
@@ -206,12 +206,12 @@ var b = { class: "bb-time-selector" }, x = { class: "bb-time-selector__columns"
|
|
|
206
206
|
"aria-hidden": "true",
|
|
207
207
|
class: "bb-time-selector__cell-column-header",
|
|
208
208
|
ref_for: !0
|
|
209
|
-
},
|
|
209
|
+
}, e.passthrough?.cellColumnHeader), _(n.header), 17), c("div", {
|
|
210
210
|
ref_for: !0,
|
|
211
211
|
ref: (e) => O[n.unit] = e,
|
|
212
212
|
class: "bb-time-selector__scroll",
|
|
213
213
|
"data-bb-no-drag": ""
|
|
214
|
-
}, [(h(!0), s(i, null, g(n.options, (r) => (h(), o(
|
|
214
|
+
}, [(h(!0), s(i, null, g(n.options, (r) => (h(), o(t, d({
|
|
215
215
|
key: r.value,
|
|
216
216
|
"aria-pressed": r.selected,
|
|
217
217
|
class: ["bb-time-selector__item", {
|
|
@@ -219,10 +219,10 @@ var b = { class: "bb-time-selector" }, x = { class: "bb-time-selector__columns"
|
|
|
219
219
|
"bb-time-selector__item--disabled": r.disabled
|
|
220
220
|
}],
|
|
221
221
|
"data-value": r.value,
|
|
222
|
-
disabled:
|
|
222
|
+
disabled: e.disabled || r.disabled,
|
|
223
223
|
onClick: (e) => G(n, r),
|
|
224
224
|
ref_for: !0
|
|
225
|
-
},
|
|
225
|
+
}, e.passthrough?.part?.("item", {
|
|
226
226
|
selected: r.selected,
|
|
227
227
|
disabled: r.disabled || void 0
|
|
228
228
|
})), {
|
|
@@ -13,6 +13,12 @@ type Options = {
|
|
|
13
13
|
* `append:icon`) — see `ItemProps`. Absent means none of them.
|
|
14
14
|
*/
|
|
15
15
|
itemProps?: MaybeRef<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Q60.24: with no `itemText` / `itemValue`, read an own `label` (then
|
|
18
|
+
* `text`) and an own `value` (see `getOptionText` / `getOptionValue`).
|
|
19
|
+
* The option surfaces set it; BbTable and BbTag keep the whole item.
|
|
20
|
+
*/
|
|
21
|
+
optionDefaults?: boolean;
|
|
16
22
|
};
|
|
17
23
|
type BaseOptionIdentity = {
|
|
18
24
|
item: any;
|
|
@@ -27,7 +33,7 @@ type BaseOption2 = BaseOptionIdentity & {
|
|
|
27
33
|
selected: boolean;
|
|
28
34
|
disabled: boolean;
|
|
29
35
|
};
|
|
30
|
-
export declare const useBaseOptions: ({ items, disabled, selectable, itemText, itemValue, itemProps, selectedIndexedByHash, max, }: Options) => {
|
|
36
|
+
export declare const useBaseOptions: ({ items, disabled, selectable, itemText, itemValue, itemProps, selectedIndexedByHash, max, optionDefaults, }: Options) => {
|
|
31
37
|
options: import('vue').ComputedRef<BaseOption2[]>;
|
|
32
38
|
baseOptions: import('vue').ComputedRef<BaseOptionIdentity[]>;
|
|
33
39
|
createOption: (item: any) => {
|
|
@@ -4,70 +4,70 @@ import { useItemValue as n } from "./useItemValue.js";
|
|
|
4
4
|
import { asDescription as r, createItemPropsResolver as i } from "../utilities/functions/itemProps.js";
|
|
5
5
|
import { computed as a, unref as o } from "vue";
|
|
6
6
|
//#region src/composables/useBaseOptions.ts
|
|
7
|
-
var { getItemText: s } = t(), { getItemValue:
|
|
7
|
+
var { getItemText: s, getOptionText: c } = t(), { getItemValue: l, getOptionValue: u } = n(), d = (e, t, n, r, i, a) => {
|
|
8
8
|
if (t) return !0;
|
|
9
9
|
if (typeof n == "function") {
|
|
10
10
|
if (!n(e)) return !0;
|
|
11
11
|
} else if (typeof n == "boolean" && !n) return !0;
|
|
12
12
|
return !a && r !== void 0 && i >= r;
|
|
13
|
-
},
|
|
14
|
-
let
|
|
15
|
-
let n =
|
|
13
|
+
}, f = ({ items: t, disabled: n, selectable: f, itemText: m, itemValue: h, itemProps: g, selectedIndexedByHash: _, max: v = Infinity, optionDefaults: y = !1 }) => {
|
|
14
|
+
let b = y ? c : s, x = y ? u : l, S = a(() => o(n)), C = a(() => o(t)), w = a(() => Object.keys(_.value).length), T = (t) => {
|
|
15
|
+
let n = x(t, o(h)), a = e(n), s = b(t, o(m)), c = i(o(g)).field, l = _.value[a] !== void 0, u = d(t, S.value, o(f), o(v), w.value, l);
|
|
16
16
|
return {
|
|
17
17
|
item: t,
|
|
18
|
-
text:
|
|
19
|
-
description: r(
|
|
20
|
-
"prepend:icon":
|
|
21
|
-
"append:icon":
|
|
18
|
+
text: s,
|
|
19
|
+
description: r(c(t, "description")),
|
|
20
|
+
"prepend:icon": c(t, "prepend:icon"),
|
|
21
|
+
"append:icon": c(t, "append:icon"),
|
|
22
22
|
value: n,
|
|
23
23
|
valueHash: a,
|
|
24
|
-
selected:
|
|
25
|
-
disabled: o(
|
|
24
|
+
selected: l,
|
|
25
|
+
disabled: o(u)
|
|
26
26
|
};
|
|
27
|
-
},
|
|
28
|
-
let t = [], n = /* @__PURE__ */ new Set(), a = o(
|
|
29
|
-
for (let i of
|
|
30
|
-
let
|
|
31
|
-
if (n.has(
|
|
32
|
-
n.add(
|
|
33
|
-
let
|
|
27
|
+
}, E = a(() => {
|
|
28
|
+
let t = [], n = /* @__PURE__ */ new Set(), a = o(m), s = i(o(g)).field;
|
|
29
|
+
for (let i of C.value) {
|
|
30
|
+
let c = x(i, o(h)), l = e(c);
|
|
31
|
+
if (n.has(l)) continue;
|
|
32
|
+
n.add(l);
|
|
33
|
+
let u;
|
|
34
34
|
t.push({
|
|
35
35
|
item: i,
|
|
36
36
|
get text() {
|
|
37
|
-
return
|
|
37
|
+
return u ??= b(i, a);
|
|
38
38
|
},
|
|
39
39
|
get description() {
|
|
40
|
-
return r(
|
|
40
|
+
return r(s(i, "description"));
|
|
41
41
|
},
|
|
42
42
|
get "prepend:icon"() {
|
|
43
|
-
return
|
|
43
|
+
return s(i, "prepend:icon");
|
|
44
44
|
},
|
|
45
45
|
get "append:icon"() {
|
|
46
|
-
return
|
|
46
|
+
return s(i, "append:icon");
|
|
47
47
|
},
|
|
48
|
-
value:
|
|
49
|
-
valueHash:
|
|
48
|
+
value: c,
|
|
49
|
+
valueHash: l
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
return t;
|
|
53
|
-
}),
|
|
53
|
+
}), D = /* @__PURE__ */ new Map();
|
|
54
54
|
return {
|
|
55
55
|
options: a(() => {
|
|
56
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
57
|
-
let n =
|
|
56
|
+
let e = /* @__PURE__ */ new Map(), t = E.value.map((t) => {
|
|
57
|
+
let n = _.value[t.valueHash] !== void 0, r = d(t.item, S.value, o(f), o(v), w.value, n), i = D.get(t.valueHash);
|
|
58
58
|
if (i && i.base === t && i.option.selected === n && i.option.disabled === r) return e.set(t.valueHash, i), i.option;
|
|
59
|
-
let a =
|
|
59
|
+
let a = p(t, n, r);
|
|
60
60
|
return e.set(t.valueHash, {
|
|
61
61
|
base: t,
|
|
62
62
|
option: a
|
|
63
63
|
}), a;
|
|
64
64
|
});
|
|
65
|
-
return
|
|
65
|
+
return D = e, t;
|
|
66
66
|
}),
|
|
67
|
-
baseOptions:
|
|
68
|
-
createOption:
|
|
67
|
+
baseOptions: E,
|
|
68
|
+
createOption: T
|
|
69
69
|
};
|
|
70
|
-
},
|
|
70
|
+
}, p = (e, t, n) => ({
|
|
71
71
|
item: e.item,
|
|
72
72
|
get text() {
|
|
73
73
|
return e.text;
|
|
@@ -87,4 +87,4 @@ var { getItemText: s } = t(), { getItemValue: c } = n(), l = (e, t, n, r, i, a)
|
|
|
87
87
|
disabled: n
|
|
88
88
|
});
|
|
89
89
|
//#endregion
|
|
90
|
-
export {
|
|
90
|
+
export { f as useBaseOptions };
|
|
@@ -2,15 +2,15 @@ import { InternalGroup } from '../components/BbDropdown/types';
|
|
|
2
2
|
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
3
3
|
/**
|
|
4
4
|
* One selected option of a group, resolved as far as the dropdown currently can.
|
|
5
|
-
* `value` is always present (it is the consumer's `v-model` value); `
|
|
5
|
+
* `value` is always present (it is the consumer's `v-model` value); `label` and
|
|
6
6
|
* `original` are filled in only once the owning group has loaded/stashed the
|
|
7
7
|
* matching item — reading the context never triggers a fetch, so a search-first
|
|
8
8
|
* group the user never opened yields `{ value }` alone until it loads. Pass
|
|
9
9
|
* `prefill: true` on such a group to resolve a seeded selection eagerly.
|
|
10
10
|
*/
|
|
11
11
|
export type BbDropdownContextOption = {
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/** The row's label, once the group has the item. */
|
|
13
|
+
label?: string;
|
|
14
14
|
/**
|
|
15
15
|
* Resolved description (the group's `itemProps.description`, or a literal item's
|
|
16
16
|
* `description`), once the group has the item. Absent when it has none.
|
|
@@ -25,7 +25,7 @@ export type BbDropdownContextOption = {
|
|
|
25
25
|
* Live, read-only state of one selectable group — **the group config you
|
|
26
26
|
* declared, plus the dropdown's live state on top.**
|
|
27
27
|
*
|
|
28
|
-
* Every field you passed in `items` is carried through as-is (`
|
|
28
|
+
* Every field you passed in `items` is carried through as-is (`id`, `label`,
|
|
29
29
|
* `hideLabel`, `filterBy`, `max`, `prepend:icon`, `variant`, …), so a filter
|
|
30
30
|
* chip can be rendered from one declaration instead of re-deriving it. The
|
|
31
31
|
* group config is a closed shape — unknown keys are a type error on the way in,
|
|
@@ -38,10 +38,10 @@ export type BbDropdownContextOption = {
|
|
|
38
38
|
*
|
|
39
39
|
* The live fields below always win over anything of the same name in the config.
|
|
40
40
|
*/
|
|
41
|
-
export type BbDropdownContextGroup = Omit<InternalGroup, 'items' | 'multiple' | 'selectable'> & {
|
|
41
|
+
export type BbDropdownContextGroup = Omit<InternalGroup, 'items' | 'multiple' | 'selectable' | 'value' | 'key'> & {
|
|
42
42
|
/** The group's `v-model` value — a single value (or `null`), an array when `multiple`. */
|
|
43
43
|
value: unknown;
|
|
44
|
-
/** Selected options with `value` always, `
|
|
44
|
+
/** Selected options with `value` always, `label`/`original` resolved lazily. */
|
|
45
45
|
selectedOptions: BbDropdownContextOption[];
|
|
46
46
|
/** Whether the group is multi-select (resolved, never `undefined`). */
|
|
47
47
|
multiple: boolean;
|
|
@@ -61,7 +61,7 @@ export type BbDropdownContextHandle = {
|
|
|
61
61
|
isReady: ComputedRef<boolean>;
|
|
62
62
|
/** Whether the dropdown panel/sheet is open. */
|
|
63
63
|
open: ComputedRef<boolean>;
|
|
64
|
-
/** Live per-group state, keyed by group
|
|
64
|
+
/** Live per-group state, keyed by group `id`. `{}` until the dropdown mounts. */
|
|
65
65
|
groups: ComputedRef<Record<string, BbDropdownContextGroup>>;
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
@@ -72,7 +72,7 @@ export type BbDropdownContextHandle = {
|
|
|
72
72
|
*
|
|
73
73
|
* The point is chips/filter summaries **without a twin fetch**: the dropdown
|
|
74
74
|
* already resolved a selection's label when the user picked it (kept via
|
|
75
|
-
* `stash`), so `groups[
|
|
75
|
+
* `stash`), so `groups[id].selectedOptions` hands you `{ value, label, original }`
|
|
76
76
|
* for free. It is read-only — to change a selection, mutate that group's own
|
|
77
77
|
* `v-model` (which you own). It is also **lazy**: reading it never triggers a
|
|
78
78
|
* fetch, so a seeded selection whose group was never opened stays label-less
|
|
@@ -16,6 +16,8 @@ export type BbFormFieldSpec = BbFormFieldOptions & {
|
|
|
16
16
|
/** A `required` rule or the form's schema makes it mandatory (Q56.8). */
|
|
17
17
|
required?: boolean;
|
|
18
18
|
bound: boolean;
|
|
19
|
+
/** Q60.17: the form is saving (its submit lock is on). */
|
|
20
|
+
locked?: boolean;
|
|
19
21
|
setValue?: (value: unknown) => void;
|
|
20
22
|
validate?: () => Promise<boolean>;
|
|
21
23
|
};
|
|
@@ -37,6 +39,13 @@ export type BbFormFieldHandle<T> = {
|
|
|
37
39
|
errorAttrs: {
|
|
38
40
|
id: string;
|
|
39
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* The form is saving (Q60.17): a `@submit` promise is pending and the
|
|
44
|
+
* form locks while it runs. Treat the control as read-only: keep it
|
|
45
|
+
* focusable and its value visible, refuse changes. `controlAttrs`
|
|
46
|
+
* carries `aria-readonly` meanwhile, and writes to `value` are ignored.
|
|
47
|
+
*/
|
|
48
|
+
readonly: ComputedRef<boolean>;
|
|
40
49
|
};
|
|
41
50
|
/**
|
|
42
51
|
* The custom fields described for a form. For BbForm; call in its setup.
|
|
@@ -32,12 +32,12 @@ function p(t, r) {
|
|
|
32
32
|
e.delete(s), e.size || c.fields.delete(t), d(c, t);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
let l = n(() => s.errors);
|
|
35
|
+
let l = n(() => s.errors), f = n(() => !!s.locked);
|
|
36
36
|
return {
|
|
37
37
|
value: n({
|
|
38
38
|
get: () => s.value,
|
|
39
39
|
set: (e) => {
|
|
40
|
-
s.setValue ? s.setValue(e) : s.value = e;
|
|
40
|
+
f.value || (s.setValue ? s.setValue(e) : s.value = e);
|
|
41
41
|
}
|
|
42
42
|
}),
|
|
43
43
|
errors: l,
|
|
@@ -46,9 +46,11 @@ function p(t, r) {
|
|
|
46
46
|
"aria-invalid": l.value.length ? "true" : void 0,
|
|
47
47
|
"aria-required": s.required ? "true" : void 0,
|
|
48
48
|
"aria-describedby": l.value.length ? s.errorId : void 0,
|
|
49
|
+
"aria-readonly": f.value ? "true" : void 0,
|
|
49
50
|
"data-bb-field": r.name
|
|
50
51
|
})),
|
|
51
|
-
errorAttrs: { id: s.errorId }
|
|
52
|
+
errorAttrs: { id: s.errorId },
|
|
53
|
+
readonly: f
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
//#endregion
|
|
@@ -11,14 +11,14 @@ type ResolvedTabsProps<K extends string = string> = BbTabsRootProps<K> & {
|
|
|
11
11
|
export type TabsMappedItem<K extends string = string> = {
|
|
12
12
|
/** The source descriptor from `items` — what a per-item `pt:item` function receives. */
|
|
13
13
|
item: BbTabsItem<K>;
|
|
14
|
-
|
|
14
|
+
value: K;
|
|
15
15
|
label?: string;
|
|
16
16
|
eager?: boolean;
|
|
17
17
|
tabId: string;
|
|
18
18
|
panelId: string;
|
|
19
|
-
/** Per-tab label slot name, normalized: `` `${slotKey(
|
|
19
|
+
/** Per-tab label slot name, normalized: `` `${slotKey(value)}:label` ``. */
|
|
20
20
|
labelSlotName: string;
|
|
21
|
-
/** Per-tab panel slot name, normalized: `slotKey(
|
|
21
|
+
/** Per-tab panel slot name, normalized: `slotKey(value)`. */
|
|
22
22
|
panelSlotName: string;
|
|
23
23
|
active: boolean;
|
|
24
24
|
ariaSelected: boolean;
|
|
@@ -37,7 +37,7 @@ export type TabsMappedItem<K extends string = string> = {
|
|
|
37
37
|
export type BbTabsContext<K extends string = string> = {
|
|
38
38
|
/** Public id of the host component (`id` prop or generated). */
|
|
39
39
|
id: string;
|
|
40
|
-
/** Prefix used for tab/panel DOM ids (`{instanceid}_tab_{slotKey(
|
|
40
|
+
/** Prefix used for tab/panel DOM ids (`{instanceid}_tab_{slotKey(value)}`). */
|
|
41
41
|
instanceid: string;
|
|
42
42
|
items: ComputedRef<Array<BbTabsItem<K>>>;
|
|
43
43
|
disabled: ComputedRef<boolean>;
|
|
@@ -49,15 +49,15 @@ export type BbTabsContext<K extends string = string> = {
|
|
|
49
49
|
direction: ComputedRef<'horizontal' | 'vertical'>;
|
|
50
50
|
/** The strip's look — `BbTabsList` reads it unless given its own `variant`. */
|
|
51
51
|
variant: ComputedRef<TabsVariantType>;
|
|
52
|
-
currentTab: Ref<BbTabsItem<K>['
|
|
52
|
+
currentTab: Ref<BbTabsItem<K>['value'] | null>;
|
|
53
53
|
currentTabIndex: ComputedRef<number>;
|
|
54
54
|
isFirst: ComputedRef<boolean>;
|
|
55
55
|
isLast: ComputedRef<boolean>;
|
|
56
56
|
mappedItems: ComputedRef<Array<TabsMappedItem<K>>>;
|
|
57
57
|
/** Direction of the panel slide transition, derived from the index delta. */
|
|
58
58
|
animationDirection: Ref<'left' | 'right'>;
|
|
59
|
-
/** Selects a tab by
|
|
60
|
-
select: (key: BbTabsItem<K>['
|
|
59
|
+
/** Selects a tab by its `value`, handling v-model and URL/Inertia navigation. */
|
|
60
|
+
select: (key: BbTabsItem<K>['value']) => void;
|
|
61
61
|
goTo: (target: 'first' | 'previous' | 'next' | 'last') => void;
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
@@ -83,7 +83,7 @@ export type BbTabsContextHandle<K extends string = string> = {
|
|
|
83
83
|
isReady: ComputedRef<boolean>;
|
|
84
84
|
/**
|
|
85
85
|
* The key of the currently active tab (`null` until the tabs mount).
|
|
86
|
-
* Writable: assigning a
|
|
86
|
+
* Writable: assigning a value selects it, exactly like `select(value)` —
|
|
87
87
|
* bindable (e.g. `v-model`-style) from anywhere on the client.
|
|
88
88
|
*
|
|
89
89
|
* Reads as `K | null`, but only `K` may be *assigned*: a tab is always
|
|
@@ -99,8 +99,8 @@ export type BbTabsContextHandle<K extends string = string> = {
|
|
|
99
99
|
isLast: ComputedRef<boolean>;
|
|
100
100
|
/** Navigate to `'first'`, `'previous'`, `'next'`, or `'last'` tab. */
|
|
101
101
|
goTo: (target: 'first' | 'previous' | 'next' | 'last') => void;
|
|
102
|
-
/** Select a tab by
|
|
103
|
-
select: (
|
|
102
|
+
/** Select a tab by its `value`, with the usual v-model/URL/Inertia handling. */
|
|
103
|
+
select: (value: K) => void;
|
|
104
104
|
};
|
|
105
105
|
/**
|
|
106
106
|
* Companion composable for `BbTabs`/`BbTabsRoot`: pass the same `id` you gave
|
|
@@ -11,19 +11,19 @@ import { useQuery as l } from "./useQuery.js";
|
|
|
11
11
|
import { computed as u, getCurrentInstance as d, inject as f, onScopeDispose as p, provide as m, ref as h, shallowReactive as g, watch as _ } from "vue";
|
|
12
12
|
//#region src/composables/useBbTabsContext.ts
|
|
13
13
|
var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) => {
|
|
14
|
-
let b = s(), x = c(), { error: S, warn: C } = e(), { isInertia: w } = a(), T = d(), E = r().id.value, D = f.id ?? E, O = `bb-tabs_${D}`, k = h(null), A = u(() => f.items.findIndex((e) => e.
|
|
14
|
+
let b = s(), x = c(), { error: S, warn: C } = e(), { isInertia: w } = a(), T = d(), E = r().id.value, D = f.id ?? E, O = `bb-tabs_${D}`, k = h(null), A = u(() => f.items.findIndex((e) => e.value === k.value)), j = u(() => A.value === 0), M = u(() => A.value === f.items.length - 1);
|
|
15
15
|
f.items.forEach((e) => {
|
|
16
|
-
e.
|
|
16
|
+
e.value ? (f.server || e.server) && !f.navigation && S(`A tab item has a server property but the navigation prop is false: ${JSON.stringify(e, null, 2)}`) : S(`A tab item has no value: ${JSON.stringify(e, null, 2)}`);
|
|
17
17
|
});
|
|
18
18
|
let N = l(), P = u(() => [N.value[f.queryKey]].flat()[0]), F = (e) => String(e).split(/\W+/g).join("_").toLowerCase(), I = (e) => {
|
|
19
|
-
let t = f.items.find((t) => i(t.
|
|
19
|
+
let t = f.items.find((t) => i(t.value) === e);
|
|
20
20
|
if (t) return {
|
|
21
|
-
key: t.
|
|
21
|
+
key: t.value,
|
|
22
22
|
legacy: !1
|
|
23
23
|
};
|
|
24
|
-
let n = f.items.find((t) => F(t.
|
|
24
|
+
let n = f.items.find((t) => F(t.value) === e);
|
|
25
25
|
return n ? {
|
|
26
|
-
key: n.
|
|
26
|
+
key: n.value,
|
|
27
27
|
legacy: !0
|
|
28
28
|
} : null;
|
|
29
29
|
}, L = () => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(f.queryKey), R = (e) => {
|
|
@@ -49,7 +49,7 @@ var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) =>
|
|
|
49
49
|
else if (f.modelValue) k.value = f.modelValue;
|
|
50
50
|
else if (f.items[0]) {
|
|
51
51
|
let e = f.items.find((e) => !e.disabled);
|
|
52
|
-
e && (k.value = e.
|
|
52
|
+
e && (k.value = e.value);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
z();
|
|
@@ -69,12 +69,12 @@ var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) =>
|
|
|
69
69
|
}), V = (e) => {
|
|
70
70
|
f.modelValue !== e && g("update:modelValue", e), k.value = e;
|
|
71
71
|
}, H = (e, n = f.replace) => {
|
|
72
|
-
let r = f.items.find((t) => t.
|
|
72
|
+
let r = f.items.find((t) => t.value === e);
|
|
73
73
|
if (t(r)) {
|
|
74
|
-
C(`Cannot select tab "${e}" on tabs "${D}": no item with this key. Available keys: ${f.items.map((e) => e.
|
|
74
|
+
C(`Cannot select tab "${e}" on tabs "${D}": no item with this key. Available keys: ${f.items.map((e) => e.value).join(", ")}. Selection unchanged.`);
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
if (r.
|
|
77
|
+
if (r.value === k.value) return;
|
|
78
78
|
let a = i(e);
|
|
79
79
|
if (f.navigation && b.value && x && P.value !== a) {
|
|
80
80
|
let e = n ? "replace" : "push", t = {
|
|
@@ -127,7 +127,7 @@ var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) =>
|
|
|
127
127
|
let r = f.items[n];
|
|
128
128
|
return !r || r.disabled ? null : n;
|
|
129
129
|
}, G = (e) => {
|
|
130
|
-
document.getElementById(`${O}_tab_${i(f.items[e].
|
|
130
|
+
document.getElementById(`${O}_tab_${i(f.items[e].value)}`)?.focus();
|
|
131
131
|
}, K = (e) => {
|
|
132
132
|
if (![
|
|
133
133
|
"first",
|
|
@@ -140,14 +140,14 @@ var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) =>
|
|
|
140
140
|
}
|
|
141
141
|
if (!f.items.length) return;
|
|
142
142
|
let t = W(e, A.value);
|
|
143
|
-
t !== null && (G(t), H(f.items[t].
|
|
143
|
+
t !== null && (G(t), H(f.items[t].value));
|
|
144
144
|
}, q = u(() => f.manualActivation ?? (!!f.server || f.items.some((e) => !!e.server))), J = (e, t) => {
|
|
145
145
|
if (!q.value) {
|
|
146
146
|
K(e);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
if (!f.items.length) return;
|
|
150
|
-
let n = t.currentTarget?.id, r = f.items.findIndex((e) => `${O}_tab_${i(e.
|
|
150
|
+
let n = t.currentTarget?.id, r = f.items.findIndex((e) => `${O}_tab_${i(e.value)}` === n), a = r === -1 ? A.value : r, o = W(e, a);
|
|
151
151
|
o !== null && G(o);
|
|
152
152
|
}, Y = (e) => {
|
|
153
153
|
if (f.disabled) return;
|
|
@@ -156,10 +156,10 @@ var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) =>
|
|
|
156
156
|
}, X = u(() => {
|
|
157
157
|
let e = k.value, t = A.value;
|
|
158
158
|
return f.items.map((n) => {
|
|
159
|
-
let {
|
|
159
|
+
let { value: r, label: a, eager: o } = n, s = r === e, c = !!(n.disabled || f.disabled);
|
|
160
160
|
return {
|
|
161
161
|
item: n,
|
|
162
|
-
|
|
162
|
+
value: r,
|
|
163
163
|
label: a,
|
|
164
164
|
eager: o,
|
|
165
165
|
tabId: `${O}_tab_${i(r)}`,
|
|
@@ -177,7 +177,7 @@ var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) =>
|
|
|
177
177
|
isFirst: j.value,
|
|
178
178
|
isLast: M.value,
|
|
179
179
|
selected: s,
|
|
180
|
-
|
|
180
|
+
label: a,
|
|
181
181
|
value: r,
|
|
182
182
|
goTo: K
|
|
183
183
|
},
|
|
@@ -204,11 +204,11 @@ var v = Symbol("BbTabsContext"), y = g(/* @__PURE__ */ new Map()), b = (f, g) =>
|
|
|
204
204
|
let Q = h("right");
|
|
205
205
|
_(k, (e, t) => {
|
|
206
206
|
if (e && t) {
|
|
207
|
-
let n = f.items.findIndex((t) => t.
|
|
207
|
+
let n = f.items.findIndex((t) => t.value === e), r = f.items.findIndex((e) => e.value === t);
|
|
208
208
|
Q.value = n > r ? "right" : "left";
|
|
209
209
|
}
|
|
210
210
|
}, { flush: "sync" }), _(() => n(f.items), () => {
|
|
211
|
-
k.value && !f.items.find((e) => e.
|
|
211
|
+
k.value && !f.items.find((e) => e.value === k.value) && (z(), U());
|
|
212
212
|
}, {
|
|
213
213
|
immediate: !0,
|
|
214
214
|
deep: !0
|
|
@@ -77,6 +77,12 @@ export type FieldBinding<T> = {
|
|
|
77
77
|
leave: () => void;
|
|
78
78
|
/** A checkbox / switch click: the value is committed at once. */
|
|
79
79
|
commit: (next: T) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Q60.17 — the enclosing BbForm is saving (a `@submit` promise is
|
|
82
|
+
* pending, and the form did not opt out with `disable-submit-lock`): the
|
|
83
|
+
* control acts read-only until it settles.
|
|
84
|
+
*/
|
|
85
|
+
locked: ComputedRef<boolean>;
|
|
80
86
|
};
|
|
81
87
|
type AnyEmit = (event: any, ...args: any[]) => void;
|
|
82
88
|
export type FormConnection = {
|
|
@@ -103,6 +109,11 @@ export type BoundField<P extends Record<string, any>, E> = {
|
|
|
103
109
|
required: ComputedRef<boolean | undefined>;
|
|
104
110
|
/** Bind as `aria-required` where the control's role supports it. */
|
|
105
111
|
ariaRequired: ComputedRef<true | undefined>;
|
|
112
|
+
/**
|
|
113
|
+
* Q60.17 — the `readonly` prop, or the enclosing form saving: the
|
|
114
|
+
* template binds this, the script reads `props.readonly` (bound too).
|
|
115
|
+
*/
|
|
116
|
+
readonly: ComputedRef<boolean>;
|
|
106
117
|
};
|
|
107
118
|
/**
|
|
108
119
|
* The binding a form control runs on: the enclosing `BbForm`'s (it joins the
|
|
@@ -19,25 +19,27 @@ var s = Symbol.for("bitboss-ui:form-connection"), c = (i, s, c) => {
|
|
|
19
19
|
showAsterisk: n(() => !!l.requiredAsterisk && !!i.required),
|
|
20
20
|
setModelValue: p,
|
|
21
21
|
leave: () => {},
|
|
22
|
-
commit: p
|
|
22
|
+
commit: p,
|
|
23
|
+
locked: n(() => !1)
|
|
23
24
|
};
|
|
24
|
-
}, l = (e, t,
|
|
25
|
-
let
|
|
25
|
+
}, l = (e, t, r) => {
|
|
26
|
+
let a = i(s, null), o = a && !e.formless ? a.bind(e, t, r) : c(e, t, r), l = n(() => !!e.readonly || o.locked.value);
|
|
26
27
|
return {
|
|
27
|
-
props: new Proxy(e, { get: (e, t) => t === "modelValue" ?
|
|
28
|
-
emit: ((e, ...
|
|
28
|
+
props: new Proxy(e, { get: (e, t) => t === "modelValue" ? o.model.value : t === "errors" ? o.errors.value : t === "required" && "required" in e ? o.required.value : t === "readonly" ? l.value : Reflect.get(e, t) }),
|
|
29
|
+
emit: ((e, ...n) => {
|
|
29
30
|
if (e === "update:modelValue") {
|
|
30
|
-
let e =
|
|
31
|
-
|
|
31
|
+
let e = n[0];
|
|
32
|
+
r.commits ? o.commit(e) : o.setModelValue(e);
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
|
-
e ===
|
|
35
|
+
e === r.leaveOn && o.leave(), t(e, ...n);
|
|
35
36
|
}),
|
|
36
|
-
showAsterisk:
|
|
37
|
-
model:
|
|
38
|
-
errors:
|
|
39
|
-
required:
|
|
40
|
-
ariaRequired:
|
|
37
|
+
showAsterisk: o.showAsterisk,
|
|
38
|
+
model: o.model,
|
|
39
|
+
errors: o.errors,
|
|
40
|
+
required: o.required,
|
|
41
|
+
ariaRequired: o.ariaRequired,
|
|
42
|
+
readonly: l
|
|
41
43
|
};
|
|
42
44
|
};
|
|
43
45
|
//#endregion
|
|
@@ -2,7 +2,11 @@ type NestedKeyOf<ObjectType extends object> = {
|
|
|
2
2
|
[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object ? `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key]>}` : `${Key}`;
|
|
3
3
|
}[keyof ObjectType & (string | number)];
|
|
4
4
|
export type Path<T> = T extends object ? NestedKeyOf<T> | ((item: T) => string | number) | undefined | (string & Record<never, never>) : undefined;
|
|
5
|
+
/** A non-null object item that has `key` as an OWN property (never `in`). */
|
|
6
|
+
export declare const hasOwnItemKey: (item: unknown, key: string) => item is Record<string, unknown>;
|
|
7
|
+
declare function getItemText<T>(item: T, getter?: Path<T>): string;
|
|
5
8
|
export declare const useItemText: () => {
|
|
6
|
-
getItemText
|
|
9
|
+
getItemText: typeof getItemText;
|
|
10
|
+
getOptionText: <T>(item: T, getter?: Path<T>) => string;
|
|
7
11
|
};
|
|
8
12
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { get as e } from "../utilities/functions/get.js";
|
|
2
2
|
//#region src/composables/useItemText.ts
|
|
3
|
-
var t = (e) => JSON.stringify(e) ?? "", n = () =>
|
|
3
|
+
var t = (e) => JSON.stringify(e) ?? "", n = (e, t) => typeof e == "object" && !!e && Object.hasOwn(e, t);
|
|
4
|
+
function r(n, r) {
|
|
4
5
|
if (typeof n == "string") return n;
|
|
5
6
|
if (r) {
|
|
6
7
|
if (typeof r == "function") {
|
|
@@ -12,6 +13,10 @@ var t = (e) => JSON.stringify(e) ?? "", n = () => ({ getItemText(n, r) {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
return t(n);
|
|
15
|
-
}
|
|
16
|
+
}
|
|
17
|
+
var i = (e, t) => t === void 0 ? n(e, "label") ? r(e, "label") : n(e, "text") ? r(e, "text") : r(e) : r(e, t), a = () => ({
|
|
18
|
+
getItemText: r,
|
|
19
|
+
getOptionText: i
|
|
20
|
+
});
|
|
16
21
|
//#endregion
|
|
17
|
-
export { n as useItemText };
|
|
22
|
+
export { n as hasOwnItemKey, a as useItemText };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
type ValueGetter<T> = string | ((item: T) => unknown);
|
|
2
|
+
declare function getItemValue<T>(item: T, getter?: ValueGetter<T>): any;
|
|
1
3
|
export declare const useItemValue: () => {
|
|
2
|
-
getItemValue
|
|
4
|
+
getItemValue: typeof getItemValue;
|
|
5
|
+
getOptionValue: <T>(item: T, getter?: ValueGetter<T>) => any;
|
|
3
6
|
};
|
|
7
|
+
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { get as e } from "../utilities/functions/get.js";
|
|
2
|
+
import { hasOwnItemKey as t } from "./useItemText.js";
|
|
2
3
|
//#region src/composables/useItemValue.ts
|
|
3
|
-
|
|
4
|
+
function n(t, n) {
|
|
4
5
|
if (n === void 0) return t;
|
|
5
6
|
if (typeof n == "function") return n(t);
|
|
6
7
|
if (typeof n == "string") return e(t, n);
|
|
7
|
-
}
|
|
8
|
+
}
|
|
9
|
+
var r = (e, r) => r === void 0 && t(e, "value") ? e.value : n(e, r), i = () => ({
|
|
10
|
+
getItemValue: n,
|
|
11
|
+
getOptionValue: r
|
|
12
|
+
});
|
|
8
13
|
//#endregion
|
|
9
|
-
export {
|
|
14
|
+
export { i as useItemValue };
|