UNPKG

@utrecht/web-component-library-stencil

Version:

Stencil component library bundle for the Municipality of Utrecht based on the NL Design System architecture

143 lines (142 loc) 4.58 kB
/** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ import { h } from "@stencil/core"; export class Form { constructor() { this.action = undefined; this.autocomplete = undefined; this.enctype = undefined; this.method = undefined; this.noValidate = undefined; this.target = undefined; } render() { const { action, autocomplete, enctype, method, target, noValidate } = this; const headingId = '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (n) => { const c = parseInt(n, 10); return (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16); }); return (h("form", { action: action, "aria-labelledby": headingId, autocomplete: autocomplete, enctype: enctype, method: method, novalidate: noValidate, target: target }, h("div", { class: "utrecht-form__heading", id: headingId }, h("slot", { name: "heading" })), h("slot", null))); } static get is() { return "utrecht-form"; } static get originalStyleUrls() { return { "$": ["form.scss"] }; } static get styleUrls() { return { "$": ["form.css"] }; } static get properties() { return { "action": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "action", "reflect": false }, "autocomplete": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "autocomplete", "reflect": false }, "enctype": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "enctype", "reflect": false }, "method": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "method", "reflect": false }, "noValidate": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "novalidate", "reflect": false }, "target": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "target", "reflect": false } }; } } //# sourceMappingURL=form.js.map