@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,246 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import {
|
|
3
|
+
defineComponent,
|
|
4
|
+
} from 'vue'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Pagination as RekaPagination,
|
|
8
|
+
} from 'reka-ui/namespaced'
|
|
9
|
+
|
|
10
|
+
import FuroIcon from '../../atoms/FuroIcon/FuroIcon.vue'
|
|
11
|
+
import FuroPaginationContext from './FuroPaginationContext.js'
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
name: 'FuroPagination',
|
|
15
|
+
|
|
16
|
+
components: {
|
|
17
|
+
FuroIcon,
|
|
18
|
+
PaginationRoot: RekaPagination['Root'],
|
|
19
|
+
PaginationPrev: RekaPagination['Prev'],
|
|
20
|
+
PaginationNext: RekaPagination['Next'],
|
|
21
|
+
PaginationRange: RekaPagination['List'],
|
|
22
|
+
PaginationPage: RekaPagination['ListItem'],
|
|
23
|
+
PaginationEllipsis: RekaPagination['Ellipsis'],
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
inheritAttrs: false,
|
|
27
|
+
|
|
28
|
+
props: {
|
|
29
|
+
parcel: {
|
|
30
|
+
/** @type {import('vue').PropType<import('./FuroPaginationContext.js').Props['parcel']>} */
|
|
31
|
+
type: [
|
|
32
|
+
Object,
|
|
33
|
+
null,
|
|
34
|
+
],
|
|
35
|
+
default: null,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
slots: /** @type {import('./FuroPaginationContext.js').FuroPaginationSlots} */ (Object),
|
|
40
|
+
emits: FuroPaginationContext.EMIT_EVENT_HASH,
|
|
41
|
+
|
|
42
|
+
/** @type {import('./FuroPaginationContext.js').FuroPaginationSetup} */
|
|
43
|
+
setup (
|
|
44
|
+
props,
|
|
45
|
+
componentContext
|
|
46
|
+
) {
|
|
47
|
+
const context = FuroPaginationContext.create({
|
|
48
|
+
props,
|
|
49
|
+
componentContext,
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
context,
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<PaginationRoot
|
|
61
|
+
:class="context.extractRootClassNames()"
|
|
62
|
+
:page="context.extractPageValue()"
|
|
63
|
+
:items-per-page="context.extractLimit()"
|
|
64
|
+
:total="context.extractTotalRecords()"
|
|
65
|
+
:sibling-count="context.extractSiblingCount()"
|
|
66
|
+
:show-edges="context.shouldShowEdges()"
|
|
67
|
+
:disabled="context.isDisabled()"
|
|
68
|
+
v-bind="$attrs"
|
|
69
|
+
@update:page="context.onPageChange({
|
|
70
|
+
page: $event,
|
|
71
|
+
})"
|
|
72
|
+
>
|
|
73
|
+
<PaginationPrev class="previous">
|
|
74
|
+
<slot name="previous">
|
|
75
|
+
<FuroIcon
|
|
76
|
+
name="ph:caret-left"
|
|
77
|
+
class="icon"
|
|
78
|
+
/>
|
|
79
|
+
</slot>
|
|
80
|
+
</PaginationPrev>
|
|
81
|
+
|
|
82
|
+
<PaginationRange
|
|
83
|
+
v-slot="{ items: pages }"
|
|
84
|
+
class="pages"
|
|
85
|
+
>
|
|
86
|
+
<template
|
|
87
|
+
v-for="(entry, index) in pages"
|
|
88
|
+
:key="index"
|
|
89
|
+
>
|
|
90
|
+
<PaginationPage
|
|
91
|
+
v-if="context.isPageEntry({ entry })"
|
|
92
|
+
class="page"
|
|
93
|
+
:value="context.extractEntryPage({ entry })"
|
|
94
|
+
:as-child="context.hasPageSlot()"
|
|
95
|
+
>
|
|
96
|
+
<slot
|
|
97
|
+
name="page"
|
|
98
|
+
:page="context.extractEntryPage({ entry })"
|
|
99
|
+
>
|
|
100
|
+
{{ context.extractEntryPage({ entry }) }}
|
|
101
|
+
</slot>
|
|
102
|
+
</PaginationPage>
|
|
103
|
+
|
|
104
|
+
<PaginationEllipsis
|
|
105
|
+
v-else
|
|
106
|
+
class="ellipsis"
|
|
107
|
+
>
|
|
108
|
+
<slot name="ellipsis">
|
|
109
|
+
<FuroIcon
|
|
110
|
+
name="ph:dots-three"
|
|
111
|
+
class="icon"
|
|
112
|
+
/>
|
|
113
|
+
</slot>
|
|
114
|
+
</PaginationEllipsis>
|
|
115
|
+
</template>
|
|
116
|
+
</PaginationRange>
|
|
117
|
+
|
|
118
|
+
<PaginationNext class="next">
|
|
119
|
+
<slot name="next">
|
|
120
|
+
<FuroIcon
|
|
121
|
+
name="ph:caret-right"
|
|
122
|
+
class="icon"
|
|
123
|
+
/>
|
|
124
|
+
</slot>
|
|
125
|
+
</PaginationNext>
|
|
126
|
+
</PaginationRoot>
|
|
127
|
+
</template>
|
|
128
|
+
|
|
129
|
+
<style>
|
|
130
|
+
@layer furo {
|
|
131
|
+
.unit-pagination {
|
|
132
|
+
display: flex;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
align-items: center;
|
|
135
|
+
gap: var(--size-space-tiny);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.unit-pagination.disabled {
|
|
139
|
+
opacity: 0.5;
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.unit-pagination > .pages {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: var(--size-space-tiny);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.unit-pagination .page {
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
|
|
154
|
+
min-width: 2rem;
|
|
155
|
+
height: 2rem;
|
|
156
|
+
|
|
157
|
+
border: none;
|
|
158
|
+
border-radius: var(--size-border-radius-small);
|
|
159
|
+
|
|
160
|
+
padding-block: 0;
|
|
161
|
+
padding-inline: 0.5rem;
|
|
162
|
+
|
|
163
|
+
background-color: transparent;
|
|
164
|
+
color: var(--color-foreground);
|
|
165
|
+
font: var(--font-label-small);
|
|
166
|
+
font-variant-numeric: tabular-nums;
|
|
167
|
+
text-decoration: none;
|
|
168
|
+
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
|
|
171
|
+
appearance: none;
|
|
172
|
+
|
|
173
|
+
transition-duration: var(--transition-timer);
|
|
174
|
+
transition-property: background-color, color;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.unit-pagination .page:hover {
|
|
178
|
+
background-color: var(--color-accent);
|
|
179
|
+
color: var(--color-accent-foreground);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.unit-pagination .page[data-selected] {
|
|
183
|
+
background-color: var(--color-primary);
|
|
184
|
+
color: var(--color-primary-foreground);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.unit-pagination .page:focus-visible {
|
|
188
|
+
outline: none;
|
|
189
|
+
box-shadow: 0 0 0 0.125rem var(--color-ring);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.unit-pagination :where(.previous, .next) {
|
|
193
|
+
display: inline-flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
justify-content: center;
|
|
196
|
+
|
|
197
|
+
width: 2rem;
|
|
198
|
+
height: 2rem;
|
|
199
|
+
|
|
200
|
+
border: none;
|
|
201
|
+
border-radius: var(--size-border-radius-small);
|
|
202
|
+
|
|
203
|
+
background-color: transparent;
|
|
204
|
+
color: var(--color-foreground);
|
|
205
|
+
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
|
|
208
|
+
appearance: none;
|
|
209
|
+
|
|
210
|
+
transition-duration: var(--transition-timer);
|
|
211
|
+
transition-property: background-color, color;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.unit-pagination :where(.previous, .next):hover {
|
|
215
|
+
background-color: var(--color-accent);
|
|
216
|
+
color: var(--color-accent-foreground);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.unit-pagination :where(.previous, .next):focus-visible {
|
|
220
|
+
outline: none;
|
|
221
|
+
box-shadow: 0 0 0 0.125rem var(--color-ring);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.unit-pagination :where(.previous, .next):disabled {
|
|
225
|
+
color: var(--color-muted-foreground);
|
|
226
|
+
cursor: not-allowed;
|
|
227
|
+
pointer-events: none;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.unit-pagination .ellipsis {
|
|
231
|
+
display: inline-flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
justify-content: center;
|
|
234
|
+
|
|
235
|
+
width: 2rem;
|
|
236
|
+
height: 2rem;
|
|
237
|
+
|
|
238
|
+
color: var(--color-muted-foreground);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.unit-pagination .icon {
|
|
242
|
+
width: 1rem;
|
|
243
|
+
height: 1rem;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
</style>
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
} from 'vue'
|
|
4
|
+
|
|
5
|
+
import BaseFuroContext from '../../../contexts/BaseFuroContext.js'
|
|
6
|
+
|
|
7
|
+
const DEFAULT_LIMIT = 20
|
|
8
|
+
const DEFAULT_TOTAL_RECORDS = 0
|
|
9
|
+
const DEFAULT_SIBLING_COUNT = 2
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Context class for FuroPagination organism.
|
|
13
|
+
*
|
|
14
|
+
* @extends {BaseFuroContext<null, Props, EmitEventName>}
|
|
15
|
+
*/
|
|
16
|
+
export default class FuroPaginationContext extends BaseFuroContext {
|
|
17
|
+
/**
|
|
18
|
+
* Constructor.
|
|
19
|
+
*
|
|
20
|
+
* @param {FuroPaginationContextParams} params - Parameters of this constructor.
|
|
21
|
+
*/
|
|
22
|
+
constructor ({
|
|
23
|
+
props,
|
|
24
|
+
componentContext,
|
|
25
|
+
|
|
26
|
+
refHash,
|
|
27
|
+
}) {
|
|
28
|
+
super({
|
|
29
|
+
props,
|
|
30
|
+
componentContext,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
this.refHash = refHash
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Factory method.
|
|
38
|
+
*
|
|
39
|
+
* @template {X extends typeof FuroPaginationContext ? X : never} T, X
|
|
40
|
+
* @override
|
|
41
|
+
* @param {FuroPaginationContextFactoryParams} params - Parameters of this factory method.
|
|
42
|
+
* @returns {InstanceType<T>} An instance of this class.
|
|
43
|
+
* @this {T}
|
|
44
|
+
*/
|
|
45
|
+
static create ({
|
|
46
|
+
props,
|
|
47
|
+
componentContext,
|
|
48
|
+
|
|
49
|
+
refHash = this.buildRefHash(),
|
|
50
|
+
}) {
|
|
51
|
+
return /** @type {InstanceType<T>} */ (
|
|
52
|
+
new this({
|
|
53
|
+
props,
|
|
54
|
+
componentContext,
|
|
55
|
+
|
|
56
|
+
refHash,
|
|
57
|
+
})
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Build ref hash.
|
|
63
|
+
*
|
|
64
|
+
* @override
|
|
65
|
+
* @returns {FuroPaginationContextParams['refHash']}
|
|
66
|
+
*/
|
|
67
|
+
static buildRefHash () {
|
|
68
|
+
return {
|
|
69
|
+
pageRef: ref(1),
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get emit event name.
|
|
75
|
+
*
|
|
76
|
+
* @override
|
|
77
|
+
* @returns {Readonly<{
|
|
78
|
+
* PAGE_CHANGE: 'page:change'
|
|
79
|
+
* UPDATE_PAGE: 'update:page'
|
|
80
|
+
* }>}
|
|
81
|
+
*/
|
|
82
|
+
static get EMIT_EVENT_NAME () {
|
|
83
|
+
return {
|
|
84
|
+
PAGE_CHANGE: 'page:change',
|
|
85
|
+
UPDATE_PAGE: 'update:page',
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get emit options.
|
|
91
|
+
*
|
|
92
|
+
* @returns {{
|
|
93
|
+
* 'page:change': (payload: {
|
|
94
|
+
* page: number
|
|
95
|
+
* offset: number
|
|
96
|
+
* limit: number
|
|
97
|
+
* }) => void
|
|
98
|
+
* 'update:page': (page: number) => void
|
|
99
|
+
* }}
|
|
100
|
+
*/
|
|
101
|
+
static get EMIT_EVENT_HASH () {
|
|
102
|
+
return {
|
|
103
|
+
[this.EMIT_EVENT_NAME.PAGE_CHANGE]: payload => {},
|
|
104
|
+
[this.EMIT_EVENT_NAME.UPDATE_PAGE]: payload => {},
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* get: Constructor of this class.
|
|
110
|
+
*
|
|
111
|
+
* @override
|
|
112
|
+
* @returns {typeof FuroPaginationContext}
|
|
113
|
+
*/
|
|
114
|
+
get Ctor () {
|
|
115
|
+
return /** @type {typeof FuroPaginationContext} */ (
|
|
116
|
+
this.constructor
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Get internal page ref (uncontrolled mode).
|
|
122
|
+
*
|
|
123
|
+
* @returns {import('vue').Ref<number>}
|
|
124
|
+
*/
|
|
125
|
+
get pageRef () {
|
|
126
|
+
return this.refHash.pageRef
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Parcel passed from parent via props.
|
|
131
|
+
*
|
|
132
|
+
* @override
|
|
133
|
+
* @returns {NonNullable<Props['parcel']>}
|
|
134
|
+
*/
|
|
135
|
+
get parcel () {
|
|
136
|
+
return {
|
|
137
|
+
page: null,
|
|
138
|
+
offset: null,
|
|
139
|
+
limit: DEFAULT_LIMIT,
|
|
140
|
+
totalRecords: DEFAULT_TOTAL_RECORDS,
|
|
141
|
+
siblingCount: DEFAULT_SIBLING_COUNT,
|
|
142
|
+
showEdges: true,
|
|
143
|
+
disabled: false,
|
|
144
|
+
...this.props.parcel,
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Whether the current page is controlled via `parcel.page`.
|
|
150
|
+
*
|
|
151
|
+
* @returns {boolean}
|
|
152
|
+
*/
|
|
153
|
+
isPageControlled () {
|
|
154
|
+
return (this.parcel?.page ?? null) !== null
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Whether the current page is controlled via `parcel.offset`
|
|
159
|
+
* (offset/limit-style state, e.g. GraphQL pagination).
|
|
160
|
+
*
|
|
161
|
+
* @returns {boolean}
|
|
162
|
+
*/
|
|
163
|
+
isOffsetControlled () {
|
|
164
|
+
return (this.parcel?.offset ?? null) !== null
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Whether the page is controlled by the parent (via `page` or `offset`).
|
|
169
|
+
*
|
|
170
|
+
* @returns {boolean}
|
|
171
|
+
*/
|
|
172
|
+
isControlled () {
|
|
173
|
+
return this.isPageControlled()
|
|
174
|
+
|| this.isOffsetControlled()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Whether controlled `page` and `offset` are both set but disagree
|
|
179
|
+
* (i.e. `offset` is not the offset of `page`).
|
|
180
|
+
*
|
|
181
|
+
* @returns {boolean}
|
|
182
|
+
*/
|
|
183
|
+
hasControlledConflict () {
|
|
184
|
+
if (!this.isPageControlled()) {
|
|
185
|
+
return false
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (!this.isOffsetControlled()) {
|
|
189
|
+
return false
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const page = Number(this.parcel?.page)
|
|
193
|
+
const offset = Number(this.parcel?.offset)
|
|
194
|
+
|
|
195
|
+
return offset !== this.generateOffset({
|
|
196
|
+
page,
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Fail when controlled `page` and `offset` disagree. Production keeps letting
|
|
202
|
+
* `page` win and ignores the mismatched `offset`.
|
|
203
|
+
*
|
|
204
|
+
* @returns {void}
|
|
205
|
+
* @throws {Error} When controlled `page` and `offset` disagree.
|
|
206
|
+
*/
|
|
207
|
+
throwOnControlledConflict () {
|
|
208
|
+
if (process.env.NODE_ENV === 'production') {
|
|
209
|
+
return
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (!this.hasControlledConflict()) {
|
|
213
|
+
return
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const page = this.parcel?.page
|
|
217
|
+
const offset = this.parcel?.offset
|
|
218
|
+
|
|
219
|
+
throw new Error(`[FuroPagination] \`parcel.page\` (${page}) and \`parcel.offset\` (${offset}) are both set but disagree. Provide only one to avoid divergence.`)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Whether the whole pagination control is disabled.
|
|
224
|
+
*
|
|
225
|
+
* @returns {boolean}
|
|
226
|
+
*/
|
|
227
|
+
isDisabled () {
|
|
228
|
+
const disabledByParcel = Boolean(this.parcel?.disabled)
|
|
229
|
+
const disabledByAttrs = this.hasBooleanAttribute({ name: 'disabled' })
|
|
230
|
+
|
|
231
|
+
return disabledByParcel || disabledByAttrs
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Whether the first and last pages stay pinned with ellipsis gaps.
|
|
236
|
+
*
|
|
237
|
+
* @returns {boolean}
|
|
238
|
+
*/
|
|
239
|
+
shouldShowEdges () {
|
|
240
|
+
return this.parcel?.showEdges !== false
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Resolve the current page for the root host element.
|
|
245
|
+
* `page` takes precedence over `offset` when both are provided.
|
|
246
|
+
*
|
|
247
|
+
* @returns {number}
|
|
248
|
+
*/
|
|
249
|
+
extractPageValue () {
|
|
250
|
+
this.throwOnControlledConflict()
|
|
251
|
+
|
|
252
|
+
if (this.isPageControlled()) {
|
|
253
|
+
return Number(this.parcel?.page)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (this.isOffsetControlled()) {
|
|
257
|
+
return this.generatePageFromOffset({
|
|
258
|
+
offset: Number(this.parcel?.offset),
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return this.pageRef.value
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Resolve the number of records per page.
|
|
267
|
+
*
|
|
268
|
+
* @returns {number}
|
|
269
|
+
*/
|
|
270
|
+
extractLimit () {
|
|
271
|
+
return this.parcel?.limit
|
|
272
|
+
?? DEFAULT_LIMIT
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Resolve the total record count.
|
|
277
|
+
*
|
|
278
|
+
* @returns {number}
|
|
279
|
+
*/
|
|
280
|
+
extractTotalRecords () {
|
|
281
|
+
return this.parcel?.totalRecords
|
|
282
|
+
?? DEFAULT_TOTAL_RECORDS
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Resolve how many sibling pages render on each side of the current page.
|
|
287
|
+
*
|
|
288
|
+
* @returns {number}
|
|
289
|
+
*/
|
|
290
|
+
extractSiblingCount () {
|
|
291
|
+
return this.parcel?.siblingCount
|
|
292
|
+
?? DEFAULT_SIBLING_COUNT
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Extract root class names.
|
|
297
|
+
*
|
|
298
|
+
* @returns {Record<string, boolean>}
|
|
299
|
+
*/
|
|
300
|
+
extractRootClassNames () {
|
|
301
|
+
return {
|
|
302
|
+
'unit-pagination': true,
|
|
303
|
+
disabled: this.isDisabled(),
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Whether a rendered range entry is a page button (vs. an ellipsis gap).
|
|
309
|
+
*
|
|
310
|
+
* @param {{
|
|
311
|
+
* entry: {
|
|
312
|
+
* type: string
|
|
313
|
+
* value?: number
|
|
314
|
+
* }
|
|
315
|
+
* }} params
|
|
316
|
+
* @returns {boolean}
|
|
317
|
+
*/
|
|
318
|
+
isPageEntry ({
|
|
319
|
+
entry,
|
|
320
|
+
}) {
|
|
321
|
+
return entry.type === 'page'
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Extract the page number from a range entry.
|
|
326
|
+
*
|
|
327
|
+
* @param {{
|
|
328
|
+
* entry: {
|
|
329
|
+
* type: string
|
|
330
|
+
* value?: number
|
|
331
|
+
* }
|
|
332
|
+
* }} params
|
|
333
|
+
* @returns {number}
|
|
334
|
+
*/
|
|
335
|
+
extractEntryPage ({
|
|
336
|
+
entry,
|
|
337
|
+
}) {
|
|
338
|
+
return entry.value
|
|
339
|
+
?? 0
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Whether the consumer provides a custom per-page slot (e.g. anchor links).
|
|
344
|
+
*
|
|
345
|
+
* @returns {boolean}
|
|
346
|
+
*/
|
|
347
|
+
hasPageSlot () {
|
|
348
|
+
return Boolean(this.componentContext.slots?.page)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Generate the zero-based record offset for a page.
|
|
353
|
+
* Convenience for offset/limit-style data sources (e.g. GraphQL pagination).
|
|
354
|
+
*
|
|
355
|
+
* @param {{
|
|
356
|
+
* page: number
|
|
357
|
+
* }} params
|
|
358
|
+
* @returns {number}
|
|
359
|
+
*/
|
|
360
|
+
generateOffset ({
|
|
361
|
+
page,
|
|
362
|
+
}) {
|
|
363
|
+
return (page - 1) * this.extractLimit()
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Generate the 1-based page that contains a given zero-based offset.
|
|
368
|
+
* Inverse of {@link generateOffset} for offset/limit-style state.
|
|
369
|
+
*
|
|
370
|
+
* @param {{
|
|
371
|
+
* offset: number
|
|
372
|
+
* }} params
|
|
373
|
+
* @returns {number}
|
|
374
|
+
*/
|
|
375
|
+
generatePageFromOffset ({
|
|
376
|
+
offset,
|
|
377
|
+
}) {
|
|
378
|
+
const limit = this.extractLimit()
|
|
379
|
+
|
|
380
|
+
if (limit <= 0) {
|
|
381
|
+
return 1
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return Math.floor(offset / limit) + 1
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Handle page updates from the root host element.
|
|
389
|
+
*
|
|
390
|
+
* @param {{
|
|
391
|
+
* page: number
|
|
392
|
+
* }} params
|
|
393
|
+
*/
|
|
394
|
+
onPageChange ({
|
|
395
|
+
page,
|
|
396
|
+
}) {
|
|
397
|
+
if (!this.isControlled()) {
|
|
398
|
+
this.pageRef.value = page
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const limit = this.extractLimit()
|
|
402
|
+
const offset = this.generateOffset({
|
|
403
|
+
page,
|
|
404
|
+
})
|
|
405
|
+
|
|
406
|
+
this.emit(
|
|
407
|
+
this.EMIT_EVENT_NAME.UPDATE_PAGE,
|
|
408
|
+
page
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
this.emit(
|
|
412
|
+
this.EMIT_EVENT_NAME.PAGE_CHANGE,
|
|
413
|
+
{
|
|
414
|
+
page,
|
|
415
|
+
offset,
|
|
416
|
+
limit,
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @typedef {import('../../../contexts/BaseFuroContext.js').BaseFuroContextParams & {
|
|
424
|
+
* props: Props
|
|
425
|
+
* componentContext: ComponentContext
|
|
426
|
+
* refHash: {
|
|
427
|
+
* pageRef: import('vue').Ref<number>
|
|
428
|
+
* }
|
|
429
|
+
* }} FuroPaginationContextParams
|
|
430
|
+
*/
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @typedef {Omit<FuroPaginationContextParams, 'refHash'> & {
|
|
434
|
+
* refHash?: FuroPaginationContextParams['refHash']
|
|
435
|
+
* }} FuroPaginationContextFactoryParams
|
|
436
|
+
*/
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* @typedef {keyof typeof FuroPaginationContext.EMIT_EVENT_NAME} EmitEventName
|
|
440
|
+
*/
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* @typedef {import('vue').HTMLAttributes & {
|
|
444
|
+
* parcel?: FuroPaginationParcel | null
|
|
445
|
+
* }} Props
|
|
446
|
+
*/
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Closed-set Furo behavior for `<FuroPagination>`.
|
|
450
|
+
* JSON-serializable only. Not an open passthrough to the internal pagination primitive.
|
|
451
|
+
*
|
|
452
|
+
* @typedef {{
|
|
453
|
+
* page?: number | null
|
|
454
|
+
* offset?: number | null
|
|
455
|
+
* limit?: number
|
|
456
|
+
* totalRecords?: number
|
|
457
|
+
* siblingCount?: number
|
|
458
|
+
* showEdges?: boolean
|
|
459
|
+
* disabled?: boolean
|
|
460
|
+
* }} FuroPaginationParcel
|
|
461
|
+
*/
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @typedef {import('vue').SetupContext<FuroPaginationEmitHash, FuroPaginationSlots>} ComponentContext
|
|
465
|
+
*/
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* @typedef {typeof FuroPaginationContext.EMIT_EVENT_HASH} FuroPaginationEmitHash
|
|
469
|
+
*/
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* @typedef {import('vue').SlotsType<{
|
|
473
|
+
* previous: {}
|
|
474
|
+
* next: {}
|
|
475
|
+
* ellipsis: {}
|
|
476
|
+
* page: {
|
|
477
|
+
* page: number
|
|
478
|
+
* }
|
|
479
|
+
* }>} FuroPaginationSlots
|
|
480
|
+
*/
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* @typedef {(
|
|
484
|
+
* props: Props,
|
|
485
|
+
* componentContext: ComponentContext
|
|
486
|
+
* ) => {
|
|
487
|
+
* context: FuroPaginationContext
|
|
488
|
+
* }} FuroPaginationSetup
|
|
489
|
+
*/
|