@openreachtech/furo-vue 1.3.1
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/LICENSE +9 -0
- package/README.ja.md +334 -0
- package/README.md +333 -0
- package/index.js +11 -0
- package/lib/assets/css/furo/0010.variables-palette-color-scale.css +298 -0
- package/lib/assets/css/furo/0020.variables-z-index.css +10 -0
- package/lib/assets/css/furo/0030.variables-semantic-color.css +178 -0
- package/lib/assets/css/furo/0035.variables-semantic-dimension.css +104 -0
- package/lib/assets/css/furo/0040.variables-component-furo.css +28 -0
- package/lib/assets/css/furo/0050.furo-editor-content.css +22 -0
- package/lib/assets/css/furo.css +15 -0
- package/lib/components/atoms/FuroAvatar/FuroAvatar.vue +135 -0
- package/lib/components/atoms/FuroAvatar/FuroAvatarContext.js +147 -0
- package/lib/components/atoms/FuroBadge/FuroBadge.vue +240 -0
- package/lib/components/atoms/FuroBadge/FuroBadgeContext.js +298 -0
- package/lib/components/atoms/FuroButton/ButtonEmitPayload.js +44 -0
- package/lib/components/atoms/FuroButton/FuroButton.vue +301 -0
- package/lib/components/atoms/FuroButton/FuroButtonContext.js +328 -0
- package/lib/components/atoms/FuroCheckbox/CheckboxEmitPayload.js +106 -0
- package/lib/components/atoms/FuroCheckbox/FuroCheckbox.vue +173 -0
- package/lib/components/atoms/FuroCheckbox/FuroCheckboxContext.js +682 -0
- package/lib/components/atoms/FuroEmailField/EmailFieldEmitPayload.js +74 -0
- package/lib/components/atoms/FuroEmailField/FuroEmailField.vue +119 -0
- package/lib/components/atoms/FuroEmailField/FuroEmailFieldContext.js +311 -0
- package/lib/components/atoms/FuroFileField/FileFieldEmitPayload.js +80 -0
- package/lib/components/atoms/FuroFileField/FuroFileField.vue +128 -0
- package/lib/components/atoms/FuroFileField/FuroFileFieldContext.js +195 -0
- package/lib/components/atoms/FuroIcon/FuroIcon.vue +74 -0
- package/lib/components/atoms/FuroIcon/FuroIconContext.js +293 -0
- package/lib/components/atoms/FuroIcon/FuroIconRegistry.js +617 -0
- package/lib/components/atoms/FuroIcon/FuroIconifyRendererContext.js +101 -0
- package/lib/components/atoms/FuroIcon/furoIconData.js +164 -0
- package/lib/components/atoms/FuroIcon/iconRenderers.js +62 -0
- package/lib/components/atoms/FuroIcon/icons.js +7 -0
- package/lib/components/atoms/FuroNumberField/FuroNumberField.vue +213 -0
- package/lib/components/atoms/FuroNumberField/FuroNumberFieldContext.js +442 -0
- package/lib/components/atoms/FuroNumberField/NumberFieldEmitPayload.js +162 -0
- package/lib/components/atoms/FuroPasswordField/FuroPasswordField.vue +119 -0
- package/lib/components/atoms/FuroPasswordField/FuroPasswordFieldContext.js +311 -0
- package/lib/components/atoms/FuroPasswordField/PasswordFieldEmitPayload.js +74 -0
- package/lib/components/atoms/FuroRadio/FuroRadio.vue +193 -0
- package/lib/components/atoms/FuroRadio/FuroRadioContext.js +557 -0
- package/lib/components/atoms/FuroRadio/RadioEmitPayload.js +72 -0
- package/lib/components/atoms/FuroSwitch/FuroSwitch.vue +165 -0
- package/lib/components/atoms/FuroSwitch/FuroSwitchContext.js +440 -0
- package/lib/components/atoms/FuroSwitch/SwitchEmitPayload.js +86 -0
- package/lib/components/atoms/FuroTextField/FuroTextField.vue +119 -0
- package/lib/components/atoms/FuroTextField/FuroTextFieldContext.js +311 -0
- package/lib/components/atoms/FuroTextField/TextFieldEmitPayload.js +83 -0
- package/lib/components/atoms/FuroTextarea/FuroTextarea.vue +121 -0
- package/lib/components/atoms/FuroTextarea/FuroTextareaContext.js +322 -0
- package/lib/components/atoms/FuroTextarea/TextareaEmitPayload.js +83 -0
- package/lib/components/atoms/FuroToggle/FuroToggle.vue +172 -0
- package/lib/components/atoms/FuroToggle/FuroToggleContext.js +410 -0
- package/lib/components/atoms/FuroToggle/ToggleEmitPayload.js +86 -0
- package/lib/components/molecules/FuroAccordion/AccordionEmitPayload.js +80 -0
- package/lib/components/molecules/FuroAccordion/FuroAccordion.vue +219 -0
- package/lib/components/molecules/FuroAccordion/FuroAccordionContext.js +547 -0
- package/lib/components/molecules/FuroAttachment/FuroAttachment.vue +376 -0
- package/lib/components/molecules/FuroAttachment/FuroAttachmentContext.js +628 -0
- package/lib/components/molecules/FuroAutocompleteField/AutocompleteEmitPayload.js +225 -0
- package/lib/components/molecules/FuroAutocompleteField/FuroAutocompleteField.vue +669 -0
- package/lib/components/molecules/FuroAutocompleteField/FuroAutocompleteFieldContext.js +1525 -0
- package/lib/components/molecules/FuroAvatarGroup/FuroAvatarGroup.vue +126 -0
- package/lib/components/molecules/FuroAvatarGroup/FuroAvatarGroupContext.js +245 -0
- package/lib/components/molecules/FuroBreadcrumb/FuroBreadcrumb.vue +219 -0
- package/lib/components/molecules/FuroBreadcrumb/FuroBreadcrumbContext.js +257 -0
- package/lib/components/molecules/FuroCollapsible/CollapsibleEmitPayload.js +69 -0
- package/lib/components/molecules/FuroCollapsible/FuroCollapsible.vue +177 -0
- package/lib/components/molecules/FuroCollapsible/FuroCollapsibleContext.js +389 -0
- package/lib/components/molecules/FuroControlBlock/FuroControlBlock.vue +149 -0
- package/lib/components/molecules/FuroControlBlock/FuroControlBlockContext.js +81 -0
- package/lib/components/molecules/FuroDatePicker/DatePickerEmitPayload.js +74 -0
- package/lib/components/molecules/FuroDatePicker/FuroDatePicker.vue +661 -0
- package/lib/components/molecules/FuroDatePicker/FuroDatePickerContext.js +1038 -0
- package/lib/components/molecules/FuroDateTimePicker/DateTimePickerEmitPayload.js +96 -0
- package/lib/components/molecules/FuroDateTimePicker/FuroDateTimePicker.vue +153 -0
- package/lib/components/molecules/FuroDateTimePicker/FuroDateTimePickerContext.js +840 -0
- package/lib/components/molecules/FuroDropdownMenu/DropdownMenuOptionSelectEmitPayload.js +100 -0
- package/lib/components/molecules/FuroDropdownMenu/FuroDropdownMenu.vue +348 -0
- package/lib/components/molecules/FuroDropdownMenu/FuroDropdownMenuContext.js +714 -0
- package/lib/components/molecules/FuroDropdownMenu/FuroDropdownMenuOptionRows.vue +222 -0
- package/lib/components/molecules/FuroEditableField/EditableEmitPayload.js +89 -0
- package/lib/components/molecules/FuroEditableField/FuroEditableField.vue +314 -0
- package/lib/components/molecules/FuroEditableField/FuroEditableFieldContext.js +1018 -0
- package/lib/components/molecules/FuroEditableField/processors/EditorCollisionProcessor.js +236 -0
- package/lib/components/molecules/FuroEditableField/processors/ObjectProcessor.js +101 -0
- package/lib/components/molecules/FuroEmptyState/FuroEmptyState.vue +124 -0
- package/lib/components/molecules/FuroEmptyState/FuroEmptyStateContext.js +42 -0
- package/lib/components/molecules/FuroErrorState/FuroErrorState.vue +125 -0
- package/lib/components/molecules/FuroErrorState/FuroErrorStateContext.js +42 -0
- package/lib/components/molecules/FuroPagination/FuroPagination.vue +246 -0
- package/lib/components/molecules/FuroPagination/FuroPaginationContext.js +489 -0
- package/lib/components/molecules/FuroPopover/FuroPopover.vue +171 -0
- package/lib/components/molecules/FuroPopover/FuroPopoverContext.js +279 -0
- package/lib/components/molecules/FuroScrollArea/FuroScrollArea.vue +181 -0
- package/lib/components/molecules/FuroScrollArea/FuroScrollAreaContext.js +149 -0
- package/lib/components/molecules/FuroSearchField/FuroSearchField.vue +155 -0
- package/lib/components/molecules/FuroSearchField/FuroSearchFieldContext.js +231 -0
- package/lib/components/molecules/FuroSectionHeader/FuroSectionHeader.vue +140 -0
- package/lib/components/molecules/FuroSectionHeader/FuroSectionHeaderContext.js +204 -0
- package/lib/components/molecules/FuroSelect/FuroSelect.vue +474 -0
- package/lib/components/molecules/FuroSelect/FuroSelectContext.js +743 -0
- package/lib/components/molecules/FuroSelect/SelectEmitPayload.js +181 -0
- package/lib/components/molecules/FuroSeparator/FuroSeparator.vue +88 -0
- package/lib/components/molecules/FuroSeparator/FuroSeparatorContext.js +40 -0
- package/lib/components/molecules/FuroSkeleton/FuroSkeleton.vue +101 -0
- package/lib/components/molecules/FuroSkeleton/FuroSkeletonContext.js +82 -0
- package/lib/components/molecules/FuroSplitter/FuroSplitter.vue +237 -0
- package/lib/components/molecules/FuroSplitter/FuroSplitterContext.js +429 -0
- package/lib/components/molecules/FuroSplitter/SplitterEmitPayload.js +69 -0
- package/lib/components/molecules/FuroTimeField/FuroTimeField.vue +251 -0
- package/lib/components/molecules/FuroTimeField/FuroTimeFieldContext.js +1138 -0
- package/lib/components/molecules/FuroTimeField/TimeFieldEmitPayload.js +74 -0
- package/lib/components/molecules/FuroToggleGroup/FuroToggleGroup.vue +211 -0
- package/lib/components/molecules/FuroToggleGroup/FuroToggleGroupContext.js +551 -0
- package/lib/components/molecules/FuroToggleGroup/ToggleGroupEmitPayload.js +80 -0
- package/lib/components/molecules/FuroToolBar/FuroToolBar.vue +91 -0
- package/lib/components/molecules/FuroToolBar/FuroToolBarContext.js +75 -0
- package/lib/components/molecules/FuroTooltip/FuroTooltip.vue +183 -0
- package/lib/components/molecules/FuroTooltip/FuroTooltipContext.js +290 -0
- package/lib/components/organisms/FuroAlertDialog/FuroAlertDialog.vue +324 -0
- package/lib/components/organisms/FuroAlertDialog/FuroAlertDialogContext.js +608 -0
- package/lib/components/organisms/FuroDialog/FuroDialog.vue +362 -0
- package/lib/components/organisms/FuroDialog/FuroDialogContext.js +535 -0
- package/lib/components/organisms/FuroDrawer/FuroDrawer.vue +618 -0
- package/lib/components/organisms/FuroDrawer/FuroDrawerContext.js +676 -0
- package/lib/components/organisms/FuroEditor/FuroEditor.vue +613 -0
- package/lib/components/organisms/FuroEditor/FuroEditorCommandContext.js +420 -0
- package/lib/components/organisms/FuroEditor/FuroEditorContext.js +2048 -0
- package/lib/components/organisms/FuroEditor/FuroEditorMentionMenu.vue +120 -0
- package/lib/components/organisms/FuroEditor/FuroEditorMentionMenuContext.js +261 -0
- package/lib/components/organisms/FuroEditor/PreserveNewlinesPasteExtension.js +267 -0
- package/lib/components/organisms/FuroEditor/build-editor-extensions.js +97 -0
- package/lib/components/organisms/FuroEditor/mention-suggestion.js +320 -0
- package/lib/components/organisms/FuroEditor/paste-link-segments.js +124 -0
- package/lib/components/organisms/FuroSidebar/FuroSidebar.vue +473 -0
- package/lib/components/organisms/FuroSidebar/FuroSidebarContext.js +1014 -0
- package/lib/components/organisms/FuroStepper/FuroStepper.vue +345 -0
- package/lib/components/organisms/FuroStepper/FuroStepperContext.js +481 -0
- package/lib/components/organisms/FuroTable/FuroTable.vue +707 -0
- package/lib/components/organisms/FuroTable/FuroTableContext.js +1965 -0
- package/lib/components/organisms/FuroTable/FuroTableRowItemContext.js +111 -0
- package/lib/components/organisms/FuroTabs/FuroTabs.vue +403 -0
- package/lib/components/organisms/FuroTabs/FuroTabsContext.js +846 -0
- package/lib/components/organisms/FuroToast/FuroToast.vue +624 -0
- package/lib/components/organisms/FuroToast/FuroToastContext.js +1089 -0
- package/lib/components/organisms/FuroToast/FuroToaster.vue +44 -0
- package/lib/components/organisms/FuroToast/FuroToasterContext.js +113 -0
- package/lib/components/organisms/FuroToast/ToastQueue.js +325 -0
- package/lib/components/organisms/FuroToast/toast.js +64 -0
- package/lib/contexts/BaseFuroContext.js +318 -0
- package/lib/contexts/BaseFuroContextAccessor.js +47 -0
- package/lib/emit-payload/BaseEmitPayload.js +91 -0
- package/lib/index.components.js +61 -0
- package/lib/index.core.js +18 -0
- package/lib/tools/TimerClerk.js +75 -0
- package/nuxt/index.js +109 -0
- package/nuxt/runtime/furo-icon-renderer.js +24 -0
- package/package.json +137 -0
- package/public/furo-vue/components.json +4619 -0
- package/public/furo-vue/llms.txt +66 -0
- package/types/furo-nuxt.d.ts +48 -0
- package/types/generated/components/atoms/FuroAvatar/FuroAvatar.vue.d.ts +74 -0
- package/types/generated/components/atoms/FuroAvatar/FuroAvatarContext.d.ts +82 -0
- package/types/generated/components/atoms/FuroBadge/FuroBadge.vue.d.ts +12 -0
- package/types/generated/components/atoms/FuroBadge/FuroBadgeContext.d.ts +160 -0
- package/types/generated/components/atoms/FuroButton/ButtonEmitPayload.d.ts +19 -0
- package/types/generated/components/atoms/FuroButton/FuroButton.vue.d.ts +53 -0
- package/types/generated/components/atoms/FuroButton/FuroButtonContext.d.ts +156 -0
- package/types/generated/components/atoms/FuroCheckbox/CheckboxEmitPayload.d.ts +55 -0
- package/types/generated/components/atoms/FuroCheckbox/FuroCheckbox.vue.d.ts +87 -0
- package/types/generated/components/atoms/FuroCheckbox/FuroCheckboxContext.d.ts +342 -0
- package/types/generated/components/atoms/FuroEmailField/EmailFieldEmitPayload.d.ts +46 -0
- package/types/generated/components/atoms/FuroEmailField/FuroEmailField.vue.d.ts +458 -0
- package/types/generated/components/atoms/FuroEmailField/FuroEmailFieldContext.d.ts +161 -0
- package/types/generated/components/atoms/FuroFileField/FileFieldEmitPayload.d.ts +46 -0
- package/types/generated/components/atoms/FuroFileField/FuroFileField.vue.d.ts +454 -0
- package/types/generated/components/atoms/FuroFileField/FuroFileFieldContext.d.ts +109 -0
- package/types/generated/components/atoms/FuroIcon/FuroIcon.vue.d.ts +14 -0
- package/types/generated/components/atoms/FuroIcon/FuroIconContext.d.ts +152 -0
- package/types/generated/components/atoms/FuroIcon/FuroIconRegistry.d.ts +457 -0
- package/types/generated/components/atoms/FuroIcon/FuroIconifyRendererContext.d.ts +65 -0
- package/types/generated/components/atoms/FuroIcon/furoIconData.d.ts +154 -0
- package/types/generated/components/atoms/FuroIcon/iconRenderers.d.ts +6 -0
- package/types/generated/components/atoms/FuroIcon/icons.d.ts +6 -0
- package/types/generated/components/atoms/FuroNumberField/FuroNumberField.vue.d.ts +500 -0
- package/types/generated/components/atoms/FuroNumberField/FuroNumberFieldContext.d.ts +243 -0
- package/types/generated/components/atoms/FuroNumberField/NumberFieldEmitPayload.d.ts +74 -0
- package/types/generated/components/atoms/FuroPasswordField/FuroPasswordField.vue.d.ts +458 -0
- package/types/generated/components/atoms/FuroPasswordField/FuroPasswordFieldContext.d.ts +161 -0
- package/types/generated/components/atoms/FuroPasswordField/PasswordFieldEmitPayload.d.ts +46 -0
- package/types/generated/components/atoms/FuroRadio/FuroRadio.vue.d.ts +96 -0
- package/types/generated/components/atoms/FuroRadio/FuroRadioContext.d.ts +290 -0
- package/types/generated/components/atoms/FuroRadio/RadioEmitPayload.d.ts +39 -0
- package/types/generated/components/atoms/FuroSwitch/FuroSwitch.vue.d.ts +74 -0
- package/types/generated/components/atoms/FuroSwitch/FuroSwitchContext.d.ts +218 -0
- package/types/generated/components/atoms/FuroSwitch/SwitchEmitPayload.d.ts +42 -0
- package/types/generated/components/atoms/FuroTextField/FuroTextField.vue.d.ts +458 -0
- package/types/generated/components/atoms/FuroTextField/FuroTextFieldContext.d.ts +161 -0
- package/types/generated/components/atoms/FuroTextField/TextFieldEmitPayload.d.ts +52 -0
- package/types/generated/components/atoms/FuroTextarea/FuroTextarea.vue.d.ts +422 -0
- package/types/generated/components/atoms/FuroTextarea/FuroTextareaContext.d.ts +161 -0
- package/types/generated/components/atoms/FuroTextarea/TextareaEmitPayload.d.ts +52 -0
- package/types/generated/components/atoms/FuroToggle/FuroToggle.vue.d.ts +51 -0
- package/types/generated/components/atoms/FuroToggle/FuroToggleContext.d.ts +191 -0
- package/types/generated/components/atoms/FuroToggle/ToggleEmitPayload.d.ts +42 -0
- package/types/generated/components/molecules/FuroAccordion/AccordionEmitPayload.d.ts +41 -0
- package/types/generated/components/molecules/FuroAccordion/FuroAccordion.vue.d.ts +133 -0
- package/types/generated/components/molecules/FuroAccordion/FuroAccordionContext.d.ts +279 -0
- package/types/generated/components/molecules/FuroAttachment/FuroAttachment.vue.d.ts +79 -0
- package/types/generated/components/molecules/FuroAttachment/FuroAttachmentContext.d.ts +363 -0
- package/types/generated/components/molecules/FuroAutocompleteField/AutocompleteEmitPayload.d.ts +129 -0
- package/types/generated/components/molecules/FuroAutocompleteField/FuroAutocompleteField.vue.d.ts +751 -0
- package/types/generated/components/molecules/FuroAutocompleteField/FuroAutocompleteFieldContext.d.ts +722 -0
- package/types/generated/components/molecules/FuroAvatarGroup/FuroAvatarGroup.vue.d.ts +84 -0
- package/types/generated/components/molecules/FuroAvatarGroup/FuroAvatarGroupContext.d.ts +150 -0
- package/types/generated/components/molecules/FuroBreadcrumb/FuroBreadcrumb.vue.d.ts +24 -0
- package/types/generated/components/molecules/FuroBreadcrumb/FuroBreadcrumbContext.d.ts +152 -0
- package/types/generated/components/molecules/FuroCollapsible/CollapsibleEmitPayload.d.ts +36 -0
- package/types/generated/components/molecules/FuroCollapsible/FuroCollapsible.vue.d.ts +98 -0
- package/types/generated/components/molecules/FuroCollapsible/FuroCollapsibleContext.d.ts +191 -0
- package/types/generated/components/molecules/FuroControlBlock/FuroControlBlock.vue.d.ts +30 -0
- package/types/generated/components/molecules/FuroControlBlock/FuroControlBlockContext.d.ts +57 -0
- package/types/generated/components/molecules/FuroDatePicker/DatePickerEmitPayload.d.ts +41 -0
- package/types/generated/components/molecules/FuroDatePicker/FuroDatePicker.vue.d.ts +456 -0
- package/types/generated/components/molecules/FuroDatePicker/FuroDatePickerContext.d.ts +516 -0
- package/types/generated/components/molecules/FuroDateTimePicker/DateTimePickerEmitPayload.d.ts +55 -0
- package/types/generated/components/molecules/FuroDateTimePicker/FuroDateTimePicker.vue.d.ts +1365 -0
- package/types/generated/components/molecules/FuroDateTimePicker/FuroDateTimePickerContext.d.ts +435 -0
- package/types/generated/components/molecules/FuroDropdownMenu/DropdownMenuOptionSelectEmitPayload.d.ts +48 -0
- package/types/generated/components/molecules/FuroDropdownMenu/FuroDropdownMenu.vue.d.ts +773 -0
- package/types/generated/components/molecules/FuroDropdownMenu/FuroDropdownMenuContext.d.ts +380 -0
- package/types/generated/components/molecules/FuroDropdownMenu/FuroDropdownMenuOptionRows.vue.d.ts +261 -0
- package/types/generated/components/molecules/FuroEditableField/EditableEmitPayload.d.ts +39 -0
- package/types/generated/components/molecules/FuroEditableField/FuroEditableField.vue.d.ts +646 -0
- package/types/generated/components/molecules/FuroEditableField/FuroEditableFieldContext.d.ts +477 -0
- package/types/generated/components/molecules/FuroEditableField/processors/EditorCollisionProcessor.d.ts +121 -0
- package/types/generated/components/molecules/FuroEditableField/processors/ObjectProcessor.d.ts +45 -0
- package/types/generated/components/molecules/FuroEmptyState/FuroEmptyState.vue.d.ts +21 -0
- package/types/generated/components/molecules/FuroEmptyState/FuroEmptyStateContext.d.ts +32 -0
- package/types/generated/components/molecules/FuroErrorState/FuroErrorState.vue.d.ts +21 -0
- package/types/generated/components/molecules/FuroErrorState/FuroErrorStateContext.d.ts +32 -0
- package/types/generated/components/molecules/FuroPagination/FuroPagination.vue.d.ts +534 -0
- package/types/generated/components/molecules/FuroPagination/FuroPaginationContext.d.ts +271 -0
- package/types/generated/components/molecules/FuroPopover/FuroPopover.vue.d.ts +513 -0
- package/types/generated/components/molecules/FuroPopover/FuroPopoverContext.d.ts +160 -0
- package/types/generated/components/molecules/FuroScrollArea/FuroScrollArea.vue.d.ts +124 -0
- package/types/generated/components/molecules/FuroScrollArea/FuroScrollAreaContext.d.ts +86 -0
- package/types/generated/components/molecules/FuroSearchField/FuroSearchField.vue.d.ts +487 -0
- package/types/generated/components/molecules/FuroSearchField/FuroSearchFieldContext.d.ts +137 -0
- package/types/generated/components/molecules/FuroSectionHeader/FuroSectionHeader.vue.d.ts +49 -0
- package/types/generated/components/molecules/FuroSectionHeader/FuroSectionHeaderContext.d.ts +121 -0
- package/types/generated/components/molecules/FuroSelect/FuroSelect.vue.d.ts +719 -0
- package/types/generated/components/molecules/FuroSelect/FuroSelectContext.d.ts +402 -0
- package/types/generated/components/molecules/FuroSelect/SelectEmitPayload.d.ts +102 -0
- package/types/generated/components/molecules/FuroSeparator/FuroSeparator.vue.d.ts +39 -0
- package/types/generated/components/molecules/FuroSeparator/FuroSeparatorContext.d.ts +31 -0
- package/types/generated/components/molecules/FuroSkeleton/FuroSkeleton.vue.d.ts +27 -0
- package/types/generated/components/molecules/FuroSkeleton/FuroSkeletonContext.d.ts +61 -0
- package/types/generated/components/molecules/FuroSplitter/FuroSplitter.vue.d.ts +139 -0
- package/types/generated/components/molecules/FuroSplitter/FuroSplitterContext.d.ts +226 -0
- package/types/generated/components/molecules/FuroSplitter/SplitterEmitPayload.d.ts +41 -0
- package/types/generated/components/molecules/FuroTimeField/FuroTimeField.vue.d.ts +498 -0
- package/types/generated/components/molecules/FuroTimeField/FuroTimeFieldContext.d.ts +555 -0
- package/types/generated/components/molecules/FuroTimeField/TimeFieldEmitPayload.d.ts +41 -0
- package/types/generated/components/molecules/FuroToggleGroup/FuroToggleGroup.vue.d.ts +70 -0
- package/types/generated/components/molecules/FuroToggleGroup/FuroToggleGroupContext.d.ts +270 -0
- package/types/generated/components/molecules/FuroToggleGroup/ToggleGroupEmitPayload.d.ts +41 -0
- package/types/generated/components/molecules/FuroToolBar/FuroToolBar.vue.d.ts +30 -0
- package/types/generated/components/molecules/FuroToolBar/FuroToolBarContext.d.ts +48 -0
- package/types/generated/components/molecules/FuroTooltip/FuroTooltip.vue.d.ts +524 -0
- package/types/generated/components/molecules/FuroTooltip/FuroTooltipContext.d.ts +166 -0
- package/types/generated/components/organisms/FuroAlertDialog/FuroAlertDialog.vue.d.ts +651 -0
- package/types/generated/components/organisms/FuroAlertDialog/FuroAlertDialogContext.d.ts +299 -0
- package/types/generated/components/organisms/FuroDialog/FuroDialog.vue.d.ts +583 -0
- package/types/generated/components/organisms/FuroDialog/FuroDialogContext.d.ts +264 -0
- package/types/generated/components/organisms/FuroDrawer/FuroDrawer.vue.d.ts +635 -0
- package/types/generated/components/organisms/FuroDrawer/FuroDrawerContext.d.ts +347 -0
- package/types/generated/components/organisms/FuroEditor/FuroEditor.vue.d.ts +2487 -0
- package/types/generated/components/organisms/FuroEditor/FuroEditorCommandContext.d.ts +192 -0
- package/types/generated/components/organisms/FuroEditor/FuroEditorContext.d.ts +904 -0
- package/types/generated/components/organisms/FuroEditor/FuroEditorMentionMenu.vue.d.ts +43 -0
- package/types/generated/components/organisms/FuroEditor/FuroEditorMentionMenuContext.d.ts +159 -0
- package/types/generated/components/organisms/FuroEditor/PreserveNewlinesPasteExtension.d.ts +43 -0
- package/types/generated/components/organisms/FuroEditor/build-editor-extensions.d.ts +22 -0
- package/types/generated/components/organisms/FuroEditor/mention-suggestion.d.ts +25 -0
- package/types/generated/components/organisms/FuroEditor/paste-link-segments.d.ts +31 -0
- package/types/generated/components/organisms/FuroSidebar/FuroSidebar.vue.d.ts +898 -0
- package/types/generated/components/organisms/FuroSidebar/FuroSidebarContext.d.ts +596 -0
- package/types/generated/components/organisms/FuroStepper/FuroStepper.vue.d.ts +589 -0
- package/types/generated/components/organisms/FuroStepper/FuroStepperContext.d.ts +266 -0
- package/types/generated/components/organisms/FuroTable/FuroTable.vue.d.ts +528 -0
- package/types/generated/components/organisms/FuroTable/FuroTableContext.d.ts +1035 -0
- package/types/generated/components/organisms/FuroTable/FuroTableRowItemContext.d.ts +62 -0
- package/types/generated/components/organisms/FuroTabs/FuroTabs.vue.d.ts +515 -0
- package/types/generated/components/organisms/FuroTabs/FuroTabsContext.d.ts +438 -0
- package/types/generated/components/organisms/FuroToast/FuroToast.vue.d.ts +725 -0
- package/types/generated/components/organisms/FuroToast/FuroToastContext.d.ts +543 -0
- package/types/generated/components/organisms/FuroToast/FuroToaster.vue.d.ts +729 -0
- package/types/generated/components/organisms/FuroToast/FuroToasterContext.d.ts +62 -0
- package/types/generated/components/organisms/FuroToast/ToastQueue.d.ts +201 -0
- package/types/generated/components/organisms/FuroToast/toast.d.ts +23 -0
- package/types/generated/contexts/BaseFuroContext.d.ts +207 -0
- package/types/generated/contexts/BaseFuroContextAccessor.d.ts +28 -0
- package/types/generated/emit-payload/BaseEmitPayload.d.ts +62 -0
- package/types/generated/index.components.d.ts +50 -0
- package/types/generated/index.core.d.ts +6 -0
- package/types/generated/tools/TimerClerk.d.ts +50 -0
- package/types/index.d.ts +12 -0
|
@@ -0,0 +1,846 @@
|
|
|
1
|
+
import {
|
|
2
|
+
onBeforeUnmount,
|
|
3
|
+
onMounted,
|
|
4
|
+
reactive,
|
|
5
|
+
ref,
|
|
6
|
+
} from 'vue'
|
|
7
|
+
|
|
8
|
+
import BaseFuroContext from '../../../contexts/BaseFuroContext.js'
|
|
9
|
+
|
|
10
|
+
const DEFAULT_ORIENTATION = 'horizontal'
|
|
11
|
+
const DEFAULT_VARIANT = 'line'
|
|
12
|
+
const DEFAULT_SCROLL_PREVIOUS_LABEL = 'Scroll to previous tabs'
|
|
13
|
+
const DEFAULT_SCROLL_NEXT_LABEL = 'Scroll to next tabs'
|
|
14
|
+
const SCROLL_RATIO = 0.75
|
|
15
|
+
const SCROLL_THRESHOLD = 1
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Trigger attributes the component owns, dropped from a tab's `attrs` bag.
|
|
19
|
+
* They carry the trigger-panel pairing, the element shape and the active state.
|
|
20
|
+
*/
|
|
21
|
+
const OWNED_TRIGGER_ATTRIBUTE_NAMES = new Set([
|
|
22
|
+
'value',
|
|
23
|
+
'disabled',
|
|
24
|
+
'as',
|
|
25
|
+
'asChild',
|
|
26
|
+
'as-child',
|
|
27
|
+
'id',
|
|
28
|
+
'role',
|
|
29
|
+
'type',
|
|
30
|
+
'aria-selected',
|
|
31
|
+
'aria-controls',
|
|
32
|
+
'data-state',
|
|
33
|
+
'data-disabled',
|
|
34
|
+
'data-orientation',
|
|
35
|
+
])
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Context class for FuroTabs organism.
|
|
39
|
+
*
|
|
40
|
+
* @extends {BaseFuroContext<null, Props, EmitEventName>}
|
|
41
|
+
*/
|
|
42
|
+
export default class FuroTabsContext extends BaseFuroContext {
|
|
43
|
+
/**
|
|
44
|
+
* Constructor.
|
|
45
|
+
*
|
|
46
|
+
* @param {FuroTabsContextParams} params - Parameters of this constructor.
|
|
47
|
+
*/
|
|
48
|
+
constructor ({
|
|
49
|
+
props,
|
|
50
|
+
componentContext,
|
|
51
|
+
|
|
52
|
+
refHash,
|
|
53
|
+
reactiveHash,
|
|
54
|
+
}) {
|
|
55
|
+
super({
|
|
56
|
+
props,
|
|
57
|
+
componentContext,
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
this.refHash = refHash
|
|
61
|
+
this.reactiveHash = reactiveHash
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Factory method.
|
|
66
|
+
*
|
|
67
|
+
* @template {X extends typeof FuroTabsContext ? X : never} T, X
|
|
68
|
+
* @override
|
|
69
|
+
* @param {FuroTabsContextFactoryParams} params - Parameters of this factory method.
|
|
70
|
+
* @returns {InstanceType<T>} An instance of this class.
|
|
71
|
+
* @this {T}
|
|
72
|
+
*/
|
|
73
|
+
static create ({
|
|
74
|
+
props,
|
|
75
|
+
componentContext,
|
|
76
|
+
|
|
77
|
+
refHash = this.buildRefHash(),
|
|
78
|
+
reactiveHash = this.buildReactiveHash(),
|
|
79
|
+
}) {
|
|
80
|
+
return /** @type {InstanceType<T>} */ (
|
|
81
|
+
new this({
|
|
82
|
+
props,
|
|
83
|
+
componentContext,
|
|
84
|
+
|
|
85
|
+
refHash,
|
|
86
|
+
reactiveHash,
|
|
87
|
+
})
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Build ref hash.
|
|
93
|
+
*
|
|
94
|
+
* @override
|
|
95
|
+
* @returns {FuroTabsContextParams['refHash']}
|
|
96
|
+
*/
|
|
97
|
+
static buildRefHash () {
|
|
98
|
+
return {
|
|
99
|
+
activeValueRef: ref(null),
|
|
100
|
+
viewportElementRef: ref(null),
|
|
101
|
+
resizeObserverRef: ref(null),
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Build reactive hash.
|
|
107
|
+
*
|
|
108
|
+
* @override
|
|
109
|
+
* @returns {FuroTabsContextParams['reactiveHash']}
|
|
110
|
+
*/
|
|
111
|
+
static buildReactiveHash () {
|
|
112
|
+
return {
|
|
113
|
+
scrollStateReactive: reactive({
|
|
114
|
+
canScrollPrevious: false,
|
|
115
|
+
canScrollNext: false,
|
|
116
|
+
}),
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Get emit event name.
|
|
122
|
+
*
|
|
123
|
+
* @override
|
|
124
|
+
* @returns {Readonly<{
|
|
125
|
+
* TAB_CHANGE: 'tab:change'
|
|
126
|
+
* UPDATE_VALUE: 'update:value'
|
|
127
|
+
* }>}
|
|
128
|
+
*/
|
|
129
|
+
static get EMIT_EVENT_NAME () {
|
|
130
|
+
return {
|
|
131
|
+
TAB_CHANGE: 'tab:change',
|
|
132
|
+
UPDATE_VALUE: 'update:value',
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Get emit options.
|
|
138
|
+
*
|
|
139
|
+
* @returns {{
|
|
140
|
+
* 'tab:change': (payload: {
|
|
141
|
+
* value: string
|
|
142
|
+
* }) => void
|
|
143
|
+
* 'update:value': (value: string) => void
|
|
144
|
+
* }}
|
|
145
|
+
*/
|
|
146
|
+
static get EMIT_EVENT_HASH () {
|
|
147
|
+
return {
|
|
148
|
+
[this.EMIT_EVENT_NAME.TAB_CHANGE]: payload => {},
|
|
149
|
+
[this.EMIT_EVENT_NAME.UPDATE_VALUE]: payload => {},
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* get: ResizeObserverCtor
|
|
155
|
+
*
|
|
156
|
+
* @returns {typeof ResizeObserver | null}
|
|
157
|
+
*/
|
|
158
|
+
static get ResizeObserverCtor () {
|
|
159
|
+
return globalThis.ResizeObserver
|
|
160
|
+
?? null
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* get: Constructor of this class.
|
|
165
|
+
*
|
|
166
|
+
* @override
|
|
167
|
+
* @returns {typeof FuroTabsContext}
|
|
168
|
+
*/
|
|
169
|
+
get Ctor () {
|
|
170
|
+
return /** @type {typeof FuroTabsContext} */ (
|
|
171
|
+
this.constructor
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Get internal active value ref (uncontrolled mode).
|
|
177
|
+
*
|
|
178
|
+
* @returns {import('vue').Ref<string | null>}
|
|
179
|
+
*/
|
|
180
|
+
get activeValueRef () {
|
|
181
|
+
return this.refHash.activeValueRef
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Get the scrollable viewport element ref.
|
|
186
|
+
*
|
|
187
|
+
* @returns {import('vue').Ref<HTMLElement | null>}
|
|
188
|
+
*/
|
|
189
|
+
get viewportElementRef () {
|
|
190
|
+
return this.refHash.viewportElementRef
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* get: resizeObserverRef
|
|
195
|
+
*
|
|
196
|
+
* @returns {import('vue').Ref<ResizeObserver | null>}
|
|
197
|
+
*/
|
|
198
|
+
get resizeObserverRef () {
|
|
199
|
+
return this.refHash.resizeObserverRef
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Get the scroll button state.
|
|
204
|
+
*
|
|
205
|
+
* @returns {import('vue').Reactive<{
|
|
206
|
+
* canScrollPrevious: boolean
|
|
207
|
+
* canScrollNext: boolean
|
|
208
|
+
* }>}
|
|
209
|
+
*/
|
|
210
|
+
get scrollStateReactive () {
|
|
211
|
+
return this.reactiveHash.scrollStateReactive
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Parcel passed from parent via props.
|
|
216
|
+
*
|
|
217
|
+
* @override
|
|
218
|
+
* @returns {NonNullable<Props['parcel']>}
|
|
219
|
+
*/
|
|
220
|
+
get parcel () {
|
|
221
|
+
return {
|
|
222
|
+
tabs: [],
|
|
223
|
+
orientation: DEFAULT_ORIENTATION,
|
|
224
|
+
variant: DEFAULT_VARIANT,
|
|
225
|
+
scrollable: false,
|
|
226
|
+
showPanels: true,
|
|
227
|
+
showIndicator: true,
|
|
228
|
+
disabled: false,
|
|
229
|
+
scrollPreviousLabel: DEFAULT_SCROLL_PREVIOUS_LABEL,
|
|
230
|
+
scrollNextLabel: DEFAULT_SCROLL_NEXT_LABEL,
|
|
231
|
+
...this.props.parcel,
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Normalized per-tab entries for rendering.
|
|
237
|
+
*
|
|
238
|
+
* @returns {Array<TabEntry>}
|
|
239
|
+
*/
|
|
240
|
+
get tabEntries () {
|
|
241
|
+
return (this.parcel?.tabs ?? [])
|
|
242
|
+
.map(it => ({
|
|
243
|
+
value: it.value,
|
|
244
|
+
label: it.label,
|
|
245
|
+
disabled: Boolean(it.disabled),
|
|
246
|
+
panelSlotName: it.slotName ?? it.value,
|
|
247
|
+
triggerSlotName: `label-${it.value}`,
|
|
248
|
+
attrs: it.attrs ?? null,
|
|
249
|
+
className: it.class ?? null,
|
|
250
|
+
}))
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Whether the active tab is controlled via `parcel.value`.
|
|
255
|
+
*
|
|
256
|
+
* @returns {boolean}
|
|
257
|
+
*/
|
|
258
|
+
isControlled () {
|
|
259
|
+
const { parcel } = this.props
|
|
260
|
+
|
|
261
|
+
return parcel !== null
|
|
262
|
+
&& Object.hasOwn(parcel, 'value')
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Whether the whole tab set is disabled.
|
|
267
|
+
*
|
|
268
|
+
* @returns {boolean}
|
|
269
|
+
*/
|
|
270
|
+
isDisabled () {
|
|
271
|
+
const disabledByParcel = Boolean(this.parcel?.disabled)
|
|
272
|
+
const disabledByAttrs = this.hasBooleanAttribute({ name: 'disabled' })
|
|
273
|
+
|
|
274
|
+
return disabledByParcel || disabledByAttrs
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Whether the tab set lays out vertically.
|
|
279
|
+
*
|
|
280
|
+
* @returns {boolean}
|
|
281
|
+
*/
|
|
282
|
+
isVertical () {
|
|
283
|
+
return this.extractOrientation() === 'vertical'
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Whether the underline `line` variant is active.
|
|
288
|
+
*
|
|
289
|
+
* @returns {boolean}
|
|
290
|
+
*/
|
|
291
|
+
isLineVariant () {
|
|
292
|
+
return this.extractVariant() === 'line'
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Whether the segmented `solid` variant is active.
|
|
297
|
+
*
|
|
298
|
+
* @returns {boolean}
|
|
299
|
+
*/
|
|
300
|
+
isSolidVariant () {
|
|
301
|
+
return this.extractVariant() === 'solid'
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Whether the trigger row scrolls with navigation buttons.
|
|
306
|
+
*
|
|
307
|
+
* @returns {boolean}
|
|
308
|
+
*/
|
|
309
|
+
isScrollable () {
|
|
310
|
+
return this.parcel?.scrollable === true
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Whether tab panels render. When false, the component is a navigation menu
|
|
315
|
+
* only (e.g. the active value drives an external `router-view`).
|
|
316
|
+
*
|
|
317
|
+
* @returns {boolean}
|
|
318
|
+
*/
|
|
319
|
+
shouldShowPanels () {
|
|
320
|
+
return this.parcel?.showPanels !== false
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Whether the animated active-tab indicator renders.
|
|
325
|
+
* The indicator is exclusive to the `line` variant; the `solid` variant marks
|
|
326
|
+
* the active tab with a static background instead.
|
|
327
|
+
*
|
|
328
|
+
* @returns {boolean}
|
|
329
|
+
*/
|
|
330
|
+
shouldShowIndicator () {
|
|
331
|
+
return this.isLineVariant()
|
|
332
|
+
&& this.parcel?.showIndicator !== false
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Resolve the visual variant.
|
|
337
|
+
*
|
|
338
|
+
* @returns {'line' | 'solid'}
|
|
339
|
+
*/
|
|
340
|
+
extractVariant () {
|
|
341
|
+
return this.parcel?.variant
|
|
342
|
+
?? DEFAULT_VARIANT
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Resolve the layout orientation.
|
|
347
|
+
*
|
|
348
|
+
* @returns {'horizontal' | 'vertical'}
|
|
349
|
+
*/
|
|
350
|
+
extractOrientation () {
|
|
351
|
+
return this.parcel?.orientation
|
|
352
|
+
?? DEFAULT_ORIENTATION
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Resolve the icon name for the scroll-toward-start button.
|
|
357
|
+
*
|
|
358
|
+
* @returns {string}
|
|
359
|
+
*/
|
|
360
|
+
extractScrollPreviousIcon () {
|
|
361
|
+
return this.isVertical()
|
|
362
|
+
? 'ph:caret-up'
|
|
363
|
+
: 'ph:caret-left'
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Resolve the icon name for the scroll-toward-end button.
|
|
368
|
+
*
|
|
369
|
+
* @returns {string}
|
|
370
|
+
*/
|
|
371
|
+
extractScrollNextIcon () {
|
|
372
|
+
return this.isVertical()
|
|
373
|
+
? 'ph:caret-down'
|
|
374
|
+
: 'ph:caret-right'
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Resolve the accessible name of the scroll-toward-start button.
|
|
379
|
+
*
|
|
380
|
+
* @returns {string}
|
|
381
|
+
*/
|
|
382
|
+
extractScrollPreviousLabel () {
|
|
383
|
+
return this.parcel?.scrollPreviousLabel
|
|
384
|
+
?? DEFAULT_SCROLL_PREVIOUS_LABEL
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Resolve the accessible name of the scroll-toward-end button.
|
|
389
|
+
*
|
|
390
|
+
* @returns {string}
|
|
391
|
+
*/
|
|
392
|
+
extractScrollNextLabel () {
|
|
393
|
+
return this.parcel?.scrollNextLabel
|
|
394
|
+
?? DEFAULT_SCROLL_NEXT_LABEL
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Resolve the value of the first tab, if any.
|
|
399
|
+
*
|
|
400
|
+
* @returns {string | null}
|
|
401
|
+
*/
|
|
402
|
+
extractFirstTabValue () {
|
|
403
|
+
return this.tabEntries[0]?.value
|
|
404
|
+
?? null
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Resolve the active tab value for the root host element.
|
|
409
|
+
* `parcel.value` takes precedence; otherwise the internal ref,
|
|
410
|
+
* falling back to the first tab.
|
|
411
|
+
*
|
|
412
|
+
* @returns {string | null}
|
|
413
|
+
*/
|
|
414
|
+
extractActiveValue () {
|
|
415
|
+
if (this.isControlled()) {
|
|
416
|
+
return this.parcel?.value
|
|
417
|
+
?? null
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return this.activeValueRef.value
|
|
421
|
+
?? this.extractFirstTabValue()
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Extract attributes for the root host element.
|
|
426
|
+
* The `model-value` key is only included when an active value exists, so the
|
|
427
|
+
* primitive (whose `model-value` is `string`, never `null`) stays uncontrolled
|
|
428
|
+
* when there is no active tab.
|
|
429
|
+
*
|
|
430
|
+
* @returns {Record<string, unknown>}
|
|
431
|
+
*/
|
|
432
|
+
extractRootAttributes () {
|
|
433
|
+
const optionalAttributes = this.buildOptionalRootAttributes()
|
|
434
|
+
|
|
435
|
+
return {
|
|
436
|
+
orientation: this.extractOrientation(),
|
|
437
|
+
...optionalAttributes,
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Build the optional root attributes that are only included when present.
|
|
443
|
+
*
|
|
444
|
+
* @returns {Record<string, unknown>}
|
|
445
|
+
*/
|
|
446
|
+
buildOptionalRootAttributes () {
|
|
447
|
+
const entries = [
|
|
448
|
+
['modelValue', this.extractActiveValue()],
|
|
449
|
+
]
|
|
450
|
+
.filter(([, attributeValue]) => attributeValue !== null)
|
|
451
|
+
|
|
452
|
+
return Object.fromEntries(entries)
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Extract root class names.
|
|
457
|
+
*
|
|
458
|
+
* @returns {Record<string, boolean>}
|
|
459
|
+
*/
|
|
460
|
+
extractRootClassNames () {
|
|
461
|
+
return {
|
|
462
|
+
'unit-tabs': true,
|
|
463
|
+
line: this.isLineVariant(),
|
|
464
|
+
solid: this.isSolidVariant(),
|
|
465
|
+
vertical: this.isVertical(),
|
|
466
|
+
scrollable: this.isScrollable(),
|
|
467
|
+
disabled: this.isDisabled(),
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Build attributes of a single trigger. The component-owned attributes win:
|
|
473
|
+
* the bag loses every one of them before the tab's own values are applied.
|
|
474
|
+
*
|
|
475
|
+
* @param {{
|
|
476
|
+
* entry: TabEntry
|
|
477
|
+
* }} params - Parameters.
|
|
478
|
+
* @returns {Record<string, *>} Attributes of the trigger.
|
|
479
|
+
*/
|
|
480
|
+
buildTriggerAttributes ({
|
|
481
|
+
entry,
|
|
482
|
+
}) {
|
|
483
|
+
const bagEntries = Object.entries(entry.attrs ?? {})
|
|
484
|
+
.filter(([attributeName]) => !OWNED_TRIGGER_ATTRIBUTE_NAMES.has(attributeName))
|
|
485
|
+
|
|
486
|
+
return {
|
|
487
|
+
...Object.fromEntries(bagEntries),
|
|
488
|
+
value: entry.value,
|
|
489
|
+
disabled: entry.disabled,
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Build class names of a single trigger.
|
|
495
|
+
*
|
|
496
|
+
* @param {{
|
|
497
|
+
* entry: TabEntry
|
|
498
|
+
* }} params - Parameters.
|
|
499
|
+
* @returns {Array<string | null>} Class names of the trigger.
|
|
500
|
+
*/
|
|
501
|
+
buildTriggerClassNames ({
|
|
502
|
+
entry,
|
|
503
|
+
}) {
|
|
504
|
+
return [
|
|
505
|
+
'tab',
|
|
506
|
+
entry.className,
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Whether a given tab is the active one.
|
|
512
|
+
*
|
|
513
|
+
* @param {{
|
|
514
|
+
* value: string
|
|
515
|
+
* }} params
|
|
516
|
+
* @returns {boolean}
|
|
517
|
+
*/
|
|
518
|
+
isActiveTab ({
|
|
519
|
+
value,
|
|
520
|
+
}) {
|
|
521
|
+
return this.extractActiveValue() === value
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Handle active-tab changes from the root host element.
|
|
526
|
+
*
|
|
527
|
+
* @param {{
|
|
528
|
+
* value: string
|
|
529
|
+
* }} params
|
|
530
|
+
*/
|
|
531
|
+
onTabChange ({
|
|
532
|
+
value,
|
|
533
|
+
}) {
|
|
534
|
+
if (!this.isControlled()) {
|
|
535
|
+
this.activeValueRef.value = value
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
this.emit(
|
|
539
|
+
this.EMIT_EVENT_NAME.UPDATE_VALUE,
|
|
540
|
+
value
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
this.emit(
|
|
544
|
+
this.EMIT_EVENT_NAME.TAB_CHANGE,
|
|
545
|
+
{
|
|
546
|
+
value,
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Setup component context.
|
|
553
|
+
*
|
|
554
|
+
* @template {X extends FuroTabsContext ? X : never} T, X
|
|
555
|
+
* @override
|
|
556
|
+
* @returns {T} For method chaining.
|
|
557
|
+
* @this {T}
|
|
558
|
+
*/
|
|
559
|
+
setupComponent () {
|
|
560
|
+
onMounted(() => {
|
|
561
|
+
this.setupScrollObservation()
|
|
562
|
+
this.updateScrollState()
|
|
563
|
+
})
|
|
564
|
+
|
|
565
|
+
onBeforeUnmount(() => {
|
|
566
|
+
this.teardownScrollObservation()
|
|
567
|
+
})
|
|
568
|
+
|
|
569
|
+
return this
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Observe the viewport size to recompute scroll button state.
|
|
574
|
+
*/
|
|
575
|
+
setupScrollObservation () {
|
|
576
|
+
const element = this.viewportElementRef.value
|
|
577
|
+
const observer = this.createResizeObserver()
|
|
578
|
+
|
|
579
|
+
if (!element || !observer) {
|
|
580
|
+
return
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
observer.observe(element)
|
|
584
|
+
|
|
585
|
+
this.resizeObserverRef.value = observer
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Create the observer that recomputes scroll button state on a size change.
|
|
590
|
+
*
|
|
591
|
+
* @returns {ResizeObserver | null}
|
|
592
|
+
*/
|
|
593
|
+
createResizeObserver () {
|
|
594
|
+
const {
|
|
595
|
+
ResizeObserverCtor,
|
|
596
|
+
} = this.Ctor
|
|
597
|
+
|
|
598
|
+
if (!ResizeObserverCtor) {
|
|
599
|
+
return null
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
return new ResizeObserverCtor(() => {
|
|
603
|
+
this.updateScrollState()
|
|
604
|
+
})
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Disconnect the viewport size observer.
|
|
609
|
+
*/
|
|
610
|
+
teardownScrollObservation () {
|
|
611
|
+
if (!this.resizeObserverRef.value) {
|
|
612
|
+
return
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
this.resizeObserverRef.value.disconnect()
|
|
616
|
+
|
|
617
|
+
this.resizeObserverRef.value = null
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Recompute whether the viewport can scroll in either direction.
|
|
622
|
+
*/
|
|
623
|
+
onScroll () {
|
|
624
|
+
this.updateScrollState()
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Extract the current scroll position, viewport size, and total size
|
|
629
|
+
* along the active axis.
|
|
630
|
+
*
|
|
631
|
+
* @returns {{
|
|
632
|
+
* position: number
|
|
633
|
+
* size: number
|
|
634
|
+
* total: number
|
|
635
|
+
* }}
|
|
636
|
+
*/
|
|
637
|
+
extractScrollMetrics () {
|
|
638
|
+
const element = this.viewportElementRef.value
|
|
639
|
+
|
|
640
|
+
if (!element) {
|
|
641
|
+
return {
|
|
642
|
+
position: 0,
|
|
643
|
+
size: 0,
|
|
644
|
+
total: 0,
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (this.isVertical()) {
|
|
649
|
+
return {
|
|
650
|
+
position: element.scrollTop,
|
|
651
|
+
size: element.clientHeight,
|
|
652
|
+
total: element.scrollHeight,
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
return {
|
|
657
|
+
position: element.scrollLeft,
|
|
658
|
+
size: element.clientWidth,
|
|
659
|
+
total: element.scrollWidth,
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Update the scroll button enabled state from the viewport metrics.
|
|
665
|
+
*/
|
|
666
|
+
updateScrollState () {
|
|
667
|
+
const {
|
|
668
|
+
position,
|
|
669
|
+
size,
|
|
670
|
+
total,
|
|
671
|
+
} = this.extractScrollMetrics()
|
|
672
|
+
|
|
673
|
+
this.scrollStateReactive.canScrollPrevious = position > SCROLL_THRESHOLD
|
|
674
|
+
this.scrollStateReactive.canScrollNext = position + size < total - SCROLL_THRESHOLD
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Scroll the viewport by a fraction of its size.
|
|
679
|
+
*
|
|
680
|
+
* @param {{
|
|
681
|
+
* direction: number
|
|
682
|
+
* }} params - `-1` scrolls toward the start, `1` toward the end.
|
|
683
|
+
*/
|
|
684
|
+
scrollByViewport ({
|
|
685
|
+
direction,
|
|
686
|
+
}) {
|
|
687
|
+
const element = this.viewportElementRef.value
|
|
688
|
+
|
|
689
|
+
if (!element) {
|
|
690
|
+
return
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
const {
|
|
694
|
+
size,
|
|
695
|
+
} = this.extractScrollMetrics()
|
|
696
|
+
|
|
697
|
+
const distance = direction * size * SCROLL_RATIO
|
|
698
|
+
const axis = this.isVertical()
|
|
699
|
+
? 'top'
|
|
700
|
+
: 'left'
|
|
701
|
+
|
|
702
|
+
element.scrollBy({
|
|
703
|
+
[axis]: distance,
|
|
704
|
+
behavior: 'smooth',
|
|
705
|
+
})
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Scroll the viewport toward the start.
|
|
710
|
+
*/
|
|
711
|
+
onScrollPrevious () {
|
|
712
|
+
this.scrollByViewport({
|
|
713
|
+
direction: -1,
|
|
714
|
+
})
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Scroll the viewport toward the end.
|
|
719
|
+
*/
|
|
720
|
+
onScrollNext () {
|
|
721
|
+
this.scrollByViewport({
|
|
722
|
+
direction: 1,
|
|
723
|
+
})
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Whether the viewport can scroll toward the start.
|
|
728
|
+
*
|
|
729
|
+
* @returns {boolean}
|
|
730
|
+
*/
|
|
731
|
+
canScrollPrevious () {
|
|
732
|
+
return this.scrollStateReactive.canScrollPrevious
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Whether the viewport can scroll toward the end.
|
|
737
|
+
*
|
|
738
|
+
* @returns {boolean}
|
|
739
|
+
*/
|
|
740
|
+
canScrollNext () {
|
|
741
|
+
return this.scrollStateReactive.canScrollNext
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* @typedef {import('../../../contexts/BaseFuroContext.js').BaseFuroContextParams & {
|
|
747
|
+
* props: Props
|
|
748
|
+
* componentContext: ComponentContext
|
|
749
|
+
* refHash: {
|
|
750
|
+
* activeValueRef: import('vue').Ref<string | null>
|
|
751
|
+
* viewportElementRef: import('vue').Ref<HTMLElement | null>
|
|
752
|
+
* resizeObserverRef: import('vue').Ref<ResizeObserver | null>
|
|
753
|
+
* }
|
|
754
|
+
* reactiveHash: {
|
|
755
|
+
* scrollStateReactive: import('vue').Reactive<{
|
|
756
|
+
* canScrollPrevious: boolean
|
|
757
|
+
* canScrollNext: boolean
|
|
758
|
+
* }>
|
|
759
|
+
* }
|
|
760
|
+
* }} FuroTabsContextParams
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* @typedef {Omit<FuroTabsContextParams, 'refHash' | 'reactiveHash'> & {
|
|
765
|
+
* refHash?: FuroTabsContextParams['refHash']
|
|
766
|
+
* reactiveHash?: FuroTabsContextParams['reactiveHash']
|
|
767
|
+
* }} FuroTabsContextFactoryParams
|
|
768
|
+
*/
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* @typedef {keyof typeof FuroTabsContext.EMIT_EVENT_NAME} EmitEventName
|
|
772
|
+
*/
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* @typedef {import('vue').HTMLAttributes & {
|
|
776
|
+
* parcel?: FuroTabsParcel | null
|
|
777
|
+
* }} Props
|
|
778
|
+
*/
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Closed-set Furo behavior for `<FuroTabs>`.
|
|
782
|
+
* JSON-serializable only. Not an open passthrough to the internal tabs primitive.
|
|
783
|
+
*
|
|
784
|
+
* @typedef {{
|
|
785
|
+
* tabs?: Array<FuroTabsTab>
|
|
786
|
+
* value?: string | null
|
|
787
|
+
* orientation?: 'horizontal' | 'vertical'
|
|
788
|
+
* variant?: 'line' | 'solid'
|
|
789
|
+
* scrollable?: boolean
|
|
790
|
+
* showPanels?: boolean
|
|
791
|
+
* showIndicator?: boolean
|
|
792
|
+
* disabled?: boolean
|
|
793
|
+
* scrollPreviousLabel?: string
|
|
794
|
+
* scrollNextLabel?: string
|
|
795
|
+
* }} FuroTabsParcel
|
|
796
|
+
*/
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* A single tab. `value` reaches the DOM inside the trigger and panel element ids,
|
|
800
|
+
* so pass a token that is valid in an id rather than raw server data.
|
|
801
|
+
*
|
|
802
|
+
* @typedef {{
|
|
803
|
+
* value: string
|
|
804
|
+
* label: string
|
|
805
|
+
* slotName?: string
|
|
806
|
+
* disabled?: boolean
|
|
807
|
+
* attrs?: Record<string, string | number | boolean>
|
|
808
|
+
* class?: string
|
|
809
|
+
* }} FuroTabsTab
|
|
810
|
+
*/
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* @typedef {{
|
|
814
|
+
* value: string
|
|
815
|
+
* label: string
|
|
816
|
+
* disabled: boolean
|
|
817
|
+
* panelSlotName: string
|
|
818
|
+
* triggerSlotName: string
|
|
819
|
+
* attrs: Record<string, string | number | boolean> | null
|
|
820
|
+
* className: string | null
|
|
821
|
+
* }} TabEntry
|
|
822
|
+
*/
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* @typedef {import('vue').SetupContext<FuroTabsEmitHash, FuroTabsSlots>} ComponentContext
|
|
826
|
+
*/
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* @typedef {typeof FuroTabsContext.EMIT_EVENT_HASH} FuroTabsEmitHash
|
|
830
|
+
*/
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* @typedef {import('vue').SlotsType<Record<string, {
|
|
834
|
+
* value: string
|
|
835
|
+
* label?: string
|
|
836
|
+
* }>>} FuroTabsSlots
|
|
837
|
+
*/
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* @typedef {(
|
|
841
|
+
* props: Props,
|
|
842
|
+
* componentContext: ComponentContext
|
|
843
|
+
* ) => {
|
|
844
|
+
* context: FuroTabsContext
|
|
845
|
+
* }} FuroTabsSetup
|
|
846
|
+
*/
|