@nl-design-system-community/clippy-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +288 -0
- package/dist/clippy-combobox/index.d.ts +60 -0
- package/dist/clippy-combobox/index.js +317 -0
- package/dist/clippy-font-combobox/external.d.ts +6 -0
- package/dist/clippy-font-combobox/google-fonts.json.d.ts +33283 -0
- package/dist/clippy-font-combobox/index.d.ts +20 -0
- package/dist/clippy-font-combobox/index.js +55 -0
- package/dist/clippy-html-image/index.d.ts +14 -0
- package/dist/clippy-html-image/index.js +64 -0
- package/dist/clippy-modal/index.d.ts +43 -0
- package/dist/clippy-modal/index.js +164 -0
- package/dist/external-lwd0iv80.js +8 -0
- package/dist/index.d.ts +0 -0
- package/package.json +68 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { css as G, unsafeCSS as z, LitElement as B, html as T, nothing as Y } from "lit";
|
|
2
|
+
import { property as x, state as W, customElement as D } from "lit/decorators.js";
|
|
3
|
+
import { classMap as V } from "lit/directives/class-map.js";
|
|
4
|
+
const Q = ".utrecht-combobox{inline-size:100%;max-inline-size:var(--utrecht-textbox-max-inline-size, var(--utrecht-form-control-max-inline-size));position:relative}.utrecht-combobox__popover{border-width:0;padding-block-end:0;padding-block-start:0;padding-inline-end:0;padding-inline-start:0;background-color:canvas;block-size:fit-content;color:canvastext;inline-size:fit-content;inset:0;overflow:auto;position:absolute;z-index:var(--utrecht-combobox-popover-z-index, 1)}.utrecht-combobox__popover--block-end{inset-block-start:100%}.utrecht-combobox__popover--hidden{display:none!important}", K = ".utrecht-listbox{--utrecht-listbox-max-block-size: 300px;background-color:var(--_utrecht-listbox-disabled-background-color, var(--_utrecht-listbox-interactive-background-color, var(--utrecht-listbox-background-color)));border-color:var(--_utrecht-listbox-disabled-border-color, var(--_utrecht-listbox-interactive-border-color, var(--utrecht-listbox-border-color)));border-radius:var(--utrecht-listbox-border-radius);border-style:solid;border-width:var(--utrecht-listbox-border-width);box-sizing:border-box;color:var(--_utrecht-listbox-disabled-color, var(--_utrecht-listbox-interactive-color, var(--utrecht-listbox-color)));cursor:default;display:flex;flex-direction:column;font-weight:var(--utrecht-listbox-font-weight, var(--utrecht-form-control-font-weight, initial));inline-size:var(--utrecht-listbox-inline-size, var(--utrecht-form-control-max-inline-size));max-block-size:var(--utrecht-listbox-max-block-size);max-inline-size:100%;min-block-size:1em;overflow-block:auto;overflow-y:auto;padding-block-end:var(--utrecht-listbox-padding-block-end);padding-block-start:var(--utrecht-listbox-padding-block-start);padding-inline-end:var(--utrecht-listbox-padding-inline-end);padding-inline-start:var(--utrecht-listbox-padding-inline-start);-webkit-user-select:none;user-select:none}@media(forced-colors:active){.utrecht-listbox{--utrecht-listbox-background-color: field;--utrecht-listbox-border-color: fieldtext;--utrecht-listbox-hover-background-color: field;--utrecht-listbox-hover-border-color: fieldtext;--utrecht-listbox-hover-color: fieldtext;--utrecht-listbox-focus-border-color: Highlight;--utrecht-listbox-disabled-border-color: GrayText;--utrecht-listbox-option-background-color: field;--utrecht-listbox-option-color: fieldtext;--utrecht-listbox-option-hover-background-color: Highlight;--utrecht-listbox-option-hover-color: HighlightText;--utrecht-listbox-option-active-background-color: Highlight;--utrecht-listbox-option-active-color: HighlightText;--utrecht-listbox-option-disabled-background-color: field;--utrecht-listbox-option-disabled-color: GrayText;--utrecht-listbox-option-selected-background-color: Highlight;--utrecht-listbox-option-selected-color: HighlightText;--utrecht-listbox-option-selected-hover-background-color: Highlight;--utrecht-listbox-option-selected-hover-color: HighlightText;--utrecht-listbox-option-selected-disabled-background-color: GrayText;--utrecht-listbox-option-selected-disabled-color: field}}.utrecht-listbox--focus{--_utrecht-listbox-interactive-border-color: var(--utrecht-listbox-focus-border-color)}.utrecht-listbox--focus-visible{--_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0) var(--utrecht-focus-inverse-outline-color, transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color, revert);outline-offset:var(--utrecht-focus-outline-offset, revert);outline-style:var(--utrecht-focus-outline-style, revert);outline-width:var(--utrecht-focus-outline-width, revert);z-index:1}.utrecht-listbox__list{margin-block-end:0;margin-block-start:0;margin-inline-end:0;margin-inline-start:0;padding-inline-start:0}.utrecht-listbox__group{margin-block-end:0;margin-block-start:0;margin-inline-end:0;margin-inline-start:0;padding-inline-start:0;margin-block-end:var(--utrecht-listbox-option-group-margin-block-end)}.utrecht-listbox__group-label{color:var(--utrecht-listbox-option-group-label-color);font-size:var(--utrecht-listbox-option-group-label-font-size);font-weight:var(--utrecht-listbox-option-group-label-font-weight);line-height:var(--utrecht-listbox-option-group-label-line-height);margin-inline-start:var(--utrecht-listbox-option-group-label-margin-inline-start)}@media(forced-colors:active){.utrecht-listbox__group-label{background-color:field;color:fieldtext}}.utrecht-listbox__option{list-style:none;--_utrecht-listbox-option-background-color: var( --_utrecht-listbox-option-disabled-background-color, var( --_utrecht-listbox-option-interactive-background-color, var(--_utrecht-listbox-option-state-background-color, var(--utrecht-listbox-option-background-color)) ) );--_utrecht-listbox-option-color: var( --_utrecht-listbox-option-disabled-color, var( --_utrecht-listbox-option-interactive-color, var(--_utrecht-listbox-option-state-color, var(--utrecht-listbox-option-color)) ) );align-items:center;background-color:var(--_utrecht-listbox-option-background-color);box-sizing:border-box;color:var(--_utrecht-listbox-option-color);display:flex;min-block-size:var(--utrecht-listbox-option-min-block-size, var(--utrecht-pointer-target-min-size, 24px));padding-block-end:var(--utrecht-listbox-option-padding-block-end);padding-block-start:var(--utrecht-listbox-option-padding-block-start);padding-inline-end:var(--utrecht-listbox-option-padding-inline-end);padding-inline-start:var(--utrecht-listbox-option-padding-inline-start)}@media(forced-colors:active){.utrecht-listbox__option{forced-color-adjust:none}}.utrecht-listbox__option--hover{--_utrecht-listbox-option-interactive-background-color: var(--utrecht-listbox-option-hover-background-color);--_utrecht-listbox-option-interactive-color: var(--utrecht-listbox-option-hover-color)}.utrecht-listbox__option--focus{--_utrecht-listbox-option-state-background-color: var(--utrecht-listbox-option-focus-background-color);--_utrecht-listbox-option-state-color: var(--utrecht-listbox-option-focus-color)}.utrecht-listbox__option--focus-visible{--_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0) var(--utrecht-focus-inverse-outline-color, transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color, revert);outline-offset:var(--utrecht-focus-outline-offset, revert);outline-style:var(--utrecht-focus-outline-style, revert);outline-width:var(--utrecht-focus-outline-width, revert);z-index:1;--utrecht-focus-outline-offset: calc(var(--utrecht-focus-outline-width) * -1)}.utrecht-listbox__option--active{--_utrecht-listbox-option-state-background-color: var(--utrecht-listbox-option-active-background-color);--_utrecht-listbox-option-state-color: var(--utrecht-listbox-option-active-color);font-weight:var(--utrecht-listbox-option-is-active-font-weight)}.utrecht-listbox__option--selected{--_utrecht-listbox-option-disabled-background-color: var(--utrecht-listbox-option-selected-disabled-background-color);--_utrecht-listbox-option-disabled-color: var(--utrecht-listbox-option-selected-disabled-color);--_utrecht-listbox-option-interactive-background-color: var(--utrecht-listbox-option-selected-hover-background-color);--_utrecht-listbox-option-interactive-color: var(--utrecht-listbox-option-selected-hover-color);--_utrecht-listbox-option-state-background-color: var(--utrecht-listbox-option-selected-background-color);--_utrecht-listbox-option-state-color: var(--utrecht-listbox-option-selected-color)}.utrecht-listbox__option--html-li{list-style:none}.utrecht-listbox__option--html-li:hover{--_utrecht-listbox-option-interactive-background-color: var(--utrecht-listbox-option-hover-background-color);--_utrecht-listbox-option-interactive-color: var(--utrecht-listbox-option-hover-color)}.utrecht-listbox__option--html-li:focus{--_utrecht-listbox-option-state-background-color: var(--utrecht-listbox-option-focus-background-color);--_utrecht-listbox-option-state-color: var(--utrecht-listbox-option-focus-color)}.utrecht-listbox__option--disabled{--utrecht-listbox-option-hover-background-color: var(--utrecht-listbox-option-disabled-background-color);--utrecht-listbox-option-hover-color: var(--utrecht-listbox-option-disabled-color);--_utrecht-listbox-option-interactive-background-color: var(--utrecht-listbox-option-disabled-background-color);--_utrecht-listbox-option-interactive-color: var(--utrecht-listbox-option-disabled-color);cursor:var(--utrecht-action-disabled-cursor, not-allowed)}.utrecht-listbox--disabled{--_utrecht-listbox-option-disabled-background-color: var(--utrecht-listbox-option-disabled-background-color);--_utrecht-listbox-option-disabled-color: var(--utrecht-listbox-option-disabled-color);--_utrecht-listbox-disabled-background-color: var(--utrecht-listbox-disabled-background-color);--_utrecht-listbox-disabled-border-color: var(--utrecht-listbox-disabled-border-color);--_utrecht-listbox-disabled-color: var(--utrecht-listbox-disabled-color);cursor:var(--utrecht-action-disabled-cursor, not-allowed)}.utrecht-listbox--html-div:focus{--_utrecht-listbox-interactive-border-color: var(--utrecht-listbox-focus-border-color)}.utrecht-listbox--html-div:focus-visible{--_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0) var(--utrecht-focus-inverse-outline-color, transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color, revert);outline-offset:var(--utrecht-focus-outline-offset, revert);outline-style:var(--utrecht-focus-outline-style, revert);outline-width:var(--utrecht-focus-outline-width, revert);z-index:1}.utrecht-listbox--forced-colors{--utrecht-listbox-background-color: field;--utrecht-listbox-border-color: fieldtext;--utrecht-listbox-hover-background-color: field;--utrecht-listbox-hover-border-color: fieldtext;--utrecht-listbox-hover-color: fieldtext;--utrecht-listbox-focus-border-color: Highlight;--utrecht-listbox-disabled-border-color: GrayText;--utrecht-listbox-option-background-color: field;--utrecht-listbox-option-color: fieldtext;--utrecht-listbox-option-hover-background-color: Highlight;--utrecht-listbox-option-hover-color: HighlightText;--utrecht-listbox-option-active-background-color: Highlight;--utrecht-listbox-option-active-color: HighlightText;--utrecht-listbox-option-disabled-background-color: field;--utrecht-listbox-option-disabled-color: GrayText;--utrecht-listbox-option-selected-background-color: Highlight;--utrecht-listbox-option-selected-color: HighlightText;--utrecht-listbox-option-selected-hover-background-color: Highlight;--utrecht-listbox-option-selected-hover-color: HighlightText;--utrecht-listbox-option-selected-disabled-background-color: GrayText;--utrecht-listbox-option-selected-disabled-color: field}", R = '.utrecht-textbox{--_utrecht-textbox-value-char: .667em + .334ch;--_utrecht-textbox-max-inline-size: calc( calc(var(--utrecht-textbox-value-max-length) * var(--_utrecht-textbox-value-char)) + var(--utrecht-textbox-padding-inline-end, var(--utrecht-form-control-padding-inline-end, 0)) + var(--utrecht-textbox-padding-inline-start, var(--utrecht-form-control-padding-inline-start, 0)) + var(--utrecht-textbox-border-width, var(--utrecht-form-control-border-width, 0)) + var(--utrecht-textbox-autocomplete-ui-size, 44px) );background-color:var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color));block-size:initial;border-width:var(--utrecht-textbox-border-width, var(--utrecht-form-control-border-width));border-block-end-width:var(--utrecht-textbox-border-bottom-width, var(--utrecht-textbox-border-width, var(--utrecht-form-control-border-width)));border-color:var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color));border-radius:var(--utrecht-textbox-border-radius, var(--utrecht-form-control-border-radius, 0));border-style:solid;box-sizing:border-box;color:var(--utrecht-textbox-color, var(--utrecht-form-control-color));font-family:var(--utrecht-textbox-font-family, var(--utrecht-form-control-font-family));font-size:var(--utrecht-textbox-font-size, var(--utrecht-form-control-font-size, inherit));font-weight:var(--utrecht-textbox-font-weight, var(--utrecht-form-control-font-weight, initial));inline-size:100%;line-height:var(--utrecht-textbox-line-height, var(--utrecht-form-control-line-height, initial));min-block-size:var(--utrecht-pointer-target-min-size, 44px);min-inline-size:var(--utrecht-pointer-target-min-size, 44px);max-inline-size:min(var(--_utrecht-textbox-max-inline-size, 100%),var(--utrecht-textbox-max-inline-size, var(--utrecht-form-control-max-inline-size)));padding-block-end:var(--utrecht-textbox-padding-block-end, var(--utrecht-form-control-padding-block-end, 0));padding-block-start:var(--utrecht-textbox-padding-block-start, var(--utrecht-form-control-padding-block-start, 0));padding-inline-end:var(--utrecht-textbox-padding-inline-end, var(--utrecht-form-control-padding-inline-end, initial));padding-inline-start:var(--utrecht-textbox-padding-inline-start, var(--utrecht-form-control-padding-inline-start, initial))}.utrecht-textbox--invalid{--_utrecht-textbox-border-width: var( --utrecht-textbox-invalid-border-width, var( --utrecht-form-control-invalid-border-width, var(--utrecht-textbox-border-width, var(--utrecht-form-control-border-width)) ) );background-color:var(--utrecht-textbox-invalid-background-color, var(--utrecht-form-control-invalid-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-width:var(--_utrecht-textbox-border-width);border-block-end-width:var(--utrecht-textbox-invalid-border-bottom-width, var(--utrecht-form-control-invalid-border-bottom-width, var(--utrecht-textbox-border-bottom-width, var(--utrecht-form-control-border-bottom-width, var(--_utrecht-textbox-border-width)))));border-color:var(--utrecht-textbox-invalid-border-color, var(--utrecht-form-control-invalid-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-invalid-color, var(--utrecht-form-control-invalid-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))))}.utrecht-textbox--disabled{background-color:var(--utrecht-textbox-disabled-background-color, var(--utrecht-form-control-disabled-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-color:var(--utrecht-textbox-disabled-border-color, var(--utrecht-form-control-disabled-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-disabled-color, var(--utrecht-form-control-disabled-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))));cursor:var(--utrecht-action-disabled-cursor, not-allowed)}.utrecht-textbox--focus{background-color:var(--utrecht-textbox-focus-background-color, var(--utrecht-form-control-focus-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-color:var(--utrecht-textbox-focus-border-color, var(--utrecht-form-control-focus-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-focus-color, var(--utrecht-form-control-focus-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))))}.utrecht-textbox--focus-visible{--_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0) var(--utrecht-focus-inverse-outline-color, transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color, revert);outline-offset:var(--utrecht-focus-outline-offset, revert);outline-style:var(--utrecht-focus-outline-style, revert);outline-width:var(--utrecht-focus-outline-width, revert);z-index:1}.utrecht-textbox--read-only{background-color:var(--utrecht-textbox-read-only-background-color, var(--utrecht-form-control-read-only-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-color:var(--utrecht-textbox-read-only-border-color, var(--utrecht-form-control-read-only-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-read-only-color, var(--utrecht-form-control-read-only-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))))}.utrecht-textbox__placeholder{color:var(--utrecht-textbox-placeholder-color, var(--utrecht-form-control-placeholder-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))));font-style:var(--utrecht-form-control-placeholder-font-style);opacity:100%}.utrecht-textbox--numeric{-moz-appearance:textfield;font-variant-numeric:lining-nums tabular-nums}.utrecht-textbox--password{font-variant-ligatures:none;font-variant-numeric:slashed-zero}.utrecht-textbox--postal-code-nl-size{--utrecht-textbox-value-max-length: 7}.utrecht-textbox--house-number-size{--utrecht-textbox-value-max-length: 5}.utrecht-textbox--house-letter-size{--utrecht-textbox-value-max-length: 1}.utrecht-textbox--house-addition-size{--utrecht-textbox-value-max-length: 4}.utrecht-textbox--voorvoegsel-size{--utrecht-textbox-value-max-length: 10}.utrecht-textbox--tel-size{--utrecht-textbox-value-max-length: 19}.utrecht-textbox--tel-nl-size{--utrecht-textbox-value-max-length: 13}.utrecht-textbox--iban-size{--utrecht-textbox-value-max-length: 41}.utrecht-textbox--iban-nl-size{--utrecht-textbox-value-max-length: 22}.utrecht-textbox--placeholder-ltr::placeholder,.utrecht-textbox--placeholder-ltr:placeholder-shown{direction:ltr}.utrecht-textbox--placeholder-rtl::placeholder,.utrecht-textbox--placeholder-rtl:placeholder-shown{direction:rtl}.utrecht-textbox--url{font-variant-ligatures:none}.utrecht-textbox--html-input:focus{background-color:var(--utrecht-textbox-focus-background-color, var(--utrecht-form-control-focus-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-color:var(--utrecht-textbox-focus-border-color, var(--utrecht-form-control-focus-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-focus-color, var(--utrecht-form-control-focus-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))))}.utrecht-textbox--html-input:focus-visible{--_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0) var(--utrecht-focus-inverse-outline-color, transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color, revert);outline-offset:var(--utrecht-focus-outline-offset, revert);outline-style:var(--utrecht-focus-outline-style, revert);outline-width:var(--utrecht-focus-outline-width, revert);z-index:1}.utrecht-textbox--html-input:user-invalid,.utrecht-textbox--html-input[aria-invalid=true]{--_utrecht-textbox-border-width: var( --utrecht-textbox-invalid-border-width, var( --utrecht-form-control-invalid-border-width, var(--utrecht-textbox-border-width, var(--utrecht-form-control-border-width)) ) );background-color:var(--utrecht-textbox-invalid-background-color, var(--utrecht-form-control-invalid-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-width:var(--_utrecht-textbox-border-width);border-block-end-width:var(--utrecht-textbox-invalid-border-bottom-width, var(--utrecht-form-control-invalid-border-bottom-width, var(--utrecht-textbox-border-bottom-width, var(--utrecht-form-control-border-bottom-width, var(--_utrecht-textbox-border-width)))));border-color:var(--utrecht-textbox-invalid-border-color, var(--utrecht-form-control-invalid-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-invalid-color, var(--utrecht-form-control-invalid-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))))}.utrecht-textbox--html-input:read-only{background-color:var(--utrecht-textbox-read-only-background-color, var(--utrecht-form-control-read-only-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-color:var(--utrecht-textbox-read-only-border-color, var(--utrecht-form-control-read-only-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-read-only-color, var(--utrecht-form-control-read-only-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))))}.utrecht-textbox--html-input:disabled{background-color:var(--utrecht-textbox-disabled-background-color, var(--utrecht-form-control-disabled-background-color, var(--utrecht-textbox-background-color, var(--utrecht-form-control-background-color))));border-color:var(--utrecht-textbox-disabled-border-color, var(--utrecht-form-control-disabled-border-color, var(--utrecht-textbox-border-color, var(--utrecht-form-control-border-color))));color:var(--utrecht-textbox-disabled-color, var(--utrecht-form-control-disabled-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))));cursor:var(--utrecht-action-disabled-cursor, not-allowed)}.utrecht-textbox--html-input::placeholder{color:var(--utrecht-textbox-placeholder-color, var(--utrecht-form-control-placeholder-color, var(--utrecht-textbox-color, var(--utrecht-form-control-color))));font-style:var(--utrecht-form-control-placeholder-font-style);opacity:100%}.utrecht-textbox--html-input[type=password i]{font-variant-ligatures:none;font-variant-numeric:slashed-zero}.utrecht-textbox--html-input[type=url i],.utrecht-textbox--html-input[type=email i],.utrecht-textbox--html-input[inputMode=email i],.utrecht-textbox--html-input[inputMode=url i]{font-variant-ligatures:none}.utrecht-textbox--html-input[pattern="\\\\d*"],.utrecht-textbox--html-input[pattern="[0-9]*"],.utrecht-textbox--html-input[type=number i],.utrecht-textbox--html-input[type=tel i],.utrecht-textbox--html-input[inputMode=numeric i],.utrecht-textbox--html-input[inputMode=decimal i],.utrecht-textbox--html-input[inputMode=tel i]{-moz-appearance:textfield;font-variant-numeric:lining-nums tabular-nums}', U = (t, o, r, e) => {
|
|
5
|
+
if (r === "length" || r === "prototype" || r === "arguments" || r === "caller")
|
|
6
|
+
return;
|
|
7
|
+
const c = Object.getOwnPropertyDescriptor(t, r), l = Object.getOwnPropertyDescriptor(o, r);
|
|
8
|
+
!J(c, l) && e || Object.defineProperty(t, r, l);
|
|
9
|
+
}, J = function(t, o) {
|
|
10
|
+
return t === void 0 || t.configurable || t.writable === o.writable && t.enumerable === o.enumerable && t.configurable === o.configurable && (t.writable || t.value === o.value);
|
|
11
|
+
}, X = (t, o) => {
|
|
12
|
+
const r = Object.getPrototypeOf(o);
|
|
13
|
+
r !== Object.getPrototypeOf(t) && Object.setPrototypeOf(t, r);
|
|
14
|
+
}, Z = (t, o) => `/* Wrapped ${t}*/
|
|
15
|
+
${o}`, tt = Object.getOwnPropertyDescriptor(Function.prototype, "toString"), ot = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name"), rt = (t, o, r) => {
|
|
16
|
+
const e = r === "" ? "" : `with ${r.trim()}() `, c = Z.bind(null, e, o.toString());
|
|
17
|
+
Object.defineProperty(c, "name", ot);
|
|
18
|
+
const { writable: l, enumerable: d, configurable: g } = tt;
|
|
19
|
+
Object.defineProperty(t, "toString", { value: c, writable: l, enumerable: d, configurable: g });
|
|
20
|
+
};
|
|
21
|
+
function et(t, o, { ignoreNonConfigurable: r = !1 } = {}) {
|
|
22
|
+
const { name: e } = t;
|
|
23
|
+
for (const c of Reflect.ownKeys(o))
|
|
24
|
+
U(t, o, c, r);
|
|
25
|
+
return X(t, o), rt(t, o, e), t;
|
|
26
|
+
}
|
|
27
|
+
const m = 2147483647, ct = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap();
|
|
28
|
+
function lt(t, o) {
|
|
29
|
+
const r = t.get(o);
|
|
30
|
+
if (r) {
|
|
31
|
+
if (r.maxAge <= Date.now()) {
|
|
32
|
+
t.delete(o);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
return r;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function nt(t, { cacheKey: o, cache: r = /* @__PURE__ */ new Map(), maxAge: e } = {}) {
|
|
39
|
+
if (e === 0)
|
|
40
|
+
return t;
|
|
41
|
+
if (typeof e == "number" && Number.isFinite(e)) {
|
|
42
|
+
if (e > m)
|
|
43
|
+
throw new TypeError(`The \`maxAge\` option cannot exceed ${m}.`);
|
|
44
|
+
if (e < 0)
|
|
45
|
+
throw new TypeError("The `maxAge` option should not be a negative number.");
|
|
46
|
+
}
|
|
47
|
+
const c = function(...l) {
|
|
48
|
+
const d = o ? o(l) : l[0], g = lt(r, d);
|
|
49
|
+
if (g)
|
|
50
|
+
return g.data;
|
|
51
|
+
const w = t.apply(this, l), s = typeof e == "function" ? e(...l) : e;
|
|
52
|
+
if (s !== void 0 && s !== Number.POSITIVE_INFINITY) {
|
|
53
|
+
if (!Number.isFinite(s))
|
|
54
|
+
throw new TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");
|
|
55
|
+
if (s <= 0)
|
|
56
|
+
return w;
|
|
57
|
+
if (s > m)
|
|
58
|
+
throw new TypeError(`The \`maxAge\` function result cannot exceed ${m}.`);
|
|
59
|
+
}
|
|
60
|
+
if (r.set(d, {
|
|
61
|
+
data: w,
|
|
62
|
+
maxAge: s === void 0 || s === Number.POSITIVE_INFINITY ? Number.POSITIVE_INFINITY : Date.now() + s
|
|
63
|
+
}), s !== void 0 && s !== Number.POSITIVE_INFINITY) {
|
|
64
|
+
const y = setTimeout(() => {
|
|
65
|
+
r.delete(d), O.get(c)?.delete(y);
|
|
66
|
+
}, s);
|
|
67
|
+
y.unref?.();
|
|
68
|
+
const F = O.get(c) ?? /* @__PURE__ */ new Set();
|
|
69
|
+
F.add(y), O.set(c, F);
|
|
70
|
+
}
|
|
71
|
+
return w;
|
|
72
|
+
};
|
|
73
|
+
return et(c, t, {
|
|
74
|
+
ignoreNonConfigurable: !0
|
|
75
|
+
}), ct.set(c, r), it.set(c, o ?? ((l) => l[0])), c;
|
|
76
|
+
}
|
|
77
|
+
const at = G`
|
|
78
|
+
/* stylelint-disable */
|
|
79
|
+
.sr-only {
|
|
80
|
+
position: absolute;
|
|
81
|
+
inline-size: 1px;
|
|
82
|
+
block-size: 1px;
|
|
83
|
+
padding: 0;
|
|
84
|
+
margin: -1px;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
clip: rect(0, 0, 0, 0);
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
border-width: 0;
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
var ut = Object.defineProperty, st = Object.getOwnPropertyDescriptor, A = (t) => {
|
|
92
|
+
throw TypeError(t);
|
|
93
|
+
}, u = (t, o, r, e) => {
|
|
94
|
+
for (var c = e > 1 ? void 0 : e ? st(o, r) : o, l = t.length - 1, d; l >= 0; l--)
|
|
95
|
+
(d = t[l]) && (c = (e ? d(o, r, c) : d(c)) || c);
|
|
96
|
+
return e && c && ut(o, r, c), c;
|
|
97
|
+
}, q = (t, o, r) => o.has(t) || A("Cannot " + r), i = (t, o, r) => (q(t, o, "read from private field"), r ? r.call(t) : o.get(t)), h = (t, o, r) => o.has(t) ? A("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(t) : o.set(t, r), j = (t, o, r, e) => (q(t, o, "write to private field"), o.set(t, r), r), b = (t, o, r) => (q(t, o, "access private method"), r), p, _, f, I, $, k, S, M, P, E, a, v, H, N, C;
|
|
98
|
+
const L = "clippy-combobox";
|
|
99
|
+
let n = class extends B {
|
|
100
|
+
constructor() {
|
|
101
|
+
super(...arguments), h(this, a), this.name = "", this.hiddenLabel = "", this.disabled = !1, this.readonly = !1, this.open = !1, this.position = "block-end", this.internals_ = this.attachInternals(), h(this, p, `${L}-${this.name}`), h(this, _), h(this, f, /* @__PURE__ */ new Map()), this.selectedIndex = -1, this.query = "", this.filter = (t) => `${t.label}`.toLowerCase().includes(this.query.toLowerCase()), h(this, I, nt(async (t) => {
|
|
102
|
+
const o = await this.fetchAdditionalOptions(t);
|
|
103
|
+
for (const r of o)
|
|
104
|
+
i(this, f).set(r.label, r);
|
|
105
|
+
})), h(this, $, () => {
|
|
106
|
+
this.open = !1, this.emit("blur");
|
|
107
|
+
}), h(this, k, () => {
|
|
108
|
+
this.emit("change");
|
|
109
|
+
}), h(this, S, () => {
|
|
110
|
+
this.open = !0, this.emit("focus");
|
|
111
|
+
}), h(this, M, (t) => {
|
|
112
|
+
const o = t.target;
|
|
113
|
+
o instanceof HTMLInputElement && (this.selectedIndex = -1, this.open = !0, this.query = o.value, this.value = this.queryToValue(this.query), this.emit("input"));
|
|
114
|
+
}), h(this, P, (t) => {
|
|
115
|
+
const o = t.currentTarget;
|
|
116
|
+
if (!(o instanceof HTMLElement)) return;
|
|
117
|
+
const r = Number(o.dataset.index);
|
|
118
|
+
Number.isNaN(r) || b(this, a, H).call(this, r);
|
|
119
|
+
}), h(this, E, ({ key: t }) => {
|
|
120
|
+
const o = this.selectedIndex, r = this.filteredOptions.length;
|
|
121
|
+
switch (t) {
|
|
122
|
+
case "ArrowDown":
|
|
123
|
+
return b(this, a, v).call(this, o + 1, !0);
|
|
124
|
+
case "ArrowUp":
|
|
125
|
+
return b(this, a, v).call(this, o - 1, !0);
|
|
126
|
+
case "Enter":
|
|
127
|
+
return b(this, a, H).call(this, o);
|
|
128
|
+
case "Escape":
|
|
129
|
+
return b(this, a, v).call(this, -1);
|
|
130
|
+
case "Home":
|
|
131
|
+
return b(this, a, v).call(this, 0);
|
|
132
|
+
case "End":
|
|
133
|
+
return b(this, a, v).call(this, r - 1);
|
|
134
|
+
default:
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
get filteredOptions() {
|
|
140
|
+
if (this.query.length === 0)
|
|
141
|
+
return this.options;
|
|
142
|
+
const t = this.options.filter(this.filter);
|
|
143
|
+
return t.length === 0 && i(this, I).call(this, this.query), t;
|
|
144
|
+
}
|
|
145
|
+
set options(t) {
|
|
146
|
+
j(this, f, new Map(t.map((o) => [o.label, o])));
|
|
147
|
+
}
|
|
148
|
+
get options() {
|
|
149
|
+
return [...i(this, f).values()];
|
|
150
|
+
}
|
|
151
|
+
set value(t) {
|
|
152
|
+
j(this, _, t), this.query = this.valueToQuery(t), this.internals_.setFormValue(this.valueToFormValue(t));
|
|
153
|
+
}
|
|
154
|
+
get value() {
|
|
155
|
+
return i(this, _);
|
|
156
|
+
}
|
|
157
|
+
emit(t) {
|
|
158
|
+
this.dispatchEvent(new Event(t, { bubbles: !0, composed: !0 }));
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Override this function to customize an external data source
|
|
162
|
+
*/
|
|
163
|
+
fetchAdditionalOptions(t) {
|
|
164
|
+
const o = [];
|
|
165
|
+
return Promise.resolve(o);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Override this function to customize how the user input is resolved to a value.
|
|
169
|
+
* This runs on input.
|
|
170
|
+
*/
|
|
171
|
+
queryToValue(t) {
|
|
172
|
+
return t;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Override this function to customize how a value is converted to a .
|
|
176
|
+
* This runs on setting the value.
|
|
177
|
+
*/
|
|
178
|
+
valueToQuery(t) {
|
|
179
|
+
return (t ?? "").toString();
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Override this function to customize how the value is converted to a form value;
|
|
183
|
+
*/
|
|
184
|
+
valueToFormValue(t) {
|
|
185
|
+
return t ? `${t}` : "";
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Override this function to customize the rendering of combobox options and selected value.
|
|
189
|
+
*/
|
|
190
|
+
renderEntry(t, o) {
|
|
191
|
+
return T`${t?.label}`;
|
|
192
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
const t = {
|
|
195
|
+
[`utrecht-combobox__popover--${this.position}`]: this.position,
|
|
196
|
+
"utrecht-combobox__popover--hidden": !this.open
|
|
197
|
+
};
|
|
198
|
+
return T`
|
|
199
|
+
<div class="utrecht-combobox">
|
|
200
|
+
<label for="${i(this, p)}" class="sr-only">${this.hiddenLabel}</label>
|
|
201
|
+
<input
|
|
202
|
+
id=${i(this, p)}
|
|
203
|
+
name=${this.name}
|
|
204
|
+
autocomplete="off"
|
|
205
|
+
role="combobox"
|
|
206
|
+
aria-autocomplete="list"
|
|
207
|
+
aria-haspopup="listbox"
|
|
208
|
+
aria-controls=${i(this, a, N)}
|
|
209
|
+
aria-activedescendant=${b(this, a, C).call(this)}
|
|
210
|
+
type="text"
|
|
211
|
+
class="utrecht-textbox utrecht-combobox__input"
|
|
212
|
+
dir="auto"
|
|
213
|
+
.value=${this.query}
|
|
214
|
+
@input=${i(this, M)}
|
|
215
|
+
@focus=${i(this, S)}
|
|
216
|
+
@blur=${i(this, $)}
|
|
217
|
+
@change=${i(this, k)}
|
|
218
|
+
@keydown=${i(this, E)}
|
|
219
|
+
/>
|
|
220
|
+
<div
|
|
221
|
+
id=${i(this, a, N)}
|
|
222
|
+
class="utrecht-listbox utrecht-combobox__popover ${V(t)}"
|
|
223
|
+
role="listbox"
|
|
224
|
+
tabindex="-1"
|
|
225
|
+
>
|
|
226
|
+
<ul class="utrecht-listbox__list" role="none">
|
|
227
|
+
${this.filteredOptions.map((o, r) => {
|
|
228
|
+
const e = r === this.selectedIndex;
|
|
229
|
+
return T`<li
|
|
230
|
+
class="utrecht-listbox__option utrecht-listbox__option--html-li ${V({
|
|
231
|
+
"utrecht-listbox__option--selected": e
|
|
232
|
+
})}"
|
|
233
|
+
role="option"
|
|
234
|
+
id=${b(this, a, C).call(this, r)}
|
|
235
|
+
aria-selected=${e}
|
|
236
|
+
data-index=${r}
|
|
237
|
+
@mousedown=${i(this, P)}
|
|
238
|
+
>
|
|
239
|
+
${this.renderEntry(o, r)}
|
|
240
|
+
</li>`;
|
|
241
|
+
})}
|
|
242
|
+
</ul>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
`;
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
p = /* @__PURE__ */ new WeakMap();
|
|
249
|
+
_ = /* @__PURE__ */ new WeakMap();
|
|
250
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
251
|
+
I = /* @__PURE__ */ new WeakMap();
|
|
252
|
+
$ = /* @__PURE__ */ new WeakMap();
|
|
253
|
+
k = /* @__PURE__ */ new WeakMap();
|
|
254
|
+
S = /* @__PURE__ */ new WeakMap();
|
|
255
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
256
|
+
P = /* @__PURE__ */ new WeakMap();
|
|
257
|
+
E = /* @__PURE__ */ new WeakMap();
|
|
258
|
+
a = /* @__PURE__ */ new WeakSet();
|
|
259
|
+
v = function(t, o = !1) {
|
|
260
|
+
this.open = o, this.selectedIndex = t > -1 ? t % this.filteredOptions.length : -1;
|
|
261
|
+
};
|
|
262
|
+
H = function(t) {
|
|
263
|
+
const { label: o, value: r } = this.filteredOptions.at(t) ?? {};
|
|
264
|
+
t < 0 || !o || (this.query = o.toString(), this.value !== r && (this.value = r, i(this, k).call(this)), this.open = !1);
|
|
265
|
+
};
|
|
266
|
+
N = function() {
|
|
267
|
+
return `list-${i(this, p)}`;
|
|
268
|
+
};
|
|
269
|
+
C = function(t = this.selectedIndex) {
|
|
270
|
+
return t !== -1 ? `option-${t}-${i(this, p)}` : Y;
|
|
271
|
+
};
|
|
272
|
+
n.formAssociated = !0;
|
|
273
|
+
n.styles = [
|
|
274
|
+
at,
|
|
275
|
+
z(Q),
|
|
276
|
+
z(K),
|
|
277
|
+
z(R)
|
|
278
|
+
];
|
|
279
|
+
u([
|
|
280
|
+
x()
|
|
281
|
+
], n.prototype, "name", 2);
|
|
282
|
+
u([
|
|
283
|
+
x({ attribute: "hidden-label" })
|
|
284
|
+
], n.prototype, "hiddenLabel", 2);
|
|
285
|
+
u([
|
|
286
|
+
x({ type: Boolean })
|
|
287
|
+
], n.prototype, "disabled", 2);
|
|
288
|
+
u([
|
|
289
|
+
x({ type: Boolean })
|
|
290
|
+
], n.prototype, "readonly", 2);
|
|
291
|
+
u([
|
|
292
|
+
x({ type: Boolean })
|
|
293
|
+
], n.prototype, "open", 2);
|
|
294
|
+
u([
|
|
295
|
+
x()
|
|
296
|
+
], n.prototype, "position", 2);
|
|
297
|
+
u([
|
|
298
|
+
W()
|
|
299
|
+
], n.prototype, "selectedIndex", 2);
|
|
300
|
+
u([
|
|
301
|
+
W()
|
|
302
|
+
], n.prototype, "query", 2);
|
|
303
|
+
u([
|
|
304
|
+
W()
|
|
305
|
+
], n.prototype, "filteredOptions", 1);
|
|
306
|
+
u([
|
|
307
|
+
x({ type: Array })
|
|
308
|
+
], n.prototype, "options", 1);
|
|
309
|
+
u([
|
|
310
|
+
x({ attribute: !1 })
|
|
311
|
+
], n.prototype, "value", 1);
|
|
312
|
+
n = u([
|
|
313
|
+
D(L)
|
|
314
|
+
], n);
|
|
315
|
+
export {
|
|
316
|
+
n as ClippyCombobox
|
|
317
|
+
};
|