UNPKG

@public-ui/components

Version:

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

543 lines (542 loc) 21.4 kB
/*! * KoliBri - The accessible HTML-Standard */ import { __decorate } from "tslib"; import { h } from "@stencil/core"; import { KolPopoverButtonWcTag } from "../../core/component-names"; import { createCtaRef, delegateClick, delegateFocus } from "../../utils/element-interaction"; export class KolPopoverButton { constructor() { this.ctaRef = createCtaRef(); this._disabled = false; this._hideLabel = false; this._inline = false; this._popoverAlign = 'bottom'; this._tooltipAlign = 'top'; this._type = 'button'; this._variant = 'normal'; } async hidePopover() { var _a; void ((_a = this.ctaRef.el) === null || _a === void 0 ? void 0 : _a.hidePopover()); } async showPopover() { var _a; void ((_a = this.ctaRef.el) === null || _a === void 0 ? void 0 : _a.showPopover()); } async click() { } async focus() { } render() { return (h(KolPopoverButtonWcTag, { key: 'b394838d1b5f29df382e4652673bfb42b7930853', ref: this.ctaRef, _accessKey: this._accessKey, _ariaDescription: this._ariaDescription, _customClass: this._customClass, _disabled: this._disabled, _hideLabel: this._hideLabel, _icons: this._icons, _inline: this._inline, _label: this._label, _name: this._name, _popoverAlign: this._popoverAlign, _shortKey: this._shortKey, _syncValueBySelector: this._syncValueBySelector, _tabIndex: this._tabIndex, _tooltipAlign: this._tooltipAlign, _type: this._type, _value: this._value, _variant: this._variant }, h("slot", { key: '094e5e4a91dc18375d778ab155431fec1b50d7ea', name: "expert", slot: "expert" }), h("slot", { key: '9e2a314b243ac3360cf1411f8cf747b4a7d345d7' }))); } static get is() { return "kol-popover-button"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "default": ["./style.scss"] }; } static get styleUrls() { return { "default": ["style.css"] }; } static get properties() { return { "_accessKey": { "type": "string", "mutable": false, "complexType": { "original": "AccessKeyPropType", "resolved": "string | undefined", "references": { "AccessKeyPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::AccessKeyPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the key combination that can be used to trigger or focus the component's interactive element." }, "getter": false, "setter": false, "reflect": false, "attribute": "_access-key" }, "_ariaDescription": { "type": "string", "mutable": false, "complexType": { "original": "AriaDescriptionPropType", "resolved": "string | undefined", "references": { "AriaDescriptionPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::AriaDescriptionPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the value for the aria-description attribute." }, "getter": false, "setter": false, "reflect": false, "attribute": "_aria-description" }, "_customClass": { "type": "string", "mutable": false, "complexType": { "original": "CustomClassPropType", "resolved": "string | undefined", "references": { "CustomClassPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::CustomClassPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the custom class attribute if _variant=\"custom\" is set." }, "getter": false, "setter": false, "reflect": false, "attribute": "_custom-class" }, "_disabled": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean | undefined", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Makes the element not focusable and ignore all events." }, "getter": false, "setter": false, "reflect": false, "attribute": "_disabled", "defaultValue": "false" }, "_hideLabel": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean | undefined", "references": {} }, "required": false, "optional": true, "docs": { "tags": [{ "name": "TODO", "text": ": Change type back to `HideLabelPropType` after Stencil#4663 has been resolved." }], "text": "Hides the caption by default and displays the caption text with a tooltip when the\ninteractive element is focused or the mouse is over it." }, "getter": false, "setter": false, "reflect": false, "attribute": "_hide-label", "defaultValue": "false" }, "_icons": { "type": "string", "mutable": false, "complexType": { "original": "IconsPropType", "resolved": "KoliBriHorizontalIcons & KoliBriVerticalIcons | string | undefined", "references": { "IconsPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::IconsPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the icon classnames (e.g. `_icons=\"fa-solid fa-user\"`)." }, "getter": false, "setter": false, "reflect": false, "attribute": "_icons" }, "_inline": { "type": "boolean", "mutable": false, "complexType": { "original": "InlinePropType", "resolved": "boolean | undefined", "references": { "InlinePropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::InlinePropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines whether the component is displayed as a standalone block or inline without enforcing a minimum size of 44px." }, "getter": false, "setter": false, "reflect": false, "attribute": "_inline", "defaultValue": "false" }, "_label": { "type": "string", "mutable": false, "complexType": { "original": "LabelWithExpertSlotPropType", "resolved": "string", "references": { "LabelWithExpertSlotPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::LabelWithExpertSlotPropType" } } }, "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.). Set to `false` to enable the expert slot." }, "getter": false, "setter": false, "reflect": false, "attribute": "_label" }, "_name": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string | undefined", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the technical name of an input field." }, "getter": false, "setter": false, "reflect": false, "attribute": "_name" }, "_popoverAlign": { "type": "string", "mutable": false, "complexType": { "original": "PopoverAlignPropType", "resolved": "\"bottom\" | \"left\" | \"right\" | \"top\" | undefined", "references": { "PopoverAlignPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::PopoverAlignPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines where to show the Popover preferably: top, right, bottom or left." }, "getter": false, "setter": false, "reflect": false, "attribute": "_popover-align", "defaultValue": "'bottom'" }, "_shortKey": { "type": "string", "mutable": false, "complexType": { "original": "ShortKeyPropType", "resolved": "string | undefined", "references": { "ShortKeyPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::ShortKeyPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Adds a visual shortcut hint after the label and instructs the screen reader to read the shortcut aloud." }, "getter": false, "setter": false, "reflect": false, "attribute": "_short-key" }, "_syncValueBySelector": { "type": "string", "mutable": false, "complexType": { "original": "SyncValueBySelectorPropType", "resolved": "string | undefined", "references": { "SyncValueBySelectorPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::SyncValueBySelectorPropType" } } }, "required": false, "optional": true, "docs": { "tags": [{ "name": "internal", "text": undefined }], "text": "Selector for synchronizing the value with another input element." }, "getter": false, "setter": false, "reflect": false, "attribute": "_sync-value-by-selector" }, "_tabIndex": { "type": "number", "mutable": false, "complexType": { "original": "number", "resolved": "number | undefined", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)" }, "getter": false, "setter": false, "reflect": false, "attribute": "_tab-index" }, "_tooltipAlign": { "type": "string", "mutable": false, "complexType": { "original": "TooltipAlignPropType", "resolved": "\"bottom\" | \"left\" | \"right\" | \"top\" | undefined", "references": { "TooltipAlignPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::TooltipAlignPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines where to show the Tooltip preferably: top, right, bottom or left." }, "getter": false, "setter": false, "reflect": false, "attribute": "_tooltip-align", "defaultValue": "'top'" }, "_type": { "type": "string", "mutable": false, "complexType": { "original": "ButtonTypePropType", "resolved": "\"button\" | \"reset\" | \"submit\" | undefined", "references": { "ButtonTypePropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::ButtonTypePropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines either the type of the component or of the components interactive element." }, "getter": false, "setter": false, "reflect": false, "attribute": "_type", "defaultValue": "'button'" }, "_value": { "type": "any", "mutable": false, "complexType": { "original": "StencilUnknown", "resolved": "boolean | null | number | object | string | undefined", "references": { "StencilUnknown": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::StencilUnknown" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines the value of the element." }, "getter": false, "setter": false, "reflect": false, "attribute": "_value" }, "_variant": { "type": "string", "mutable": false, "complexType": { "original": "ButtonVariantPropType", "resolved": "\"custom\" | \"danger\" | \"ghost\" | \"normal\" | \"primary\" | \"secondary\" | \"tertiary\" | undefined", "references": { "ButtonVariantPropType": { "location": "import", "path": "../../schema", "id": "src/schema/index.ts::ButtonVariantPropType" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Defines which variant should be used for presentation." }, "getter": false, "setter": false, "reflect": false, "attribute": "_variant", "defaultValue": "'normal'" } }; } static get methods() { return { "hidePopover": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Hides the popover programmatically by forwarding the call to the web component.", "tags": [] } }, "showPopover": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Shows the popover programmatically by forwarding the call to the web component.", "tags": [] } }, "click": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Clicks the primary interactive element inside this component.", "tags": [] } }, "focus": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global", "id": "global::Promise" } }, "return": "Promise<void>" }, "docs": { "text": "Sets focus on the internal element.", "tags": [] } } }; } static get elementRef() { return "host"; } } __decorate([ delegateClick('ctaRef') ], KolPopoverButton.prototype, "click", null); __decorate([ delegateFocus('ctaRef') ], KolPopoverButton.prototype, "focus", null); //# sourceMappingURL=shadow.js.map