@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,6 @@
|
|
|
1
|
+
export { DuiPopover, openChangeEvent } from "./popover.js";
|
|
2
|
+
export type { PopoverOpenChangeDetail } from "./popover.js";
|
|
3
|
+
export { DuiPopoverTrigger } from "./popover-trigger.js";
|
|
4
|
+
export { DuiPopoverPopup } from "./popover-popup.js";
|
|
5
|
+
export { DuiPopoverClose } from "./popover-close.js";
|
|
6
|
+
export type { PopoverContext, PopoverSide } from "./popover-context.js";
|
package/popover/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-popover-close>` — A close button wrapper for the popover.
|
|
5
|
+
*
|
|
6
|
+
* @slot - Content that closes the popover (usually a button or icon).
|
|
7
|
+
*/
|
|
8
|
+
export declare class DuiPopoverClose extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
static tagName: "dui-popover-close";
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
render(): TemplateResult;
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
|
+
import { css, html, LitElement } from "lit";
|
|
3
|
+
import { ContextConsumer } from "@lit/context";
|
|
4
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
5
|
+
import { popoverContext } from "./popover-context.js";
|
|
6
|
+
const hostStyles = css `
|
|
7
|
+
:host {
|
|
8
|
+
display: contents;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
/**
|
|
12
|
+
* `<dui-popover-close>` — A close button wrapper for the popover.
|
|
13
|
+
*
|
|
14
|
+
* @slot - Content that closes the popover (usually a button or icon).
|
|
15
|
+
*/
|
|
16
|
+
export class DuiPopoverClose extends LitElement {
|
|
17
|
+
static { this.tagName = "dui-popover-close"; }
|
|
18
|
+
static { this.styles = [base, hostStyles]; }
|
|
19
|
+
#ctx = new ContextConsumer(this, {
|
|
20
|
+
context: popoverContext,
|
|
21
|
+
subscribe: true,
|
|
22
|
+
});
|
|
23
|
+
#handleClick = () => {
|
|
24
|
+
this.#ctx.value?.closePopover();
|
|
25
|
+
};
|
|
26
|
+
render() {
|
|
27
|
+
return html `
|
|
28
|
+
<span @click="${this.#handleClick}">
|
|
29
|
+
<slot></slot>
|
|
30
|
+
</span>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
|
+
export type PopoverSide = "top" | "bottom";
|
|
3
|
+
export type PopoverContext = {
|
|
4
|
+
readonly open: boolean;
|
|
5
|
+
readonly triggerId: string;
|
|
6
|
+
readonly popupId: string;
|
|
7
|
+
readonly side: PopoverSide;
|
|
8
|
+
readonly sideOffset: number;
|
|
9
|
+
readonly triggerEl: HTMLElement | undefined;
|
|
10
|
+
readonly openPopover: () => void;
|
|
11
|
+
readonly closePopover: () => void;
|
|
12
|
+
readonly togglePopover: () => void;
|
|
13
|
+
readonly setTriggerEl: (el: HTMLElement | undefined) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const popoverContext: {
|
|
16
|
+
__context__: PopoverContext;
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-popover-popup>` — The popover popup content container.
|
|
5
|
+
*
|
|
6
|
+
* @slot - Popover content.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DuiPopoverPopup extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
static tagName: "dui-popover-popup";
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
/** Whether to show an arrow pointing to the trigger. */
|
|
13
|
+
accessor showArrow: boolean;
|
|
14
|
+
/** Close the popover when content inside the popup is clicked. */
|
|
15
|
+
accessor closeOnClick: boolean;
|
|
16
|
+
/** Check if an event path includes this popup's portal positioner. */
|
|
17
|
+
containsEventTarget(path: EventTarget[]): boolean;
|
|
18
|
+
updated(): void;
|
|
19
|
+
render(): TemplateResult;
|
|
20
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
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 { ContextConsumer } from "@lit/context";
|
|
11
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
12
|
+
import { popoverContext } from "./popover-context.js";
|
|
13
|
+
import { FloatingPortalController } from "@deepfuture/dui-core/floating-portal-controller";
|
|
14
|
+
import { renderArrow, } from "@deepfuture/dui-core/floating-popup-utils";
|
|
15
|
+
const hostStyles = css `
|
|
16
|
+
:host {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
/** Styles injected into the portal positioner. */
|
|
21
|
+
const portalPopupStyles = [
|
|
22
|
+
css `
|
|
23
|
+
.Popup {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
padding: var(--space-1);
|
|
26
|
+
border-radius: var(--radius-md);
|
|
27
|
+
background: var(--popover);
|
|
28
|
+
color: var(--popover-foreground);
|
|
29
|
+
font-family: var(--font-sans);
|
|
30
|
+
font-size: var(--font-size-sm);
|
|
31
|
+
line-height: var(--line-height-normal);
|
|
32
|
+
box-shadow: var(--shadow-md);
|
|
33
|
+
border: var(--border-width-thin) solid var(--border);
|
|
34
|
+
pointer-events: auto;
|
|
35
|
+
transform-origin: var(--transform-origin, center);
|
|
36
|
+
opacity: 1;
|
|
37
|
+
transform: scale(1);
|
|
38
|
+
transition-property: opacity, transform;
|
|
39
|
+
transition-duration: var(--duration-fast);
|
|
40
|
+
transition-timing-function: var(--ease-out-3);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.Popup[data-starting-style],
|
|
44
|
+
.Popup[data-ending-style] {
|
|
45
|
+
opacity: 0;
|
|
46
|
+
transform: scale(0.96);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.Popup[data-side="top"] {
|
|
50
|
+
--transform-origin: bottom center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.Popup[data-side="bottom"] {
|
|
54
|
+
--transform-origin: top center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.Arrow {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 10px;
|
|
60
|
+
height: 6px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.Arrow[data-side="top"] {
|
|
64
|
+
bottom: -5px;
|
|
65
|
+
left: 50%;
|
|
66
|
+
transform: translateX(-50%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.Arrow[data-side="bottom"] {
|
|
70
|
+
top: -5px;
|
|
71
|
+
left: 50%;
|
|
72
|
+
transform: translateX(-50%) rotate(180deg);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.Arrow .arrow-fill {
|
|
76
|
+
fill: var(--popover);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.Arrow .arrow-stroke {
|
|
80
|
+
fill: none;
|
|
81
|
+
stroke: var(--border);
|
|
82
|
+
stroke-width: 1px;
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
];
|
|
86
|
+
/**
|
|
87
|
+
* `<dui-popover-popup>` — The popover popup content container.
|
|
88
|
+
*
|
|
89
|
+
* @slot - Popover content.
|
|
90
|
+
*/
|
|
91
|
+
export class DuiPopoverPopup extends LitElement {
|
|
92
|
+
static { this.tagName = "dui-popover-popup"; }
|
|
93
|
+
static { this.styles = [base, hostStyles]; }
|
|
94
|
+
#showArrow_accessor_storage = true;
|
|
95
|
+
/** Whether to show an arrow pointing to the trigger. */
|
|
96
|
+
get showArrow() { return this.#showArrow_accessor_storage; }
|
|
97
|
+
set showArrow(value) { this.#showArrow_accessor_storage = value; }
|
|
98
|
+
#closeOnClick_accessor_storage = false;
|
|
99
|
+
/** Close the popover when content inside the popup is clicked. */
|
|
100
|
+
get closeOnClick() { return this.#closeOnClick_accessor_storage; }
|
|
101
|
+
set closeOnClick(value) { this.#closeOnClick_accessor_storage = value; }
|
|
102
|
+
#side_accessor_storage = "bottom";
|
|
103
|
+
get #side() { return this.#side_accessor_storage; }
|
|
104
|
+
set #side(value) { this.#side_accessor_storage = value; }
|
|
105
|
+
#ctx = new ContextConsumer(this, {
|
|
106
|
+
context: popoverContext,
|
|
107
|
+
subscribe: true,
|
|
108
|
+
});
|
|
109
|
+
#wasOpen = false;
|
|
110
|
+
#portal = new FloatingPortalController(this, {
|
|
111
|
+
getAnchor: () => this.#ctx.value?.triggerEl,
|
|
112
|
+
matchWidth: false,
|
|
113
|
+
placement: "bottom",
|
|
114
|
+
offset: 8,
|
|
115
|
+
styles: portalPopupStyles,
|
|
116
|
+
contentContainer: ".Content",
|
|
117
|
+
onPosition: ({ placement }) => {
|
|
118
|
+
const actualSide = placement.split("-")[0];
|
|
119
|
+
if (actualSide !== this.#side) {
|
|
120
|
+
this.#side = actualSide;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
renderPopup: (portal) => {
|
|
124
|
+
const popupId = this.#ctx.value?.popupId ?? "";
|
|
125
|
+
return html `
|
|
126
|
+
<div
|
|
127
|
+
class="Popup"
|
|
128
|
+
id="${popupId}"
|
|
129
|
+
role="dialog"
|
|
130
|
+
?data-starting-style="${portal.isStarting}"
|
|
131
|
+
?data-ending-style="${portal.isEnding}"
|
|
132
|
+
data-side="${this.#side}"
|
|
133
|
+
@click="${this.#handleContentClick}"
|
|
134
|
+
>
|
|
135
|
+
<div class="Content"></div>
|
|
136
|
+
${this.showArrow ? renderArrow(this.#side) : ""}
|
|
137
|
+
</div>
|
|
138
|
+
`;
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
/** Check if an event path includes this popup's portal positioner. */
|
|
142
|
+
containsEventTarget(path) {
|
|
143
|
+
const positioner = this.#portal.positionerElement;
|
|
144
|
+
return positioner !== null && path.includes(positioner);
|
|
145
|
+
}
|
|
146
|
+
#handleContentClick = () => {
|
|
147
|
+
if (this.closeOnClick) {
|
|
148
|
+
this.#ctx.value?.closePopover();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
updated() {
|
|
152
|
+
const isOpen = this.#ctx.value?.open ?? false;
|
|
153
|
+
if (isOpen && !this.#wasOpen) {
|
|
154
|
+
this.#updatePlacement();
|
|
155
|
+
this.#portal.open();
|
|
156
|
+
}
|
|
157
|
+
else if (!isOpen && this.#wasOpen) {
|
|
158
|
+
this.#portal.close();
|
|
159
|
+
}
|
|
160
|
+
this.#wasOpen = isOpen;
|
|
161
|
+
}
|
|
162
|
+
#updatePlacement() {
|
|
163
|
+
const side = this.#ctx.value?.side ?? "bottom";
|
|
164
|
+
this.#portal.placement = side;
|
|
165
|
+
this.#portal.offset = this.#ctx.value?.sideOffset ?? 8;
|
|
166
|
+
}
|
|
167
|
+
render() {
|
|
168
|
+
return html `<slot></slot>`;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
__decorate([
|
|
172
|
+
property({ type: Boolean, attribute: "show-arrow" })
|
|
173
|
+
], DuiPopoverPopup.prototype, "showArrow", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
property({ type: Boolean, attribute: "close-on-click" })
|
|
176
|
+
], DuiPopoverPopup.prototype, "closeOnClick", null);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-popover-trigger>` — Click-to-toggle trigger for the popover.
|
|
5
|
+
*
|
|
6
|
+
* @slot - Content that triggers the popover (usually a button).
|
|
7
|
+
*/
|
|
8
|
+
export declare class DuiPopoverTrigger extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
static tagName: "dui-popover-trigger";
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
render(): TemplateResult;
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
|
+
import { css, html, LitElement } from "lit";
|
|
3
|
+
import { ContextConsumer } from "@lit/context";
|
|
4
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
5
|
+
import { popoverContext } from "./popover-context.js";
|
|
6
|
+
const hostStyles = css `
|
|
7
|
+
:host {
|
|
8
|
+
display: contents;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
const componentStyles = css `
|
|
12
|
+
.Trigger {
|
|
13
|
+
display: contents;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
/**
|
|
17
|
+
* `<dui-popover-trigger>` — Click-to-toggle trigger for the popover.
|
|
18
|
+
*
|
|
19
|
+
* @slot - Content that triggers the popover (usually a button).
|
|
20
|
+
*/
|
|
21
|
+
export class DuiPopoverTrigger extends LitElement {
|
|
22
|
+
static { this.tagName = "dui-popover-trigger"; }
|
|
23
|
+
static { this.styles = [base, hostStyles, componentStyles]; }
|
|
24
|
+
#ctx = new ContextConsumer(this, {
|
|
25
|
+
context: popoverContext,
|
|
26
|
+
subscribe: true,
|
|
27
|
+
});
|
|
28
|
+
#handleClick = (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
this.#updateTriggerEl();
|
|
31
|
+
this.#ctx.value?.togglePopover();
|
|
32
|
+
};
|
|
33
|
+
#updateTriggerEl() {
|
|
34
|
+
const slot = this.shadowRoot?.querySelector("slot");
|
|
35
|
+
const el = slot?.assignedElements()?.[0] ?? this;
|
|
36
|
+
this.#ctx.value?.setTriggerEl(el);
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
const isOpen = this.#ctx.value?.open ?? false;
|
|
40
|
+
const popupId = this.#ctx.value?.popupId ?? "";
|
|
41
|
+
const triggerId = this.#ctx.value?.triggerId ?? "";
|
|
42
|
+
return html `
|
|
43
|
+
<span
|
|
44
|
+
class="Trigger"
|
|
45
|
+
part="trigger"
|
|
46
|
+
id="${triggerId}"
|
|
47
|
+
aria-haspopup="dialog"
|
|
48
|
+
aria-expanded="${isOpen}"
|
|
49
|
+
aria-controls="${isOpen ? popupId : ""}"
|
|
50
|
+
?data-popup-open="${isOpen}"
|
|
51
|
+
@click="${this.#handleClick}"
|
|
52
|
+
>
|
|
53
|
+
<slot></slot>
|
|
54
|
+
</span>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
|
+
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
3
|
+
import { type PopoverSide } from "./popover-context.js";
|
|
4
|
+
export type PopoverOpenChangeDetail = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const openChangeEvent: (detail: PopoverOpenChangeDetail) => CustomEvent<PopoverOpenChangeDetail>;
|
|
8
|
+
/**
|
|
9
|
+
* `<dui-popover>` — A popover root that provides context for trigger and popup.
|
|
10
|
+
*
|
|
11
|
+
* @slot - Default slot for dui-popover-trigger and dui-popover-popup.
|
|
12
|
+
* @fires open-change - Dispatched when the popover opens or closes.
|
|
13
|
+
*/
|
|
14
|
+
export declare class DuiPopover extends LitElement {
|
|
15
|
+
#private;
|
|
16
|
+
static tagName: "dui-popover";
|
|
17
|
+
static styles: import("lit").CSSResult[];
|
|
18
|
+
/** Controlled open state. */
|
|
19
|
+
accessor open: boolean;
|
|
20
|
+
/** Default open state for uncontrolled usage. */
|
|
21
|
+
accessor defaultOpen: boolean;
|
|
22
|
+
/** Which side of the trigger the popover appears on. */
|
|
23
|
+
accessor side: PopoverSide;
|
|
24
|
+
/** Offset from the trigger in pixels. */
|
|
25
|
+
accessor sideOffset: number;
|
|
26
|
+
connectedCallback(): void;
|
|
27
|
+
disconnectedCallback(): void;
|
|
28
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
29
|
+
render(): TemplateResult;
|
|
30
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
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 { base } from "@deepfuture/dui-core/base";
|
|
11
|
+
import { customEvent } from "@deepfuture/dui-core/event";
|
|
12
|
+
export const openChangeEvent = customEvent("open-change", { bubbles: true, composed: true });
|
|
13
|
+
const hostStyles = css `
|
|
14
|
+
:host {
|
|
15
|
+
display: contents;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
/**
|
|
19
|
+
* `<dui-popover>` — A popover root that provides context for trigger and popup.
|
|
20
|
+
*
|
|
21
|
+
* @slot - Default slot for dui-popover-trigger and dui-popover-popup.
|
|
22
|
+
* @fires open-change - Dispatched when the popover opens or closes.
|
|
23
|
+
*/
|
|
24
|
+
export class DuiPopover extends LitElement {
|
|
25
|
+
static { this.tagName = "dui-popover"; }
|
|
26
|
+
static { this.styles = [base, hostStyles]; }
|
|
27
|
+
#open_accessor_storage = false;
|
|
28
|
+
/** Controlled open state. */
|
|
29
|
+
get open() { return this.#open_accessor_storage; }
|
|
30
|
+
set open(value) { this.#open_accessor_storage = value; }
|
|
31
|
+
#defaultOpen_accessor_storage = false;
|
|
32
|
+
/** Default open state for uncontrolled usage. */
|
|
33
|
+
get defaultOpen() { return this.#defaultOpen_accessor_storage; }
|
|
34
|
+
set defaultOpen(value) { this.#defaultOpen_accessor_storage = value; }
|
|
35
|
+
#side_accessor_storage = "bottom";
|
|
36
|
+
/** Which side of the trigger the popover appears on. */
|
|
37
|
+
get side() { return this.#side_accessor_storage; }
|
|
38
|
+
set side(value) { this.#side_accessor_storage = value; }
|
|
39
|
+
#sideOffset_accessor_storage = 8;
|
|
40
|
+
/** Offset from the trigger in pixels. */
|
|
41
|
+
get sideOffset() { return this.#sideOffset_accessor_storage; }
|
|
42
|
+
set sideOffset(value) { this.#sideOffset_accessor_storage = value; }
|
|
43
|
+
#internalOpen_accessor_storage = false;
|
|
44
|
+
get #internalOpen() { return this.#internalOpen_accessor_storage; }
|
|
45
|
+
set #internalOpen(value) { this.#internalOpen_accessor_storage = value; }
|
|
46
|
+
#triggerEl_accessor_storage;
|
|
47
|
+
get #triggerEl() { return this.#triggerEl_accessor_storage; }
|
|
48
|
+
set #triggerEl(value) { this.#triggerEl_accessor_storage = value; }
|
|
49
|
+
get #isOpen() {
|
|
50
|
+
return this.open || this.#internalOpen;
|
|
51
|
+
}
|
|
52
|
+
#triggerId = `popover-trigger-${crypto.randomUUID().slice(0, 8)}`;
|
|
53
|
+
#popupId = `popover-popup-${crypto.randomUUID().slice(0, 8)}`;
|
|
54
|
+
#ctx_accessor_storage = {
|
|
55
|
+
open: false,
|
|
56
|
+
triggerId: this.#triggerId,
|
|
57
|
+
popupId: this.#popupId,
|
|
58
|
+
side: "bottom",
|
|
59
|
+
sideOffset: 8,
|
|
60
|
+
triggerEl: undefined,
|
|
61
|
+
openPopover: () => this.#doOpen(),
|
|
62
|
+
closePopover: () => this.#doClose(),
|
|
63
|
+
togglePopover: () => this.#doToggle(),
|
|
64
|
+
setTriggerEl: (el) => this.#setTriggerEl(el),
|
|
65
|
+
};
|
|
66
|
+
get #ctx() { return this.#ctx_accessor_storage; }
|
|
67
|
+
set #ctx(value) { this.#ctx_accessor_storage = value; }
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
super.connectedCallback();
|
|
70
|
+
if (this.defaultOpen) {
|
|
71
|
+
this.#internalOpen = true;
|
|
72
|
+
}
|
|
73
|
+
document.addEventListener("keydown", this.#onDocumentKeyDown);
|
|
74
|
+
}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
super.disconnectedCallback();
|
|
77
|
+
document.removeEventListener("keydown", this.#onDocumentKeyDown);
|
|
78
|
+
}
|
|
79
|
+
willUpdate(changed) {
|
|
80
|
+
if (changed.has("open") ||
|
|
81
|
+
changed.has("side") ||
|
|
82
|
+
changed.has("sideOffset") ||
|
|
83
|
+
this.#ctx.open !== this.#isOpen ||
|
|
84
|
+
this.#ctx.triggerEl !== this.#triggerEl) {
|
|
85
|
+
this.#ctx = {
|
|
86
|
+
...this.#ctx,
|
|
87
|
+
open: this.#isOpen,
|
|
88
|
+
side: this.side,
|
|
89
|
+
sideOffset: this.sideOffset,
|
|
90
|
+
triggerEl: this.#triggerEl,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
#onDocumentKeyDown = (event) => {
|
|
95
|
+
if (!this.#isOpen)
|
|
96
|
+
return;
|
|
97
|
+
if (event.key === "Escape") {
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
this.#doClose();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
#doOpen() {
|
|
103
|
+
if (this.#internalOpen)
|
|
104
|
+
return;
|
|
105
|
+
this.#internalOpen = true;
|
|
106
|
+
this.dispatchEvent(openChangeEvent({ open: true }));
|
|
107
|
+
}
|
|
108
|
+
#doClose() {
|
|
109
|
+
if (!this.#internalOpen)
|
|
110
|
+
return;
|
|
111
|
+
this.#internalOpen = false;
|
|
112
|
+
this.dispatchEvent(openChangeEvent({ open: false }));
|
|
113
|
+
}
|
|
114
|
+
#doToggle() {
|
|
115
|
+
if (this.#isOpen) {
|
|
116
|
+
this.#doClose();
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.#doOpen();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
#setTriggerEl(el) {
|
|
123
|
+
this.#triggerEl = el;
|
|
124
|
+
}
|
|
125
|
+
render() {
|
|
126
|
+
return html `<slot></slot>`;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
__decorate([
|
|
130
|
+
property({ type: Boolean, reflect: true })
|
|
131
|
+
], DuiPopover.prototype, "open", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
property({ type: Boolean, attribute: "default-open" })
|
|
134
|
+
], DuiPopover.prototype, "defaultOpen", null);
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ reflect: true })
|
|
137
|
+
], DuiPopover.prototype, "side", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Number, attribute: "side-offset" })
|
|
140
|
+
], DuiPopover.prototype, "sideOffset", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DuiPopover } from "./popover.js";
|
|
2
|
+
import { DuiPopoverTrigger } from "./popover-trigger.js";
|
|
3
|
+
import { DuiPopoverPopup } from "./popover-popup.js";
|
|
4
|
+
import { DuiPopoverClose } from "./popover-close.js";
|
|
5
|
+
if (!customElements.get(DuiPopover.tagName)) {
|
|
6
|
+
customElements.define(DuiPopover.tagName, DuiPopover);
|
|
7
|
+
}
|
|
8
|
+
if (!customElements.get(DuiPopoverTrigger.tagName)) {
|
|
9
|
+
customElements.define(DuiPopoverTrigger.tagName, DuiPopoverTrigger);
|
|
10
|
+
}
|
|
11
|
+
if (!customElements.get(DuiPopoverPopup.tagName)) {
|
|
12
|
+
customElements.define(DuiPopoverPopup.tagName, DuiPopoverPopup);
|
|
13
|
+
}
|
|
14
|
+
if (!customElements.get(DuiPopoverClose.tagName)) {
|
|
15
|
+
customElements.define(DuiPopoverClose.tagName, DuiPopoverClose);
|
|
16
|
+
}
|
package/portal/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiPortal } from "./portal.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/portal */
|
|
2
|
+
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
3
|
+
export type QueryRoot = "shadow" | "document";
|
|
4
|
+
/**
|
|
5
|
+
* `<dui-portal>` — Teleports light DOM children to a target container.
|
|
6
|
+
*
|
|
7
|
+
* Children are moved back into the portal when the element disconnects,
|
|
8
|
+
* allowing the portal and its children to be moved or garbage-collected
|
|
9
|
+
* correctly.
|
|
10
|
+
*
|
|
11
|
+
* @slot - Content to teleport.
|
|
12
|
+
* @attr {string} target - CSS selector for the destination container (default: "body").
|
|
13
|
+
* @attr {"shadow" | "document"} target-root - Where to resolve the target selector.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DuiPortal extends LitElement {
|
|
16
|
+
#private;
|
|
17
|
+
static tagName: "dui-portal";
|
|
18
|
+
static styles: import("lit").CSSResult[];
|
|
19
|
+
/** CSS selector for the destination container. */
|
|
20
|
+
accessor target: string;
|
|
21
|
+
/** Where to resolve the target selector: "document" (default) or "shadow". */
|
|
22
|
+
accessor targetRoot: QueryRoot;
|
|
23
|
+
/** Direct element reference for cross-shadow-root targets. Takes precedence over `target` selector. */
|
|
24
|
+
accessor targetElement: HTMLElement | undefined;
|
|
25
|
+
connectedCallback(): void;
|
|
26
|
+
disconnectedCallback(): void;
|
|
27
|
+
protected updated(changed: PropertyValues): void;
|
|
28
|
+
render(): TemplateResult;
|
|
29
|
+
}
|