UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

246 lines (245 loc) 8.91 kB
/*! * KoliBri - The accessible HTML-Standard */ import { h } from "@stencil/core"; import { KolDialogWcTag } from "../../core/component-names"; export class KolModal { constructor() { this.catchRef = (ref) => { this.dialogRef = ref; }; this._width = '100%'; this._variant = 'blank'; } openModal() { return this.showModal(); } showModal() { var _a, _b; return (_b = (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.showModal()) !== null && _b !== void 0 ? _b : Promise.resolve(); } show(modal = false) { var _a, _b; return (_b = (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.show(modal)) !== null && _b !== void 0 ? _b : Promise.resolve(); } close() { var _a, _b; return (_b = (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close()) !== null && _b !== void 0 ? _b : Promise.resolve(); } closeModal() { return this.close(); } render() { return (h(KolDialogWcTag, { key: '99ab60573ded95d3aebfca05d99052c73bbb32b2', ref: this.catchRef, _label: this._label, _on: this._on, _variant: this._variant, _width: this._width }, h("slot", { key: 'dd8fc56c1757d4ebf641d796a24e228bbe432d2e' }))); } static get is() { return "kol-modal"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "default": ["./style.scss"] }; } static get styleUrls() { return { "default": ["style.css"] }; } static get properties() { return { "_label": { "type": "string", "mutable": false, "complexType": { "original": "LabelPropType", "resolved": "string", "references": { "LabelPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::LabelPropType" } } }, "required": true, "optional": false, "docs": { "tags": [], "text": "Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.)." }, "getter": false, "setter": false, "reflect": false, "attribute": "_label" }, "_on": { "type": "unknown", "mutable": false, "complexType": { "original": "KoliBriDialogEventCallbacks", "resolved": "undefined | ({ onCancel?: ((event: Event) => void) | undefined; onClose?: (() => void) | undefined; onToggle?: ((open: boolean) => void) | undefined; })", "references": { "KoliBriDialogEventCallbacks": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::KoliBriDialogEventCallbacks" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the modal callback functions." }, "getter": false, "setter": false }, "_width": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string | undefined", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the width of the modal. (max-width: 100%)" }, "getter": false, "setter": false, "reflect": false, "attribute": "_width", "defaultValue": "'100%'" }, "_variant": { "type": "string", "mutable": false, "complexType": { "original": "ModalVariantPropType", "resolved": "\"blank\" | \"card\" | undefined", "references": { "ModalVariantPropType": { "location": "import", "path": "../../schema/props/variant/modal", "id": "src/schema/props/variant/modal.ts::ModalVariantPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the variant of the modal." }, "getter": false, "setter": false, "reflect": false, "attribute": "_variant", "defaultValue": "'blank'" } }; } static get methods() { return { "openModal": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Opens the modal dialog.", "tags": [{ "name": "deprecated", "text": "Use showModal() instead." }] } }, "showModal": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Opens the dialog as a modal.", "tags": [] } }, "show": { "complexType": { "signature": "(modal?: boolean) => Promise<void>", "parameters": [{ "name": "modal", "type": "boolean", "docs": "" }], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Opens the dialog. Pass true to open as a modal dialog.", "tags": [] } }, "close": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Closes the modal dialog.", "tags": [] } }, "closeModal": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Closes the modal dialog.", "tags": [{ "name": "deprecated", "text": "Use close() instead." }] } } }; } } //# sourceMappingURL=shadow.js.map