@threadlabs/looma 0.14.7 → 0.15.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/components/shared/icons.js +5 -0
- package/components/shared/menu-navigation.js +49 -0
- package/components/shared/overlay.js +33 -60
- package/components/ui-avatar/ui-avatar.html +19 -2
- package/components/ui-avatar/ui-avatar.js +7 -1
- package/components/ui-avatar-group/ui-avatar-group.html +8 -3
- package/components/ui-avatar-group/ui-avatar-group.js +6 -2
- package/components/ui-badge/ui-badge.html +70 -4
- package/components/ui-button/ui-button.html +21 -5
- package/components/ui-button/ui-button.js +10 -0
- package/components/ui-callout/ui-callout.html +13 -5
- package/components/ui-checkbox/ui-checkbox.html +11 -0
- package/components/ui-combobox/ui-combobox.html +50 -10
- package/components/ui-combobox/ui-combobox.js +11 -8
- package/components/ui-context-menu/ui-context-menu.html +33 -5
- package/components/ui-context-menu/ui-context-menu.js +26 -17
- package/components/ui-dialog/ui-dialog.html +51 -8
- package/components/ui-dialog/ui-dialog.js +28 -7
- package/components/ui-disclosure/ui-disclosure.html +14 -5
- package/components/ui-disclosure/ui-disclosure.js +51 -4
- package/components/ui-editable/ui-editable.html +17 -3
- package/components/ui-editable/ui-editable.js +7 -0
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +48 -14
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +40 -6
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +22 -9
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +33 -11
- package/components/ui-editor-mention-menu-item/ui-editor-mention-menu-item.html +67 -0
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +33 -30
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +42 -8
- package/components/ui-editor-slash-menu-group/ui-editor-slash-menu-group.html +31 -0
- package/components/ui-editor-slash-menu-item/ui-editor-slash-menu-item.html +75 -0
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +16 -5
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +10 -2
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +5 -5
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +5 -2
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +14 -4
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +2 -2
- package/components/ui-editor-toolbar/ui-editor-toolbar.html +1 -1
- package/components/ui-editor-toolbar/ui-editor-toolbar.js +46 -0
- package/components/ui-floating-action-button/ui-floating-action-button.html +1 -1
- package/components/ui-form-field/ui-form-field.html +16 -3
- package/components/ui-form-field/ui-form-field.js +1 -1
- package/components/ui-grid/ui-grid.html +17 -2
- package/components/ui-icon/ui-icon.html +5 -0
- package/components/ui-icon-button/ui-icon-button.html +25 -6
- package/components/ui-icon-button/ui-icon-button.js +11 -1
- package/components/ui-input/ui-input.html +3 -3
- package/components/ui-input-group/ui-input-group.html +18 -4
- package/components/ui-listbox/ui-listbox.html +81 -0
- package/components/ui-listbox/ui-listbox.js +27 -0
- package/components/ui-menu/ui-menu.html +33 -5
- package/components/ui-menu/ui-menu.js +18 -12
- package/components/ui-menu-group/ui-menu-group.html +27 -0
- package/components/ui-menu-item/ui-menu-item.html +80 -8
- package/components/ui-menu-item/ui-menu-item.js +47 -0
- package/components/ui-popover/ui-popover.html +33 -5
- package/components/ui-popover/ui-popover.js +9 -1
- package/components/ui-radio-group/ui-radio-group.html +13 -1
- package/components/ui-search-shell/ui-search-shell.html +6 -6
- package/components/ui-search-shell/ui-search-shell.js +21 -5
- package/components/ui-select/ui-select.html +14 -4
- package/components/ui-switch/ui-switch.html +2 -2
- package/components/ui-switcher/ui-switcher.html +8 -1
- package/components/ui-switcher/ui-switcher.js +15 -0
- package/components/ui-tabs/ui-tabs.html +17 -12
- package/components/ui-tabs/ui-tabs.js +43 -7
- package/components/ui-textarea/ui-textarea.html +28 -5
- package/components/ui-toast/ui-toast.html +88 -0
- package/components/ui-toast/ui-toast.js +68 -0
- package/components/ui-toast-region/ui-toast-region.html +102 -19
- package/components/ui-toast-region/ui-toast-region.js +10 -18
- package/components/ui-tooltip/ui-tooltip.html +51 -7
- package/components/ui-tooltip/ui-tooltip.js +29 -3
- package/components/ui-tree/ui-tree.html +12 -0
- package/components/ui-tree/ui-tree.js +191 -12
- package/components/ui-tree-item/ui-tree-item.html +87 -8
- package/components/ui-tree-item/ui-tree-item.js +3 -1
- package/dist/index.js +38 -32
- package/editor/chunks/extensions.js +82 -2
- package/editor/extensions/table-commands.d.ts +8 -0
- package/editor/icons.d.ts +5 -0
- package/editor/index.js +7 -2
- package/editor/insert-table-grid.d.ts +1 -1
- package/editor/mention-menu.d.ts +2 -0
- package/editor/slash-menu.d.ts +3 -0
- package/editor/table-context-menu.d.ts +1 -1
- package/editor/table-overlay.d.ts +2 -2
- package/package.json +1 -1
- package/styles/ui-avatar-group.css +1 -2
- package/styles/ui-avatar.css +11 -1
- package/styles/ui-badge.css +73 -1
- package/styles/ui-button.css +9 -1
- package/styles/ui-callout.css +1 -1
- package/styles/ui-checkbox.css +9 -0
- package/styles/ui-combobox.css +38 -7
- package/styles/ui-context-menu.css +32 -4
- package/styles/ui-dialog.css +42 -5
- package/styles/ui-editor-insert-table-grid.css +48 -11
- package/styles/ui-editor-mention-menu-item.css +57 -0
- package/styles/ui-editor-mention-menu.css +11 -1
- package/styles/ui-editor-slash-menu-group.css +21 -0
- package/styles/ui-editor-slash-menu-item.css +62 -0
- package/styles/ui-editor-slash-menu.css +10 -21
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +14 -1
- package/styles/ui-grid.css +14 -1
- package/styles/ui-icon-button.css +17 -5
- package/styles/ui-input-group.css +18 -4
- package/styles/ui-input.css +3 -3
- package/styles/ui-listbox.css +69 -0
- package/styles/ui-menu-group.css +19 -0
- package/styles/ui-menu-item.css +48 -9
- package/styles/ui-menu.css +32 -4
- package/styles/ui-popover.css +28 -4
- package/styles/ui-radio-group.css +9 -0
- package/styles/ui-search-shell.css +5 -5
- package/styles/ui-select.css +14 -4
- package/styles/ui-switch.css +2 -2
- package/styles/ui-switcher.css +4 -0
- package/styles/ui-textarea.css +27 -4
- package/styles/ui-toast-region.css +88 -4
- package/styles/ui-toast.css +74 -0
- package/styles/ui-tooltip.css +46 -6
- package/styles/ui-tree-item.css +72 -4
- package/styles/ui-tree.css +8 -0
- package/tokens.css +3 -0
- package/vanilla/UiAvatar.d.ts +2 -0
- package/vanilla/UiAvatar.js +8 -1
- package/vanilla/UiAvatarGroup.d.ts +2 -0
- package/vanilla/UiAvatarGroup.js +1 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vanilla/UiButton.d.ts +1 -0
- package/vanilla/UiButton.js +22 -6
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -0
- package/vanilla/UiCheckbox.js +12 -9
- package/vanilla/UiCombobox.d.ts +4 -0
- package/vanilla/UiCombobox.js +30 -15
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +1 -1
- package/vanilla/UiDialog.d.ts +5 -2
- package/vanilla/UiDialog.js +1 -1
- package/vanilla/UiDisclosure.d.ts +2 -0
- package/vanilla/UiDisclosure.js +32 -18
- package/vanilla/UiEditable.d.ts +5 -0
- package/vanilla/UiEditable.js +7 -3
- package/vanilla/UiEditorInsertTableGrid.js +1 -6
- package/vanilla/UiEditorMentionMenu.d.ts +4 -2
- package/vanilla/UiEditorMentionMenu.js +49 -31
- package/vanilla/UiEditorMentionMenuItem.d.ts +16 -0
- package/vanilla/UiEditorMentionMenuItem.js +56 -0
- package/vanilla/UiEditorSlashMenu.d.ts +4 -3
- package/vanilla/UiEditorSlashMenu.js +59 -46
- package/vanilla/UiEditorSlashMenuGroup.d.ts +14 -0
- package/vanilla/UiEditorSlashMenuGroup.js +48 -0
- package/vanilla/UiEditorSlashMenuItem.d.ts +18 -0
- package/vanilla/UiEditorSlashMenuItem.js +57 -0
- package/vanilla/UiEditorTableContextMenu.d.ts +5 -2
- package/vanilla/UiEditorTableContextMenu.js +1 -2
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +5 -5
- package/vanilla/UiEditorTableToolbar.d.ts +4 -2
- package/vanilla/UiEditorTableToolbar.js +1 -2
- package/vanilla/UiEditorToolbar.js +2 -0
- package/vanilla/UiGrid.d.ts +1 -0
- package/vanilla/UiGrid.js +8 -7
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -0
- package/vanilla/UiIconButton.js +11 -2
- package/vanilla/UiListbox.d.ts +20 -0
- package/vanilla/UiListbox.js +45 -0
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +1 -1
- package/vanilla/UiMenuGroup.d.ts +14 -0
- package/vanilla/UiMenuGroup.js +35 -0
- package/vanilla/UiMenuItem.d.ts +5 -1
- package/vanilla/UiMenuItem.js +91 -30
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadioGroup.d.ts +1 -0
- package/vanilla/UiRadioGroup.js +6 -3
- package/vanilla/UiSwitcher.d.ts +1 -0
- package/vanilla/UiSwitcher.js +7 -9
- package/vanilla/UiTabs.d.ts +1 -0
- package/vanilla/UiTabs.js +9 -1
- package/vanilla/UiTextarea.d.ts +1 -0
- package/vanilla/UiTextarea.js +4 -1
- package/vanilla/UiToast.d.ts +16 -0
- package/vanilla/UiToast.js +53 -0
- package/vanilla/UiToastRegion.d.ts +1 -4
- package/vanilla/UiToastRegion.js +3 -11
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +1 -1
- package/vanilla/UiTree.d.ts +2 -0
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.d.ts +1 -0
- package/vanilla/UiTreeItem.js +45 -31
- package/vanilla/index.js +6 -0
- package/vue/UiAvatar.d.ts +4 -0
- package/vue/UiAvatar.vue +23 -3
- package/vue/UiAvatarGroup.d.ts +3 -0
- package/vue/UiAvatarGroup.vue +7 -4
- package/vue/UiBadge.d.ts +2 -2
- package/vue/UiBadge.vue +74 -2
- package/vue/UiButton.d.ts +5 -3
- package/vue/UiButton.vue +41 -7
- package/vue/UiCallout.d.ts +2 -2
- package/vue/UiCallout.vue +3 -2
- package/vue/UiCheckbox.d.ts +2 -0
- package/vue/UiCheckbox.vue +16 -0
- package/vue/UiCombobox.d.ts +13 -3
- package/vue/UiCombobox.vue +62 -11
- package/vue/UiContextMenu.d.ts +2 -0
- package/vue/UiContextMenu.vue +47 -6
- package/vue/UiDialog.d.ts +18 -4
- package/vue/UiDialog.vue +86 -11
- package/vue/UiDisclosure.d.ts +8 -2
- package/vue/UiDisclosure.vue +38 -14
- package/vue/UiEditable.d.ts +10 -0
- package/vue/UiEditable.vue +14 -2
- package/vue/UiEditorInsertTableGrid.vue +52 -15
- package/vue/UiEditorMentionMenu.d.ts +24 -2
- package/vue/UiEditorMentionMenu.vue +27 -11
- package/vue/UiEditorMentionMenuItem.d.ts +24 -0
- package/vue/UiEditorMentionMenuItem.js +2 -0
- package/vue/UiEditorMentionMenuItem.vue +88 -0
- package/vue/UiEditorSlashMenu.d.ts +24 -1
- package/vue/UiEditorSlashMenu.vue +33 -33
- package/vue/UiEditorSlashMenuGroup.d.ts +18 -0
- package/vue/UiEditorSlashMenuGroup.js +2 -0
- package/vue/UiEditorSlashMenuGroup.vue +43 -0
- package/vue/UiEditorSlashMenuItem.d.ts +26 -0
- package/vue/UiEditorSlashMenuItem.js +2 -0
- package/vue/UiEditorSlashMenuItem.vue +101 -0
- package/vue/UiEditorTableContextMenu.d.ts +9 -3
- package/vue/UiEditorTableContextMenu.vue +53 -3
- package/vue/UiEditorTableOverlay.d.ts +2 -2
- package/vue/UiEditorTableOverlay.vue +8 -6
- package/vue/UiEditorTableToolbar.d.ts +7 -3
- package/vue/UiEditorTableToolbar.vue +50 -2
- package/vue/UiEditorToolbar.vue +14 -1
- package/vue/UiFloatingActionButton.vue +1 -1
- package/vue/UiFormField.vue +28 -3
- package/vue/UiGrid.d.ts +1 -0
- package/vue/UiGrid.vue +26 -2
- package/vue/UiIcon.vue +16 -0
- package/vue/UiIconButton.d.ts +5 -3
- package/vue/UiIconButton.vue +40 -6
- package/vue/UiInput.vue +10 -3
- package/vue/UiInputGroup.vue +32 -11
- package/vue/UiListbox.d.ts +33 -0
- package/vue/UiListbox.js +2 -0
- package/vue/UiListbox.vue +131 -0
- package/vue/UiMenu.d.ts +2 -0
- package/vue/UiMenu.vue +43 -6
- package/vue/UiMenuGroup.d.ts +18 -0
- package/vue/UiMenuGroup.js +2 -0
- package/vue/UiMenuGroup.vue +39 -0
- package/vue/UiMenuItem.d.ts +34 -2
- package/vue/UiMenuItem.vue +145 -9
- package/vue/UiPopover.d.ts +2 -2
- package/vue/UiPopover.vue +44 -5
- package/vue/UiRadioGroup.d.ts +2 -0
- package/vue/UiRadioGroup.vue +17 -0
- package/vue/UiSearchShell.vue +12 -5
- package/vue/UiSelect.vue +18 -4
- package/vue/UiSwitch.vue +2 -2
- package/vue/UiSwitcher.d.ts +1 -0
- package/vue/UiSwitcher.vue +22 -1
- package/vue/UiTabs.d.ts +6 -2
- package/vue/UiTabs.vue +14 -12
- package/vue/UiTextarea.d.ts +2 -0
- package/vue/UiTextarea.vue +32 -4
- package/vue/UiToast.d.ts +34 -0
- package/vue/UiToast.js +2 -0
- package/vue/UiToast.vue +173 -0
- package/vue/UiToastRegion.d.ts +2 -18
- package/vue/UiToastRegion.vue +123 -48
- package/vue/UiTooltip.d.ts +2 -2
- package/vue/UiTooltip.vue +67 -12
- package/vue/UiTree.d.ts +10 -0
- package/vue/UiTree.vue +27 -0
- package/vue/UiTreeItem.d.ts +2 -0
- package/vue/UiTreeItem.vue +96 -4
- package/vue/chunks/UiAvatar.js +19 -5
- package/vue/chunks/UiAvatarGroup.js +10 -4
- package/vue/chunks/UiBadge.js +1 -1
- package/vue/chunks/UiButton.js +58 -11
- package/vue/chunks/UiCallout.js +2 -2
- package/vue/chunks/UiCheckbox.js +12 -2
- package/vue/chunks/UiCombobox.js +30 -13
- package/vue/chunks/UiContextMenu.js +6 -2
- package/vue/chunks/UiDialog.js +25 -8
- package/vue/chunks/UiDisclosure.js +36 -12
- package/vue/chunks/UiEditable.js +22 -8
- package/vue/chunks/UiEditorInsertTableGrid.js +11 -14
- package/vue/chunks/UiEditorMentionMenu.js +30 -19
- package/vue/chunks/UiEditorMentionMenuItem.js +36 -0
- package/vue/chunks/UiEditorSlashMenu.js +33 -35
- package/vue/chunks/UiEditorSlashMenuGroup.js +26 -0
- package/vue/chunks/UiEditorSlashMenuItem.js +51 -0
- package/vue/chunks/UiEditorTableContextMenu.js +39 -5
- package/vue/chunks/UiEditorTableOverlay.js +6 -6
- package/vue/chunks/UiEditorTableToolbar.js +37 -4
- package/vue/chunks/UiEditorToolbar.js +18 -4
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +13 -9
- package/vue/chunks/UiGrid.js +6 -2
- package/vue/chunks/UiIcon.js +40 -2
- package/vue/chunks/UiIconButton.js +35 -4
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +1 -1
- package/vue/chunks/UiListbox.js +70 -0
- package/vue/chunks/UiMenu.js +6 -2
- package/vue/chunks/UiMenuGroup.js +25 -0
- package/vue/chunks/UiMenuItem.js +128 -7
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadioGroup.js +8 -2
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/chunks/UiSwitch.js +1 -1
- package/vue/chunks/UiSwitcher.js +20 -3
- package/vue/chunks/UiTabs.js +4 -3
- package/vue/chunks/UiTextarea.js +7 -2
- package/vue/chunks/UiToast.js +81 -0
- package/vue/chunks/UiToastRegion.js +25 -49
- package/vue/chunks/UiTooltip.js +3 -7
- package/vue/chunks/UiTree.js +8 -4
- package/vue/chunks/UiTreeItem.js +28 -10
- package/vue/components.css +1840 -851
- package/vue/editor/index.js +263 -2
- package/vue/index.d.ts +6 -0
- package/vue/index.js +9 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
label: string;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
defineOptions({ inheritAttrs: false })
|
|
4
|
+
|
|
5
|
+
withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
label?: string
|
|
8
|
+
}>(),
|
|
9
|
+
{
|
|
10
|
+
label: '',
|
|
11
|
+
},
|
|
12
|
+
)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<li data-component="ui-editor-slash-menu-group" role="presentation" v-bind="$attrs">
|
|
17
|
+
<div role="group" :aria-label="label">
|
|
18
|
+
<div class="heading">{{ label }}</div>
|
|
19
|
+
<ul role="presentation"><slot /></ul>
|
|
20
|
+
</div>
|
|
21
|
+
</li>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
[data-component~="ui-editor-slash-menu-group"] {
|
|
26
|
+
display: block;
|
|
27
|
+
list-style: none;
|
|
28
|
+
}
|
|
29
|
+
.heading {
|
|
30
|
+
padding: var(--ui-space-2) var(--ui-space-3) var(--ui-space-1);
|
|
31
|
+
color: var(--ui-text-muted);
|
|
32
|
+
font-size: var(--ui-font-size-xs);
|
|
33
|
+
font-weight: var(--ui-font-semibold);
|
|
34
|
+
}
|
|
35
|
+
ul {
|
|
36
|
+
margin: 0;
|
|
37
|
+
padding: 0;
|
|
38
|
+
list-style: none;
|
|
39
|
+
}
|
|
40
|
+
[data-component~="ui-editor-slash-menu-group"][hidden] {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
description?: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
icon?: string;
|
|
5
|
+
keywords?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_6: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_6) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
13
|
+
value: string;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
icon: string;
|
|
16
|
+
description: string;
|
|
17
|
+
keywords: string;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
import UiIcon from './UiIcon.vue'
|
|
4
|
+
|
|
5
|
+
defineOptions({ inheritAttrs: false })
|
|
6
|
+
|
|
7
|
+
withDefaults(
|
|
8
|
+
defineProps<{
|
|
9
|
+
description?: string
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
icon?: string
|
|
12
|
+
keywords?: string
|
|
13
|
+
value?: string
|
|
14
|
+
}>(),
|
|
15
|
+
{
|
|
16
|
+
description: '',
|
|
17
|
+
disabled: false,
|
|
18
|
+
icon: '',
|
|
19
|
+
keywords: '',
|
|
20
|
+
value: '',
|
|
21
|
+
},
|
|
22
|
+
)
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<li
|
|
27
|
+
data-component="ui-editor-slash-menu-item"
|
|
28
|
+
role="option"
|
|
29
|
+
tabindex="-1"
|
|
30
|
+
v-bind="$attrs"
|
|
31
|
+
:aria-disabled="disabled"
|
|
32
|
+
:data-value="value"
|
|
33
|
+
:data-keywords="keywords"
|
|
34
|
+
>
|
|
35
|
+
<span v-if="icon" class="icon" aria-hidden="true"><UiIcon :name="icon" /></span>
|
|
36
|
+
<span class="body"><span class="title"><slot /></span>
|
|
37
|
+
<span v-if="description" class="description">{{ description }}</span></span>
|
|
38
|
+
</li>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<style scoped>
|
|
42
|
+
[data-component~="ui-editor-slash-menu-item"] {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: var(--ui-space-3);
|
|
46
|
+
min-block-size: 44px;
|
|
47
|
+
padding: var(--ui-space-2) var(--ui-space-3);
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
list-style: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-component~="ui-editor-slash-menu-item"][aria-selected="true"] {
|
|
53
|
+
background: var(--ui-accent-subtle);
|
|
54
|
+
}
|
|
55
|
+
[data-component~="ui-editor-slash-menu-item"][aria-disabled="true"] {
|
|
56
|
+
opacity: 0.6;
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.icon {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
inline-size: 32px;
|
|
65
|
+
block-size: 32px;
|
|
66
|
+
flex: 0 0 auto;
|
|
67
|
+
color: var(--ui-text-secondary);
|
|
68
|
+
background: var(--ui-surface-hover);
|
|
69
|
+
border: 1px solid var(--ui-border);
|
|
70
|
+
border-radius: var(--ui-radius-md);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.icon {
|
|
74
|
+
--_ui-default-icon-size: 1rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.body {
|
|
78
|
+
display: flex;
|
|
79
|
+
min-inline-size: 0;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: 1px;
|
|
82
|
+
}
|
|
83
|
+
.title, .description {
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
text-overflow: ellipsis;
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
}
|
|
88
|
+
.title {
|
|
89
|
+
color: var(--ui-text-primary);
|
|
90
|
+
font-size: var(--ui-font-size-sm);
|
|
91
|
+
font-weight: var(--ui-font-medium);
|
|
92
|
+
}
|
|
93
|
+
.description {
|
|
94
|
+
color: var(--ui-text-muted);
|
|
95
|
+
font-size: var(--ui-font-size-xs);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-component~="ui-editor-slash-menu-item"][hidden] {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
|
|
2
|
+
actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'toggle-header-row' | 'toggle-header-column' | 'move-row-up' | 'move-row-down' | 'move-column-left' | 'move-column-right' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
|
|
3
3
|
cellBackground?: string;
|
|
4
|
+
headerColumn?: boolean;
|
|
5
|
+
headerRow?: boolean;
|
|
4
6
|
open?: boolean;
|
|
7
|
+
scope?: 'cell' | 'row' | 'column';
|
|
5
8
|
};
|
|
6
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
10
|
action: (detail: {
|
|
8
|
-
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
11
|
+
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
9
12
|
}) => any;
|
|
10
13
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
14
|
onAction?: ((detail: {
|
|
12
|
-
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
15
|
+
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
13
16
|
}) => any) | undefined;
|
|
14
17
|
}>, {
|
|
15
18
|
open: boolean;
|
|
19
|
+
headerRow: boolean;
|
|
16
20
|
cellBackground: string;
|
|
21
|
+
headerColumn: boolean;
|
|
22
|
+
scope: "cell" | "row" | "column";
|
|
17
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
24
|
declare const _default: typeof __VLS_export;
|
|
19
25
|
export default _default;
|
|
@@ -24,6 +24,12 @@ const props = withDefaults(
|
|
|
24
24
|
| 'add-row-after'
|
|
25
25
|
| 'add-column-before'
|
|
26
26
|
| 'add-column-after'
|
|
27
|
+
| 'toggle-header-row'
|
|
28
|
+
| 'toggle-header-column'
|
|
29
|
+
| 'move-row-up'
|
|
30
|
+
| 'move-row-down'
|
|
31
|
+
| 'move-column-left'
|
|
32
|
+
| 'move-column-right'
|
|
27
33
|
| 'clear-cells'
|
|
28
34
|
| 'merge-cells'
|
|
29
35
|
| 'split-cell'
|
|
@@ -32,11 +38,17 @@ const props = withDefaults(
|
|
|
32
38
|
| 'delete-table'
|
|
33
39
|
)[]
|
|
34
40
|
cellBackground?: string
|
|
41
|
+
headerColumn?: boolean
|
|
42
|
+
headerRow?: boolean
|
|
35
43
|
open?: boolean
|
|
44
|
+
scope?: 'cell' | 'row' | 'column'
|
|
36
45
|
}>(),
|
|
37
46
|
{
|
|
38
47
|
cellBackground: '',
|
|
48
|
+
headerColumn: false,
|
|
49
|
+
headerRow: false,
|
|
39
50
|
open: false,
|
|
51
|
+
scope: 'cell',
|
|
40
52
|
},
|
|
41
53
|
)
|
|
42
54
|
const emit = defineEmits<{
|
|
@@ -56,6 +68,12 @@ const emit = defineEmits<{
|
|
|
56
68
|
| 'add-row-after'
|
|
57
69
|
| 'add-column-before'
|
|
58
70
|
| 'add-column-after'
|
|
71
|
+
| 'toggle-header-row'
|
|
72
|
+
| 'toggle-header-column'
|
|
73
|
+
| 'move-row-up'
|
|
74
|
+
| 'move-row-down'
|
|
75
|
+
| 'move-column-left'
|
|
76
|
+
| 'move-column-right'
|
|
59
77
|
| 'clear-cells'
|
|
60
78
|
| 'merge-cells'
|
|
61
79
|
| 'split-cell'
|
|
@@ -71,7 +89,17 @@ const swatches = ref<{ action: string; label: string; color: string; selected: b
|
|
|
71
89
|
[],
|
|
72
90
|
)
|
|
73
91
|
const sections = ref<
|
|
74
|
-
{
|
|
92
|
+
{
|
|
93
|
+
heading: string
|
|
94
|
+
items: {
|
|
95
|
+
action: string
|
|
96
|
+
label: string
|
|
97
|
+
icon: string
|
|
98
|
+
danger: boolean
|
|
99
|
+
checkable: boolean
|
|
100
|
+
checked: boolean
|
|
101
|
+
}[]
|
|
102
|
+
}[]
|
|
75
103
|
>([])
|
|
76
104
|
|
|
77
105
|
const isActionDetail = (detail: unknown): boolean =>
|
|
@@ -89,6 +117,12 @@ const isActionDetail = (detail: unknown): boolean =>
|
|
|
89
117
|
|| (detail as Record<string, unknown>)['action'] === 'add-row-after'
|
|
90
118
|
|| (detail as Record<string, unknown>)['action'] === 'add-column-before'
|
|
91
119
|
|| (detail as Record<string, unknown>)['action'] === 'add-column-after'
|
|
120
|
+
|| (detail as Record<string, unknown>)['action'] === 'toggle-header-row'
|
|
121
|
+
|| (detail as Record<string, unknown>)['action'] === 'toggle-header-column'
|
|
122
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-row-up'
|
|
123
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-row-down'
|
|
124
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-column-left'
|
|
125
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-column-right'
|
|
92
126
|
|| (detail as Record<string, unknown>)['action'] === 'clear-cells'
|
|
93
127
|
|| (detail as Record<string, unknown>)['action'] === 'merge-cells'
|
|
94
128
|
|| (detail as Record<string, unknown>)['action'] === 'split-cell'
|
|
@@ -108,6 +142,19 @@ useComponentHost(controllerModule.default, {
|
|
|
108
142
|
props,
|
|
109
143
|
state: { swatches, sections },
|
|
110
144
|
})
|
|
145
|
+
|
|
146
|
+
function text(value: unknown): string {
|
|
147
|
+
if (Array.isArray(value)) return value.map(text).join(' ')
|
|
148
|
+
return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function attribute(value: unknown): any {
|
|
152
|
+
if (
|
|
153
|
+
value === null || value === undefined || value === false
|
|
154
|
+
|| (typeof value === 'object' && !Array.isArray(value))
|
|
155
|
+
) return undefined
|
|
156
|
+
return value === true ? '' : text(value)
|
|
157
|
+
}
|
|
111
158
|
</script>
|
|
112
159
|
|
|
113
160
|
<template>
|
|
@@ -147,7 +194,10 @@ useComponentHost(controllerModule.default, {
|
|
|
147
194
|
v-for="item in section.items"
|
|
148
195
|
:key="item.action"
|
|
149
196
|
type="button"
|
|
150
|
-
role="menuitem"
|
|
197
|
+
:role="attribute(({ true: 'menuitemcheckbox', false: 'menuitem' })[`${item.checkable}`])"
|
|
198
|
+
:aria-checked="typeof (({ true: item.checked, false: null })[`${item.checkable}`]) === 'boolean'
|
|
199
|
+
? String(({ true: item.checked, false: null })[`${item.checkable}`])
|
|
200
|
+
: attribute(({ true: item.checked, false: null })[`${item.checkable}`])"
|
|
151
201
|
:data-action="item.action"
|
|
152
202
|
:class="{ danger: item.danger }"
|
|
153
203
|
>
|
|
@@ -233,7 +283,7 @@ useComponentHost(controllerModule.default, {
|
|
|
233
283
|
display: inline-flex;
|
|
234
284
|
width: 1rem;
|
|
235
285
|
height: 1rem;
|
|
236
|
-
border-radius:
|
|
286
|
+
border-radius: var(--ui-radius-round);
|
|
237
287
|
border: 1px solid var(--ui-border);
|
|
238
288
|
background: var(--_swatch, #fff);
|
|
239
289
|
box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.35);
|
|
@@ -30,7 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
30
30
|
readonly rowIndex: number;
|
|
31
31
|
readonly columnIndex: number;
|
|
32
32
|
} | {
|
|
33
|
-
readonly action: "open-cell-menu";
|
|
33
|
+
readonly action: "open-cell-menu" | "open-row-menu" | "open-column-menu";
|
|
34
34
|
readonly rowIndex: number;
|
|
35
35
|
readonly columnIndex: number;
|
|
36
36
|
readonly anchor: {
|
|
@@ -49,7 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
49
49
|
readonly rowIndex: number;
|
|
50
50
|
readonly columnIndex: number;
|
|
51
51
|
} | {
|
|
52
|
-
readonly action: "open-cell-menu";
|
|
52
|
+
readonly action: "open-cell-menu" | "open-row-menu" | "open-column-menu";
|
|
53
53
|
readonly rowIndex: number;
|
|
54
54
|
readonly columnIndex: number;
|
|
55
55
|
readonly anchor: {
|
|
@@ -45,7 +45,7 @@ const emit = defineEmits<{
|
|
|
45
45
|
readonly rowIndex: number
|
|
46
46
|
readonly columnIndex: number
|
|
47
47
|
} | {
|
|
48
|
-
readonly action: 'open-cell-menu'
|
|
48
|
+
readonly action: 'open-cell-menu' | 'open-row-menu' | 'open-column-menu'
|
|
49
49
|
readonly rowIndex: number
|
|
50
50
|
readonly columnIndex: number
|
|
51
51
|
readonly anchor: {
|
|
@@ -122,7 +122,9 @@ const isActionDetail = (detail: unknown): boolean =>
|
|
|
122
122
|
['action', 'rowIndex', 'columnIndex'].includes(key)
|
|
123
123
|
))
|
|
124
124
|
|| (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
125
|
-
&& (detail as Record<string, unknown>)['action'] === 'open-cell-menu'
|
|
125
|
+
&& ((detail as Record<string, unknown>)['action'] === 'open-cell-menu'
|
|
126
|
+
|| (detail as Record<string, unknown>)['action'] === 'open-row-menu'
|
|
127
|
+
|| (detail as Record<string, unknown>)['action'] === 'open-column-menu')
|
|
126
128
|
&& Number.isInteger((detail as Record<string, unknown>)['rowIndex'])
|
|
127
129
|
&& Number.isInteger((detail as Record<string, unknown>)['columnIndex'])
|
|
128
130
|
&& ((detail as Record<string, unknown>)['anchor'] !== null
|
|
@@ -229,8 +231,8 @@ useComponentHost(controllerModule.default, {
|
|
|
229
231
|
type="button"
|
|
230
232
|
class="selector row"
|
|
231
233
|
data-action="select-row"
|
|
232
|
-
title="
|
|
233
|
-
aria-label="
|
|
234
|
+
title="Row actions"
|
|
235
|
+
aria-label="Row actions"
|
|
234
236
|
:data-row-index="hovered?.rowIndex"
|
|
235
237
|
:data-column-index="hovered?.columnIndex"
|
|
236
238
|
:style="{ top: hovered?.rowOffset }"
|
|
@@ -241,8 +243,8 @@ useComponentHost(controllerModule.default, {
|
|
|
241
243
|
type="button"
|
|
242
244
|
class="selector column"
|
|
243
245
|
data-action="select-column"
|
|
244
|
-
title="
|
|
245
|
-
aria-label="
|
|
246
|
+
title="Column actions"
|
|
247
|
+
aria-label="Column actions"
|
|
246
248
|
:data-row-index="hovered?.rowIndex"
|
|
247
249
|
:data-column-index="hovered?.columnIndex"
|
|
248
250
|
:style="{ left: hovered?.columnOffset }"
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
|
|
2
|
+
actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'toggle-header-row' | 'toggle-header-column' | 'move-row-up' | 'move-row-down' | 'move-column-left' | 'move-column-right' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
|
|
3
3
|
cellAlignment?: 'left' | 'center' | 'right';
|
|
4
4
|
cellBackground?: string;
|
|
5
|
+
headerColumn?: boolean;
|
|
6
|
+
headerRow?: boolean;
|
|
5
7
|
open?: boolean;
|
|
6
8
|
};
|
|
7
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
10
|
action: (detail: {
|
|
9
|
-
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
11
|
+
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
10
12
|
}) => any;
|
|
11
13
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
14
|
onAction?: ((detail: {
|
|
13
|
-
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
15
|
+
readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
|
|
14
16
|
}) => any) | undefined;
|
|
15
17
|
}>, {
|
|
16
18
|
open: boolean;
|
|
19
|
+
headerRow: boolean;
|
|
17
20
|
cellBackground: string;
|
|
21
|
+
headerColumn: boolean;
|
|
18
22
|
cellAlignment: "left" | "center" | "right";
|
|
19
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -24,6 +24,12 @@ const props = withDefaults(
|
|
|
24
24
|
| 'add-row-after'
|
|
25
25
|
| 'add-column-before'
|
|
26
26
|
| 'add-column-after'
|
|
27
|
+
| 'toggle-header-row'
|
|
28
|
+
| 'toggle-header-column'
|
|
29
|
+
| 'move-row-up'
|
|
30
|
+
| 'move-row-down'
|
|
31
|
+
| 'move-column-left'
|
|
32
|
+
| 'move-column-right'
|
|
27
33
|
| 'clear-cells'
|
|
28
34
|
| 'merge-cells'
|
|
29
35
|
| 'split-cell'
|
|
@@ -33,11 +39,15 @@ const props = withDefaults(
|
|
|
33
39
|
)[]
|
|
34
40
|
cellAlignment?: 'left' | 'center' | 'right'
|
|
35
41
|
cellBackground?: string
|
|
42
|
+
headerColumn?: boolean
|
|
43
|
+
headerRow?: boolean
|
|
36
44
|
open?: boolean
|
|
37
45
|
}>(),
|
|
38
46
|
{
|
|
39
47
|
cellAlignment: 'left',
|
|
40
48
|
cellBackground: '',
|
|
49
|
+
headerColumn: false,
|
|
50
|
+
headerRow: false,
|
|
41
51
|
open: false,
|
|
42
52
|
},
|
|
43
53
|
)
|
|
@@ -58,6 +68,12 @@ const emit = defineEmits<{
|
|
|
58
68
|
| 'add-row-after'
|
|
59
69
|
| 'add-column-before'
|
|
60
70
|
| 'add-column-after'
|
|
71
|
+
| 'toggle-header-row'
|
|
72
|
+
| 'toggle-header-column'
|
|
73
|
+
| 'move-row-up'
|
|
74
|
+
| 'move-row-down'
|
|
75
|
+
| 'move-column-left'
|
|
76
|
+
| 'move-column-right'
|
|
61
77
|
| 'clear-cells'
|
|
62
78
|
| 'merge-cells'
|
|
63
79
|
| 'split-cell'
|
|
@@ -77,7 +93,17 @@ const structure = ref<
|
|
|
77
93
|
>([])
|
|
78
94
|
const swatches = ref<{ action: string; label: string; color: string; selected: boolean }[]>([])
|
|
79
95
|
const sections = ref<
|
|
80
|
-
{
|
|
96
|
+
{
|
|
97
|
+
heading: string
|
|
98
|
+
items: {
|
|
99
|
+
action: string
|
|
100
|
+
label: string
|
|
101
|
+
icon: string
|
|
102
|
+
danger: boolean
|
|
103
|
+
checkable: boolean
|
|
104
|
+
checked: boolean
|
|
105
|
+
}[]
|
|
106
|
+
}[]
|
|
81
107
|
>([])
|
|
82
108
|
const hasOverflow = ref(false)
|
|
83
109
|
const overflowOpen = ref(false)
|
|
@@ -97,6 +123,12 @@ const isActionDetail = (detail: unknown): boolean =>
|
|
|
97
123
|
|| (detail as Record<string, unknown>)['action'] === 'add-row-after'
|
|
98
124
|
|| (detail as Record<string, unknown>)['action'] === 'add-column-before'
|
|
99
125
|
|| (detail as Record<string, unknown>)['action'] === 'add-column-after'
|
|
126
|
+
|| (detail as Record<string, unknown>)['action'] === 'toggle-header-row'
|
|
127
|
+
|| (detail as Record<string, unknown>)['action'] === 'toggle-header-column'
|
|
128
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-row-up'
|
|
129
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-row-down'
|
|
130
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-column-left'
|
|
131
|
+
|| (detail as Record<string, unknown>)['action'] === 'move-column-right'
|
|
100
132
|
|| (detail as Record<string, unknown>)['action'] === 'clear-cells'
|
|
101
133
|
|| (detail as Record<string, unknown>)['action'] === 'merge-cells'
|
|
102
134
|
|| (detail as Record<string, unknown>)['action'] === 'split-cell'
|
|
@@ -116,6 +148,19 @@ useComponentHost(controllerModule.default, {
|
|
|
116
148
|
props,
|
|
117
149
|
state: { alignments, structure, swatches, sections, hasOverflow, overflowOpen },
|
|
118
150
|
})
|
|
151
|
+
|
|
152
|
+
function text(value: unknown): string {
|
|
153
|
+
if (Array.isArray(value)) return value.map(text).join(' ')
|
|
154
|
+
return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function attribute(value: unknown): any {
|
|
158
|
+
if (
|
|
159
|
+
value === null || value === undefined || value === false
|
|
160
|
+
|| (typeof value === 'object' && !Array.isArray(value))
|
|
161
|
+
) return undefined
|
|
162
|
+
return value === true ? '' : text(value)
|
|
163
|
+
}
|
|
119
164
|
</script>
|
|
120
165
|
|
|
121
166
|
<template>
|
|
@@ -201,7 +246,10 @@ useComponentHost(controllerModule.default, {
|
|
|
201
246
|
v-for="item in section.items"
|
|
202
247
|
:key="item.action"
|
|
203
248
|
type="button"
|
|
204
|
-
role="menuitem"
|
|
249
|
+
:role="attribute(({ true: 'menuitemcheckbox', false: 'menuitem' })[`${item.checkable}`])"
|
|
250
|
+
:aria-checked="typeof (({ true: item.checked, false: null })[`${item.checkable}`]) === 'boolean'
|
|
251
|
+
? String(({ true: item.checked, false: null })[`${item.checkable}`])
|
|
252
|
+
: attribute(({ true: item.checked, false: null })[`${item.checkable}`])"
|
|
205
253
|
:data-action="item.action"
|
|
206
254
|
:class="{ danger: item.danger }"
|
|
207
255
|
>
|
package/vue/UiEditorToolbar.vue
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
import { computed, useTemplateRef } from 'vue'
|
|
3
|
+
import { computed, ref, useTemplateRef } from 'vue'
|
|
4
|
+
import * as controllerModule from '../components/ui-editor-toolbar/ui-editor-toolbar.js'
|
|
5
|
+
import { createDispatch, useComponentHost } from './host'
|
|
4
6
|
|
|
5
7
|
defineOptions({ inheritAttrs: false })
|
|
6
8
|
|
|
@@ -13,6 +15,7 @@ const props = withDefaults(
|
|
|
13
15
|
},
|
|
14
16
|
)
|
|
15
17
|
|
|
18
|
+
const root = ref<HTMLElement | null>(null)
|
|
16
19
|
const stripElement = useTemplateRef<HTMLElement>('strip')
|
|
17
20
|
|
|
18
21
|
/** The values the styles' :host-state() rules test. */
|
|
@@ -21,6 +24,15 @@ const hostState = computed(() =>
|
|
|
21
24
|
props.floating && 'floating',
|
|
22
25
|
].filter(Boolean).join(' ')
|
|
23
26
|
)
|
|
27
|
+
|
|
28
|
+
const dispatch = createDispatch(root)
|
|
29
|
+
|
|
30
|
+
useComponentHost(controllerModule.default, {
|
|
31
|
+
root,
|
|
32
|
+
dispatch,
|
|
33
|
+
props,
|
|
34
|
+
refs: { strip: stripElement },
|
|
35
|
+
})
|
|
24
36
|
</script>
|
|
25
37
|
|
|
26
38
|
<template>
|
|
@@ -30,6 +42,7 @@ const hostState = computed(() =>
|
|
|
30
42
|
aria-label="Editor toolbar"
|
|
31
43
|
v-bind="$attrs"
|
|
32
44
|
:data-ui-editor-toolbar-state="hostState || undefined"
|
|
45
|
+
ref="root"
|
|
33
46
|
>
|
|
34
47
|
<div class="strip" ref="strip"><slot /></div>
|
|
35
48
|
</div>
|
package/vue/UiFormField.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
import { ref } from 'vue'
|
|
3
|
+
import { computed, ref } from 'vue'
|
|
4
4
|
import * as controllerModule from '../components/ui-form-field/ui-form-field.js'
|
|
5
5
|
import { createDispatch, useComponentHost } from './host'
|
|
6
6
|
|
|
@@ -21,6 +21,13 @@ const props = withDefaults(
|
|
|
21
21
|
|
|
22
22
|
const root = ref<HTMLElement | null>(null)
|
|
23
23
|
|
|
24
|
+
/** The values the styles' :host-state() rules test. */
|
|
25
|
+
const hostState = computed(() =>
|
|
26
|
+
[
|
|
27
|
+
props.invalid && 'invalid',
|
|
28
|
+
].filter(Boolean).join(' ')
|
|
29
|
+
)
|
|
30
|
+
|
|
24
31
|
const dispatch = createDispatch(root)
|
|
25
32
|
|
|
26
33
|
useComponentHost(controllerModule.default, {
|
|
@@ -31,7 +38,12 @@ useComponentHost(controllerModule.default, {
|
|
|
31
38
|
</script>
|
|
32
39
|
|
|
33
40
|
<template>
|
|
34
|
-
<div
|
|
41
|
+
<div
|
|
42
|
+
data-component="ui-form-field"
|
|
43
|
+
v-bind="$attrs"
|
|
44
|
+
:data-ui-form-field-state="hostState || undefined"
|
|
45
|
+
ref="root"
|
|
46
|
+
>
|
|
35
47
|
<div class="label"><slot name="label" /></div>
|
|
36
48
|
<slot />
|
|
37
49
|
<div class="help"><slot name="help" /></div>
|
|
@@ -41,6 +53,10 @@ useComponentHost(controllerModule.default, {
|
|
|
41
53
|
|
|
42
54
|
<style scoped>
|
|
43
55
|
/* This component's hooks style the element they are set on, and never a nested one. */
|
|
56
|
+
@property --ui-form-field-danger {
|
|
57
|
+
syntax: "*";
|
|
58
|
+
inherits: false;
|
|
59
|
+
}
|
|
44
60
|
@property --ui-form-field-help-min-block-size {
|
|
45
61
|
syntax: "*";
|
|
46
62
|
inherits: false;
|
|
@@ -48,6 +64,7 @@ useComponentHost(controllerModule.default, {
|
|
|
48
64
|
|
|
49
65
|
[data-component~="ui-form-field"] {
|
|
50
66
|
/* Hooks do not inherit, so the parts below read them from the root. */
|
|
67
|
+
--_ui-form-field-danger: var(--ui-form-field-danger);
|
|
51
68
|
--_ui-form-field-help-min-block-size: var(--ui-form-field-help-min-block-size);
|
|
52
69
|
|
|
53
70
|
display: grid;
|
|
@@ -80,10 +97,18 @@ useComponentHost(controllerModule.default, {
|
|
|
80
97
|
min-block-size: var(--_ui-form-field-help-min-block-size, 0);
|
|
81
98
|
}
|
|
82
99
|
|
|
100
|
+
.error {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-component~="ui-form-field"][data-ui-form-field-state~="invalid"] .error {
|
|
105
|
+
display: contents;
|
|
106
|
+
}
|
|
107
|
+
|
|
83
108
|
/* An error reads in the danger colour, the one the invalid control's border takes. */
|
|
84
109
|
.error,
|
|
85
110
|
:slotted([role="alert"]) {
|
|
86
|
-
color: var(--ui-danger);
|
|
111
|
+
color: var(--_ui-form-field-danger, var(--ui-field-danger, var(--ui-danger)));
|
|
87
112
|
font-size: var(--ui-font-size-sm);
|
|
88
113
|
}
|
|
89
114
|
|