@ghostvue/vue 0.0.0-stage → 0.1.0
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 +22 -0
- package/README.md +40 -2
- package/dist/.registries/component-names.generated.d.ts +3 -0
- package/dist/GhostAccordion.vue.d.ts +38 -0
- package/dist/GhostAccordionContent.vue.d.ts +26 -0
- package/dist/GhostAccordionItem.vue.d.ts +20 -0
- package/dist/GhostAccordionTrigger.vue.d.ts +23 -0
- package/dist/GhostAvatar.vue.d.ts +27 -0
- package/dist/GhostBadge.vue.d.ts +16 -0
- package/dist/GhostBreadcrumb.vue.d.ts +28 -0
- package/dist/GhostBreadcrumbEllipsis.vue.d.ts +20 -0
- package/dist/GhostBreadcrumbItem.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbLink.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbList.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbPage.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbSeparator.vue.d.ts +25 -0
- package/dist/GhostButton.vue.d.ts +25 -0
- package/dist/GhostCalendar.vue.d.ts +57 -0
- package/dist/GhostCalendarCell.vue.d.ts +35 -0
- package/dist/GhostCalendarGrid.vue.d.ts +19 -0
- package/dist/GhostCalendarHeader.vue.d.ts +24 -0
- package/dist/GhostCalendarHeading.vue.d.ts +22 -0
- package/dist/GhostCalendarNextButton.vue.d.ts +24 -0
- package/dist/GhostCalendarPrevButton.vue.d.ts +24 -0
- package/dist/GhostCard.vue.d.ts +18 -0
- package/dist/GhostCheckbox.vue.d.ts +48 -0
- package/dist/GhostCollapsible.vue.d.ts +31 -0
- package/dist/GhostCollapsibleContent.vue.d.ts +30 -0
- package/dist/GhostCollapsibleTrigger.vue.d.ts +28 -0
- package/dist/GhostCombobox.vue.d.ts +69 -0
- package/dist/GhostComboboxContent.vue.d.ts +41 -0
- package/dist/GhostComboboxEmpty.vue.d.ts +21 -0
- package/dist/GhostComboboxGroup.vue.d.ts +21 -0
- package/dist/GhostComboboxInput.vue.d.ts +11 -0
- package/dist/GhostComboboxLabel.vue.d.ts +21 -0
- package/dist/GhostComboboxOption.vue.d.ts +29 -0
- package/dist/GhostComboboxTrigger.vue.d.ts +26 -0
- package/dist/GhostCommandPalette.vue.d.ts +57 -0
- package/dist/GhostCommandPaletteContent.vue.d.ts +47 -0
- package/dist/GhostCommandPaletteEmpty.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteGroup.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteInput.vue.d.ts +13 -0
- package/dist/GhostCommandPaletteItem.vue.d.ts +33 -0
- package/dist/GhostCommandPaletteLabel.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteList.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteOverlay.vue.d.ts +32 -0
- package/dist/GhostCommandPaletteSeparator.vue.d.ts +10 -0
- package/dist/GhostCommandPaletteTitle.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteTrigger.vue.d.ts +28 -0
- package/dist/GhostContextMenu.vue.d.ts +26 -0
- package/dist/GhostContextMenuCheckboxItem.vue.d.ts +63 -0
- package/dist/GhostContextMenuContent.vue.d.ts +39 -0
- package/dist/GhostContextMenuGroup.vue.d.ts +21 -0
- package/dist/GhostContextMenuItem.vue.d.ts +30 -0
- package/dist/GhostContextMenuLabel.vue.d.ts +21 -0
- package/dist/GhostContextMenuRadioGroup.vue.d.ts +31 -0
- package/dist/GhostContextMenuRadioItem.vue.d.ts +31 -0
- package/dist/GhostContextMenuSeparator.vue.d.ts +11 -0
- package/dist/GhostContextMenuTrigger.vue.d.ts +28 -0
- package/dist/GhostDataTable.vue.d.ts +29 -0
- package/dist/GhostDataTablePreset.vue.d.ts +21 -0
- package/dist/GhostDataTableTable.vue.d.ts +20 -0
- package/dist/GhostDatePicker.vue.d.ts +106 -0
- package/dist/GhostDatePickerCalendar.vue.d.ts +16 -0
- package/dist/GhostDatePickerContent.vue.d.ts +46 -0
- package/dist/GhostDatePickerInput.vue.d.ts +19 -0
- package/dist/GhostDatePickerTrigger.vue.d.ts +14 -0
- package/dist/GhostDialog.vue.d.ts +31 -0
- package/dist/GhostDialogClose.vue.d.ts +28 -0
- package/dist/GhostDialogContent.vue.d.ts +50 -0
- package/dist/GhostDialogDescription.vue.d.ts +25 -0
- package/dist/GhostDialogOverlay.vue.d.ts +32 -0
- package/dist/GhostDialogTitle.vue.d.ts +25 -0
- package/dist/GhostDialogTrigger.vue.d.ts +28 -0
- package/dist/GhostDrawer.vue.d.ts +39 -0
- package/dist/GhostDrawerClose.vue.d.ts +28 -0
- package/dist/GhostDrawerContent.vue.d.ts +47 -0
- package/dist/GhostDrawerDescription.vue.d.ts +25 -0
- package/dist/GhostDrawerOverlay.vue.d.ts +32 -0
- package/dist/GhostDrawerTitle.vue.d.ts +25 -0
- package/dist/GhostDrawerTrigger.vue.d.ts +28 -0
- package/dist/GhostDropdownMenu.vue.d.ts +26 -0
- package/dist/GhostDropdownMenuCheckboxItem.vue.d.ts +63 -0
- package/dist/GhostDropdownMenuContent.vue.d.ts +39 -0
- package/dist/GhostDropdownMenuGroup.vue.d.ts +21 -0
- package/dist/GhostDropdownMenuItem.vue.d.ts +30 -0
- package/dist/GhostDropdownMenuLabel.vue.d.ts +21 -0
- package/dist/GhostDropdownMenuRadioGroup.vue.d.ts +31 -0
- package/dist/GhostDropdownMenuRadioItem.vue.d.ts +31 -0
- package/dist/GhostDropdownMenuSeparator.vue.d.ts +11 -0
- package/dist/GhostDropdownMenuTrigger.vue.d.ts +26 -0
- package/dist/GhostEmptyState.vue.d.ts +19 -0
- package/dist/GhostField.vue.d.ts +28 -0
- package/dist/GhostFieldControl.vue.d.ts +13 -0
- package/dist/GhostFieldDescription.vue.d.ts +21 -0
- package/dist/GhostFieldError.vue.d.ts +21 -0
- package/dist/GhostFieldLabel.vue.d.ts +30 -0
- package/dist/GhostFileUpload.vue.d.ts +64 -0
- package/dist/GhostFileUploadDropzone.vue.d.ts +13 -0
- package/dist/GhostFileUploadItem.vue.d.ts +17 -0
- package/dist/GhostFileUploadItemRemove.vue.d.ts +13 -0
- package/dist/GhostFileUploadList.vue.d.ts +13 -0
- package/dist/GhostFileUploadTrigger.vue.d.ts +19 -0
- package/dist/GhostHoverCard.vue.d.ts +37 -0
- package/dist/GhostHoverCardContent.vue.d.ts +47 -0
- package/dist/GhostHoverCardTrigger.vue.d.ts +28 -0
- package/dist/GhostInlineAlert.vue.d.ts +19 -0
- package/dist/GhostInput.vue.d.ts +26 -0
- package/dist/GhostInteractiveSurface.vue.d.ts +25 -0
- package/dist/GhostKbd.vue.d.ts +25 -0
- package/dist/GhostLink.vue.d.ts +25 -0
- package/dist/GhostMenubar.vue.d.ts +27 -0
- package/dist/GhostMenubarCheckboxItem.vue.d.ts +63 -0
- package/dist/GhostMenubarContent.vue.d.ts +39 -0
- package/dist/GhostMenubarGroup.vue.d.ts +21 -0
- package/dist/GhostMenubarItem.vue.d.ts +30 -0
- package/dist/GhostMenubarLabel.vue.d.ts +21 -0
- package/dist/GhostMenubarMenu.vue.d.ts +26 -0
- package/dist/GhostMenubarRadioGroup.vue.d.ts +31 -0
- package/dist/GhostMenubarRadioItem.vue.d.ts +31 -0
- package/dist/GhostMenubarSeparator.vue.d.ts +11 -0
- package/dist/GhostMenubarTrigger.vue.d.ts +26 -0
- package/dist/GhostNumberInput.vue.d.ts +37 -0
- package/dist/GhostPagination.vue.d.ts +53 -0
- package/dist/GhostPopover.vue.d.ts +28 -0
- package/dist/GhostPopoverClose.vue.d.ts +28 -0
- package/dist/GhostPopoverContent.vue.d.ts +47 -0
- package/dist/GhostPopoverTrigger.vue.d.ts +28 -0
- package/dist/GhostPortal.vue.d.ts +28 -0
- package/dist/GhostProgress.vue.d.ts +14 -0
- package/dist/GhostRadioGroup.vue.d.ts +36 -0
- package/dist/GhostRadioGroupItem.vue.d.ts +10 -0
- package/dist/GhostScrollArea.vue.d.ts +17 -0
- package/dist/GhostScrollSpy.vue.d.ts +57 -0
- package/dist/GhostScrollSpyItem.vue.d.ts +26 -0
- package/dist/GhostScrollSpyLink.vue.d.ts +27 -0
- package/dist/GhostScrollSpyList.vue.d.ts +24 -0
- package/dist/GhostSegmentedControl.vue.d.ts +44 -0
- package/dist/GhostSegmentedControlIndicator.vue.d.ts +3 -0
- package/dist/GhostSegmentedControlItem.vue.d.ts +30 -0
- package/dist/GhostSelect.vue.d.ts +51 -0
- package/dist/GhostSelectContent.vue.d.ts +41 -0
- package/dist/GhostSelectGroup.vue.d.ts +21 -0
- package/dist/GhostSelectLabel.vue.d.ts +21 -0
- package/dist/GhostSelectOption.vue.d.ts +29 -0
- package/dist/GhostSelectTrigger.vue.d.ts +26 -0
- package/dist/GhostSelectValue.vue.d.ts +17 -0
- package/dist/GhostSeparator.vue.d.ts +7 -0
- package/dist/GhostSkeleton.vue.d.ts +18 -0
- package/dist/GhostSlider.vue.d.ts +141 -0
- package/dist/GhostSpinner.vue.d.ts +8 -0
- package/dist/GhostSwitch.vue.d.ts +37 -0
- package/dist/GhostTable.vue.d.ts +15 -0
- package/dist/GhostTableBody.vue.d.ts +13 -0
- package/dist/GhostTableCaption.vue.d.ts +13 -0
- package/dist/GhostTableCell.vue.d.ts +13 -0
- package/dist/GhostTableFoot.vue.d.ts +13 -0
- package/dist/GhostTableHead.vue.d.ts +13 -0
- package/dist/GhostTableHeaderCell.vue.d.ts +13 -0
- package/dist/GhostTableRow.vue.d.ts +13 -0
- package/dist/GhostTabs.vue.d.ts +37 -0
- package/dist/GhostTabsContent.vue.d.ts +27 -0
- package/dist/GhostTabsList.vue.d.ts +25 -0
- package/dist/GhostTabsTrigger.vue.d.ts +30 -0
- package/dist/GhostTextarea.vue.d.ts +29 -0
- package/dist/GhostToast.vue.d.ts +17 -0
- package/dist/GhostToastAction.vue.d.ts +17 -0
- package/dist/GhostToastClose.vue.d.ts +16 -0
- package/dist/GhostToastDescription.vue.d.ts +12 -0
- package/dist/GhostToastProvider.vue.d.ts +24 -0
- package/dist/GhostToastTitle.vue.d.ts +12 -0
- package/dist/GhostToastViewport.vue.d.ts +25 -0
- package/dist/GhostToggleGroup.vue.d.ts +41 -0
- package/dist/GhostToggleGroupItem.vue.d.ts +30 -0
- package/dist/GhostToolbar.vue.d.ts +29 -0
- package/dist/GhostTooltip.vue.d.ts +36 -0
- package/dist/GhostTooltipContent.vue.d.ts +47 -0
- package/dist/GhostTooltipProvider.vue.d.ts +16 -0
- package/dist/GhostTooltipTrigger.vue.d.ts +28 -0
- package/dist/GhostTree.vue.d.ts +59 -0
- package/dist/GhostTreeGroup.vue.d.ts +22 -0
- package/dist/GhostTreeItem.vue.d.ts +27 -0
- package/dist/GhostTreeTrigger.vue.d.ts +25 -0
- package/dist/GhostVisuallyHidden.vue.d.ts +19 -0
- package/dist/accordion-header-keyboard.d.ts +11 -0
- package/dist/calendar-date-math.d.ts +16 -0
- package/dist/calendar-intl.d.ts +7 -0
- package/dist/calendar-public-date.d.ts +1 -0
- package/dist/command-palette-context.d.ts +6 -0
- package/dist/data-table-interaction.d.ts +57 -0
- package/dist/data-table-processing.d.ts +32 -0
- package/dist/data-table-render.d.ts +40 -0
- package/dist/data-table-slot-bindings.d.ts +21 -0
- package/dist/date-picker-calendar-bridge.d.ts +25 -0
- package/dist/date-picker-value.d.ts +33 -0
- package/dist/define-data-table-columns.d.ts +89 -0
- package/dist/dev-codes.d.ts +143 -0
- package/dist/dialog-shared.d.ts +169 -0
- package/dist/dismissable-layer-stack.d.ts +27 -0
- package/dist/form-reset.d.ts +21 -0
- package/dist/get-pagination-range.d.ts +24 -0
- package/dist/get-tabbable-elements.d.ts +22 -0
- package/dist/ghost-accordion.d.ts +120 -0
- package/dist/ghost-avatar.d.ts +41 -0
- package/dist/ghost-badge.d.ts +11 -0
- package/dist/ghost-breadcrumb.d.ts +114 -0
- package/dist/ghost-button.d.ts +39 -0
- package/dist/ghost-calendar.d.ts +148 -0
- package/dist/ghost-card.d.ts +29 -0
- package/dist/ghost-checkbox.d.ts +51 -0
- package/dist/ghost-collapsible.d.ts +104 -0
- package/dist/ghost-combobox.d.ts +217 -0
- package/dist/ghost-command-palette.d.ts +377 -0
- package/dist/ghost-context-menu.d.ts +226 -0
- package/dist/ghost-data-table-preset.d.ts +107 -0
- package/dist/ghost-data-table-table.d.ts +76 -0
- package/dist/ghost-data-table.d.ts +508 -0
- package/dist/ghost-date-picker.d.ts +301 -0
- package/dist/ghost-dialog.d.ts +254 -0
- package/dist/ghost-drawer.d.ts +268 -0
- package/dist/ghost-dropdown-menu.d.ts +226 -0
- package/dist/ghost-empty-state.d.ts +26 -0
- package/dist/ghost-field.d.ts +151 -0
- package/dist/ghost-file-upload-accept.d.ts +32 -0
- package/dist/ghost-file-upload-messages.d.ts +14 -0
- package/dist/ghost-file-upload.d.ts +325 -0
- package/dist/ghost-hover-card.d.ts +192 -0
- package/dist/ghost-inline-alert.d.ts +34 -0
- package/dist/ghost-input.d.ts +71 -0
- package/dist/ghost-interactive-surface.d.ts +41 -0
- package/dist/ghost-kbd.d.ts +39 -0
- package/dist/ghost-link.d.ts +58 -0
- package/dist/ghost-menubar.d.ts +260 -0
- package/dist/ghost-number-input.d.ts +88 -0
- package/dist/ghost-pagination.d.ts +92 -0
- package/dist/ghost-popover.d.ts +188 -0
- package/dist/ghost-portal.d.ts +21 -0
- package/dist/ghost-progress.d.ts +40 -0
- package/dist/ghost-radio-group.d.ts +100 -0
- package/dist/ghost-scroll-area.d.ts +46 -0
- package/dist/ghost-scroll-spy.d.ts +150 -0
- package/dist/ghost-segmented-control.d.ts +124 -0
- package/dist/ghost-select.d.ts +131 -0
- package/dist/ghost-separator.d.ts +33 -0
- package/dist/ghost-skeleton.d.ts +14 -0
- package/dist/ghost-slider.d.ts +99 -0
- package/dist/ghost-spinner.d.ts +22 -0
- package/dist/ghost-switch.d.ts +77 -0
- package/dist/ghost-table.d.ts +62 -0
- package/dist/ghost-tabs.d.ts +154 -0
- package/dist/ghost-textarea.d.ts +78 -0
- package/dist/ghost-toast.d.ts +219 -0
- package/dist/ghost-toggle-group.d.ts +123 -0
- package/dist/ghost-toolbar.d.ts +23 -0
- package/dist/ghost-tooltip-provider.d.ts +37 -0
- package/dist/ghost-tooltip.d.ts +190 -0
- package/dist/ghost-tree.d.ts +355 -0
- package/dist/ghost-visually-hidden.d.ts +27 -0
- package/dist/ghostvue.js +17534 -0
- package/dist/has-tabbable-descendants.d.ts +2 -0
- package/dist/index.d.ts +307 -0
- package/dist/invoke-attr-handler.d.ts +15 -0
- package/dist/is-ime-composing.d.ts +28 -0
- package/dist/manifest.json +17098 -0
- package/dist/measure-scroll-overflow.d.ts +6 -0
- package/dist/menu-item-activation.d.ts +39 -0
- package/dist/resolver.d.ts +49 -0
- package/dist/resolver.js +14 -0
- package/dist/scroll-spy-motion.d.ts +26 -0
- package/dist/sort-by-document-order.d.ts +23 -0
- package/dist/sync-calendar-focus-tab-stops.d.ts +2 -0
- package/dist/sync-segmented-control-item-order.d.ts +5 -0
- package/dist/sync-tabs-selection-tab-stops.d.ts +7 -0
- package/dist/sync-toggle-group-selection-tab-stops.d.ts +14 -0
- package/dist/typeahead-match.d.ts +15 -0
- package/dist/use-collapsible-content-hidden.d.ts +28 -0
- package/dist/use-controllable-state.d.ts +20 -0
- package/dist/use-dismissable-layer.d.ts +40 -0
- package/dist/use-floating.d.ts +38 -0
- package/dist/use-focus-scope.d.ts +34 -0
- package/dist/use-ghost-accordion.d.ts +5 -0
- package/dist/use-ghost-avatar.d.ts +28 -0
- package/dist/use-ghost-badge.d.ts +13 -0
- package/dist/use-ghost-breadcrumb.d.ts +19 -0
- package/dist/use-ghost-button.d.ts +18 -0
- package/dist/use-ghost-calendar.d.ts +3 -0
- package/dist/use-ghost-card.d.ts +15 -0
- package/dist/use-ghost-checkbox.d.ts +24 -0
- package/dist/use-ghost-collapsible.d.ts +8 -0
- package/dist/use-ghost-combobox.d.ts +65 -0
- package/dist/use-ghost-command-palette.d.ts +24 -0
- package/dist/use-ghost-context-menu.d.ts +14 -0
- package/dist/use-ghost-data-table.d.ts +55 -0
- package/dist/use-ghost-date-picker.d.ts +11 -0
- package/dist/use-ghost-dialog.d.ts +10 -0
- package/dist/use-ghost-drawer.d.ts +11 -0
- package/dist/use-ghost-dropdown-menu.d.ts +5 -0
- package/dist/use-ghost-empty-state.d.ts +18 -0
- package/dist/use-ghost-field-part-content.d.ts +15 -0
- package/dist/use-ghost-field.d.ts +10 -0
- package/dist/use-ghost-file-upload.d.ts +16 -0
- package/dist/use-ghost-hover-card.d.ts +8 -0
- package/dist/use-ghost-id.d.ts +6 -0
- package/dist/use-ghost-inline-alert.d.ts +20 -0
- package/dist/use-ghost-input.d.ts +29 -0
- package/dist/use-ghost-interactive-surface.d.ts +21 -0
- package/dist/use-ghost-kbd.d.ts +35 -0
- package/dist/use-ghost-link.d.ts +20 -0
- package/dist/use-ghost-menu-collection.d.ts +19 -0
- package/dist/use-ghost-menubar-menu.d.ts +3 -0
- package/dist/use-ghost-menubar.d.ts +10 -0
- package/dist/use-ghost-number-input.d.ts +63 -0
- package/dist/use-ghost-pagination.d.ts +22 -0
- package/dist/use-ghost-popover.d.ts +8 -0
- package/dist/use-ghost-progress.d.ts +33 -0
- package/dist/use-ghost-radio-group.d.ts +5 -0
- package/dist/use-ghost-scroll-area.d.ts +23 -0
- package/dist/use-ghost-scroll-spy.d.ts +25 -0
- package/dist/use-ghost-segmented-control.d.ts +6 -0
- package/dist/use-ghost-select.d.ts +52 -0
- package/dist/use-ghost-separator.d.ts +19 -0
- package/dist/use-ghost-skeleton.d.ts +19 -0
- package/dist/use-ghost-slider.d.ts +65 -0
- package/dist/use-ghost-spinner.d.ts +18 -0
- package/dist/use-ghost-switch.d.ts +39 -0
- package/dist/use-ghost-table.d.ts +70 -0
- package/dist/use-ghost-tabs.d.ts +5 -0
- package/dist/use-ghost-textarea.d.ts +44 -0
- package/dist/use-ghost-toast.d.ts +56 -0
- package/dist/use-ghost-toggle-group.d.ts +6 -0
- package/dist/use-ghost-toolbar.d.ts +23 -0
- package/dist/use-ghost-tooltip.d.ts +8 -0
- package/dist/use-ghost-tree.d.ts +14 -0
- package/dist/use-ghost-visually-hidden.d.ts +35 -0
- package/dist/use-inert-others.d.ts +20 -0
- package/dist/use-roving-focus.d.ts +20 -0
- package/dist/use-scroll-lock.d.ts +13 -0
- package/package.json +59 -4
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { type Component, type ComputedRef, type InjectionKey, type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
/** Single (`string | undefined`) or multiple (`string[]`) selection. */
|
|
3
|
+
export type GhostTreeSelectionMode = 'single' | 'multiple';
|
|
4
|
+
/**
|
|
5
|
+
* Committed selection. `string | undefined` in `'single'` mode and `string[]`
|
|
6
|
+
* in `'multiple'` mode.
|
|
7
|
+
*/
|
|
8
|
+
export type GhostTreeValue = string | string[] | undefined;
|
|
9
|
+
/** Writing direction used to map `ArrowRight` / `ArrowLeft`. */
|
|
10
|
+
export type GhostTreeDirection = 'ltr' | 'rtl';
|
|
11
|
+
/**
|
|
12
|
+
* Pointer action of a {@link GhostTreeTrigger}: `'both'` selects and (for
|
|
13
|
+
* branches with `expandOnClick`) toggles, `'toggle'` only toggles expansion,
|
|
14
|
+
* `'select'` only selects.
|
|
15
|
+
*/
|
|
16
|
+
export type GhostTreeTriggerAction = 'both' | 'toggle' | 'select';
|
|
17
|
+
/** Valid `as` targets for {@link GhostTree}. */
|
|
18
|
+
export type GhostTreeElement = string | Component;
|
|
19
|
+
/** Valid `as` targets for {@link GhostTreeItem}. */
|
|
20
|
+
export type GhostTreeItemElement = string | Component;
|
|
21
|
+
/** Valid `as` targets for {@link GhostTreeTrigger}. */
|
|
22
|
+
export type GhostTreeTriggerElement = string | Component;
|
|
23
|
+
/** Valid `as` targets for {@link GhostTreeGroup}. */
|
|
24
|
+
export type GhostTreeGroupElement = string | Component;
|
|
25
|
+
/** Payload of the `select` event. `selected` is the requested next state. */
|
|
26
|
+
export interface GhostTreeSelectPayload {
|
|
27
|
+
value: string;
|
|
28
|
+
selected: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Payload of the `toggle` event. `expanded` is the requested next state. */
|
|
31
|
+
export interface GhostTreeTogglePayload {
|
|
32
|
+
value: string;
|
|
33
|
+
expanded: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Props for the {@link GhostTree} root component. */
|
|
36
|
+
export interface GhostTreeProps {
|
|
37
|
+
/**
|
|
38
|
+
* Tag name or component rendered for the `role="tree"` container.
|
|
39
|
+
* @default 'ul'
|
|
40
|
+
*/
|
|
41
|
+
as?: GhostTreeElement;
|
|
42
|
+
/**
|
|
43
|
+
* Single or multiple selection. `'multiple'` sets `aria-multiselectable`.
|
|
44
|
+
* @default 'single'
|
|
45
|
+
*/
|
|
46
|
+
selectionMode?: GhostTreeSelectionMode;
|
|
47
|
+
/**
|
|
48
|
+
* Controlled selection (`v-model`). Omit for uncontrolled mode.
|
|
49
|
+
* @default undefined
|
|
50
|
+
*/
|
|
51
|
+
modelValue?: GhostTreeValue;
|
|
52
|
+
/**
|
|
53
|
+
* Initial uncontrolled selection.
|
|
54
|
+
* @default undefined
|
|
55
|
+
*/
|
|
56
|
+
defaultValue?: GhostTreeValue;
|
|
57
|
+
/**
|
|
58
|
+
* Controlled expanded branch values (`v-model:expanded`). Omit for
|
|
59
|
+
* uncontrolled mode.
|
|
60
|
+
* @default undefined
|
|
61
|
+
*/
|
|
62
|
+
expanded?: string[] | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Initial expanded branch values when `expanded` is omitted.
|
|
65
|
+
* @default []
|
|
66
|
+
*/
|
|
67
|
+
defaultExpanded?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* In `'single'` mode, re-activating the selected node clears the selection.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
allowDeselect?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Pointer clicks on a branch row (or a `'both'` trigger) also toggle expansion.
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
expandOnClick?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* `ArrowDown` / `ArrowUp` wrap at the ends of the visible node list.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
loop?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Explicit writing direction. When omitted, resolves from the closest
|
|
85
|
+
* `[dir]` ancestor, then `<html dir>`, then `'ltr'`.
|
|
86
|
+
* @default undefined
|
|
87
|
+
*/
|
|
88
|
+
dir?: GhostTreeDirection | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Disables every interaction in the tree.
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/** Props passed to the {@link GhostTree} default slot. */
|
|
96
|
+
export interface GhostTreeSlotProps {
|
|
97
|
+
modelValue: GhostTreeValue;
|
|
98
|
+
expanded: string[];
|
|
99
|
+
focusedValue: string | undefined;
|
|
100
|
+
isSelected: (value: string) => boolean;
|
|
101
|
+
isExpanded: (value: string) => boolean;
|
|
102
|
+
select: (value: string) => void;
|
|
103
|
+
toggleExpanded: (value: string) => void;
|
|
104
|
+
expandAllSiblings: (value: string) => void;
|
|
105
|
+
}
|
|
106
|
+
/** Methods and state exposed by a template ref to {@link GhostTree}. */
|
|
107
|
+
export interface GhostTreeExposed {
|
|
108
|
+
readonly element: HTMLElement | null;
|
|
109
|
+
/** Focuses the current roving tab stop item, if any. */
|
|
110
|
+
focus(options?: FocusOptions): void;
|
|
111
|
+
blur(): void;
|
|
112
|
+
}
|
|
113
|
+
/** Props for {@link GhostTreeItem}. */
|
|
114
|
+
export interface GhostTreeItemProps {
|
|
115
|
+
/**
|
|
116
|
+
* Tag name or component rendered for the `role="treeitem"` node.
|
|
117
|
+
* @default 'li'
|
|
118
|
+
*/
|
|
119
|
+
as?: GhostTreeItemElement;
|
|
120
|
+
/** Unique, stable key used in `modelValue`, `expanded`, and focus tracking. */
|
|
121
|
+
value: string;
|
|
122
|
+
/**
|
|
123
|
+
* Disables selection, expansion, and roving focus for this node only.
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
disabled?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Explicit typeahead label. Defaults to the trigger text, or the item's own
|
|
129
|
+
* text excluding nested groups.
|
|
130
|
+
* @default undefined
|
|
131
|
+
*/
|
|
132
|
+
textValue?: string | undefined;
|
|
133
|
+
}
|
|
134
|
+
/** Props passed to the {@link GhostTreeItem} default slot. */
|
|
135
|
+
export interface GhostTreeItemSlotProps {
|
|
136
|
+
selected: boolean;
|
|
137
|
+
expanded: boolean;
|
|
138
|
+
focused: boolean;
|
|
139
|
+
disabled: boolean;
|
|
140
|
+
expandable: boolean;
|
|
141
|
+
level: number;
|
|
142
|
+
select: () => void;
|
|
143
|
+
toggle: () => void;
|
|
144
|
+
}
|
|
145
|
+
/** Methods and state exposed by a template ref to {@link GhostTreeItem}. */
|
|
146
|
+
export interface GhostTreeItemExposed {
|
|
147
|
+
readonly element: HTMLElement | null;
|
|
148
|
+
focus(options?: FocusOptions): void;
|
|
149
|
+
blur(): void;
|
|
150
|
+
}
|
|
151
|
+
/** Props for {@link GhostTreeTrigger}. */
|
|
152
|
+
export interface GhostTreeTriggerProps {
|
|
153
|
+
/**
|
|
154
|
+
* Tag name or component for the non-focusable row or disclosure target.
|
|
155
|
+
* @default 'span'
|
|
156
|
+
*/
|
|
157
|
+
as?: GhostTreeTriggerElement;
|
|
158
|
+
/**
|
|
159
|
+
* Pointer click behavior.
|
|
160
|
+
* @default 'both'
|
|
161
|
+
*/
|
|
162
|
+
action?: GhostTreeTriggerAction;
|
|
163
|
+
/**
|
|
164
|
+
* Local disable flag, combined with the item and root `disabled`.
|
|
165
|
+
* @default false
|
|
166
|
+
*/
|
|
167
|
+
disabled?: boolean;
|
|
168
|
+
}
|
|
169
|
+
/** Props passed to the {@link GhostTreeTrigger} default slot. */
|
|
170
|
+
export interface GhostTreeTriggerSlotProps {
|
|
171
|
+
selected: boolean;
|
|
172
|
+
expanded: boolean;
|
|
173
|
+
disabled: boolean;
|
|
174
|
+
expandable: boolean;
|
|
175
|
+
level: number;
|
|
176
|
+
select: () => void;
|
|
177
|
+
toggle: () => void;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Methods and state exposed by a template ref to {@link GhostTreeTrigger}.
|
|
181
|
+
* `focus()` delegates to the owning `role="treeitem"` element.
|
|
182
|
+
*/
|
|
183
|
+
export interface GhostTreeTriggerExposed {
|
|
184
|
+
readonly element: HTMLElement | null;
|
|
185
|
+
focus(options?: FocusOptions): void;
|
|
186
|
+
blur(): void;
|
|
187
|
+
}
|
|
188
|
+
/** Props for {@link GhostTreeGroup}. */
|
|
189
|
+
export interface GhostTreeGroupProps {
|
|
190
|
+
/**
|
|
191
|
+
* Tag name or component rendered for the `role="group"` child container.
|
|
192
|
+
* @default 'ul'
|
|
193
|
+
*/
|
|
194
|
+
as?: GhostTreeGroupElement;
|
|
195
|
+
/**
|
|
196
|
+
* Skips themed height transitions (`data-animation="off"`).
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
disableAnimation?: boolean;
|
|
200
|
+
}
|
|
201
|
+
/** Methods and state exposed by a template ref to {@link GhostTreeGroup}. */
|
|
202
|
+
export interface GhostTreeGroupExposed {
|
|
203
|
+
readonly element: HTMLElement | null;
|
|
204
|
+
focus(options?: FocusOptions): void;
|
|
205
|
+
blur(): void;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* A mounted `GhostTreeItem` as seen by {@link useGhostTree}. Getters keep the
|
|
209
|
+
* registry free of reactive copies: the composable reads current prop values
|
|
210
|
+
* and DOM elements only when it needs them (navigation, typeahead, recovery).
|
|
211
|
+
*/
|
|
212
|
+
export interface GhostTreeNodeRecord {
|
|
213
|
+
readonly value: string;
|
|
214
|
+
/** Value of the closest ancestor `GhostTreeItem`, or `undefined` at root level. */
|
|
215
|
+
readonly parentValue: string | undefined;
|
|
216
|
+
getElement: () => HTMLElement | null;
|
|
217
|
+
/** The item's own `disabled` prop (the root flag is applied separately). */
|
|
218
|
+
isDisabled: () => boolean;
|
|
219
|
+
/** `true` once a `GhostTreeGroup` belongs to the item. */
|
|
220
|
+
isExpandable: () => boolean;
|
|
221
|
+
/** Label used by printable-character typeahead. */
|
|
222
|
+
getTextValue: () => string;
|
|
223
|
+
}
|
|
224
|
+
/** Options for {@link useGhostTree}. */
|
|
225
|
+
export interface UseGhostTreeOptions {
|
|
226
|
+
selectionMode?: MaybeRefOrGetter<GhostTreeSelectionMode | undefined>;
|
|
227
|
+
modelValue?: MaybeRefOrGetter<GhostTreeValue>;
|
|
228
|
+
defaultValue?: MaybeRefOrGetter<GhostTreeValue>;
|
|
229
|
+
expanded?: MaybeRefOrGetter<string[] | undefined>;
|
|
230
|
+
defaultExpanded?: MaybeRefOrGetter<string[] | undefined>;
|
|
231
|
+
allowDeselect?: MaybeRefOrGetter<boolean | undefined>;
|
|
232
|
+
loop?: MaybeRefOrGetter<boolean | undefined>;
|
|
233
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
234
|
+
dir?: MaybeRefOrGetter<GhostTreeDirection | undefined>;
|
|
235
|
+
/** Tree root element; used to resolve the inherited writing direction. */
|
|
236
|
+
rootElement?: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
237
|
+
onValueChange?: (value: GhostTreeValue) => void;
|
|
238
|
+
onExpandedChange?: (expanded: string[]) => void;
|
|
239
|
+
onSelect?: (payload: GhostTreeSelectPayload) => void;
|
|
240
|
+
onToggle?: (payload: GhostTreeTogglePayload) => void;
|
|
241
|
+
}
|
|
242
|
+
/** Reactive state and helpers returned by {@link useGhostTree}. */
|
|
243
|
+
export interface UseGhostTreeReturn {
|
|
244
|
+
/** Authoritative committed selection (controlled prop or internal state). */
|
|
245
|
+
modelValue: ComputedRef<GhostTreeValue>;
|
|
246
|
+
/** Authoritative expanded branch values. */
|
|
247
|
+
expanded: ComputedRef<string[]>;
|
|
248
|
+
/** Value of the item that owns (or last owned) keyboard focus. */
|
|
249
|
+
focusedValue: Ref<string | undefined>;
|
|
250
|
+
/** Value of the single item that renders `tabindex="0"`. */
|
|
251
|
+
tabStopValue: ComputedRef<string | undefined>;
|
|
252
|
+
/** Effective writing direction (`'ltr'` during SSR unless explicit). */
|
|
253
|
+
dir: ComputedRef<GhostTreeDirection>;
|
|
254
|
+
disabled: ComputedRef<boolean>;
|
|
255
|
+
isSelected: (value: string) => boolean;
|
|
256
|
+
isExpanded: (value: string) => boolean;
|
|
257
|
+
/** Root or item `disabled`. */
|
|
258
|
+
isDisabled: (value: string) => boolean;
|
|
259
|
+
select: (value: string) => void;
|
|
260
|
+
setExpanded: (value: string, expanded: boolean) => void;
|
|
261
|
+
toggleExpanded: (value: string) => void;
|
|
262
|
+
expandAllSiblings: (value: string) => void;
|
|
263
|
+
/** Registers a node; returns the matching unregister function. */
|
|
264
|
+
registerNode: (record: GhostTreeNodeRecord) => () => void;
|
|
265
|
+
/** Moves `focusedValue` (and DOM focus when mounted) to `value`. */
|
|
266
|
+
focusNode: (value: string, options?: FocusOptions) => boolean;
|
|
267
|
+
/** Root keydown handler implementing the APG Tree View keyboard contract. */
|
|
268
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
|
269
|
+
/** Root focusin handler that tracks the focused item. */
|
|
270
|
+
handleFocusIn: (event: FocusEvent) => void;
|
|
271
|
+
/** Visible enabled values in rendered document order. */
|
|
272
|
+
getNavigableValues: () => string[];
|
|
273
|
+
}
|
|
274
|
+
/** Context shared from {@link GhostTree} with every descendant part. */
|
|
275
|
+
export interface GhostTreeContext {
|
|
276
|
+
tree: UseGhostTreeReturn;
|
|
277
|
+
expandOnClick: ComputedRef<boolean>;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Context shared from a {@link GhostTreeItem} with its own trigger(s), group,
|
|
281
|
+
* and nested items (which read it as their parent).
|
|
282
|
+
*/
|
|
283
|
+
export interface GhostTreeItemContext {
|
|
284
|
+
value: ComputedRef<string>;
|
|
285
|
+
level: ComputedRef<number>;
|
|
286
|
+
element: ComputedRef<HTMLElement | null>;
|
|
287
|
+
selected: ComputedRef<boolean>;
|
|
288
|
+
expanded: ComputedRef<boolean>;
|
|
289
|
+
disabled: ComputedRef<boolean>;
|
|
290
|
+
expandable: ComputedRef<boolean>;
|
|
291
|
+
/** Effective `role="group"` id used by `aria-controls`. */
|
|
292
|
+
groupId: ComputedRef<string>;
|
|
293
|
+
/** Effective labelling trigger id, when a labelling trigger exists. */
|
|
294
|
+
labelTriggerId: ComputedRef<string | undefined>;
|
|
295
|
+
/** Item-generated id for the first labelling trigger. */
|
|
296
|
+
defaultTriggerId: ComputedRef<string>;
|
|
297
|
+
/** Item-generated id for the group. */
|
|
298
|
+
defaultGroupId: ComputedRef<string>;
|
|
299
|
+
/**
|
|
300
|
+
* Registers a labelling trigger (`action` other than `'toggle'`). Returns
|
|
301
|
+
* `true` when it is the first one and should use `defaultTriggerId`.
|
|
302
|
+
*/
|
|
303
|
+
registerLabelTrigger: (token: symbol, id: () => string) => boolean;
|
|
304
|
+
unregisterLabelTrigger: (token: symbol) => void;
|
|
305
|
+
registerGroup: (token: symbol, id: () => string) => void;
|
|
306
|
+
unregisterGroup: (token: symbol) => void;
|
|
307
|
+
select: () => void;
|
|
308
|
+
toggle: () => void;
|
|
309
|
+
/** Pointer activation shared by the item row and its triggers. */
|
|
310
|
+
activate: (action: GhostTreeTriggerAction) => void;
|
|
311
|
+
}
|
|
312
|
+
export declare const ghostTreeContextKey: InjectionKey<GhostTreeContext>;
|
|
313
|
+
export declare const ghostTreeItemContextKey: InjectionKey<GhostTreeItemContext>;
|
|
314
|
+
/** Component `name` shared by the headless and themed tree parts. */
|
|
315
|
+
export declare const GHOST_TREE_GROUP_NAME = "GhostTreeGroup";
|
|
316
|
+
export declare const GHOST_TREE_TRIGGER_NAME = "GhostTreeTrigger";
|
|
317
|
+
/**
|
|
318
|
+
* Resolves a DOM element from either a raw element or a component ref
|
|
319
|
+
* (preferring exposed `.element` over `.$el` so themed wrappers resolve to
|
|
320
|
+
* their inner element).
|
|
321
|
+
*/
|
|
322
|
+
export declare function resolveTreeHtmlElement(target: unknown): HTMLElement | null;
|
|
323
|
+
/**
|
|
324
|
+
* Resolves the effective writing direction for a tree, SSR-safe.
|
|
325
|
+
*
|
|
326
|
+
* Priority: explicit `dir` → closest `[dir="ltr" | "rtl"]` ancestor (or self)
|
|
327
|
+
* of `element` → `<html dir>` → `'ltr'`. `dir="auto"` and other values are
|
|
328
|
+
* skipped so resolution falls through to the next source.
|
|
329
|
+
*/
|
|
330
|
+
export declare function resolveTreeDir(explicitDir: GhostTreeDirection | undefined, element?: HTMLElement | null): GhostTreeDirection;
|
|
331
|
+
/** Structure of one item's direct slot output, read before the item renders. */
|
|
332
|
+
export interface GhostTreeItemSlotStructure {
|
|
333
|
+
hasGroup: boolean;
|
|
334
|
+
/** Consumer `id` on the first group, if any. */
|
|
335
|
+
groupId: string | undefined;
|
|
336
|
+
hasLabelTrigger: boolean;
|
|
337
|
+
/** Consumer `id` on the first labelling trigger, if any. */
|
|
338
|
+
labelTriggerId: string | undefined;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Scans the vnodes an item is about to render for its own `GhostTreeGroup`
|
|
342
|
+
* and labelling `GhostTreeTrigger`.
|
|
343
|
+
*
|
|
344
|
+
* Why: an item's attributes (`aria-expanded`, `aria-controls`,
|
|
345
|
+
* `aria-labelledby`) are serialized before its child parts run `setup()`, so
|
|
346
|
+
* runtime registration alone cannot produce them in server-rendered HTML.
|
|
347
|
+
* Reading the slot's vnode types gives the same answer on the server and in
|
|
348
|
+
* the hydration render, while registration stays the client source of truth
|
|
349
|
+
* (it also covers parts hidden inside consumer wrapper components, which this
|
|
350
|
+
* shallow scan cannot see). Matching is by component name so the themed
|
|
351
|
+
* wrappers in `@ghostvue/themes` are recognized too. The scan descends
|
|
352
|
+
* through elements and fragments but never into component slots, so nested
|
|
353
|
+
* items and their parts are not mistaken for this item's own.
|
|
354
|
+
*/
|
|
355
|
+
export declare function scanTreeItemSlot(nodes: readonly unknown[] | undefined): GhostTreeItemSlotStructure;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Closed union: interactive/void tags would break hiding or cannot hold children.
|
|
4
|
+
* Widening is additive; narrowing is breaking.
|
|
5
|
+
*/
|
|
6
|
+
export type GhostVisuallyHiddenElement = 'span' | 'div' | 'p' | 'li' | 'td' | 'th';
|
|
7
|
+
/** Props for the unstyled {@link GhostVisuallyHidden} component. */
|
|
8
|
+
export interface GhostVisuallyHiddenProps {
|
|
9
|
+
/**
|
|
10
|
+
* Root tag valid in the parent context (`th` in a row, `li` in a list).
|
|
11
|
+
* @default 'span'
|
|
12
|
+
*/
|
|
13
|
+
as?: GhostVisuallyHiddenElement;
|
|
14
|
+
/**
|
|
15
|
+
* Reveal while focus is inside. Required if the slot is focusable (skip links).
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
focusable?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Options for {@link useGhostVisuallyHidden}. `as` is a render concern of the SFC. */
|
|
21
|
+
export interface UseGhostVisuallyHiddenOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Reveal while focus is inside.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
focusable?: MaybeRefOrGetter<boolean | undefined>;
|
|
27
|
+
}
|