@threadlabs/looma 0.21.6 → 0.22.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/components/ui-affordance-scope/ui-affordance-scope.html +1 -1
- package/components/ui-avatar/ui-avatar.html +4 -4
- package/components/ui-avatar-group/ui-avatar-group.html +2 -2
- package/components/ui-checkbox/ui-checkbox.html +1 -1
- package/components/ui-combobox/ui-combobox.html +18 -18
- package/components/ui-context-menu/ui-context-menu.html +1 -1
- package/components/ui-dialog/ui-dialog.html +2 -2
- package/components/ui-disclosure/ui-disclosure.html +4 -4
- package/components/ui-editable/ui-editable.html +3 -3
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +5 -5
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +5 -5
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +3 -3
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +2 -2
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +3 -7
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +6 -6
- package/components/ui-listbox/ui-listbox.html +6 -6
- package/components/ui-menu/ui-menu.html +1 -1
- package/components/ui-menu-item/ui-menu-item.html +1 -1
- package/components/ui-popover/ui-popover.html +1 -1
- package/components/ui-radio/ui-radio.html +1 -1
- package/components/ui-radio-group/ui-radio-group.html +1 -1
- package/components/ui-search-shell/ui-search-shell.html +1 -1
- package/components/ui-sidebar/ui-sidebar.html +2 -2
- package/components/ui-switch/ui-switch.html +1 -1
- package/components/ui-switcher/ui-switcher.html +1 -1
- package/components/ui-tabs/ui-tabs.html +2 -2
- package/components/ui-toast-region/ui-toast-region.html +1 -1
- package/components/ui-tooltip/ui-tooltip.html +1 -1
- package/components/ui-tree-item/ui-tree-item.html +4 -4
- 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 +1 -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 +2 -2
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +2 -2
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +2 -2
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- 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 +2 -2
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +1 -1
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +2 -2
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +1 -1
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +2 -2
- 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 +2 -2
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +2 -2
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +2 -2
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +2 -2
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +2 -2
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +1 -1
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +2 -2
- 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 +2 -2
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +2 -2
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +2 -2
- 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 +2 -2
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +2 -2
- package/vanilla/UiMenuGroup.d.ts +1 -1
- package/vanilla/UiMenuGroup.js +1 -1
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +2 -2
- 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 +2 -2
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +2 -2
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +2 -2
- package/vanilla/UiTable.d.ts +1 -1
- package/vanilla/UiTable.js +1 -1
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +2 -2
- 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 +2 -2
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +2 -2
- 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 +2 -2
- package/vue/UiActionBar.vue +1 -1
- package/vue/UiAffordanceScope.vue +25 -7
- package/vue/UiAvatar.vue +125 -30
- package/vue/UiAvatarGroup.d.ts +1 -1
- package/vue/UiAvatarGroup.vue +67 -21
- package/vue/UiBadge.vue +34 -8
- package/vue/UiBreadcrumbItem.vue +15 -4
- package/vue/UiBreadcrumbs.vue +14 -4
- package/vue/UiButton.vue +123 -42
- package/vue/UiCallout.vue +16 -4
- package/vue/UiCard.vue +46 -10
- package/vue/UiCheckbox.d.ts +5 -5
- package/vue/UiCheckbox.vue +73 -19
- package/vue/UiCluster.vue +39 -10
- package/vue/UiCombobox.d.ts +5 -5
- package/vue/UiCombobox.vue +317 -78
- package/vue/UiContainer.vue +23 -6
- package/vue/UiContextMenu.vue +24 -7
- package/vue/UiCover.vue +16 -4
- package/vue/UiDescriptionItem.vue +14 -4
- package/vue/UiDescriptionList.vue +33 -8
- package/vue/UiDialog.vue +79 -26
- package/vue/UiDisclosure.vue +101 -38
- package/vue/UiEditable.d.ts +3 -3
- package/vue/UiEditable.vue +107 -27
- package/vue/UiEditorInsertTableGrid.vue +47 -11
- package/vue/UiEditorMentionMenu.vue +99 -20
- package/vue/UiEditorMentionMenuItem.vue +29 -8
- package/vue/UiEditorSlashMenu.vue +85 -16
- package/vue/UiEditorSlashMenuGroup.vue +14 -4
- package/vue/UiEditorSlashMenuItem.vue +43 -12
- package/vue/UiEditorTableContextMenu.d.ts +1 -1
- package/vue/UiEditorTableContextMenu.vue +95 -19
- package/vue/UiEditorTableOverlay.vue +91 -7
- package/vue/UiEditorTableToolbar.vue +105 -16
- package/vue/UiEditorToolbar.vue +15 -4
- package/vue/UiFloatingActionButton.vue +31 -8
- package/vue/UiFormField.d.ts +1 -1
- package/vue/UiFormField.vue +31 -8
- package/vue/UiGrid.vue +30 -8
- package/vue/UiIcon.vue +15 -4
- package/vue/UiIconButton.vue +70 -24
- package/vue/UiInput.vue +114 -39
- package/vue/UiInputGroup.vue +15 -4
- package/vue/UiList.vue +47 -16
- package/vue/UiListItem.vue +24 -6
- package/vue/UiListbox.d.ts +3 -3
- package/vue/UiListbox.vue +72 -24
- package/vue/UiMenu.vue +55 -15
- package/vue/UiMenuGroup.vue +14 -4
- package/vue/UiMenuItem.d.ts +4 -4
- package/vue/UiMenuItem.vue +77 -27
- package/vue/UiMeter.vue +65 -16
- package/vue/UiNavItem.vue +48 -24
- package/vue/UiPageHeader.vue +16 -4
- package/vue/UiPopover.vue +46 -21
- package/vue/UiRadio.d.ts +4 -4
- package/vue/UiRadio.vue +58 -15
- package/vue/UiRadioGroup.d.ts +3 -3
- package/vue/UiRadioGroup.vue +66 -17
- package/vue/UiReel.d.ts +1 -1
- package/vue/UiReel.vue +31 -8
- package/vue/UiScrollArea.vue +16 -4
- package/vue/UiSearchResultRow.vue +23 -6
- package/vue/UiSearchShell.vue +38 -11
- package/vue/UiSection.vue +33 -8
- package/vue/UiSelect.d.ts +1 -1
- package/vue/UiSelect.vue +45 -20
- package/vue/UiSeparator.vue +16 -4
- package/vue/UiSidebar.d.ts +2 -2
- package/vue/UiSidebar.vue +86 -22
- package/vue/UiSpinner.vue +23 -6
- package/vue/UiStack.vue +31 -8
- package/vue/UiStatusMessage.vue +32 -8
- package/vue/UiSwitch.d.ts +4 -4
- package/vue/UiSwitch.vue +57 -15
- package/vue/UiSwitcher.vue +41 -17
- package/vue/UiTable.vue +24 -6
- package/vue/UiTabs.vue +60 -14
- package/vue/UiText.vue +98 -35
- package/vue/UiTextarea.d.ts +1 -1
- package/vue/UiTextarea.vue +67 -26
- package/vue/UiToast.vue +24 -6
- package/vue/UiToastRegion.vue +41 -13
- package/vue/UiTooltip.d.ts +1 -1
- package/vue/UiTooltip.vue +85 -30
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.vue +56 -14
- package/vue/UiTreeItem.d.ts +3 -3
- package/vue/UiTreeItem.vue +147 -36
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +34 -7
- package/vue/chunks/UiAvatar.js +141 -21
- package/vue/chunks/UiAvatarGroup.js +83 -16
- package/vue/chunks/UiBadge.js +57 -19
- package/vue/chunks/UiBreadcrumbItem.js +19 -6
- package/vue/chunks/UiBreadcrumbs.js +19 -6
- package/vue/chunks/UiButton.js +194 -42
- package/vue/chunks/UiCallout.js +27 -13
- package/vue/chunks/UiCard.js +83 -25
- package/vue/chunks/UiCheckbox.js +104 -17
- package/vue/chunks/UiCluster.js +70 -25
- package/vue/chunks/UiCombobox.js +441 -46
- package/vue/chunks/UiContainer.js +36 -11
- package/vue/chunks/UiContextMenu.js +33 -7
- package/vue/chunks/UiCover.js +20 -6
- package/vue/chunks/UiDescriptionItem.js +18 -5
- package/vue/chunks/UiDescriptionList.js +54 -17
- package/vue/chunks/UiDialog.js +115 -23
- package/vue/chunks/UiDisclosure.js +110 -24
- package/vue/chunks/UiEditable.js +146 -18
- package/vue/chunks/UiEditorInsertTableGrid.js +65 -10
- package/vue/chunks/UiEditorMentionMenu.js +210 -14
- package/vue/chunks/UiEditorMentionMenuItem.js +43 -8
- package/vue/chunks/UiEditorSlashMenu.js +186 -12
- package/vue/chunks/UiEditorSlashMenuGroup.js +19 -6
- package/vue/chunks/UiEditorSlashMenuItem.js +65 -10
- package/vue/chunks/UiEditorTableContextMenu.js +116 -16
- package/vue/chunks/UiEditorTableOverlay.js +188 -7
- package/vue/chunks/UiEditorTableToolbar.js +125 -16
- package/vue/chunks/UiEditorToolbar.js +19 -6
- package/vue/chunks/UiFloatingActionButton.js +43 -8
- package/vue/chunks/UiFormField.js +43 -8
- package/vue/chunks/UiGrid.js +52 -18
- package/vue/chunks/UiIcon.js +19 -6
- package/vue/chunks/UiIconButton.js +107 -21
- package/vue/chunks/UiInput.js +309 -30
- package/vue/chunks/UiInputGroup.js +19 -6
- package/vue/chunks/UiList.js +62 -10
- package/vue/chunks/UiListItem.js +33 -7
- package/vue/chunks/UiListbox.js +105 -13
- package/vue/chunks/UiMenu.js +79 -11
- package/vue/chunks/UiMenuGroup.js +19 -6
- package/vue/chunks/UiMenuItem.js +93 -28
- package/vue/chunks/UiMeter.js +96 -19
- package/vue/chunks/UiNavItem.js +74 -17
- package/vue/chunks/UiPageHeader.js +20 -6
- package/vue/chunks/UiPopover.js +58 -21
- package/vue/chunks/UiRadio.js +82 -15
- package/vue/chunks/UiRadioGroup.js +89 -12
- package/vue/chunks/UiReel.js +53 -18
- package/vue/chunks/UiScrollArea.js +20 -6
- package/vue/chunks/UiSearchResultRow.js +32 -7
- package/vue/chunks/UiSearchShell.js +55 -9
- package/vue/chunks/UiSection.js +49 -12
- package/vue/chunks/UiSelect.js +68 -13
- package/vue/chunks/UiSeparator.js +20 -6
- package/vue/chunks/UiSidebar.js +123 -19
- package/vue/chunks/UiSpinner.js +33 -7
- package/vue/chunks/UiStack.js +59 -24
- package/vue/chunks/UiStatusMessage.js +53 -16
- package/vue/chunks/UiSwitch.js +82 -15
- package/vue/chunks/UiSwitcher.js +70 -25
- package/vue/chunks/UiTable.js +33 -7
- package/vue/chunks/UiTabs.js +81 -11
- package/vue/chunks/UiText.js +169 -58
- package/vue/chunks/UiTextarea.js +101 -16
- package/vue/chunks/UiToast.js +39 -13
- package/vue/chunks/UiToastRegion.js +41 -14
- package/vue/chunks/UiTooltip.js +113 -30
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +82 -15
- package/vue/chunks/UiTreeItem.js +184 -22
- package/vue/chunks/props.js +271 -35
- package/vue/components.css +1197 -1197
- package/vue/editor/index.js +5 -2
- package/vue/editor/primitives.d.ts +4 -1
- package/vue/host.ts +6 -6
package/vue/chunks/UiTreeItem.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
2
2
|
import { r as useComponentHost, t as createDispatch } from "./host.js";
|
|
3
|
-
import { t as checkedProp } from "./props.js";
|
|
4
|
-
import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, ref, renderSlot, toDisplayString, useTemplateRef, watchSyncEffect } from "vue";
|
|
3
|
+
import { r as vPropValidity, t as checkedProp } from "./props.js";
|
|
4
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
|
|
5
5
|
//#region .build/vue/UiTreeItem.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = [
|
|
7
7
|
"aria-label",
|
|
@@ -118,64 +118,204 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
118
118
|
},
|
|
119
119
|
emits: ["update:expanded", "expand"],
|
|
120
120
|
setup(__props, { emit: __emit }) {
|
|
121
|
+
const propValidityContract = { props: {
|
|
122
|
+
accepts: {
|
|
123
|
+
type: {
|
|
124
|
+
kind: "terminal",
|
|
125
|
+
name: "string"
|
|
126
|
+
},
|
|
127
|
+
required: false,
|
|
128
|
+
target: { attribute: "data-accepts" },
|
|
129
|
+
description: "A comma-separated list of the dragType values this branch accepts dropped inside it. Empty accepts any type. It does not affect drops before or after the\n item.",
|
|
130
|
+
default: ""
|
|
131
|
+
},
|
|
132
|
+
container: {
|
|
133
|
+
type: {
|
|
134
|
+
kind: "terminal",
|
|
135
|
+
name: "boolean"
|
|
136
|
+
},
|
|
137
|
+
required: false,
|
|
138
|
+
target: { attribute: "container" },
|
|
139
|
+
description: "Makes the item a branch even before it has children: it gets the expand button and aria-expanded, and accepts drops inside it. An item with nested items is\n a branch without it.",
|
|
140
|
+
default: false
|
|
141
|
+
},
|
|
142
|
+
disabled: {
|
|
143
|
+
type: {
|
|
144
|
+
kind: "terminal",
|
|
145
|
+
name: "boolean"
|
|
146
|
+
},
|
|
147
|
+
required: false,
|
|
148
|
+
target: { attribute: "aria-disabled" },
|
|
149
|
+
description: "Makes the item unavailable: faded, skipped by keyboard navigation, unable to expand or be dragged, and closed to drops inside it.",
|
|
150
|
+
default: false
|
|
151
|
+
},
|
|
152
|
+
dragType: {
|
|
153
|
+
type: {
|
|
154
|
+
kind: "terminal",
|
|
155
|
+
name: "string"
|
|
156
|
+
},
|
|
157
|
+
required: false,
|
|
158
|
+
target: { attribute: "data-drag-type" },
|
|
159
|
+
description: "The item's kind, for drag rules: it can be dropped before or after only items of the same type, and inside a branch only if that branch's accepts allows\n it. Reported as sourceType and targetType.",
|
|
160
|
+
default: "item"
|
|
161
|
+
},
|
|
162
|
+
dropDepth: {
|
|
163
|
+
type: {
|
|
164
|
+
kind: "terminal",
|
|
165
|
+
name: "number"
|
|
166
|
+
},
|
|
167
|
+
required: false,
|
|
168
|
+
target: { attribute: "data-drop-depth" },
|
|
169
|
+
description: "Overrides the level this item counts as when the tree checks maxDepth for a drop onto it. Unset, its level in the rendered tree is used; set it when the\n item sits deeper in the real hierarchy than the rendered tree shows."
|
|
170
|
+
},
|
|
171
|
+
dropScope: {
|
|
172
|
+
type: {
|
|
173
|
+
kind: "terminal",
|
|
174
|
+
name: "string"
|
|
175
|
+
},
|
|
176
|
+
required: false,
|
|
177
|
+
target: { attribute: "data-drop-scope" },
|
|
178
|
+
description: "Names the list the item sits in, such as its parent's id, and is reported as sourceScope and targetScope in the tree's reorder events, so a handler can\n tell a reorder within one list from a move between lists. It never restricts where an item can be dropped; dragType and accepts do that.",
|
|
179
|
+
default: ""
|
|
180
|
+
},
|
|
181
|
+
expanded: {
|
|
182
|
+
type: {
|
|
183
|
+
kind: "terminal",
|
|
184
|
+
name: "boolean"
|
|
185
|
+
},
|
|
186
|
+
required: false,
|
|
187
|
+
target: { attribute: "expanded" },
|
|
188
|
+
description: "Whether the branch shows its children, initially or when set externally. The expand button, a click on the row, and the arrow keys toggle it from there,\n each reported as an expand event. Only meaningful for a branch.",
|
|
189
|
+
default: false
|
|
190
|
+
},
|
|
191
|
+
itemId: {
|
|
192
|
+
type: {
|
|
193
|
+
kind: "terminal",
|
|
194
|
+
name: "string"
|
|
195
|
+
},
|
|
196
|
+
required: false,
|
|
197
|
+
target: { attribute: "data-item-id" },
|
|
198
|
+
description: "The item's identifier, reported as sourceId and targetId in the tree's reorder events and as id in its expand event. A sortable item needs one to be\n dragged, and a drop onto an item without one is not reported.",
|
|
199
|
+
default: ""
|
|
200
|
+
},
|
|
201
|
+
label: {
|
|
202
|
+
type: {
|
|
203
|
+
kind: "terminal",
|
|
204
|
+
name: "string"
|
|
205
|
+
},
|
|
206
|
+
required: false,
|
|
207
|
+
target: { attribute: "aria-label" },
|
|
208
|
+
description: "The item's accessible name, also shown as the row text unless the label slot supplies content.",
|
|
209
|
+
default: ""
|
|
210
|
+
},
|
|
211
|
+
lazy: {
|
|
212
|
+
type: {
|
|
213
|
+
kind: "terminal",
|
|
214
|
+
name: "boolean"
|
|
215
|
+
},
|
|
216
|
+
required: false,
|
|
217
|
+
target: { attribute: "lazy" },
|
|
218
|
+
description: "Keeps an empty item expandable while its children are supplied later. Expanding emits expand; the item is aria-busy until child Tree Items are appended.\n Clear lazy if loading finishes with no children.",
|
|
219
|
+
default: false
|
|
220
|
+
},
|
|
221
|
+
marquee: {
|
|
222
|
+
type: {
|
|
223
|
+
kind: "terminal",
|
|
224
|
+
name: "boolean"
|
|
225
|
+
},
|
|
226
|
+
required: false,
|
|
227
|
+
target: { attribute: "marquee" },
|
|
228
|
+
description: "Scrolls a name too long for its row while a pointer hovers the row or keyboard focus is in it, rests at the end, then scrolls it again from the start. A\n touch does not start it. Off by default: a tree of short names should not move, and a product decides whether reading the whole name matters more than a\n still list.",
|
|
229
|
+
default: false
|
|
230
|
+
},
|
|
231
|
+
selected: {
|
|
232
|
+
type: {
|
|
233
|
+
kind: "terminal",
|
|
234
|
+
name: "boolean"
|
|
235
|
+
},
|
|
236
|
+
required: false,
|
|
237
|
+
target: { attribute: "aria-selected" },
|
|
238
|
+
description: "Marks the item selected: it sets aria-selected and highlights the row. This is controlled state; respond to the parent Tree's select request by updating\n it.",
|
|
239
|
+
default: false
|
|
240
|
+
},
|
|
241
|
+
sortable: {
|
|
242
|
+
type: {
|
|
243
|
+
kind: "terminal",
|
|
244
|
+
name: "boolean"
|
|
245
|
+
},
|
|
246
|
+
required: false,
|
|
247
|
+
target: { attribute: "sortable" },
|
|
248
|
+
description: "Gives the item a move handle. Drag it, or activate it and choose a target by a second click or the keyboard. The tree reports reorder and leaves moving the\n item to you. Needs itemId; disabled items show no handle.",
|
|
249
|
+
default: false
|
|
250
|
+
},
|
|
251
|
+
subtreeDepth: {
|
|
252
|
+
type: {
|
|
253
|
+
kind: "terminal",
|
|
254
|
+
name: "number"
|
|
255
|
+
},
|
|
256
|
+
required: false,
|
|
257
|
+
target: { attribute: "data-subtree-depth" },
|
|
258
|
+
description: "Overrides how many levels sit beneath this item when the tree checks maxDepth for a drag of it. Unset, the tree counts the rendered descendants; set it\n when some are not rendered, such as children that load later."
|
|
259
|
+
}
|
|
260
|
+
} };
|
|
121
261
|
const props = __props;
|
|
122
262
|
const checkedProps = computed(() => ({
|
|
123
263
|
accepts: checkedProp(props["accepts"], {
|
|
124
264
|
kind: "terminal",
|
|
125
265
|
name: "string"
|
|
126
|
-
}, false, "accepts"
|
|
266
|
+
}, false, "accepts"),
|
|
127
267
|
container: checkedProp(props["container"], {
|
|
128
268
|
kind: "terminal",
|
|
129
269
|
name: "boolean"
|
|
130
|
-
}, false, "container"
|
|
270
|
+
}, false, "container"),
|
|
131
271
|
disabled: checkedProp(props["disabled"], {
|
|
132
272
|
kind: "terminal",
|
|
133
273
|
name: "boolean"
|
|
134
|
-
}, false, "disabled"
|
|
274
|
+
}, false, "disabled"),
|
|
135
275
|
dragType: checkedProp(props["dragType"], {
|
|
136
276
|
kind: "terminal",
|
|
137
277
|
name: "string"
|
|
138
|
-
}, false, "dragType"
|
|
278
|
+
}, false, "dragType"),
|
|
139
279
|
dropDepth: checkedProp(props["dropDepth"], {
|
|
140
280
|
kind: "terminal",
|
|
141
281
|
name: "number"
|
|
142
|
-
}, false, "dropDepth"
|
|
282
|
+
}, false, "dropDepth"),
|
|
143
283
|
dropScope: checkedProp(props["dropScope"], {
|
|
144
284
|
kind: "terminal",
|
|
145
285
|
name: "string"
|
|
146
|
-
}, false, "dropScope"
|
|
286
|
+
}, false, "dropScope"),
|
|
147
287
|
expanded: checkedProp(props["expanded"], {
|
|
148
288
|
kind: "terminal",
|
|
149
289
|
name: "boolean"
|
|
150
|
-
}, false, "expanded"
|
|
290
|
+
}, false, "expanded"),
|
|
151
291
|
itemId: checkedProp(props["itemId"], {
|
|
152
292
|
kind: "terminal",
|
|
153
293
|
name: "string"
|
|
154
|
-
}, false, "itemId"
|
|
294
|
+
}, false, "itemId"),
|
|
155
295
|
label: checkedProp(props["label"], {
|
|
156
296
|
kind: "terminal",
|
|
157
297
|
name: "string"
|
|
158
|
-
}, false, "label"
|
|
298
|
+
}, false, "label"),
|
|
159
299
|
lazy: checkedProp(props["lazy"], {
|
|
160
300
|
kind: "terminal",
|
|
161
301
|
name: "boolean"
|
|
162
|
-
}, false, "lazy"
|
|
302
|
+
}, false, "lazy"),
|
|
163
303
|
marquee: checkedProp(props["marquee"], {
|
|
164
304
|
kind: "terminal",
|
|
165
305
|
name: "boolean"
|
|
166
|
-
}, false, "marquee"
|
|
306
|
+
}, false, "marquee"),
|
|
167
307
|
selected: checkedProp(props["selected"], {
|
|
168
308
|
kind: "terminal",
|
|
169
309
|
name: "boolean"
|
|
170
|
-
}, false, "selected"
|
|
310
|
+
}, false, "selected"),
|
|
171
311
|
sortable: checkedProp(props["sortable"], {
|
|
172
312
|
kind: "terminal",
|
|
173
313
|
name: "boolean"
|
|
174
|
-
}, false, "sortable"
|
|
314
|
+
}, false, "sortable"),
|
|
175
315
|
subtreeDepth: checkedProp(props["subtreeDepth"], {
|
|
176
316
|
kind: "terminal",
|
|
177
317
|
name: "number"
|
|
178
|
-
}, false, "subtreeDepth"
|
|
318
|
+
}, false, "subtreeDepth")
|
|
179
319
|
}));
|
|
180
320
|
checkedProps.value;
|
|
181
321
|
watchSyncEffect(() => {
|
|
@@ -208,6 +348,25 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
208
348
|
const structuralLevel = ref(1);
|
|
209
349
|
const tabStop = ref(false);
|
|
210
350
|
const isContainer = ref(false);
|
|
351
|
+
let guardedPrevious;
|
|
352
|
+
const guarded = computed(() => {
|
|
353
|
+
if (!(structuralLevel.value == null || Number.isInteger(structuralLevel.value))) return guardedPrevious;
|
|
354
|
+
return guardedPrevious = structuralLevel.value;
|
|
355
|
+
});
|
|
356
|
+
let guardedBindingPrevious;
|
|
357
|
+
const guardedBinding = computed(() => {
|
|
358
|
+
if (!(isContainer.value == null || typeof isContainer.value === "boolean")) return guardedBindingPrevious;
|
|
359
|
+
return guardedBindingPrevious = !isContainer.value;
|
|
360
|
+
});
|
|
361
|
+
let guardedBinding2Previous;
|
|
362
|
+
const guardedBinding2 = computed(() => {
|
|
363
|
+
if (!((internalExpanded.value == null || typeof internalExpanded.value === "boolean") && (isContainer.value == null || typeof isContainer.value === "boolean"))) return guardedBinding2Previous;
|
|
364
|
+
return guardedBinding2Previous = !(isContainer.value && internalExpanded.value);
|
|
365
|
+
});
|
|
366
|
+
provide("html-next:ui-tree-item:internalExpanded", internalExpanded);
|
|
367
|
+
provide("html-next:ui-tree-item:structuralLevel", structuralLevel);
|
|
368
|
+
provide("html-next:ui-tree-item:tabStop", tabStop);
|
|
369
|
+
provide("html-next:ui-tree-item:isContainer", isContainer);
|
|
211
370
|
const hydrationNode = hydrationInstance?.vnode.el;
|
|
212
371
|
if (typeof window !== "undefined" && hydrationNode != null && (!(hydrationNode instanceof Element) || hydrationNode.localName !== "div")) throw Object.assign(/* @__PURE__ */ new Error("HR005: Server markup for <ui-tree-item> has an incompatible root."), {
|
|
213
372
|
name: "HtmlDiagnosticError",
|
|
@@ -262,12 +421,12 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
262
421
|
}
|
|
263
422
|
});
|
|
264
423
|
return (_ctx, _cache) => {
|
|
265
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
424
|
+
return withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
266
425
|
"data-component": "ui-tree-item",
|
|
267
426
|
role: "treeitem"
|
|
268
427
|
}, nativeAttrs(_ctx.$attrs), {
|
|
269
428
|
"aria-label": checkedProps.value.label ?? void 0,
|
|
270
|
-
"aria-level":
|
|
429
|
+
"aria-level": guarded.value,
|
|
271
430
|
"aria-selected": checkedProps.value.selected ?? void 0,
|
|
272
431
|
"aria-disabled": checkedProps.value.disabled ?? void 0,
|
|
273
432
|
"data-accepts": reflectedProp("accepts", "accepts", checkedProps.value.accepts, void 0, true),
|
|
@@ -341,7 +500,7 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
341
500
|
class: "disclosure",
|
|
342
501
|
type: "button",
|
|
343
502
|
disabled: checkedProps.value.disabled ?? void 0,
|
|
344
|
-
hidden:
|
|
503
|
+
hidden: guardedBinding.value,
|
|
345
504
|
ref: "disclosure"
|
|
346
505
|
}, [..._cache[1] || (_cache[1] = [createElementVNode("span", {
|
|
347
506
|
class: "disclosure-icon",
|
|
@@ -366,16 +525,19 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
366
525
|
createElementVNode("div", {
|
|
367
526
|
class: "children",
|
|
368
527
|
role: "group",
|
|
369
|
-
hidden:
|
|
528
|
+
hidden: guardedBinding2.value,
|
|
370
529
|
ref: "children"
|
|
371
530
|
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_11),
|
|
372
531
|
_cache[3] || (_cache[3] = createElementVNode("span", {
|
|
373
532
|
class: "drop-indicator subtree-drop-indicator",
|
|
374
533
|
"aria-hidden": "true"
|
|
375
534
|
}, null, -1))
|
|
376
|
-
], 16, _hoisted_1)
|
|
535
|
+
], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
536
|
+
contract: propValidityContract,
|
|
537
|
+
values: { ...checkedProps.value }
|
|
538
|
+
}]]);
|
|
377
539
|
};
|
|
378
540
|
}
|
|
379
|
-
}), [["__scopeId", "data-v-
|
|
541
|
+
}), [["__scopeId", "data-v-0e350273"]]);
|
|
380
542
|
//#endregion
|
|
381
543
|
export { UiTreeItem_default as t };
|
package/vue/chunks/props.js
CHANGED
|
@@ -171,17 +171,6 @@ var CSS_NAMED_COLOR_SET = /* @__PURE__ */ new Set([
|
|
|
171
171
|
"yellowgreen"
|
|
172
172
|
]);
|
|
173
173
|
var HTML_EMAIL_PATTERN = /^[a-zA-Z0-9.!#$%&'*+/?=^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
174
|
-
var HtmlDiagnosticError = class extends Error {
|
|
175
|
-
diagnostic;
|
|
176
|
-
constructor(code, message) {
|
|
177
|
-
super(code + ": " + message);
|
|
178
|
-
this.name = "HtmlDiagnosticError";
|
|
179
|
-
this.diagnostic = Object.freeze({
|
|
180
|
-
code,
|
|
181
|
-
message
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
174
|
function issue(path, message) {
|
|
186
175
|
return {
|
|
187
176
|
ok: false,
|
|
@@ -287,7 +276,7 @@ function typeName(node) {
|
|
|
287
276
|
"object"
|
|
288
277
|
].includes(node.value) ? node.value : JSON.stringify(node.value);
|
|
289
278
|
case "union": return node.members.map(typeName).join(" | ");
|
|
290
|
-
case "constrained": return typeName(node.base) + " with values " + node.values.map(String).join(", ");
|
|
279
|
+
case "constrained": return typeName(node.base) + (node.values === void 0 ? "" : " with values " + node.values.map(String).join(", "));
|
|
291
280
|
case "list": return "list(" + typeName(node.item) + ")";
|
|
292
281
|
case "record": return "record(" + typeName(node.value) + ")";
|
|
293
282
|
case "object": return "object({ " + [...node.fields.map((field) => field.name + (field.optional ? "?" : "") + ": " + typeName(field.type)), ...node.open ? ["..."] : []].join(", ") + " })";
|
|
@@ -371,7 +360,10 @@ function parse(value, node, path) {
|
|
|
371
360
|
return issue(path, "Must match " + typeName(node) + ".");
|
|
372
361
|
case "constrained": {
|
|
373
362
|
const parsed = parse(value, node.base, path);
|
|
374
|
-
|
|
363
|
+
if (!parsed.ok) return parsed;
|
|
364
|
+
if (node.values !== void 0 && !node.values.some((choice) => choice === parsed.value)) return issue(path, "Must be one of " + node.values.map(String).join(", ") + ".");
|
|
365
|
+
const problem = boundProblem(parsed.value, node.base.kind === "terminal" ? node.base.name : "", node);
|
|
366
|
+
return problem === void 0 ? parsed : issue(path, problem);
|
|
375
367
|
}
|
|
376
368
|
case "list": {
|
|
377
369
|
const input = structured(value);
|
|
@@ -445,34 +437,278 @@ function selectedPropNode(selector, options) {
|
|
|
445
437
|
kind: "terminal",
|
|
446
438
|
name: "null"
|
|
447
439
|
};
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
440
|
+
return options.find((candidate) => candidate.value === selector)?.type ?? {
|
|
441
|
+
kind: "terminal",
|
|
442
|
+
name: "null"
|
|
443
|
+
};
|
|
451
444
|
}
|
|
452
|
-
function
|
|
453
|
-
if (value === void 0
|
|
454
|
-
|
|
455
|
-
|
|
445
|
+
function comparable(value, type) {
|
|
446
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
447
|
+
if (typeof value !== "string") return void 0;
|
|
448
|
+
const date = /^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/.exec(value);
|
|
449
|
+
const month = /^([0-9]{4,})-([0-9]{2})$/.exec(value);
|
|
450
|
+
const week = /^([0-9]{4,})-W([0-9]{2})$/.exec(value);
|
|
451
|
+
const time = /^([0-9]{2}):([0-9]{2})(?::([0-9]{2})(?:\.([0-9]+))?)?$/.exec(value);
|
|
452
|
+
switch (type) {
|
|
453
|
+
case "number":
|
|
454
|
+
case "integer": return Number.isFinite(Number(value)) ? Number(value) : void 0;
|
|
455
|
+
case "date": return date === null ? void 0 : Number(date[1]) * 372 + Number(date[2]) * 31 + Number(date[3]);
|
|
456
|
+
case "month": return month === null ? void 0 : Number(month[1]) * 12 + Number(month[2]);
|
|
457
|
+
case "week": return week === null ? void 0 : Number(week[1]) * 53 + Number(week[2]);
|
|
458
|
+
case "time": return time === null ? void 0 : Number(time[1]) * 3600 + Number(time[2]) * 60 + Number(time[3] ?? 0) + Number("0." + (time[4] ?? "0"));
|
|
459
|
+
case "datetime-local": {
|
|
460
|
+
const parsed = Date.parse(value.replace(" ", "T") + "Z");
|
|
461
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
462
|
+
}
|
|
463
|
+
case "datetime": {
|
|
464
|
+
const parsed = Date.parse(value);
|
|
465
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
466
|
+
}
|
|
467
|
+
default: return;
|
|
456
468
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
469
|
+
}
|
|
470
|
+
function boundProblem(value, type, bounds) {
|
|
471
|
+
if (value === null || value === void 0 || value === "") return void 0;
|
|
472
|
+
const actual = comparable(value, type);
|
|
473
|
+
if (actual !== void 0) {
|
|
474
|
+
const min = comparable(bounds.min, type);
|
|
475
|
+
const max = comparable(bounds.max, type);
|
|
476
|
+
if (min !== void 0 && actual < min) return "Value is below its minimum.";
|
|
477
|
+
if (max !== void 0 && actual > max) return "Value is above its maximum.";
|
|
460
478
|
}
|
|
479
|
+
if (typeof value === "string") {
|
|
480
|
+
if (bounds.minLength !== void 0 && value.length < bounds.minLength) return "Value is too short.";
|
|
481
|
+
if (bounds.maxLength !== void 0 && value.length > bounds.maxLength) return "Value is too long.";
|
|
482
|
+
if (bounds.pattern !== void 0) {
|
|
483
|
+
let expression;
|
|
484
|
+
try {
|
|
485
|
+
expression = new RegExp("^(?:" + bounds.pattern + ")$", "v");
|
|
486
|
+
} catch {
|
|
487
|
+
expression = new RegExp("^(?:" + bounds.pattern + ")$", "u");
|
|
488
|
+
}
|
|
489
|
+
if (!expression.test(value)) return "Value does not match its pattern.";
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
function checkedProp(value, type, _required, _name) {
|
|
494
|
+
if (value === void 0 || value === null) return null;
|
|
461
495
|
if (value === "" && type.kind === "terminal" && type.name === "boolean") value = true;
|
|
462
|
-
if (required && value === "") throw new HtmlDiagnosticError("HR002", "A required prop cannot be empty.");
|
|
463
496
|
const result = parse(value, type, "$");
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
497
|
+
return result.ok ? result.value : value;
|
|
498
|
+
}
|
|
499
|
+
function propValidity(binding) {
|
|
500
|
+
const errors = [];
|
|
501
|
+
for (const [name, prop] of Object.entries(binding.contract.props)) {
|
|
502
|
+
const value = binding.values[name];
|
|
503
|
+
const selected = prop.select === void 0 ? prop.type : selectedPropNode(binding.values[prop.select.from], prop.select.options);
|
|
504
|
+
if (value === null || value === void 0 || value === "") {
|
|
505
|
+
if (prop.required) errors.push({
|
|
506
|
+
reason: "valueMissing",
|
|
507
|
+
message: "This field is required.",
|
|
508
|
+
path: name
|
|
509
|
+
});
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
if (selected.kind === "terminal" && selected.name === "null") {
|
|
513
|
+
errors.push({
|
|
514
|
+
reason: "typeMismatch",
|
|
515
|
+
message: "No type option matches the selector.",
|
|
516
|
+
path: name
|
|
517
|
+
});
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
const result = parse(value, selected, name);
|
|
521
|
+
if (!result.ok) {
|
|
522
|
+
const terminal = selected.kind === "terminal" ? selected.name : "";
|
|
523
|
+
errors.push(...result.issues.map((message) => ({
|
|
524
|
+
reason: terminal === "email" || terminal === "url" ? "typeMismatch" : "badInput",
|
|
525
|
+
message,
|
|
526
|
+
path: name
|
|
527
|
+
})));
|
|
472
528
|
}
|
|
473
|
-
if (
|
|
529
|
+
if (prop.values !== void 0 && !prop.values.some((choice) => choice === value)) errors.push({
|
|
530
|
+
reason: "typeMismatch",
|
|
531
|
+
message: "Value must be one of " + prop.values.map(String).join(", ") + ".",
|
|
532
|
+
path: name
|
|
533
|
+
});
|
|
534
|
+
const type = selected.kind === "terminal" ? selected.name : "";
|
|
535
|
+
const actual = comparable(value, type);
|
|
536
|
+
const min = comparable(prop.min, type);
|
|
537
|
+
const max = comparable(prop.max, type);
|
|
538
|
+
if (actual !== void 0 && min !== void 0 && actual < min) errors.push({
|
|
539
|
+
reason: "rangeUnderflow",
|
|
540
|
+
message: "Value must be at least " + prop.min + ".",
|
|
541
|
+
path: name
|
|
542
|
+
});
|
|
543
|
+
if (actual !== void 0 && max !== void 0 && actual > max) errors.push({
|
|
544
|
+
reason: "rangeOverflow",
|
|
545
|
+
message: "Value must be at most " + prop.max + ".",
|
|
546
|
+
path: name
|
|
547
|
+
});
|
|
548
|
+
if (typeof value === "string") {
|
|
549
|
+
if (prop.minLength !== void 0 && value.length < prop.minLength) errors.push({
|
|
550
|
+
reason: "tooShort",
|
|
551
|
+
message: "Use at least " + prop.minLength + " characters.",
|
|
552
|
+
path: name
|
|
553
|
+
});
|
|
554
|
+
if (prop.maxLength !== void 0 && value.length > prop.maxLength) errors.push({
|
|
555
|
+
reason: "tooLong",
|
|
556
|
+
message: "Use at most " + prop.maxLength + " characters.",
|
|
557
|
+
path: name
|
|
558
|
+
});
|
|
559
|
+
if (prop.pattern !== void 0) {
|
|
560
|
+
let pattern;
|
|
561
|
+
try {
|
|
562
|
+
pattern = new RegExp("^(?:" + prop.pattern + ")$", "v");
|
|
563
|
+
} catch {
|
|
564
|
+
try {
|
|
565
|
+
pattern = new RegExp("^(?:" + prop.pattern + ")$", "u");
|
|
566
|
+
} catch {}
|
|
567
|
+
}
|
|
568
|
+
if (pattern !== void 0 && !pattern.test(value)) errors.push({
|
|
569
|
+
reason: "patternMismatch",
|
|
570
|
+
message: "Value does not match the required format.",
|
|
571
|
+
path: name
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return {
|
|
577
|
+
valid: errors.length === 0,
|
|
578
|
+
errors
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
var validityStates = /* @__PURE__ */ new WeakMap();
|
|
582
|
+
var ariaMirrors = /* @__PURE__ */ new WeakSet();
|
|
583
|
+
var REASONS = [
|
|
584
|
+
"valueMissing",
|
|
585
|
+
"typeMismatch",
|
|
586
|
+
"patternMismatch",
|
|
587
|
+
"tooLong",
|
|
588
|
+
"tooShort",
|
|
589
|
+
"rangeUnderflow",
|
|
590
|
+
"rangeOverflow",
|
|
591
|
+
"stepMismatch",
|
|
592
|
+
"badInput",
|
|
593
|
+
"customError",
|
|
594
|
+
"schemaMismatch",
|
|
595
|
+
"untrustedValue"
|
|
596
|
+
];
|
|
597
|
+
function reflectValidity(el, state) {
|
|
598
|
+
const errors = [...state.validity.errors, ...state.external];
|
|
599
|
+
const valid = errors.length === 0;
|
|
600
|
+
if ([
|
|
601
|
+
"button",
|
|
602
|
+
"fieldset",
|
|
603
|
+
"input",
|
|
604
|
+
"object",
|
|
605
|
+
"output",
|
|
606
|
+
"select",
|
|
607
|
+
"textarea"
|
|
608
|
+
].includes(el.localName) && "setCustomValidity" in el && typeof el.setCustomValidity === "function") {
|
|
609
|
+
el.setCustomValidity(valid ? "" : errors[0].message);
|
|
610
|
+
return;
|
|
474
611
|
}
|
|
475
|
-
|
|
612
|
+
el.toggleAttribute("data-valid", valid);
|
|
613
|
+
el.toggleAttribute("data-invalid", !valid);
|
|
614
|
+
el.toggleAttribute("data-user-invalid", state.interacted && !valid);
|
|
615
|
+
if (valid) {
|
|
616
|
+
if (ariaMirrors.has(el)) {
|
|
617
|
+
el.removeAttribute("aria-invalid");
|
|
618
|
+
ariaMirrors.delete(el);
|
|
619
|
+
}
|
|
620
|
+
} else if (!el.hasAttribute("aria-invalid") || ariaMirrors.has(el)) {
|
|
621
|
+
el.setAttribute("aria-invalid", "true");
|
|
622
|
+
ariaMirrors.add(el);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function validityState(state) {
|
|
626
|
+
const errors = [...state.validity.errors, ...state.external];
|
|
627
|
+
const reasons = new Set(errors.map((error) => error.reason));
|
|
628
|
+
return Object.freeze({
|
|
629
|
+
valid: errors.length === 0,
|
|
630
|
+
...Object.fromEntries(REASONS.map((reason) => [reason, reasons.has(reason)])),
|
|
631
|
+
errors
|
|
632
|
+
});
|
|
476
633
|
}
|
|
634
|
+
var vPropValidity = {
|
|
635
|
+
mounted(el, binding) {
|
|
636
|
+
const state = {
|
|
637
|
+
current: binding.value,
|
|
638
|
+
validity: propValidity(binding.value),
|
|
639
|
+
external: [],
|
|
640
|
+
interacted: false,
|
|
641
|
+
cleanup: () => {}
|
|
642
|
+
};
|
|
643
|
+
validityStates.set(el, state);
|
|
644
|
+
if (!("validity" in el)) {
|
|
645
|
+
const target = el;
|
|
646
|
+
Object.defineProperties(target, {
|
|
647
|
+
validity: {
|
|
648
|
+
configurable: true,
|
|
649
|
+
get: () => validityState(state)
|
|
650
|
+
},
|
|
651
|
+
validationMessage: {
|
|
652
|
+
configurable: true,
|
|
653
|
+
get: () => validityState(state).errors[0]?.message ?? ""
|
|
654
|
+
},
|
|
655
|
+
willValidate: {
|
|
656
|
+
configurable: true,
|
|
657
|
+
get: () => true
|
|
658
|
+
},
|
|
659
|
+
checkValidity: {
|
|
660
|
+
configurable: true,
|
|
661
|
+
value: () => {
|
|
662
|
+
const valid = validityState(state).valid;
|
|
663
|
+
if (!valid) el.dispatchEvent(new Event("invalid", { cancelable: true }));
|
|
664
|
+
return valid;
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
reportValidity: {
|
|
668
|
+
configurable: true,
|
|
669
|
+
value: () => {
|
|
670
|
+
state.interacted = true;
|
|
671
|
+
reflectValidity(el, state);
|
|
672
|
+
return target.checkValidity();
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
setCustomValidity: {
|
|
676
|
+
configurable: true,
|
|
677
|
+
value: (message) => {
|
|
678
|
+
state.external = message === "" ? [] : [{
|
|
679
|
+
reason: "customError",
|
|
680
|
+
message
|
|
681
|
+
}];
|
|
682
|
+
reflectValidity(el, state);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
const interacted = () => {
|
|
688
|
+
state.interacted = true;
|
|
689
|
+
reflectValidity(el, state);
|
|
690
|
+
};
|
|
691
|
+
el.addEventListener("input", interacted);
|
|
692
|
+
el.addEventListener("change", interacted);
|
|
693
|
+
el.addEventListener("blur", interacted, true);
|
|
694
|
+
state.cleanup = () => {
|
|
695
|
+
el.removeEventListener("input", interacted);
|
|
696
|
+
el.removeEventListener("change", interacted);
|
|
697
|
+
el.removeEventListener("blur", interacted, true);
|
|
698
|
+
};
|
|
699
|
+
reflectValidity(el, state);
|
|
700
|
+
},
|
|
701
|
+
updated(el, binding) {
|
|
702
|
+
const state = validityStates.get(el);
|
|
703
|
+
if (state === void 0) return;
|
|
704
|
+
state.current = binding.value;
|
|
705
|
+
state.validity = propValidity(state.current);
|
|
706
|
+
reflectValidity(el, state);
|
|
707
|
+
},
|
|
708
|
+
unmounted(el) {
|
|
709
|
+
validityStates.get(el)?.cleanup();
|
|
710
|
+
validityStates.delete(el);
|
|
711
|
+
}
|
|
712
|
+
};
|
|
477
713
|
//#endregion
|
|
478
|
-
export { selectedPropNode as n, checkedProp as t };
|
|
714
|
+
export { selectedPropNode as n, vPropValidity as r, checkedProp as t };
|