dap-design-system
Version:
Official design system for the DÁP (dap.gov.hu)
78 lines (77 loc) • 3.07 kB
TypeScript
import { PropertyValueMap, LitElement } from 'lit';
import { EventOptions } from './event';
export declare class DdsElement extends LitElement {
/**
* The custom element tag name for this component (e.g. `dap-ds-button`).
* Each component sets this; `define()` uses it as the default name and the
* Custom Elements Manifest analyzer reads it to recover the tag.
*/
static tagName: string;
/**
* Other DDS components this element renders internally. They are registered
* automatically (guarded) the first time this element is constructed, so a
* per-component import brings its own dependencies without the consumer
* having to register them by hand.
*/
static dependencies: Record<string, typeof DdsElement>;
/**
* Registers this component as a custom element. Safe to call repeatedly and
* across bundles: if the tag is already defined it is a no-op (warning on a
* different constructor) instead of throwing like `customElements.define`.
*/
static define(name?: string, ctor?: CustomElementConstructor, options?: ElementDefinitionOptions): void;
constructor();
/**
* Accessible label for the element. Use this to provide a text alternative
* for elements that don't have visible text content.
* @group Accessibility
*/
ariaLabel: string | null;
/**
* Indicates whether the element is expanded or collapsed.
* @type { 'true' | 'false' }
* @group Accessibility
*/
ariaExpanded: string | null;
/**
* Identifies the element that is controlled by this element.
* @group Accessibility
*/
ariaControls: string | null;
/**
* Indicates the availability and type of interactive popup element.
* @group Accessibility
*/
ariaHasPopup: string | null;
/**
* Identifies the element that describes the current element.
* @group Accessibility
*/
ariaDescribedBy: string | null;
/**
* Indicates the current "pressed" state of toggle buttons.
* @type { 'true' | 'false' | 'mixed' }
* @group Accessibility
*/
ariaPressed: string | null;
/**
* Indicates whether the element is hidden from accessibility APIs.
* @type { 'true' | 'false' }
* @group Accessibility
*/
ariaHidden: string | null;
/**
* Custom CSS text to be merged with the component's styles.
* This CSS will be injected into the shadow DOM and merged with the component's static styles.
* @example
* ```html
* <dap-ds-spinner custom-styles=".spinner { border: 2px solid red; }"></dap-ds-spinner>
* ```
*/
customStyles?: string;
private _customStyleSheet?;
emit<V = Record<PropertyKey, any>>(name: string, value?: V, options?: EventOptions): CustomEvent<V>;
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
protected updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
private _updateCustomStyles;
}