@threadlabs/looma 0.14.8 → 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 +46 -10
- package/components/ui-combobox/ui-combobox.js +5 -5
- 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 +3 -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 +11 -3
- package/vue/UiCombobox.vue +60 -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 +29 -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,20 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiListboxEventMap {
|
|
3
|
+
}
|
|
4
|
+
export interface UiListboxElement extends HTMLSelectElement {
|
|
5
|
+
addEventListener<K extends keyof UiListboxEventMap>(type: K, listener: (this: UiListboxElement, event: UiListboxEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
removeEventListener<K extends keyof UiListboxEventMap>(type: K, listener: (this: UiListboxElement, event: UiListboxEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UiListboxProps {
|
|
9
|
+
disabled?: boolean | null;
|
|
10
|
+
invalid?: boolean | null;
|
|
11
|
+
multiple?: boolean | null;
|
|
12
|
+
required?: boolean | null;
|
|
13
|
+
rows?: number | null;
|
|
14
|
+
value?: string | null;
|
|
15
|
+
values?: readonly (string)[] | null;
|
|
16
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
17
|
+
children?: readonly (string | Node)[];
|
|
18
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
19
|
+
}
|
|
20
|
+
export declare function createUiListbox(props?: UiListboxProps): UiListboxElement;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import * as controller from "../components/ui-listbox/ui-listbox.js";
|
|
4
|
+
import "../styles/ui-listbox.css";
|
|
5
|
+
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-listbox","props":{"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"multiple":{"type":"boolean","required":false,"target":{"attribute":"multiple"},"default":false},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"rows":{"type":"number","required":false,"target":{"attribute":"size"},"default":5},"value":{"type":"string","required":false,"target":{"attribute":"value"}},"values":{"type":{"kind":"list","item":{"kind":"terminal","name":"string"}},"required":false,"target":{"attribute":"values"}}}},"template":{"kind":"element","name":"select","attributes":[{"kind":"attribute","name":"size","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]}},{"kind":"attribute","name":"multiple","expression":"multiple","expressionPlan":{"source":"multiple","ast":{"kind":"id","name":"multiple"},"dependencies":["multiple"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}}],"children":[{"kind":"slot"}]},"declarations":[],"root":{"kind":"native","element":"select","choices":["select"]}},source:{file:import.meta.url},css:""};
|
|
7
|
+
|
|
8
|
+
export function createUiListbox(options = {}) {
|
|
9
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
10
|
+
const projected = [];
|
|
11
|
+
const element = document.createElement("select");
|
|
12
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
13
|
+
if (value === null || value === undefined || value === false) continue;
|
|
14
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
15
|
+
}
|
|
16
|
+
const value0 = componentProps["rows"] === undefined ? 5 : componentProps["rows"];
|
|
17
|
+
if (value0 === null || value0 === undefined) element.removeAttribute("size");
|
|
18
|
+
else element.setAttribute("size", String(value0));
|
|
19
|
+
const value1 = componentProps["multiple"] === undefined ? false : componentProps["multiple"];
|
|
20
|
+
if (value1 === true) element.setAttribute("multiple", "");
|
|
21
|
+
else element.removeAttribute("multiple");
|
|
22
|
+
const value2 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
|
|
23
|
+
if (value2 === true) element.setAttribute("disabled", "");
|
|
24
|
+
else element.removeAttribute("disabled");
|
|
25
|
+
const value3 = componentProps["required"] === undefined ? false : componentProps["required"];
|
|
26
|
+
if (value3 === true) element.setAttribute("required", "");
|
|
27
|
+
else element.removeAttribute("required");
|
|
28
|
+
const value4 = componentProps["invalid"] === undefined ? false : componentProps["invalid"];
|
|
29
|
+
if (typeof value4 === "boolean") element.setAttribute("aria-invalid", String(value4));
|
|
30
|
+
else element.removeAttribute("aria-invalid");
|
|
31
|
+
element.setAttribute("data-component", "ui-listbox");
|
|
32
|
+
if (children.length > 0) {
|
|
33
|
+
for (const child of children) {
|
|
34
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
35
|
+
projected.push([node, ""]);
|
|
36
|
+
element.append(node);
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
}
|
|
40
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
41
|
+
controller,
|
|
42
|
+
});
|
|
43
|
+
return element;
|
|
44
|
+
}
|
|
45
|
+
|
package/vanilla/UiMenu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
2
|
export interface UiMenuEventMap {
|
|
3
|
-
select: CustomEvent<{ readonly value: string; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
3
|
+
select: CustomEvent<{ readonly value: string; readonly checked?: boolean; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
4
4
|
open: CustomEvent<{ readonly open: boolean; readonly reason: "action" | "programmatic"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
5
5
|
close: CustomEvent<{ readonly open: boolean; readonly reason: "action" | "programmatic" | "light-dismiss" | "escape"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
6
6
|
}
|
package/vanilla/UiMenu.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-menu/ui-menu.js";
|
|
4
4
|
import "../styles/ui-menu.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-menu","props":{"density":{"type":{"enum":["comfortable","compact"]},"required":false,"target":{"attribute":"density"},"default":"comfortable"},"for":{"type":"string","required":false,"target":{"attribute":"for"},"default":""},"open":{"type":"boolean","required":false,"target":{"attribute":"open"},"default":false},"placement":{"type":"string","required":false,"target":{"attribute":"placement"},"default":"bottom-start"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"menu"},{"kind":"literal","name":"aria-orientation","value":"vertical"}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"surface"}],"children":[{"kind":"slot"}]}]},"declarations":[{"kind":"state","name":"internalOpen","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"select","type":"object({ value: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"open","type":"object({ open: boolean, reason: action | programmatic, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"close","type":"object({ open: boolean, reason: action | programmatic | light-dismiss | escape, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-menu","props":{"density":{"type":{"enum":["comfortable","compact"]},"required":false,"target":{"attribute":"density"},"default":"comfortable"},"for":{"type":"string","required":false,"target":{"attribute":"for"},"default":""},"open":{"type":"boolean","required":false,"target":{"attribute":"open"},"default":false},"placement":{"type":"string","required":false,"target":{"attribute":"placement"},"default":"bottom-start"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"menu"},{"kind":"literal","name":"aria-orientation","value":"vertical"}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"surface"}],"children":[{"kind":"slot"}]}]},"declarations":[{"kind":"state","name":"internalOpen","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"select","type":"object({ value: string, checked?: boolean, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"open","type":"object({ open: boolean, reason: action | programmatic, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"close","type":"object({ open: boolean, reason: action | programmatic | light-dismiss | escape, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiMenu(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiMenuGroupEventMap {
|
|
3
|
+
}
|
|
4
|
+
export interface UiMenuGroupElement extends HTMLDivElement {
|
|
5
|
+
addEventListener<K extends keyof UiMenuGroupEventMap>(type: K, listener: (this: UiMenuGroupElement, event: UiMenuGroupEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
removeEventListener<K extends keyof UiMenuGroupEventMap>(type: K, listener: (this: UiMenuGroupElement, event: UiMenuGroupEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UiMenuGroupProps {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
11
|
+
children?: readonly (string | Node)[];
|
|
12
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createUiMenuGroup(props?: UiMenuGroupProps): UiMenuGroupElement;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import "../styles/ui-menu-group.css";
|
|
4
|
+
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-menu-group","props":{"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"heading"},{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[],"flow":{"kind":"if","test":"label","testPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}},{"kind":"slot"}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
|
|
7
|
+
export function createUiMenuGroup(options = {}) {
|
|
8
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
9
|
+
const projected = [];
|
|
10
|
+
const element = document.createElement("div");
|
|
11
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
12
|
+
if (value === null || value === undefined || value === false) continue;
|
|
13
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
14
|
+
}
|
|
15
|
+
if (!element.hasAttribute("role")) element.setAttribute("role", "group");
|
|
16
|
+
const value0 = componentProps["label"] === undefined ? "" : componentProps["label"];
|
|
17
|
+
if (value0 === null || value0 === undefined) element.removeAttribute("aria-label");
|
|
18
|
+
else element.setAttribute("aria-label", String(value0));
|
|
19
|
+
element.setAttribute("data-component", "ui-menu-group");
|
|
20
|
+
const element0 = document.createElement("div");
|
|
21
|
+
element0.setAttribute("class", "heading");
|
|
22
|
+
element.append(element0);
|
|
23
|
+
if (children.length > 0) {
|
|
24
|
+
for (const child of children) {
|
|
25
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
26
|
+
projected.push([node, ""]);
|
|
27
|
+
element.append(node);
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
}
|
|
31
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
32
|
+
});
|
|
33
|
+
return element;
|
|
34
|
+
}
|
|
35
|
+
|
package/vanilla/UiMenuItem.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
2
|
export interface UiMenuItemEventMap {
|
|
3
|
+
change: CustomEvent<{ readonly checked: boolean; readonly value: string; readonly type: "checkbox" | "radio"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
3
4
|
}
|
|
4
|
-
export interface UiMenuItemElement extends
|
|
5
|
+
export interface UiMenuItemElement extends HTMLElement {
|
|
5
6
|
addEventListener<K extends keyof UiMenuItemEventMap>(type: K, listener: (this: UiMenuItemElement, event: UiMenuItemEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
7
|
removeEventListener<K extends keyof UiMenuItemEventMap>(type: K, listener: (this: UiMenuItemElement, event: UiMenuItemEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
8
|
}
|
|
8
9
|
export interface UiMenuItemProps {
|
|
10
|
+
checked?: boolean | null;
|
|
9
11
|
disabled?: boolean | null;
|
|
12
|
+
href?: string | null;
|
|
13
|
+
type?: "action" | "checkbox" | "radio" | null;
|
|
10
14
|
value?: string | null;
|
|
11
15
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
12
16
|
children?: readonly (string | Node)[];
|
package/vanilla/UiMenuItem.js
CHANGED
|
@@ -1,42 +1,103 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
-
import {
|
|
2
|
+
import { componentRootIndex, manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import * as controller from "../components/ui-menu-item/ui-menu-item.js";
|
|
3
4
|
import "../styles/ui-menu-item.css";
|
|
4
5
|
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-menu-item","props":{"checked":{"type":"boolean","required":false,"target":{"attribute":"checked"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"aria-disabled"},"default":false},"href":{"type":"string","required":false,"target":{"attribute":"href"},"default":""},"type":{"type":{"enum":["action","checkbox","radio"]},"required":false,"target":{"attribute":"type"},"default":"action"},"value":{"type":"string","required":false,"target":{"attribute":"data-value"},"default":""}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"a","attributes":[{"kind":"literal","name":"role","value":"menuitem"},{"kind":"literal","name":"tabindex","value":"-1"},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}},{"kind":"attribute","name":"href","expression":"{ true: null, false: href }[format('%s', disabled)]","expressionPlan":{"source":"{ true: null, false: href }[format('%s', disabled)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":null}},{"key":"false","value":{"kind":"id","name":"href"}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"id","name":"disabled"}]}},"dependencies":["disabled","href"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"shortcut"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"slot","fallback":[],"name":"shortcut"}]}],"flow":{"kind":"when","test":"href and type = 'action'","testPlan":{"source":"href and type = 'action'","ast":{"kind":"binary","op":"and","left":{"kind":"id","name":"href"},"right":{"kind":"binary","op":"=","left":{"kind":"id","name":"type"},"right":{"kind":"literal","value":"action"}}},"dependencies":["href","type"]}}},{"kind":"element","name":"div","attributes":[{"kind":"attribute","name":"role","expression":"{ action: 'menuitem', checkbox: 'menuitemcheckbox', radio: 'menuitemradio' }[type]","expressionPlan":{"source":"{ action: 'menuitem', checkbox: 'menuitemcheckbox', radio: 'menuitemradio' }[type]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"action","value":{"kind":"literal","value":"menuitem"}},{"key":"checkbox","value":{"kind":"literal","value":"menuitemcheckbox"}},{"key":"radio","value":{"kind":"literal","value":"menuitemradio"}}]},"index":{"kind":"id","name":"type"}},"dependencies":["type"]}},{"kind":"attribute","name":"aria-checked","expression":"{ action: null, checkbox: internalChecked, radio: internalChecked }[type]","expressionPlan":{"source":"{ action: null, checkbox: internalChecked, radio: internalChecked }[type]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"action","value":{"kind":"literal","value":null}},{"key":"checkbox","value":{"kind":"id","name":"internalChecked"}},{"key":"radio","value":{"kind":"id","name":"internalChecked"}}]},"index":{"kind":"id","name":"type"}},"dependencies":["internalChecked","type"]}},{"kind":"literal","name":"tabindex","value":"-1"},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"check"}],"children":[],"flow":{"kind":"if","test":"type = 'checkbox' and internalChecked","testPlan":{"source":"type = 'checkbox' and internalChecked","ast":{"kind":"binary","op":"and","left":{"kind":"binary","op":"=","left":{"kind":"id","name":"type"},"right":{"kind":"literal","value":"checkbox"}},"right":{"kind":"id","name":"internalChecked"}},"dependencies":["internalChecked","type"]}}},{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"circle-dot"}],"children":[],"flow":{"kind":"if","test":"type = 'radio' and internalChecked","testPlan":{"source":"type = 'radio' and internalChecked","ast":{"kind":"binary","op":"and","left":{"kind":"binary","op":"=","left":{"kind":"id","name":"type"},"right":{"kind":"literal","value":"radio"}},"right":{"kind":"id","name":"internalChecked"}},"dependencies":["internalChecked","type"]}}}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"shortcut"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"slot","fallback":[],"name":"shortcut"}]}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[{"kind":"state","name":"internalChecked","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"change","type":"object({ checked: boolean, value: string, type: checkbox | radio, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["a","div"]}},source:{file:import.meta.url},css:""};
|
|
7
|
+
|
|
5
8
|
export function createUiMenuItem(options = {}) {
|
|
6
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
7
10
|
const projected = [];
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
const root = componentRootIndex(definition, componentProps);
|
|
12
|
+
let element;
|
|
13
|
+
if (root === 0) {
|
|
14
|
+
element = document.createElement("a");
|
|
15
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
16
|
+
if (value === null || value === undefined || value === false) continue;
|
|
17
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
18
|
+
}
|
|
19
|
+
if (!element.hasAttribute("role")) element.setAttribute("role", "menuitem");
|
|
20
|
+
if (!element.hasAttribute("tabindex")) element.setAttribute("tabindex", "-1");
|
|
21
|
+
const value0 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
|
|
22
|
+
if (typeof value0 === "boolean") element.setAttribute("aria-disabled", String(value0));
|
|
23
|
+
else element.removeAttribute("aria-disabled");
|
|
24
|
+
const value1 = componentProps["value"] === undefined ? "" : componentProps["value"];
|
|
25
|
+
if (value1 === null || value1 === undefined) element.removeAttribute("data-value");
|
|
26
|
+
else element.setAttribute("data-value", String(value1));
|
|
27
|
+
element.setAttribute("data-component", "ui-menu-item");
|
|
28
|
+
const element0 = document.createElement("span");
|
|
29
|
+
element0.setAttribute("class", "label");
|
|
30
|
+
if (children.length > 0) {
|
|
31
|
+
for (const child of children) {
|
|
32
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
33
|
+
projected.push([node, ""]);
|
|
34
|
+
element0.append(node);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
}
|
|
38
|
+
element.append(element0);
|
|
39
|
+
const element1 = document.createElement("span");
|
|
40
|
+
element1.setAttribute("class", "shortcut");
|
|
41
|
+
element1.setAttribute("aria-hidden", "true");
|
|
42
|
+
if (slots["shortcut"] ?? [].length > 0) {
|
|
43
|
+
for (const child of slots["shortcut"] ?? []) {
|
|
44
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
45
|
+
projected.push([node, "shortcut"]);
|
|
46
|
+
element1.append(node);
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
29
49
|
}
|
|
50
|
+
element.append(element1);
|
|
30
51
|
} else {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
52
|
+
element = document.createElement("div");
|
|
53
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
54
|
+
if (value === null || value === undefined || value === false) continue;
|
|
55
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
56
|
+
}
|
|
57
|
+
if (!element.hasAttribute("tabindex")) element.setAttribute("tabindex", "-1");
|
|
58
|
+
const value2 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
|
|
59
|
+
if (typeof value2 === "boolean") element.setAttribute("aria-disabled", String(value2));
|
|
60
|
+
else element.removeAttribute("aria-disabled");
|
|
61
|
+
const value3 = componentProps["value"] === undefined ? "" : componentProps["value"];
|
|
62
|
+
if (value3 === null || value3 === undefined) element.removeAttribute("data-value");
|
|
63
|
+
else element.setAttribute("data-value", String(value3));
|
|
64
|
+
element.setAttribute("data-component", "ui-menu-item");
|
|
65
|
+
const element2 = document.createElement("span");
|
|
66
|
+
element2.setAttribute("class", "indicator");
|
|
67
|
+
element2.setAttribute("aria-hidden", "true");
|
|
68
|
+
const element3 = document.createElement("ui-icon");
|
|
69
|
+
element3.setAttribute("name", "check");
|
|
70
|
+
element2.append(element3);
|
|
71
|
+
const element4 = document.createElement("ui-icon");
|
|
72
|
+
element4.setAttribute("name", "circle-dot");
|
|
73
|
+
element2.append(element4);
|
|
74
|
+
element.append(element2);
|
|
75
|
+
const element5 = document.createElement("span");
|
|
76
|
+
element5.setAttribute("class", "label");
|
|
77
|
+
if (children.length > 0) {
|
|
78
|
+
for (const child of children) {
|
|
79
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
80
|
+
projected.push([node, ""]);
|
|
81
|
+
element5.append(node);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
39
84
|
}
|
|
85
|
+
element.append(element5);
|
|
86
|
+
const element6 = document.createElement("span");
|
|
87
|
+
element6.setAttribute("class", "shortcut");
|
|
88
|
+
element6.setAttribute("aria-hidden", "true");
|
|
89
|
+
if (slots["shortcut"] ?? [].length > 0) {
|
|
90
|
+
for (const child of slots["shortcut"] ?? []) {
|
|
91
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
92
|
+
projected.push([node, "shortcut"]);
|
|
93
|
+
element6.append(node);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
}
|
|
97
|
+
element.append(element6);
|
|
98
|
+
}
|
|
99
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
100
|
+
controller,
|
|
40
101
|
});
|
|
41
102
|
return element;
|
|
42
103
|
}
|
package/vanilla/UiPopover.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface UiPopoverElement extends HTMLSpanElement {
|
|
|
10
10
|
export interface UiPopoverProps {
|
|
11
11
|
for?: string | null;
|
|
12
12
|
open?: boolean | null;
|
|
13
|
-
placement?:
|
|
13
|
+
placement?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end" | null;
|
|
14
14
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
15
15
|
children?: readonly (string | Node)[];
|
|
16
16
|
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
package/vanilla/UiPopover.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-popover/ui-popover.js";
|
|
4
4
|
import "../styles/ui-popover.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-popover","props":{"for":{"type":"string","required":false,"target":{"attribute":"for"},"default":""},"open":{"type":"boolean","required":false,"target":{"attribute":"open"},"default":false},"placement":{"type":"
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-popover","props":{"for":{"type":"string","required":false,"target":{"attribute":"for"},"default":""},"open":{"type":"boolean","required":false,"target":{"attribute":"open"},"default":false},"placement":{"type":{"enum":["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]},"required":false,"target":{"attribute":"placement"},"default":"bottom-start"}}},"template":{"kind":"element","name":"span","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"surface"}],"children":[{"kind":"slot"}]}]},"declarations":[{"kind":"state","name":"internalOpen","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"open","type":"object({ open: boolean, reason: action | programmatic | light-dismiss | escape, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"close","type":"object({ open: boolean, reason: action | programmatic | light-dismiss | escape, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"span","choices":["span"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiPopover(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -9,6 +9,7 @@ export interface UiRadioGroupElement extends HTMLFieldSetElement {
|
|
|
9
9
|
}
|
|
10
10
|
export interface UiRadioGroupProps {
|
|
11
11
|
disabled?: boolean | null;
|
|
12
|
+
invalid?: boolean | null;
|
|
12
13
|
label?: string | null;
|
|
13
14
|
name?: string | null;
|
|
14
15
|
orientation?: "horizontal" | "vertical" | null;
|
package/vanilla/UiRadioGroup.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-radio-group/ui-radio-group.js";
|
|
4
4
|
import "../styles/ui-radio-group.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-radio-group","props":{"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"label":{"type":"string","required":false,"target":{"attribute":"label"},"default":"Options"},"name":{"type":"string","required":false,"target":{"attribute":"name"},"default":""},"orientation":{"type":{"enum":["horizontal","vertical"]},"required":false,"target":{"attribute":"orientation"},"default":"horizontal"},"required":{"type":"boolean","required":false,"target":{"attribute":"aria-required"},"default":false},"value":{"type":"string","required":false,"target":{"attribute":"value"},"default":""}}},"template":{"kind":"element","name":"fieldset","attributes":[{"kind":"literal","name":"role","value":"radiogroup"},{"kind":"attribute","name":"aria-required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}}],"children":[{"kind":"element","name":"legend","attributes":[],"children":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}]},{"kind":"slot"}]},"declarations":[{"kind":"state","name":"internalValue","expression":{"source":"''","ast":{"kind":"literal","value":""},"dependencies":[]}},{"kind":"event","name":"select","type":"object({ value: string, previousValue: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"change","type":"object({ checked: boolean, value: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"fieldset","choices":["fieldset"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-radio-group","props":{"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"label":{"type":"string","required":false,"target":{"attribute":"label"},"default":"Options"},"name":{"type":"string","required":false,"target":{"attribute":"name"},"default":""},"orientation":{"type":{"enum":["horizontal","vertical"]},"required":false,"target":{"attribute":"orientation"},"default":"horizontal"},"required":{"type":"boolean","required":false,"target":{"attribute":"aria-required"},"default":false},"value":{"type":"string","required":false,"target":{"attribute":"value"},"default":""}}},"template":{"kind":"element","name":"fieldset","attributes":[{"kind":"literal","name":"role","value":"radiogroup"},{"kind":"attribute","name":"aria-required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}}],"children":[{"kind":"element","name":"legend","attributes":[],"children":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}]},{"kind":"slot"}]},"declarations":[{"kind":"state","name":"internalValue","expression":{"source":"''","ast":{"kind":"literal","value":""},"dependencies":[]}},{"kind":"event","name":"select","type":"object({ value: string, previousValue: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"change","type":"object({ checked: boolean, value: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"fieldset","choices":["fieldset"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiRadioGroup(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -17,8 +17,11 @@ export function createUiRadioGroup(options = {}) {
|
|
|
17
17
|
const value0 = componentProps["required"] === undefined ? false : componentProps["required"];
|
|
18
18
|
if (typeof value0 === "boolean") element.setAttribute("aria-required", String(value0));
|
|
19
19
|
else element.removeAttribute("aria-required");
|
|
20
|
-
const value1 = componentProps["
|
|
21
|
-
if (value1 ===
|
|
20
|
+
const value1 = componentProps["invalid"] === undefined ? false : componentProps["invalid"];
|
|
21
|
+
if (typeof value1 === "boolean") element.setAttribute("aria-invalid", String(value1));
|
|
22
|
+
else element.removeAttribute("aria-invalid");
|
|
23
|
+
const value2 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
|
|
24
|
+
if (value2 === true) element.setAttribute("disabled", "");
|
|
22
25
|
else element.removeAttribute("disabled");
|
|
23
26
|
element.setAttribute("data-component", "ui-radio-group");
|
|
24
27
|
const element0 = document.createElement("legend");
|
package/vanilla/UiSwitcher.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface UiSwitcherElement extends HTMLDivElement {
|
|
|
8
8
|
export interface UiSwitcherProps {
|
|
9
9
|
align?: "start" | "center" | "end" | "stretch" | null;
|
|
10
10
|
gap?: "xs" | "s" | "m" | "l" | "xl" | null;
|
|
11
|
+
limit?: number | null;
|
|
11
12
|
threshold?: "xs" | "sm" | "md" | "lg" | null;
|
|
12
13
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
13
14
|
children?: readonly (string | Node)[];
|
package/vanilla/UiSwitcher.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
-
import {
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import * as controller from "../components/ui-switcher/ui-switcher.js";
|
|
3
4
|
import "../styles/ui-switcher.css";
|
|
4
5
|
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-switcher","props":{"align":{"type":{"enum":["start","center","end","stretch"]},"required":false,"target":{"attribute":"align"}},"gap":{"type":{"enum":["xs","s","m","l","xl"]},"required":false,"target":{"attribute":"gap"}},"limit":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"limit"}},"threshold":{"type":{"enum":["xs","sm","md","lg"]},"required":false,"target":{"attribute":"threshold"}}}},"template":{"kind":"element","name":"div","attributes":[],"children":[{"kind":"slot"}]},"declarations":[{"kind":"state","name":"overLimit","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
|
+
|
|
5
8
|
export function createUiSwitcher(options = {}) {
|
|
6
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
7
10
|
const projected = [];
|
|
8
|
-
const prop0 = componentProps["align"] === undefined ? undefined : componentProps["align"];
|
|
9
|
-
const prop1 = componentProps["gap"] === undefined ? undefined : componentProps["gap"];
|
|
10
|
-
const prop2 = componentProps["threshold"] === undefined ? undefined : componentProps["threshold"];
|
|
11
11
|
const element = document.createElement("div");
|
|
12
12
|
for (const [name, value] of Object.entries(attributes)) {
|
|
13
13
|
if (value === null || value === undefined || value === false) continue;
|
|
@@ -22,11 +22,9 @@ export function createUiSwitcher(options = {}) {
|
|
|
22
22
|
}
|
|
23
23
|
} else {
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{ name: "threshold", attribute: "data-threshold", value: componentProps["threshold"], type: ["xs","sm","md","lg"], required: false },
|
|
29
|
-
]);
|
|
25
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
26
|
+
controller,
|
|
27
|
+
});
|
|
30
28
|
return element;
|
|
31
29
|
}
|
|
32
30
|
|
package/vanilla/UiTabs.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface UiTabsElement extends HTMLDivElement {
|
|
|
7
7
|
removeEventListener<K extends keyof UiTabsEventMap>(type: K, listener: (this: UiTabsElement, event: UiTabsEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
8
8
|
}
|
|
9
9
|
export interface UiTabsProps {
|
|
10
|
+
activation?: "auto" | "manual" | null;
|
|
10
11
|
density?: "comfortable" | "compact" | null;
|
|
11
12
|
label?: string | null;
|
|
12
13
|
orientation?: "horizontal" | "vertical" | null;
|
package/vanilla/UiTabs.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-tabs/ui-tabs.js";
|
|
4
4
|
import "../styles/ui-tabs.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-tabs","props":{"density":{"type":{"enum":["comfortable","compact"]},"required":false,"target":{"attribute":"density"},"default":"comfortable"},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":"Tabs"},"orientation":{"type":{"enum":["horizontal","vertical"]},"required":false,"target":{"attribute":"aria-orientation"},"default":"horizontal"},"stretch":{"type":"boolean","required":false,"target":{"attribute":"stretch"},"default":false},"value":{"type":"string","required":false,"target":{"attribute":"value"},"default":""}}},"template":{"kind":"element","name":"div","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"list"},{"kind":"literal","name":"role","value":"tablist"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-orientation","expression":"orientation","expressionPlan":{"source":"orientation","ast":{"kind":"id","name":"orientation"},"dependencies":["orientation"]}}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"role","value":"tab"},{"kind":"attribute","name":"id","expression":"format('%s-tab', tab.id)","expressionPlan":{"source":"format('%s-tab', tab.id)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s-tab"},{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"}]},"dependencies":["tab.id"]}},{"kind":"attribute","name":"value","expression":"tab.id","expressionPlan":{"source":"tab.id","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"dependencies":["tab.id"]}},{"kind":"attribute","name":"aria-controls","expression":"tab.id","expressionPlan":{"source":"tab.id","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"dependencies":["tab.id"]}},{"kind":"attribute","name":"aria-selected","expression":"tab.id = internalValue","expressionPlan":{"source":"tab.id = internalValue","ast":{"kind":"binary","op":"=","left":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"right":{"kind":"id","name":"internalValue"}},"dependencies":["internalValue","tab.id"]}},{"kind":"directive","name":"value","expression":"tab.label","expressionPlan":{"source":"tab.label","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"label"},"dependencies":["tab.label"]}}],"children":[],"flow":{"kind":"each","item":"tab","list":"tabs","listPlan":{"source":"tabs","ast":{"kind":"id","name":"tabs"},"dependencies":["tabs"]},"key":"tab.id","keyPlan":{"source":"tab.id","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"dependencies":["tab.id"]}}}],"ref":"list"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"panels"}],"children":[{"kind":"slot"}],"ref":"panels"}]},"declarations":[{"kind":"state","name":"internalValue","expression":{"source":"''","ast":{"kind":"literal","value":""},"dependencies":[]}},{"kind":"state","name":"tabs","type":"list(object({ id: string, label: string }))","expression":{"source":"[]","ast":{"kind":"array","items":[]},"dependencies":[]}},{"kind":"event","name":"select","type":"object({ value: string, previousValue: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-tabs","props":{"activation":{"type":{"enum":["auto","manual"]},"required":false,"target":{"attribute":"activation"},"default":"auto"},"density":{"type":{"enum":["comfortable","compact"]},"required":false,"target":{"attribute":"density"},"default":"comfortable"},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":"Tabs"},"orientation":{"type":{"enum":["horizontal","vertical"]},"required":false,"target":{"attribute":"aria-orientation"},"default":"horizontal"},"stretch":{"type":"boolean","required":false,"target":{"attribute":"stretch"},"default":false},"value":{"type":"string","required":false,"target":{"attribute":"value"},"default":""}}},"template":{"kind":"element","name":"div","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"list"},{"kind":"literal","name":"role","value":"tablist"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-orientation","expression":"orientation","expressionPlan":{"source":"orientation","ast":{"kind":"id","name":"orientation"},"dependencies":["orientation"]}}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"role","value":"tab"},{"kind":"attribute","name":"id","expression":"format('%s-tab', tab.id)","expressionPlan":{"source":"format('%s-tab', tab.id)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s-tab"},{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"}]},"dependencies":["tab.id"]}},{"kind":"attribute","name":"value","expression":"tab.id","expressionPlan":{"source":"tab.id","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"dependencies":["tab.id"]}},{"kind":"attribute","name":"aria-controls","expression":"tab.id","expressionPlan":{"source":"tab.id","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"dependencies":["tab.id"]}},{"kind":"attribute","name":"aria-selected","expression":"tab.id = internalValue","expressionPlan":{"source":"tab.id = internalValue","ast":{"kind":"binary","op":"=","left":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"right":{"kind":"id","name":"internalValue"}},"dependencies":["internalValue","tab.id"]}},{"kind":"directive","name":"value","expression":"tab.label","expressionPlan":{"source":"tab.label","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"label"},"dependencies":["tab.label"]}}],"children":[],"flow":{"kind":"each","item":"tab","list":"tabs","listPlan":{"source":"tabs","ast":{"kind":"id","name":"tabs"},"dependencies":["tabs"]},"key":"tab.id","keyPlan":{"source":"tab.id","ast":{"kind":"member","object":{"kind":"id","name":"tab"},"key":"id"},"dependencies":["tab.id"]}}}],"name":"tab"}],"ref":"list"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"panels"}],"children":[{"kind":"slot"}],"ref":"panels"}]},"declarations":[{"kind":"state","name":"internalValue","expression":{"source":"''","ast":{"kind":"literal","value":""},"dependencies":[]}},{"kind":"state","name":"tabs","type":"list(object({ id: string, label: string }))","expression":{"source":"[]","ast":{"kind":"array","items":[]},"dependencies":[]}},{"kind":"event","name":"select","type":"object({ value: string, previousValue: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTabs(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -23,10 +23,18 @@ export function createUiTabs(options = {}) {
|
|
|
23
23
|
const value1 = componentProps["orientation"] === undefined ? "horizontal" : componentProps["orientation"];
|
|
24
24
|
if (value1 === null || value1 === undefined) element0.removeAttribute("aria-orientation");
|
|
25
25
|
else element0.setAttribute("aria-orientation", String(value1));
|
|
26
|
+
if (slots["tab"] ?? [].length > 0) {
|
|
27
|
+
for (const child of slots["tab"] ?? []) {
|
|
28
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
29
|
+
projected.push([node, "tab"]);
|
|
30
|
+
element0.append(node);
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
26
33
|
const element1 = document.createElement("button");
|
|
27
34
|
element1.setAttribute("type", "button");
|
|
28
35
|
element1.setAttribute("role", "tab");
|
|
29
36
|
element0.append(element1);
|
|
37
|
+
}
|
|
30
38
|
element.append(element0);
|
|
31
39
|
const element2 = document.createElement("div");
|
|
32
40
|
element2.setAttribute("class", "panels");
|
package/vanilla/UiTextarea.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface UiTextareaElement extends HTMLTextAreaElement {
|
|
|
6
6
|
removeEventListener<K extends keyof UiTextareaEventMap>(type: K, listener: (this: UiTextareaElement, event: UiTextareaEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
7
|
}
|
|
8
8
|
export interface UiTextareaProps {
|
|
9
|
+
autosize?: boolean | null;
|
|
9
10
|
disabled?: boolean | null;
|
|
10
11
|
invalid?: boolean | null;
|
|
11
12
|
readonly?: boolean | null;
|
package/vanilla/UiTextarea.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-textarea/ui-textarea.js";
|
|
4
4
|
import "../styles/ui-textarea.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-textarea","props":{"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"readonly":{"type":"boolean","required":false,"target":{"attribute":"readonly"},"default":false},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"rows":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"rows"},"default":4},"size":{"type":{"enum":["sm","md","lg"]},"required":false,"target":{"attribute":"size"},"default":"md"},"value":{"type":"string","required":false,"target":{"attribute":"value"}}}},"template":{"kind":"element","name":"textarea","attributes":[{"kind":"attribute","name":"value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"readonly","expression":"readonly","expressionPlan":{"source":"readonly","ast":{"kind":"id","name":"readonly"},"dependencies":["readonly"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}},{"kind":"attribute","name":"rows","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]}}],"children":[]},"declarations":[],"root":{"kind":"native","element":"textarea","choices":["textarea"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-textarea","props":{"autosize":{"type":"boolean","required":false,"target":{"attribute":"autosize"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"readonly":{"type":"boolean","required":false,"target":{"attribute":"readonly"},"default":false},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"rows":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"rows"},"default":4},"size":{"type":{"enum":["sm","md","lg"]},"required":false,"target":{"attribute":"size"},"default":"md"},"value":{"type":"string","required":false,"target":{"attribute":"value"}}}},"template":{"kind":"element","name":"textarea","attributes":[{"kind":"attribute","name":"value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"readonly","expression":"readonly","expressionPlan":{"source":"readonly","ast":{"kind":"id","name":"readonly"},"dependencies":["readonly"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}},{"kind":"attribute","name":"rows","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]}},{"kind":"attribute","name":"--_rows","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]},"target":"style"}],"children":[]},"declarations":[],"root":{"kind":"native","element":"textarea","choices":["textarea"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTextarea(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -31,6 +31,9 @@ export function createUiTextarea(options = {}) {
|
|
|
31
31
|
const value5 = componentProps["rows"] === undefined ? 4 : componentProps["rows"];
|
|
32
32
|
if (value5 === null || value5 === undefined) element.removeAttribute("rows");
|
|
33
33
|
else element.setAttribute("rows", String(value5));
|
|
34
|
+
const value6 = componentProps["rows"] === undefined ? 4 : componentProps["rows"];
|
|
35
|
+
if (value6 === null || value6 === undefined) element.removeAttribute("--_rows");
|
|
36
|
+
else element.setAttribute("--_rows", String(value6));
|
|
34
37
|
element.setAttribute("data-component", "ui-textarea");
|
|
35
38
|
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
36
39
|
controller,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiToastEventMap {
|
|
3
|
+
dismiss: CustomEvent<{ readonly id: string; readonly reason: "action" | "timeout"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
4
|
+
}
|
|
5
|
+
export interface UiToastElement extends HTMLDivElement {
|
|
6
|
+
addEventListener<K extends keyof UiToastEventMap>(type: K, listener: (this: UiToastElement, event: UiToastEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
7
|
+
removeEventListener<K extends keyof UiToastEventMap>(type: K, listener: (this: UiToastElement, event: UiToastEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
8
|
+
}
|
|
9
|
+
export interface UiToastProps {
|
|
10
|
+
duration?: number | null;
|
|
11
|
+
tone?: "neutral" | "info" | "success" | "warning" | "danger" | null;
|
|
12
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
13
|
+
children?: readonly (string | Node)[];
|
|
14
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createUiToast(props?: UiToastProps): UiToastElement;
|