solid-ui 3.1.3-10 → 3.1.3-11
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/dist/_virtual/~icons/svg-spinners/3-dots-fade.cjs.js +2 -0
- package/dist/_virtual/~icons/svg-spinners/3-dots-fade.cjs.js.map +1 -0
- package/dist/_virtual/~icons/svg-spinners/3-dots-fade.esm.js +11 -0
- package/dist/_virtual/~icons/svg-spinners/3-dots-fade.esm.js.map +1 -0
- package/dist/chunks/{DialogProvider-CrvbR_fd.js → DialogProvider-ge2aA77F.js} +3 -3
- package/dist/chunks/DialogProvider-ge2aA77F.js.map +1 -0
- package/dist/chunks/{account-Ma2Ipfjx.js → account-CdqIoTsl.js} +11 -11
- package/dist/chunks/{account-Ma2Ipfjx.js.map → account-CdqIoTsl.js.map} +1 -1
- package/dist/chunks/{auth-BI22fz6P.js → auth-D8B5yczR.js} +9 -9
- package/dist/chunks/{auth-BI22fz6P.js.map → auth-D8B5yczR.js.map} +1 -1
- package/dist/chunks/{avatar-DN7FzC2N.js → avatar-DNGFKkhm.js} +4 -4
- package/dist/chunks/{avatar-DN7FzC2N.js.map → avatar-DNGFKkhm.js.map} +1 -1
- package/dist/chunks/{button-DHahwxqn.js → button-oanBb_ha.js} +2 -2
- package/dist/chunks/{button-DHahwxqn.js.map → button-oanBb_ha.js.map} +1 -1
- package/dist/chunks/combobox-Dav1bNHS.js +734 -0
- package/dist/chunks/combobox-Dav1bNHS.js.map +1 -0
- package/dist/chunks/{combobox-option-DB6KGb7o.js → combobox-option-DxJvAZ_Q.js} +2 -2
- package/dist/chunks/{combobox-option-DB6KGb7o.js.map → combobox-option-DxJvAZ_Q.js.map} +1 -1
- package/dist/chunks/{components-DH1slGZY.js → components-PQfnwrHI.js} +10 -10
- package/dist/chunks/components-PQfnwrHI.js.map +1 -0
- package/dist/chunks/{context-CA1Kq0FW.js → context-B_xwK-Y_.js} +2 -2
- package/dist/chunks/{context-CA1Kq0FW.js.map → context-B_xwK-Y_.js.map} +1 -1
- package/dist/chunks/{dialog-YaqTwAtR.js → dialog-Ujvm11_B.js} +5 -5
- package/dist/chunks/{dialog-YaqTwAtR.js.map → dialog-Ujvm11_B.js.map} +1 -1
- package/dist/chunks/{dialog-content-B3I3H7hj.js → dialog-content-CEITrC59.js} +2 -2
- package/dist/chunks/{dialog-content-B3I3H7hj.js.map → dialog-content-CEITrC59.js.map} +1 -1
- package/dist/chunks/{dialog-footer-BjcYeVhg.js → dialog-footer-DVLEK5bU.js} +2 -2
- package/dist/chunks/{dialog-footer-BjcYeVhg.js.map → dialog-footer-DVLEK5bU.js.map} +1 -1
- package/dist/chunks/{dialog-header-BynEzovK.js → dialog-header-kEWl21oD.js} +2 -2
- package/dist/chunks/{dialog-header-BynEzovK.js.map → dialog-header-kEWl21oD.js.map} +1 -1
- package/dist/chunks/{dialogs-root-B61LtZks.js → dialogs-root-dPGfuzSZ.js} +3 -3
- package/dist/chunks/{dialogs-root-B61LtZks.js.map → dialogs-root-dPGfuzSZ.js.map} +1 -1
- package/dist/chunks/{guard-YhbCPY-V.js → guard-DZGvf4tS.js} +4 -4
- package/dist/chunks/{guard-YhbCPY-V.js.map → guard-DZGvf4tS.js.map} +1 -1
- package/dist/chunks/{input-CVKu3XRI.js → input-BjCX2bFe.js} +8 -8
- package/dist/chunks/input-BjCX2bFe.js.map +1 -0
- package/dist/chunks/{login-button-76PlEs2Y.js → login-button-Ta3tkpn4.js} +5 -5
- package/dist/chunks/{login-button-76PlEs2Y.js.map → login-button-Ta3tkpn4.js.map} +1 -1
- package/dist/chunks/{logout-button-Dt3Utgj0.js → logout-button-Db6VmUmJ.js} +5 -5
- package/dist/chunks/{logout-button-Dt3Utgj0.js.map → logout-button-Db6VmUmJ.js.map} +1 -1
- package/dist/chunks/{menu-6ayNsxFG.js → menu-CQEXqNO6.js} +2 -2
- package/dist/chunks/{menu-6ayNsxFG.js.map → menu-CQEXqNO6.js.map} +1 -1
- package/dist/chunks/{menu-item-Ckl9f1rG.js → menu-item-BHJ4xljI.js} +2 -2
- package/dist/chunks/{menu-item-Ckl9f1rG.js.map → menu-item-BHJ4xljI.js.map} +1 -1
- package/dist/chunks/{provider-BfO67dzy.js → provider-CoVkCkMs.js} +5 -5
- package/dist/chunks/provider-CoVkCkMs.js.map +1 -0
- package/dist/chunks/{select-DHFgELMJ.js → select-OM-SgY4K.js} +101 -66
- package/dist/chunks/select-OM-SgY4K.js.map +1 -0
- package/dist/chunks/{select-option-Duk4S4Sc.js → select-option-pVhYlXrt.js} +2 -2
- package/dist/chunks/{select-option-Duk4S4Sc.js.map → select-option-pVhYlXrt.js.map} +1 -1
- package/dist/chunks/{signup-button-B10K6b8A.js → signup-button-wO4uoqUi.js} +5 -5
- package/dist/chunks/{signup-button-B10K6b8A.js.map → signup-button-wO4uoqUi.js.map} +1 -1
- package/dist/chunks/{solid-emblem-DgBJk5Th.js → solid-emblem-D2clBuKZ.js} +2 -2
- package/dist/chunks/{solid-emblem-DgBJk5Th.js.map → solid-emblem-D2clBuKZ.js.map} +1 -1
- package/dist/chunks/{src-CdZhCYdF.js → src-B9CXYA44.js} +3 -3
- package/dist/chunks/{src-CdZhCYdF.js.map → src-B9CXYA44.js.map} +1 -1
- package/dist/components/account.js +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/combobox/Combobox.cjs.js +21 -21
- package/dist/components/combobox/Combobox.cjs.js.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +30 -3
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.esm.js +268 -107
- package/dist/components/combobox/Combobox.esm.js.map +1 -1
- package/dist/components/combobox/Combobox.stories.d.ts +54 -0
- package/dist/components/combobox/Combobox.stories.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.styles.cjs.js +1 -1
- package/dist/components/combobox/Combobox.styles.cjs.js.map +1 -1
- package/dist/components/combobox/Combobox.styles.esm.js +1 -1
- package/dist/components/combobox/Combobox.styles.esm.js.map +1 -1
- package/dist/components/combobox/index.cjs.js +1 -1
- package/dist/components/combobox/index.cjs.js.map +1 -1
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/index.esm.js +3 -3
- package/dist/components/combobox/index.esm.js.map +1 -1
- package/dist/components/combobox-option.js +1 -1
- package/dist/components/combobox.js +2 -2
- package/dist/components/dialog-content.js +1 -1
- package/dist/components/dialog-footer.js +1 -1
- package/dist/components/dialog-header.js +1 -1
- package/dist/components/dialog-provider/DialogProvider.cjs.js.map +1 -1
- package/dist/components/dialog-provider/DialogProvider.d.ts +2 -1
- package/dist/components/dialog-provider/DialogProvider.d.ts.map +1 -1
- package/dist/components/dialog-provider/DialogProvider.esm.js.map +1 -1
- package/dist/components/dialog-provider.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialogs-root.js +1 -1
- package/dist/components/guard.js +1 -1
- package/dist/components/input/Input.cjs.js +5 -5
- package/dist/components/input/Input.cjs.js.map +1 -1
- package/dist/components/input/Input.d.ts +1 -1
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.esm.js +7 -7
- package/dist/components/input/Input.esm.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/login-button.js +1 -1
- package/dist/components/login-modal.js +1 -1
- package/dist/components/logout-button.js +1 -1
- package/dist/components/menu-item.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/provider/Provider.cjs.js.map +1 -1
- package/dist/components/provider/Provider.d.ts +2 -1
- package/dist/components/provider/Provider.d.ts.map +1 -1
- package/dist/components/provider/Provider.esm.js.map +1 -1
- package/dist/components/provider.js +1 -1
- package/dist/components/select/Select.cjs.js +7 -6
- package/dist/components/select/Select.cjs.js.map +1 -1
- package/dist/components/select/Select.d.ts +12 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.esm.js +96 -65
- package/dist/components/select/Select.esm.js.map +1 -1
- package/dist/components/select/index.cjs.js.map +1 -1
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.esm.js.map +1 -1
- package/dist/components/select-option.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/signup-button.js +1 -1
- package/dist/components/solid-emblem.js +1 -1
- package/dist/components.js +22 -22
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +6 -6
- package/dist/lib/components/index.cjs.js +1 -1
- package/dist/lib/components/index.esm.js +2 -2
- package/dist/lib/components/traits/FormControlTrait.cjs.js +2 -0
- package/dist/lib/components/traits/FormControlTrait.cjs.js.map +1 -0
- package/dist/lib/components/traits/{InputTrait.d.ts → FormControlTrait.d.ts} +10 -11
- package/dist/lib/components/traits/FormControlTrait.d.ts.map +1 -0
- package/dist/lib/components/traits/FormControlTrait.esm.js +45 -0
- package/dist/lib/components/traits/FormControlTrait.esm.js.map +1 -0
- package/dist/lib/components/traits/index.cjs.js +1 -1
- package/dist/lib/components/traits/index.d.ts +2 -2
- package/dist/lib/components/traits/index.d.ts.map +1 -1
- package/dist/lib/components/traits/index.esm.js +2 -2
- package/dist/lib/components/web-component/WebComponent.cjs.js.map +1 -1
- package/dist/lib/components/web-component/WebComponent.d.ts +2 -2
- package/dist/lib/components/web-component/WebComponent.d.ts.map +1 -1
- package/dist/lib/components/web-component/WebComponent.esm.js.map +1 -1
- package/dist/lib/timing.cjs.js +2 -0
- package/dist/lib/timing.cjs.js.map +1 -0
- package/dist/lib/timing.d.ts +6 -0
- package/dist/lib/timing.d.ts.map +1 -0
- package/dist/lib/timing.esm.js +13 -0
- package/dist/lib/timing.esm.js.map +1 -0
- package/dist/lib/values.cjs.js +2 -0
- package/dist/lib/values.cjs.js.map +1 -0
- package/dist/lib/values.d.ts +2 -0
- package/dist/lib/values.d.ts.map +1 -0
- package/dist/lib/values.esm.js +8 -0
- package/dist/lib/values.esm.js.map +1 -0
- package/dist/loader.js +6 -6
- package/dist/solid-ui.js +91 -90
- package/dist/solid-ui.min.js +91 -90
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/storybook/components/StorybookProvider.d.ts +2 -1
- package/dist/storybook/components/StorybookProvider.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/chunks/DialogProvider-CrvbR_fd.js.map +0 -1
- package/dist/chunks/combobox-BWOPh9dj.js +0 -474
- package/dist/chunks/combobox-BWOPh9dj.js.map +0 -1
- package/dist/chunks/components-DH1slGZY.js.map +0 -1
- package/dist/chunks/input-CVKu3XRI.js.map +0 -1
- package/dist/chunks/provider-BfO67dzy.js.map +0 -1
- package/dist/chunks/select-DHFgELMJ.js.map +0 -1
- package/dist/lib/components/traits/InputTrait.cjs.js +0 -2
- package/dist/lib/components/traits/InputTrait.cjs.js.map +0 -1
- package/dist/lib/components/traits/InputTrait.d.ts.map +0 -1
- package/dist/lib/components/traits/InputTrait.esm.js +0 -45
- package/dist/lib/components/traits/InputTrait.esm.js.map +0 -1
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
import { customElement as e } from "../../lib/components/decorators.esm.js";
|
|
2
2
|
import t from "../../lib/components/web-component/WebComponent.esm.js";
|
|
3
|
-
import n from "../../lib/components/traits/
|
|
3
|
+
import n from "../../lib/components/traits/FormControlTrait.esm.js";
|
|
4
4
|
import "../../lib/components/index.esm.js";
|
|
5
5
|
import "../../_virtual/~icons/lucide/chevron-down.esm.js";
|
|
6
|
-
import r from "
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import { debounce as r } from "../../lib/timing.esm.js";
|
|
7
|
+
import "../../_virtual/~icons/svg-spinners/3-dots-fade.esm.js";
|
|
8
|
+
import i from "./Combobox.styles.esm.js";
|
|
9
|
+
import { html as a, nothing as o } from "lit";
|
|
10
|
+
import { property as s, query as c, state as l } from "lit/decorators.js";
|
|
11
|
+
import { Task as u } from "@lit/task";
|
|
9
12
|
import "@awesome.me/webawesome/dist/components/popup/popup.js";
|
|
10
13
|
//#region src/components/combobox/Combobox.ts
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
+
var d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j, M, ee, te, ne, re, ie, ae, oe, N, P, F, I, L, R, z, B, V, H, U, W, G, K, q, se, ce, le, ue, de, fe, pe, me, he, ge, _e, ve, ye, be;
|
|
15
|
+
function J(e, t, n) {
|
|
16
|
+
xe(e, t), t.set(e, n);
|
|
14
17
|
}
|
|
15
|
-
function
|
|
18
|
+
function xe(e, t) {
|
|
16
19
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
17
20
|
}
|
|
18
|
-
function
|
|
19
|
-
return e.set(
|
|
21
|
+
function Y(e, t, n) {
|
|
22
|
+
return e.set(Se(e, t), n), n;
|
|
20
23
|
}
|
|
21
|
-
function
|
|
22
|
-
return e.get(
|
|
24
|
+
function X(e, t) {
|
|
25
|
+
return e.get(Se(e, t));
|
|
23
26
|
}
|
|
24
|
-
function
|
|
27
|
+
function Se(e, t, n) {
|
|
25
28
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
26
29
|
throw TypeError("Private element is not present on this object");
|
|
27
30
|
}
|
|
28
|
-
function
|
|
29
|
-
return (t =
|
|
31
|
+
function Z(e, t, n) {
|
|
32
|
+
return (t = we(t)) in e ? Object.defineProperty(e, t, {
|
|
30
33
|
value: n,
|
|
31
34
|
enumerable: !0,
|
|
32
35
|
configurable: !0,
|
|
33
36
|
writable: !0
|
|
34
37
|
}) : e[t] = n, e;
|
|
35
38
|
}
|
|
36
|
-
function
|
|
39
|
+
function Ce(e, t, n, r, i, a) {
|
|
37
40
|
function o(e, t, n) {
|
|
38
41
|
return function(r, i) {
|
|
39
42
|
return n && n(r), e[t].call(r, i);
|
|
@@ -56,13 +59,13 @@ function Y(e, t, n, r, i, a) {
|
|
|
56
59
|
n || Array.isArray(_) || (_ = [_]);
|
|
57
60
|
var b = {}, x = [], S = i === 3 ? "get" : i === 4 || p ? "set" : "value";
|
|
58
61
|
d ? (f || p ? b = {
|
|
59
|
-
get:
|
|
62
|
+
get: Ee(function() {
|
|
60
63
|
return v(this);
|
|
61
64
|
}, r, "get"),
|
|
62
65
|
set: function(e) {
|
|
63
66
|
t[4](this, e);
|
|
64
67
|
}
|
|
65
|
-
} : b[S] = v, f ||
|
|
68
|
+
} : b[S] = v, f || Ee(b[S], r, i === 2 ? "" : S)) : f || (b = Object.getOwnPropertyDescriptor(e, r));
|
|
66
69
|
}
|
|
67
70
|
for (var C = e, w = _.length - 1; w >= 0; w -= n ? 2 : 1) {
|
|
68
71
|
var T = _[w], E = n ? _[w - 1] : void 0, D = {}, O = {
|
|
@@ -122,7 +125,7 @@ function Y(e, t, n, r, i, a) {
|
|
|
122
125
|
if (arguments.length >= 6) var d = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
123
126
|
var f = Object.create(d ?? null), p = function(e, t, n, r) {
|
|
124
127
|
var i, a, o = [], c = function(t) {
|
|
125
|
-
return
|
|
128
|
+
return De(t) === e;
|
|
126
129
|
}, u = /* @__PURE__ */ new Map();
|
|
127
130
|
function d(e) {
|
|
128
131
|
e && o.push(s.bind(null, e));
|
|
@@ -136,7 +139,7 @@ function Y(e, t, n, r, i, a) {
|
|
|
136
139
|
if (!0 === x || x === 3 && m !== 4 || x === 4 && m !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
|
|
137
140
|
u.set(b, !(m > 2) || m);
|
|
138
141
|
}
|
|
139
|
-
l(v ? e : e.prototype, p, _, g ? "#" + h :
|
|
142
|
+
l(v ? e : e.prototype, p, _, g ? "#" + h : we(h), m, r, v ? a ||= [] : i ||= [], o, v, g, y, m === 1, v && g ? c : n);
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
145
|
return d(i), d(a), o;
|
|
@@ -149,11 +152,11 @@ function Y(e, t, n, r, i, a) {
|
|
|
149
152
|
}
|
|
150
153
|
};
|
|
151
154
|
}
|
|
152
|
-
function
|
|
153
|
-
var t =
|
|
155
|
+
function we(e) {
|
|
156
|
+
var t = Te(e, "string");
|
|
154
157
|
return typeof t == "symbol" ? t : t + "";
|
|
155
158
|
}
|
|
156
|
-
function
|
|
159
|
+
function Te(e, t) {
|
|
157
160
|
if (typeof e != "object" || !e) return e;
|
|
158
161
|
var n = e[Symbol.toPrimitive];
|
|
159
162
|
if (n !== void 0) {
|
|
@@ -163,7 +166,7 @@ function Z(e, t) {
|
|
|
163
166
|
}
|
|
164
167
|
return (t === "string" ? String : Number)(e);
|
|
165
168
|
}
|
|
166
|
-
function
|
|
169
|
+
function Ee(e, t, n) {
|
|
167
170
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
168
171
|
try {
|
|
169
172
|
Object.defineProperty(e, "name", {
|
|
@@ -173,108 +176,176 @@ function Q(e, t, n) {
|
|
|
173
176
|
} catch {}
|
|
174
177
|
return e;
|
|
175
178
|
}
|
|
176
|
-
function
|
|
179
|
+
function De(e) {
|
|
177
180
|
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
|
|
178
181
|
return e;
|
|
179
182
|
}
|
|
180
|
-
function
|
|
183
|
+
function Oe(e) {
|
|
184
|
+
return e;
|
|
185
|
+
}
|
|
186
|
+
var Q = class extends Error {};
|
|
187
|
+
function ke(e) {
|
|
181
188
|
return e;
|
|
182
189
|
}
|
|
183
|
-
|
|
190
|
+
M = [e("solid-ui-combobox")];
|
|
184
191
|
var $;
|
|
185
|
-
new (
|
|
192
|
+
new (ye = (p = /*#__PURE__*/ new WeakMap(), m = /*#__PURE__*/ new WeakMap(), h = /*#__PURE__*/ new WeakMap(), g = /*#__PURE__*/ new WeakMap(), _ = /*#__PURE__*/ new WeakMap(), v = /*#__PURE__*/ new WeakMap(), y = /*#__PURE__*/ new WeakMap(), b = /*#__PURE__*/ new WeakMap(), x = /*#__PURE__*/ new WeakMap(), S = /*#__PURE__*/ new WeakMap(), C = /*#__PURE__*/ new WeakMap(), w = /*#__PURE__*/ new WeakMap(), T = /*#__PURE__*/ new WeakMap(), E = /*#__PURE__*/ new WeakMap(), D = /*#__PURE__*/ new WeakMap(), O = /*#__PURE__*/ new WeakMap(), k = /*#__PURE__*/ new WeakMap(), be = (ee = s({
|
|
186
193
|
type: String,
|
|
187
194
|
reflect: !0
|
|
188
|
-
}),
|
|
195
|
+
}), ne = s({
|
|
189
196
|
type: String,
|
|
190
197
|
reflect: !0
|
|
191
|
-
}),
|
|
198
|
+
}), ie = s(), oe = s({
|
|
192
199
|
type: String,
|
|
193
200
|
reflect: !0
|
|
194
|
-
}),
|
|
201
|
+
}), P = s({
|
|
195
202
|
type: Boolean,
|
|
196
203
|
reflect: !0
|
|
197
|
-
}),
|
|
198
|
-
|
|
199
|
-
|
|
204
|
+
}), I = s({
|
|
205
|
+
type: Boolean,
|
|
206
|
+
reflect: !0,
|
|
207
|
+
attribute: "select-only"
|
|
208
|
+
}), R = s({
|
|
209
|
+
type: String,
|
|
210
|
+
attribute: "async-options-url"
|
|
211
|
+
}), B = s({
|
|
212
|
+
type: String,
|
|
213
|
+
attribute: "async-options-results-field"
|
|
214
|
+
}), H = s({
|
|
215
|
+
type: String,
|
|
216
|
+
attribute: "async-options-label-field"
|
|
217
|
+
}), W = s({
|
|
218
|
+
type: String,
|
|
219
|
+
attribute: "async-options-value-field"
|
|
220
|
+
}), K = s({ type: Function }), se = s({ type: Array }), le = c("input"), de = l(), pe = l(), he = l(), _e = l(), "label"), f = class extends t {
|
|
221
|
+
get [be]() {
|
|
222
|
+
return X(p, this);
|
|
200
223
|
}
|
|
201
224
|
set label(e) {
|
|
202
|
-
|
|
225
|
+
Y(p, this, e);
|
|
203
226
|
}
|
|
204
227
|
get name() {
|
|
205
|
-
return
|
|
228
|
+
return X(m, this);
|
|
206
229
|
}
|
|
207
230
|
set name(e) {
|
|
208
|
-
|
|
231
|
+
Y(m, this, e);
|
|
209
232
|
}
|
|
210
233
|
get value() {
|
|
211
|
-
return
|
|
234
|
+
return X(h, this);
|
|
212
235
|
}
|
|
213
236
|
set value(e) {
|
|
214
|
-
|
|
237
|
+
Y(h, this, e);
|
|
215
238
|
}
|
|
216
239
|
get placeholder() {
|
|
217
|
-
return
|
|
240
|
+
return X(g, this);
|
|
218
241
|
}
|
|
219
242
|
set placeholder(e) {
|
|
220
|
-
|
|
243
|
+
Y(g, this, e);
|
|
221
244
|
}
|
|
222
245
|
get required() {
|
|
223
|
-
return
|
|
246
|
+
return X(_, this);
|
|
224
247
|
}
|
|
225
248
|
set required(e) {
|
|
226
|
-
|
|
249
|
+
Y(_, this, e);
|
|
250
|
+
}
|
|
251
|
+
get selectOnly() {
|
|
252
|
+
return X(v, this);
|
|
253
|
+
}
|
|
254
|
+
set selectOnly(e) {
|
|
255
|
+
Y(v, this, e);
|
|
256
|
+
}
|
|
257
|
+
get asyncOptionsUrl() {
|
|
258
|
+
return X(y, this);
|
|
259
|
+
}
|
|
260
|
+
set asyncOptionsUrl(e) {
|
|
261
|
+
Y(y, this, e);
|
|
262
|
+
}
|
|
263
|
+
get asyncOptionsResultsField() {
|
|
264
|
+
return X(b, this);
|
|
265
|
+
}
|
|
266
|
+
set asyncOptionsResultsField(e) {
|
|
267
|
+
Y(b, this, e);
|
|
268
|
+
}
|
|
269
|
+
get asyncOptionsLabelField() {
|
|
270
|
+
return X(x, this);
|
|
271
|
+
}
|
|
272
|
+
set asyncOptionsLabelField(e) {
|
|
273
|
+
Y(x, this, e);
|
|
274
|
+
}
|
|
275
|
+
get asyncOptionsValueField() {
|
|
276
|
+
return X(S, this);
|
|
277
|
+
}
|
|
278
|
+
set asyncOptionsValueField(e) {
|
|
279
|
+
Y(S, this, e);
|
|
280
|
+
}
|
|
281
|
+
get asyncOptionsProvider() {
|
|
282
|
+
return X(C, this);
|
|
283
|
+
}
|
|
284
|
+
set asyncOptionsProvider(e) {
|
|
285
|
+
Y(C, this, e);
|
|
286
|
+
}
|
|
287
|
+
get optionsFallback() {
|
|
288
|
+
return X(w, this);
|
|
289
|
+
}
|
|
290
|
+
set optionsFallback(e) {
|
|
291
|
+
Y(w, this, e);
|
|
227
292
|
}
|
|
228
293
|
get inputElement() {
|
|
229
|
-
return
|
|
294
|
+
return X(T, this);
|
|
230
295
|
}
|
|
231
296
|
set inputElement(e) {
|
|
232
|
-
|
|
297
|
+
Y(T, this, e);
|
|
233
298
|
}
|
|
234
299
|
get filter() {
|
|
235
|
-
return
|
|
300
|
+
return X(E, this);
|
|
236
301
|
}
|
|
237
302
|
set filter(e) {
|
|
238
|
-
|
|
303
|
+
Y(E, this, e);
|
|
304
|
+
}
|
|
305
|
+
get displayValue() {
|
|
306
|
+
return X(D, this);
|
|
307
|
+
}
|
|
308
|
+
set displayValue(e) {
|
|
309
|
+
Y(D, this, e);
|
|
239
310
|
}
|
|
240
311
|
get open() {
|
|
241
|
-
return
|
|
312
|
+
return X(O, this);
|
|
242
313
|
}
|
|
243
314
|
set open(e) {
|
|
244
|
-
|
|
315
|
+
Y(O, this, e);
|
|
245
316
|
}
|
|
246
317
|
get activeIndex() {
|
|
247
|
-
return
|
|
318
|
+
return X(k, this);
|
|
248
319
|
}
|
|
249
320
|
set activeIndex(e) {
|
|
250
|
-
|
|
321
|
+
Y(k, this, e);
|
|
251
322
|
}
|
|
252
323
|
constructor() {
|
|
253
|
-
super(),
|
|
324
|
+
super(), J(this, p, (A(this), te(this, ""))), J(this, m, re(this, "")), J(this, h, ae(this, "")), J(this, g, N(this, "")), J(this, _, F(this, !1)), J(this, v, L(this, !1)), J(this, y, z(this, "")), J(this, b, V(this, "")), J(this, x, U(this, "")), J(this, S, G(this, "")), J(this, C, q(this, null)), J(this, w, ce(this, null)), J(this, T, ue(this, null)), J(this, E, fe(this, "")), J(this, D, me(this, "")), J(this, O, ge(this, !1)), J(this, k, ve(this, -1)), Z(this, "controlTrait", void 0), Z(this, "openListenersAttached", !1), Z(this, "updateDebouncedFilter", r(300, (e) => this.filter = e)), Z(this, "asyncOptionsTask", void 0), Z(this, "_selectedOption", void 0), Z(this, "listboxId", void 0), Z(this, "handleDocumentFocusIn", (e) => {
|
|
254
325
|
e.composedPath().includes(this) || this.hide();
|
|
255
|
-
}),
|
|
326
|
+
}), Z(this, "handleDocumentMouseDown", (e) => {
|
|
256
327
|
e.composedPath().includes(this) || this.hide();
|
|
257
|
-
}), this.
|
|
258
|
-
|
|
259
|
-
getInternals: () => this.getInternals()
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
this.hide();
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
this.open && (this.activeIndex = this.getInitialActiveIndex(t));
|
|
268
|
-
}
|
|
269
|
-
})), this.listboxId = `listbox-${this.inputTrait.inputId}`;
|
|
328
|
+
}), this.controlTrait = this.addTrait(new n(this, {
|
|
329
|
+
getControlElement: () => this.inputElement,
|
|
330
|
+
getInternals: () => this.getInternals()
|
|
331
|
+
})), this.listboxId = `listbox-${this.controlTrait.controlId}`;
|
|
332
|
+
}
|
|
333
|
+
get selectedOption() {
|
|
334
|
+
return this._selectedOption;
|
|
270
335
|
}
|
|
271
336
|
disconnectedCallback() {
|
|
272
337
|
super.disconnectedCallback(), this.removeOpenListeners();
|
|
273
338
|
}
|
|
339
|
+
willUpdate(e) {
|
|
340
|
+
if (super.willUpdate(e), (e.has("asyncOptionsUrl") || e.has("asyncOptionsProvider")) && this.updateAsyncOptionsTask(), e.has("value")) {
|
|
341
|
+
let e = this.getFilteredOptions(), t = e.find((e) => e.selectable !== !1 && e.value === this.value) ?? this.optionsFallback?.find((e) => e.value === this.value), n = t?.selectable !== !1 && t?.label;
|
|
342
|
+
this.updateDisplayValue(n || this.value), this.open && (this.activeIndex = this.getInitialActiveIndex(e)), this._selectedOption && this._selectedOption.value !== this.value && (this._selectedOption = void 0);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
274
345
|
render() {
|
|
275
346
|
let e = this.getFilteredOptions(), t = (this.open && this.activeIndex >= 0 ? e[this.activeIndex] : void 0) === void 0 ? void 0 : this.getOptionId(this.activeIndex), n = this.placeholder || "Combobox";
|
|
276
|
-
return
|
|
277
|
-
${this.
|
|
347
|
+
return a`
|
|
348
|
+
${this.controlTrait.renderLabel()}
|
|
278
349
|
<wa-popup
|
|
279
350
|
placement="bottom"
|
|
280
351
|
flip
|
|
@@ -286,7 +357,7 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
286
357
|
>
|
|
287
358
|
<div class="input-wrapper" slot="anchor" @mousedown=${this.onAnchorMouseDown}>
|
|
288
359
|
<input
|
|
289
|
-
id="${this.
|
|
360
|
+
id="${this.controlTrait.controlId}"
|
|
290
361
|
type="text"
|
|
291
362
|
name=${this.name}
|
|
292
363
|
placeholder=${this.placeholder}
|
|
@@ -295,17 +366,17 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
295
366
|
aria-haspopup="listbox"
|
|
296
367
|
aria-expanded=${this.open ? "true" : "false"}
|
|
297
368
|
aria-controls=${this.listboxId}
|
|
298
|
-
aria-activedescendant=${t ??
|
|
299
|
-
aria-labelledby=${this.label ? this.
|
|
300
|
-
aria-label=${this.label ?
|
|
301
|
-
aria-required=${this.required ? "true" :
|
|
369
|
+
aria-activedescendant=${t ?? o}
|
|
370
|
+
aria-labelledby=${this.label ? this.controlTrait.labelId : o}
|
|
371
|
+
aria-label=${this.label ? o : n}
|
|
372
|
+
aria-required=${this.required ? "true" : o}
|
|
302
373
|
autocomplete="off"
|
|
303
374
|
spellcheck="false"
|
|
304
375
|
?required=${this.required}
|
|
305
|
-
.value=${this.
|
|
376
|
+
.value=${this.displayValue}
|
|
306
377
|
@keydown=${this.onInputKeyDown}
|
|
307
378
|
@focus=${this.onInputFocus}
|
|
308
|
-
@input=${() => this.
|
|
379
|
+
@input=${() => this.selectOnly ? this.updateDisplayValue(this.inputElement?.value ?? "") : this.controlTrait.onInput()}
|
|
309
380
|
/>
|
|
310
381
|
<icon-lucide-chevron-down></icon-lucide-chevron-down>
|
|
311
382
|
</div>
|
|
@@ -314,28 +385,46 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
314
385
|
class="listbox"
|
|
315
386
|
role="listbox"
|
|
316
387
|
aria-orientation="vertical"
|
|
317
|
-
aria-labelledby=${this.label ? this.
|
|
318
|
-
aria-label=${this.label ?
|
|
388
|
+
aria-labelledby=${this.label ? this.controlTrait.labelId : o}
|
|
389
|
+
aria-label=${this.label ? o : n}
|
|
319
390
|
?hidden=${!this.open}
|
|
320
391
|
@mousedown=${this.onListboxMouseDown}
|
|
321
392
|
>
|
|
322
|
-
${e.map((e, t) =>
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
393
|
+
${e.map((e, t) => e.selectable === !1 ? a`<div class="non-selectable-option">${e.template ?? e.label}</div>` : a`<div
|
|
394
|
+
id=${this.getOptionId(t)}
|
|
395
|
+
role="option"
|
|
396
|
+
aria-selected=${this.open && t === this.activeIndex ? "true" : "false"}
|
|
397
|
+
data-active=${t === this.activeIndex || o}
|
|
398
|
+
@mousemove=${() => this.setActiveIndex(t)}
|
|
399
|
+
>
|
|
400
|
+
${e.template ?? e.label}
|
|
401
|
+
</div>`)}
|
|
331
402
|
</div>
|
|
332
403
|
</wa-popup>
|
|
333
404
|
`;
|
|
334
405
|
}
|
|
335
406
|
getFilteredOptions() {
|
|
336
|
-
return this.
|
|
407
|
+
return this.asyncOptionsTask ? this.asyncOptionsTask.render({
|
|
408
|
+
initial: () => this.optionsFallback ?? [],
|
|
409
|
+
complete: (e) => e,
|
|
410
|
+
pending: () => [{
|
|
411
|
+
value: "",
|
|
412
|
+
label: "Loading...",
|
|
413
|
+
template: a`<icon-svg-spinners-3-dots-fade></icon-svg-spinners-3-dots-fade>`,
|
|
414
|
+
selectable: !1
|
|
415
|
+
}],
|
|
416
|
+
error: (e) => {
|
|
417
|
+
let t = !(e instanceof Q), n = Object(e).message ?? "Something went wrong";
|
|
418
|
+
return [{
|
|
419
|
+
value: "",
|
|
420
|
+
label: n,
|
|
421
|
+
template: a`<span class="message message--${t ? "error" : "info"}">${n}</span>`,
|
|
422
|
+
selectable: !1
|
|
423
|
+
}];
|
|
424
|
+
}
|
|
425
|
+
}) : this.getOptionsFromDOM().filter((e) => String(e.label).toLowerCase().includes(this.filter));
|
|
337
426
|
}
|
|
338
|
-
|
|
427
|
+
getOptionsFromDOM() {
|
|
339
428
|
let e = this.querySelectorAll("solid-ui-combobox-option");
|
|
340
429
|
return Array.from(e).map((e) => ({
|
|
341
430
|
value: e.value,
|
|
@@ -355,16 +444,47 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
355
444
|
setActiveIndex(e) {
|
|
356
445
|
this.activeIndex = e;
|
|
357
446
|
}
|
|
447
|
+
updateDisplayValue(e) {
|
|
448
|
+
if (this.displayValue = String(e), this.open) {
|
|
449
|
+
let e = this.displayValue.toLowerCase();
|
|
450
|
+
this.asyncOptionsTask ? this.updateDebouncedFilter(e) : this.filter = e;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
updateAsyncOptionsTask() {
|
|
454
|
+
if (!this.asyncOptionsUrl && !this.asyncOptionsProvider) {
|
|
455
|
+
this.asyncOptionsTask = void 0;
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
this.asyncOptionsTask ??= new u(this, async ([e]) => {
|
|
459
|
+
if (this.asyncOptionsProvider) {
|
|
460
|
+
let t = await this.asyncOptionsProvider(e);
|
|
461
|
+
if (t.length === 0) throw new Q("No results found");
|
|
462
|
+
return t;
|
|
463
|
+
}
|
|
464
|
+
let t = await (await fetch(this.asyncOptionsUrl.replace("%search%", encodeURIComponent(e)))).json(), n = Array.from(this.asyncOptionsResultsField ? t[this.asyncOptionsResultsField] : t);
|
|
465
|
+
if (n.length === 0) throw new Q("No results found");
|
|
466
|
+
let r = this.asyncOptionsLabelField || "label", i = this.asyncOptionsValueField || "value";
|
|
467
|
+
return n.map((e) => ({
|
|
468
|
+
label: String(Object(e)[r]),
|
|
469
|
+
value: Object(e)[i]
|
|
470
|
+
}));
|
|
471
|
+
}, () => [this.filter]);
|
|
472
|
+
}
|
|
358
473
|
show(e) {
|
|
359
474
|
if (this.open) return;
|
|
360
475
|
let t = this.getFilteredOptions();
|
|
361
476
|
t.length !== 0 && (this.open = !0, this.activeIndex = e?.focusLast ? t.length - 1 : this.getInitialActiveIndex(t), this.addOpenListeners(), requestAnimationFrame(() => this.scrollActiveOptionIntoView()));
|
|
362
477
|
}
|
|
363
478
|
hide() {
|
|
364
|
-
this.open && (this.filter = "", this.open = !1, this.activeIndex = -1, this.removeOpenListeners());
|
|
479
|
+
this.open && (this.filter = "", this.open = !1, this.activeIndex = -1, this.removeOpenListeners(), this.updateDebouncedFilter.cancel());
|
|
365
480
|
}
|
|
366
481
|
selectOption(e) {
|
|
367
|
-
|
|
482
|
+
let t = this.value;
|
|
483
|
+
this._selectedOption = e, this.hide(), this.controlTrait.setValue(e.value), this.inputElement?.focus({ preventScroll: !0 }), this.dispatchEvent(new CustomEvent("change", {
|
|
484
|
+
bubbles: !0,
|
|
485
|
+
composed: !0,
|
|
486
|
+
detail: { option: e }
|
|
487
|
+
})), t === this.value && this.updateDisplayValue(e.label);
|
|
368
488
|
}
|
|
369
489
|
scrollActiveOptionIntoView() {
|
|
370
490
|
this.activeIndex < 0 || this.shadowRoot?.querySelector(`#${this.getOptionId(this.activeIndex)}`)?.scrollIntoView({ block: "nearest" });
|
|
@@ -382,7 +502,7 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
382
502
|
e !== document && e.removeEventListener("focusin", this.handleDocumentFocusIn), this.openListenersAttached = !1;
|
|
383
503
|
}
|
|
384
504
|
onAnchorMouseDown(e) {
|
|
385
|
-
e.preventDefault(), this.inputElement?.focus({ preventScroll: !0 });
|
|
505
|
+
e.target !== this.inputElement && (e.preventDefault(), this.inputElement?.focus({ preventScroll: !0 }));
|
|
386
506
|
}
|
|
387
507
|
onInputFocus() {
|
|
388
508
|
this.show();
|
|
@@ -400,7 +520,7 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
400
520
|
e.preventDefault(), this.open ? (this.activeIndex = this.getNextIndex(this.activeIndex, t, -1), this.scrollActiveOptionIntoView()) : this.openPopupFromKey(!0);
|
|
401
521
|
break;
|
|
402
522
|
case "Enter":
|
|
403
|
-
this.open && this.activeIndex >= 0 && t[this.activeIndex] ? (e.preventDefault(), this.selectOption(t[this.activeIndex]
|
|
523
|
+
this.open && this.activeIndex >= 0 && t[this.activeIndex] ? (e.preventDefault(), this.selectOption(t[this.activeIndex])) : this.open || (e.preventDefault(), this.controlTrait.onSubmit());
|
|
404
524
|
break;
|
|
405
525
|
case "Escape":
|
|
406
526
|
this.open && (e.preventDefault(), e.stopPropagation(), this.hide(), this.inputElement?.focus({ preventScroll: !0 }));
|
|
@@ -408,6 +528,7 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
408
528
|
case "Tab":
|
|
409
529
|
this.hide();
|
|
410
530
|
break;
|
|
531
|
+
default: this.open || this.show();
|
|
411
532
|
}
|
|
412
533
|
}
|
|
413
534
|
onListboxMouseDown(e) {
|
|
@@ -415,60 +536,100 @@ new (V = (d = /*#__PURE__*/ new WeakMap(), f = /*#__PURE__*/ new WeakMap(), p =
|
|
|
415
536
|
let t = e.target.closest("[role=\"option\"]");
|
|
416
537
|
if (!t) return;
|
|
417
538
|
let n = t.id, r = Number.parseInt(n.replace(`${this.listboxId}-option-`, ""), 10), i = this.getFilteredOptions()[r];
|
|
418
|
-
i && this.selectOption(i
|
|
539
|
+
i && this.selectOption(i);
|
|
419
540
|
}
|
|
420
|
-
}, {e: [
|
|
541
|
+
}, {e: [te, re, ae, N, F, L, z, V, U, G, q, ce, ue, fe, me, ge, ve, A], c: [$, j]} = Ce(f, [
|
|
421
542
|
[
|
|
422
|
-
|
|
543
|
+
ee,
|
|
423
544
|
1,
|
|
424
545
|
"label"
|
|
425
546
|
],
|
|
426
547
|
[
|
|
427
|
-
|
|
548
|
+
ne,
|
|
428
549
|
1,
|
|
429
550
|
"name"
|
|
430
551
|
],
|
|
431
552
|
[
|
|
432
|
-
|
|
553
|
+
ie,
|
|
433
554
|
1,
|
|
434
555
|
"value"
|
|
435
556
|
],
|
|
436
557
|
[
|
|
437
|
-
|
|
558
|
+
oe,
|
|
438
559
|
1,
|
|
439
560
|
"placeholder"
|
|
440
561
|
],
|
|
441
562
|
[
|
|
442
|
-
|
|
563
|
+
P,
|
|
443
564
|
1,
|
|
444
565
|
"required"
|
|
445
566
|
],
|
|
446
567
|
[
|
|
447
|
-
|
|
568
|
+
I,
|
|
569
|
+
1,
|
|
570
|
+
"selectOnly"
|
|
571
|
+
],
|
|
572
|
+
[
|
|
573
|
+
R,
|
|
574
|
+
1,
|
|
575
|
+
"asyncOptionsUrl"
|
|
576
|
+
],
|
|
577
|
+
[
|
|
578
|
+
B,
|
|
579
|
+
1,
|
|
580
|
+
"asyncOptionsResultsField"
|
|
581
|
+
],
|
|
582
|
+
[
|
|
583
|
+
H,
|
|
584
|
+
1,
|
|
585
|
+
"asyncOptionsLabelField"
|
|
586
|
+
],
|
|
587
|
+
[
|
|
588
|
+
W,
|
|
589
|
+
1,
|
|
590
|
+
"asyncOptionsValueField"
|
|
591
|
+
],
|
|
592
|
+
[
|
|
593
|
+
K,
|
|
594
|
+
1,
|
|
595
|
+
"asyncOptionsProvider"
|
|
596
|
+
],
|
|
597
|
+
[
|
|
598
|
+
se,
|
|
599
|
+
1,
|
|
600
|
+
"optionsFallback"
|
|
601
|
+
],
|
|
602
|
+
[
|
|
603
|
+
le,
|
|
448
604
|
1,
|
|
449
605
|
"inputElement"
|
|
450
606
|
],
|
|
451
607
|
[
|
|
452
|
-
|
|
608
|
+
de,
|
|
453
609
|
1,
|
|
454
610
|
"filter"
|
|
455
611
|
],
|
|
456
612
|
[
|
|
457
|
-
|
|
613
|
+
pe,
|
|
614
|
+
1,
|
|
615
|
+
"displayValue"
|
|
616
|
+
],
|
|
617
|
+
[
|
|
618
|
+
he,
|
|
458
619
|
1,
|
|
459
620
|
"open"
|
|
460
621
|
],
|
|
461
622
|
[
|
|
462
|
-
|
|
623
|
+
_e,
|
|
463
624
|
1,
|
|
464
625
|
"activeIndex"
|
|
465
626
|
]
|
|
466
|
-
],
|
|
627
|
+
], M, 0, void 0, t), f), d = class extends Oe {
|
|
467
628
|
constructor() {
|
|
468
|
-
super($),
|
|
629
|
+
super($), Z(this, "styles", i), Z(this, "formAssociated", !0), j();
|
|
469
630
|
}
|
|
470
|
-
},
|
|
631
|
+
}, Z(d, ye, void 0), d)();
|
|
471
632
|
//#endregion
|
|
472
|
-
export { $ as default };
|
|
633
|
+
export { $ as default, ke as defineAsyncComboboxOptionsProvider };
|
|
473
634
|
|
|
474
635
|
//# sourceMappingURL=Combobox.esm.js.map
|