@utrecht/web-component-library-stencil
Version:
Stencil component library bundle for the Municipality of Utrecht based on the NL Design System architecture
53 lines (48 loc) • 2.17 kB
JavaScript
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
const formCss = ".utrecht-form{display:block;max-inline-size:var(--utrecht-form-max-inline-size)}:host{display:block;max-inline-size:var(--utrecht-form-max-inline-size)}.utrecht-form__heading:empty{display:none}:host([hidden]){display:none !important}";
const UtrechtFormStyle0 = formCss;
const Form = /*@__PURE__*/ proxyCustomElement(class Form extends HTMLElement {
constructor() {
super();
this.__registerHost();
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 style() { return UtrechtFormStyle0; }
}, [4, "utrecht-form", {
"action": [1],
"autocomplete": [1],
"enctype": [1],
"method": [1],
"noValidate": [1, "novalidate"],
"target": [1]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["utrecht-form"];
components.forEach(tagName => { switch (tagName) {
case "utrecht-form":
if (!customElements.get(tagName)) {
customElements.define(tagName, Form);
}
break;
} });
}
const UtrechtForm = Form;
const defineCustomElement = defineCustomElement$1;
export { UtrechtForm, defineCustomElement };
//# sourceMappingURL=utrecht-form.js.map