@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,1525 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
} from 'vue'
|
|
4
|
+
|
|
5
|
+
import TimerClerk from '../../../tools/TimerClerk.js'
|
|
6
|
+
|
|
7
|
+
import BaseFuroContext from '../../../contexts/BaseFuroContext.js'
|
|
8
|
+
|
|
9
|
+
import AutocompleteEmitPayload from './AutocompleteEmitPayload.js'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Sentinel value for the select-all option (not stored in model).
|
|
13
|
+
*/
|
|
14
|
+
export const FURO_AUTOCOMPLETE_FIELD_SELECT_ALL_VALUE = '__furo_autocomplete_field_select_all__'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Sentinel value for the create-option row (not stored in model).
|
|
18
|
+
*/
|
|
19
|
+
export const FURO_AUTOCOMPLETE_FIELD_CREATE_VALUE = '__furo_autocomplete_field_create__'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Context class for managing FuroAutocompleteField component.
|
|
23
|
+
*
|
|
24
|
+
* @extends {BaseFuroContext<null, Props, EmitEventName>}
|
|
25
|
+
*/
|
|
26
|
+
export default class FuroAutocompleteFieldContext extends BaseFuroContext {
|
|
27
|
+
/**
|
|
28
|
+
* Constructor.
|
|
29
|
+
*
|
|
30
|
+
* @param {FuroAutocompleteFieldContextParams} params - Parameters of this constructor.
|
|
31
|
+
*/
|
|
32
|
+
constructor ({
|
|
33
|
+
props,
|
|
34
|
+
componentContext,
|
|
35
|
+
|
|
36
|
+
refHash,
|
|
37
|
+
|
|
38
|
+
filterCollator,
|
|
39
|
+
}) {
|
|
40
|
+
super({
|
|
41
|
+
props,
|
|
42
|
+
componentContext,
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
this.refHash = refHash
|
|
46
|
+
|
|
47
|
+
this.filterCollator = filterCollator
|
|
48
|
+
|
|
49
|
+
this.updateSearchKeywordTimerClerk = null
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Factory method.
|
|
54
|
+
*
|
|
55
|
+
* @template {X extends typeof FuroAutocompleteFieldContext ? X : never} T, X
|
|
56
|
+
* @override
|
|
57
|
+
* @param {FuroAutocompleteFieldContextFactoryParams} params - Parameters of this factory method.
|
|
58
|
+
* @returns {InstanceType<T>} An instance of this class.
|
|
59
|
+
* @this {T}
|
|
60
|
+
*/
|
|
61
|
+
static create ({
|
|
62
|
+
props,
|
|
63
|
+
componentContext,
|
|
64
|
+
|
|
65
|
+
refHash = this.buildRefHash(),
|
|
66
|
+
|
|
67
|
+
filterCollator,
|
|
68
|
+
}) {
|
|
69
|
+
return /** @type {InstanceType<T>} */ (
|
|
70
|
+
new this({
|
|
71
|
+
props,
|
|
72
|
+
componentContext,
|
|
73
|
+
|
|
74
|
+
refHash,
|
|
75
|
+
|
|
76
|
+
filterCollator,
|
|
77
|
+
})
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Build ref hash.
|
|
83
|
+
*
|
|
84
|
+
* @override
|
|
85
|
+
* @returns {FuroAutocompleteFieldContextParams['refHash']}
|
|
86
|
+
*/
|
|
87
|
+
static buildRefHash () {
|
|
88
|
+
return {
|
|
89
|
+
triggerContentElementRef: ref(null),
|
|
90
|
+
internalValueRef: ref(null),
|
|
91
|
+
internalSearchKeywordRef: ref(''),
|
|
92
|
+
internalOpenPopoverRef: ref(false),
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get emit event name.
|
|
98
|
+
*
|
|
99
|
+
* @override
|
|
100
|
+
* @returns {Readonly<{
|
|
101
|
+
* CHANGE_VALUE: 'change-value'
|
|
102
|
+
* COMMIT_VALUE: 'commit-value'
|
|
103
|
+
* UPDATE_VALUE: 'update:value'
|
|
104
|
+
* SEARCH_KEYWORD: 'search-keyword'
|
|
105
|
+
* UPDATE_SEARCH_KEYWORD: 'update:search-keyword'
|
|
106
|
+
* UPDATE_OPEN: 'update:open'
|
|
107
|
+
* CREATE_OPTION: 'create-option'
|
|
108
|
+
* }>}
|
|
109
|
+
*/
|
|
110
|
+
static get EMIT_EVENT_NAME () {
|
|
111
|
+
return {
|
|
112
|
+
CHANGE_VALUE: 'change-value',
|
|
113
|
+
COMMIT_VALUE: 'commit-value',
|
|
114
|
+
UPDATE_VALUE: 'update:value',
|
|
115
|
+
SEARCH_KEYWORD: 'search-keyword',
|
|
116
|
+
UPDATE_SEARCH_KEYWORD: 'update:search-keyword',
|
|
117
|
+
UPDATE_OPEN: 'update:open',
|
|
118
|
+
CREATE_OPTION: 'create-option',
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Get emit options.
|
|
124
|
+
*
|
|
125
|
+
* @returns {{
|
|
126
|
+
* 'change-value': (payload: import('./AutocompleteEmitPayload.js').default) => void
|
|
127
|
+
* 'commit-value': (payload: import('./AutocompleteEmitPayload.js').default) => void
|
|
128
|
+
* 'update:value': (value: FuroAutocompleteOption | null) => void
|
|
129
|
+
* 'update:search-keyword': (searchKeyword: string) => void
|
|
130
|
+
* 'search-keyword': (payload: { searchKeyword: string }) => void
|
|
131
|
+
* 'update:open': (isOpen: boolean) => void
|
|
132
|
+
* 'create-option': (payload: import('./AutocompleteEmitPayload.js').default) => void
|
|
133
|
+
* }}
|
|
134
|
+
*/
|
|
135
|
+
static get EMIT_EVENT_HASH () {
|
|
136
|
+
return {
|
|
137
|
+
[this.EMIT_EVENT_NAME.CHANGE_VALUE]: payload => {},
|
|
138
|
+
[this.EMIT_EVENT_NAME.COMMIT_VALUE]: payload => {},
|
|
139
|
+
[this.EMIT_EVENT_NAME.UPDATE_VALUE]: value => {},
|
|
140
|
+
[this.EMIT_EVENT_NAME.UPDATE_SEARCH_KEYWORD]: searchKeyword => {},
|
|
141
|
+
[this.EMIT_EVENT_NAME.SEARCH_KEYWORD]: payload => {},
|
|
142
|
+
[this.EMIT_EVENT_NAME.UPDATE_OPEN]: isOpen => {},
|
|
143
|
+
[this.EMIT_EVENT_NAME.CREATE_OPTION]: payload => {},
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* get: Constructor of `EmitPayload`.
|
|
149
|
+
*
|
|
150
|
+
* @returns {typeof AutocompleteEmitPayload}
|
|
151
|
+
*/
|
|
152
|
+
static get EmitPayloadCtor () {
|
|
153
|
+
return AutocompleteEmitPayload
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* get: Constructor of this class.
|
|
158
|
+
*
|
|
159
|
+
* @override
|
|
160
|
+
* @returns {typeof FuroAutocompleteFieldContext}
|
|
161
|
+
*/
|
|
162
|
+
get Ctor () {
|
|
163
|
+
return /** @type {typeof FuroAutocompleteFieldContext} */ (
|
|
164
|
+
this.constructor
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Get anchor trigger-content element ref.
|
|
170
|
+
*
|
|
171
|
+
* @returns {import('vue').Ref<HTMLElement | null>}
|
|
172
|
+
*/
|
|
173
|
+
get triggerContentElementRef () {
|
|
174
|
+
return this.refHash.triggerContentElementRef
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Get internal value ref.
|
|
179
|
+
*
|
|
180
|
+
* @returns {import('vue').Ref<FuroAutocompleteOption | Array<FuroAutocompleteOption> | FuroAcceptableValue | Array<FuroAcceptableValue> | null>}
|
|
181
|
+
*/
|
|
182
|
+
get internalValueRef () {
|
|
183
|
+
return this.refHash.internalValueRef
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Get internal search keyword ref.
|
|
188
|
+
*
|
|
189
|
+
* @returns {import('vue').Ref<string>}
|
|
190
|
+
*/
|
|
191
|
+
get internalSearchKeywordRef () {
|
|
192
|
+
return this.refHash.internalSearchKeywordRef
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Get internal open ref.
|
|
197
|
+
*
|
|
198
|
+
* @returns {import('vue').Ref<boolean>}
|
|
199
|
+
*/
|
|
200
|
+
get internalOpenPopoverRef () {
|
|
201
|
+
return this.refHash.internalOpenPopoverRef
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Parcel passed from parent via props.
|
|
206
|
+
*
|
|
207
|
+
* @override
|
|
208
|
+
* @returns {Props['parcel']}
|
|
209
|
+
*/
|
|
210
|
+
get parcel () {
|
|
211
|
+
return {
|
|
212
|
+
showClear: true,
|
|
213
|
+
localCompare: true,
|
|
214
|
+
debounceMilliseconds: 300,
|
|
215
|
+
openOnClick: true,
|
|
216
|
+
showSelectAll: false,
|
|
217
|
+
emptyText: 'No options.',
|
|
218
|
+
selectAllText: 'Select All',
|
|
219
|
+
textDirection: 'toRight',
|
|
220
|
+
placeholder: 'Select an option',
|
|
221
|
+
creatable: false,
|
|
222
|
+
createOptionText: 'Create "{keyword}"',
|
|
223
|
+
chipOverflow: 'wrap',
|
|
224
|
+
...this.props.parcel,
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Get loading.
|
|
230
|
+
*
|
|
231
|
+
* @returns {boolean}
|
|
232
|
+
*/
|
|
233
|
+
get loading () {
|
|
234
|
+
return this.parcel?.loading
|
|
235
|
+
?? false
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Whether the autocomplete is invalid.
|
|
240
|
+
*
|
|
241
|
+
* @returns {boolean}
|
|
242
|
+
*/
|
|
243
|
+
get isInvalid () {
|
|
244
|
+
return this.parcel?.invalid
|
|
245
|
+
?? false
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Whether the autocomplete is disabled.
|
|
250
|
+
*
|
|
251
|
+
* @returns {boolean}
|
|
252
|
+
*/
|
|
253
|
+
get isDisabled () {
|
|
254
|
+
return this.parcel?.disabled
|
|
255
|
+
?? false
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Whether the autocomplete is multiple.
|
|
260
|
+
*
|
|
261
|
+
* @returns {boolean}
|
|
262
|
+
*/
|
|
263
|
+
get isMultiple () {
|
|
264
|
+
return this.parcel?.multiple
|
|
265
|
+
?? false
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Whether the autocomplete allows creating new options.
|
|
270
|
+
*
|
|
271
|
+
* @returns {boolean}
|
|
272
|
+
*/
|
|
273
|
+
get creatable () {
|
|
274
|
+
return this.parcel?.creatable
|
|
275
|
+
?? false
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @returns {Array<FuroAutocompleteOption | FuroAcceptableValue>}
|
|
280
|
+
*/
|
|
281
|
+
get options () {
|
|
282
|
+
return this.parcel?.options
|
|
283
|
+
?? []
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* get: maximum number of chips to render before collapsing the rest into a
|
|
288
|
+
* `+{count}` indicator. Null means no cap (render every chip).
|
|
289
|
+
*
|
|
290
|
+
* @returns {number | null}
|
|
291
|
+
*/
|
|
292
|
+
get maxVisibleChips () {
|
|
293
|
+
return this.parcel?.maxVisibleChips
|
|
294
|
+
?? null
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* get: how chips behave when they exceed the trigger width — `'wrap'` (chips
|
|
299
|
+
* flow onto multiple lines) or `'ellipsis'` (single line, truncated).
|
|
300
|
+
*
|
|
301
|
+
* @returns {'wrap' | 'ellipsis'}
|
|
302
|
+
*/
|
|
303
|
+
get chipOverflow () {
|
|
304
|
+
return this.parcel?.chipOverflow
|
|
305
|
+
?? 'wrap'
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Selected options currently held as chips (multiple mode).
|
|
310
|
+
*
|
|
311
|
+
* @returns {Array<FuroAutocompleteOption | FuroAcceptableValue>}
|
|
312
|
+
*/
|
|
313
|
+
extractSelectedChips () {
|
|
314
|
+
if (!Array.isArray(this.internalValueRef.value)) {
|
|
315
|
+
return []
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return this.internalValueRef.value
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Chips to actually render — capped at `maxVisibleChips` when set.
|
|
323
|
+
*
|
|
324
|
+
* @returns {Array<FuroAutocompleteOption | FuroAcceptableValue>}
|
|
325
|
+
*/
|
|
326
|
+
extractVisibleChips () {
|
|
327
|
+
const chips = this.extractSelectedChips()
|
|
328
|
+
|
|
329
|
+
if (this.maxVisibleChips === null) {
|
|
330
|
+
return chips
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return chips.slice(0, this.maxVisibleChips)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Number of selected chips hidden by the `maxVisibleChips` cap.
|
|
338
|
+
*
|
|
339
|
+
* @returns {number}
|
|
340
|
+
*/
|
|
341
|
+
extractHiddenChipCount () {
|
|
342
|
+
return this.extractSelectedChips().length
|
|
343
|
+
- this.extractVisibleChips().length
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Whether the `+{count}` overflow indicator should be shown.
|
|
348
|
+
*
|
|
349
|
+
* @returns {boolean}
|
|
350
|
+
*/
|
|
351
|
+
hasHiddenChips () {
|
|
352
|
+
return this.extractHiddenChipCount() > 0
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Whether chips render on a single truncated line (`chipOverflow: 'ellipsis'`).
|
|
357
|
+
*
|
|
358
|
+
* @returns {boolean}
|
|
359
|
+
*/
|
|
360
|
+
hasEllipsisChipOverflow () {
|
|
361
|
+
return this.chipOverflow === 'ellipsis'
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* get: how to derive an option's display label — a key name or a function.
|
|
366
|
+
*
|
|
367
|
+
* @returns {string | ((option: FuroAutocompleteOption | FuroAcceptableValue) => string) | null}
|
|
368
|
+
*/
|
|
369
|
+
get optionLabel () {
|
|
370
|
+
return this.parcel?.optionLabel
|
|
371
|
+
?? null
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* get: how to derive an option's model value — a key name or a function.
|
|
376
|
+
*
|
|
377
|
+
* @returns {string | ((option: FuroAutocompleteOption | FuroAcceptableValue) => FuroAcceptableValue) | null}
|
|
378
|
+
*/
|
|
379
|
+
get optionValue () {
|
|
380
|
+
return this.parcel?.optionValue
|
|
381
|
+
?? null
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Resolve an option's display label.
|
|
386
|
+
*
|
|
387
|
+
* Uses `optionLabel` when set (function or key name); otherwise falls back to
|
|
388
|
+
* the option's own `label` (the historical default). Primitive options fall
|
|
389
|
+
* through to the caller (returns null) unless a function is given.
|
|
390
|
+
*
|
|
391
|
+
* @param {{
|
|
392
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
393
|
+
* }} params - Parameters of this method.
|
|
394
|
+
* @returns {string | null} Display label, or null for primitives without a function.
|
|
395
|
+
*/
|
|
396
|
+
resolveOptionLabel ({
|
|
397
|
+
option,
|
|
398
|
+
}) {
|
|
399
|
+
if (typeof this.optionLabel === 'function') {
|
|
400
|
+
return this.optionLabel(option)
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (typeof option !== 'object' || option === null) {
|
|
404
|
+
return null
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if (typeof this.optionLabel === 'string') {
|
|
408
|
+
return option[this.optionLabel]
|
|
409
|
+
?? null
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return option.label
|
|
413
|
+
?? null
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Resolve an option's model value.
|
|
418
|
+
*
|
|
419
|
+
* Uses `optionValue` when set (function or key name); otherwise falls back to
|
|
420
|
+
* the whole option (the historical default for FuroAutocompleteField).
|
|
421
|
+
*
|
|
422
|
+
* @param {{
|
|
423
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
424
|
+
* }} params - Parameters of this method.
|
|
425
|
+
* @returns {*} Model value.
|
|
426
|
+
*/
|
|
427
|
+
resolveOptionValue ({
|
|
428
|
+
option,
|
|
429
|
+
}) {
|
|
430
|
+
if (typeof this.optionValue === 'function') {
|
|
431
|
+
return this.optionValue(option)
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (typeof this.optionValue !== 'string') {
|
|
435
|
+
return option
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if (typeof option !== 'object' || option === null) {
|
|
439
|
+
return null
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return option[this.optionValue]
|
|
443
|
+
?? null
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Resolve the value emitted via `update:value` from the current internal
|
|
448
|
+
* selection, mapping each selected option through `resolveOptionValue`.
|
|
449
|
+
*
|
|
450
|
+
* @returns {*} Emitted value — an array in multiple mode, a single value otherwise.
|
|
451
|
+
*/
|
|
452
|
+
resolveEmittedValue () {
|
|
453
|
+
const selected = this.internalValueRef.value
|
|
454
|
+
|
|
455
|
+
if (Array.isArray(selected)) {
|
|
456
|
+
return selected.map(option => this.resolveOptionValue({ option }))
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return this.resolveOptionValue({
|
|
460
|
+
option: selected,
|
|
461
|
+
})
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Find the option whose resolved model value equals the given value.
|
|
466
|
+
*
|
|
467
|
+
* @param {{
|
|
468
|
+
* value: *
|
|
469
|
+
* }} params - Parameters of this method.
|
|
470
|
+
* @returns {FuroAutocompleteOption | FuroAcceptableValue | null} Matching option, or null.
|
|
471
|
+
*/
|
|
472
|
+
findOptionByValue ({
|
|
473
|
+
value,
|
|
474
|
+
}) {
|
|
475
|
+
const flattenedOptions = this.options.flatMap(option => (
|
|
476
|
+
(option !== null && typeof option === 'object' && Array.isArray(option.options))
|
|
477
|
+
? [
|
|
478
|
+
option,
|
|
479
|
+
...option.options,
|
|
480
|
+
]
|
|
481
|
+
: [option]
|
|
482
|
+
))
|
|
483
|
+
|
|
484
|
+
const matchedOption = flattenedOptions.find(option =>
|
|
485
|
+
JSON.stringify(this.resolveOptionValue({ option })) === JSON.stringify(value)
|
|
486
|
+
)
|
|
487
|
+
|
|
488
|
+
return matchedOption
|
|
489
|
+
?? null
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Reverse the `optionValue` projection when ingesting a bound value.
|
|
494
|
+
*
|
|
495
|
+
* The internal model is kept in option space (the underlying combobox binds
|
|
496
|
+
* whole option objects), but `optionValue` makes `update:value` emit a
|
|
497
|
+
* projected value (e.g. an id). When the consumer feeds that projected value
|
|
498
|
+
* back via `parcel.value`, map it to the matching option so the selection is
|
|
499
|
+
* reflected. With no `optionValue` set, the bound value is already an option
|
|
500
|
+
* and passes through unchanged (backward compatible).
|
|
501
|
+
*
|
|
502
|
+
* @param {{
|
|
503
|
+
* rawValue: *
|
|
504
|
+
* }} params - Parameters of this method.
|
|
505
|
+
* @returns {*} A value in option space (the raw value when unmatched).
|
|
506
|
+
*/
|
|
507
|
+
resolveInternalValueFromRaw ({
|
|
508
|
+
rawValue,
|
|
509
|
+
}) {
|
|
510
|
+
if (this.optionValue === null) {
|
|
511
|
+
return rawValue
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (Array.isArray(rawValue)) {
|
|
515
|
+
return rawValue.map(value =>
|
|
516
|
+
this.resolveSingleInternalValue({ rawValue: value })
|
|
517
|
+
)
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
return this.resolveSingleInternalValue({ rawValue })
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Reverse the `optionValue` projection for a single bound value.
|
|
525
|
+
*
|
|
526
|
+
* @param {{
|
|
527
|
+
* rawValue: *
|
|
528
|
+
* }} params - Parameters of this method.
|
|
529
|
+
* @returns {*} The matching option, or the raw value when unmatched.
|
|
530
|
+
*/
|
|
531
|
+
resolveSingleInternalValue ({
|
|
532
|
+
rawValue,
|
|
533
|
+
}) {
|
|
534
|
+
const matchedOption = this.findOptionByValue({ value: rawValue })
|
|
535
|
+
|
|
536
|
+
return matchedOption
|
|
537
|
+
?? rawValue
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Get attrs value.
|
|
542
|
+
*
|
|
543
|
+
* @returns {FuroAutocompleteOption | Array<FuroAutocompleteOption> | null}
|
|
544
|
+
*/
|
|
545
|
+
get attrsValue () {
|
|
546
|
+
return /** @type {FuroAutocompleteOption | Array<FuroAutocompleteOption> | null} */ (
|
|
547
|
+
this.attrs?.value
|
|
548
|
+
?? null
|
|
549
|
+
)
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Get sentinel value for the select-all option.
|
|
554
|
+
*
|
|
555
|
+
* @returns {string}
|
|
556
|
+
*/
|
|
557
|
+
get furoAutocompleteSelectAllValue () {
|
|
558
|
+
return FURO_AUTOCOMPLETE_FIELD_SELECT_ALL_VALUE
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Get sentinel value for the create-option row.
|
|
563
|
+
*
|
|
564
|
+
* @returns {string}
|
|
565
|
+
*/
|
|
566
|
+
get furoAutocompleteCreateValue () {
|
|
567
|
+
return FURO_AUTOCOMPLETE_FIELD_CREATE_VALUE
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Whether the clear button should be shown.
|
|
572
|
+
*
|
|
573
|
+
* @returns {boolean}
|
|
574
|
+
*/
|
|
575
|
+
get showClear () {
|
|
576
|
+
return this.parcel?.showClear
|
|
577
|
+
?? false
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Setup component context.
|
|
582
|
+
*
|
|
583
|
+
* @template {X extends FuroAutocompleteFieldContext ? X : never} T, X
|
|
584
|
+
* @override
|
|
585
|
+
* @returns {T} - For method chaining.
|
|
586
|
+
* @this {T}
|
|
587
|
+
*/
|
|
588
|
+
setupComponent () {
|
|
589
|
+
this.updateSearchKeywordTimerClerk = TimerClerk.create({
|
|
590
|
+
onTick: ({ searchKeyword = '' }) => {
|
|
591
|
+
this.emit(this.EMIT_EVENT_NAME.SEARCH_KEYWORD, searchKeyword)
|
|
592
|
+
},
|
|
593
|
+
timeInMilliseconds: this.parcel?.debounceMilliseconds ?? 300,
|
|
594
|
+
})
|
|
595
|
+
|
|
596
|
+
this.watch(
|
|
597
|
+
() => this.parcel?.searchKeyword,
|
|
598
|
+
searchKeyword => {
|
|
599
|
+
if (searchKeyword === this.internalSearchKeywordRef.value) {
|
|
600
|
+
return
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
this.internalSearchKeywordRef.value = searchKeyword ?? ''
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
immediate: true,
|
|
607
|
+
}
|
|
608
|
+
)
|
|
609
|
+
|
|
610
|
+
this.watch(
|
|
611
|
+
[
|
|
612
|
+
() => this.parcel?.value ?? this.attrsValue ?? null,
|
|
613
|
+
() => this.parcel?.multiple ?? false,
|
|
614
|
+
],
|
|
615
|
+
([selectedValue, multiple]) => {
|
|
616
|
+
const resolvedValue = this.resolveInternalValueFromRaw({
|
|
617
|
+
rawValue: selectedValue,
|
|
618
|
+
})
|
|
619
|
+
|
|
620
|
+
if (multiple) {
|
|
621
|
+
this.internalValueRef.value = Array.isArray(resolvedValue)
|
|
622
|
+
? resolvedValue
|
|
623
|
+
: []
|
|
624
|
+
} else {
|
|
625
|
+
this.internalValueRef.value = resolvedValue ?? null
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
immediate: true,
|
|
630
|
+
}
|
|
631
|
+
)
|
|
632
|
+
|
|
633
|
+
return this
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* @param {{
|
|
638
|
+
* searchKeyword: string
|
|
639
|
+
* }} params - Parameters of this method.
|
|
640
|
+
*/
|
|
641
|
+
onUpdateSearchKeyword ({
|
|
642
|
+
searchKeyword,
|
|
643
|
+
}) {
|
|
644
|
+
this.internalSearchKeywordRef.value = searchKeyword
|
|
645
|
+
|
|
646
|
+
if (this.internalOpenPopoverRef.value) {
|
|
647
|
+
this.updateSearchKeywordTimerClerk?.startTimer({ searchKeyword })
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* @param {{
|
|
653
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue | null
|
|
654
|
+
* }} params - Parameters of this method.
|
|
655
|
+
* @returns {boolean}
|
|
656
|
+
*/
|
|
657
|
+
isGroupOption ({
|
|
658
|
+
option,
|
|
659
|
+
}) {
|
|
660
|
+
if (
|
|
661
|
+
typeof option !== 'object'
|
|
662
|
+
|| option === null
|
|
663
|
+
|| !('options' in option)
|
|
664
|
+
) {
|
|
665
|
+
return false
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
return Array.isArray(option.options)
|
|
669
|
+
&& option.options.length > 0
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* @param {{
|
|
674
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
675
|
+
* }} params - Parameters of this method.
|
|
676
|
+
* @returns {Array<FuroAutocompleteOption | FuroAcceptableValue>}
|
|
677
|
+
*/
|
|
678
|
+
extractChildOptions ({
|
|
679
|
+
option,
|
|
680
|
+
}) {
|
|
681
|
+
if (
|
|
682
|
+
option
|
|
683
|
+
&& typeof option === 'object'
|
|
684
|
+
&& Array.isArray(option.options)
|
|
685
|
+
) {
|
|
686
|
+
return option.options
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
return [option]
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Whether the autocomplete has empty options.
|
|
694
|
+
*
|
|
695
|
+
* @returns {boolean}
|
|
696
|
+
*/
|
|
697
|
+
hasEmptyOptions () {
|
|
698
|
+
return this.filteredOptions().length === 0
|
|
699
|
+
&& !this.loading
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Whether the clear button should be shown.
|
|
704
|
+
*
|
|
705
|
+
* @returns {boolean}
|
|
706
|
+
*/
|
|
707
|
+
shouldShowClearButton () {
|
|
708
|
+
const hasValidState = !this.loading && !this.isDisabled
|
|
709
|
+
const hasSelectedValue = Array.isArray(this.internalValueRef.value)
|
|
710
|
+
? this.internalValueRef.value.length > 0
|
|
711
|
+
: this.internalValueRef.value !== null
|
|
712
|
+
|
|
713
|
+
if (this.isMultiple) {
|
|
714
|
+
return this.showClear
|
|
715
|
+
&& hasValidState
|
|
716
|
+
&& hasSelectedValue
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
return this.showClear
|
|
720
|
+
&& hasValidState
|
|
721
|
+
&& hasSelectedValue
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* @param {{
|
|
726
|
+
* isOpen: boolean
|
|
727
|
+
* }} params - Parameters of this method.
|
|
728
|
+
*/
|
|
729
|
+
onUpdateOpenPopover ({
|
|
730
|
+
isOpen,
|
|
731
|
+
}) {
|
|
732
|
+
this.internalOpenPopoverRef.value = isOpen
|
|
733
|
+
|
|
734
|
+
if (isOpen) {
|
|
735
|
+
this.internalSearchKeywordRef.value = ''
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Clear value.
|
|
741
|
+
*
|
|
742
|
+
* @param {{
|
|
743
|
+
* rawEvent: PointerEvent
|
|
744
|
+
* }} params - Parameters of this method.
|
|
745
|
+
*/
|
|
746
|
+
onClearValue ({
|
|
747
|
+
rawEvent,
|
|
748
|
+
}) {
|
|
749
|
+
if (this.isMultiple) {
|
|
750
|
+
this.internalValueRef.value = []
|
|
751
|
+
} else {
|
|
752
|
+
this.internalValueRef.value = null
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
this.internalSearchKeywordRef.value = ''
|
|
756
|
+
|
|
757
|
+
const payload = this.Ctor.EmitPayloadCtor.create({
|
|
758
|
+
rawEvent,
|
|
759
|
+
})
|
|
760
|
+
|
|
761
|
+
this.emit(this.EMIT_EVENT_NAME.UPDATE_VALUE, this.resolveEmittedValue())
|
|
762
|
+
this.emit(this.EMIT_EVENT_NAME.CHANGE_VALUE, payload)
|
|
763
|
+
this.emit(this.EMIT_EVENT_NAME.SEARCH_KEYWORD, '')
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Extract display value.
|
|
768
|
+
*
|
|
769
|
+
* @param {{
|
|
770
|
+
* option: FuroAutocompleteOption
|
|
771
|
+
* }} params - Parameters of this method.
|
|
772
|
+
* @returns {string}
|
|
773
|
+
*/
|
|
774
|
+
extractDisplayValue ({
|
|
775
|
+
option,
|
|
776
|
+
}) {
|
|
777
|
+
if (typeof option === 'string') {
|
|
778
|
+
return option
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
return this.resolveOptionLabel({ option })
|
|
782
|
+
?? ''
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* Whether the select all option should be shown.
|
|
787
|
+
*
|
|
788
|
+
* @returns {boolean}
|
|
789
|
+
*/
|
|
790
|
+
shouldShowSelectAllOption () {
|
|
791
|
+
return Boolean(this.parcel?.showSelectAll)
|
|
792
|
+
&& this.isMultiple
|
|
793
|
+
&& !this.loading
|
|
794
|
+
&& this.filteredOptions().length > 0
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Compare two options. Returns true if the options are the same.
|
|
799
|
+
*
|
|
800
|
+
* @param {{
|
|
801
|
+
* optionA: FuroAutocompleteOption | FuroAcceptableValue
|
|
802
|
+
* optionB: FuroAutocompleteOption | FuroAcceptableValue
|
|
803
|
+
* }} params - Parameters of this method.
|
|
804
|
+
* @returns {boolean}
|
|
805
|
+
*/
|
|
806
|
+
compareOption ({
|
|
807
|
+
optionA,
|
|
808
|
+
optionB,
|
|
809
|
+
}) {
|
|
810
|
+
if (
|
|
811
|
+
optionA
|
|
812
|
+
&& optionB
|
|
813
|
+
&& typeof optionA === 'object'
|
|
814
|
+
&& typeof optionB === 'object'
|
|
815
|
+
&& 'value' in optionA
|
|
816
|
+
&& 'value' in optionB
|
|
817
|
+
) {
|
|
818
|
+
return JSON.stringify(optionA.value) === JSON.stringify(optionB.value)
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
return optionA === optionB
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* @param {{
|
|
826
|
+
* parentOption: FuroAutocompleteOption | FuroAcceptableValue
|
|
827
|
+
* childOption: FuroAutocompleteOption | FuroAcceptableValue
|
|
828
|
+
* childIndex: number
|
|
829
|
+
* parentIndex: number
|
|
830
|
+
* }} params - Parameters of this method.
|
|
831
|
+
* @returns {number}
|
|
832
|
+
*/
|
|
833
|
+
extractOptionIndex ({
|
|
834
|
+
parentOption,
|
|
835
|
+
childOption,
|
|
836
|
+
childIndex,
|
|
837
|
+
parentIndex,
|
|
838
|
+
}) {
|
|
839
|
+
if (JSON.stringify(parentOption) === JSON.stringify(childOption)) {
|
|
840
|
+
return parentIndex
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
return childIndex
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* @param {{
|
|
848
|
+
* parentOption: FuroAutocompleteOption | FuroAcceptableValue
|
|
849
|
+
* childOption: FuroAutocompleteOption | FuroAcceptableValue
|
|
850
|
+
* parentIndex: number
|
|
851
|
+
* }} params - Parameters of this method.
|
|
852
|
+
* @returns {number | null}
|
|
853
|
+
*/
|
|
854
|
+
extractGroupOptionIndex ({
|
|
855
|
+
parentOption,
|
|
856
|
+
childOption,
|
|
857
|
+
parentIndex,
|
|
858
|
+
}) {
|
|
859
|
+
if (JSON.stringify(parentOption) !== JSON.stringify(childOption)) {
|
|
860
|
+
return parentIndex
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
return null
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* @param {{
|
|
868
|
+
* rawEvent: Reka.SelectItemSelectEvent<FuroAutocompleteOption | FuroAcceptableValue> | null
|
|
869
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
870
|
+
* selectedIndex: number
|
|
871
|
+
* selectedGroupIndex: number | null
|
|
872
|
+
* }} params - Parameters of this method.
|
|
873
|
+
* @returns {AutocompleteRawEvent}
|
|
874
|
+
*/
|
|
875
|
+
buildCustomEmitPayloadEvent ({
|
|
876
|
+
rawEvent,
|
|
877
|
+
option,
|
|
878
|
+
selectedIndex,
|
|
879
|
+
selectedGroupIndex,
|
|
880
|
+
}) {
|
|
881
|
+
return new CustomEvent(this.EMIT_EVENT_NAME.CHANGE_VALUE, {
|
|
882
|
+
detail: {
|
|
883
|
+
target: /** @type {HTMLElement} */ (rawEvent?.target ?? null),
|
|
884
|
+
selectedOption: option,
|
|
885
|
+
isMultiple: this.isMultiple,
|
|
886
|
+
searchKeyword: this.internalSearchKeywordRef.value,
|
|
887
|
+
selectedIndex,
|
|
888
|
+
selectedOptions: Array.isArray(this.internalValueRef.value)
|
|
889
|
+
? this.internalValueRef.value
|
|
890
|
+
: [this.internalValueRef.value],
|
|
891
|
+
selectedGroupIndex,
|
|
892
|
+
},
|
|
893
|
+
})
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* @param {{
|
|
898
|
+
* rawEvent: Reka.SelectItemSelectEvent<FuroAutocompleteOption | FuroAcceptableValue>
|
|
899
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
900
|
+
* selectedIndex: number
|
|
901
|
+
* selectedGroupIndex: number | null
|
|
902
|
+
* }} params - Parameters of this method.
|
|
903
|
+
*/
|
|
904
|
+
onSelectOption ({
|
|
905
|
+
rawEvent,
|
|
906
|
+
option,
|
|
907
|
+
selectedIndex,
|
|
908
|
+
selectedGroupIndex,
|
|
909
|
+
}) {
|
|
910
|
+
if (
|
|
911
|
+
typeof option === 'object'
|
|
912
|
+
&& option?.disabled
|
|
913
|
+
) {
|
|
914
|
+
return
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
if (
|
|
918
|
+
this.isMultiple
|
|
919
|
+
&& Array.isArray(this.internalValueRef.value)
|
|
920
|
+
) {
|
|
921
|
+
const existingOption = this.internalValueRef.value.find(
|
|
922
|
+
it => this.compareOption({
|
|
923
|
+
optionA: it,
|
|
924
|
+
optionB: option,
|
|
925
|
+
})
|
|
926
|
+
)
|
|
927
|
+
const newOptions = existingOption
|
|
928
|
+
? this.internalValueRef.value.filter(
|
|
929
|
+
it => !this.compareOption({
|
|
930
|
+
optionA: it,
|
|
931
|
+
optionB: option,
|
|
932
|
+
})
|
|
933
|
+
)
|
|
934
|
+
: [
|
|
935
|
+
...this.internalValueRef.value,
|
|
936
|
+
option,
|
|
937
|
+
]
|
|
938
|
+
|
|
939
|
+
this.internalValueRef.value = newOptions
|
|
940
|
+
} else {
|
|
941
|
+
this.internalValueRef.value = option
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
const customEvent = this.buildCustomEmitPayloadEvent({
|
|
945
|
+
rawEvent,
|
|
946
|
+
option,
|
|
947
|
+
|
|
948
|
+
selectedIndex,
|
|
949
|
+
selectedGroupIndex,
|
|
950
|
+
})
|
|
951
|
+
const payload = this.Ctor.EmitPayloadCtor.create({
|
|
952
|
+
rawEvent: customEvent,
|
|
953
|
+
})
|
|
954
|
+
|
|
955
|
+
this.emit(this.EMIT_EVENT_NAME.CHANGE_VALUE, payload)
|
|
956
|
+
this.emit(this.EMIT_EVENT_NAME.UPDATE_VALUE, this.resolveEmittedValue())
|
|
957
|
+
|
|
958
|
+
if (this.internalSearchKeywordRef.value.length > 0) {
|
|
959
|
+
this.internalSearchKeywordRef.value = ''
|
|
960
|
+
this.onUpdateOpenPopover({
|
|
961
|
+
isOpen: false,
|
|
962
|
+
})
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* @param {{
|
|
968
|
+
* option: FuroAutocompleteOption
|
|
969
|
+
* }} params - Parameters of this method.
|
|
970
|
+
*/
|
|
971
|
+
onRemoveOption ({
|
|
972
|
+
option,
|
|
973
|
+
}) {
|
|
974
|
+
if (!Array.isArray(this.internalValueRef.value)) {
|
|
975
|
+
return
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
this.internalValueRef.value = this.internalValueRef.value.filter(
|
|
979
|
+
it => !this.compareOption({
|
|
980
|
+
optionA: it,
|
|
981
|
+
optionB: option,
|
|
982
|
+
})
|
|
983
|
+
)
|
|
984
|
+
|
|
985
|
+
const selectedGroupIndex = /** @type {Array<FuroAutocompleteOption>} */ (this.internalValueRef.value)
|
|
986
|
+
.findIndex(parentOption => parentOption.options && parentOption.options?.some(childOption => this.compareOption({
|
|
987
|
+
optionA: childOption,
|
|
988
|
+
optionB: option,
|
|
989
|
+
})))
|
|
990
|
+
|
|
991
|
+
this.emit(this.EMIT_EVENT_NAME.UPDATE_VALUE, this.resolveEmittedValue())
|
|
992
|
+
this.emit(this.EMIT_EVENT_NAME.CHANGE_VALUE, this.buildCustomEmitPayloadEvent({
|
|
993
|
+
rawEvent: null,
|
|
994
|
+
option,
|
|
995
|
+
selectedIndex: this.internalValueRef.value
|
|
996
|
+
.findIndex(it => this.compareOption({
|
|
997
|
+
optionA: it,
|
|
998
|
+
optionB: option,
|
|
999
|
+
})),
|
|
1000
|
+
selectedGroupIndex: selectedGroupIndex > 0
|
|
1001
|
+
? selectedGroupIndex
|
|
1002
|
+
: null,
|
|
1003
|
+
}))
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* @param {{
|
|
1008
|
+
* rawEvent: CustomEvent<FuroAcceptableValue>
|
|
1009
|
+
* }} params - Parameters of this method.
|
|
1010
|
+
*/
|
|
1011
|
+
onSelectSelectAllOption ({
|
|
1012
|
+
rawEvent,
|
|
1013
|
+
}) {
|
|
1014
|
+
if (!this.isMultiple) {
|
|
1015
|
+
return
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
const objectOptions = /** @type {Array<FuroAutocompleteOption>} */ (
|
|
1019
|
+
this.options.filter(it => it && typeof it === 'object')
|
|
1020
|
+
)
|
|
1021
|
+
const primitiveOptions = /** @type {Array<FuroAcceptableValue>} */ (
|
|
1022
|
+
this.options.filter(it => it && typeof it !== 'object')
|
|
1023
|
+
)
|
|
1024
|
+
|
|
1025
|
+
const allObjectOptions = /** @type {Array<FuroAutocompleteOption>} */ (objectOptions.flatMap(it => [it, ...(it?.options ?? [])]))
|
|
1026
|
+
.filter(it => !it?.disabled)
|
|
1027
|
+
const allOptions = [
|
|
1028
|
+
...allObjectOptions,
|
|
1029
|
+
...primitiveOptions,
|
|
1030
|
+
]
|
|
1031
|
+
|
|
1032
|
+
const hasSelectedAllOptions = allOptions.every(it => Array.isArray(this.internalValueRef.value)
|
|
1033
|
+
&& this.internalValueRef.value?.some(
|
|
1034
|
+
selectedOption => this.compareOption({
|
|
1035
|
+
optionA: selectedOption,
|
|
1036
|
+
optionB: it,
|
|
1037
|
+
})
|
|
1038
|
+
)
|
|
1039
|
+
)
|
|
1040
|
+
const newOptions = hasSelectedAllOptions
|
|
1041
|
+
? []
|
|
1042
|
+
: allOptions
|
|
1043
|
+
|
|
1044
|
+
this.internalValueRef.value = newOptions
|
|
1045
|
+
|
|
1046
|
+
const payload = this.Ctor.EmitPayloadCtor.create({
|
|
1047
|
+
rawEvent,
|
|
1048
|
+
})
|
|
1049
|
+
|
|
1050
|
+
this.emit(this.EMIT_EVENT_NAME.CHANGE_VALUE, payload)
|
|
1051
|
+
this.emit(this.EMIT_EVENT_NAME.UPDATE_VALUE, this.resolveEmittedValue())
|
|
1052
|
+
|
|
1053
|
+
this.internalSearchKeywordRef.value = ''
|
|
1054
|
+
this.onUpdateOpenPopover({
|
|
1055
|
+
isOpen: false,
|
|
1056
|
+
})
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Generate the create-option row text with the typed keyword interpolated.
|
|
1061
|
+
*
|
|
1062
|
+
* @returns {string}
|
|
1063
|
+
*/
|
|
1064
|
+
generateCreateOptionText () {
|
|
1065
|
+
const template = this.parcel?.createOptionText
|
|
1066
|
+
?? 'Create "{keyword}"'
|
|
1067
|
+
const trimmedSearchKeyword = this.internalSearchKeywordRef.value.trim()
|
|
1068
|
+
|
|
1069
|
+
return template.replace('{keyword}', trimmedSearchKeyword)
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Whether the trimmed keyword exactly matches an existing option label or value.
|
|
1074
|
+
*
|
|
1075
|
+
* @returns {boolean}
|
|
1076
|
+
*/
|
|
1077
|
+
hasExactOptionMatch () {
|
|
1078
|
+
const trimmedSearchKeyword = this.internalSearchKeywordRef.value
|
|
1079
|
+
.trim()
|
|
1080
|
+
.toLowerCase()
|
|
1081
|
+
|
|
1082
|
+
if (!trimmedSearchKeyword) {
|
|
1083
|
+
return false
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
const flattenedOptions = this.options.flatMap(option => (
|
|
1087
|
+
(option !== null && typeof option === 'object' && Array.isArray(option.options))
|
|
1088
|
+
? [
|
|
1089
|
+
option,
|
|
1090
|
+
...option.options,
|
|
1091
|
+
]
|
|
1092
|
+
: [option]
|
|
1093
|
+
))
|
|
1094
|
+
|
|
1095
|
+
return flattenedOptions.some(option => {
|
|
1096
|
+
const optionLabel = this.extractOptionDisplayValue({ option })
|
|
1097
|
+
const optionValue = (option !== null && typeof option === 'object')
|
|
1098
|
+
? option.value
|
|
1099
|
+
: option
|
|
1100
|
+
|
|
1101
|
+
const normalizedLabel = optionLabel.toLowerCase()
|
|
1102
|
+
const normalizedValue = String(optionValue)
|
|
1103
|
+
.toLowerCase()
|
|
1104
|
+
|
|
1105
|
+
return normalizedLabel === trimmedSearchKeyword
|
|
1106
|
+
|| normalizedValue === trimmedSearchKeyword
|
|
1107
|
+
})
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Whether the create-option row should be shown.
|
|
1112
|
+
*
|
|
1113
|
+
* @returns {boolean}
|
|
1114
|
+
*/
|
|
1115
|
+
shouldShowCreateOption () {
|
|
1116
|
+
return this.creatable
|
|
1117
|
+
&& this.internalSearchKeywordRef.value.trim().length > 0
|
|
1118
|
+
&& !this.hasExactOptionMatch()
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Whether the empty row should be shown.
|
|
1123
|
+
*
|
|
1124
|
+
* @returns {boolean}
|
|
1125
|
+
*/
|
|
1126
|
+
shouldShowEmpty () {
|
|
1127
|
+
return this.hasEmptyOptions()
|
|
1128
|
+
&& !this.shouldShowCreateOption()
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Emit the typed keyword so the parent can create and append a new option.
|
|
1133
|
+
*
|
|
1134
|
+
* @param {{
|
|
1135
|
+
* rawEvent: Reka.SelectItemSelectEvent<FuroAutocompleteOption | FuroAcceptableValue> | null
|
|
1136
|
+
* }} params - Parameters of this method.
|
|
1137
|
+
*/
|
|
1138
|
+
onCreateOption ({
|
|
1139
|
+
rawEvent,
|
|
1140
|
+
}) {
|
|
1141
|
+
const trimmedSearchKeyword = this.internalSearchKeywordRef.value.trim()
|
|
1142
|
+
|
|
1143
|
+
if (!trimmedSearchKeyword) {
|
|
1144
|
+
return
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
const customEvent = this.buildCustomEmitPayloadEvent({
|
|
1148
|
+
rawEvent,
|
|
1149
|
+
option: null,
|
|
1150
|
+
selectedIndex: -1,
|
|
1151
|
+
selectedGroupIndex: null,
|
|
1152
|
+
})
|
|
1153
|
+
const payload = this.Ctor.EmitPayloadCtor.create({
|
|
1154
|
+
rawEvent: customEvent,
|
|
1155
|
+
})
|
|
1156
|
+
|
|
1157
|
+
this.emit(this.EMIT_EVENT_NAME.CREATE_OPTION, payload)
|
|
1158
|
+
|
|
1159
|
+
this.internalSearchKeywordRef.value = ''
|
|
1160
|
+
this.onUpdateOpenPopover({
|
|
1161
|
+
isOpen: false,
|
|
1162
|
+
})
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* @returns {FuroAcceptableValue | Array<FuroAcceptableValue> | null}
|
|
1167
|
+
*/
|
|
1168
|
+
extractListboxModelValue () {
|
|
1169
|
+
if (!Array.isArray(this.internalValueRef.value)) {
|
|
1170
|
+
return this.internalValueRef.value
|
|
1171
|
+
?? null
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
return this.internalValueRef.value
|
|
1175
|
+
?? []
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* @returns {Array<FuroAutocompleteOption | FuroAcceptableValue>}
|
|
1180
|
+
*/
|
|
1181
|
+
filteredOptions () {
|
|
1182
|
+
if (this.loading) {
|
|
1183
|
+
return []
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
if (!this.parcel?.localCompare) {
|
|
1187
|
+
return this.options
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
const objectOptions = /** @type {Array<FuroAutocompleteOption>} */ (
|
|
1191
|
+
this.options.filter(it => it && typeof it === 'object')
|
|
1192
|
+
)
|
|
1193
|
+
const primitiveOptions = /** @type {Array<FuroAcceptableValue>} */ (
|
|
1194
|
+
this.options.filter(it => it && typeof it !== 'object')
|
|
1195
|
+
)
|
|
1196
|
+
|
|
1197
|
+
const trimmedSearchKeyword = this.internalSearchKeywordRef.value.trim()
|
|
1198
|
+
|
|
1199
|
+
const objectFilteredOptions = objectOptions.filter(
|
|
1200
|
+
it => /** @type {Array<FuroAutocompleteOption>} */ (it.options)
|
|
1201
|
+
?.some(childOption =>
|
|
1202
|
+
this.filterCollator.contains(this.resolveOptionLabel({ option: childOption }) ?? '', trimmedSearchKeyword)
|
|
1203
|
+
|| this.filterCollator.contains(String(childOption.value), trimmedSearchKeyword)
|
|
1204
|
+
)
|
|
1205
|
+
|| this.filterCollator.contains(this.resolveOptionLabel({ option: it }) ?? '', trimmedSearchKeyword)
|
|
1206
|
+
|| this.filterCollator.contains(String(it.value), trimmedSearchKeyword)
|
|
1207
|
+
)
|
|
1208
|
+
|
|
1209
|
+
const primitiveFilteredOptions = primitiveOptions.filter(
|
|
1210
|
+
it => this.filterCollator.contains(String(it), trimmedSearchKeyword)
|
|
1211
|
+
)
|
|
1212
|
+
|
|
1213
|
+
return [
|
|
1214
|
+
...objectFilteredOptions,
|
|
1215
|
+
...primitiveFilteredOptions,
|
|
1216
|
+
]
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* @param {{
|
|
1221
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
1222
|
+
* }} params - Parameters of this method.
|
|
1223
|
+
* @returns {boolean}
|
|
1224
|
+
*/
|
|
1225
|
+
shouldShowOptionIcon ({
|
|
1226
|
+
option,
|
|
1227
|
+
}) {
|
|
1228
|
+
if (
|
|
1229
|
+
typeof option !== 'object'
|
|
1230
|
+
|| option === null
|
|
1231
|
+
) {
|
|
1232
|
+
return false
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
return Boolean(option.icon)
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* @param {{
|
|
1240
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
1241
|
+
* }} params - Parameters of this method.
|
|
1242
|
+
* @returns {boolean}
|
|
1243
|
+
*/
|
|
1244
|
+
shouldShowSeparator ({
|
|
1245
|
+
option,
|
|
1246
|
+
}) {
|
|
1247
|
+
if (
|
|
1248
|
+
typeof option !== 'object'
|
|
1249
|
+
|| option === null
|
|
1250
|
+
) {
|
|
1251
|
+
return false
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
return Boolean(option.separator)
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* @param {{
|
|
1259
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
1260
|
+
* }} params - Parameters of this method.
|
|
1261
|
+
* @returns {boolean}
|
|
1262
|
+
*/
|
|
1263
|
+
shouldShowParentSeparator ({
|
|
1264
|
+
option,
|
|
1265
|
+
}) {
|
|
1266
|
+
if (
|
|
1267
|
+
typeof option !== 'object'
|
|
1268
|
+
|| option === null
|
|
1269
|
+
) {
|
|
1270
|
+
return false
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
return Boolean(option.separator)
|
|
1274
|
+
&& Array.isArray(option.options)
|
|
1275
|
+
&& option.options.length > 0
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* @param {{
|
|
1280
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
1281
|
+
* }} params - Parameters of this method.
|
|
1282
|
+
* @returns {boolean}
|
|
1283
|
+
*/
|
|
1284
|
+
shouldDisableOption ({
|
|
1285
|
+
option,
|
|
1286
|
+
}) {
|
|
1287
|
+
if (
|
|
1288
|
+
typeof option !== 'object'
|
|
1289
|
+
|| option === null
|
|
1290
|
+
) {
|
|
1291
|
+
return false
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
return Boolean(option?.disabled)
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* @param {{
|
|
1299
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
1300
|
+
* }} params - Parameters of this method.
|
|
1301
|
+
* @returns {string}
|
|
1302
|
+
*/
|
|
1303
|
+
extractOptionDisplayValue ({
|
|
1304
|
+
option,
|
|
1305
|
+
}) {
|
|
1306
|
+
if (typeof option !== 'object') {
|
|
1307
|
+
return String(option)
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
return String(this.resolveOptionLabel({ option }) ?? '')
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* @param {{
|
|
1315
|
+
* option: FuroAutocompleteOption | FuroAcceptableValue
|
|
1316
|
+
* }} params - Parameters of this method.
|
|
1317
|
+
* @returns {import('./AutocompleteEmitPayload.js').IconProps | null}
|
|
1318
|
+
*/
|
|
1319
|
+
extractOptionIcon ({
|
|
1320
|
+
option,
|
|
1321
|
+
}) {
|
|
1322
|
+
if (
|
|
1323
|
+
typeof option !== 'object'
|
|
1324
|
+
|| option === null
|
|
1325
|
+
) {
|
|
1326
|
+
return null
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
return /** @type {import('./AutocompleteEmitPayload.js').IconProps} */ (option.icon)
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Extract empty text.
|
|
1334
|
+
*
|
|
1335
|
+
* @returns {string}
|
|
1336
|
+
*/
|
|
1337
|
+
extractEmptyText () {
|
|
1338
|
+
return this.parcel?.emptyText
|
|
1339
|
+
?? 'No options.'
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* Extract select all text.
|
|
1344
|
+
*
|
|
1345
|
+
* @returns {string}
|
|
1346
|
+
*/
|
|
1347
|
+
extractSelectAllText () {
|
|
1348
|
+
return this.parcel?.selectAllText
|
|
1349
|
+
?? 'Select All'
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* Extract text direction value.
|
|
1354
|
+
*
|
|
1355
|
+
* @returns {'ltr' | 'rtl'}
|
|
1356
|
+
*/
|
|
1357
|
+
extractTextDirectionValue () {
|
|
1358
|
+
if (!this.parcel?.textDirection) {
|
|
1359
|
+
return 'ltr'
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
return this.parcel.textDirection === 'toRight'
|
|
1363
|
+
? 'ltr'
|
|
1364
|
+
: 'rtl'
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* Extract placeholder text.
|
|
1369
|
+
*
|
|
1370
|
+
* @returns {string}
|
|
1371
|
+
*/
|
|
1372
|
+
extractPlaceholderText () {
|
|
1373
|
+
return this.parcel?.placeholder
|
|
1374
|
+
?? 'Select an option'
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* @typedef {import('../../../contexts/BaseFuroContext.js').BaseFuroContextParams & {
|
|
1380
|
+
* props: Props
|
|
1381
|
+
* componentContext: ComponentContext
|
|
1382
|
+
* refHash: {
|
|
1383
|
+
* triggerContentElementRef: import('vue').Ref<HTMLElement | null>
|
|
1384
|
+
* internalValueRef: import('vue').Ref<FuroAutocompleteOption | null>
|
|
1385
|
+
* internalSearchKeywordRef: import('vue').Ref<string>
|
|
1386
|
+
* internalOpenPopoverRef: import('vue').Ref<boolean>
|
|
1387
|
+
* }
|
|
1388
|
+
* filterCollator: ReturnType<typeof import('reka-ui').useFilter>
|
|
1389
|
+
* }} FuroAutocompleteFieldContextParams
|
|
1390
|
+
*/
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* @typedef {Omit<FuroAutocompleteFieldContextParams, 'refHash'> & {
|
|
1394
|
+
* refHash?: FuroAutocompleteFieldContextParams['refHash']
|
|
1395
|
+
* filterCollator: ReturnType<typeof import('reka-ui').useFilter>
|
|
1396
|
+
* }} FuroAutocompleteFieldContextFactoryParams
|
|
1397
|
+
*/
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* @typedef {keyof typeof FuroAutocompleteFieldContext.EMIT_EVENT_NAME} EmitEventName
|
|
1401
|
+
*/
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* @typedef {string | number | bigint | Record<string, unknown> | null} FuroAcceptableValue
|
|
1405
|
+
*/
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* @typedef {import('vue').HTMLAttributes & {
|
|
1409
|
+
* parcel?: FuroAutocompleteFieldParcel | null
|
|
1410
|
+
* }} Props
|
|
1411
|
+
*/
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* Closed-set Furo behavior for `<FuroAutocompleteField>`.
|
|
1415
|
+
* JSON-serializable only. Not an open passthrough to the internal combobox library.
|
|
1416
|
+
*
|
|
1417
|
+
* @typedef {{
|
|
1418
|
+
* value?: FuroAutocompleteOption | Array<FuroAutocompleteOption> | FuroAcceptableValue | Array<FuroAcceptableValue> | null
|
|
1419
|
+
* options?: Array<FuroAutocompleteOption | FuroAcceptableValue>
|
|
1420
|
+
* optionLabel?: string | ((option: FuroAutocompleteOption | FuroAcceptableValue) => string)
|
|
1421
|
+
* optionValue?: string | ((option: FuroAutocompleteOption | FuroAcceptableValue) => FuroAcceptableValue)
|
|
1422
|
+
* placeholder?: string | null
|
|
1423
|
+
* loading?: boolean
|
|
1424
|
+
* invalid?: boolean
|
|
1425
|
+
* disabled?: boolean
|
|
1426
|
+
* textDirection?: 'toRight' | 'toLeft'
|
|
1427
|
+
* multiple?: boolean
|
|
1428
|
+
* showClear?: boolean
|
|
1429
|
+
* searchKeyword?: string
|
|
1430
|
+
* localCompare?: boolean
|
|
1431
|
+
* debounceMilliseconds?: number
|
|
1432
|
+
* open?: boolean
|
|
1433
|
+
* openOnClick?: boolean
|
|
1434
|
+
* showSelectAll?: boolean
|
|
1435
|
+
* selectAllText?: string
|
|
1436
|
+
* emptyText?: string
|
|
1437
|
+
* creatable?: boolean
|
|
1438
|
+
* createOptionText?: string
|
|
1439
|
+
* maxVisibleChips?: number
|
|
1440
|
+
* chipOverflow?: 'wrap' | 'ellipsis'
|
|
1441
|
+
* }} FuroAutocompleteFieldParcel
|
|
1442
|
+
*/
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* @typedef {FuroAutocompleteFieldParcel} ExtraRootParcel
|
|
1446
|
+
* @deprecated Use {@link FuroAutocompleteFieldParcel} instead.
|
|
1447
|
+
*/
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* @typedef {import('vue').SetupContext<FuroAutocompleteFieldEmitHash, FuroAutocompleteFieldSlots>} ComponentContext
|
|
1451
|
+
*/
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* @typedef {typeof FuroAutocompleteFieldContext.EMIT_EVENT_HASH} FuroAutocompleteFieldEmitHash
|
|
1455
|
+
*/
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* @typedef {import('vue').SlotsType<{
|
|
1459
|
+
* 'trigger-content': {}
|
|
1460
|
+
* 'trigger-left': {}
|
|
1461
|
+
* 'trigger-right': {}
|
|
1462
|
+
* cancel: {}
|
|
1463
|
+
* 'content-before': {}
|
|
1464
|
+
* 'content-after': {}
|
|
1465
|
+
* 'select-all': {
|
|
1466
|
+
* checked: boolean
|
|
1467
|
+
* indeterminate: boolean
|
|
1468
|
+
* disabled: boolean
|
|
1469
|
+
* }
|
|
1470
|
+
* 'create-option': {
|
|
1471
|
+
* searchKeyword: string
|
|
1472
|
+
* }
|
|
1473
|
+
* group: {
|
|
1474
|
+
* group: FuroAutocompleteOption
|
|
1475
|
+
* groupIndex: number
|
|
1476
|
+
* }
|
|
1477
|
+
* 'group-label': {
|
|
1478
|
+
* group: FuroAutocompleteOption
|
|
1479
|
+
* groupIndex: number
|
|
1480
|
+
* }
|
|
1481
|
+
* option: {
|
|
1482
|
+
* option: FuroAutocompleteOption
|
|
1483
|
+
* optionIndex: number
|
|
1484
|
+
* group?: FuroAutocompleteOption
|
|
1485
|
+
* groupIndex?: number
|
|
1486
|
+
* }
|
|
1487
|
+
* 'option-text': {
|
|
1488
|
+
* option: FuroAutocompleteOption
|
|
1489
|
+
* optionIndex: number
|
|
1490
|
+
* }
|
|
1491
|
+
* 'option-indicator': {
|
|
1492
|
+
* option: FuroAutocompleteOption
|
|
1493
|
+
* optionIndex: number
|
|
1494
|
+
* }
|
|
1495
|
+
* separator: {
|
|
1496
|
+
* option: FuroAutocompleteOption
|
|
1497
|
+
* optionIndex: number
|
|
1498
|
+
* }
|
|
1499
|
+
* empty: {
|
|
1500
|
+
* searchKeyword: string
|
|
1501
|
+
* loading: boolean
|
|
1502
|
+
* }
|
|
1503
|
+
* loading: {
|
|
1504
|
+
* searchKeyword: string
|
|
1505
|
+
* }
|
|
1506
|
+
* }>} FuroAutocompleteFieldSlots
|
|
1507
|
+
*/
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* @typedef {(
|
|
1511
|
+
* props: Props,
|
|
1512
|
+
* componentContext: ComponentContext
|
|
1513
|
+
* ) => {
|
|
1514
|
+
* context: FuroAutocompleteFieldContext
|
|
1515
|
+
* }} FuroAutocompleteFieldSetup
|
|
1516
|
+
*/
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* @typedef {import('./AutocompleteEmitPayload.js').FuroAutocompleteOption} FuroAutocompleteOption
|
|
1520
|
+
* @typedef {import('./AutocompleteEmitPayload.js').AutocompleteRawEvent} AutocompleteRawEvent
|
|
1521
|
+
*/
|
|
1522
|
+
|
|
1523
|
+
/**
|
|
1524
|
+
* @import * as Reka from 'reka-ui'
|
|
1525
|
+
*/
|