@vverchonov/web-components 0.1.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/dist/button-DYrT530y.js +39 -0
- package/dist/button.js +2 -0
- package/dist/components/button/button-types.d.ts +2 -0
- package/dist/components/button/button.d.ts +14 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/dropdown-button/dropdown-button-types.d.ts +13 -0
- package/dist/components/dropdown-button/dropdown-button.d.ts +34 -0
- package/dist/components/dropdown-button/index.d.ts +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input-types.d.ts +2 -0
- package/dist/components/input/input.d.ts +22 -0
- package/dist/components/layouts/form/form-layout-types.d.ts +3 -0
- package/dist/components/layouts/form/form-layout.d.ts +53 -0
- package/dist/components/layouts/form/index.d.ts +2 -0
- package/dist/components/layouts/index.d.ts +3 -0
- package/dist/components/layouts/page/index.d.ts +1 -0
- package/dist/components/layouts/page/layout.d.ts +20 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu-types.d.ts +16 -0
- package/dist/components/menu/menu.d.ts +36 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/modal-types.d.ts +2 -0
- package/dist/components/modal/modal.d.ts +103 -0
- package/dist/components/selector/index.d.ts +2 -0
- package/dist/components/selector/selector-types.d.ts +19 -0
- package/dist/components/selector/selector.d.ts +56 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/table-types.d.ts +35 -0
- package/dist/components/table/table.d.ts +47 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tabs.d.ts +19 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/toggle-types.d.ts +4 -0
- package/dist/components/toggle/toggle.d.ts +15 -0
- package/dist/dropdown-button-B6XNoy4L.js +172 -0
- package/dist/dropdown-button.js +2 -0
- package/dist/form-layout-DCX8X-8-.js +140 -0
- package/dist/index.d.ts +22 -0
- package/dist/input-BVlPYqTe.js +70 -0
- package/dist/input.js +2 -0
- package/dist/layout-CYvgu_WE.js +23 -0
- package/dist/layouts.js +3 -0
- package/dist/menu-DmAFaVi5.js +248 -0
- package/dist/menu.js +2 -0
- package/dist/mock/table-data.d.ts +16 -0
- package/dist/modal-v1GlqMF_.js +174 -0
- package/dist/modal.js +2 -0
- package/dist/react/button.d.ts +2 -0
- package/dist/react/button.js +9 -0
- package/dist/react/dropdown-button.d.ts +6 -0
- package/dist/react/dropdown-button.js +10 -0
- package/dist/react/form-layout.d.ts +8 -0
- package/dist/react/form-layout.js +14 -0
- package/dist/react/index.d.ts +21 -0
- package/dist/react/input.d.ts +2 -0
- package/dist/react/input.js +9 -0
- package/dist/react/layout.d.ts +2 -0
- package/dist/react/layout.js +9 -0
- package/dist/react/menu.d.ts +7 -0
- package/dist/react/menu.js +13 -0
- package/dist/react/modal.d.ts +7 -0
- package/dist/react/modal.js +14 -0
- package/dist/react/selector.d.ts +6 -0
- package/dist/react/selector.js +10 -0
- package/dist/react/table.d.ts +8 -0
- package/dist/react/table.js +14 -0
- package/dist/react/tabs.d.ts +5 -0
- package/dist/react/tabs.js +10 -0
- package/dist/react/toggle.d.ts +6 -0
- package/dist/react/toggle.js +10 -0
- package/dist/react.js +12 -0
- package/dist/selector-Bl7Nbkqo.js +300 -0
- package/dist/selector.js +2 -0
- package/dist/styles/tailwind-base.d.ts +1 -0
- package/dist/table--O5km0Wv.js +279 -0
- package/dist/table.js +2 -0
- package/dist/tabs-C2lP0uxY.js +94 -0
- package/dist/tabs.js +2 -0
- package/dist/toggle-D6UMZ8UZ.js +59 -0
- package/dist/toggle.js +2 -0
- package/dist/vite.svg +1 -0
- package/dist/web-components.js +24 -0
- package/package.json +153 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement as e, html as t, unsafeCSS as n } from "lit";
|
|
2
|
+
import { customElement as r, property as i } from "lit/decorators.js";
|
|
3
|
+
var a = ":host{display:inline-block}button{margin:var(--button-margin-block) var(--button-margin-inline);padding:var(--button-padding-block) var(--button-padding-inline);font-size:var(--button-font-size);font-weight:var(--button-font-weight);border-radius:var(--radius-button);background:var(--color-primary);color:var(--color-text-inverse);cursor:pointer;transition:background-color var(--button-transition-duration) var(--ease-emphasized);border:none;align-items:center;display:inline-flex}button:has(.icon-wrapper:has(*)){gap:var(--button-icon-gap)}button .icon-wrapper{align-items:center;display:inline-flex}button .icon-wrapper:not(:has(*)){display:none}button.icon-start .icon-wrapper{order:0}button.icon-start .label{order:1}button.icon-end .label{order:0}button.icon-end .icon-wrapper{order:1}button:hover{background:var(--color-primary-hover)}button:focus{outline:none}";
|
|
4
|
+
function o(e, t, n, r) {
|
|
5
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
6
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
7
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
8
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
9
|
+
}
|
|
10
|
+
var s = class extends e {
|
|
11
|
+
static {
|
|
12
|
+
this.styles = [n(a)];
|
|
13
|
+
}
|
|
14
|
+
_handleClick(e) {
|
|
15
|
+
this.onClick?.(e);
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return t`
|
|
19
|
+
<button
|
|
20
|
+
type=${this.type}
|
|
21
|
+
class="icon-${this.iconPosition}"
|
|
22
|
+
@click=${this._handleClick}
|
|
23
|
+
>
|
|
24
|
+
<span class="icon-wrapper">
|
|
25
|
+
<slot name="icon"></slot>
|
|
26
|
+
</span>
|
|
27
|
+
<span class="label">${this.label}</span>
|
|
28
|
+
</button>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
constructor(...e) {
|
|
32
|
+
super(...e), this.label = "Click me", this.iconPosition = "start", this.type = "button";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
o([i({ type: String })], s.prototype, "label", void 0), o([i({
|
|
36
|
+
type: String,
|
|
37
|
+
attribute: "icon-position"
|
|
38
|
+
})], s.prototype, "iconPosition", void 0), o([i({ type: String })], s.prototype, "type", void 0), o([i({ attribute: !1 })], s.prototype, "onClick", void 0), s = o([r("app-button")], s);
|
|
39
|
+
export { s as t };
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ButtonIconPosition, ButtonType } from './button-types.ts';
|
|
3
|
+
/** Custom element name must contain a hyphen; use <app-button> in HTML. */
|
|
4
|
+
export declare class Button extends LitElement {
|
|
5
|
+
static styles: import('lit').CSSResult[];
|
|
6
|
+
label: string;
|
|
7
|
+
/** Where to show the icon: before the label (start) or after (end). */
|
|
8
|
+
iconPosition: ButtonIconPosition;
|
|
9
|
+
type: ButtonType;
|
|
10
|
+
/** Optional click handler; set via property (e.g. el.onClick = (e) => ...). */
|
|
11
|
+
onClick?: (e: MouseEvent) => void;
|
|
12
|
+
private _handleClick;
|
|
13
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
export type DropdownPlacement = 'bottom' | 'top';
|
|
3
|
+
export interface DropdownItem {
|
|
4
|
+
label: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
/** Optional per-item icon: string (icon name for slot) or TemplateResult. */
|
|
7
|
+
icon?: string | TemplateResult;
|
|
8
|
+
children?: DropdownItem[];
|
|
9
|
+
}
|
|
10
|
+
export interface DropdownSelectEventDetail {
|
|
11
|
+
item: DropdownItem;
|
|
12
|
+
value?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { DropdownItem, DropdownPlacement } from './dropdown-button-types';
|
|
3
|
+
export declare class DropdownButton extends LitElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
label: string;
|
|
6
|
+
placement: DropdownPlacement;
|
|
7
|
+
items: DropdownItem[];
|
|
8
|
+
private _open;
|
|
9
|
+
/**
|
|
10
|
+
* Tracks which parent-item paths have their inline submenus expanded.
|
|
11
|
+
* Paths use dash-separated indices, e.g. "1" for the second top-level item,
|
|
12
|
+
* "1-0" for its first child, etc.
|
|
13
|
+
* We always assign a new Set so Lit detects the change.
|
|
14
|
+
*/
|
|
15
|
+
private _openPaths;
|
|
16
|
+
connectedCallback(): void;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
private _onDocumentClick;
|
|
19
|
+
private _onDocumentKeydown;
|
|
20
|
+
private _toggle;
|
|
21
|
+
private _positionPanel;
|
|
22
|
+
/**
|
|
23
|
+
* Toggle an inline submenu open/closed.
|
|
24
|
+
* Closing a parent also removes all its descendant paths.
|
|
25
|
+
* Opening a parent closes any sibling at the same depth+parent.
|
|
26
|
+
*/
|
|
27
|
+
private _toggleSubmenu;
|
|
28
|
+
private _onTriggerKeydown;
|
|
29
|
+
private _onPanelKeydown;
|
|
30
|
+
private _onItemClick;
|
|
31
|
+
private _renderItemIcon;
|
|
32
|
+
private _renderMenu;
|
|
33
|
+
render(): TemplateResult<1>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { InputType, InputState } from './input-types.ts';
|
|
3
|
+
export declare class Input extends LitElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
private readonly _uid;
|
|
6
|
+
type: InputType;
|
|
7
|
+
label: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
value: string;
|
|
10
|
+
name: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
readonly: boolean;
|
|
14
|
+
state: InputState;
|
|
15
|
+
errorMessage: string;
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
private _hasIcon;
|
|
18
|
+
private _onIconSlotChange;
|
|
19
|
+
private _handleInput;
|
|
20
|
+
private _renderStateIcon;
|
|
21
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* app-form-layout — a configurable form shell with optional multi-step stages.
|
|
4
|
+
*
|
|
5
|
+
* Single-step usage:
|
|
6
|
+
* <app-form-layout title="Create account" description="Fill in the details below." columns="2">
|
|
7
|
+
* <app-input slot="fields" label="First name"></app-input>
|
|
8
|
+
* <app-input slot="fields" label="Last name"></app-input>
|
|
9
|
+
* </app-form-layout>
|
|
10
|
+
*
|
|
11
|
+
* Multi-step usage:
|
|
12
|
+
* <app-form-layout title="Onboarding" .stages=${['Personal', 'Address', 'Review']}>
|
|
13
|
+
* <div slot="stage-0">…step 1 fields…</div>
|
|
14
|
+
* <div slot="stage-1">…step 2 fields…</div>
|
|
15
|
+
* <div slot="stage-2">…step 3 fields…</div>
|
|
16
|
+
* </app-form-layout>
|
|
17
|
+
*
|
|
18
|
+
* Events:
|
|
19
|
+
* form-layout-next — fired when moving to the next stage
|
|
20
|
+
* form-layout-back — fired when moving to the previous stage
|
|
21
|
+
* form-layout-submit — fired when the submit button is clicked
|
|
22
|
+
*/
|
|
23
|
+
export declare class FormLayout extends LitElement {
|
|
24
|
+
static styles: import('lit').CSSResult[];
|
|
25
|
+
title: string;
|
|
26
|
+
description: string;
|
|
27
|
+
/** Number of columns for the fields grid. */
|
|
28
|
+
columns: 1 | 2 | 3;
|
|
29
|
+
/**
|
|
30
|
+
* Stage labels. When non-empty, the form renders a step indicator and
|
|
31
|
+
* Back / Next / Submit navigation buttons. The slot for each stage is
|
|
32
|
+
* `slot="stage-{index}"`.
|
|
33
|
+
*/
|
|
34
|
+
stages: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Seamless mode — strips the outer card shell (border, background, border-radius).
|
|
37
|
+
* Use when embedding inside another container such as app-modal with flush.
|
|
38
|
+
*/
|
|
39
|
+
seamless: boolean;
|
|
40
|
+
/** Active stage index (0-based). Controlled externally or managed internally. */
|
|
41
|
+
currentStage: number;
|
|
42
|
+
private _stage;
|
|
43
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
44
|
+
private get _isMultiStep();
|
|
45
|
+
private get _isLastStage();
|
|
46
|
+
private _handleBack;
|
|
47
|
+
private _handleNext;
|
|
48
|
+
private _handleSubmit;
|
|
49
|
+
private _renderStepIndicator;
|
|
50
|
+
private _renderFields;
|
|
51
|
+
private _renderActions;
|
|
52
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Layout } from './layout.ts';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* app-layout — two-column shell with a sticky sidebar and a scrollable content area.
|
|
4
|
+
*
|
|
5
|
+
* No Shadow DOM: styles are injected once into document.head and target
|
|
6
|
+
* `app-layout > [slot="sidebar"]` / `app-layout > [slot="content"]` directly.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <app-layout>
|
|
10
|
+
* <app-menu slot="sidebar" collapsed></app-menu>
|
|
11
|
+
* <main slot="content">…</main>
|
|
12
|
+
* </app-layout>
|
|
13
|
+
*
|
|
14
|
+
* The sidebar width is fixed to --menu-collapsed-width (default 3.5rem).
|
|
15
|
+
* When the menu expands on hover it overlays the content via overflow:visible
|
|
16
|
+
* on the sidebar — the content area never moves.
|
|
17
|
+
*/
|
|
18
|
+
export declare class Layout extends LitElement {
|
|
19
|
+
createRenderRoot(): HTMLElement;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
export interface MenuItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
icon?: string | TemplateResult;
|
|
6
|
+
href?: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
children?: MenuItem[];
|
|
9
|
+
}
|
|
10
|
+
export interface MenuSelectEventDetail {
|
|
11
|
+
item: MenuItem;
|
|
12
|
+
value: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface MenuSearchEventDetail {
|
|
15
|
+
query: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { MenuItem } from './menu-types';
|
|
3
|
+
export declare class Menu extends LitElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
items: MenuItem[];
|
|
6
|
+
footerItems: MenuItem[];
|
|
7
|
+
searchable: boolean;
|
|
8
|
+
searchPlaceholder: string;
|
|
9
|
+
activeValue?: string;
|
|
10
|
+
/**
|
|
11
|
+
* When true the menu renders in semi-open (icon-only) mode by default.
|
|
12
|
+
* Hovering the component temporarily expands it to full width.
|
|
13
|
+
*/
|
|
14
|
+
collapsed: boolean;
|
|
15
|
+
private _openPaths;
|
|
16
|
+
private _searchQuery;
|
|
17
|
+
private _hoverExpanded;
|
|
18
|
+
private _bottomSlotPopulated;
|
|
19
|
+
private get _isCollapsed();
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
updated(): void;
|
|
23
|
+
private _itemContainsActiveValue;
|
|
24
|
+
private _getPathToActiveValue;
|
|
25
|
+
private _onBottomSlotChange;
|
|
26
|
+
private _onMouseEnter;
|
|
27
|
+
private _onMouseLeave;
|
|
28
|
+
private _toggleSubmenu;
|
|
29
|
+
private _onItemClick;
|
|
30
|
+
private _onSearchInput;
|
|
31
|
+
private _onNavKeydown;
|
|
32
|
+
private _renderItemIcon;
|
|
33
|
+
private _renderItems;
|
|
34
|
+
private _renderMenu;
|
|
35
|
+
render(): TemplateResult<1>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ModalVariant, ModalSize } from './modal-types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* app-modal — a configurable dialog for info, confirm, form, and custom use-cases.
|
|
5
|
+
*
|
|
6
|
+
* Info (single OK button):
|
|
7
|
+
* <app-modal open title="Note" description="Saved." variant="info"></app-modal>
|
|
8
|
+
*
|
|
9
|
+
* Confirm (two buttons):
|
|
10
|
+
* <app-modal open title="Delete?" description="Cannot be undone." variant="confirm"></app-modal>
|
|
11
|
+
*
|
|
12
|
+
* Form (two buttons + slotted content):
|
|
13
|
+
* <app-modal open title="Edit profile" variant="form">
|
|
14
|
+
* <app-input label="Name"></app-input>
|
|
15
|
+
* </app-modal>
|
|
16
|
+
*
|
|
17
|
+
* Custom footer buttons (footer slot replaces built-in actions):
|
|
18
|
+
* <app-modal open title="Request">
|
|
19
|
+
* <app-input label="Subject"></app-input>
|
|
20
|
+
* <div slot="footer">
|
|
21
|
+
* <app-button label="Save draft"></app-button>
|
|
22
|
+
* <app-button label="Submit"></app-button>
|
|
23
|
+
* </div>
|
|
24
|
+
* </app-modal>
|
|
25
|
+
*
|
|
26
|
+
* Embedded multi-step form (hide-actions + flush + seamless form-layout):
|
|
27
|
+
* <app-modal open title="Create account" hide-actions flush size="lg">
|
|
28
|
+
* <app-form-layout seamless .stages=${[…]}>…</app-form-layout>
|
|
29
|
+
* </app-modal>
|
|
30
|
+
*
|
|
31
|
+
* Events:
|
|
32
|
+
* modal-confirm — primary action (Save / Confirm / OK) clicked
|
|
33
|
+
* modal-cancel — secondary action (Cancel) clicked
|
|
34
|
+
* modal-close — any close action (Escape, backdrop, OK, Confirm, Cancel)
|
|
35
|
+
*/
|
|
36
|
+
export declare class Modal extends LitElement {
|
|
37
|
+
static styles: import('lit').CSSResult[];
|
|
38
|
+
/** Whether the modal is visible. Reflect so CSS :host([open]) works. */
|
|
39
|
+
open: boolean;
|
|
40
|
+
/** Dialog heading. */
|
|
41
|
+
title: string;
|
|
42
|
+
/** Subtitle / body text shown below the title (optional). */
|
|
43
|
+
description: string;
|
|
44
|
+
/**
|
|
45
|
+
* Controls the built-in button layout:
|
|
46
|
+
* - `info` → single OK button
|
|
47
|
+
* - `confirm` → Cancel + Confirm
|
|
48
|
+
* - `form` → Cancel + Save
|
|
49
|
+
*/
|
|
50
|
+
variant: ModalVariant;
|
|
51
|
+
/**
|
|
52
|
+
* Dialog width:
|
|
53
|
+
* - `sm` → 24rem
|
|
54
|
+
* - `md` → 32rem (default, uses --modal-width token)
|
|
55
|
+
* - `lg` → 44rem (good for multi-step forms)
|
|
56
|
+
*/
|
|
57
|
+
size: ModalSize;
|
|
58
|
+
/** Label for the primary action button. Defaults to variant-appropriate text. */
|
|
59
|
+
confirmLabel: string;
|
|
60
|
+
/** Label for the cancel button. */
|
|
61
|
+
cancelLabel: string;
|
|
62
|
+
/** Label for the OK button (info variant only). */
|
|
63
|
+
okLabel: string;
|
|
64
|
+
/** Close the modal when the backdrop is clicked. */
|
|
65
|
+
closeOnBackdrop: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Hide the built-in footer (divider + action buttons).
|
|
68
|
+
* Use when the slotted content manages its own actions (e.g. app-form-layout).
|
|
69
|
+
* Has no effect when the `footer` slot is populated — the slot always shows.
|
|
70
|
+
*/
|
|
71
|
+
hideActions: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Remove body padding so slotted content fills edge-to-edge.
|
|
74
|
+
* Pair with `seamless` on app-form-layout for a clean embedded form.
|
|
75
|
+
*/
|
|
76
|
+
flush: boolean;
|
|
77
|
+
/** True when the named `footer` slot has slotted content. */
|
|
78
|
+
private _hasFooterContent;
|
|
79
|
+
private _dialog;
|
|
80
|
+
/** The element that had focus before the modal opened — restored on close. */
|
|
81
|
+
private _previousFocus;
|
|
82
|
+
updated(changed: Map<string, unknown>): void;
|
|
83
|
+
connectedCallback(): void;
|
|
84
|
+
disconnectedCallback(): void;
|
|
85
|
+
private _handleKeydown;
|
|
86
|
+
private _focusableSelectors;
|
|
87
|
+
private _getFocusable;
|
|
88
|
+
private _focusFirst;
|
|
89
|
+
private _trapFocus;
|
|
90
|
+
private _handleBackdropClick;
|
|
91
|
+
private _close;
|
|
92
|
+
private _handleConfirm;
|
|
93
|
+
private _handleCancel;
|
|
94
|
+
private get _resolvedConfirmLabel();
|
|
95
|
+
private _onFooterSlotChange;
|
|
96
|
+
private _renderBuiltInActions;
|
|
97
|
+
/**
|
|
98
|
+
* Whether the footer area (divider + buttons) should be visible at all.
|
|
99
|
+
* Hidden only when hide-actions=true AND the footer slot has no content.
|
|
100
|
+
*/
|
|
101
|
+
private get _showFooter();
|
|
102
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
103
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
export type SelectorState = 'default' | 'valid' | 'invalid';
|
|
3
|
+
export interface SelectorOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
/** Optional per-item icon: string (icon name for slot) or TemplateResult. */
|
|
7
|
+
icon?: string | TemplateResult;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Group key — matches `SelectorGroup.key` for visual grouping. */
|
|
10
|
+
group?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SelectorGroup {
|
|
13
|
+
key: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SelectorChangeEventDetail {
|
|
17
|
+
/** Selected values. Always an array (single-select wraps in a one-element array). */
|
|
18
|
+
value: string[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SelectorOption, SelectorGroup, SelectorState } from './selector-types';
|
|
3
|
+
export declare class Selector extends LitElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
private readonly _uid;
|
|
6
|
+
items: SelectorOption[];
|
|
7
|
+
groups: SelectorGroup[];
|
|
8
|
+
value: string[];
|
|
9
|
+
label: string;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
searchable: boolean;
|
|
12
|
+
multiple: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
name: string;
|
|
15
|
+
state: SelectorState;
|
|
16
|
+
errorMessage: string;
|
|
17
|
+
private _open;
|
|
18
|
+
private _search;
|
|
19
|
+
private _focusedIndex;
|
|
20
|
+
private _liveMessage;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
private get _filteredItems();
|
|
24
|
+
private _isSelected;
|
|
25
|
+
private _getOptionById;
|
|
26
|
+
/**
|
|
27
|
+
* Returns filtered items organized by group.
|
|
28
|
+
* Ungrouped items come first, then each group in the order defined by `this.groups`.
|
|
29
|
+
*/
|
|
30
|
+
private _getGroupedItems;
|
|
31
|
+
/**
|
|
32
|
+
* Flat list of visible option values (for keyboard index tracking).
|
|
33
|
+
* Skips disabled items.
|
|
34
|
+
*/
|
|
35
|
+
private get _navigableValues();
|
|
36
|
+
private _select;
|
|
37
|
+
private _deselect;
|
|
38
|
+
private _dispatchChange;
|
|
39
|
+
private _announceLive;
|
|
40
|
+
private _toggle;
|
|
41
|
+
private _openPanel;
|
|
42
|
+
private _close;
|
|
43
|
+
private _positionPanel;
|
|
44
|
+
private _onDocumentClick;
|
|
45
|
+
private _onDocumentKeydown;
|
|
46
|
+
private _onTriggerKeydown;
|
|
47
|
+
private _onPanelKeydown;
|
|
48
|
+
private _scrollToFocused;
|
|
49
|
+
private _onSearchInput;
|
|
50
|
+
private _onChipRemove;
|
|
51
|
+
private _renderOptionIcon;
|
|
52
|
+
private _renderChipIcon;
|
|
53
|
+
private _renderTriggerContent;
|
|
54
|
+
private _renderOptions;
|
|
55
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
export interface ColumnDef<T = Record<string, unknown>> {
|
|
3
|
+
/** Unique key — matched against row object properties for default text rendering. */
|
|
4
|
+
key: string;
|
|
5
|
+
/** Column header label. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** When set, columns sharing the same group string are merged under a group header row. */
|
|
8
|
+
group?: string;
|
|
9
|
+
/** Adds a clickable sort indicator in the header. */
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
/** Start hidden; the user can reveal it via the column-toggle panel. */
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
/** Fixed column width, e.g. '200px'. Omit for auto. */
|
|
14
|
+
width?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Custom cell renderer. Return a Lit TemplateResult (or any renderable value).
|
|
17
|
+
* The result is rendered directly inside the table's Shadow DOM — no extra
|
|
18
|
+
* shadow root per cell.
|
|
19
|
+
*/
|
|
20
|
+
renderCell?: (row: T, rowIndex: number) => TemplateResult | unknown;
|
|
21
|
+
}
|
|
22
|
+
export type SortDir = 'asc' | 'desc';
|
|
23
|
+
export interface TableSortEvent {
|
|
24
|
+
column: string;
|
|
25
|
+
dir: SortDir;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
}
|
|
28
|
+
export interface TablePageEvent {
|
|
29
|
+
page: number;
|
|
30
|
+
pageSize: number;
|
|
31
|
+
}
|
|
32
|
+
export interface TableColumnToggleEvent {
|
|
33
|
+
column: string;
|
|
34
|
+
hidden: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ColumnDef } from './table-types';
|
|
3
|
+
export declare class Table extends LitElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
columns: ColumnDef<any>[];
|
|
6
|
+
rows: Record<string, unknown>[];
|
|
7
|
+
/** If > 0, enables pagination with this many rows per page. */
|
|
8
|
+
pageSize: number;
|
|
9
|
+
/**
|
|
10
|
+
* Total number of items across all pages. When > 0 (with pageSize > 0),
|
|
11
|
+
* the table enters server-side pagination mode: `rows` is treated as the
|
|
12
|
+
* current page's data and no local slicing is performed.
|
|
13
|
+
*/
|
|
14
|
+
totalItems: number;
|
|
15
|
+
/** Current page (1-based). Can be set externally to navigate programmatically. */
|
|
16
|
+
page: number;
|
|
17
|
+
/** Shows a loading overlay on the table body while data is being fetched. */
|
|
18
|
+
loading: boolean;
|
|
19
|
+
/** When true, sorting is not performed locally — only the `table-sort` event fires. */
|
|
20
|
+
externalSort: boolean;
|
|
21
|
+
/** Show the column visibility toggle panel. */
|
|
22
|
+
showColumnToggle: boolean;
|
|
23
|
+
private _hiddenCols;
|
|
24
|
+
private _sortCol;
|
|
25
|
+
private _sortDir;
|
|
26
|
+
private _togglePanelOpen;
|
|
27
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
28
|
+
private get _visibleCols();
|
|
29
|
+
private get _hasGroups();
|
|
30
|
+
private get _hasPagination();
|
|
31
|
+
private get _isServerPagination();
|
|
32
|
+
private get _sortedRows();
|
|
33
|
+
private get _pagedRows();
|
|
34
|
+
private get _totalPages();
|
|
35
|
+
private _dispatchSort;
|
|
36
|
+
private _dispatchPage;
|
|
37
|
+
private _dispatchColumnToggle;
|
|
38
|
+
private _handleSortClick;
|
|
39
|
+
private _handleToggleColumn;
|
|
40
|
+
private _handlePageChange;
|
|
41
|
+
private _renderColumnToggle;
|
|
42
|
+
private _renderGroupRow;
|
|
43
|
+
private _renderHeaderRow;
|
|
44
|
+
private _renderRows;
|
|
45
|
+
private _renderPagination;
|
|
46
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface TabItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TabChangeEventDetail {
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class Tabs extends LitElement {
|
|
11
|
+
static styles: import('lit').CSSResult[];
|
|
12
|
+
tabs: TabItem[];
|
|
13
|
+
value: string;
|
|
14
|
+
onChange?: (e: CustomEvent<TabChangeEventDetail>) => void;
|
|
15
|
+
private _selectTab;
|
|
16
|
+
private _handleKeydown;
|
|
17
|
+
private _activeValue;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ToggleIconPosition, ToggleChangeEventDetail } from './toggle-types';
|
|
3
|
+
/** Custom element name must contain a hyphen; use <app-toggle> in HTML. */
|
|
4
|
+
export declare class Toggle extends LitElement {
|
|
5
|
+
static styles: import('lit').CSSResult[];
|
|
6
|
+
checked: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
/** Where to show the icon: before the label (start) or after (end). */
|
|
10
|
+
iconPosition: ToggleIconPosition;
|
|
11
|
+
/** Optional change handler; set via property (e.g. el.onChange = (e) => ...). */
|
|
12
|
+
onChange?: (e: CustomEvent<ToggleChangeEventDetail>) => void;
|
|
13
|
+
private _handleClick;
|
|
14
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
15
|
+
}
|