@threadlabs/looma 0.22.8 → 0.22.10
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/components/ui-affordance-scope/ui-affordance-scope.js +2 -2
- package/components/ui-avatar/ui-avatar.js +5 -5
- package/components/ui-avatar-group/ui-avatar-group.js +5 -5
- package/components/ui-badge/ui-badge.html +10 -0
- package/components/ui-button/ui-button.js +1 -1
- package/components/ui-checkbox/ui-checkbox.js +5 -5
- package/components/ui-combobox/ui-combobox.js +61 -61
- package/components/ui-context-menu/ui-context-menu.js +6 -6
- package/components/ui-dialog/ui-dialog.js +9 -9
- package/components/ui-disclosure/ui-disclosure.js +6 -6
- package/components/ui-editable/ui-editable.js +6 -6
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +4 -4
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +8 -8
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +6 -6
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +5 -5
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +4 -4
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +5 -5
- package/components/ui-form-field/ui-form-field.js +4 -4
- package/components/ui-icon-button/ui-icon-button.js +2 -2
- package/components/ui-input/ui-input.js +1 -1
- package/components/ui-input-group/ui-input-group.js +1 -1
- package/components/ui-listbox/ui-listbox.js +12 -12
- package/components/ui-menu/ui-menu.js +7 -7
- package/components/ui-menu-item/ui-menu-item.js +7 -7
- package/components/ui-popover/ui-popover.js +4 -4
- package/components/ui-radio/ui-radio.js +5 -5
- package/components/ui-radio-group/ui-radio-group.js +6 -6
- package/components/ui-scroll-area/ui-scroll-area.js +1 -1
- package/components/ui-search-shell/ui-search-shell.js +6 -6
- package/components/ui-select/ui-select.js +1 -1
- package/components/ui-sidebar/ui-sidebar.js +12 -12
- package/components/ui-switch/ui-switch.js +5 -5
- package/components/ui-switcher/ui-switcher.js +1 -1
- package/components/ui-tabs/ui-tabs.js +5 -5
- package/components/ui-textarea/ui-textarea.js +1 -1
- package/components/ui-toast/ui-toast.js +3 -3
- package/components/ui-toast-region/ui-toast-region.js +1 -1
- package/components/ui-tooltip/ui-tooltip.js +9 -9
- package/components/ui-tree/ui-tree.js +4 -4
- package/components/ui-tree-item/ui-tree-item.js +11 -11
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/styles/ui-action-bar.css +1 -1
- package/styles/ui-affordance-scope.css +1 -1
- package/styles/ui-avatar-group.css +1 -1
- package/styles/ui-avatar.css +1 -1
- package/styles/ui-badge.css +10 -1
- package/styles/ui-breadcrumb-item.css +1 -1
- package/styles/ui-breadcrumbs.css +1 -1
- package/styles/ui-button.css +1 -1
- package/styles/ui-callout.css +1 -1
- package/styles/ui-card.css +1 -1
- package/styles/ui-checkbox.css +1 -1
- package/styles/ui-cluster.css +1 -1
- package/styles/ui-combobox.css +1 -1
- package/styles/ui-container.css +1 -1
- package/styles/ui-context-menu.css +1 -1
- package/styles/ui-cover.css +1 -1
- package/styles/ui-description-item.css +1 -1
- package/styles/ui-description-list.css +1 -1
- package/styles/ui-dialog.css +1 -1
- package/styles/ui-disclosure.css +1 -1
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +1 -1
- package/styles/ui-editor-mention-menu-item.css +1 -1
- package/styles/ui-editor-mention-menu.css +1 -1
- package/styles/ui-editor-slash-menu-group.css +1 -1
- package/styles/ui-editor-slash-menu-item.css +1 -1
- package/styles/ui-editor-slash-menu.css +1 -1
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-editor-table-overlay.css +1 -1
- package/styles/ui-editor-table-toolbar.css +1 -1
- package/styles/ui-editor-toolbar.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +1 -1
- package/styles/ui-grid.css +1 -1
- package/styles/ui-icon-button.css +1 -1
- package/styles/ui-icon.css +1 -1
- package/styles/ui-input-group.css +1 -1
- package/styles/ui-input.css +1 -1
- package/styles/ui-list-item.css +1 -1
- package/styles/ui-list.css +1 -1
- package/styles/ui-listbox.css +1 -1
- package/styles/ui-menu-group.css +1 -1
- package/styles/ui-menu-item.css +1 -1
- package/styles/ui-menu.css +1 -1
- package/styles/ui-meter.css +1 -1
- package/styles/ui-nav-item.css +1 -1
- package/styles/ui-page-header.css +1 -1
- package/styles/ui-popover.css +1 -1
- package/styles/ui-radio-group.css +1 -1
- package/styles/ui-radio.css +1 -1
- package/styles/ui-reel.css +1 -1
- package/styles/ui-scroll-area.css +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/styles/ui-search-shell.css +1 -1
- package/styles/ui-section.css +1 -1
- package/styles/ui-select.css +1 -1
- package/styles/ui-separator.css +1 -1
- package/styles/ui-sidebar.css +1 -1
- package/styles/ui-spinner.css +1 -1
- package/styles/ui-stack.css +1 -1
- package/styles/ui-status-message.css +1 -1
- package/styles/ui-switch.css +1 -1
- package/styles/ui-switcher.css +1 -1
- package/styles/ui-table.css +1 -1
- package/styles/ui-tabs.css +1 -1
- package/styles/ui-text.css +1 -1
- package/styles/ui-textarea.css +1 -1
- package/styles/ui-toast-region.css +1 -1
- package/styles/ui-toast.css +1 -1
- package/styles/ui-tooltip.css +1 -1
- package/styles/ui-top-bar.css +1 -1
- package/styles/ui-tree-item.css +1 -1
- package/styles/ui-tree.css +1 -1
- package/vanilla/UiActionBar.d.ts +1 -1
- package/vanilla/UiActionBar.js +1 -1
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +1 -1
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +1 -1
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +1 -1
- package/vanilla/UiBadge.d.ts +2 -1
- package/vanilla/UiBadge.js +5 -3
- package/vanilla/UiBreadcrumbItem.d.ts +1 -1
- package/vanilla/UiBreadcrumbItem.js +1 -1
- package/vanilla/UiBreadcrumbs.d.ts +1 -1
- package/vanilla/UiBreadcrumbs.js +1 -1
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +1 -1
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +1 -1
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +1 -1
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +1 -1
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +1 -1
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +1 -1
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +1 -1
- package/vanilla/UiCover.d.ts +1 -1
- package/vanilla/UiCover.js +1 -1
- package/vanilla/UiDescriptionItem.d.ts +1 -1
- package/vanilla/UiDescriptionItem.js +1 -1
- package/vanilla/UiDescriptionList.d.ts +1 -1
- package/vanilla/UiDescriptionList.js +1 -1
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +1 -1
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +1 -1
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +1 -1
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +1 -1
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +1 -1
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +1 -1
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +1 -1
- package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuGroup.js +1 -1
- package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuItem.js +1 -1
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +1 -1
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +1 -1
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +1 -1
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +1 -1
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +1 -1
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +1 -1
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +1 -1
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +1 -1
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +1 -1
- package/vanilla/UiInputGroup.d.ts +1 -1
- package/vanilla/UiInputGroup.js +1 -1
- package/vanilla/UiList.d.ts +1 -1
- package/vanilla/UiList.js +1 -1
- package/vanilla/UiListItem.d.ts +1 -1
- package/vanilla/UiListItem.js +1 -1
- package/vanilla/UiListbox.d.ts +1 -1
- package/vanilla/UiListbox.js +1 -1
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +1 -1
- package/vanilla/UiMenuGroup.d.ts +1 -1
- package/vanilla/UiMenuGroup.js +1 -1
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +1 -1
- package/vanilla/UiMeter.d.ts +1 -1
- package/vanilla/UiMeter.js +1 -1
- package/vanilla/UiNavItem.d.ts +1 -1
- package/vanilla/UiNavItem.js +1 -1
- package/vanilla/UiPageHeader.d.ts +1 -1
- package/vanilla/UiPageHeader.js +1 -1
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +1 -1
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +1 -1
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +1 -1
- package/vanilla/UiScrollArea.d.ts +1 -1
- package/vanilla/UiScrollArea.js +1 -1
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +1 -1
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +1 -1
- package/vanilla/UiSection.d.ts +1 -1
- package/vanilla/UiSection.js +1 -1
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +1 -1
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +1 -1
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +1 -1
- package/vanilla/UiSpinner.d.ts +1 -1
- package/vanilla/UiSpinner.js +1 -1
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiStatusMessage.d.ts +1 -1
- package/vanilla/UiStatusMessage.js +1 -1
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +1 -1
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +1 -1
- package/vanilla/UiTable.d.ts +1 -1
- package/vanilla/UiTable.js +1 -1
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +1 -1
- package/vanilla/UiText.d.ts +1 -1
- package/vanilla/UiText.js +1 -1
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +1 -1
- package/vanilla/UiToast.d.ts +1 -1
- package/vanilla/UiToast.js +1 -1
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +1 -1
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +1 -1
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +1 -1
- package/vue/UiActionBar.vue +1 -1
- package/vue/UiAffordanceScope.vue +17 -4
- package/vue/UiAvatar.vue +38 -5
- package/vue/UiAvatarGroup.vue +32 -5
- package/vue/UiBadge.d.ts +9 -0
- package/vue/UiBadge.vue +41 -3
- package/vue/UiBreadcrumbItem.vue +5 -3
- package/vue/UiBreadcrumbs.vue +5 -3
- package/vue/UiButton.vue +72 -7
- package/vue/UiCallout.vue +5 -3
- package/vue/UiCard.vue +16 -6
- package/vue/UiCheckbox.vue +41 -4
- package/vue/UiCluster.vue +8 -3
- package/vue/UiCombobox.vue +98 -6
- package/vue/UiContainer.vue +6 -3
- package/vue/UiContextMenu.vue +17 -4
- package/vue/UiCover.vue +5 -3
- package/vue/UiDescriptionItem.vue +5 -3
- package/vue/UiDescriptionList.vue +11 -3
- package/vue/UiDialog.vue +38 -5
- package/vue/UiDisclosure.vue +28 -4
- package/vue/UiEditable.vue +50 -4
- package/vue/UiEditorInsertTableGrid.vue +24 -4
- package/vue/UiEditorMentionMenu.vue +41 -4
- package/vue/UiEditorMentionMenuItem.vue +7 -3
- package/vue/UiEditorSlashMenu.vue +28 -4
- package/vue/UiEditorSlashMenuGroup.vue +5 -3
- package/vue/UiEditorSlashMenuItem.vue +15 -3
- package/vue/UiEditorTableContextMenu.vue +28 -4
- package/vue/UiEditorTableOverlay.vue +17 -4
- package/vue/UiEditorTableToolbar.vue +28 -4
- package/vue/UiEditorToolbar.vue +16 -4
- package/vue/UiFloatingActionButton.vue +7 -3
- package/vue/UiFormField.vue +18 -4
- package/vue/UiGrid.vue +7 -3
- package/vue/UiIcon.vue +5 -3
- package/vue/UiIconButton.vue +47 -5
- package/vue/UiInput.vue +90 -37
- package/vue/UiInputGroup.vue +16 -4
- package/vue/UiList.vue +20 -7
- package/vue/UiListItem.vue +6 -3
- package/vue/UiListbox.vue +38 -5
- package/vue/UiMenu.vue +28 -4
- package/vue/UiMenuGroup.vue +5 -3
- package/vue/UiMenuItem.vue +27 -5
- package/vue/UiMeter.vue +19 -3
- package/vue/UiNavItem.vue +28 -6
- package/vue/UiPageHeader.vue +5 -3
- package/vue/UiPopover.vue +18 -5
- package/vue/UiRadio.vue +28 -4
- package/vue/UiRadioGroup.vue +30 -4
- package/vue/UiReel.vue +7 -3
- package/vue/UiScrollArea.vue +16 -4
- package/vue/UiSearchResultRow.d.ts +1 -1
- package/vue/UiSearchResultRow.vue +6 -3
- package/vue/UiSearchShell.vue +24 -4
- package/vue/UiSection.vue +7 -3
- package/vue/UiSelect.vue +33 -5
- package/vue/UiSeparator.vue +5 -3
- package/vue/UiSidebar.vue +44 -4
- package/vue/UiSpinner.vue +6 -3
- package/vue/UiStack.vue +7 -3
- package/vue/UiStatusMessage.vue +7 -3
- package/vue/UiSwitch.vue +28 -4
- package/vue/UiSwitcher.vue +30 -5
- package/vue/UiTable.vue +17 -4
- package/vue/UiTabs.vue +28 -4
- package/vue/UiText.vue +29 -15
- package/vue/UiTextarea.vue +39 -5
- package/vue/UiToast.vue +17 -4
- package/vue/UiToastRegion.vue +17 -5
- package/vue/UiTooltip.vue +30 -5
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.vue +28 -4
- package/vue/UiTreeItem.d.ts +1 -1
- package/vue/UiTreeItem.vue +59 -4
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +19 -5
- package/vue/chunks/UiAvatar.js +40 -11
- package/vue/chunks/UiAvatarGroup.js +31 -8
- package/vue/chunks/UiBadge.js +35 -6
- package/vue/chunks/UiBreadcrumbItem.js +5 -4
- package/vue/chunks/UiBreadcrumbs.js +5 -4
- package/vue/chunks/UiButton.js +60 -19
- package/vue/chunks/UiCallout.js +5 -4
- package/vue/chunks/UiCard.js +16 -10
- package/vue/chunks/UiCheckbox.js +40 -11
- package/vue/chunks/UiCluster.js +13 -7
- package/vue/chunks/UiCombobox.js +85 -26
- package/vue/chunks/UiContainer.js +9 -5
- package/vue/chunks/UiContextMenu.js +19 -5
- package/vue/chunks/UiCover.js +5 -4
- package/vue/chunks/UiDescriptionItem.js +5 -4
- package/vue/chunks/UiDescriptionList.js +11 -6
- package/vue/chunks/UiDialog.js +40 -11
- package/vue/chunks/UiDisclosure.js +34 -9
- package/vue/chunks/UiEditable.js +49 -14
- package/vue/chunks/UiEditorInsertTableGrid.js +28 -7
- package/vue/chunks/UiEditorMentionMenu.js +40 -11
- package/vue/chunks/UiEditorMentionMenuItem.js +11 -6
- package/vue/chunks/UiEditorSlashMenu.js +34 -9
- package/vue/chunks/UiEditorSlashMenuGroup.js +5 -4
- package/vue/chunks/UiEditorSlashMenuItem.js +15 -8
- package/vue/chunks/UiEditorTableContextMenu.js +34 -9
- package/vue/chunks/UiEditorTableOverlay.js +19 -5
- package/vue/chunks/UiEditorTableToolbar.js +34 -9
- package/vue/chunks/UiEditorToolbar.js +15 -4
- package/vue/chunks/UiFloatingActionButton.js +11 -6
- package/vue/chunks/UiFormField.js +26 -7
- package/vue/chunks/UiGrid.js +11 -6
- package/vue/chunks/UiIcon.js +5 -4
- package/vue/chunks/UiIconButton.js +41 -12
- package/vue/chunks/UiInput.js +53 -14
- package/vue/chunks/UiInputGroup.js +16 -5
- package/vue/chunks/UiList.js +14 -8
- package/vue/chunks/UiListItem.js +9 -5
- package/vue/chunks/UiListbox.js +40 -11
- package/vue/chunks/UiMenu.js +34 -9
- package/vue/chunks/UiMenuGroup.js +5 -4
- package/vue/chunks/UiMenuItem.js +32 -9
- package/vue/chunks/UiMeter.js +19 -10
- package/vue/chunks/UiNavItem.js +16 -9
- package/vue/chunks/UiPageHeader.js +5 -4
- package/vue/chunks/UiPopover.js +25 -6
- package/vue/chunks/UiRadio.js +34 -9
- package/vue/chunks/UiRadioGroup.js +37 -10
- package/vue/chunks/UiReel.js +11 -6
- package/vue/chunks/UiScrollArea.js +15 -4
- package/vue/chunks/UiSearchResultRow.js +9 -5
- package/vue/chunks/UiSearchShell.js +28 -7
- package/vue/chunks/UiSection.js +11 -6
- package/vue/chunks/UiSelect.js +33 -10
- package/vue/chunks/UiSeparator.js +5 -4
- package/vue/chunks/UiSidebar.js +43 -12
- package/vue/chunks/UiSpinner.js +9 -5
- package/vue/chunks/UiStack.js +11 -6
- package/vue/chunks/UiStatusMessage.js +11 -6
- package/vue/chunks/UiSwitch.js +34 -9
- package/vue/chunks/UiSwitcher.js +28 -7
- package/vue/chunks/UiTable.js +20 -6
- package/vue/chunks/UiTabs.js +34 -9
- package/vue/chunks/UiText.js +29 -20
- package/vue/chunks/UiTextarea.js +42 -13
- package/vue/chunks/UiToast.js +19 -5
- package/vue/chunks/UiToastRegion.js +19 -5
- package/vue/chunks/UiTooltip.js +37 -10
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +35 -10
- package/vue/chunks/UiTreeItem.js +58 -17
- package/vue/chunks/host.js +22 -4
- package/vue/chunks/props.js +20 -7
- package/vue/components.css +1212 -1204
- package/vue/host.ts +50 -6
package/vue/host.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by HTML Next 1.0.0-alpha.
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.19 for Vue 3.5. Do not edit.
|
|
2
2
|
import {
|
|
3
3
|
computed,
|
|
4
4
|
Fragment,
|
|
@@ -190,14 +190,22 @@ export interface ComponentHostOptions {
|
|
|
190
190
|
readonly dispatch: (name: string, detail?: unknown) => boolean
|
|
191
191
|
/** The authored controller edge, retained for the live loader's module diagnostic. */
|
|
192
192
|
readonly controllerSource?: { readonly specifier: string; readonly definition: string }
|
|
193
|
-
/**
|
|
193
|
+
/** Accepted component props, which a controller reads through `host.props`. */
|
|
194
194
|
readonly props?: Readable<Readonly<Record<string, unknown>>>
|
|
195
|
+
/** Raw Vue prop inputs before the declared type is applied. */
|
|
196
|
+
readonly propInputs?: (name: string) => unknown
|
|
197
|
+
readonly propNames?: readonly string[]
|
|
198
|
+
readonly propValidity?: (name: string) => Readonly<Record<string, unknown>>
|
|
195
199
|
/** Template refs, by the ref name the component declared. Vue collects a `v-for` ref into an array. */
|
|
196
200
|
readonly refs?: Readonly<Record<string, Readable<HTMLElement | HTMLElement[] | null>>>
|
|
197
201
|
/** Declared state, which a controller reads and writes. */
|
|
198
202
|
readonly state?: Readonly<Record<string, { value: any }>>
|
|
199
203
|
/** Declared computed values, which a controller reads. */
|
|
200
204
|
readonly computed?: Readonly<Record<string, Readable<unknown>>>
|
|
205
|
+
/** Declared data resources, which a controller reads. */
|
|
206
|
+
readonly data?: Readonly<Record<string, Readable<unknown>>>
|
|
207
|
+
/** Values inherited through declared context, which a controller reads. */
|
|
208
|
+
readonly context?: Readonly<Record<string, Readable<unknown>>>
|
|
201
209
|
}
|
|
202
210
|
|
|
203
211
|
/** Vue does not promise a `v-for` ref array in source order, and the host does. */
|
|
@@ -226,7 +234,18 @@ export function useComponentHost(
|
|
|
226
234
|
controllerLoader: () => Promise<unknown>,
|
|
227
235
|
options: ComponentHostOptions,
|
|
228
236
|
) {
|
|
229
|
-
const {
|
|
237
|
+
const {
|
|
238
|
+
root,
|
|
239
|
+
dispatch,
|
|
240
|
+
props,
|
|
241
|
+
propInputs = () => null,
|
|
242
|
+
propNames = [],
|
|
243
|
+
refs = {},
|
|
244
|
+
state = {},
|
|
245
|
+
computed: computedValues = {},
|
|
246
|
+
data = {},
|
|
247
|
+
context = {},
|
|
248
|
+
} = options
|
|
230
249
|
const vueSlots = useSlots()
|
|
231
250
|
const component = getCurrentInstance()
|
|
232
251
|
const report = (error: unknown): void => {
|
|
@@ -269,12 +288,32 @@ export function useComponentHost(
|
|
|
269
288
|
throw controllerDiagnostic('HJ001', error)
|
|
270
289
|
})
|
|
271
290
|
const stops: Array<() => void> = []
|
|
272
|
-
const
|
|
291
|
+
const readState = (name: string): unknown =>
|
|
273
292
|
Object.hasOwn(state, name)
|
|
274
293
|
? state[name]!.value
|
|
275
294
|
: Object.hasOwn(computedValues, name)
|
|
276
295
|
? computedValues[name]!.value
|
|
277
|
-
:
|
|
296
|
+
: Object.hasOwn(data, name)
|
|
297
|
+
? data[name]!.value
|
|
298
|
+
: Object.hasOwn(context, name)
|
|
299
|
+
? context[name]!.value
|
|
300
|
+
: undefined
|
|
301
|
+
const propHandles = Object.create(null) as Record<string, unknown>
|
|
302
|
+
for (const name of propNames) {
|
|
303
|
+
const validity = () => options.propValidity?.(name)
|
|
304
|
+
propHandles[name] = Object.freeze({
|
|
305
|
+
get value() {
|
|
306
|
+
return props?.value[name]
|
|
307
|
+
},
|
|
308
|
+
get inputValue() {
|
|
309
|
+
return propInputs(name)
|
|
310
|
+
},
|
|
311
|
+
get validity() {
|
|
312
|
+
return validity()
|
|
313
|
+
},
|
|
314
|
+
validate: validity,
|
|
315
|
+
})
|
|
316
|
+
}
|
|
278
317
|
const host = {
|
|
279
318
|
get element(): Element {
|
|
280
319
|
return root.value as Element
|
|
@@ -283,7 +322,7 @@ export function useComponentHost(
|
|
|
283
322
|
return root.value as Element
|
|
284
323
|
},
|
|
285
324
|
state: new Proxy({} as Record<string, unknown>, {
|
|
286
|
-
get: (_target, name) => typeof name === 'string' ?
|
|
325
|
+
get: (_target, name) => typeof name === 'string' ? readState(name) : undefined,
|
|
287
326
|
set: (_target, name, value) => {
|
|
288
327
|
if (typeof name !== 'string' || !Object.hasOwn(state, name)) {
|
|
289
328
|
throw new TypeError(`Only declared state is writable; \`${String(name)}\` is not.`)
|
|
@@ -291,7 +330,12 @@ export function useComponentHost(
|
|
|
291
330
|
state[name]!.value = value
|
|
292
331
|
return true
|
|
293
332
|
},
|
|
333
|
+
has: (_target, name) =>
|
|
334
|
+
typeof name === 'string'
|
|
335
|
+
&& (Object.hasOwn(state, name) || Object.hasOwn(computedValues, name)
|
|
336
|
+
|| Object.hasOwn(data, name) || Object.hasOwn(context, name)),
|
|
294
337
|
}),
|
|
338
|
+
props: Object.freeze(propHandles),
|
|
295
339
|
refs: Object.defineProperties(
|
|
296
340
|
{},
|
|
297
341
|
Object.fromEntries(
|