@bquery/bquery 1.5.0 → 1.6.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/README.md +586 -546
- package/dist/component/component.d.ts +13 -5
- package/dist/component/component.d.ts.map +1 -1
- package/dist/component/html.d.ts +40 -3
- package/dist/component/html.d.ts.map +1 -1
- package/dist/component/index.d.ts +2 -2
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/library.d.ts.map +1 -1
- package/dist/component/types.d.ts +131 -16
- package/dist/component/types.d.ts.map +1 -1
- package/dist/component-BEQgt5hl.js +600 -0
- package/dist/component-BEQgt5hl.js.map +1 -0
- package/dist/component.es.mjs +7 -6
- package/dist/config-DRmZZno3.js.map +1 -1
- package/dist/core-BGQJVw0-.js +35 -0
- package/dist/core-BGQJVw0-.js.map +1 -0
- package/dist/{core-CK2Mfpf4.js → core-CCEabVHl.js} +2 -2
- package/dist/{core-CK2Mfpf4.js.map → core-CCEabVHl.js.map} +1 -1
- package/dist/core.es.mjs +1 -1
- package/dist/effect-AFRW_Plg.js +84 -0
- package/dist/effect-AFRW_Plg.js.map +1 -0
- package/dist/full.d.ts +4 -4
- package/dist/full.d.ts.map +1 -1
- package/dist/full.es.mjs +98 -94
- package/dist/full.iife.js +14 -14
- package/dist/full.iife.js.map +1 -1
- package/dist/full.umd.js +14 -14
- package/dist/full.umd.js.map +1 -1
- package/dist/index.es.mjs +143 -139
- package/dist/{motion-C5DRdPnO.js → motion-D9TcHxOF.js} +1 -1
- package/dist/{motion-C5DRdPnO.js.map → motion-D9TcHxOF.js.map} +1 -1
- package/dist/motion.es.mjs +1 -1
- package/dist/{platform-B7JhGBc7.js → platform-Dr9b6fsq.js} +21 -20
- package/dist/platform-Dr9b6fsq.js.map +1 -0
- package/dist/platform.es.mjs +1 -1
- package/dist/{reactive-BDya-ia8.js → reactive-DSkct0dO.js} +51 -50
- package/dist/reactive-DSkct0dO.js.map +1 -0
- package/dist/reactive.es.mjs +19 -17
- package/dist/{router-CijiICxt.js → router-CbDhl8rS.js} +3 -3
- package/dist/{router-CijiICxt.js.map → router-CbDhl8rS.js.map} +1 -1
- package/dist/router.es.mjs +1 -1
- package/dist/{sanitize-jyJ2ryE2.js → sanitize-Bs2dkMby.js} +94 -83
- package/dist/sanitize-Bs2dkMby.js.map +1 -0
- package/dist/security/index.d.ts +4 -2
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/sanitize.d.ts +4 -1
- package/dist/security/sanitize.d.ts.map +1 -1
- package/dist/security/trusted-html.d.ts +53 -0
- package/dist/security/trusted-html.d.ts.map +1 -0
- package/dist/security.es.mjs +10 -9
- package/dist/store/define-store.d.ts +1 -1
- package/dist/store/define-store.d.ts.map +1 -1
- package/dist/store/mapping.d.ts +1 -1
- package/dist/store/mapping.d.ts.map +1 -1
- package/dist/store/persisted.d.ts +1 -1
- package/dist/store/persisted.d.ts.map +1 -1
- package/dist/store/types.d.ts +2 -2
- package/dist/store/types.d.ts.map +1 -1
- package/dist/store/watch.d.ts +1 -1
- package/dist/store/watch.d.ts.map +1 -1
- package/dist/{store-CPK9E62U.js → store-BwDvI45q.js} +49 -48
- package/dist/{store-CPK9E62U.js.map → store-BwDvI45q.js.map} +1 -1
- package/dist/store.es.mjs +1 -1
- package/dist/storybook/index.d.ts +37 -0
- package/dist/storybook/index.d.ts.map +1 -0
- package/dist/storybook.es.mjs +151 -0
- package/dist/storybook.es.mjs.map +1 -0
- package/dist/untrack-B0rVscTc.js +7 -0
- package/dist/untrack-B0rVscTc.js.map +1 -0
- package/dist/{view-Cdi0g-qo.js → view-C70lA3vf.js} +29 -28
- package/dist/{view-Cdi0g-qo.js.map → view-C70lA3vf.js.map} +1 -1
- package/dist/view.es.mjs +9 -8
- package/package.json +141 -136
- package/src/component/component.ts +259 -54
- package/src/component/html.ts +153 -53
- package/src/component/index.ts +10 -2
- package/src/component/library.ts +42 -28
- package/src/component/types.ts +184 -19
- package/src/full.ts +8 -2
- package/src/motion/transition.ts +97 -97
- package/src/motion/types.ts +208 -208
- package/src/platform/announcer.ts +208 -208
- package/src/platform/config.ts +163 -163
- package/src/platform/cookies.ts +165 -165
- package/src/platform/index.ts +39 -39
- package/src/platform/meta.ts +168 -168
- package/src/reactive/async-data.ts +486 -486
- package/src/reactive/index.ts +37 -37
- package/src/reactive/signal.ts +29 -29
- package/src/security/constants.ts +211 -211
- package/src/security/index.ts +17 -10
- package/src/security/sanitize.ts +70 -66
- package/src/security/trusted-html.ts +71 -0
- package/src/store/define-store.ts +49 -48
- package/src/store/mapping.ts +74 -73
- package/src/store/persisted.ts +62 -61
- package/src/store/types.ts +92 -94
- package/src/store/watch.ts +53 -52
- package/src/storybook/index.ts +479 -0
- package/dist/component-CY5MVoYN.js +0 -531
- package/dist/component-CY5MVoYN.js.map +0 -1
- package/dist/core-DPdbItcq.js +0 -112
- package/dist/core-DPdbItcq.js.map +0 -1
- package/dist/platform-B7JhGBc7.js.map +0 -1
- package/dist/reactive-BDya-ia8.js.map +0 -1
- package/dist/sanitize-jyJ2ryE2.js.map +0 -1
|
@@ -1,531 +0,0 @@
|
|
|
1
|
-
import { n as v, t as x } from "./sanitize-jyJ2ryE2.js";
|
|
2
|
-
import { n as $ } from "./config-DRmZZno3.js";
|
|
3
|
-
var w = (r, t) => {
|
|
4
|
-
const { type: a } = t;
|
|
5
|
-
if (a === String) return r;
|
|
6
|
-
if (a === Number) return Number(r);
|
|
7
|
-
if (a === Boolean) {
|
|
8
|
-
const e = r.trim().toLowerCase();
|
|
9
|
-
return e === "" || e === "true" || e === "1" ? !0 : e === "false" || e === "0" ? !1 : !!r;
|
|
10
|
-
}
|
|
11
|
-
if (a === Object || a === Array) try {
|
|
12
|
-
return JSON.parse(r);
|
|
13
|
-
} catch {
|
|
14
|
-
return r;
|
|
15
|
-
}
|
|
16
|
-
if (typeof a == "function") {
|
|
17
|
-
const e = a, o = a;
|
|
18
|
-
if (t.construct === !0) return Reflect.construct(o, [r]);
|
|
19
|
-
if (t.construct === !1) return e(r);
|
|
20
|
-
const n = a.prototype !== void 0 && a.prototype !== null, l = (n ? Object.getOwnPropertyNames(a.prototype) : []).length > 1, i = n && a.prototype.constructor !== a, d = /^class\s/.test(Function.prototype.toString.call(a));
|
|
21
|
-
if (l || i || d) try {
|
|
22
|
-
return Reflect.construct(o, [r]);
|
|
23
|
-
} catch {
|
|
24
|
-
return e(r);
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
const c = e(r);
|
|
28
|
-
if (c === void 0 && n) try {
|
|
29
|
-
return Reflect.construct(o, [r]);
|
|
30
|
-
} catch {
|
|
31
|
-
return c;
|
|
32
|
-
}
|
|
33
|
-
return c;
|
|
34
|
-
} catch (c) {
|
|
35
|
-
if (c instanceof TypeError && /cannot be invoked without 'new'|is not a function/i.test(c.message)) return Reflect.construct(o, [r]);
|
|
36
|
-
throw c;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return r;
|
|
40
|
-
}, S = (r, t) => {
|
|
41
|
-
class a extends HTMLElement {
|
|
42
|
-
constructor() {
|
|
43
|
-
super(), this.state = { ...t.state ?? {} }, this.props = {}, this.missingRequiredProps = /* @__PURE__ */ new Set(), this.hasMounted = !1, this.attachShadow({ mode: "open" }), this.syncProps();
|
|
44
|
-
}
|
|
45
|
-
static get observedAttributes() {
|
|
46
|
-
return Object.keys(t.props ?? {});
|
|
47
|
-
}
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
try {
|
|
50
|
-
if (this.missingRequiredProps.size > 0) return;
|
|
51
|
-
this.mount();
|
|
52
|
-
} catch (o) {
|
|
53
|
-
this.handleError(o);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
mount() {
|
|
57
|
-
this.hasMounted || (t.beforeMount?.call(this), t.connected?.call(this), this.render(), this.hasMounted = !0);
|
|
58
|
-
}
|
|
59
|
-
disconnectedCallback() {
|
|
60
|
-
try {
|
|
61
|
-
t.disconnected?.call(this);
|
|
62
|
-
} catch (o) {
|
|
63
|
-
this.handleError(o);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
attributeChangedCallback(o, n, l) {
|
|
67
|
-
try {
|
|
68
|
-
this.syncProps(), this.hasMounted ? this.render(!0) : this.isConnected && this.missingRequiredProps.size === 0 && this.mount();
|
|
69
|
-
} catch (i) {
|
|
70
|
-
this.handleError(i);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
handleError(o) {
|
|
74
|
-
t.onError ? t.onError.call(this, o) : console.error(`bQuery component error in <${r}>:`, o);
|
|
75
|
-
}
|
|
76
|
-
setState(o, n) {
|
|
77
|
-
this.state[o] = n, this.render(!0);
|
|
78
|
-
}
|
|
79
|
-
getState(o) {
|
|
80
|
-
return this.state[o];
|
|
81
|
-
}
|
|
82
|
-
syncProps() {
|
|
83
|
-
const o = t.props ?? {};
|
|
84
|
-
for (const [n, l] of Object.entries(o)) {
|
|
85
|
-
const i = this.getAttribute(n);
|
|
86
|
-
let d;
|
|
87
|
-
if (i == null ? l.required && l.default === void 0 ? (this.missingRequiredProps.add(n), d = void 0) : d = l.default ?? void 0 : (this.missingRequiredProps.has(n) && this.missingRequiredProps.delete(n), d = w(i, l)), l.validator && d !== void 0 && !l.validator(d))
|
|
88
|
-
throw new Error(`bQuery component: validation failed for prop "${n}" with value ${JSON.stringify(d)}`);
|
|
89
|
-
this.props[n] = d;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
render(o = !1) {
|
|
93
|
-
try {
|
|
94
|
-
if (o && t.beforeUpdate && t.beforeUpdate.call(this, this.props) === !1)
|
|
95
|
-
return;
|
|
96
|
-
const n = (i, d) => {
|
|
97
|
-
this.dispatchEvent(new CustomEvent(i, {
|
|
98
|
-
detail: d,
|
|
99
|
-
bubbles: !0,
|
|
100
|
-
composed: !0
|
|
101
|
-
}));
|
|
102
|
-
};
|
|
103
|
-
if (!this.shadowRoot) return;
|
|
104
|
-
const l = v(t.render({
|
|
105
|
-
props: this.props,
|
|
106
|
-
state: this.state,
|
|
107
|
-
emit: n
|
|
108
|
-
}), {
|
|
109
|
-
allowTags: ["slot"],
|
|
110
|
-
allowAttributes: [
|
|
111
|
-
"part",
|
|
112
|
-
"disabled",
|
|
113
|
-
"checked",
|
|
114
|
-
"placeholder",
|
|
115
|
-
"value",
|
|
116
|
-
"rows",
|
|
117
|
-
"cols",
|
|
118
|
-
"readonly",
|
|
119
|
-
"required",
|
|
120
|
-
"maxlength",
|
|
121
|
-
"minlength",
|
|
122
|
-
"max",
|
|
123
|
-
"min",
|
|
124
|
-
"step",
|
|
125
|
-
"pattern",
|
|
126
|
-
"autocomplete",
|
|
127
|
-
"autofocus",
|
|
128
|
-
"for",
|
|
129
|
-
"multiple",
|
|
130
|
-
"selected",
|
|
131
|
-
"wrap"
|
|
132
|
-
]
|
|
133
|
-
});
|
|
134
|
-
if (this.shadowRoot.innerHTML = l, t.styles) {
|
|
135
|
-
const i = document.createElement("style");
|
|
136
|
-
i.textContent = t.styles, this.shadowRoot.prepend(i);
|
|
137
|
-
}
|
|
138
|
-
o && t.updated?.call(this);
|
|
139
|
-
} catch (n) {
|
|
140
|
-
this.handleError(n);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return a;
|
|
145
|
-
}, u = (r, t) => {
|
|
146
|
-
const a = S(r, t);
|
|
147
|
-
customElements.get(r) || customElements.define(r, a);
|
|
148
|
-
}, h = (r, ...t) => r.reduce((a, e, o) => `${a}${e}${t[o] ?? ""}`, ""), P = (r, ...t) => {
|
|
149
|
-
const a = {
|
|
150
|
-
"&": "&",
|
|
151
|
-
"<": "<",
|
|
152
|
-
">": ">",
|
|
153
|
-
'"': """,
|
|
154
|
-
"'": "'",
|
|
155
|
-
"`": "`"
|
|
156
|
-
}, e = (o) => String(o ?? "").replace(/[&<>"'`]/g, (n) => a[n]);
|
|
157
|
-
return r.reduce((o, n, l) => `${o}${n}${e(t[l])}`, "");
|
|
158
|
-
}, f = `
|
|
159
|
-
:host {
|
|
160
|
-
color: inherit;
|
|
161
|
-
font: inherit;
|
|
162
|
-
}
|
|
163
|
-
`, y = `
|
|
164
|
-
${f}
|
|
165
|
-
.field {
|
|
166
|
-
display: inline-flex;
|
|
167
|
-
flex-direction: column;
|
|
168
|
-
gap: 0.375rem;
|
|
169
|
-
width: 100%;
|
|
170
|
-
}
|
|
171
|
-
.label {
|
|
172
|
-
color: #334155;
|
|
173
|
-
font-size: 0.875rem;
|
|
174
|
-
font-weight: 600;
|
|
175
|
-
}
|
|
176
|
-
.control {
|
|
177
|
-
border: 1px solid #cbd5e1;
|
|
178
|
-
border-radius: 0.75rem;
|
|
179
|
-
box-sizing: border-box;
|
|
180
|
-
font: inherit;
|
|
181
|
-
min-height: 2.75rem;
|
|
182
|
-
outline: none;
|
|
183
|
-
padding: 0.75rem 0.875rem;
|
|
184
|
-
width: 100%;
|
|
185
|
-
background: #fff;
|
|
186
|
-
color: #0f172a;
|
|
187
|
-
transition: border-color 160ms ease, box-shadow 160ms ease;
|
|
188
|
-
}
|
|
189
|
-
.control:focus {
|
|
190
|
-
border-color: #2563eb;
|
|
191
|
-
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
|
|
192
|
-
}
|
|
193
|
-
.control:disabled {
|
|
194
|
-
background: #f8fafc;
|
|
195
|
-
color: #94a3b8;
|
|
196
|
-
cursor: not-allowed;
|
|
197
|
-
}
|
|
198
|
-
`, s = (r) => x(r), m = /* @__PURE__ */ new WeakMap(), b = (r, t) => m.get(r)?.[t], p = (r, t, a) => {
|
|
199
|
-
const e = m.get(r) ?? {};
|
|
200
|
-
e[t] = a, m.set(r, e);
|
|
201
|
-
}, g = (r) => r.shadowRoot?.querySelector(".label")?.textContent ?? "", k = (r, t) => {
|
|
202
|
-
const a = r.shadowRoot?.querySelector("input.control");
|
|
203
|
-
return !a || g(r) !== t.label || (a.getAttribute("type") ?? "text") !== t.type || (a.getAttribute("placeholder") ?? "") !== t.placeholder || (a.getAttribute("name") ?? "") !== t.name || a.disabled !== t.disabled ? !1 : (a.value !== t.value && (a.value = t.value), !0);
|
|
204
|
-
}, E = (r, t) => {
|
|
205
|
-
const a = r.shadowRoot?.querySelector("textarea.control");
|
|
206
|
-
return !a || g(r) !== t.label || (a.getAttribute("placeholder") ?? "") !== t.placeholder || (a.getAttribute("name") ?? "") !== t.name || a.getAttribute("rows") !== String(t.rows) || a.disabled !== t.disabled ? !1 : (a.value !== t.value && (a.value = t.value), !0);
|
|
207
|
-
}, C = (r) => [
|
|
208
|
-
"<textarea",
|
|
209
|
-
' part="control"',
|
|
210
|
-
' class="control"',
|
|
211
|
-
` placeholder="${s(r.placeholder)}"`,
|
|
212
|
-
` name="${s(r.name)}"`,
|
|
213
|
-
` rows="${r.rows}"`,
|
|
214
|
-
r.disabled ? " disabled" : "",
|
|
215
|
-
`>${s(r.value)}</textarea>`
|
|
216
|
-
].join(""), z = (r = {}) => {
|
|
217
|
-
const t = r.prefix ?? $().components?.prefix ?? "bq", a = {
|
|
218
|
-
button: `${t}-button`,
|
|
219
|
-
card: `${t}-card`,
|
|
220
|
-
input: `${t}-input`,
|
|
221
|
-
textarea: `${t}-textarea`,
|
|
222
|
-
checkbox: `${t}-checkbox`
|
|
223
|
-
};
|
|
224
|
-
return u(a.button, {
|
|
225
|
-
props: {
|
|
226
|
-
label: {
|
|
227
|
-
type: String,
|
|
228
|
-
default: ""
|
|
229
|
-
},
|
|
230
|
-
variant: {
|
|
231
|
-
type: String,
|
|
232
|
-
default: "primary"
|
|
233
|
-
},
|
|
234
|
-
size: {
|
|
235
|
-
type: String,
|
|
236
|
-
default: "md"
|
|
237
|
-
},
|
|
238
|
-
type: {
|
|
239
|
-
type: String,
|
|
240
|
-
default: "button"
|
|
241
|
-
},
|
|
242
|
-
disabled: {
|
|
243
|
-
type: Boolean,
|
|
244
|
-
default: !1
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
styles: `
|
|
248
|
-
${f}
|
|
249
|
-
button {
|
|
250
|
-
appearance: none;
|
|
251
|
-
border: 0;
|
|
252
|
-
border-radius: 999px;
|
|
253
|
-
cursor: pointer;
|
|
254
|
-
display: inline-flex;
|
|
255
|
-
align-items: center;
|
|
256
|
-
justify-content: center;
|
|
257
|
-
font: inherit;
|
|
258
|
-
font-weight: 600;
|
|
259
|
-
gap: 0.5rem;
|
|
260
|
-
min-height: 2.5rem;
|
|
261
|
-
padding: 0.65rem 1rem;
|
|
262
|
-
transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
|
|
263
|
-
background: #2563eb;
|
|
264
|
-
color: #fff;
|
|
265
|
-
}
|
|
266
|
-
button[data-variant='secondary'] {
|
|
267
|
-
background: #e2e8f0;
|
|
268
|
-
color: #0f172a;
|
|
269
|
-
}
|
|
270
|
-
button[data-size='sm'] {
|
|
271
|
-
min-height: 2.125rem;
|
|
272
|
-
padding: 0.5rem 0.875rem;
|
|
273
|
-
}
|
|
274
|
-
button[data-size='lg'] {
|
|
275
|
-
min-height: 3rem;
|
|
276
|
-
padding: 0.875rem 1.25rem;
|
|
277
|
-
}
|
|
278
|
-
button:hover:not(:disabled) {
|
|
279
|
-
transform: translateY(-1px);
|
|
280
|
-
}
|
|
281
|
-
button:disabled {
|
|
282
|
-
cursor: not-allowed;
|
|
283
|
-
opacity: 0.6;
|
|
284
|
-
}
|
|
285
|
-
`,
|
|
286
|
-
render: ({ props: e }) => h`
|
|
287
|
-
<button
|
|
288
|
-
part="button"
|
|
289
|
-
type="${s(e.type)}"
|
|
290
|
-
data-variant="${s(e.variant)}"
|
|
291
|
-
data-size="${s(e.size)}"
|
|
292
|
-
${e.disabled ? "disabled" : ""}
|
|
293
|
-
>
|
|
294
|
-
<slot>${s(e.label)}</slot>
|
|
295
|
-
</button>
|
|
296
|
-
`
|
|
297
|
-
}), u(a.card, {
|
|
298
|
-
props: {
|
|
299
|
-
title: {
|
|
300
|
-
type: String,
|
|
301
|
-
default: ""
|
|
302
|
-
},
|
|
303
|
-
footer: {
|
|
304
|
-
type: String,
|
|
305
|
-
default: ""
|
|
306
|
-
},
|
|
307
|
-
elevated: {
|
|
308
|
-
type: Boolean,
|
|
309
|
-
default: !0
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
styles: `
|
|
313
|
-
${f}
|
|
314
|
-
article {
|
|
315
|
-
background: #fff;
|
|
316
|
-
border: 1px solid #e2e8f0;
|
|
317
|
-
border-radius: 1rem;
|
|
318
|
-
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
|
|
319
|
-
color: #0f172a;
|
|
320
|
-
display: block;
|
|
321
|
-
padding: 1rem;
|
|
322
|
-
}
|
|
323
|
-
article[data-elevated='false'] {
|
|
324
|
-
box-shadow: none;
|
|
325
|
-
}
|
|
326
|
-
header, footer {
|
|
327
|
-
color: #475569;
|
|
328
|
-
font-size: 0.95rem;
|
|
329
|
-
font-weight: 600;
|
|
330
|
-
}
|
|
331
|
-
header {
|
|
332
|
-
margin-bottom: 0.75rem;
|
|
333
|
-
}
|
|
334
|
-
footer {
|
|
335
|
-
margin-top: 0.75rem;
|
|
336
|
-
}
|
|
337
|
-
`,
|
|
338
|
-
render: ({ props: e }) => h`
|
|
339
|
-
<article part="card" data-elevated="${String(e.elevated)}">
|
|
340
|
-
${e.title ? `<header part="header">${s(e.title)}</header>` : ""}
|
|
341
|
-
<section part="body"><slot></slot></section>
|
|
342
|
-
${e.footer ? `<footer part="footer">${s(e.footer)}</footer>` : ""}
|
|
343
|
-
</article>
|
|
344
|
-
`
|
|
345
|
-
}), u(a.input, {
|
|
346
|
-
props: {
|
|
347
|
-
label: {
|
|
348
|
-
type: String,
|
|
349
|
-
default: ""
|
|
350
|
-
},
|
|
351
|
-
type: {
|
|
352
|
-
type: String,
|
|
353
|
-
default: "text"
|
|
354
|
-
},
|
|
355
|
-
value: {
|
|
356
|
-
type: String,
|
|
357
|
-
default: ""
|
|
358
|
-
},
|
|
359
|
-
placeholder: {
|
|
360
|
-
type: String,
|
|
361
|
-
default: ""
|
|
362
|
-
},
|
|
363
|
-
name: {
|
|
364
|
-
type: String,
|
|
365
|
-
default: ""
|
|
366
|
-
},
|
|
367
|
-
disabled: {
|
|
368
|
-
type: Boolean,
|
|
369
|
-
default: !1
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
styles: y,
|
|
373
|
-
beforeUpdate(e) {
|
|
374
|
-
return !k(this, e);
|
|
375
|
-
},
|
|
376
|
-
connected() {
|
|
377
|
-
const e = (o) => {
|
|
378
|
-
const n = o.target;
|
|
379
|
-
n?.matches("input") && (o.stopPropagation(), this.setAttribute("value", n.value), this.dispatchEvent(new CustomEvent("input", {
|
|
380
|
-
detail: { value: n.value },
|
|
381
|
-
bubbles: !0,
|
|
382
|
-
composed: !0
|
|
383
|
-
})));
|
|
384
|
-
};
|
|
385
|
-
p(this, "__bqueryInputHandler", e), this.shadowRoot?.addEventListener("input", e);
|
|
386
|
-
},
|
|
387
|
-
disconnected() {
|
|
388
|
-
const e = b(this, "__bqueryInputHandler");
|
|
389
|
-
e && this.shadowRoot?.removeEventListener("input", e);
|
|
390
|
-
},
|
|
391
|
-
render: ({ props: e }) => h`
|
|
392
|
-
<label part="field" class="field">
|
|
393
|
-
${e.label ? `<span part="label" class="label">${s(e.label)}</span>` : ""}
|
|
394
|
-
<input
|
|
395
|
-
part="control"
|
|
396
|
-
class="control"
|
|
397
|
-
type="${s(e.type)}"
|
|
398
|
-
value="${s(e.value)}"
|
|
399
|
-
placeholder="${s(e.placeholder)}"
|
|
400
|
-
name="${s(e.name)}"
|
|
401
|
-
${e.disabled ? "disabled" : ""}
|
|
402
|
-
/>
|
|
403
|
-
</label>
|
|
404
|
-
`
|
|
405
|
-
}), u(a.textarea, {
|
|
406
|
-
props: {
|
|
407
|
-
label: {
|
|
408
|
-
type: String,
|
|
409
|
-
default: ""
|
|
410
|
-
},
|
|
411
|
-
value: {
|
|
412
|
-
type: String,
|
|
413
|
-
default: ""
|
|
414
|
-
},
|
|
415
|
-
placeholder: {
|
|
416
|
-
type: String,
|
|
417
|
-
default: ""
|
|
418
|
-
},
|
|
419
|
-
name: {
|
|
420
|
-
type: String,
|
|
421
|
-
default: ""
|
|
422
|
-
},
|
|
423
|
-
rows: {
|
|
424
|
-
type: Number,
|
|
425
|
-
default: 4
|
|
426
|
-
},
|
|
427
|
-
disabled: {
|
|
428
|
-
type: Boolean,
|
|
429
|
-
default: !1
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
styles: `${y}
|
|
433
|
-
textarea.control {
|
|
434
|
-
min-height: 6rem;
|
|
435
|
-
resize: vertical;
|
|
436
|
-
}
|
|
437
|
-
`,
|
|
438
|
-
beforeUpdate(e) {
|
|
439
|
-
return !E(this, e);
|
|
440
|
-
},
|
|
441
|
-
connected() {
|
|
442
|
-
const e = (o) => {
|
|
443
|
-
const n = o.target;
|
|
444
|
-
n?.matches("textarea") && (o.stopPropagation(), this.setAttribute("value", n.value), this.dispatchEvent(new CustomEvent("input", {
|
|
445
|
-
detail: { value: n.value },
|
|
446
|
-
bubbles: !0,
|
|
447
|
-
composed: !0
|
|
448
|
-
})));
|
|
449
|
-
};
|
|
450
|
-
p(this, "__bqueryTextareaHandler", e), this.shadowRoot?.addEventListener("input", e);
|
|
451
|
-
},
|
|
452
|
-
disconnected() {
|
|
453
|
-
const e = b(this, "__bqueryTextareaHandler");
|
|
454
|
-
e && this.shadowRoot?.removeEventListener("input", e);
|
|
455
|
-
},
|
|
456
|
-
render: ({ props: e }) => h`
|
|
457
|
-
<label part="field" class="field">
|
|
458
|
-
${e.label ? `<span part="label" class="label">${s(e.label)}</span>` : ""}
|
|
459
|
-
${C(e)}
|
|
460
|
-
</label>
|
|
461
|
-
`
|
|
462
|
-
}), u(a.checkbox, {
|
|
463
|
-
props: {
|
|
464
|
-
label: {
|
|
465
|
-
type: String,
|
|
466
|
-
default: ""
|
|
467
|
-
},
|
|
468
|
-
checked: {
|
|
469
|
-
type: Boolean,
|
|
470
|
-
default: !1
|
|
471
|
-
},
|
|
472
|
-
disabled: {
|
|
473
|
-
type: Boolean,
|
|
474
|
-
default: !1
|
|
475
|
-
}
|
|
476
|
-
},
|
|
477
|
-
styles: `
|
|
478
|
-
${f}
|
|
479
|
-
label {
|
|
480
|
-
align-items: center;
|
|
481
|
-
color: #0f172a;
|
|
482
|
-
cursor: pointer;
|
|
483
|
-
display: inline-flex;
|
|
484
|
-
gap: 0.625rem;
|
|
485
|
-
}
|
|
486
|
-
input {
|
|
487
|
-
accent-color: #2563eb;
|
|
488
|
-
block-size: 1rem;
|
|
489
|
-
inline-size: 1rem;
|
|
490
|
-
}
|
|
491
|
-
input:disabled {
|
|
492
|
-
cursor: not-allowed;
|
|
493
|
-
}
|
|
494
|
-
`,
|
|
495
|
-
connected() {
|
|
496
|
-
const e = (o) => {
|
|
497
|
-
const n = o.target;
|
|
498
|
-
n?.matches('input[type="checkbox"]') && (o.stopPropagation(), n.checked ? this.setAttribute("checked", "true") : this.removeAttribute("checked"), this.dispatchEvent(new CustomEvent("change", {
|
|
499
|
-
detail: { checked: n.checked },
|
|
500
|
-
bubbles: !0,
|
|
501
|
-
composed: !0
|
|
502
|
-
})));
|
|
503
|
-
};
|
|
504
|
-
p(this, "__bqueryCheckboxHandler", e), this.shadowRoot?.addEventListener("change", e);
|
|
505
|
-
},
|
|
506
|
-
disconnected() {
|
|
507
|
-
const e = b(this, "__bqueryCheckboxHandler");
|
|
508
|
-
e && this.shadowRoot?.removeEventListener("change", e);
|
|
509
|
-
},
|
|
510
|
-
render: ({ props: e }) => h`
|
|
511
|
-
<label part="label">
|
|
512
|
-
<input
|
|
513
|
-
part="control"
|
|
514
|
-
type="checkbox"
|
|
515
|
-
${e.checked ? "checked" : ""}
|
|
516
|
-
${e.disabled ? "disabled" : ""}
|
|
517
|
-
/>
|
|
518
|
-
<span part="text"><slot>${s(e.label)}</slot></span>
|
|
519
|
-
</label>
|
|
520
|
-
`
|
|
521
|
-
}), a;
|
|
522
|
-
};
|
|
523
|
-
export {
|
|
524
|
-
S as a,
|
|
525
|
-
u as i,
|
|
526
|
-
h as n,
|
|
527
|
-
P as r,
|
|
528
|
-
z as t
|
|
529
|
-
};
|
|
530
|
-
|
|
531
|
-
//# sourceMappingURL=component-CY5MVoYN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-CY5MVoYN.js","names":[],"sources":["../src/component/props.ts","../src/component/component.ts","../src/component/html.ts","../src/component/library.ts"],"sourcesContent":["/**\n * Prop coercion utilities.\n *\n * @module bquery/component\n */\n\nimport type { PropDefinition } from './types';\n\n/**\n * Coerces a string attribute value into a typed prop value.\n * Supports String, Number, Boolean, Object, Array, and custom converters.\n *\n * @internal\n * @template T - The target type\n * @param rawValue - The raw string value from the attribute\n * @param config - The prop definition with type information\n * @returns The coerced value of type T\n */\nexport const coercePropValue = <T>(rawValue: string, config: PropDefinition<T>): T => {\n const { type } = config;\n\n if (type === String) return rawValue as T;\n\n if (type === Number) {\n return Number(rawValue) as T;\n }\n\n if (type === Boolean) {\n const normalized = rawValue.trim().toLowerCase();\n if (normalized === '' || normalized === 'true' || normalized === '1') {\n return true as T;\n }\n if (normalized === 'false' || normalized === '0') {\n return false as T;\n }\n return Boolean(rawValue) as T;\n }\n\n if (type === Object || type === Array) {\n try {\n return JSON.parse(rawValue) as T;\n } catch {\n return rawValue as T;\n }\n }\n\n if (typeof type === 'function') {\n const callable = type as (value: unknown) => T;\n const constructable = type as new (value: unknown) => T;\n\n // Explicit construct mode takes precedence\n if (config.construct === true) {\n return Reflect.construct(constructable, [rawValue]) as T;\n }\n if (config.construct === false) {\n return callable(rawValue);\n }\n\n // Auto-detect: Check if type is constructable\n // A function is considered constructable if:\n // 1. It has a prototype with properties beyond just constructor, OR\n // 2. Its prototype.constructor is not itself (inherited), OR\n // 3. It's a class (toString starts with \"class\")\n const hasPrototype = type.prototype !== undefined && type.prototype !== null;\n const prototypeProps = hasPrototype ? Object.getOwnPropertyNames(type.prototype) : [];\n const hasPrototypeMethods = prototypeProps.length > 1;\n const hasInheritedConstructor = hasPrototype && type.prototype.constructor !== type;\n const isClassSyntax = /^class\\s/.test(Function.prototype.toString.call(type));\n\n const isConstructable = hasPrototypeMethods || hasInheritedConstructor || isClassSyntax;\n\n // For constructable types (e.g. Date, custom classes), prefer `new` to avoid\n // silent wrong-type returns (Date() returns string, new Date() returns Date)\n if (isConstructable) {\n try {\n return Reflect.construct(constructable, [rawValue]) as T;\n } catch {\n // Fall back to calling as function if construction fails\n return callable(rawValue);\n }\n }\n\n // For non-constructable types (arrow functions, plain functions), call directly\n // but fall back to constructor if result is undefined (common for function constructors)\n try {\n const result = callable(rawValue);\n\n // If calling without `new` returned undefined and the function has a prototype,\n // it's likely a function constructor that should be called with `new`\n if (result === undefined && hasPrototype) {\n try {\n return Reflect.construct(constructable, [rawValue]) as T;\n } catch {\n // Construction also failed, return the undefined\n return result as T;\n }\n }\n\n return result as T;\n } catch (error) {\n // Fall back to constructor if error indicates 'new' is required\n const isNewRequired =\n error instanceof TypeError &&\n /cannot be invoked without 'new'|is not a function/i.test(error.message);\n\n if (isNewRequired) {\n return Reflect.construct(constructable, [rawValue]) as T;\n }\n\n // Rethrow original error for non-constructable converters\n throw error;\n }\n }\n\n return rawValue as T;\n};\n","/**\r\n * Web Component factory and registry.\r\n *\r\n * @module bquery/component\r\n */\r\n\r\nimport { sanitizeHtml } from '../security/sanitize';\r\nimport { coercePropValue } from './props';\r\nimport type { ComponentDefinition, PropDefinition } from './types';\r\n\r\n/**\r\n * Creates a custom element class for a component definition.\r\n *\r\n * This is useful when you want to extend or register the class manually\r\n * (e.g. with different tag names in tests or custom registries).\r\n *\r\n * @template TProps - Type of the component's props\r\n * @param tagName - The custom element tag name (used for diagnostics)\r\n * @param definition - The component configuration\r\n */\r\nexport const defineComponent = <TProps extends Record<string, unknown>>(\r\n tagName: string,\r\n definition: ComponentDefinition<TProps>\r\n): typeof HTMLElement => {\r\n class BQueryComponent extends HTMLElement {\r\n /** Internal state object for the component */\r\n private readonly state = { ...(definition.state ?? {}) };\r\n /** Typed props object populated from attributes */\r\n private props = {} as TProps;\r\n /** Tracks missing required props for validation during connectedCallback */\r\n private missingRequiredProps = new Set<string>();\r\n /** Tracks whether the component has completed its initial mount */\r\n private hasMounted = false;\r\n\r\n constructor() {\r\n super();\r\n this.attachShadow({ mode: 'open' });\r\n this.syncProps();\r\n }\r\n\r\n /**\r\n * Returns the list of attributes to observe for changes.\r\n */\r\n static get observedAttributes(): string[] {\r\n return Object.keys(definition.props ?? {});\r\n }\r\n\r\n /**\r\n * Called when the element is added to the DOM.\r\n */\r\n connectedCallback(): void {\r\n try {\r\n // Defer initial render until all required props are present\r\n // This allows attributes to be set after element creation\r\n if (this.missingRequiredProps.size > 0) {\r\n // Component will mount once all required props are satisfied\r\n // via attributeChangedCallback\r\n return;\r\n }\r\n this.mount();\r\n } catch (error) {\r\n this.handleError(error as Error);\r\n }\r\n }\r\n\r\n /**\r\n * Performs the initial mount of the component.\r\n * Called when the element is connected and all required props are present.\r\n * @internal\r\n */\r\n private mount(): void {\r\n if (this.hasMounted) return;\r\n definition.beforeMount?.call(this);\r\n definition.connected?.call(this);\r\n this.render();\r\n this.hasMounted = true;\r\n }\r\n\r\n /**\r\n * Called when the element is removed from the DOM.\r\n */\r\n disconnectedCallback(): void {\r\n try {\r\n definition.disconnected?.call(this);\r\n } catch (error) {\r\n this.handleError(error as Error);\r\n }\r\n }\r\n\r\n /**\r\n * Called when an observed attribute changes.\r\n */\r\n attributeChangedCallback(\r\n _name: string,\r\n _oldValue: string | null,\r\n _newValue: string | null\r\n ): void {\r\n try {\r\n this.syncProps();\r\n\r\n if (this.hasMounted) {\r\n // Component already mounted - trigger update render\r\n this.render(true);\r\n } else if (this.isConnected && this.missingRequiredProps.size === 0) {\r\n // All required props are now satisfied and element is connected\r\n // Trigger the deferred initial mount\r\n this.mount();\r\n }\r\n } catch (error) {\r\n this.handleError(error as Error);\r\n }\r\n }\r\n\r\n /**\r\n * Handles errors during component lifecycle.\r\n * @internal\r\n */\r\n private handleError(error: Error): void {\r\n if (definition.onError) {\r\n definition.onError.call(this, error);\r\n } else {\r\n console.error(`bQuery component error in <${tagName}>:`, error);\r\n }\r\n }\r\n\r\n /**\r\n * Updates a state property and triggers a re-render.\r\n *\r\n * @param key - The state property key\r\n * @param value - The new value\r\n */\r\n setState(key: string, value: unknown): void {\r\n this.state[key] = value;\r\n this.render(true);\r\n }\r\n\r\n /**\r\n * Gets a state property value.\r\n *\r\n * @param key - The state property key\r\n * @returns The current value\r\n */\r\n getState<T = unknown>(key: string): T {\r\n return this.state[key] as T;\r\n }\r\n\r\n /**\r\n * Synchronizes props from attributes.\r\n * @internal\r\n */\r\n private syncProps(): void {\r\n const props = definition.props ?? {};\r\n for (const [key, config] of Object.entries(props) as [string, PropDefinition][]) {\r\n const attrValue = this.getAttribute(key);\r\n let value: unknown;\r\n\r\n if (attrValue == null) {\r\n if (config.required && config.default === undefined) {\r\n // Mark as missing instead of throwing - validate during connectedCallback\r\n this.missingRequiredProps.add(key);\r\n value = undefined;\r\n } else {\r\n value = config.default ?? undefined;\r\n }\r\n } else {\r\n // Attribute is present, remove from missing set if it was there\r\n if (this.missingRequiredProps.has(key)) {\r\n this.missingRequiredProps.delete(key);\r\n }\r\n value = coercePropValue(attrValue, config);\r\n }\r\n\r\n if (config.validator && value !== undefined) {\r\n const isValid = config.validator(value);\r\n if (!isValid) {\r\n throw new Error(\r\n `bQuery component: validation failed for prop \"${key}\" with value ${JSON.stringify(value)}`\r\n );\r\n }\r\n }\r\n\r\n (this.props as Record<string, unknown>)[key] = value;\r\n }\r\n }\r\n\r\n /**\r\n * Renders the component to its shadow root.\r\n * @internal\r\n */\r\n private render(triggerUpdated = false): void {\r\n try {\r\n if (triggerUpdated && definition.beforeUpdate) {\r\n const shouldUpdate = definition.beforeUpdate.call(this, this.props);\r\n if (shouldUpdate === false) return;\r\n }\r\n\r\n const emit = (event: string, detail?: unknown): void => {\r\n this.dispatchEvent(new CustomEvent(event, { detail, bubbles: true, composed: true }));\r\n };\r\n\r\n if (!this.shadowRoot) return;\r\n\r\n const markup = definition.render({\r\n props: this.props,\r\n state: this.state,\r\n emit,\r\n });\r\n\r\n // Component render output is authored by the component definition itself,\r\n // so we can explicitly preserve shadow-DOM-specific markup such as <slot>,\r\n // the stylistic `part` attribute, and standard form/input attributes without\r\n // relaxing the global DOM sanitization rules.\r\n const sanitizedMarkup = sanitizeHtml(markup, {\r\n allowTags: ['slot'],\r\n allowAttributes: [\r\n 'part',\r\n // Standard form attributes required by interactive shadow DOM content\r\n 'disabled',\r\n 'checked',\r\n 'placeholder',\r\n 'value',\r\n 'rows',\r\n 'cols',\r\n 'readonly',\r\n 'required',\r\n 'maxlength',\r\n 'minlength',\r\n 'max',\r\n 'min',\r\n 'step',\r\n 'pattern',\r\n 'autocomplete',\r\n 'autofocus',\r\n 'for',\r\n 'multiple',\r\n 'selected',\r\n 'wrap',\r\n ],\r\n });\r\n this.shadowRoot.innerHTML = sanitizedMarkup;\r\n\r\n if (definition.styles) {\r\n const styleElement = document.createElement('style');\r\n styleElement.textContent = definition.styles;\r\n this.shadowRoot.prepend(styleElement);\r\n }\r\n\r\n if (triggerUpdated) {\r\n definition.updated?.call(this);\r\n }\r\n } catch (error) {\r\n this.handleError(error as Error);\r\n }\r\n }\r\n }\r\n\r\n return BQueryComponent;\r\n};\r\n\r\n/**\r\n * Defines and registers a custom Web Component.\r\n *\r\n * This function creates a new custom element with the given tag name\r\n * and configuration. The component uses Shadow DOM for encapsulation\r\n * and automatically re-renders when observed attributes change.\r\n *\r\n * @template TProps - Type of the component's props\r\n * @param tagName - The custom element tag name (must contain a hyphen)\r\n * @param definition - The component configuration\r\n *\r\n * @example\r\n * ```ts\r\n * component('counter-button', {\r\n * props: {\r\n * start: { type: Number, default: 0 },\r\n * },\r\n * state: { count: 0 },\r\n * styles: `\r\n * button { padding: 0.5rem 1rem; }\r\n * `,\r\n * connected() {\r\n * // Use event delegation on shadow root so handler survives re-renders\r\n * const handleClick = (event: Event) => {\r\n * const target = event.target as HTMLElement | null;\r\n * if (target?.matches('button')) {\r\n * this.setState('count', (this.getState('count') as number) + 1);\r\n * }\r\n * };\r\n * this.shadowRoot?.addEventListener('click', handleClick);\r\n * // Store handler for cleanup\r\n * (this as any)._handleClick = handleClick;\r\n * },\r\n * disconnected() {\r\n * // Clean up event listener to prevent memory leaks\r\n * const handleClick = (this as any)._handleClick;\r\n * if (handleClick) {\r\n * this.shadowRoot?.removeEventListener('click', handleClick);\r\n * }\r\n * },\r\n * render({ props, state }) {\r\n * return html`\r\n * <button>\r\n * Count: ${state.count}\r\n * </button>\r\n * `;\r\n * },\r\n * });\r\n * ```\r\n */\r\nexport const component = <TProps extends Record<string, unknown>>(\r\n tagName: string,\r\n definition: ComponentDefinition<TProps>\r\n): void => {\r\n const elementClass = defineComponent(tagName, definition);\r\n\r\n if (!customElements.get(tagName)) {\r\n customElements.define(tagName, elementClass);\r\n }\r\n};\r\n","/**\n * Tagged template literal for creating HTML strings.\n *\n * This function handles interpolation of values into HTML templates,\n * converting null/undefined to empty strings.\n *\n * @param strings - Template literal string parts\n * @param values - Interpolated values\n * @returns Combined HTML string\n *\n * @example\n * ```ts\n * const name = 'World';\n * const greeting = html`<h1>Hello, ${name}!</h1>`;\n * // Result: '<h1>Hello, World!</h1>'\n * ```\n */\nexport const html = (strings: TemplateStringsArray, ...values: unknown[]): string => {\n return strings.reduce((acc, part, index) => `${acc}${part}${values[index] ?? ''}`, '');\n};\n\n/**\n * Escapes HTML entities in interpolated values for XSS prevention.\n * Use this when you need to safely embed user content in templates.\n *\n * @param strings - Template literal string parts\n * @param values - Interpolated values to escape\n * @returns Combined HTML string with escaped values\n *\n * @example\n * ```ts\n * const userInput = '<script>alert(\"xss\")</script>';\n * const safe = safeHtml`<div>${userInput}</div>`;\n * // Result: '<div><script>alert(\"xss\")</script></div>'\n * ```\n */\nexport const safeHtml = (strings: TemplateStringsArray, ...values: unknown[]): string => {\n const escapeMap: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`',\n };\n\n const escape = (value: unknown): string => {\n const str = String(value ?? '');\n return str.replace(/[&<>\"'`]/g, (char) => escapeMap[char]);\n };\n\n return strings.reduce((acc, part, index) => `${acc}${part}${escape(values[index])}`, '');\n};\n","/**\r\n * Default component library based on native Web Components.\r\n *\r\n * @module bquery/component\r\n */\r\n\r\nimport { getBqueryConfig } from '../platform/config';\r\nimport { escapeHtml } from '../security';\r\nimport { component } from './component';\r\nimport { html } from './html';\r\n\r\n/** Options for registering the default component library. */\r\nexport interface DefaultComponentLibraryOptions {\r\n /** Prefix used for all registered component tags. Defaults to `bq`. */\r\n prefix?: string;\r\n}\r\n\r\n/** Tag names returned by registerDefaultComponents(). */\r\nexport interface RegisteredDefaultComponents {\r\n /** Button component tag name. */\r\n button: string;\r\n /** Card component tag name. */\r\n card: string;\r\n /** Input component tag name. */\r\n input: string;\r\n /** Textarea component tag name. */\r\n textarea: string;\r\n /** Checkbox component tag name. */\r\n checkbox: string;\r\n}\r\n\r\nconst baseStyles = `\r\n :host {\r\n color: inherit;\r\n font: inherit;\r\n }\r\n`;\r\n\r\nconst controlStyles = `\r\n ${baseStyles}\r\n .field {\r\n display: inline-flex;\r\n flex-direction: column;\r\n gap: 0.375rem;\r\n width: 100%;\r\n }\r\n .label {\r\n color: #334155;\r\n font-size: 0.875rem;\r\n font-weight: 600;\r\n }\r\n .control {\r\n border: 1px solid #cbd5e1;\r\n border-radius: 0.75rem;\r\n box-sizing: border-box;\r\n font: inherit;\r\n min-height: 2.75rem;\r\n outline: none;\r\n padding: 0.75rem 0.875rem;\r\n width: 100%;\r\n background: #fff;\r\n color: #0f172a;\r\n transition: border-color 160ms ease, box-shadow 160ms ease;\r\n }\r\n .control:focus {\r\n border-color: #2563eb;\r\n box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);\r\n }\r\n .control:disabled {\r\n background: #f8fafc;\r\n color: #94a3b8;\r\n cursor: not-allowed;\r\n }\r\n`;\r\n\r\nconst escapeProp = (value: string): string => escapeHtml(value);\r\n\r\nconst handlerStore = new WeakMap<HTMLElement, Record<string, EventListener>>();\r\n\r\nconst readHandler = (element: HTMLElement, key: string): EventListener | undefined => {\r\n return handlerStore.get(element)?.[key];\r\n};\r\n\r\nconst storeHandler = (element: HTMLElement, key: string, value: EventListener): void => {\r\n const handlers = handlerStore.get(element) ?? {};\r\n handlers[key] = value;\r\n handlerStore.set(element, handlers);\r\n};\r\n\r\nconst getShadowLabelText = (element: HTMLElement): string => {\r\n return element.shadowRoot?.querySelector('.label')?.textContent ?? '';\r\n};\r\n\r\n/**\r\n * Detect a value-only input update, patch the live control in place, and\r\n * return whether the component can skip a full shadow DOM re-render.\r\n *\r\n * @param element - The host custom element whose shadow DOM is being updated\r\n * @param props - The next reflected input props for the pending update\r\n */\r\nconst canSkipInputRender = (\r\n element: HTMLElement,\r\n props: {\r\n label: string;\r\n type: string;\r\n value: string;\r\n placeholder: string;\r\n name: string;\r\n disabled: boolean;\r\n }\r\n): boolean => {\r\n const control = element.shadowRoot?.querySelector('input.control') as HTMLInputElement | null;\r\n if (!control) return false;\r\n\r\n if (getShadowLabelText(element) !== props.label) return false;\r\n if ((control.getAttribute('type') ?? 'text') !== props.type) return false;\r\n if ((control.getAttribute('placeholder') ?? '') !== props.placeholder) return false;\r\n if ((control.getAttribute('name') ?? '') !== props.name) return false;\r\n if (control.disabled !== props.disabled) return false;\r\n\r\n if (control.value !== props.value) {\r\n control.value = props.value;\r\n }\r\n\r\n return true;\r\n};\r\n\r\n/**\r\n * Detect a value-only textarea update, patch the live control in place, and\r\n * return whether the component can skip a full shadow DOM re-render.\r\n *\r\n * @param element - The host custom element whose shadow DOM is being updated\r\n * @param props - The next reflected textarea props for the pending update\r\n */\r\nconst canSkipTextareaRender = (\r\n element: HTMLElement,\r\n props: {\r\n label: string;\r\n value: string;\r\n placeholder: string;\r\n name: string;\r\n rows: number;\r\n disabled: boolean;\r\n }\r\n): boolean => {\r\n const control = element.shadowRoot?.querySelector(\r\n 'textarea.control'\r\n ) as HTMLTextAreaElement | null;\r\n if (!control) return false;\r\n\r\n if (getShadowLabelText(element) !== props.label) return false;\r\n if ((control.getAttribute('placeholder') ?? '') !== props.placeholder) return false;\r\n if ((control.getAttribute('name') ?? '') !== props.name) return false;\r\n if (control.getAttribute('rows') !== String(props.rows)) return false;\r\n if (control.disabled !== props.disabled) return false;\r\n\r\n if (control.value !== props.value) {\r\n control.value = props.value;\r\n }\r\n return true;\r\n};\r\n\r\nconst renderTextareaControl = (props: {\r\n value: string;\r\n placeholder: string;\r\n name: string;\r\n rows: number;\r\n disabled: boolean;\r\n}): string => {\r\n return [\r\n '<textarea',\r\n ' part=\"control\"',\r\n ' class=\"control\"',\r\n ` placeholder=\"${escapeProp(props.placeholder)}\"`,\r\n ` name=\"${escapeProp(props.name)}\"`,\r\n ` rows=\"${props.rows}\"`,\r\n props.disabled ? ' disabled' : '',\r\n `>${escapeProp(props.value)}</textarea>`,\r\n ].join('');\r\n};\r\n\r\n/**\r\n * Register a default set of foundational UI components.\r\n *\r\n * The library is intentionally small and dependency-free, providing common\r\n * primitives that can be themed via shadow parts and CSS custom properties.\r\n *\r\n * @param options - Optional registration settings such as a custom tag prefix\r\n * @returns The registered tag names for each component\r\n */\r\nexport const registerDefaultComponents = (\r\n options: DefaultComponentLibraryOptions = {}\r\n): RegisteredDefaultComponents => {\r\n const prefix = options.prefix ?? getBqueryConfig().components?.prefix ?? 'bq';\r\n const tags: RegisteredDefaultComponents = {\r\n button: `${prefix}-button`,\r\n card: `${prefix}-card`,\r\n input: `${prefix}-input`,\r\n textarea: `${prefix}-textarea`,\r\n checkbox: `${prefix}-checkbox`,\r\n };\r\n\r\n component<{\r\n label: string;\r\n variant: string;\r\n size: string;\r\n type: string;\r\n disabled: boolean;\r\n }>(tags.button, {\r\n props: {\r\n label: { type: String, default: '' },\r\n variant: { type: String, default: 'primary' },\r\n size: { type: String, default: 'md' },\r\n type: { type: String, default: 'button' },\r\n disabled: { type: Boolean, default: false },\r\n },\r\n styles: `\r\n ${baseStyles}\r\n button {\r\n appearance: none;\r\n border: 0;\r\n border-radius: 999px;\r\n cursor: pointer;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n font: inherit;\r\n font-weight: 600;\r\n gap: 0.5rem;\r\n min-height: 2.5rem;\r\n padding: 0.65rem 1rem;\r\n transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;\r\n background: #2563eb;\r\n color: #fff;\r\n }\r\n button[data-variant='secondary'] {\r\n background: #e2e8f0;\r\n color: #0f172a;\r\n }\r\n button[data-size='sm'] {\r\n min-height: 2.125rem;\r\n padding: 0.5rem 0.875rem;\r\n }\r\n button[data-size='lg'] {\r\n min-height: 3rem;\r\n padding: 0.875rem 1.25rem;\r\n }\r\n button:hover:not(:disabled) {\r\n transform: translateY(-1px);\r\n }\r\n button:disabled {\r\n cursor: not-allowed;\r\n opacity: 0.6;\r\n }\r\n `,\r\n render: ({ props }) => html`\r\n <button\r\n part=\"button\"\r\n type=\"${escapeProp(props.type)}\"\r\n data-variant=\"${escapeProp(props.variant)}\"\r\n data-size=\"${escapeProp(props.size)}\"\r\n ${props.disabled ? 'disabled' : ''}\r\n >\r\n <slot>${escapeProp(props.label)}</slot>\r\n </button>\r\n `,\r\n });\r\n\r\n component<{ title: string; footer: string; elevated: boolean }>(tags.card, {\r\n props: {\r\n title: { type: String, default: '' },\r\n footer: { type: String, default: '' },\r\n elevated: { type: Boolean, default: true },\r\n },\r\n styles: `\r\n ${baseStyles}\r\n article {\r\n background: #fff;\r\n border: 1px solid #e2e8f0;\r\n border-radius: 1rem;\r\n box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);\r\n color: #0f172a;\r\n display: block;\r\n padding: 1rem;\r\n }\r\n article[data-elevated='false'] {\r\n box-shadow: none;\r\n }\r\n header, footer {\r\n color: #475569;\r\n font-size: 0.95rem;\r\n font-weight: 600;\r\n }\r\n header {\r\n margin-bottom: 0.75rem;\r\n }\r\n footer {\r\n margin-top: 0.75rem;\r\n }\r\n `,\r\n render: ({ props }) => html`\r\n <article part=\"card\" data-elevated=\"${String(props.elevated)}\">\r\n ${props.title ? `<header part=\"header\">${escapeProp(props.title)}</header>` : ''}\r\n <section part=\"body\"><slot></slot></section>\r\n ${props.footer ? `<footer part=\"footer\">${escapeProp(props.footer)}</footer>` : ''}\r\n </article>\r\n `,\r\n });\r\n\r\n component<{\r\n label: string;\r\n type: string;\r\n value: string;\r\n placeholder: string;\r\n name: string;\r\n disabled: boolean;\r\n }>(tags.input, {\r\n props: {\r\n label: { type: String, default: '' },\r\n type: { type: String, default: 'text' },\r\n value: { type: String, default: '' },\r\n placeholder: { type: String, default: '' },\r\n name: { type: String, default: '' },\r\n disabled: { type: Boolean, default: false },\r\n },\r\n styles: controlStyles,\r\n /**\r\n * Skip the full shadow DOM re-render when only the reflected input value\r\n * changed, because the live control has already been patched in place.\r\n */\r\n beforeUpdate(props) {\r\n if (canSkipInputRender(this, props)) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n connected() {\r\n const handleInput = (event: Event) => {\r\n const target = event.target as HTMLInputElement | null;\r\n if (!target?.matches('input')) return;\r\n event.stopPropagation();\r\n this.setAttribute('value', target.value);\r\n this.dispatchEvent(\r\n new CustomEvent('input', {\r\n detail: { value: target.value },\r\n bubbles: true,\r\n composed: true,\r\n })\r\n );\r\n };\r\n storeHandler(this, '__bqueryInputHandler', handleInput);\r\n this.shadowRoot?.addEventListener('input', handleInput);\r\n },\r\n disconnected() {\r\n const handleInput = readHandler(this, '__bqueryInputHandler');\r\n if (handleInput) {\r\n this.shadowRoot?.removeEventListener('input', handleInput);\r\n }\r\n },\r\n render: ({ props }) => html`\r\n <label part=\"field\" class=\"field\">\r\n ${props.label ? `<span part=\"label\" class=\"label\">${escapeProp(props.label)}</span>` : ''}\r\n <input\r\n part=\"control\"\r\n class=\"control\"\r\n type=\"${escapeProp(props.type)}\"\r\n value=\"${escapeProp(props.value)}\"\r\n placeholder=\"${escapeProp(props.placeholder)}\"\r\n name=\"${escapeProp(props.name)}\"\r\n ${props.disabled ? 'disabled' : ''}\r\n />\r\n </label>\r\n `,\r\n });\r\n\r\n component<{\r\n label: string;\r\n value: string;\r\n placeholder: string;\r\n name: string;\r\n rows: number;\r\n disabled: boolean;\r\n }>(tags.textarea, {\r\n props: {\r\n label: { type: String, default: '' },\r\n value: { type: String, default: '' },\r\n placeholder: { type: String, default: '' },\r\n name: { type: String, default: '' },\r\n rows: { type: Number, default: 4 },\r\n disabled: { type: Boolean, default: false },\r\n },\r\n styles: `${controlStyles}\r\n textarea.control {\r\n min-height: 6rem;\r\n resize: vertical;\r\n }\r\n `,\r\n /**\r\n * Skip the full shadow DOM re-render when only the reflected textarea value\r\n * changed, because the live control has already been patched in place.\r\n */\r\n beforeUpdate(props) {\r\n if (canSkipTextareaRender(this, props)) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n connected() {\r\n const handleInput = (event: Event) => {\r\n const target = event.target as HTMLTextAreaElement | null;\r\n if (!target?.matches('textarea')) return;\r\n event.stopPropagation();\r\n this.setAttribute('value', target.value);\r\n this.dispatchEvent(\r\n new CustomEvent('input', {\r\n detail: { value: target.value },\r\n bubbles: true,\r\n composed: true,\r\n })\r\n );\r\n };\r\n storeHandler(this, '__bqueryTextareaHandler', handleInput);\r\n this.shadowRoot?.addEventListener('input', handleInput);\r\n },\r\n disconnected() {\r\n const handleInput = readHandler(this, '__bqueryTextareaHandler');\r\n if (handleInput) {\r\n this.shadowRoot?.removeEventListener('input', handleInput);\r\n }\r\n },\r\n render: ({ props }) => html`\r\n <label part=\"field\" class=\"field\">\r\n ${props.label ? `<span part=\"label\" class=\"label\">${escapeProp(props.label)}</span>` : ''}\r\n ${renderTextareaControl(props)}\r\n </label>\r\n `,\r\n });\r\n\r\n component<{ label: string; checked: boolean; disabled: boolean }>(tags.checkbox, {\r\n props: {\r\n label: { type: String, default: '' },\r\n checked: { type: Boolean, default: false },\r\n disabled: { type: Boolean, default: false },\r\n },\r\n styles: `\r\n ${baseStyles}\r\n label {\r\n align-items: center;\r\n color: #0f172a;\r\n cursor: pointer;\r\n display: inline-flex;\r\n gap: 0.625rem;\r\n }\r\n input {\r\n accent-color: #2563eb;\r\n block-size: 1rem;\r\n inline-size: 1rem;\r\n }\r\n input:disabled {\r\n cursor: not-allowed;\r\n }\r\n `,\r\n connected() {\r\n const handleChange = (event: Event) => {\r\n const target = event.target as HTMLInputElement | null;\r\n if (!target?.matches('input[type=\"checkbox\"]')) return;\r\n event.stopPropagation();\r\n if (target.checked) {\r\n this.setAttribute('checked', 'true');\r\n } else {\r\n this.removeAttribute('checked');\r\n }\r\n this.dispatchEvent(\r\n new CustomEvent('change', {\r\n detail: { checked: target.checked },\r\n bubbles: true,\r\n composed: true,\r\n })\r\n );\r\n };\r\n storeHandler(this, '__bqueryCheckboxHandler', handleChange);\r\n this.shadowRoot?.addEventListener('change', handleChange);\r\n },\r\n disconnected() {\r\n const handleChange = readHandler(this, '__bqueryCheckboxHandler');\r\n if (handleChange) {\r\n this.shadowRoot?.removeEventListener('change', handleChange);\r\n }\r\n },\r\n render: ({ props }) => html`\r\n <label part=\"label\">\r\n <input\r\n part=\"control\"\r\n type=\"checkbox\"\r\n ${props.checked ? 'checked' : ''}\r\n ${props.disabled ? 'disabled' : ''}\r\n />\r\n <span part=\"text\"><slot>${escapeProp(props.label)}</slot></span>\r\n </label>\r\n `,\r\n });\r\n\r\n return tags;\r\n};\r\n"],"mappings":";;AAkBA,IAAa,IAAA,CAAsB,GAAkB,MAAiC;AACpF,QAAM,EAAE,MAAA,EAAA,IAAS;AAEjB,MAAI,MAAS,OAAQ,QAAO;AAE5B,MAAI,MAAS,OACX,QAAO,OAAO,CAAA;AAGhB,MAAI,MAAS,SAAS;AACpB,UAAM,IAAa,EAAS,KAAA,EAAO,YAAA;AACnC,WAAI,MAAe,MAAM,MAAe,UAAU,MAAe,MACxD,KAEL,MAAe,WAAW,MAAe,MACpC,KAEF,EAAQ;AAAA;AAGjB,M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