@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,840 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
} from 'vue'
|
|
4
|
+
|
|
5
|
+
import BaseFuroContext from '../../../contexts/BaseFuroContext.js'
|
|
6
|
+
|
|
7
|
+
import DateTimePickerEmitPayload from './DateTimePickerEmitPayload.js'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Furo-only parcel keys that are not forwarded to the composed date atom.
|
|
11
|
+
* The molecule owns these and derives the child parcels explicitly.
|
|
12
|
+
*/
|
|
13
|
+
export const FURO_DATE_TIME_PICKER_PARCEL_KEYS = new Set([
|
|
14
|
+
'value',
|
|
15
|
+
'invalid',
|
|
16
|
+
'placeholder',
|
|
17
|
+
'disabled',
|
|
18
|
+
'minValue',
|
|
19
|
+
'maxValue',
|
|
20
|
+
'timezone',
|
|
21
|
+
'granularity',
|
|
22
|
+
'step',
|
|
23
|
+
'timeFormat',
|
|
24
|
+
])
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Default time part used to recombine when only a date is present but a complete
|
|
28
|
+
* value is requested. The molecule never fabricates this into an emit (Q2) — it is
|
|
29
|
+
* only the seconds-padding default for the wire format (Q4).
|
|
30
|
+
*/
|
|
31
|
+
const DEFAULT_TIME_SECONDS = '00'
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Time part fabricated the first time a date is selected without an existing time, so the
|
|
35
|
+
* combined value becomes complete immediately while the popover stays open for the user to
|
|
36
|
+
* refine the time (UAT decision: default to noon).
|
|
37
|
+
*/
|
|
38
|
+
const DEFAULT_TIME_PART = '12:00:00'
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Context class for managing FuroDateTimePicker molecule.
|
|
42
|
+
*
|
|
43
|
+
* Composes `FuroDatePicker` (calendar) and `FuroTimeField` (segmented time) into a
|
|
44
|
+
* single popover and exposes one combined `v-model:value` as a canonical
|
|
45
|
+
* `YYYY-MM-DDTHH:MM:SS` string (timezone-naive v1).
|
|
46
|
+
*
|
|
47
|
+
* @extends {BaseFuroContext<null, Props, EmitEventName>}
|
|
48
|
+
*/
|
|
49
|
+
export default class FuroDateTimePickerContext extends BaseFuroContext {
|
|
50
|
+
/**
|
|
51
|
+
* Constructor.
|
|
52
|
+
*
|
|
53
|
+
* @param {FuroDateTimePickerContextParams} params - Parameters of this constructor.
|
|
54
|
+
*/
|
|
55
|
+
constructor ({
|
|
56
|
+
props,
|
|
57
|
+
componentContext,
|
|
58
|
+
refHash,
|
|
59
|
+
}) {
|
|
60
|
+
super({
|
|
61
|
+
props,
|
|
62
|
+
componentContext,
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
this.refHash = refHash
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Factory method.
|
|
70
|
+
*
|
|
71
|
+
* @template {X extends typeof FuroDateTimePickerContext ? X : never} T, X
|
|
72
|
+
* @override
|
|
73
|
+
* @param {FuroDateTimePickerContextFactoryParams} params - Parameters of this factory method.
|
|
74
|
+
* @returns {InstanceType<T>} An instance of this class.
|
|
75
|
+
* @this {T}
|
|
76
|
+
*/
|
|
77
|
+
static create ({
|
|
78
|
+
props,
|
|
79
|
+
componentContext,
|
|
80
|
+
refHash = this.buildRefHash(),
|
|
81
|
+
}) {
|
|
82
|
+
return /** @type {InstanceType<T>} */ (
|
|
83
|
+
new this({
|
|
84
|
+
props,
|
|
85
|
+
componentContext,
|
|
86
|
+
refHash,
|
|
87
|
+
})
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Build ref hash.
|
|
93
|
+
*
|
|
94
|
+
* @override
|
|
95
|
+
* @returns {FuroDateTimePickerContextParams['refHash']}
|
|
96
|
+
*/
|
|
97
|
+
static buildRefHash () {
|
|
98
|
+
return {
|
|
99
|
+
rootElementRef: ref(null),
|
|
100
|
+
datePartRef: ref(null),
|
|
101
|
+
timePartRef: ref(null),
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Get emit event names.
|
|
107
|
+
*
|
|
108
|
+
* @override
|
|
109
|
+
* @returns {Readonly<{
|
|
110
|
+
* CHANGE_VALUE: 'change-value'
|
|
111
|
+
* COMMIT_VALUE: 'commit-value'
|
|
112
|
+
* UPDATE_VALUE: 'update:value'
|
|
113
|
+
* }>}
|
|
114
|
+
*/
|
|
115
|
+
static get EMIT_EVENT_NAME () {
|
|
116
|
+
return {
|
|
117
|
+
CHANGE_VALUE: 'change-value',
|
|
118
|
+
COMMIT_VALUE: 'commit-value',
|
|
119
|
+
UPDATE_VALUE: 'update:value',
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Get emit event hash.
|
|
125
|
+
*
|
|
126
|
+
* @returns {{
|
|
127
|
+
* 'change-value': (payload: import('./DateTimePickerEmitPayload.js').default) => void
|
|
128
|
+
* 'commit-value': (payload: import('./DateTimePickerEmitPayload.js').default) => void
|
|
129
|
+
* 'update:value': (value: string | null) => void
|
|
130
|
+
* }}
|
|
131
|
+
*/
|
|
132
|
+
static get EMIT_EVENT_HASH () {
|
|
133
|
+
return {
|
|
134
|
+
[this.EMIT_EVENT_NAME.CHANGE_VALUE]: payload => {},
|
|
135
|
+
[this.EMIT_EVENT_NAME.COMMIT_VALUE]: payload => {},
|
|
136
|
+
[this.EMIT_EVENT_NAME.UPDATE_VALUE]: value => {},
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Get the EmitPayload constructor.
|
|
142
|
+
*
|
|
143
|
+
* @returns {typeof DateTimePickerEmitPayload}
|
|
144
|
+
*/
|
|
145
|
+
static get EmitPayloadCtor () {
|
|
146
|
+
return DateTimePickerEmitPayload
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Split a combined ISO `YYYY-MM-DDTHH:MM:SS` string into its date and time parts.
|
|
151
|
+
* Returns `null` parts for any value that does not contain the matching segment.
|
|
152
|
+
*
|
|
153
|
+
* @param {{
|
|
154
|
+
* value: string | null
|
|
155
|
+
* }} params - Parameters of this method.
|
|
156
|
+
* @returns {{
|
|
157
|
+
* datePart: string | null
|
|
158
|
+
* timePart: string | null
|
|
159
|
+
* }}
|
|
160
|
+
*/
|
|
161
|
+
static splitValue ({
|
|
162
|
+
value,
|
|
163
|
+
}) {
|
|
164
|
+
if (!value) {
|
|
165
|
+
return {
|
|
166
|
+
datePart: null,
|
|
167
|
+
timePart: null,
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const [
|
|
172
|
+
datePartRaw,
|
|
173
|
+
timePartRaw = null,
|
|
174
|
+
] = value.split('T')
|
|
175
|
+
|
|
176
|
+
const datePart = this.blankToNull({ segment: datePartRaw })
|
|
177
|
+
const timePart = this.blankToNull({ segment: timePartRaw })
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
datePart,
|
|
181
|
+
timePart,
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Normalize a blank (empty / nullish) string segment to `null`.
|
|
187
|
+
*
|
|
188
|
+
* @param {{
|
|
189
|
+
* segment: string | null
|
|
190
|
+
* }} params - Parameters of this method.
|
|
191
|
+
* @returns {string | null}
|
|
192
|
+
*/
|
|
193
|
+
static blankToNull ({
|
|
194
|
+
segment,
|
|
195
|
+
}) {
|
|
196
|
+
if (!segment) {
|
|
197
|
+
return null
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return segment
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Combine a date part and a time part into a canonical `YYYY-MM-DDTHH:MM:SS` string.
|
|
205
|
+
* Returns `null` until BOTH parts are present (Q2 — never fabricates a default time).
|
|
206
|
+
* The time part is normalized to second precision (`HH:MM:SS`, seconds default `00` — Q4).
|
|
207
|
+
*
|
|
208
|
+
* @param {{
|
|
209
|
+
* datePart: string | null
|
|
210
|
+
* timePart: string | null
|
|
211
|
+
* }} params - Parameters of this method.
|
|
212
|
+
* @returns {string | null}
|
|
213
|
+
*/
|
|
214
|
+
static combineValue ({
|
|
215
|
+
datePart,
|
|
216
|
+
timePart,
|
|
217
|
+
}) {
|
|
218
|
+
if (
|
|
219
|
+
!datePart
|
|
220
|
+
|| !timePart
|
|
221
|
+
) {
|
|
222
|
+
return null
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const normalizedTime = this.normalizeTimeToSeconds({ timePart })
|
|
226
|
+
|
|
227
|
+
return `${datePart}T${normalizedTime}`
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Pad a time part to second precision (`HH:MM` → `HH:MM:SS`).
|
|
232
|
+
*
|
|
233
|
+
* @param {{
|
|
234
|
+
* timePart: string
|
|
235
|
+
* }} params - Parameters of this method.
|
|
236
|
+
* @returns {string}
|
|
237
|
+
*/
|
|
238
|
+
static normalizeTimeToSeconds ({
|
|
239
|
+
timePart,
|
|
240
|
+
}) {
|
|
241
|
+
const segments = timePart.split(':')
|
|
242
|
+
|
|
243
|
+
const hour = segments[0] ?? '00'
|
|
244
|
+
const minute = segments[1] ?? '00'
|
|
245
|
+
const second = segments[2] ?? DEFAULT_TIME_SECONDS
|
|
246
|
+
|
|
247
|
+
return [
|
|
248
|
+
hour,
|
|
249
|
+
minute,
|
|
250
|
+
second,
|
|
251
|
+
].join(':')
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Get the constructor of this class.
|
|
256
|
+
*
|
|
257
|
+
* @override
|
|
258
|
+
* @returns {typeof FuroDateTimePickerContext}
|
|
259
|
+
*/
|
|
260
|
+
get Ctor () {
|
|
261
|
+
return /** @type {typeof FuroDateTimePickerContext} */ (this.constructor)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Get root element ref.
|
|
266
|
+
*
|
|
267
|
+
* @returns {import('vue').Ref<HTMLElement | null>}
|
|
268
|
+
*/
|
|
269
|
+
get rootElementRef () {
|
|
270
|
+
return this.refHash.rootElementRef
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Get the current date part ref (`YYYY-MM-DD` | `null`).
|
|
275
|
+
*
|
|
276
|
+
* @returns {import('vue').Ref<string | null>}
|
|
277
|
+
*/
|
|
278
|
+
get datePartRef () {
|
|
279
|
+
return this.refHash.datePartRef
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Get the current time part ref (`HH:MM:SS` | `null`).
|
|
284
|
+
*
|
|
285
|
+
* @returns {import('vue').Ref<string | null>}
|
|
286
|
+
*/
|
|
287
|
+
get timePartRef () {
|
|
288
|
+
return this.refHash.timePartRef
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Parcel passed from parent via props.
|
|
293
|
+
*
|
|
294
|
+
* @override
|
|
295
|
+
* @returns {Props['parcel']}
|
|
296
|
+
*/
|
|
297
|
+
get parcel () {
|
|
298
|
+
return this.props.parcel
|
|
299
|
+
?? null
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Current date part (`YYYY-MM-DD` | `null`).
|
|
304
|
+
*
|
|
305
|
+
* @returns {string | null}
|
|
306
|
+
*/
|
|
307
|
+
get datePart () {
|
|
308
|
+
return this.datePartRef.value
|
|
309
|
+
?? null
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Current time part (`HH:MM:SS` | `null`).
|
|
314
|
+
*
|
|
315
|
+
* @returns {string | null}
|
|
316
|
+
*/
|
|
317
|
+
get timePart () {
|
|
318
|
+
return this.timePartRef.value
|
|
319
|
+
?? null
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Placeholder text.
|
|
324
|
+
*
|
|
325
|
+
* @returns {string}
|
|
326
|
+
*/
|
|
327
|
+
get placeholder () {
|
|
328
|
+
return this.parcel?.placeholder
|
|
329
|
+
?? ''
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* IANA timezone identifier forwarded to both atoms (naive v1; atoms own normalization).
|
|
334
|
+
*
|
|
335
|
+
* @returns {string | null}
|
|
336
|
+
*/
|
|
337
|
+
get timezone () {
|
|
338
|
+
return this.parcel?.timezone
|
|
339
|
+
?? null
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Segment granularity forwarded to the time atom (`hour` | `minute` | `second`).
|
|
344
|
+
*
|
|
345
|
+
* @returns {string | null}
|
|
346
|
+
*/
|
|
347
|
+
get granularity () {
|
|
348
|
+
return this.parcel?.granularity
|
|
349
|
+
?? null
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Step amount forwarded to the time atom's steppers.
|
|
354
|
+
*
|
|
355
|
+
* @returns {number | null}
|
|
356
|
+
*/
|
|
357
|
+
get step () {
|
|
358
|
+
return this.parcel?.step
|
|
359
|
+
?? null
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Time format (12 or 24) forwarded to the time atom.
|
|
364
|
+
*
|
|
365
|
+
* @returns {number | null}
|
|
366
|
+
*/
|
|
367
|
+
get timeFormat () {
|
|
368
|
+
return this.parcel?.timeFormat
|
|
369
|
+
?? null
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Combined minimum datetime (`YYYY-MM-DDTHH:MM:SS` | `null`).
|
|
374
|
+
*
|
|
375
|
+
* @returns {string | null}
|
|
376
|
+
*/
|
|
377
|
+
get minValue () {
|
|
378
|
+
return this.parcel?.minValue
|
|
379
|
+
?? null
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Combined maximum datetime (`YYYY-MM-DDTHH:MM:SS` | `null`).
|
|
384
|
+
*
|
|
385
|
+
* @returns {string | null}
|
|
386
|
+
*/
|
|
387
|
+
get maxValue () {
|
|
388
|
+
return this.parcel?.maxValue
|
|
389
|
+
?? null
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Whether the control is in an invalid state.
|
|
394
|
+
*
|
|
395
|
+
* @returns {boolean}
|
|
396
|
+
*/
|
|
397
|
+
get isInvalid () {
|
|
398
|
+
return this.parcel?.invalid
|
|
399
|
+
?? false
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Whether the control is disabled.
|
|
404
|
+
*
|
|
405
|
+
* @returns {boolean}
|
|
406
|
+
*/
|
|
407
|
+
get isDisabled () {
|
|
408
|
+
return this.parcel?.disabled
|
|
409
|
+
?? false
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Whether a date part is currently set.
|
|
414
|
+
*
|
|
415
|
+
* @returns {boolean}
|
|
416
|
+
*/
|
|
417
|
+
get hasDate () {
|
|
418
|
+
return this.datePart !== null
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Whether a time part is currently set.
|
|
423
|
+
*
|
|
424
|
+
* @returns {boolean}
|
|
425
|
+
*/
|
|
426
|
+
get hasTime () {
|
|
427
|
+
return this.timePart !== null
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Whether both date and time parts are set (a complete combined value exists — Q2).
|
|
432
|
+
*
|
|
433
|
+
* @returns {boolean}
|
|
434
|
+
*/
|
|
435
|
+
get hasCompleteValue () {
|
|
436
|
+
return this.hasDate
|
|
437
|
+
&& this.hasTime
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Setup component — split the external combined value into date/time part refs.
|
|
442
|
+
*
|
|
443
|
+
* @template {X extends FuroDateTimePickerContext ? X : never} T, X
|
|
444
|
+
* @override
|
|
445
|
+
* @returns {T} - For method chaining.
|
|
446
|
+
* @this {T}
|
|
447
|
+
*/
|
|
448
|
+
setupComponent () {
|
|
449
|
+
this.watch(
|
|
450
|
+
[
|
|
451
|
+
() => this.parcel?.value,
|
|
452
|
+
() => this.attrs?.value ?? null,
|
|
453
|
+
],
|
|
454
|
+
([parcelValue, attrsValue]) => {
|
|
455
|
+
const raw = /** @type {string | null} */ (parcelValue ?? attrsValue ?? null)
|
|
456
|
+
|
|
457
|
+
this.syncFromExternalValue({ raw })
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
immediate: true,
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
return this
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Sync the internal date/time parts from an external combined value.
|
|
469
|
+
*
|
|
470
|
+
* Skips when the external value already equals what the current parts combine to. This
|
|
471
|
+
* preserves an in-progress part — e.g. a time picked before a date — from being wiped by
|
|
472
|
+
* the molecule's own `null` echo through the parent's `v-model` (Q2 emits `null` until both
|
|
473
|
+
* parts are set, so stepping the time before choosing a date would otherwise reset itself).
|
|
474
|
+
*
|
|
475
|
+
* @param {{
|
|
476
|
+
* raw: string | null
|
|
477
|
+
* }} params - Parameters of this method.
|
|
478
|
+
*/
|
|
479
|
+
syncFromExternalValue ({
|
|
480
|
+
raw,
|
|
481
|
+
}) {
|
|
482
|
+
const currentCombined = this.Ctor.combineValue({
|
|
483
|
+
datePart: this.datePart,
|
|
484
|
+
timePart: this.timePart,
|
|
485
|
+
})
|
|
486
|
+
|
|
487
|
+
if (raw === currentCombined) {
|
|
488
|
+
return
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const {
|
|
492
|
+
datePart,
|
|
493
|
+
timePart,
|
|
494
|
+
} = this.Ctor.splitValue({ value: raw })
|
|
495
|
+
|
|
496
|
+
this.datePartRef.value = datePart
|
|
497
|
+
this.timePartRef.value = timePart
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Derive the parcel forwarded to the composed `FuroDatePicker`.
|
|
502
|
+
* Strips molecule-only keys, then re-applies the date-scoped value and bounds.
|
|
503
|
+
* Optional value attributes are omitted when `null` (F-3 parity).
|
|
504
|
+
*
|
|
505
|
+
* `modal: true` is forced so the popover traps focus (reka renders `PopoverContentModal`
|
|
506
|
+
* → `FocusScope` with `trapped`). Without it the non-modal popover lets Tab escape the
|
|
507
|
+
* teleported content and jump to the inline time field in the trigger, breaking the
|
|
508
|
+
* calendar → time-field focus order.
|
|
509
|
+
*
|
|
510
|
+
* `closeOnSelect: false` keeps the popover open after a date is picked, so the user can set
|
|
511
|
+
* the time in the same session (the date atom defaults to closing on select).
|
|
512
|
+
*
|
|
513
|
+
* @returns {Record<string, unknown>}
|
|
514
|
+
*/
|
|
515
|
+
extractDateParcel () {
|
|
516
|
+
const passthrough = this.stripFuroParcelKeys()
|
|
517
|
+
|
|
518
|
+
const entries = [
|
|
519
|
+
['value', this.datePart],
|
|
520
|
+
['placeholder', this.placeholder || null],
|
|
521
|
+
['minValue', this.extractDateBound({ bound: this.minValue })],
|
|
522
|
+
['maxValue', this.extractDateBound({ bound: this.maxValue })],
|
|
523
|
+
['timezone', this.timezone],
|
|
524
|
+
]
|
|
525
|
+
.filter(([, attributeValue]) => attributeValue !== null)
|
|
526
|
+
|
|
527
|
+
return {
|
|
528
|
+
...passthrough,
|
|
529
|
+
...Object.fromEntries(entries),
|
|
530
|
+
invalid: this.isInvalid,
|
|
531
|
+
disabled: this.isDisabled,
|
|
532
|
+
modal: true,
|
|
533
|
+
closeOnSelect: false,
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Derive the parcel forwarded to the composed `FuroTimeField`.
|
|
539
|
+
* Strips molecule-only keys, then re-applies the time-scoped value and cross-field bounds.
|
|
540
|
+
* Optional value attributes are omitted when `null` (F-3 parity).
|
|
541
|
+
*
|
|
542
|
+
* @returns {Record<string, unknown>}
|
|
543
|
+
*/
|
|
544
|
+
extractTimeParcel () {
|
|
545
|
+
const passthrough = this.stripFuroParcelKeys()
|
|
546
|
+
|
|
547
|
+
const entries = [
|
|
548
|
+
['value', this.timePart],
|
|
549
|
+
['granularity', this.granularity],
|
|
550
|
+
['step', this.step],
|
|
551
|
+
['timeFormat', this.timeFormat],
|
|
552
|
+
['timezone', this.timezone],
|
|
553
|
+
['minValue', this.extractTimeMinBound()],
|
|
554
|
+
['maxValue', this.extractTimeMaxBound()],
|
|
555
|
+
]
|
|
556
|
+
.filter(([, attributeValue]) => attributeValue !== null)
|
|
557
|
+
|
|
558
|
+
return {
|
|
559
|
+
...passthrough,
|
|
560
|
+
...Object.fromEntries(entries),
|
|
561
|
+
invalid: this.isInvalid,
|
|
562
|
+
disabled: this.isDisabled,
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Strip Furo-only molecule parcel keys, leaving only consumer passthrough attributes.
|
|
568
|
+
*
|
|
569
|
+
* @returns {Record<string, unknown>}
|
|
570
|
+
*/
|
|
571
|
+
stripFuroParcelKeys () {
|
|
572
|
+
const { parcel } = this
|
|
573
|
+
|
|
574
|
+
if (!parcel) {
|
|
575
|
+
return {}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
const entries = Object.entries(parcel)
|
|
579
|
+
.filter(([key]) => !FURO_DATE_TIME_PICKER_PARCEL_KEYS.has(key))
|
|
580
|
+
|
|
581
|
+
return Object.fromEntries(entries)
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Extract the date part of a combined datetime bound for the date atom.
|
|
586
|
+
*
|
|
587
|
+
* @param {{
|
|
588
|
+
* bound: string | null
|
|
589
|
+
* }} params - Parameters of this method.
|
|
590
|
+
* @returns {string | null}
|
|
591
|
+
*/
|
|
592
|
+
extractDateBound ({
|
|
593
|
+
bound,
|
|
594
|
+
}) {
|
|
595
|
+
return this.Ctor.splitValue({ value: bound })
|
|
596
|
+
.datePart
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Cross-field minimum TIME bound (Q3): applies only when the selected date equals the
|
|
601
|
+
* minimum date; otherwise the full day is allowed (`null`).
|
|
602
|
+
*
|
|
603
|
+
* @returns {string | null}
|
|
604
|
+
*/
|
|
605
|
+
extractTimeMinBound () {
|
|
606
|
+
return this.extractCrossFieldTimeBound({ bound: this.minValue })
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Cross-field maximum TIME bound (Q3): applies only when the selected date equals the
|
|
611
|
+
* maximum date; otherwise the full day is allowed (`null`).
|
|
612
|
+
*
|
|
613
|
+
* @returns {string | null}
|
|
614
|
+
*/
|
|
615
|
+
extractTimeMaxBound () {
|
|
616
|
+
return this.extractCrossFieldTimeBound({ bound: this.maxValue })
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Resolve a cross-field time bound: the bound's time part applies only when the currently
|
|
621
|
+
* selected date equals the bound's date part (Q3). Returns `null` (full day) otherwise.
|
|
622
|
+
*
|
|
623
|
+
* @param {{
|
|
624
|
+
* bound: string | null
|
|
625
|
+
* }} params - Parameters of this method.
|
|
626
|
+
* @returns {string | null}
|
|
627
|
+
*/
|
|
628
|
+
extractCrossFieldTimeBound ({
|
|
629
|
+
bound,
|
|
630
|
+
}) {
|
|
631
|
+
const {
|
|
632
|
+
datePart: boundDatePart,
|
|
633
|
+
timePart: boundTimePart,
|
|
634
|
+
} = this.Ctor.splitValue({ value: bound })
|
|
635
|
+
|
|
636
|
+
if (
|
|
637
|
+
boundDatePart === null
|
|
638
|
+
|| this.datePart !== boundDatePart
|
|
639
|
+
) {
|
|
640
|
+
return null
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
return boundTimePart
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Build a custom event carrying the combined value for the emit payload.
|
|
648
|
+
*
|
|
649
|
+
* @param {{
|
|
650
|
+
* name: string
|
|
651
|
+
* value: string | null
|
|
652
|
+
* }} params - Parameters of this method.
|
|
653
|
+
* @returns {CustomEvent<{
|
|
654
|
+
* target: HTMLElement | null
|
|
655
|
+
* value: string | null
|
|
656
|
+
* datePart: string | null
|
|
657
|
+
* timePart: string | null
|
|
658
|
+
* }>}
|
|
659
|
+
*/
|
|
660
|
+
buildCustomEvent ({
|
|
661
|
+
name,
|
|
662
|
+
value,
|
|
663
|
+
}) {
|
|
664
|
+
return new CustomEvent(
|
|
665
|
+
name,
|
|
666
|
+
{
|
|
667
|
+
detail: {
|
|
668
|
+
target: this.rootElementRef.value,
|
|
669
|
+
value,
|
|
670
|
+
datePart: this.datePart,
|
|
671
|
+
timePart: this.timePart,
|
|
672
|
+
},
|
|
673
|
+
}
|
|
674
|
+
)
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Respond to the composed date atom's `update:value`.
|
|
679
|
+
* Updates the date part, preserves the existing time part, and re-emits the trio.
|
|
680
|
+
*
|
|
681
|
+
* @param {{
|
|
682
|
+
* value: string | null
|
|
683
|
+
* }} params - Parameters of this method.
|
|
684
|
+
*/
|
|
685
|
+
onDateChange ({
|
|
686
|
+
value,
|
|
687
|
+
}) {
|
|
688
|
+
this.datePartRef.value = this.Ctor.blankToNull({ segment: value })
|
|
689
|
+
|
|
690
|
+
this.syncTimeWithDateSelection()
|
|
691
|
+
|
|
692
|
+
this.emitCombinedValue()
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Reconcile the time part after a date change. Clearing the date (the footer Clear button,
|
|
697
|
+
* with `preventDeselect` on) also clears the time so the whole value resets; selecting a
|
|
698
|
+
* date fabricates the default time when none is set yet.
|
|
699
|
+
*/
|
|
700
|
+
syncTimeWithDateSelection () {
|
|
701
|
+
if (this.datePart === null) {
|
|
702
|
+
this.timePartRef.value = null
|
|
703
|
+
|
|
704
|
+
return
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
this.applyDefaultTimeOnDateSelection()
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Fabricate a default time (`12:00:00`) the first time a date is selected without an
|
|
712
|
+
* existing time, so the combined value becomes complete immediately while the popover stays
|
|
713
|
+
* open for the user to refine the time. No-op when no date is set or a time already exists.
|
|
714
|
+
*/
|
|
715
|
+
applyDefaultTimeOnDateSelection () {
|
|
716
|
+
if (
|
|
717
|
+
this.datePart === null
|
|
718
|
+
|| this.timePart !== null
|
|
719
|
+
) {
|
|
720
|
+
return
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
this.timePartRef.value = DEFAULT_TIME_PART
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Respond to the composed time atom's `update:value`.
|
|
728
|
+
* Updates the time part, preserves the existing date part, and re-emits the trio.
|
|
729
|
+
*
|
|
730
|
+
* @param {{
|
|
731
|
+
* value: string | null
|
|
732
|
+
* }} params - Parameters of this method.
|
|
733
|
+
*/
|
|
734
|
+
onTimeChange ({
|
|
735
|
+
value,
|
|
736
|
+
}) {
|
|
737
|
+
this.timePartRef.value = this.Ctor.blankToNull({ segment: value })
|
|
738
|
+
|
|
739
|
+
this.emitCombinedValue()
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Recombine the current parts and emit `change-value`, `update:value`, `commit-value`.
|
|
744
|
+
* Emits `null` until both parts are present (Q2).
|
|
745
|
+
*/
|
|
746
|
+
emitCombinedValue () {
|
|
747
|
+
const value = this.Ctor.combineValue({
|
|
748
|
+
datePart: this.datePart,
|
|
749
|
+
timePart: this.timePart,
|
|
750
|
+
})
|
|
751
|
+
|
|
752
|
+
const customEvent = this.buildCustomEvent({
|
|
753
|
+
name: this.EMIT_EVENT_NAME.CHANGE_VALUE,
|
|
754
|
+
value,
|
|
755
|
+
})
|
|
756
|
+
|
|
757
|
+
const payload = this.Ctor.EmitPayloadCtor.create({
|
|
758
|
+
rawEvent: customEvent,
|
|
759
|
+
})
|
|
760
|
+
|
|
761
|
+
this.emit(
|
|
762
|
+
this.EMIT_EVENT_NAME.CHANGE_VALUE,
|
|
763
|
+
payload
|
|
764
|
+
)
|
|
765
|
+
|
|
766
|
+
this.emit(
|
|
767
|
+
this.EMIT_EVENT_NAME.UPDATE_VALUE,
|
|
768
|
+
value
|
|
769
|
+
)
|
|
770
|
+
|
|
771
|
+
this.emit(
|
|
772
|
+
this.EMIT_EVENT_NAME.COMMIT_VALUE,
|
|
773
|
+
payload
|
|
774
|
+
)
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* @typedef {import('../../../contexts/BaseFuroContext.js').BaseFuroContextParams & {
|
|
780
|
+
* props: Props
|
|
781
|
+
* componentContext: ComponentContext
|
|
782
|
+
* refHash: {
|
|
783
|
+
* rootElementRef: import('vue').Ref<HTMLElement | null>
|
|
784
|
+
* datePartRef: import('vue').Ref<string | null>
|
|
785
|
+
* timePartRef: import('vue').Ref<string | null>
|
|
786
|
+
* }
|
|
787
|
+
* }} FuroDateTimePickerContextParams
|
|
788
|
+
*/
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* @typedef {Omit<FuroDateTimePickerContextParams, 'refHash'> & {
|
|
792
|
+
* refHash?: {
|
|
793
|
+
* rootElementRef: import('vue').Ref<HTMLElement | null>
|
|
794
|
+
* datePartRef: import('vue').Ref<string | null>
|
|
795
|
+
* timePartRef: import('vue').Ref<string | null>
|
|
796
|
+
* }
|
|
797
|
+
* }} FuroDateTimePickerContextFactoryParams
|
|
798
|
+
*/
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* @typedef {keyof typeof FuroDateTimePickerContext.EMIT_EVENT_NAME} EmitEventName
|
|
802
|
+
*/
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* @typedef {import('vue').HTMLAttributes & {
|
|
806
|
+
* parcel?: DateTimePickerParcel | null
|
|
807
|
+
* }} Props
|
|
808
|
+
*/
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* @typedef {Record<string, unknown> & {
|
|
812
|
+
* value?: string | null
|
|
813
|
+
* invalid?: boolean
|
|
814
|
+
* placeholder?: string | null
|
|
815
|
+
* disabled?: boolean
|
|
816
|
+
* minValue?: string | null
|
|
817
|
+
* maxValue?: string | null
|
|
818
|
+
* timezone?: string | null
|
|
819
|
+
* granularity?: 'hour' | 'minute' | 'second' | null
|
|
820
|
+
* step?: number | null
|
|
821
|
+
* timeFormat?: number | null
|
|
822
|
+
* }} DateTimePickerParcel
|
|
823
|
+
*/
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* @typedef {import('vue').SetupContext<FuroDateTimePickerEmitHash>} ComponentContext
|
|
827
|
+
*/
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* @typedef {typeof FuroDateTimePickerContext.EMIT_EVENT_HASH} FuroDateTimePickerEmitHash
|
|
831
|
+
*/
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* @typedef {(
|
|
835
|
+
* props: Props,
|
|
836
|
+
* componentContext: ComponentContext
|
|
837
|
+
* ) => {
|
|
838
|
+
* context: FuroDateTimePickerContext
|
|
839
|
+
* }} FuroDateTimePickerSetup
|
|
840
|
+
*/
|