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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// inertia-helpers/useProp.ts
|
|
2
|
+
import { usePage } from '@inertiajs/vue3';
|
|
3
|
+
import { computed, nextTick, ref, type ComputedRef } from 'vue';
|
|
4
|
+
|
|
5
|
+
const walk = <T>(
|
|
6
|
+
source: unknown,
|
|
7
|
+
path: string[]
|
|
8
|
+
): { found: boolean; value: T | undefined } => {
|
|
9
|
+
let current: unknown = source;
|
|
10
|
+
for (const segment of path) {
|
|
11
|
+
if (
|
|
12
|
+
current === null ||
|
|
13
|
+
typeof current !== 'object' ||
|
|
14
|
+
!(segment in current)
|
|
15
|
+
) {
|
|
16
|
+
return { found: false, value: undefined };
|
|
17
|
+
}
|
|
18
|
+
current = (current as Record<string, unknown>)[segment];
|
|
19
|
+
}
|
|
20
|
+
return { found: true, value: current as T };
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const toPath = (propPath: string | string[]): string[] =>
|
|
24
|
+
typeof propPath === 'string' ? propPath.split('.') : propPath;
|
|
25
|
+
|
|
26
|
+
/** Reactive page prop by path. Throws when the path is not present. */
|
|
27
|
+
export const useProp = <T>(propPath: string | string[]): ComputedRef<T> => {
|
|
28
|
+
const page = usePage();
|
|
29
|
+
const path = toPath(propPath);
|
|
30
|
+
// The last value read, and the page (component + url) it was read on.
|
|
31
|
+
let last: { value: T; page: string } | null = null;
|
|
32
|
+
// Bumped once the navigation's update has flushed: ends the grace read.
|
|
33
|
+
const graceOver = ref(0);
|
|
34
|
+
|
|
35
|
+
return computed(() => {
|
|
36
|
+
void graceOver.value;
|
|
37
|
+
const { found, value } = walk<T>(page.props, path);
|
|
38
|
+
const visit = `${page.component} ${page.url}`;
|
|
39
|
+
if (found) {
|
|
40
|
+
last = { value: value as T, page: visit };
|
|
41
|
+
return value as T;
|
|
42
|
+
}
|
|
43
|
+
if (last && last.page !== visit) {
|
|
44
|
+
// The page just changed under a reader that is unmounting: hand it
|
|
45
|
+
// the last value for this flush only, then fail loudly again.
|
|
46
|
+
const stale = last.value;
|
|
47
|
+
last = null;
|
|
48
|
+
void nextTick(() => graceOver.value++);
|
|
49
|
+
return stale;
|
|
50
|
+
}
|
|
51
|
+
throw new Error(`Page prop "${path.join('.')}" is missing.`);
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Like useProp, but resolves to `undefined` when the path is missing. */
|
|
56
|
+
export const useOptionalProp = <T>(
|
|
57
|
+
propPath: string | string[]
|
|
58
|
+
): ComputedRef<T | undefined> => {
|
|
59
|
+
const page = usePage();
|
|
60
|
+
const path = toPath(propPath);
|
|
61
|
+
|
|
62
|
+
return computed(() => walk<T>(page.props, path).value);
|
|
63
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// inertia-helpers/useQuery.ts
|
|
2
|
+
// requires: npm i query-string
|
|
3
|
+
import { usePage } from '@inertiajs/vue3';
|
|
4
|
+
import qs, { type StringifyOptions } from 'query-string';
|
|
5
|
+
|
|
6
|
+
export const useQuery = ({
|
|
7
|
+
arrayFormat = 'comma',
|
|
8
|
+
}: { arrayFormat?: StringifyOptions['arrayFormat'] } = {}): Record<
|
|
9
|
+
string,
|
|
10
|
+
unknown
|
|
11
|
+
> => {
|
|
12
|
+
const { url } = usePage();
|
|
13
|
+
const [, queryString] = url.split('?');
|
|
14
|
+
if (!queryString) return {};
|
|
15
|
+
return qs.parse(decodeURIComponent(queryString), {
|
|
16
|
+
arrayFormat,
|
|
17
|
+
decode: true,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// inertia-helpers/useQueryObject.ts
|
|
2
|
+
// requires: npm i query-string
|
|
3
|
+
import { useQuery } from './useQuery';
|
|
4
|
+
import { isEmpty, isNil } from './utils';
|
|
5
|
+
import { router, usePage } from '@inertiajs/vue3';
|
|
6
|
+
import qs, { type StringifyOptions } from 'query-string';
|
|
7
|
+
import { toValue, watch, type MaybeRefOrGetter } from 'vue';
|
|
8
|
+
|
|
9
|
+
type Options<T> = {
|
|
10
|
+
transform?: (value: Partial<T>) => Partial<T>;
|
|
11
|
+
/** Reset the `page` parameter on change. Default true. */
|
|
12
|
+
resetPage?: boolean;
|
|
13
|
+
/** Additional query keys removed whenever the object changes. */
|
|
14
|
+
resetKeys?: string[];
|
|
15
|
+
/** Inertia partial reload prop names (supports reactive getter). */
|
|
16
|
+
only?: MaybeRefOrGetter<string[]>;
|
|
17
|
+
/**
|
|
18
|
+
* When it resolves to `false` the watcher keeps tracking keys but skips
|
|
19
|
+
* the navigation — use it when another owner performs the visit during a
|
|
20
|
+
* programmatic transition, to avoid competing self-cancelling requests.
|
|
21
|
+
*/
|
|
22
|
+
shouldNavigate?: MaybeRefOrGetter<boolean>;
|
|
23
|
+
arrayFormat?: StringifyOptions['arrayFormat'];
|
|
24
|
+
preserveState?: boolean;
|
|
25
|
+
preserveScroll?: boolean;
|
|
26
|
+
replace?: boolean;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function useQueryObject<T extends Record<string, unknown>>(
|
|
30
|
+
object: MaybeRefOrGetter<T>,
|
|
31
|
+
options: Options<T> = {}
|
|
32
|
+
): void {
|
|
33
|
+
const {
|
|
34
|
+
transform,
|
|
35
|
+
resetPage = true,
|
|
36
|
+
resetKeys = [],
|
|
37
|
+
preserveState = true,
|
|
38
|
+
preserveScroll = true,
|
|
39
|
+
replace = true,
|
|
40
|
+
only: onlyOption = [],
|
|
41
|
+
shouldNavigate = true,
|
|
42
|
+
arrayFormat = 'comma',
|
|
43
|
+
} = options;
|
|
44
|
+
|
|
45
|
+
const filterValidValues = (obj: T): Partial<T> => {
|
|
46
|
+
const filtered: Partial<T> = {};
|
|
47
|
+
Object.entries(obj).forEach(([key, val]) => {
|
|
48
|
+
if (!isNil(val) && val !== '') {
|
|
49
|
+
(filtered as Record<string, unknown>)[key] = val;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return filtered;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Every key this composable has ever managed, for stable URL cleanup. */
|
|
56
|
+
const seenKeys = new Set<string>(Object.keys(toValue(object) ?? {}));
|
|
57
|
+
|
|
58
|
+
watch(
|
|
59
|
+
() => toValue(object),
|
|
60
|
+
(newObject) => {
|
|
61
|
+
if (!newObject) return;
|
|
62
|
+
|
|
63
|
+
Object.keys(newObject).forEach((key) => {
|
|
64
|
+
if (!seenKeys.has(key)) {
|
|
65
|
+
console.warn(
|
|
66
|
+
`[useQueryObject] Key "${key}" appeared after initialization. ` +
|
|
67
|
+
`Initialize the object with all possible keys for stable URL cleanup.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
seenKeys.add(key);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const validValues = filterValidValues(newObject);
|
|
74
|
+
const transformedValues = transform
|
|
75
|
+
? transform(validValues)
|
|
76
|
+
: validValues;
|
|
77
|
+
|
|
78
|
+
// Start from the existing query to preserve keys owned elsewhere.
|
|
79
|
+
const existingQuery = useQuery({ arrayFormat });
|
|
80
|
+
seenKeys.forEach((key) => delete existingQuery[key]);
|
|
81
|
+
if (resetPage) delete existingQuery.page;
|
|
82
|
+
resetKeys.forEach((key) => delete existingQuery[key]);
|
|
83
|
+
|
|
84
|
+
Object.entries(transformedValues).forEach(([key, val]) => {
|
|
85
|
+
if (!isEmpty(val)) existingQuery[key] = val;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const stringified = qs.stringify(existingQuery, { arrayFormat });
|
|
89
|
+
const newUrl = stringified
|
|
90
|
+
? [window.location.pathname, stringified].join('?')
|
|
91
|
+
: window.location.pathname;
|
|
92
|
+
|
|
93
|
+
if (newUrl === usePage().url) return;
|
|
94
|
+
if (!toValue(shouldNavigate)) return;
|
|
95
|
+
|
|
96
|
+
router.visit(newUrl, {
|
|
97
|
+
preserveState,
|
|
98
|
+
preserveScroll,
|
|
99
|
+
only: toValue(onlyOption),
|
|
100
|
+
replace,
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
/*
|
|
104
|
+
* Default flush, deliberately NOT `sync`. Vue batches a tick's mutations
|
|
105
|
+
* into one watcher run, so a `clearFilters()` that blanks three keys
|
|
106
|
+
* fires ONE visit instead of three (measured: 3 writes → 3 runs under
|
|
107
|
+
* `sync`, 1 under the default). The two it saves used to self-cancel,
|
|
108
|
+
* but they were still sent.
|
|
109
|
+
*
|
|
110
|
+
* This does NOT make typing cheap — one visit per settled keystroke is
|
|
111
|
+
* still one visit per keystroke. Debounce the source for that; see the
|
|
112
|
+
* note below.
|
|
113
|
+
*/
|
|
114
|
+
{ deep: true }
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// inertia-helpers/useResourceContext.ts
|
|
2
|
+
import { useLoading } from './useLoading';
|
|
3
|
+
import { noop } from './utils';
|
|
4
|
+
import { ref, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue';
|
|
5
|
+
|
|
6
|
+
type UseResourceContextOptions<T, ID> = {
|
|
7
|
+
immediate?: boolean;
|
|
8
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
9
|
+
onReset?: () => void | Promise<void>;
|
|
10
|
+
onSuccess?: (data: T, resourceId: ID) => void | Promise<void>;
|
|
11
|
+
onError?: (error: unknown, resourceId: ID) => void | Promise<void>;
|
|
12
|
+
onFinish?: (resourceId: ID) => void | Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function useResourceContext<T, ID = string>(
|
|
16
|
+
id: MaybeRefOrGetter<ID | null | undefined>,
|
|
17
|
+
fn: (id: ID) => Promise<T>,
|
|
18
|
+
options: UseResourceContextOptions<T, ID> = {}
|
|
19
|
+
) {
|
|
20
|
+
const data = ref<T | null>(null) as Ref<T | null>;
|
|
21
|
+
const {
|
|
22
|
+
immediate = true,
|
|
23
|
+
disabled = false,
|
|
24
|
+
onSuccess = noop,
|
|
25
|
+
onError = (error: unknown) => {
|
|
26
|
+
console.error('Failed to fetch resource:', error);
|
|
27
|
+
},
|
|
28
|
+
onReset = noop,
|
|
29
|
+
onFinish = noop,
|
|
30
|
+
} = options;
|
|
31
|
+
|
|
32
|
+
const { loading, fn: fetch } = useLoading((resourceId: ID) => fn(resourceId));
|
|
33
|
+
|
|
34
|
+
const load = async (resourceId: ID) => {
|
|
35
|
+
try {
|
|
36
|
+
const result = await fetch(resourceId);
|
|
37
|
+
data.value = result;
|
|
38
|
+
await onSuccess(result, resourceId);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
data.value = null;
|
|
41
|
+
await onError(error, resourceId);
|
|
42
|
+
} finally {
|
|
43
|
+
await onFinish(resourceId);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
watch(
|
|
48
|
+
() => ({ resourceId: toValue(id), isDisabled: toValue(disabled) }),
|
|
49
|
+
async ({ resourceId, isDisabled }) => {
|
|
50
|
+
if (!resourceId) {
|
|
51
|
+
data.value = null;
|
|
52
|
+
await onReset();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
// Keep already-loaded data while disabled.
|
|
56
|
+
if (isDisabled) return;
|
|
57
|
+
await load(resourceId as ID);
|
|
58
|
+
},
|
|
59
|
+
{ immediate }
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const refresh = async () => {
|
|
63
|
+
const currentId = toValue(id);
|
|
64
|
+
if (toValue(disabled) || !currentId) return;
|
|
65
|
+
await load(currentId as ID);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return { data, loading, refresh };
|
|
69
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// inertia-helpers/useRouteQuery.ts
|
|
2
|
+
// requires: npm i query-string
|
|
3
|
+
import { router, usePage } from '@inertiajs/vue3';
|
|
4
|
+
import qs from 'query-string';
|
|
5
|
+
import { computed, type WritableComputedRef } from 'vue';
|
|
6
|
+
|
|
7
|
+
type Options<T> = {
|
|
8
|
+
/** Parse the raw string (e.g. `Number`). Defaults to identity. */
|
|
9
|
+
transform?: (value: string) => T;
|
|
10
|
+
preserveScroll?: boolean;
|
|
11
|
+
preserveState?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function useRouteQuery<T = string>(
|
|
15
|
+
key: string,
|
|
16
|
+
defaultValue: string,
|
|
17
|
+
options: Options<T> = {}
|
|
18
|
+
): WritableComputedRef<T> {
|
|
19
|
+
const {
|
|
20
|
+
transform = (value) => value as unknown as T,
|
|
21
|
+
preserveScroll = true,
|
|
22
|
+
preserveState = true,
|
|
23
|
+
} = options;
|
|
24
|
+
const page = usePage();
|
|
25
|
+
|
|
26
|
+
const readRaw = (): string => {
|
|
27
|
+
const [, queryString = ''] = page.url.split('?');
|
|
28
|
+
const raw = qs.parse(queryString)[key];
|
|
29
|
+
const single = Array.isArray(raw) ? raw[0] : raw;
|
|
30
|
+
return single != null ? String(single) : defaultValue;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return computed<T>({
|
|
34
|
+
get: () => transform(readRaw()),
|
|
35
|
+
set: (next) => {
|
|
36
|
+
const nextRaw = String(next);
|
|
37
|
+
if (nextRaw === readRaw()) return;
|
|
38
|
+
|
|
39
|
+
const [path = '', queryString = ''] = page.url.split('?');
|
|
40
|
+
const query = qs.parse(queryString);
|
|
41
|
+
if (nextRaw === defaultValue) {
|
|
42
|
+
delete query[key]; // keep URLs clean at the default
|
|
43
|
+
} else {
|
|
44
|
+
query[key] = nextRaw;
|
|
45
|
+
}
|
|
46
|
+
const stringified = qs.stringify(query);
|
|
47
|
+
router.visit(stringified ? `${path}?${stringified}` : path, {
|
|
48
|
+
preserveScroll,
|
|
49
|
+
preserveState,
|
|
50
|
+
replace: true,
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// inertia-helpers/useScreenSizes.ts
|
|
2
|
+
import { createSharedComposable, useWindowSize } from '@vueuse/core';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
|
|
5
|
+
/** Tailwind md breakpoint (px). Mobile when width < 768. */
|
|
6
|
+
export const SCREEN_BREAKPOINT_MD = 768;
|
|
7
|
+
/** Tailwind lg breakpoint (px). Tablet when 768 <= width < 1024. */
|
|
8
|
+
export const SCREEN_BREAKPOINT_LG = 1024;
|
|
9
|
+
|
|
10
|
+
const useScreenSizesImpl = () => {
|
|
11
|
+
const { width } = useWindowSize();
|
|
12
|
+
|
|
13
|
+
const isMobile = computed(() => width.value < SCREEN_BREAKPOINT_MD);
|
|
14
|
+
const isTablet = computed(
|
|
15
|
+
() =>
|
|
16
|
+
width.value >= SCREEN_BREAKPOINT_MD && width.value < SCREEN_BREAKPOINT_LG
|
|
17
|
+
);
|
|
18
|
+
const isDesktop = computed(() => width.value >= SCREEN_BREAKPOINT_LG);
|
|
19
|
+
|
|
20
|
+
return { width, isMobile, isTablet, isDesktop };
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const useScreenSizes = createSharedComposable(useScreenSizesImpl);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// inertia-helpers/useTableContext.ts
|
|
2
|
+
import {
|
|
3
|
+
usePaginatedResponseContext,
|
|
4
|
+
type PaginatedResponseContext,
|
|
5
|
+
} from './usePaginatedResponseContext';
|
|
6
|
+
import {
|
|
7
|
+
useTableSelectionContext,
|
|
8
|
+
type TableSelectionContext,
|
|
9
|
+
} from './useTableSelectionContext';
|
|
10
|
+
import { isNotNil } from './utils';
|
|
11
|
+
import { injectLocal, provideLocal } from '@vueuse/core';
|
|
12
|
+
|
|
13
|
+
export type TableContext<T, U> = TableSelectionContext<U> &
|
|
14
|
+
PaginatedResponseContext<T>;
|
|
15
|
+
|
|
16
|
+
const toTableKey = (key: string): string => `${key}:table`;
|
|
17
|
+
|
|
18
|
+
export const useTableContext = <T = object, U = T>(
|
|
19
|
+
dataKey: string
|
|
20
|
+
): TableContext<T, U> => {
|
|
21
|
+
const existing = injectLocal<TableContext<T, U> | null>(
|
|
22
|
+
toTableKey(dataKey),
|
|
23
|
+
null
|
|
24
|
+
);
|
|
25
|
+
if (isNotNil(existing)) return existing;
|
|
26
|
+
|
|
27
|
+
const context: TableContext<T, U> = {
|
|
28
|
+
...useTableSelectionContext<U>(dataKey),
|
|
29
|
+
...usePaginatedResponseContext<T>(dataKey),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
provideLocal(toTableKey(dataKey), context);
|
|
33
|
+
return context;
|
|
34
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// inertia-helpers/useTableSelectionContext.ts
|
|
2
|
+
import { isNotNil } from './utils';
|
|
3
|
+
import { injectLocal, provideLocal } from '@vueuse/core';
|
|
4
|
+
import { ref, type Ref } from 'vue';
|
|
5
|
+
|
|
6
|
+
export type TableSelectionContext<U> = {
|
|
7
|
+
/** The select-all checkbox state. Does not enumerate items. */
|
|
8
|
+
all: Ref<boolean>;
|
|
9
|
+
/** Items manually selected. NOT the full list when `all` is true. */
|
|
10
|
+
selected: Ref<U[]>;
|
|
11
|
+
/** Items manually unselected while `all` is true. */
|
|
12
|
+
unselected: Ref<U[]>;
|
|
13
|
+
resetSelection: () => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const toSelectionKey = (key: string): string => `${key}:selection`;
|
|
17
|
+
|
|
18
|
+
/** Bare selection state, no provide/inject — for callers that own sharing. */
|
|
19
|
+
export const createSelectionContext = <
|
|
20
|
+
U = unknown,
|
|
21
|
+
>(): TableSelectionContext<U> => {
|
|
22
|
+
const all = ref(false);
|
|
23
|
+
const selected = ref<U[]>([]) as Ref<U[]>;
|
|
24
|
+
const unselected = ref<U[]>([]) as Ref<U[]>;
|
|
25
|
+
|
|
26
|
+
const resetSelection = (): void => {
|
|
27
|
+
all.value = false;
|
|
28
|
+
selected.value = [];
|
|
29
|
+
unselected.value = [];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return { all, selected, unselected, resetSelection };
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const useTableSelectionContext = <U = unknown>(
|
|
36
|
+
key: string
|
|
37
|
+
): TableSelectionContext<U> => {
|
|
38
|
+
const selectionKey = toSelectionKey(key);
|
|
39
|
+
const existing = injectLocal<TableSelectionContext<U> | null>(
|
|
40
|
+
selectionKey,
|
|
41
|
+
null
|
|
42
|
+
);
|
|
43
|
+
if (isNotNil(existing)) return existing;
|
|
44
|
+
|
|
45
|
+
const context = createSelectionContext<U>();
|
|
46
|
+
provideLocal(selectionKey, context);
|
|
47
|
+
return context;
|
|
48
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// inertia-helpers/useUntil.ts
|
|
2
|
+
import { noop } from './utils';
|
|
3
|
+
import { ref, toValue, watch, type MaybeRefOrGetter } from 'vue';
|
|
4
|
+
|
|
5
|
+
type Options<T, U> = {
|
|
6
|
+
initialValue?: T;
|
|
7
|
+
nextValue?: U;
|
|
8
|
+
onChange?: VoidFunction;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const useUntil = <T = boolean, U = boolean>(
|
|
12
|
+
condition: MaybeRefOrGetter<boolean>,
|
|
13
|
+
{
|
|
14
|
+
initialValue = false as T,
|
|
15
|
+
nextValue = true as U,
|
|
16
|
+
onChange = noop,
|
|
17
|
+
}: Options<T, U> = {}
|
|
18
|
+
) => {
|
|
19
|
+
const value = ref<T | U>(initialValue);
|
|
20
|
+
|
|
21
|
+
const stopWatching = watch(
|
|
22
|
+
() => toValue(condition),
|
|
23
|
+
(met) => {
|
|
24
|
+
if (met) {
|
|
25
|
+
onChange();
|
|
26
|
+
value.value = nextValue;
|
|
27
|
+
stopWatching();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// inertia-helpers/utils.ts
|
|
2
|
+
// micro-utilities the helpers share
|
|
3
|
+
import { hash } from 'object-code';
|
|
4
|
+
|
|
5
|
+
export const isNil = (value: unknown): value is null | undefined =>
|
|
6
|
+
value === null || value === undefined;
|
|
7
|
+
|
|
8
|
+
export const isNotNil = <T>(value: T | null | undefined): value is T =>
|
|
9
|
+
!isNil(value);
|
|
10
|
+
|
|
11
|
+
export const isEmpty = (value: unknown): boolean =>
|
|
12
|
+
isNil(value) || value === '' || (Array.isArray(value) && value.length === 0);
|
|
13
|
+
|
|
14
|
+
export const noop = (): void => undefined;
|
|
15
|
+
|
|
16
|
+
/** Deep equality by structural hash — cheap and dependency-light. */
|
|
17
|
+
export const isEqual = (a: unknown, b: unknown): boolean => hash(a) === hash(b);
|
|
18
|
+
|
|
19
|
+
export const isPlainObject = (
|
|
20
|
+
value: unknown
|
|
21
|
+
): value is Record<string, unknown> =>
|
|
22
|
+
typeof value === 'object' &&
|
|
23
|
+
value !== null &&
|
|
24
|
+
Object.getPrototypeOf(value) === Object.prototype;
|
package/dist/ai/index.md
CHANGED
|
@@ -214,18 +214,18 @@ Do not use these components directly in consumer code unless the user explicitly
|
|
|
214
214
|
- [Migration v2→v3: BbAlert](./guides/migration/components/bb-alert.md) - showClose inverted to hideClose, theme replaced by typed variant.
|
|
215
215
|
- [Migration v2→v3: BbAvatar](./guides/migration/components/bb-avatar.md) - The color prop is removed — retheme the fallback through the --bg / --fg locals.
|
|
216
216
|
- [Migration v2→v3: BbBadge (and where your v2 badges went)](./guides/migration/components/bb-badge.md) - The v2 BbBadge (floating count/dot) is now BbIndicator; the v3 BbBadge is a new inline pill that also replaces BbChip.
|
|
217
|
-
- [Migration v2→v3: BbBreadcrumbs](./guides/migration/components/bb-breadcrumbs.md) -
|
|
217
|
+
- [Migration v2→v3: BbBreadcrumbs](./guides/migration/components/bb-breadcrumbs.md) - Items are { label, value } (were { key, text }), the text divider prop is gone, per-item slot names are normalized.
|
|
218
218
|
- [Migration v2→v3: BbButton](./guides/migration/components/bb-button.md) - Async click handlers now auto-track loading (behavior flip), built-in tooltip props removed, variant locked to the registry. Leftover v2 --border-color on .bb-button* still paints.
|
|
219
219
|
- [Migration v2→v3: BbCheckbox / BbRadio / BbSwitch](./guides/migration/components/bb-checkbox.md) - reverse polarity inverted (explicit values flip, default layout unchanged), checked narrowed to boolean, color removed, BbRadio's name no longer required.
|
|
220
|
-
- [Migration v2→v3: BbCheckboxGroup / BbRadioGroup / BbSwitchGroup](./guides/migration/components/bb-checkbox-group.md) - labelPosition renamed legendPosition, per-item disabled is now inert (use selectable), color and the option affix slots removed, BbRadioGroup's name no longer required, the shared bb-cr-container CSS block split into one per group, and the --bb-checkbox-* / --bb-radio-* / --bb-switch-* globals replaced by glyph locals.
|
|
220
|
+
- [Migration v2→v3: BbCheckboxGroup / BbRadioGroup / BbSwitchGroup](./guides/migration/components/bb-checkbox-group.md) - labelPosition renamed legendPosition, per-item disabled is now inert (use selectable), color and the option affix slots removed, BbRadioGroup's name no longer required, the shared bb-cr-container CSS block split into one per group, and the --bb-checkbox-* / --bb-radio-* / --bb-switch-* globals replaced by glyph locals, and object items now read their own label / value by default.
|
|
221
221
|
- [Migration v2→v3: BbChip (removed)](./guides/migration/components/bb-chip.md) - BbChip is gone — BbBadge with clearable is the replacement; non-clearable chips were badges all along.
|
|
222
222
|
- [Migration v2→v3: BbCollapsible](./guides/migration/components/bb-collapsible.md) - `tag` narrows to `'span' | 'div'` and defaults to `span`; the inner element mirrors it.
|
|
223
223
|
- [Migration v2→v3: BbColorInput](./guides/migration/components/bb-color-input.md) - picker renamed to eyeDropper.
|
|
224
224
|
- [Migration v2→v3: BbColorPalette](./guides/migration/components/bb-color-palette.md) - flip inverted to disableFlip, showArrow removed, picker renamed eyeDropper, update:open dropped, model updates never emit null.
|
|
225
225
|
- [Migration v2→v3: BbDatePickerInput](./guides/migration/components/bb-date-picker-input.md) - allowWriting inverted to disableWriting and hidePopover renamed to disableCalendar, both with a changed token set; the width prop is removed; adaptive mobile sheet by default; non-floating output carries the local offset instead of UTC `Z` (new `utc` prop restores v2 output).
|
|
226
226
|
- [Migration v2→v3: BbDialog](./guides/migration/components/bb-dialog.md) - showClose inverted to hideClose, #close removed (description restored in beta.19), default widths changed, adaptive bottom sheet on mobile by default, --bb-dialog-* tokens replaced by --bb-panel-p plus locals.
|
|
227
|
-
- [Migration v2→v3: BbDropdown](./guides/migration/components/bb-dropdown.md) -
|
|
228
|
-
- [Migration v2→v3: BbDropdownButton](./guides/migration/components/bb-dropdown-button.md) - autoLoading renamed to disableAutoLoading, disabledWhileLoading and theme removed.
|
|
227
|
+
- [Migration v2→v3: BbDropdown](./guides/migration/components/bb-dropdown.md) - Rows are { label, value } (v2 and v3 up to beta.48 { key, text }), groups are named by id; rows can carry variants/submenus; arrowPadding removed; adaptive mobile sheet on by default.
|
|
228
|
+
- [Migration v2→v3: BbDropdownButton](./guides/migration/components/bb-dropdown-button.md) - autoLoading renamed to disableAutoLoading, disabledWhileLoading and theme removed; items are { label, value } rows like BbDropdown's.
|
|
229
229
|
- [Migration v2→v3: BbDropzone](./guides/migration/components/bb-dropzone.md) - modelValue is typed, accept no longer throws and takes bare tokens, and the hidden native-submit input only renders when name is set.
|
|
230
230
|
- [Migration v2→v3: BbIcon](./guides/migration/components/bb-icon.md) - The required prop is renamed type→icon, color is removed, and the xxl size key becomes 2xl.
|
|
231
231
|
- [Migration v2→v3: BbIntersection](./guides/migration/components/bb-intersection.md) - Removed with no replacement — it wrapped IntersectionObserver and carried no styling; use @vueuse/core's useIntersectionObserver.
|
|
@@ -234,14 +234,14 @@ Do not use these components directly in consumer code unless the user explicitly
|
|
|
234
234
|
- [Migration v2→v3: BbPopover](./guides/migration/components/bb-popover.md) - Built-in close button, restoreFocus, theme, and the arrow are gone; close affordances move into your content.
|
|
235
235
|
- [Migration v2→v3: BbRadioGroup](./guides/migration/components/bb-radio-group.md) - Shares its migration with BbCheckboxGroup — see bb-checkbox-group.md.
|
|
236
236
|
- [Migration v2→v3: BbRating](./guides/migration/components/bb-rating.md) - color removed; name no longer required; the star classes moved from .bb-base-rating to the .bb-rating block (--highlighted became --filled/--empty); --bb-rating-size demoted to a local --size on .bb-rating__stars; input-position finally works.
|
|
237
|
-
- [Migration v2→v3: BbSelect](./guides/migration/components/bb-select.md) - allowWriting inverted to disableWriting, filterBy narrowed to string[], prefill value renamed, chevron/options slots removed, and
|
|
237
|
+
- [Migration v2→v3: BbSelect](./guides/migration/components/bb-select.md) - allowWriting inverted to disableWriting, filterBy narrowed to string[], prefill value renamed, chevron/options slots removed, and three behavior changes (second click, mount-time coherence, object items read their own label / value).
|
|
238
238
|
- [Migration v2→v3: BbSelectPopover](./guides/migration/components/bb-select-popover.md) - flip and allowWriting inverted, arrow props removed, filterBy narrowed, options slots replaced by header/footer; shares BbSelect's behavior changes.
|
|
239
239
|
- [Migration v2→v3: BbSlider](./guides/migration/components/bb-slider.md) - thumbTranslate inverted to disableThumbTranslate; string model values and color removed.
|
|
240
240
|
- [Migration v2→v3: BbSmoothHeight](./guides/migration/components/bb-smooth-height.md) - The `tag` prop is narrowed to `div | span`, and the inner measuring element now mirrors it instead of always being a `<div>`.
|
|
241
241
|
- [Migration v2→v3: BbSpinner](./guides/migration/components/bb-spinner.md) - The color prop is removed; spinners follow currentColor.
|
|
242
242
|
- [Migration v2→v3: BbSwitchGroup](./guides/migration/components/bb-switch-group.md) - Shares its migration with BbCheckboxGroup — see bb-checkbox-group.md.
|
|
243
243
|
- [Migration v2→v3: BbTable](./guides/migration/components/bb-table.md) - The table renders as a CSS grid of divs with ARIA roles, not a <table> — every element selector (table/thead/tbody/tr/th/td) under .bb-table matches nothing, #thead/#tbody/#tfoot take role-complete div rows, --fill/--natural-width are gone, column widths drift within documented bounds, copy-to-spreadsheet and print header repetition degrade; allowSelectAll inverted to disableSelectAll; loading no longer blanks populated tables and now inerts rows; #loading is first-load-only; #empty fills a full-width cell instead of replacing the row; row events drop the selected argument; columns gained sortable + rowClass, which collide with same-named consumer fields.
|
|
244
|
-
- [Migration v2→v3: BbTabs (was BbTab)](./guides/migration/components/bb-tabs.md) - Component renamed; querykey→queryKey; animations default on; label slots renamed, header:* slots → wrapper:*, and all dynamic names/URL slugs normalized; the entire .bb-tab BEM tree renamed to .bb-tabs / .bb-tabs-list / .bb-tabs-panels.
|
|
244
|
+
- [Migration v2→v3: BbTabs (was BbTab)](./guides/migration/components/bb-tabs.md) - Component renamed; item key→value (v-model carries it); querykey→queryKey; animations default on; label slots renamed, header:* slots → wrapper:*, and all dynamic names/URL slugs normalized; the entire .bb-tab BEM tree renamed to .bb-tabs / .bb-tabs-list / .bb-tabs-panels.
|
|
245
245
|
- [Migration v2→v3: BbTag](./guides/migration/components/bb-tag.md) - modelValue is strictly string[] now, multiple is removed, and duplicates are rejected case-insensitively by default.
|
|
246
246
|
- [Migration v2→v3: BbTextInput](./guides/migration/components/bb-text-input.md) - The type prop narrows to the text-like input types — number/date values must move to their dedicated components; a bare `floating` attribute was never a prop, the spelling is label-mode="floating".
|
|
247
247
|
- [Migration v2→v3: BbToast and toast()](./guides/migration/components/bb-toast.md) - Host placement becomes position with a corner-based value set; toast() options rewritten (variant, duration, actions, portal).
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
{"name":"append","type":"BbBreadcrumbsEdgeSlotProps","fields":["disabled?: boolean"],"description":"Content rendered after the breadcrumb list, in a dedicated append region."},
|
|
22
22
|
{"name":"divider","type":"Record<string, never>","description":"Replaces the default separator rendered between breadcrumb items."},
|
|
23
23
|
{"name":"ellipsis","type":"BbBreadcrumbsEllipsisSlotProps","fields":["props: { ref: (reference: unknown) => void; }","disabled?: boolean","overflowCount: number","ellipsisWidth: number"],"description":"Replaces the default `…` overflow button shown when items overflow."},
|
|
24
|
-
{"name":"item:append","type":"BbBreadcrumbsItemSlotProps","fields":["disabled: boolean","index: number","item: Item","
|
|
25
|
-
{"name":"item:prepend","type":"BbBreadcrumbsItemSlotProps","fields":["disabled: boolean","index: number","item: Item","
|
|
24
|
+
{"name":"item:append","type":"BbBreadcrumbsItemSlotProps","fields":["disabled: boolean","index: number","item: Item","label?: string"],"description":"Content rendered after **every** breadcrumb item's link/button. Generic\nfallback below a per-item `<value>:append` slot and above the item's\n`append:icon`."},
|
|
25
|
+
{"name":"item:prepend","type":"BbBreadcrumbsItemSlotProps","fields":["disabled: boolean","index: number","item: Item","label?: string"],"description":"Content rendered before **every** breadcrumb item's link/button, in the\nleading edge region. Generic fallback: a per-item `<value>:prepend` slot\ntakes precedence, and the item's `prepend:icon` is used when neither slot\nis present."},
|
|
26
26
|
{"name":"prepend","type":"BbBreadcrumbsEdgeSlotProps","fields":["disabled?: boolean"],"description":"Content rendered before the breadcrumb list, in a dedicated prepend region."},
|
|
27
|
-
{"name":"<
|
|
28
|
-
{"name":"<
|
|
29
|
-
{"name":"<
|
|
27
|
+
{"name":"<value>","type":"BbBreadcrumbsItemSlotProps","description":"One crumb's label, by its `value` through `slotKey`; falls back to `item.label`. A crumb folded into the overflow menu follows BbDropdown's slot rules instead (the same `#<value>` names).","dynamic":true},
|
|
28
|
+
{"name":"<value>:prepend","type":"BbBreadcrumbsItemSlotProps","description":"The glyph before one crumb's label; beats `item:prepend`, which beats its `prepend:icon`.","dynamic":true},
|
|
29
|
+
{"name":"<value>:append","type":"BbBreadcrumbsItemSlotProps","description":"The glyph after one crumb's label; beats `item:append`, which beats its `append:icon`.","dynamic":true}
|
|
30
30
|
],
|
|
31
31
|
"exposed": [],
|
|
32
32
|
"models": [],
|
|
@@ -46,7 +46,11 @@
|
|
|
46
46
|
"attrTargets": [
|
|
47
47
|
"nav"
|
|
48
48
|
],
|
|
49
|
+
"removed": [
|
|
50
|
+
{"name":"items[].key","new":"items[].value","surface":"item","hint":"a crumb's identity, naming its `#<value>` slots; `check --fix` renames it","since":"3.0.0-beta.49","migration":"ai/guides/migration/components/bb-breadcrumbs.md","silent":true,"fix":{"kind":"rename"}},
|
|
51
|
+
{"name":"items[].text","new":"items[].label","surface":"item","hint":"a crumb's text; `check --fix` renames it","since":"3.0.0-beta.49","migration":"ai/guides/migration/components/bb-breadcrumbs.md","silent":true,"fix":{"kind":"rename"}}
|
|
52
|
+
],
|
|
49
53
|
"types": [
|
|
50
|
-
{"name":"BbBreadcrumbsItem","usedAs":["prop items"],"definition":"type BbBreadcrumbsItem = Omit<BbBaseButtonProps, 'block' | 'tag' | 'type'> & { onClick?: (event: MouseEvent) => void | Promise<void>;
|
|
54
|
+
{"name":"BbBreadcrumbsItem","usedAs":["prop items"],"definition":"type BbBreadcrumbsItem = Omit<BbBaseButtonProps, 'block' | 'tag' | 'type' | 'text'> & { onClick?: (event: MouseEvent) => void | Promise<void>; label?: string; value?: string; key?: never; text?: never; 'prepend:icon'?: IconType; 'append:icon'?: IconType; };"}
|
|
51
55
|
]
|
|
52
56
|
}
|