@deepfuture/dui-components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion-context.d.ts +15 -0
- package/accordion/accordion-context.js +3 -0
- package/accordion/accordion-item.d.ts +22 -0
- package/accordion/accordion-item.js +254 -0
- package/accordion/accordion.d.ts +20 -0
- package/accordion/accordion.js +185 -0
- package/accordion/index.d.ts +3 -0
- package/accordion/index.js +2 -0
- package/accordion/register.d.ts +1 -0
- package/accordion/register.js +8 -0
- package/alert-dialog/alert-dialog-close.d.ts +15 -0
- package/alert-dialog/alert-dialog-close.js +35 -0
- package/alert-dialog/alert-dialog-context.d.ts +13 -0
- package/alert-dialog/alert-dialog-context.js +3 -0
- package/alert-dialog/alert-dialog-popup.d.ts +34 -0
- package/alert-dialog/alert-dialog-popup.js +260 -0
- package/alert-dialog/alert-dialog-trigger.d.ts +15 -0
- package/alert-dialog/alert-dialog-trigger.js +52 -0
- package/alert-dialog/alert-dialog.d.ts +30 -0
- package/alert-dialog/alert-dialog.js +97 -0
- package/alert-dialog/index.d.ts +6 -0
- package/alert-dialog/index.js +4 -0
- package/alert-dialog/register.d.ts +1 -0
- package/alert-dialog/register.js +16 -0
- package/all.d.ts +86 -0
- package/all.js +191 -0
- package/avatar/avatar.d.ts +41 -0
- package/avatar/avatar.js +188 -0
- package/avatar/index.d.ts +2 -0
- package/avatar/index.js +1 -0
- package/avatar/register.d.ts +1 -0
- package/avatar/register.js +4 -0
- package/badge/badge.d.ts +14 -0
- package/badge/badge.js +43 -0
- package/badge/index.d.ts +2 -0
- package/badge/index.js +1 -0
- package/badge/register.d.ts +1 -0
- package/badge/register.js +4 -0
- package/breadcrumb/breadcrumb-ellipsis.d.ts +14 -0
- package/breadcrumb/breadcrumb-ellipsis.js +39 -0
- package/breadcrumb/breadcrumb-item.d.ts +13 -0
- package/breadcrumb/breadcrumb-item.js +31 -0
- package/breadcrumb/breadcrumb-link.d.ts +14 -0
- package/breadcrumb/breadcrumb-link.js +32 -0
- package/breadcrumb/breadcrumb-page.d.ts +13 -0
- package/breadcrumb/breadcrumb-page.js +36 -0
- package/breadcrumb/breadcrumb-separator.d.ts +14 -0
- package/breadcrumb/breadcrumb-separator.js +36 -0
- package/breadcrumb/breadcrumb.d.ts +14 -0
- package/breadcrumb/breadcrumb.js +38 -0
- package/breadcrumb/index.d.ts +6 -0
- package/breadcrumb/index.js +6 -0
- package/breadcrumb/register.d.ts +1 -0
- package/breadcrumb/register.js +14 -0
- package/button/button.d.ts +38 -0
- package/button/button.js +143 -0
- package/button/index.d.ts +2 -0
- package/button/index.js +1 -0
- package/button/register.d.ts +1 -0
- package/button/register.js +4 -0
- package/calendar/calendar.d.ts +33 -0
- package/calendar/calendar.js +428 -0
- package/calendar/index.d.ts +1 -0
- package/calendar/index.js +1 -0
- package/calendar/register.d.ts +1 -0
- package/calendar/register.js +4 -0
- package/center/center.d.ts +14 -0
- package/center/center.js +37 -0
- package/center/index.d.ts +1 -0
- package/center/index.js +1 -0
- package/center/register.d.ts +1 -0
- package/center/register.js +4 -0
- package/checkbox/checkbox-group-context.d.ts +11 -0
- package/checkbox/checkbox-group-context.js +3 -0
- package/checkbox/checkbox-group.d.ts +34 -0
- package/checkbox/checkbox-group.js +128 -0
- package/checkbox/checkbox.d.ts +46 -0
- package/checkbox/checkbox.js +314 -0
- package/checkbox/index.d.ts +3 -0
- package/checkbox/index.js +2 -0
- package/checkbox/register.d.ts +1 -0
- package/checkbox/register.js +8 -0
- package/collapsible/collapsible.d.ts +22 -0
- package/collapsible/collapsible.js +227 -0
- package/collapsible/index.d.ts +1 -0
- package/collapsible/index.js +1 -0
- package/collapsible/register.d.ts +1 -0
- package/collapsible/register.js +4 -0
- package/combobox/combobox.d.ts +46 -0
- package/combobox/combobox.js +524 -0
- package/combobox/index.d.ts +2 -0
- package/combobox/index.js +1 -0
- package/combobox/register.d.ts +1 -0
- package/combobox/register.js +4 -0
- package/command/command-context.d.ts +30 -0
- package/command/command-context.js +3 -0
- package/command/command-empty.d.ts +10 -0
- package/command/command-empty.js +50 -0
- package/command/command-group.d.ts +15 -0
- package/command/command-group.js +79 -0
- package/command/command-input.d.ts +13 -0
- package/command/command-input.js +106 -0
- package/command/command-item.d.ts +20 -0
- package/command/command-item.js +175 -0
- package/command/command-list.d.ts +9 -0
- package/command/command-list.js +43 -0
- package/command/command-score.d.ts +6 -0
- package/command/command-score.js +31 -0
- package/command/command-separator.d.ts +7 -0
- package/command/command-separator.js +15 -0
- package/command/command-shortcut.d.ts +7 -0
- package/command/command-shortcut.js +16 -0
- package/command/command.d.ts +25 -0
- package/command/command.js +278 -0
- package/command/index.d.ts +10 -0
- package/command/index.js +9 -0
- package/command/register.d.ts +1 -0
- package/command/register.js +22 -0
- package/data-table/data-table.d.ts +59 -0
- package/data-table/data-table.js +416 -0
- package/data-table/index.d.ts +2 -0
- package/data-table/index.js +1 -0
- package/data-table/register.d.ts +1 -0
- package/data-table/register.js +4 -0
- package/dialog/dialog-close.d.ts +15 -0
- package/dialog/dialog-close.js +35 -0
- package/dialog/dialog-context.d.ts +13 -0
- package/dialog/dialog-context.js +3 -0
- package/dialog/dialog-popup.d.ts +36 -0
- package/dialog/dialog-popup.js +277 -0
- package/dialog/dialog-trigger.d.ts +15 -0
- package/dialog/dialog-trigger.js +52 -0
- package/dialog/dialog.d.ts +30 -0
- package/dialog/dialog.js +97 -0
- package/dialog/index.d.ts +6 -0
- package/dialog/index.js +4 -0
- package/dialog/register.d.ts +1 -0
- package/dialog/register.js +16 -0
- package/dropzone/dropzone.d.ts +74 -0
- package/dropzone/dropzone.js +357 -0
- package/dropzone/index.d.ts +2 -0
- package/dropzone/index.js +1 -0
- package/dropzone/register.d.ts +1 -0
- package/dropzone/register.js +4 -0
- package/field/field-context.d.ts +20 -0
- package/field/field-context.js +2 -0
- package/field/index.d.ts +2 -0
- package/field/index.js +1 -0
- package/global.d.ts +189 -0
- package/hstack/hstack.d.ts +25 -0
- package/hstack/hstack.js +141 -0
- package/hstack/index.d.ts +2 -0
- package/hstack/index.js +1 -0
- package/hstack/register.d.ts +1 -0
- package/hstack/register.js +4 -0
- package/icon/icon.d.ts +16 -0
- package/icon/icon.js +34 -0
- package/icon/index.d.ts +1 -0
- package/icon/index.js +1 -0
- package/icon/register.d.ts +1 -0
- package/icon/register.js +4 -0
- package/input/index.d.ts +1 -0
- package/input/index.js +1 -0
- package/input/input.d.ts +47 -0
- package/input/input.js +205 -0
- package/input/register.d.ts +1 -0
- package/input/register.js +4 -0
- package/link/index.d.ts +1 -0
- package/link/index.js +1 -0
- package/link/link.d.ts +27 -0
- package/link/link.js +57 -0
- package/link/register.d.ts +1 -0
- package/link/register.js +4 -0
- package/menu/index.d.ts +2 -0
- package/menu/index.js +2 -0
- package/menu/menu-item.d.ts +17 -0
- package/menu/menu-item.js +62 -0
- package/menu/menu.d.ts +15 -0
- package/menu/menu.js +228 -0
- package/menu/register.d.ts +1 -0
- package/menu/register.js +8 -0
- package/menubar/index.d.ts +2 -0
- package/menubar/index.js +1 -0
- package/menubar/menubar-context.d.ts +9 -0
- package/menubar/menubar-context.js +2 -0
- package/menubar/menubar.d.ts +19 -0
- package/menubar/menubar.js +130 -0
- package/menubar/register.d.ts +1 -0
- package/menubar/register.js +4 -0
- package/number-field/index.d.ts +1 -0
- package/number-field/index.js +1 -0
- package/number-field/number-field.d.ts +34 -0
- package/number-field/number-field.js +326 -0
- package/number-field/register.d.ts +1 -0
- package/number-field/register.js +4 -0
- package/package.json +217 -0
- package/page-inset/index.d.ts +1 -0
- package/page-inset/index.js +1 -0
- package/page-inset/page-inset.d.ts +28 -0
- package/page-inset/page-inset.js +103 -0
- package/page-inset/register.d.ts +1 -0
- package/page-inset/register.js +4 -0
- package/popover/index.d.ts +6 -0
- package/popover/index.js +4 -0
- package/popover/popover-close.d.ts +13 -0
- package/popover/popover-close.js +33 -0
- package/popover/popover-context.d.ts +17 -0
- package/popover/popover-context.js +3 -0
- package/popover/popover-popup.d.ts +20 -0
- package/popover/popover-popup.js +176 -0
- package/popover/popover-trigger.d.ts +13 -0
- package/popover/popover-trigger.js +57 -0
- package/popover/popover.d.ts +30 -0
- package/popover/popover.js +140 -0
- package/popover/register.d.ts +1 -0
- package/popover/register.js +16 -0
- package/portal/index.d.ts +2 -0
- package/portal/index.js +1 -0
- package/portal/portal.d.ts +29 -0
- package/portal/portal.js +115 -0
- package/portal/register.d.ts +1 -0
- package/portal/register.js +4 -0
- package/preview-card/index.d.ts +5 -0
- package/preview-card/index.js +3 -0
- package/preview-card/preview-card-context.d.ts +16 -0
- package/preview-card/preview-card-context.js +3 -0
- package/preview-card/preview-card-popup.d.ts +16 -0
- package/preview-card/preview-card-popup.js +167 -0
- package/preview-card/preview-card-trigger.d.ts +13 -0
- package/preview-card/preview-card-trigger.js +75 -0
- package/preview-card/preview-card.d.ts +34 -0
- package/preview-card/preview-card.js +164 -0
- package/preview-card/register.d.ts +1 -0
- package/preview-card/register.js +12 -0
- package/progress/index.d.ts +1 -0
- package/progress/index.js +1 -0
- package/progress/progress.d.ts +19 -0
- package/progress/progress.js +94 -0
- package/progress/register.d.ts +1 -0
- package/progress/register.js +4 -0
- package/radio/index.d.ts +3 -0
- package/radio/index.js +2 -0
- package/radio/radio-group-context.d.ts +11 -0
- package/radio/radio-group-context.js +2 -0
- package/radio/radio-group.d.ts +37 -0
- package/radio/radio-group.js +135 -0
- package/radio/radio.d.ts +27 -0
- package/radio/radio.js +204 -0
- package/radio/register.d.ts +1 -0
- package/radio/register.js +8 -0
- package/scroll-area/index.d.ts +1 -0
- package/scroll-area/index.js +1 -0
- package/scroll-area/register.d.ts +1 -0
- package/scroll-area/register.js +4 -0
- package/scroll-area/scroll-area.d.ts +38 -0
- package/scroll-area/scroll-area.js +453 -0
- package/select/index.d.ts +2 -0
- package/select/index.js +1 -0
- package/select/register.d.ts +1 -0
- package/select/register.js +4 -0
- package/select/select.d.ts +36 -0
- package/select/select.js +404 -0
- package/separator/index.d.ts +1 -0
- package/separator/index.js +1 -0
- package/separator/register.d.ts +1 -0
- package/separator/register.js +4 -0
- package/separator/separator.d.ts +12 -0
- package/separator/separator.js +50 -0
- package/sidebar/index.d.ts +16 -0
- package/sidebar/index.js +13 -0
- package/sidebar/register.d.ts +1 -0
- package/sidebar/register.js +52 -0
- package/sidebar/sidebar-content.d.ts +14 -0
- package/sidebar/sidebar-content.js +30 -0
- package/sidebar/sidebar-context.d.ts +15 -0
- package/sidebar/sidebar-context.js +3 -0
- package/sidebar/sidebar-footer.d.ts +12 -0
- package/sidebar/sidebar-footer.js +21 -0
- package/sidebar/sidebar-group-label.d.ts +17 -0
- package/sidebar/sidebar-group-label.js +49 -0
- package/sidebar/sidebar-group.d.ts +15 -0
- package/sidebar/sidebar-group.js +29 -0
- package/sidebar/sidebar-header.d.ts +12 -0
- package/sidebar/sidebar-header.js +21 -0
- package/sidebar/sidebar-inset.d.ts +15 -0
- package/sidebar/sidebar-inset.js +29 -0
- package/sidebar/sidebar-menu-button.d.ts +31 -0
- package/sidebar/sidebar-menu-button.js +201 -0
- package/sidebar/sidebar-menu-item.d.ts +12 -0
- package/sidebar/sidebar-menu-item.js +20 -0
- package/sidebar/sidebar-menu.d.ts +14 -0
- package/sidebar/sidebar-menu.js +30 -0
- package/sidebar/sidebar-provider.d.ts +34 -0
- package/sidebar/sidebar-provider.js +157 -0
- package/sidebar/sidebar-separator.d.ts +12 -0
- package/sidebar/sidebar-separator.js +24 -0
- package/sidebar/sidebar-trigger.d.ts +16 -0
- package/sidebar/sidebar-trigger.js +50 -0
- package/sidebar/sidebar.d.ts +21 -0
- package/sidebar/sidebar.js +228 -0
- package/slider/index.d.ts +1 -0
- package/slider/index.js +1 -0
- package/slider/register.d.ts +1 -0
- package/slider/register.js +4 -0
- package/slider/slider.d.ts +37 -0
- package/slider/slider.js +268 -0
- package/spinner/index.d.ts +1 -0
- package/spinner/index.js +1 -0
- package/spinner/register.d.ts +1 -0
- package/spinner/register.js +4 -0
- package/spinner/spinner.d.ts +18 -0
- package/spinner/spinner.js +138 -0
- package/switch/index.d.ts +1 -0
- package/switch/index.js +1 -0
- package/switch/register.d.ts +1 -0
- package/switch/register.js +4 -0
- package/switch/switch.d.ts +29 -0
- package/switch/switch.js +201 -0
- package/tabs/index.d.ts +6 -0
- package/tabs/index.js +5 -0
- package/tabs/register.d.ts +1 -0
- package/tabs/register.js +10 -0
- package/tabs/tab.d.ts +16 -0
- package/tabs/tab.js +98 -0
- package/tabs/tabs-context.d.ts +8 -0
- package/tabs/tabs-context.js +2 -0
- package/tabs/tabs-indicator.d.ts +11 -0
- package/tabs/tabs-indicator.js +27 -0
- package/tabs/tabs-list.d.ts +17 -0
- package/tabs/tabs-list.js +85 -0
- package/tabs/tabs-panel.d.ts +18 -0
- package/tabs/tabs-panel.js +85 -0
- package/tabs/tabs.d.ts +24 -0
- package/tabs/tabs.js +111 -0
- package/textarea/index.d.ts +2 -0
- package/textarea/index.js +1 -0
- package/textarea/register.d.ts +1 -0
- package/textarea/register.js +4 -0
- package/textarea/textarea.d.ts +37 -0
- package/textarea/textarea.js +170 -0
- package/toggle/index.d.ts +3 -0
- package/toggle/index.js +2 -0
- package/toggle/register.d.ts +1 -0
- package/toggle/register.js +8 -0
- package/toggle/toggle-group-context.d.ts +9 -0
- package/toggle/toggle-group-context.js +2 -0
- package/toggle/toggle-group.d.ts +27 -0
- package/toggle/toggle-group.js +163 -0
- package/toggle/toggle.d.ts +25 -0
- package/toggle/toggle.js +124 -0
- package/toolbar/index.d.ts +1 -0
- package/toolbar/index.js +1 -0
- package/toolbar/register.d.ts +1 -0
- package/toolbar/register.js +4 -0
- package/toolbar/toolbar.d.ts +15 -0
- package/toolbar/toolbar.js +89 -0
- package/tooltip/index.d.ts +5 -0
- package/tooltip/index.js +3 -0
- package/tooltip/register.d.ts +1 -0
- package/tooltip/register.js +12 -0
- package/tooltip/tooltip-context.d.ts +17 -0
- package/tooltip/tooltip-context.js +3 -0
- package/tooltip/tooltip-popup.d.ts +16 -0
- package/tooltip/tooltip-popup.js +162 -0
- package/tooltip/tooltip-trigger.d.ts +15 -0
- package/tooltip/tooltip-trigger.js +110 -0
- package/tooltip/tooltip.d.ts +36 -0
- package/tooltip/tooltip.js +176 -0
- package/trunc/index.d.ts +1 -0
- package/trunc/index.js +1 -0
- package/trunc/register.d.ts +1 -0
- package/trunc/register.js +4 -0
- package/trunc/trunc.d.ts +19 -0
- package/trunc/trunc.js +68 -0
- package/vstack/index.d.ts +1 -0
- package/vstack/index.js +1 -0
- package/vstack/register.d.ts +1 -0
- package/vstack/register.js +4 -0
- package/vstack/vstack.d.ts +17 -0
- package/vstack/vstack.js +83 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type CommandContext } from "./command-context.js";
|
|
4
|
+
export declare class DuiCommandGroup extends LitElement {
|
|
5
|
+
#private;
|
|
6
|
+
static tagName: "dui-command-group";
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
/** Heading text for this group. */
|
|
9
|
+
accessor heading: string;
|
|
10
|
+
accessor _ctx: CommandContext;
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
willUpdate(): void;
|
|
14
|
+
render(): TemplateResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
import { css, html, LitElement, nothing } from "lit";
|
|
9
|
+
import { property } from "lit/decorators.js";
|
|
10
|
+
import { consume } from "@lit/context";
|
|
11
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
12
|
+
import { commandContext } from "./command-context.js";
|
|
13
|
+
let groupIdCounter = 0;
|
|
14
|
+
const nextGroupId = () => `dui-command-group-${++groupIdCounter}`;
|
|
15
|
+
const styles = css `
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([data-hidden]) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.Group {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
export class DuiCommandGroup extends LitElement {
|
|
29
|
+
static { this.tagName = "dui-command-group"; }
|
|
30
|
+
static { this.styles = [base, styles]; }
|
|
31
|
+
#heading_accessor_storage = "";
|
|
32
|
+
/** Heading text for this group. */
|
|
33
|
+
get heading() { return this.#heading_accessor_storage; }
|
|
34
|
+
set heading(value) { this.#heading_accessor_storage = value; }
|
|
35
|
+
#_ctx_accessor_storage;
|
|
36
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
37
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
38
|
+
#groupId = nextGroupId();
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
super.connectedCallback();
|
|
41
|
+
this.setAttribute("data-group-id", this.#groupId);
|
|
42
|
+
this._ctx?.registerGroup(this.#groupId);
|
|
43
|
+
}
|
|
44
|
+
disconnectedCallback() {
|
|
45
|
+
super.disconnectedCallback();
|
|
46
|
+
this._ctx?.unregisterGroup(this.#groupId);
|
|
47
|
+
}
|
|
48
|
+
willUpdate() {
|
|
49
|
+
// Hide group when no visible items
|
|
50
|
+
if (this._ctx?.shouldFilter) {
|
|
51
|
+
const visibleCount = this._ctx.getGroupVisibleCount(this.#groupId);
|
|
52
|
+
if (visibleCount === 0 && this._ctx.search !== "") {
|
|
53
|
+
this.setAttribute("data-hidden", "");
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.removeAttribute("data-hidden");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.removeAttribute("data-hidden");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return html `
|
|
65
|
+
<div class="Group" role="group" aria-label="${this.heading || nothing}">
|
|
66
|
+
${this.heading
|
|
67
|
+
? html `<div class="Heading" aria-hidden="true">${this.heading}</div>`
|
|
68
|
+
: nothing}
|
|
69
|
+
<slot></slot>
|
|
70
|
+
</div>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
__decorate([
|
|
75
|
+
property({ type: String })
|
|
76
|
+
], DuiCommandGroup.prototype, "heading", null);
|
|
77
|
+
__decorate([
|
|
78
|
+
consume({ context: commandContext, subscribe: true })
|
|
79
|
+
], DuiCommandGroup.prototype, "_ctx", null);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type CommandContext } from "./command-context.js";
|
|
4
|
+
export declare class DuiCommandInput extends LitElement {
|
|
5
|
+
#private;
|
|
6
|
+
static tagName: "dui-command-input";
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
/** Placeholder text for the search input. */
|
|
9
|
+
accessor placeholder: string;
|
|
10
|
+
accessor _ctx: CommandContext;
|
|
11
|
+
willUpdate(): void;
|
|
12
|
+
render(): TemplateResult;
|
|
13
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
import { css, html, LitElement, nothing } from "lit";
|
|
9
|
+
import { property } from "lit/decorators.js";
|
|
10
|
+
import { consume } from "@lit/context";
|
|
11
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
12
|
+
import { commandContext } from "./command-context.js";
|
|
13
|
+
const styles = css `
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.InputWrapper {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.SearchIcon {
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.Input {
|
|
29
|
+
display: flex;
|
|
30
|
+
width: 100%;
|
|
31
|
+
border: none;
|
|
32
|
+
outline: none;
|
|
33
|
+
background: transparent;
|
|
34
|
+
padding: 0;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
export class DuiCommandInput extends LitElement {
|
|
38
|
+
static { this.tagName = "dui-command-input"; }
|
|
39
|
+
static { this.styles = [base, styles]; }
|
|
40
|
+
#placeholder_accessor_storage = "Search...";
|
|
41
|
+
/** Placeholder text for the search input. */
|
|
42
|
+
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
43
|
+
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
44
|
+
#_ctx_accessor_storage;
|
|
45
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
46
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
47
|
+
#prevSearch = undefined;
|
|
48
|
+
#handleInput = (event) => {
|
|
49
|
+
const input = event.target;
|
|
50
|
+
this._ctx?.setSearch(input.value);
|
|
51
|
+
};
|
|
52
|
+
#handleKeyDown = (event) => {
|
|
53
|
+
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
willUpdate() {
|
|
58
|
+
// Sync input value when search is cleared externally
|
|
59
|
+
if (this.#prevSearch !== undefined &&
|
|
60
|
+
this._ctx?.search === "" &&
|
|
61
|
+
this.#prevSearch !== "") {
|
|
62
|
+
const input = this.shadowRoot?.querySelector(".Input");
|
|
63
|
+
if (input)
|
|
64
|
+
input.value = "";
|
|
65
|
+
}
|
|
66
|
+
this.#prevSearch = this._ctx?.search;
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return html `
|
|
70
|
+
<div class="InputWrapper">
|
|
71
|
+
<svg
|
|
72
|
+
class="SearchIcon"
|
|
73
|
+
width="16"
|
|
74
|
+
height="16"
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
fill="none"
|
|
77
|
+
stroke="currentColor"
|
|
78
|
+
stroke-width="2"
|
|
79
|
+
stroke-linecap="round"
|
|
80
|
+
stroke-linejoin="round"
|
|
81
|
+
>
|
|
82
|
+
<circle cx="11" cy="11" r="8" />
|
|
83
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
84
|
+
</svg>
|
|
85
|
+
<input
|
|
86
|
+
class="Input"
|
|
87
|
+
type="text"
|
|
88
|
+
role="combobox"
|
|
89
|
+
autocomplete="off"
|
|
90
|
+
aria-expanded="true"
|
|
91
|
+
aria-controls="${this._ctx?.listId ?? nothing}"
|
|
92
|
+
aria-activedescendant="${this._ctx?.selectedItemId ?? nothing}"
|
|
93
|
+
.placeholder="${this.placeholder}"
|
|
94
|
+
@input="${this.#handleInput}"
|
|
95
|
+
@keydown="${this.#handleKeyDown}"
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
__decorate([
|
|
102
|
+
property({ type: String })
|
|
103
|
+
], DuiCommandInput.prototype, "placeholder", null);
|
|
104
|
+
__decorate([
|
|
105
|
+
consume({ context: commandContext, subscribe: true })
|
|
106
|
+
], DuiCommandInput.prototype, "_ctx", null);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type CommandContext } from "./command-context.js";
|
|
4
|
+
export declare class DuiCommandItem extends LitElement {
|
|
5
|
+
#private;
|
|
6
|
+
static tagName: "dui-command-item";
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
/** The value this item represents. */
|
|
9
|
+
accessor value: string;
|
|
10
|
+
/** Additional search keywords. */
|
|
11
|
+
accessor keywords: string[];
|
|
12
|
+
/** Whether this item is disabled. */
|
|
13
|
+
accessor disabled: boolean;
|
|
14
|
+
accessor _ctx: CommandContext;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
willUpdate(): void;
|
|
18
|
+
updated(): void;
|
|
19
|
+
render(): TemplateResult;
|
|
20
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
import { css, html, LitElement } from "lit";
|
|
9
|
+
import { property } from "lit/decorators.js";
|
|
10
|
+
import { consume } from "@lit/context";
|
|
11
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
12
|
+
import { commandContext } from "./command-context.js";
|
|
13
|
+
let itemIdCounter = 0;
|
|
14
|
+
const nextItemId = () => `dui-command-item-${++itemIdCounter}`;
|
|
15
|
+
const styles = css `
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([data-hidden]) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.Item {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
user-select: none;
|
|
30
|
+
outline: none;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
export class DuiCommandItem extends LitElement {
|
|
34
|
+
static { this.tagName = "dui-command-item"; }
|
|
35
|
+
static { this.styles = [base, styles]; }
|
|
36
|
+
#value_accessor_storage = "";
|
|
37
|
+
/** The value this item represents. */
|
|
38
|
+
get value() { return this.#value_accessor_storage; }
|
|
39
|
+
set value(value) { this.#value_accessor_storage = value; }
|
|
40
|
+
#keywords_accessor_storage = [];
|
|
41
|
+
/** Additional search keywords. */
|
|
42
|
+
get keywords() { return this.#keywords_accessor_storage; }
|
|
43
|
+
set keywords(value) { this.#keywords_accessor_storage = value; }
|
|
44
|
+
#disabled_accessor_storage = false;
|
|
45
|
+
/** Whether this item is disabled. */
|
|
46
|
+
get disabled() { return this.#disabled_accessor_storage; }
|
|
47
|
+
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
48
|
+
#_ctx_accessor_storage;
|
|
49
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
50
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
51
|
+
#id = nextItemId();
|
|
52
|
+
// Track previous own-property values to avoid infinite update loops
|
|
53
|
+
#prevValue = undefined;
|
|
54
|
+
#prevKeywords = undefined;
|
|
55
|
+
#prevDisabled = undefined;
|
|
56
|
+
#registered = false;
|
|
57
|
+
get #isSelected() {
|
|
58
|
+
return this._ctx?.selectedItemId === this.#id;
|
|
59
|
+
}
|
|
60
|
+
get #isVisible() {
|
|
61
|
+
if (!this._ctx)
|
|
62
|
+
return true;
|
|
63
|
+
return this._ctx.getScore(this.#id) > 0;
|
|
64
|
+
}
|
|
65
|
+
#getGroupId() {
|
|
66
|
+
const groupHost = this.closest("[data-group-id]");
|
|
67
|
+
return groupHost?.getAttribute("data-group-id") ?? undefined;
|
|
68
|
+
}
|
|
69
|
+
#buildEntry() {
|
|
70
|
+
return {
|
|
71
|
+
id: this.#id,
|
|
72
|
+
value: this.value,
|
|
73
|
+
keywords: this.keywords,
|
|
74
|
+
textContent: this.textContent?.trim() ?? "",
|
|
75
|
+
disabled: this.disabled,
|
|
76
|
+
groupId: this.#getGroupId(),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
super.connectedCallback();
|
|
81
|
+
// Defer registration to next frame so context is available
|
|
82
|
+
requestAnimationFrame(() => {
|
|
83
|
+
if (!this.isConnected)
|
|
84
|
+
return;
|
|
85
|
+
this._ctx?.registerItem(this.#buildEntry());
|
|
86
|
+
this.#registered = true;
|
|
87
|
+
this.#prevValue = this.value;
|
|
88
|
+
this.#prevKeywords = this.keywords;
|
|
89
|
+
this.#prevDisabled = this.disabled;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
disconnectedCallback() {
|
|
93
|
+
super.disconnectedCallback();
|
|
94
|
+
this._ctx?.unregisterItem(this.#id);
|
|
95
|
+
this.#registered = false;
|
|
96
|
+
}
|
|
97
|
+
willUpdate() {
|
|
98
|
+
// Only call updateItem when own properties change, not on every context update
|
|
99
|
+
if (this.#registered) {
|
|
100
|
+
const valueChanged = this.#prevValue !== this.value;
|
|
101
|
+
const keywordsChanged = this.#prevKeywords !== this.keywords;
|
|
102
|
+
const disabledChanged = this.#prevDisabled !== this.disabled;
|
|
103
|
+
if (valueChanged || keywordsChanged || disabledChanged) {
|
|
104
|
+
this._ctx?.updateItem(this.#buildEntry());
|
|
105
|
+
this.#prevValue = this.value;
|
|
106
|
+
this.#prevKeywords = this.keywords;
|
|
107
|
+
this.#prevDisabled = this.disabled;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Toggle data-hidden attribute
|
|
111
|
+
if (this._ctx?.shouldFilter) {
|
|
112
|
+
if (!this.#isVisible) {
|
|
113
|
+
this.setAttribute("data-hidden", "");
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.removeAttribute("data-hidden");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.removeAttribute("data-hidden");
|
|
121
|
+
}
|
|
122
|
+
// Update selected attribute
|
|
123
|
+
if (this.#isSelected) {
|
|
124
|
+
this.setAttribute("data-selected", "");
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.removeAttribute("data-selected");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
updated() {
|
|
131
|
+
// Scroll into view when selected
|
|
132
|
+
if (this.#isSelected) {
|
|
133
|
+
this.scrollIntoView({ block: "nearest" });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
#handleMouseMove = () => {
|
|
137
|
+
if (!this.disabled && this._ctx?.selectedItemId !== this.#id) {
|
|
138
|
+
this._ctx?.selectItem(this.#id);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
#handleClick = () => {
|
|
142
|
+
if (!this.disabled) {
|
|
143
|
+
this._ctx?.handleItemSelect(this.value);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
render() {
|
|
147
|
+
return html `
|
|
148
|
+
<div
|
|
149
|
+
class="Item"
|
|
150
|
+
role="option"
|
|
151
|
+
id="${this.#id}"
|
|
152
|
+
aria-selected="${this.#isSelected}"
|
|
153
|
+
aria-disabled="${this.disabled}"
|
|
154
|
+
?data-selected="${this.#isSelected}"
|
|
155
|
+
?data-disabled="${this.disabled}"
|
|
156
|
+
@mousemove="${this.#handleMouseMove}"
|
|
157
|
+
@click="${this.#handleClick}"
|
|
158
|
+
>
|
|
159
|
+
<slot></slot>
|
|
160
|
+
</div>
|
|
161
|
+
`;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ type: String })
|
|
166
|
+
], DuiCommandItem.prototype, "value", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
property({ type: Array, attribute: false })
|
|
169
|
+
], DuiCommandItem.prototype, "keywords", null);
|
|
170
|
+
__decorate([
|
|
171
|
+
property({ type: Boolean })
|
|
172
|
+
], DuiCommandItem.prototype, "disabled", null);
|
|
173
|
+
__decorate([
|
|
174
|
+
consume({ context: commandContext, subscribe: true })
|
|
175
|
+
], DuiCommandItem.prototype, "_ctx", null);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type CommandContext } from "./command-context.js";
|
|
4
|
+
export declare class DuiCommandList extends LitElement {
|
|
5
|
+
static tagName: "dui-command-list";
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
accessor _ctx: CommandContext;
|
|
8
|
+
render(): TemplateResult;
|
|
9
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
import { css, html, LitElement } from "lit";
|
|
9
|
+
import { consume } from "@lit/context";
|
|
10
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
11
|
+
import { commandContext } from "./command-context.js";
|
|
12
|
+
const styles = css `
|
|
13
|
+
:host {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.List {
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
export class DuiCommandList extends LitElement {
|
|
22
|
+
static { this.tagName = "dui-command-list"; }
|
|
23
|
+
static { this.styles = [base, styles]; }
|
|
24
|
+
#_ctx_accessor_storage;
|
|
25
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
26
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
27
|
+
render() {
|
|
28
|
+
return html `
|
|
29
|
+
<dui-scroll-area>
|
|
30
|
+
<div
|
|
31
|
+
class="List"
|
|
32
|
+
role="listbox"
|
|
33
|
+
id="${this._ctx?.listId ?? ""}"
|
|
34
|
+
>
|
|
35
|
+
<slot></slot>
|
|
36
|
+
</div>
|
|
37
|
+
</dui-scroll-area>
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
__decorate([
|
|
42
|
+
consume({ context: commandContext, subscribe: true })
|
|
43
|
+
], DuiCommandList.prototype, "_ctx", null);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
/**
|
|
3
|
+
* Score an item against a search query.
|
|
4
|
+
* Returns 0 for no match, higher values for better matches.
|
|
5
|
+
*/
|
|
6
|
+
export declare const commandScore: (query: string, value: string, textContent: string, keywords: readonly string[]) => number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
/**
|
|
3
|
+
* Score an item against a search query.
|
|
4
|
+
* Returns 0 for no match, higher values for better matches.
|
|
5
|
+
*/
|
|
6
|
+
export const commandScore = (query, value, textContent, keywords) => {
|
|
7
|
+
if (!query)
|
|
8
|
+
return 1;
|
|
9
|
+
const q = query.toLowerCase();
|
|
10
|
+
const v = value.toLowerCase();
|
|
11
|
+
const t = textContent.toLowerCase();
|
|
12
|
+
if (v === q)
|
|
13
|
+
return 1.0;
|
|
14
|
+
if (v.startsWith(q))
|
|
15
|
+
return 0.8;
|
|
16
|
+
if (t.startsWith(q))
|
|
17
|
+
return 0.75;
|
|
18
|
+
if (v.includes(q))
|
|
19
|
+
return 0.7;
|
|
20
|
+
if (t.includes(q))
|
|
21
|
+
return 0.6;
|
|
22
|
+
for (const kw of keywords) {
|
|
23
|
+
if (kw.toLowerCase().startsWith(q))
|
|
24
|
+
return 0.5;
|
|
25
|
+
}
|
|
26
|
+
for (const kw of keywords) {
|
|
27
|
+
if (kw.toLowerCase().includes(q))
|
|
28
|
+
return 0.4;
|
|
29
|
+
}
|
|
30
|
+
return 0;
|
|
31
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
export declare class DuiCommandSeparator extends LitElement {
|
|
4
|
+
static tagName: "dui-command-separator";
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
render(): TemplateResult;
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { css, html, LitElement } from "lit";
|
|
3
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
4
|
+
const styles = css `
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
`;
|
|
9
|
+
export class DuiCommandSeparator extends LitElement {
|
|
10
|
+
static { this.tagName = "dui-command-separator"; }
|
|
11
|
+
static { this.styles = [base, styles]; }
|
|
12
|
+
render() {
|
|
13
|
+
return html `<div class="Separator" role="separator"></div>`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
export declare class DuiCommandShortcut extends LitElement {
|
|
4
|
+
static tagName: "dui-command-shortcut";
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
render(): TemplateResult;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { css, html, LitElement } from "lit";
|
|
3
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
4
|
+
const styles = css `
|
|
5
|
+
:host {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
margin-left: auto;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
export class DuiCommandShortcut extends LitElement {
|
|
11
|
+
static { this.tagName = "dui-command-shortcut"; }
|
|
12
|
+
static { this.styles = [base, styles]; }
|
|
13
|
+
render() {
|
|
14
|
+
return html `<span class="Shortcut"><slot></slot></span>`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/command */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type CommandContext } from "./command-context.js";
|
|
4
|
+
export type FilterFn = (value: string, search: string, keywords?: readonly string[]) => number;
|
|
5
|
+
export declare const selectEvent: (detail: string) => CustomEvent<string>;
|
|
6
|
+
export declare const searchChangeEvent: (detail: string) => CustomEvent<string>;
|
|
7
|
+
export declare const escapeEvent: (detail: void) => CustomEvent<void>;
|
|
8
|
+
export declare class DuiCommand extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
static tagName: "dui-command";
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
/** Whether keyboard navigation wraps from last to first and vice versa. */
|
|
13
|
+
accessor loop: boolean;
|
|
14
|
+
/** Whether items should be filtered based on search text. */
|
|
15
|
+
accessor shouldFilter: boolean;
|
|
16
|
+
/** Controlled value — the currently selected item value. */
|
|
17
|
+
accessor value: string | undefined;
|
|
18
|
+
/** Custom filter function. */
|
|
19
|
+
accessor filter: FilterFn | undefined;
|
|
20
|
+
accessor _ctx: CommandContext;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
willUpdate(): void;
|
|
24
|
+
render(): TemplateResult;
|
|
25
|
+
}
|