@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,628 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
} from 'vue'
|
|
4
|
+
|
|
5
|
+
import BaseFuroContext from '../../../contexts/BaseFuroContext.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Furo-owned parcel keys (not forwarded verbatim to the root element).
|
|
9
|
+
*/
|
|
10
|
+
const FURO_ATTACHMENT_PARCEL_KEYS = new Set([
|
|
11
|
+
'fileName',
|
|
12
|
+
'fileSize',
|
|
13
|
+
'imageSource',
|
|
14
|
+
'imageAlternativeText',
|
|
15
|
+
'iconName',
|
|
16
|
+
'uploading',
|
|
17
|
+
'uploadProgress',
|
|
18
|
+
'downloadable',
|
|
19
|
+
'removable',
|
|
20
|
+
'downloadLabel',
|
|
21
|
+
'removeLabel',
|
|
22
|
+
'uploadingLabel',
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Context class for FuroAttachment molecule.
|
|
27
|
+
*
|
|
28
|
+
* One component covers both shapes the design draws. With no image source it
|
|
29
|
+
* renders a file row carrying a type glyph; with one it renders the preview at
|
|
30
|
+
* a single size and crop. A preview that fails to load falls back to the row,
|
|
31
|
+
* so a dead URL shows the glyph rather than a broken image.
|
|
32
|
+
*
|
|
33
|
+
* @extends {BaseFuroContext<null, Props, EmitEventName>}
|
|
34
|
+
*/
|
|
35
|
+
export default class FuroAttachmentContext extends BaseFuroContext {
|
|
36
|
+
/**
|
|
37
|
+
* Constructor.
|
|
38
|
+
*
|
|
39
|
+
* @param {FuroAttachmentContextParams} params - Parameters of this constructor.
|
|
40
|
+
*/
|
|
41
|
+
constructor ({
|
|
42
|
+
props,
|
|
43
|
+
componentContext,
|
|
44
|
+
|
|
45
|
+
refHash,
|
|
46
|
+
}) {
|
|
47
|
+
super({
|
|
48
|
+
props,
|
|
49
|
+
componentContext,
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
this.refHash = refHash
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Factory method.
|
|
57
|
+
*
|
|
58
|
+
* @template {X extends typeof FuroAttachmentContext ? X : never} T, X
|
|
59
|
+
* @override
|
|
60
|
+
* @param {FuroAttachmentContextFactoryParams} params - Parameters of this factory method.
|
|
61
|
+
* @returns {InstanceType<T>} An instance of this class.
|
|
62
|
+
* @this {T}
|
|
63
|
+
*/
|
|
64
|
+
static create ({
|
|
65
|
+
props,
|
|
66
|
+
componentContext,
|
|
67
|
+
|
|
68
|
+
refHash = this.buildRefHash(),
|
|
69
|
+
}) {
|
|
70
|
+
return /** @type {InstanceType<T>} */ (
|
|
71
|
+
new this({
|
|
72
|
+
props,
|
|
73
|
+
componentContext,
|
|
74
|
+
|
|
75
|
+
refHash,
|
|
76
|
+
})
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Build ref hash.
|
|
82
|
+
*
|
|
83
|
+
* @override
|
|
84
|
+
* @returns {FuroAttachmentContextParams['refHash']} Ref hash.
|
|
85
|
+
*/
|
|
86
|
+
static buildRefHash () {
|
|
87
|
+
return {
|
|
88
|
+
imagePreviewFailedRef: ref(false),
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get emit event name.
|
|
94
|
+
*
|
|
95
|
+
* @override
|
|
96
|
+
* @returns {Readonly<{
|
|
97
|
+
* DOWNLOAD: 'download'
|
|
98
|
+
* REMOVE: 'remove'
|
|
99
|
+
* }>} Emit event names.
|
|
100
|
+
*/
|
|
101
|
+
static get EMIT_EVENT_NAME () {
|
|
102
|
+
return {
|
|
103
|
+
DOWNLOAD: 'download',
|
|
104
|
+
REMOVE: 'remove',
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Get emit options.
|
|
110
|
+
*
|
|
111
|
+
* @returns {{
|
|
112
|
+
* download: (payload: FuroAttachmentEmitPayload) => void
|
|
113
|
+
* remove: (payload: FuroAttachmentEmitPayload) => void
|
|
114
|
+
* }} Emit hash.
|
|
115
|
+
*/
|
|
116
|
+
static get EMIT_EVENT_HASH () {
|
|
117
|
+
return {
|
|
118
|
+
[this.EMIT_EVENT_NAME.DOWNLOAD]: payload => {},
|
|
119
|
+
[this.EMIT_EVENT_NAME.REMOVE]: payload => {},
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The glyph a file row shows when the caller names none.
|
|
125
|
+
*
|
|
126
|
+
* @returns {string} Icon name.
|
|
127
|
+
*/
|
|
128
|
+
static get DEFAULT_ICON_NAME () {
|
|
129
|
+
return 'ph:file'
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The lowest share of an upload the bar can report.
|
|
134
|
+
*
|
|
135
|
+
* @returns {number} Percentage.
|
|
136
|
+
*/
|
|
137
|
+
static get MINIMUM_UPLOAD_PROGRESS () {
|
|
138
|
+
return 0
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The highest share of an upload the bar can report.
|
|
143
|
+
*
|
|
144
|
+
* @returns {number} Percentage.
|
|
145
|
+
*/
|
|
146
|
+
static get MAXIMUM_UPLOAD_PROGRESS () {
|
|
147
|
+
return 100
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* get: Constructor of this class.
|
|
152
|
+
*
|
|
153
|
+
* @override
|
|
154
|
+
* @returns {typeof FuroAttachmentContext} Constructor.
|
|
155
|
+
*/
|
|
156
|
+
get Ctor () {
|
|
157
|
+
return /** @type {typeof FuroAttachmentContext} */ (
|
|
158
|
+
this.constructor
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* get: whether the preview of the current source failed to load.
|
|
164
|
+
*
|
|
165
|
+
* @returns {import('vue').Ref<boolean>} Ref.
|
|
166
|
+
*/
|
|
167
|
+
get imagePreviewFailedRef () {
|
|
168
|
+
return this.refHash.imagePreviewFailedRef
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* get: name of the file.
|
|
173
|
+
*
|
|
174
|
+
* @returns {string} File name; empty string when unset.
|
|
175
|
+
*/
|
|
176
|
+
get fileName () {
|
|
177
|
+
return this.parcel?.fileName
|
|
178
|
+
?? ''
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* get: size of the file, already formatted for reading.
|
|
183
|
+
*
|
|
184
|
+
* @returns {string} Formatted size; empty string when unset.
|
|
185
|
+
*/
|
|
186
|
+
get fileSize () {
|
|
187
|
+
return this.parcel?.fileSize
|
|
188
|
+
?? ''
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* get: source of the preview image.
|
|
193
|
+
*
|
|
194
|
+
* @returns {string | null} Source, or null when the file has no preview.
|
|
195
|
+
*/
|
|
196
|
+
get imageSource () {
|
|
197
|
+
return this.parcel?.imageSource
|
|
198
|
+
?? null
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* get: alternative text for the preview image.
|
|
203
|
+
*
|
|
204
|
+
* Falls back to the file name, which is what a caller would otherwise repeat.
|
|
205
|
+
*
|
|
206
|
+
* @returns {string} Alternative text.
|
|
207
|
+
*/
|
|
208
|
+
get imageAlternativeText () {
|
|
209
|
+
return this.parcel?.imageAlternativeText
|
|
210
|
+
?? this.fileName
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* get: name of the glyph a file row shows.
|
|
215
|
+
*
|
|
216
|
+
* @returns {string} Icon name.
|
|
217
|
+
*/
|
|
218
|
+
get iconName () {
|
|
219
|
+
return this.parcel?.iconName
|
|
220
|
+
?? this.Ctor.DEFAULT_ICON_NAME
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* get: share of the upload already sent.
|
|
225
|
+
*
|
|
226
|
+
* @returns {number | null} Percentage, or null when the size is unknown.
|
|
227
|
+
*/
|
|
228
|
+
get uploadProgress () {
|
|
229
|
+
return this.parcel?.uploadProgress
|
|
230
|
+
?? null
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* get: accessible name of the download action.
|
|
235
|
+
*
|
|
236
|
+
* @returns {string} Label.
|
|
237
|
+
*/
|
|
238
|
+
get downloadLabel () {
|
|
239
|
+
return this.parcel?.downloadLabel
|
|
240
|
+
?? 'Download'
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* get: accessible name of the remove action.
|
|
245
|
+
*
|
|
246
|
+
* @returns {string} Label.
|
|
247
|
+
*/
|
|
248
|
+
get removeLabel () {
|
|
249
|
+
return this.parcel?.removeLabel
|
|
250
|
+
?? 'Remove'
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* get: accessible name of the upload bar.
|
|
255
|
+
*
|
|
256
|
+
* @returns {string} Label.
|
|
257
|
+
*/
|
|
258
|
+
get uploadingLabel () {
|
|
259
|
+
return this.parcel?.uploadingLabel
|
|
260
|
+
?? 'Uploading'
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Setup component.
|
|
265
|
+
*
|
|
266
|
+
* @template {X extends FuroAttachmentContext ? X : never} T, X
|
|
267
|
+
* @override
|
|
268
|
+
* @returns {T} For method chaining.
|
|
269
|
+
* @this {T}
|
|
270
|
+
*/
|
|
271
|
+
setupComponent () {
|
|
272
|
+
this.watch(
|
|
273
|
+
() => this.imageSource,
|
|
274
|
+
() => {
|
|
275
|
+
this.imagePreviewFailedRef.value = false
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
return this
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Whether the file is still being sent.
|
|
284
|
+
*
|
|
285
|
+
* @returns {boolean} true while the upload runs.
|
|
286
|
+
*/
|
|
287
|
+
isUploading () {
|
|
288
|
+
return Boolean(this.parcel?.uploading)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Whether the caller allows the file to be downloaded.
|
|
293
|
+
*
|
|
294
|
+
* @returns {boolean} true when the download action may render.
|
|
295
|
+
*/
|
|
296
|
+
isDownloadable () {
|
|
297
|
+
return this.parcel?.downloadable
|
|
298
|
+
?? true
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Whether the caller allows the file to be taken off the record.
|
|
303
|
+
*
|
|
304
|
+
* @returns {boolean} true when the remove action may render.
|
|
305
|
+
*/
|
|
306
|
+
isRemovable () {
|
|
307
|
+
return this.parcel?.removable
|
|
308
|
+
?? true
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Whether the caller knows how large the upload is.
|
|
313
|
+
*
|
|
314
|
+
* @returns {boolean} true when a share was named, false when the size is unknown.
|
|
315
|
+
*/
|
|
316
|
+
isUploadMeasured () {
|
|
317
|
+
return this.uploadProgress !== null
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Whether the preview renders in place of the file row.
|
|
322
|
+
*
|
|
323
|
+
* @returns {boolean} true when a source is set and it has loaded.
|
|
324
|
+
*/
|
|
325
|
+
hasImagePreview () {
|
|
326
|
+
return this.imageSource !== null
|
|
327
|
+
&& !this.imagePreviewFailedRef.value
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Whether the row shows the formatted size under the name.
|
|
332
|
+
*
|
|
333
|
+
* @returns {boolean} true when a size is set and no upload is running.
|
|
334
|
+
*/
|
|
335
|
+
hasFileSizeCaption () {
|
|
336
|
+
return !this.isUploading()
|
|
337
|
+
&& this.fileSize !== ''
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Whether the row shows the upload bar in place of the size.
|
|
342
|
+
*
|
|
343
|
+
* @returns {boolean} true while a file with no preview uploads.
|
|
344
|
+
*/
|
|
345
|
+
hasProgressBar () {
|
|
346
|
+
return this.isUploading()
|
|
347
|
+
&& !this.hasImagePreview()
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Whether the preview is veiled and marked as uploading.
|
|
352
|
+
*
|
|
353
|
+
* The preview has no room for a bar, so the design covers it and spins
|
|
354
|
+
* instead of reporting a share.
|
|
355
|
+
*
|
|
356
|
+
* @returns {boolean} true while a file with a preview uploads.
|
|
357
|
+
*/
|
|
358
|
+
hasUploadingPreview () {
|
|
359
|
+
return this.isUploading()
|
|
360
|
+
&& this.hasImagePreview()
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Whether the download action renders.
|
|
365
|
+
*
|
|
366
|
+
* @returns {boolean} true when the file is downloadable and settled.
|
|
367
|
+
*/
|
|
368
|
+
hasDownloadAction () {
|
|
369
|
+
return this.isDownloadable()
|
|
370
|
+
&& !this.isUploading()
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Whether the remove action renders.
|
|
375
|
+
*
|
|
376
|
+
* It stays through an upload of a file with no preview, where it cancels.
|
|
377
|
+
*
|
|
378
|
+
* @returns {boolean} true when the remove action renders.
|
|
379
|
+
*/
|
|
380
|
+
hasRemoveAction () {
|
|
381
|
+
return this.isRemovable()
|
|
382
|
+
&& !this.hasUploadingPreview()
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Whether anything renders in the action cluster.
|
|
387
|
+
*
|
|
388
|
+
* @returns {boolean} true when the cluster holds at least one control.
|
|
389
|
+
*/
|
|
390
|
+
hasActions () {
|
|
391
|
+
return this.hasDownloadAction()
|
|
392
|
+
|| this.hasRemoveAction()
|
|
393
|
+
|| this.hasUploadingPreview()
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Clamp the named share to the bar's own range, so a fill cannot outrun its track.
|
|
398
|
+
*
|
|
399
|
+
* @returns {number} Percentage between zero and one hundred.
|
|
400
|
+
*/
|
|
401
|
+
calculateUploadProgress () {
|
|
402
|
+
const requested = this.uploadProgress
|
|
403
|
+
?? this.Ctor.MINIMUM_UPLOAD_PROGRESS
|
|
404
|
+
|
|
405
|
+
return Math.min(
|
|
406
|
+
Math.max(requested, this.Ctor.MINIMUM_UPLOAD_PROGRESS),
|
|
407
|
+
this.Ctor.MAXIMUM_UPLOAD_PROGRESS
|
|
408
|
+
)
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Extract CSS class map for the root.
|
|
413
|
+
*
|
|
414
|
+
* @returns {Record<string, boolean>} Class map.
|
|
415
|
+
*/
|
|
416
|
+
extractRootClassNames () {
|
|
417
|
+
return Object.fromEntries([
|
|
418
|
+
['unit-attachment', true],
|
|
419
|
+
['image', this.hasImagePreview()],
|
|
420
|
+
['uploading', this.isUploading()],
|
|
421
|
+
])
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Extract attributes forwarded to the root element.
|
|
426
|
+
*
|
|
427
|
+
* @returns {Record<string, unknown>} Passthrough attributes.
|
|
428
|
+
*/
|
|
429
|
+
extractRootAttributes () {
|
|
430
|
+
const passthroughEntries = Object.entries(this.parcel ?? {})
|
|
431
|
+
.filter(([key]) => !FURO_ATTACHMENT_PARCEL_KEYS.has(key))
|
|
432
|
+
|
|
433
|
+
return Object.fromEntries(passthroughEntries)
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Extract the attributes that let the bar report its share.
|
|
438
|
+
*
|
|
439
|
+
* @returns {{
|
|
440
|
+
* role: 'progressbar'
|
|
441
|
+
* 'aria-label': string
|
|
442
|
+
* 'aria-valuemin': number
|
|
443
|
+
* 'aria-valuemax': number
|
|
444
|
+
* 'aria-valuenow'?: number
|
|
445
|
+
* }} Progress attributes.
|
|
446
|
+
*/
|
|
447
|
+
extractProgressAttributes () {
|
|
448
|
+
return {
|
|
449
|
+
role: 'progressbar',
|
|
450
|
+
'aria-label': this.uploadingLabel,
|
|
451
|
+
'aria-valuemin': this.Ctor.MINIMUM_UPLOAD_PROGRESS,
|
|
452
|
+
'aria-valuemax': this.Ctor.MAXIMUM_UPLOAD_PROGRESS,
|
|
453
|
+
...this.buildOptionalProgressAttributes(),
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Build the attributes an upload of unknown size cannot answer.
|
|
459
|
+
*
|
|
460
|
+
* @returns {{
|
|
461
|
+
* 'aria-valuenow'?: number
|
|
462
|
+
* }} Progress attributes.
|
|
463
|
+
*/
|
|
464
|
+
buildOptionalProgressAttributes () {
|
|
465
|
+
if (!this.isUploadMeasured()) {
|
|
466
|
+
return {}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return {
|
|
470
|
+
'aria-valuenow': this.calculateUploadProgress(),
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Extract inline style for the filled part of the bar.
|
|
476
|
+
*
|
|
477
|
+
* @returns {{
|
|
478
|
+
* width?: string
|
|
479
|
+
* }} Progress style.
|
|
480
|
+
*/
|
|
481
|
+
extractProgressStyle () {
|
|
482
|
+
if (!this.isUploadMeasured()) {
|
|
483
|
+
return {}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return {
|
|
487
|
+
width: `${this.calculateUploadProgress()}%`,
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Extract CSS class map for the filled part of the bar.
|
|
493
|
+
*
|
|
494
|
+
* @returns {Record<string, boolean>} Class map.
|
|
495
|
+
*/
|
|
496
|
+
extractProgressFillClassNames () {
|
|
497
|
+
return Object.fromEntries([
|
|
498
|
+
['fill', true],
|
|
499
|
+
['indeterminate', !this.isUploadMeasured()],
|
|
500
|
+
])
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Build the parcel handed to one action button.
|
|
505
|
+
*
|
|
506
|
+
* @returns {{
|
|
507
|
+
* variant: 'ghost'
|
|
508
|
+
* size: 'icon'
|
|
509
|
+
* }} Button parcel.
|
|
510
|
+
*/
|
|
511
|
+
buildActionParcel () {
|
|
512
|
+
return {
|
|
513
|
+
variant: 'ghost',
|
|
514
|
+
size: 'icon',
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Build the payload an action carries.
|
|
520
|
+
*
|
|
521
|
+
* @returns {FuroAttachmentEmitPayload} Payload.
|
|
522
|
+
*/
|
|
523
|
+
buildEmitPayload () {
|
|
524
|
+
return {
|
|
525
|
+
fileName: this.fileName,
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Handle the preview failing to load.
|
|
531
|
+
*/
|
|
532
|
+
onImagePreviewError () {
|
|
533
|
+
this.imagePreviewFailedRef.value = true
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Handle a click on the download action.
|
|
538
|
+
*/
|
|
539
|
+
onDownloadClick () {
|
|
540
|
+
this.emit(
|
|
541
|
+
this.EMIT_EVENT_NAME.DOWNLOAD,
|
|
542
|
+
this.buildEmitPayload()
|
|
543
|
+
)
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Handle a click on the remove action.
|
|
548
|
+
*/
|
|
549
|
+
onRemoveClick () {
|
|
550
|
+
this.emit(
|
|
551
|
+
this.EMIT_EVENT_NAME.REMOVE,
|
|
552
|
+
this.buildEmitPayload()
|
|
553
|
+
)
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* @typedef {import('../../../contexts/BaseFuroContext.js').BaseFuroContextParams & {
|
|
559
|
+
* props: Props
|
|
560
|
+
* componentContext: ComponentContext
|
|
561
|
+
* refHash: {
|
|
562
|
+
* imagePreviewFailedRef: import('vue').Ref<boolean>
|
|
563
|
+
* }
|
|
564
|
+
* }} FuroAttachmentContextParams
|
|
565
|
+
*/
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* @typedef {Omit<FuroAttachmentContextParams, 'refHash'> & {
|
|
569
|
+
* refHash?: FuroAttachmentContextParams['refHash']
|
|
570
|
+
* }} FuroAttachmentContextFactoryParams
|
|
571
|
+
*/
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* @typedef {keyof typeof FuroAttachmentContext.EMIT_EVENT_NAME} EmitEventName
|
|
575
|
+
*/
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* @typedef {{
|
|
579
|
+
* fileName: string
|
|
580
|
+
* }} FuroAttachmentEmitPayload
|
|
581
|
+
*/
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* @typedef {{
|
|
585
|
+
* parcel: FuroAttachmentParcel | null
|
|
586
|
+
* }} Props
|
|
587
|
+
*/
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* @typedef {{
|
|
591
|
+
* fileName?: string
|
|
592
|
+
* fileSize?: string
|
|
593
|
+
* imageSource?: string
|
|
594
|
+
* imageAlternativeText?: string
|
|
595
|
+
* iconName?: string
|
|
596
|
+
* uploading?: boolean
|
|
597
|
+
* uploadProgress?: number | null
|
|
598
|
+
* downloadable?: boolean
|
|
599
|
+
* removable?: boolean
|
|
600
|
+
* downloadLabel?: string
|
|
601
|
+
* removeLabel?: string
|
|
602
|
+
* uploadingLabel?: string
|
|
603
|
+
* }} FuroAttachmentParcel
|
|
604
|
+
*/
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @typedef {import('vue').SetupContext<FuroAttachmentEmitHash, FuroAttachmentSlots>} ComponentContext
|
|
608
|
+
*/
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* @typedef {typeof FuroAttachmentContext.EMIT_EVENT_HASH} FuroAttachmentEmitHash
|
|
612
|
+
*/
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* @typedef {import('vue').SlotsType<{
|
|
616
|
+
* glyph: {}
|
|
617
|
+
* actions: {}
|
|
618
|
+
* }>} FuroAttachmentSlots
|
|
619
|
+
*/
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* @typedef {(
|
|
623
|
+
* props: Props,
|
|
624
|
+
* componentContext: ComponentContext
|
|
625
|
+
* ) => {
|
|
626
|
+
* context: FuroAttachmentContext
|
|
627
|
+
* }} FuroAttachmentSetup
|
|
628
|
+
*/
|