@lundal/zed-solid 0.0.5 → 0.0.7
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/Button.d.ts +2 -1
- package/dist/Card.d.ts +2 -1
- package/dist/CheckBox.d.ts +2 -1
- package/dist/CheckBoxes.d.ts +2 -1
- package/dist/Column.d.ts +2 -1
- package/dist/Dialog.d.ts +2 -1
- package/dist/Field.d.ts +2 -1
- package/dist/Form.d.ts +2 -1
- package/dist/Header.d.ts +2 -1
- package/dist/Headings.d.ts +2 -1
- package/dist/Icon.d.ts +3 -2
- package/dist/IconButton.d.ts +2 -1
- package/dist/Link.d.ts +2 -1
- package/dist/Nav.d.ts +2 -1
- package/dist/NavHeader.d.ts +2 -1
- package/dist/NavLink.d.ts +2 -1
- package/dist/Page.d.ts +2 -1
- package/dist/RadioButtons.d.ts +2 -1
- package/dist/Row.d.ts +2 -1
- package/dist/Select.d.ts +2 -1
- package/dist/Spinner.d.ts +2 -1
- package/dist/TextBox.d.ts +3 -1
- package/dist/example.d.ts +1 -0
- package/dist/index.d.ts +23 -22
- package/dist/index.js +251 -238
- package/package.json +5 -5
package/dist/Button.d.ts
CHANGED
package/dist/Card.d.ts
CHANGED
package/dist/CheckBox.d.ts
CHANGED
package/dist/CheckBoxes.d.ts
CHANGED
package/dist/Column.d.ts
CHANGED
package/dist/Dialog.d.ts
CHANGED
package/dist/Field.d.ts
CHANGED
package/dist/Form.d.ts
CHANGED
package/dist/Header.d.ts
CHANGED
package/dist/Headings.d.ts
CHANGED
package/dist/Icon.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IconDefinition } from '@fortawesome/fontawesome-common-types';
|
|
2
|
+
import { JSX } from 'solid-js';
|
|
3
|
+
|
|
3
4
|
export type IconProps = {
|
|
4
5
|
class?: string;
|
|
5
6
|
style?: JSX.CSSProperties;
|
package/dist/IconButton.d.ts
CHANGED
package/dist/Link.d.ts
CHANGED
package/dist/Nav.d.ts
CHANGED
package/dist/NavHeader.d.ts
CHANGED
package/dist/NavLink.d.ts
CHANGED
package/dist/Page.d.ts
CHANGED
package/dist/RadioButtons.d.ts
CHANGED
package/dist/Row.d.ts
CHANGED
package/dist/Select.d.ts
CHANGED
package/dist/Spinner.d.ts
CHANGED
package/dist/TextBox.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { JSX } from
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
|
|
2
3
|
export type TextBoxProps = {
|
|
3
4
|
class?: string;
|
|
4
5
|
style?: JSX.CSSProperties;
|
|
5
6
|
id: string;
|
|
6
7
|
invalid: boolean;
|
|
7
8
|
errorId: string | undefined;
|
|
9
|
+
autocomplete?: string;
|
|
8
10
|
hidden?: boolean;
|
|
9
11
|
value: string;
|
|
10
12
|
onChange: (value: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
1
|
+
|
|
2
|
+
export * from './Button.tsx';
|
|
3
|
+
export * from './Card.tsx';
|
|
4
|
+
export * from './CheckBox.tsx';
|
|
5
|
+
export * from './CheckBoxes.tsx';
|
|
6
|
+
export * from './Column.tsx';
|
|
7
|
+
export * from './Dialog.tsx';
|
|
8
|
+
export * from './Field.tsx';
|
|
9
|
+
export * from './Form.tsx';
|
|
10
|
+
export * from './Header.tsx';
|
|
11
|
+
export * from './Headings.tsx';
|
|
12
|
+
export * from './Icon.tsx';
|
|
13
|
+
export * from './IconButton.tsx';
|
|
14
|
+
export * from './Link.tsx';
|
|
15
|
+
export * from './Nav.tsx';
|
|
16
|
+
export * from './NavHeader.tsx';
|
|
17
|
+
export * from './NavLink.tsx';
|
|
18
|
+
export * from './Page.tsx';
|
|
19
|
+
export * from './RadioButtons.tsx';
|
|
20
|
+
export * from './Row.tsx';
|
|
21
|
+
export * from './Select.tsx';
|
|
22
|
+
export * from './Spinner.tsx';
|
|
23
|
+
export * from './TextBox.tsx';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import "@fontsource/inter/400.css";
|
|
|
3
3
|
import "@fontsource/inter/500.css";
|
|
4
4
|
import { sharedConfig, createRenderEffect, untrack, createComponent, For, createMemo, createSignal, onMount } from "solid-js";
|
|
5
5
|
import { A } from "@solidjs/router";
|
|
6
|
-
const style$1 = "";
|
|
7
6
|
function reconcileArrays(parentNode, a, b) {
|
|
8
7
|
let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
|
|
9
8
|
while (aStart < aEnd || bStart < bEnd) {
|
|
@@ -83,12 +82,16 @@ function delegateEvents(eventNames, document2 = window.document) {
|
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
function setAttribute(node, name, value) {
|
|
85
|
+
if (!!sharedConfig.context && node.isConnected)
|
|
86
|
+
return;
|
|
86
87
|
if (value == null)
|
|
87
88
|
node.removeAttribute(name);
|
|
88
89
|
else
|
|
89
90
|
node.setAttribute(name, value);
|
|
90
91
|
}
|
|
91
92
|
function className(node, value) {
|
|
93
|
+
if (!!sharedConfig.context && node.isConnected)
|
|
94
|
+
return;
|
|
92
95
|
if (value == null)
|
|
93
96
|
node.removeAttribute("class");
|
|
94
97
|
else
|
|
@@ -156,7 +159,8 @@ function eventHandler(e) {
|
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
159
|
-
|
|
162
|
+
const hydrating = !!sharedConfig.context && parent.isConnected;
|
|
163
|
+
if (hydrating) {
|
|
160
164
|
!current && (current = [...parent.childNodes]);
|
|
161
165
|
let cleaned = [];
|
|
162
166
|
for (let i = 0; i < current.length; i++) {
|
|
@@ -175,14 +179,14 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
175
179
|
const t = typeof value, multi = marker !== void 0;
|
|
176
180
|
parent = multi && current[0] && current[0].parentNode || parent;
|
|
177
181
|
if (t === "string" || t === "number") {
|
|
178
|
-
if (
|
|
182
|
+
if (hydrating)
|
|
179
183
|
return current;
|
|
180
184
|
if (t === "number")
|
|
181
185
|
value = value.toString();
|
|
182
186
|
if (multi) {
|
|
183
187
|
let node = current[0];
|
|
184
188
|
if (node && node.nodeType === 3) {
|
|
185
|
-
node.data = value;
|
|
189
|
+
node.data !== value && (node.data = value);
|
|
186
190
|
} else
|
|
187
191
|
node = document.createTextNode(value);
|
|
188
192
|
current = cleanChildren(parent, current, marker, node);
|
|
@@ -193,7 +197,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
193
197
|
current = parent.textContent = value;
|
|
194
198
|
}
|
|
195
199
|
} else if (value == null || t === "boolean") {
|
|
196
|
-
if (
|
|
200
|
+
if (hydrating)
|
|
197
201
|
return current;
|
|
198
202
|
current = cleanChildren(parent, current, marker);
|
|
199
203
|
} else if (t === "function") {
|
|
@@ -211,13 +215,16 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
211
215
|
createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
212
216
|
return () => current;
|
|
213
217
|
}
|
|
214
|
-
if (
|
|
218
|
+
if (hydrating) {
|
|
215
219
|
if (!array.length)
|
|
216
220
|
return current;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
if (marker === void 0)
|
|
222
|
+
return [...parent.childNodes];
|
|
223
|
+
let node = array[0];
|
|
224
|
+
let nodes = [node];
|
|
225
|
+
while ((node = node.nextSibling) !== marker)
|
|
226
|
+
nodes.push(node);
|
|
227
|
+
return current = nodes;
|
|
221
228
|
}
|
|
222
229
|
if (array.length === 0) {
|
|
223
230
|
current = cleanChildren(parent, current, marker);
|
|
@@ -234,7 +241,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
234
241
|
}
|
|
235
242
|
current = array;
|
|
236
243
|
} else if (value.nodeType) {
|
|
237
|
-
if (
|
|
244
|
+
if (hydrating && value.parentNode)
|
|
238
245
|
return current = multi ? [value] : value;
|
|
239
246
|
if (Array.isArray(current)) {
|
|
240
247
|
if (multi)
|
|
@@ -246,13 +253,13 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
246
253
|
parent.replaceChild(value, parent.firstChild);
|
|
247
254
|
current = value;
|
|
248
255
|
} else
|
|
249
|
-
|
|
256
|
+
;
|
|
250
257
|
return current;
|
|
251
258
|
}
|
|
252
259
|
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
253
260
|
let dynamic = false;
|
|
254
261
|
for (let i = 0, len = array.length; i < len; i++) {
|
|
255
|
-
let item = array[i], prev = current && current[
|
|
262
|
+
let item = array[i], prev = current && current[normalized.length], t;
|
|
256
263
|
if (item == null || item === true || item === false)
|
|
257
264
|
;
|
|
258
265
|
else if ((t = typeof item) === "object" && item.nodeType) {
|
|
@@ -263,7 +270,11 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
263
270
|
if (unwrap) {
|
|
264
271
|
while (typeof item === "function")
|
|
265
272
|
item = item();
|
|
266
|
-
dynamic = normalizeIncomingArray(
|
|
273
|
+
dynamic = normalizeIncomingArray(
|
|
274
|
+
normalized,
|
|
275
|
+
Array.isArray(item) ? item : [item],
|
|
276
|
+
Array.isArray(prev) ? prev : [prev]
|
|
277
|
+
) || dynamic;
|
|
267
278
|
} else {
|
|
268
279
|
normalized.push(item);
|
|
269
280
|
dynamic = true;
|
|
@@ -312,146 +323,146 @@ function mergeClasses(a, b) {
|
|
|
312
323
|
return b;
|
|
313
324
|
return void 0;
|
|
314
325
|
}
|
|
315
|
-
|
|
326
|
+
var _tmpl$$k = /* @__PURE__ */ template(`<button>`);
|
|
316
327
|
function Button(props) {
|
|
317
328
|
return (() => {
|
|
318
|
-
|
|
329
|
+
var _el$ = _tmpl$$k();
|
|
319
330
|
_el$.$$click = () => props.onClick !== "submit" && !props.busy && props.onClick();
|
|
320
331
|
insert(_el$, () => props.label);
|
|
321
332
|
createRenderEffect((_p$) => {
|
|
322
|
-
|
|
323
|
-
_v$ !== _p$.
|
|
324
|
-
_p$.
|
|
325
|
-
_v$3 !== _p$.
|
|
326
|
-
_v$4 !== _p$.
|
|
333
|
+
var _v$ = mergeClasses(`z-button z-button--${props.type}`, props.class), _v$2 = props.style, _v$3 = props.busy, _v$4 = props.onClick === "submit" ? "submit" : "button";
|
|
334
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
335
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
336
|
+
_v$3 !== _p$.a && setAttribute(_el$, "aria-busy", _p$.a = _v$3);
|
|
337
|
+
_v$4 !== _p$.o && setAttribute(_el$, "type", _p$.o = _v$4);
|
|
327
338
|
return _p$;
|
|
328
339
|
}, {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
340
|
+
e: void 0,
|
|
341
|
+
t: void 0,
|
|
342
|
+
a: void 0,
|
|
343
|
+
o: void 0
|
|
333
344
|
});
|
|
334
345
|
return _el$;
|
|
335
346
|
})();
|
|
336
347
|
}
|
|
337
348
|
delegateEvents(["click"]);
|
|
338
|
-
|
|
349
|
+
var _tmpl$$j = /* @__PURE__ */ template(`<div>`);
|
|
339
350
|
function Card(props) {
|
|
340
351
|
return (() => {
|
|
341
|
-
|
|
352
|
+
var _el$ = _tmpl$$j();
|
|
342
353
|
insert(_el$, () => props.children);
|
|
343
354
|
createRenderEffect((_p$) => {
|
|
344
|
-
|
|
345
|
-
_v$ !== _p$.
|
|
346
|
-
_p$.
|
|
355
|
+
var _v$ = mergeClasses("z-card", props.class), _v$2 = props.style;
|
|
356
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
357
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
347
358
|
return _p$;
|
|
348
359
|
}, {
|
|
349
|
-
|
|
350
|
-
|
|
360
|
+
e: void 0,
|
|
361
|
+
t: void 0
|
|
351
362
|
});
|
|
352
363
|
return _el$;
|
|
353
364
|
})();
|
|
354
365
|
}
|
|
355
|
-
|
|
366
|
+
var _tmpl$$i = /* @__PURE__ */ template(`<div><input type=checkbox><label>`);
|
|
356
367
|
function CheckBox(props) {
|
|
357
368
|
return (() => {
|
|
358
|
-
|
|
369
|
+
var _el$ = _tmpl$$i(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
359
370
|
_el$2.addEventListener("change", () => props.onChange(!props.value));
|
|
360
371
|
insert(_el$3, () => props.label);
|
|
361
372
|
createRenderEffect((_p$) => {
|
|
362
|
-
|
|
363
|
-
_v$ !== _p$.
|
|
364
|
-
_p$.
|
|
365
|
-
_v$3 !== _p$.
|
|
366
|
-
_v$4 !== _p$.
|
|
367
|
-
_v$5 !== _p$.
|
|
368
|
-
_v$6 !== _p$.
|
|
373
|
+
var _v$ = mergeClasses("z-checkbox", props.class), _v$2 = props.style, _v$3 = props.id, _v$4 = props.invalid, _v$5 = props.errormessage, _v$6 = props.id;
|
|
374
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
375
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
376
|
+
_v$3 !== _p$.a && setAttribute(_el$2, "id", _p$.a = _v$3);
|
|
377
|
+
_v$4 !== _p$.o && setAttribute(_el$2, "aria-invalid", _p$.o = _v$4);
|
|
378
|
+
_v$5 !== _p$.i && setAttribute(_el$2, "aria-errormessage", _p$.i = _v$5);
|
|
379
|
+
_v$6 !== _p$.n && setAttribute(_el$3, "for", _p$.n = _v$6);
|
|
369
380
|
return _p$;
|
|
370
381
|
}, {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
382
|
+
e: void 0,
|
|
383
|
+
t: void 0,
|
|
384
|
+
a: void 0,
|
|
385
|
+
o: void 0,
|
|
386
|
+
i: void 0,
|
|
387
|
+
n: void 0
|
|
377
388
|
});
|
|
378
389
|
createRenderEffect(() => _el$2.checked = props.value);
|
|
379
390
|
return _el$;
|
|
380
391
|
})();
|
|
381
392
|
}
|
|
382
|
-
|
|
393
|
+
var _tmpl$$h = /* @__PURE__ */ template(`<fieldset><legend>`), _tmpl$2$5 = /* @__PURE__ */ template(`<div class=z-checkbox><input type=checkbox><label>`), _tmpl$3$3 = /* @__PURE__ */ template(`<div class=z-error>`), _tmpl$4$2 = /* @__PURE__ */ template(`<div class=z-error-placeholder>`);
|
|
383
394
|
function CheckBoxes(props) {
|
|
384
395
|
return (() => {
|
|
385
|
-
|
|
396
|
+
var _el$ = _tmpl$$h(), _el$2 = _el$.firstChild;
|
|
386
397
|
insert(_el$2, () => props.label);
|
|
387
398
|
insert(_el$, createComponent(For, {
|
|
388
399
|
get each() {
|
|
389
400
|
return props.options;
|
|
390
401
|
},
|
|
391
402
|
children: (option, index) => (() => {
|
|
392
|
-
|
|
403
|
+
var _el$3 = _tmpl$2$5(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling;
|
|
393
404
|
_el$4.addEventListener("change", () => option.onChange(!option.value));
|
|
394
405
|
insert(_el$5, () => option.label);
|
|
395
406
|
createRenderEffect((_p$) => {
|
|
396
|
-
|
|
397
|
-
_v$3 !== _p$.
|
|
398
|
-
_v$4 !== _p$.
|
|
399
|
-
_v$5 !== _p$.
|
|
400
|
-
_v$6 !== _p$.
|
|
407
|
+
var _v$3 = `${props.id}-${index()}`, _v$4 = !!props.error, _v$5 = props.error ? `${props.id}-error` : void 0, _v$6 = `${props.id}-${index()}`;
|
|
408
|
+
_v$3 !== _p$.e && setAttribute(_el$4, "id", _p$.e = _v$3);
|
|
409
|
+
_v$4 !== _p$.t && setAttribute(_el$4, "aria-invalid", _p$.t = _v$4);
|
|
410
|
+
_v$5 !== _p$.a && setAttribute(_el$4, "aria-errormessage", _p$.a = _v$5);
|
|
411
|
+
_v$6 !== _p$.o && setAttribute(_el$5, "for", _p$.o = _v$6);
|
|
401
412
|
return _p$;
|
|
402
413
|
}, {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
414
|
+
e: void 0,
|
|
415
|
+
t: void 0,
|
|
416
|
+
a: void 0,
|
|
417
|
+
o: void 0
|
|
407
418
|
});
|
|
408
419
|
createRenderEffect(() => _el$4.checked = option.value);
|
|
409
420
|
return _el$3;
|
|
410
421
|
})()
|
|
411
422
|
}), null);
|
|
412
423
|
insert(_el$, (() => {
|
|
413
|
-
|
|
424
|
+
var _c$ = createMemo(() => !!props.error);
|
|
414
425
|
return () => _c$() && (() => {
|
|
415
|
-
|
|
426
|
+
var _el$6 = _tmpl$3$3();
|
|
416
427
|
insert(_el$6, () => props.error);
|
|
417
428
|
createRenderEffect(() => setAttribute(_el$6, "id", `${props.id}-error`));
|
|
418
429
|
return _el$6;
|
|
419
430
|
})();
|
|
420
431
|
})(), null);
|
|
421
432
|
insert(_el$, (() => {
|
|
422
|
-
|
|
433
|
+
var _c$2 = createMemo(() => !!(!props.error && props.errorPlaceholder !== false));
|
|
423
434
|
return () => _c$2() && _tmpl$4$2();
|
|
424
435
|
})(), null);
|
|
425
436
|
createRenderEffect((_p$) => {
|
|
426
|
-
|
|
427
|
-
_v$ !== _p$.
|
|
428
|
-
_p$.
|
|
437
|
+
var _v$ = mergeClasses("z-fieldset", props.class), _v$2 = props.style;
|
|
438
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
439
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
429
440
|
return _p$;
|
|
430
441
|
}, {
|
|
431
|
-
|
|
432
|
-
|
|
442
|
+
e: void 0,
|
|
443
|
+
t: void 0
|
|
433
444
|
});
|
|
434
445
|
return _el$;
|
|
435
446
|
})();
|
|
436
447
|
}
|
|
437
|
-
|
|
448
|
+
var _tmpl$$g = /* @__PURE__ */ template(`<div>`);
|
|
438
449
|
function Column(props) {
|
|
439
450
|
return (() => {
|
|
440
|
-
|
|
451
|
+
var _el$ = _tmpl$$g();
|
|
441
452
|
insert(_el$, () => props.children);
|
|
442
453
|
createRenderEffect((_p$) => {
|
|
443
|
-
|
|
444
|
-
_v$ !== _p$.
|
|
445
|
-
_p$.
|
|
454
|
+
var _v$ = mergeClasses("z-column", props.class), _v$2 = props.style;
|
|
455
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
456
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
446
457
|
return _p$;
|
|
447
458
|
}, {
|
|
448
|
-
|
|
449
|
-
|
|
459
|
+
e: void 0,
|
|
460
|
+
t: void 0
|
|
450
461
|
});
|
|
451
462
|
return _el$;
|
|
452
463
|
})();
|
|
453
464
|
}
|
|
454
|
-
|
|
465
|
+
var _tmpl$$f = /* @__PURE__ */ template(`<dialog>`);
|
|
455
466
|
function Dialog(props) {
|
|
456
467
|
const [wasOutside, setWasOutside] = createSignal(false);
|
|
457
468
|
function isOutside(e) {
|
|
@@ -471,7 +482,7 @@ function Dialog(props) {
|
|
|
471
482
|
}, 100);
|
|
472
483
|
}
|
|
473
484
|
return (() => {
|
|
474
|
-
|
|
485
|
+
var _el$ = _tmpl$$f();
|
|
475
486
|
_el$.$$click = (e) => {
|
|
476
487
|
if (wasOutside() && isOutside(e)) {
|
|
477
488
|
e.preventDefault();
|
|
@@ -485,30 +496,30 @@ function Dialog(props) {
|
|
|
485
496
|
e.preventDefault();
|
|
486
497
|
close();
|
|
487
498
|
});
|
|
488
|
-
|
|
499
|
+
var _ref$ = dialog;
|
|
489
500
|
typeof _ref$ === "function" ? use(_ref$, _el$) : dialog = _el$;
|
|
490
501
|
insert(_el$, () => props.children(close));
|
|
491
502
|
createRenderEffect((_p$) => {
|
|
492
|
-
|
|
493
|
-
_v$ !== _p$.
|
|
494
|
-
_p$.
|
|
503
|
+
var _v$ = mergeClasses("z-dialog", props.class), _v$2 = props.style;
|
|
504
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
505
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
495
506
|
return _p$;
|
|
496
507
|
}, {
|
|
497
|
-
|
|
498
|
-
|
|
508
|
+
e: void 0,
|
|
509
|
+
t: void 0
|
|
499
510
|
});
|
|
500
511
|
return _el$;
|
|
501
512
|
})();
|
|
502
513
|
}
|
|
503
514
|
delegateEvents(["mousedown", "click"]);
|
|
504
|
-
|
|
515
|
+
var _tmpl$$e = /* @__PURE__ */ template(`<div>`), _tmpl$2$4 = /* @__PURE__ */ template(`<label>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class=z-error>`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class=z-error-placeholder>`);
|
|
505
516
|
function Field(props) {
|
|
506
517
|
return (() => {
|
|
507
|
-
|
|
518
|
+
var _el$ = _tmpl$$e();
|
|
508
519
|
insert(_el$, (() => {
|
|
509
|
-
|
|
520
|
+
var _c$ = createMemo(() => !!props.label);
|
|
510
521
|
return () => _c$() && (() => {
|
|
511
|
-
|
|
522
|
+
var _el$2 = _tmpl$2$4();
|
|
512
523
|
insert(_el$2, () => props.label);
|
|
513
524
|
createRenderEffect(() => setAttribute(_el$2, "for", props.id));
|
|
514
525
|
return _el$2;
|
|
@@ -520,120 +531,120 @@ function Field(props) {
|
|
|
520
531
|
errorId: props.error ? `${props.id}-error` : void 0
|
|
521
532
|
})), null);
|
|
522
533
|
insert(_el$, (() => {
|
|
523
|
-
|
|
534
|
+
var _c$2 = createMemo(() => !!props.error);
|
|
524
535
|
return () => _c$2() && (() => {
|
|
525
|
-
|
|
536
|
+
var _el$3 = _tmpl$3$2();
|
|
526
537
|
insert(_el$3, () => props.error);
|
|
527
538
|
createRenderEffect(() => setAttribute(_el$3, "id", `${props.id}-error`));
|
|
528
539
|
return _el$3;
|
|
529
540
|
})();
|
|
530
541
|
})(), null);
|
|
531
542
|
insert(_el$, (() => {
|
|
532
|
-
|
|
543
|
+
var _c$3 = createMemo(() => !!(!props.error && props.errorPlaceholder !== false));
|
|
533
544
|
return () => _c$3() && _tmpl$4$1();
|
|
534
545
|
})(), null);
|
|
535
546
|
createRenderEffect((_p$) => {
|
|
536
|
-
|
|
537
|
-
_v$ !== _p$.
|
|
538
|
-
_p$.
|
|
547
|
+
var _v$ = mergeClasses("z-field", props.class), _v$2 = props.style;
|
|
548
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
549
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
539
550
|
return _p$;
|
|
540
551
|
}, {
|
|
541
|
-
|
|
542
|
-
|
|
552
|
+
e: void 0,
|
|
553
|
+
t: void 0
|
|
543
554
|
});
|
|
544
555
|
return _el$;
|
|
545
556
|
})();
|
|
546
557
|
}
|
|
547
|
-
|
|
558
|
+
var _tmpl$$d = /* @__PURE__ */ template(`<form>`);
|
|
548
559
|
function Form(props) {
|
|
549
560
|
return (() => {
|
|
550
|
-
|
|
561
|
+
var _el$ = _tmpl$$d();
|
|
551
562
|
_el$.addEventListener("submit", (event) => {
|
|
552
563
|
event.preventDefault();
|
|
553
564
|
props.onSubmit();
|
|
554
565
|
});
|
|
555
566
|
insert(_el$, () => props.children);
|
|
556
567
|
createRenderEffect((_p$) => {
|
|
557
|
-
|
|
558
|
-
_v$ !== _p$.
|
|
559
|
-
_p$.
|
|
568
|
+
var _v$ = props.class, _v$2 = props.style;
|
|
569
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
570
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
560
571
|
return _p$;
|
|
561
572
|
}, {
|
|
562
|
-
|
|
563
|
-
|
|
573
|
+
e: void 0,
|
|
574
|
+
t: void 0
|
|
564
575
|
});
|
|
565
576
|
return _el$;
|
|
566
577
|
})();
|
|
567
578
|
}
|
|
568
|
-
|
|
579
|
+
var _tmpl$$c = /* @__PURE__ */ template(`<header><a class=z-header--app href=/><span></span></a><div class=z-header--buttons>`);
|
|
569
580
|
function Header(props) {
|
|
570
581
|
return (() => {
|
|
571
|
-
|
|
582
|
+
var _el$ = _tmpl$$c(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
|
|
572
583
|
insert(_el$2, () => props.appIcon, _el$3);
|
|
573
584
|
insert(_el$3, () => props.appName);
|
|
574
585
|
insert(_el$4, () => props.children);
|
|
575
586
|
createRenderEffect((_p$) => {
|
|
576
|
-
|
|
577
|
-
_v$ !== _p$.
|
|
578
|
-
_p$.
|
|
587
|
+
var _v$ = mergeClasses("z-header", props.class), _v$2 = props.style;
|
|
588
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
589
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
579
590
|
return _p$;
|
|
580
591
|
}, {
|
|
581
|
-
|
|
582
|
-
|
|
592
|
+
e: void 0,
|
|
593
|
+
t: void 0
|
|
583
594
|
});
|
|
584
595
|
return _el$;
|
|
585
596
|
})();
|
|
586
597
|
}
|
|
587
|
-
|
|
598
|
+
var _tmpl$$b = /* @__PURE__ */ template(`<h1>`), _tmpl$2$3 = /* @__PURE__ */ template(`<h2>`), _tmpl$3$1 = /* @__PURE__ */ template(`<h3>`);
|
|
588
599
|
function H1(props) {
|
|
589
600
|
return (() => {
|
|
590
|
-
|
|
601
|
+
var _el$ = _tmpl$$b();
|
|
591
602
|
insert(_el$, () => props.children);
|
|
592
603
|
createRenderEffect((_p$) => {
|
|
593
|
-
|
|
594
|
-
_v$ !== _p$.
|
|
595
|
-
_p$.
|
|
604
|
+
var _v$ = mergeClasses("z-" + (props.lookLike ?? "h1"), props.class), _v$2 = props.style;
|
|
605
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
606
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
596
607
|
return _p$;
|
|
597
608
|
}, {
|
|
598
|
-
|
|
599
|
-
|
|
609
|
+
e: void 0,
|
|
610
|
+
t: void 0
|
|
600
611
|
});
|
|
601
612
|
return _el$;
|
|
602
613
|
})();
|
|
603
614
|
}
|
|
604
615
|
function H2(props) {
|
|
605
616
|
return (() => {
|
|
606
|
-
|
|
617
|
+
var _el$2 = _tmpl$2$3();
|
|
607
618
|
insert(_el$2, () => props.children);
|
|
608
619
|
createRenderEffect((_p$) => {
|
|
609
|
-
|
|
610
|
-
_v$3 !== _p$.
|
|
611
|
-
_p$.
|
|
620
|
+
var _v$3 = mergeClasses("z-" + (props.lookLike ?? "h2"), props.class), _v$4 = props.style;
|
|
621
|
+
_v$3 !== _p$.e && className(_el$2, _p$.e = _v$3);
|
|
622
|
+
_p$.t = style(_el$2, _v$4, _p$.t);
|
|
612
623
|
return _p$;
|
|
613
624
|
}, {
|
|
614
|
-
|
|
615
|
-
|
|
625
|
+
e: void 0,
|
|
626
|
+
t: void 0
|
|
616
627
|
});
|
|
617
628
|
return _el$2;
|
|
618
629
|
})();
|
|
619
630
|
}
|
|
620
631
|
function H3(props) {
|
|
621
632
|
return (() => {
|
|
622
|
-
|
|
633
|
+
var _el$3 = _tmpl$3$1();
|
|
623
634
|
insert(_el$3, () => props.children);
|
|
624
635
|
createRenderEffect((_p$) => {
|
|
625
|
-
|
|
626
|
-
_v$5 !== _p$.
|
|
627
|
-
_p$.
|
|
636
|
+
var _v$5 = mergeClasses("z-" + (props.lookLike ?? "h3"), props.class), _v$6 = props.style;
|
|
637
|
+
_v$5 !== _p$.e && className(_el$3, _p$.e = _v$5);
|
|
638
|
+
_p$.t = style(_el$3, _v$6, _p$.t);
|
|
628
639
|
return _p$;
|
|
629
640
|
}, {
|
|
630
|
-
|
|
631
|
-
|
|
641
|
+
e: void 0,
|
|
642
|
+
t: void 0
|
|
632
643
|
});
|
|
633
644
|
return _el$3;
|
|
634
645
|
})();
|
|
635
646
|
}
|
|
636
|
-
|
|
647
|
+
var _tmpl$$a = /* @__PURE__ */ template(`<svg>`), _tmpl$2$2 = /* @__PURE__ */ template(`<svg><path fill=currentColor></svg>`, false, true);
|
|
637
648
|
function Icon(props) {
|
|
638
649
|
const data = createMemo(() => {
|
|
639
650
|
const [width, height, , , paths] = props.definition.icon;
|
|
@@ -644,51 +655,51 @@ function Icon(props) {
|
|
|
644
655
|
};
|
|
645
656
|
});
|
|
646
657
|
return (() => {
|
|
647
|
-
|
|
658
|
+
var _el$ = _tmpl$$a();
|
|
648
659
|
insert(_el$, createComponent(For, {
|
|
649
660
|
get each() {
|
|
650
661
|
return data().paths;
|
|
651
662
|
},
|
|
652
663
|
children: (path) => (() => {
|
|
653
|
-
|
|
664
|
+
var _el$2 = _tmpl$2$2();
|
|
654
665
|
setAttribute(_el$2, "d", path);
|
|
655
666
|
return _el$2;
|
|
656
667
|
})()
|
|
657
668
|
}));
|
|
658
669
|
createRenderEffect((_p$) => {
|
|
659
|
-
|
|
660
|
-
_v$ !== _p$.
|
|
661
|
-
_p$.
|
|
662
|
-
_v$3 !== _p$.
|
|
670
|
+
var _v$ = props.class, _v$2 = props.style, _v$3 = `0 0 ${data().width} ${data().height}`;
|
|
671
|
+
_v$ !== _p$.e && setAttribute(_el$, "class", _p$.e = _v$);
|
|
672
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
673
|
+
_v$3 !== _p$.a && setAttribute(_el$, "viewBox", _p$.a = _v$3);
|
|
663
674
|
return _p$;
|
|
664
675
|
}, {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
676
|
+
e: void 0,
|
|
677
|
+
t: void 0,
|
|
678
|
+
a: void 0
|
|
668
679
|
});
|
|
669
680
|
return _el$;
|
|
670
681
|
})();
|
|
671
682
|
}
|
|
672
|
-
|
|
683
|
+
var _tmpl$$9 = /* @__PURE__ */ template(`<button>`);
|
|
673
684
|
function IconButton(props) {
|
|
674
685
|
return (() => {
|
|
675
|
-
|
|
686
|
+
var _el$ = _tmpl$$9();
|
|
676
687
|
_el$.$$click = () => !props.busy && props.onClick();
|
|
677
688
|
insert(_el$, () => props.icon);
|
|
678
689
|
createRenderEffect((_p$) => {
|
|
679
|
-
|
|
680
|
-
_v$ !== _p$.
|
|
681
|
-
_p$.
|
|
682
|
-
_v$3 !== _p$.
|
|
683
|
-
_v$4 !== _p$.
|
|
684
|
-
_v$5 !== _p$.
|
|
690
|
+
var _v$ = mergeClasses(`z-button z-button--icon z-button--${props.type}`, props.class), _v$2 = props.style, _v$3 = props.busy, _v$4 = props.label, _v$5 = props.label;
|
|
691
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
692
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
693
|
+
_v$3 !== _p$.a && setAttribute(_el$, "aria-busy", _p$.a = _v$3);
|
|
694
|
+
_v$4 !== _p$.o && setAttribute(_el$, "aria-label", _p$.o = _v$4);
|
|
695
|
+
_v$5 !== _p$.i && setAttribute(_el$, "title", _p$.i = _v$5);
|
|
685
696
|
return _p$;
|
|
686
697
|
}, {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
698
|
+
e: void 0,
|
|
699
|
+
t: void 0,
|
|
700
|
+
a: void 0,
|
|
701
|
+
o: void 0,
|
|
702
|
+
i: void 0
|
|
692
703
|
});
|
|
693
704
|
return _el$;
|
|
694
705
|
})();
|
|
@@ -713,41 +724,41 @@ function Link(props) {
|
|
|
713
724
|
}
|
|
714
725
|
});
|
|
715
726
|
}
|
|
716
|
-
|
|
727
|
+
var _tmpl$$8 = /* @__PURE__ */ template(`<nav>`);
|
|
717
728
|
function Nav(props) {
|
|
718
729
|
return (() => {
|
|
719
|
-
|
|
730
|
+
var _el$ = _tmpl$$8();
|
|
720
731
|
insert(_el$, () => props.children);
|
|
721
732
|
createRenderEffect((_p$) => {
|
|
722
|
-
|
|
723
|
-
_v$ !== _p$.
|
|
724
|
-
_p$.
|
|
733
|
+
var _v$ = mergeClasses("z-nav", props.class), _v$2 = props.style;
|
|
734
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
735
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
725
736
|
return _p$;
|
|
726
737
|
}, {
|
|
727
|
-
|
|
728
|
-
|
|
738
|
+
e: void 0,
|
|
739
|
+
t: void 0
|
|
729
740
|
});
|
|
730
741
|
return _el$;
|
|
731
742
|
})();
|
|
732
743
|
}
|
|
733
|
-
|
|
744
|
+
var _tmpl$$7 = /* @__PURE__ */ template(`<div>`);
|
|
734
745
|
function NavHeader(props) {
|
|
735
746
|
return (() => {
|
|
736
|
-
|
|
747
|
+
var _el$ = _tmpl$$7();
|
|
737
748
|
insert(_el$, () => props.children);
|
|
738
749
|
createRenderEffect((_p$) => {
|
|
739
|
-
|
|
740
|
-
_v$ !== _p$.
|
|
741
|
-
_p$.
|
|
750
|
+
var _v$ = mergeClasses("z-nav--header", props.class), _v$2 = props.style;
|
|
751
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
752
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
742
753
|
return _p$;
|
|
743
754
|
}, {
|
|
744
|
-
|
|
745
|
-
|
|
755
|
+
e: void 0,
|
|
756
|
+
t: void 0
|
|
746
757
|
});
|
|
747
758
|
return _el$;
|
|
748
759
|
})();
|
|
749
760
|
}
|
|
750
|
-
|
|
761
|
+
var _tmpl$$6 = /* @__PURE__ */ template(`<span>`);
|
|
751
762
|
function NavLink(props) {
|
|
752
763
|
return createComponent(A, {
|
|
753
764
|
get ["class"]() {
|
|
@@ -764,108 +775,108 @@ function NavLink(props) {
|
|
|
764
775
|
end: true,
|
|
765
776
|
get children() {
|
|
766
777
|
return [createMemo(() => props.icon), (() => {
|
|
767
|
-
|
|
778
|
+
var _el$ = _tmpl$$6();
|
|
768
779
|
insert(_el$, () => props.text);
|
|
769
780
|
return _el$;
|
|
770
781
|
})()];
|
|
771
782
|
}
|
|
772
783
|
});
|
|
773
784
|
}
|
|
774
|
-
|
|
785
|
+
var _tmpl$$5 = /* @__PURE__ */ template(`<div>`);
|
|
775
786
|
function Page(props) {
|
|
776
787
|
return (() => {
|
|
777
|
-
|
|
788
|
+
var _el$ = _tmpl$$5();
|
|
778
789
|
insert(_el$, () => props.children);
|
|
779
790
|
createRenderEffect((_p$) => {
|
|
780
|
-
|
|
781
|
-
_v$ !== _p$.
|
|
782
|
-
_p$.
|
|
791
|
+
var _v$ = mergeClasses(`z-page z-page--layout-${props.layout} z-theme--${props.theme}`, props.class), _v$2 = props.style;
|
|
792
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
793
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
783
794
|
return _p$;
|
|
784
795
|
}, {
|
|
785
|
-
|
|
786
|
-
|
|
796
|
+
e: void 0,
|
|
797
|
+
t: void 0
|
|
787
798
|
});
|
|
788
799
|
return _el$;
|
|
789
800
|
})();
|
|
790
801
|
}
|
|
791
|
-
|
|
802
|
+
var _tmpl$$4 = /* @__PURE__ */ template(`<fieldset><legend>`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class=z-radiobutton><input type=radio><label>`), _tmpl$3 = /* @__PURE__ */ template(`<div class=z-error>`), _tmpl$4 = /* @__PURE__ */ template(`<div class=z-error-placeholder>`);
|
|
792
803
|
function RadioButtons(props) {
|
|
793
804
|
return (() => {
|
|
794
|
-
|
|
805
|
+
var _el$ = _tmpl$$4(), _el$2 = _el$.firstChild;
|
|
795
806
|
insert(_el$2, () => props.label);
|
|
796
807
|
insert(_el$, createComponent(For, {
|
|
797
808
|
get each() {
|
|
798
809
|
return props.options;
|
|
799
810
|
},
|
|
800
811
|
children: (option, index) => (() => {
|
|
801
|
-
|
|
812
|
+
var _el$3 = _tmpl$2$1(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling;
|
|
802
813
|
_el$4.addEventListener("change", () => props.onChange(option.value));
|
|
803
814
|
insert(_el$5, () => option.label);
|
|
804
815
|
createRenderEffect((_p$) => {
|
|
805
|
-
|
|
806
|
-
_v$3 !== _p$.
|
|
807
|
-
_v$4 !== _p$.
|
|
808
|
-
_v$5 !== _p$.
|
|
809
|
-
_v$6 !== _p$.
|
|
810
|
-
_v$7 !== _p$.
|
|
816
|
+
var _v$3 = props.id, _v$4 = `${props.id}-${index()}`, _v$5 = !!props.error, _v$6 = props.error ? `${props.id}-error` : void 0, _v$7 = `${props.id}-${index()}`;
|
|
817
|
+
_v$3 !== _p$.e && setAttribute(_el$4, "name", _p$.e = _v$3);
|
|
818
|
+
_v$4 !== _p$.t && setAttribute(_el$4, "id", _p$.t = _v$4);
|
|
819
|
+
_v$5 !== _p$.a && setAttribute(_el$4, "aria-invalid", _p$.a = _v$5);
|
|
820
|
+
_v$6 !== _p$.o && setAttribute(_el$4, "aria-errormessage", _p$.o = _v$6);
|
|
821
|
+
_v$7 !== _p$.i && setAttribute(_el$5, "for", _p$.i = _v$7);
|
|
811
822
|
return _p$;
|
|
812
823
|
}, {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
824
|
+
e: void 0,
|
|
825
|
+
t: void 0,
|
|
826
|
+
a: void 0,
|
|
827
|
+
o: void 0,
|
|
828
|
+
i: void 0
|
|
818
829
|
});
|
|
819
830
|
createRenderEffect(() => _el$4.checked = option.value === props.value);
|
|
820
831
|
return _el$3;
|
|
821
832
|
})()
|
|
822
833
|
}), null);
|
|
823
834
|
insert(_el$, (() => {
|
|
824
|
-
|
|
835
|
+
var _c$ = createMemo(() => !!props.error);
|
|
825
836
|
return () => _c$() && (() => {
|
|
826
|
-
|
|
837
|
+
var _el$6 = _tmpl$3();
|
|
827
838
|
insert(_el$6, () => props.error);
|
|
828
839
|
createRenderEffect(() => setAttribute(_el$6, "id", `${props.id}-error`));
|
|
829
840
|
return _el$6;
|
|
830
841
|
})();
|
|
831
842
|
})(), null);
|
|
832
843
|
insert(_el$, (() => {
|
|
833
|
-
|
|
844
|
+
var _c$2 = createMemo(() => !!(!props.error && props.errorPlaceholder !== false));
|
|
834
845
|
return () => _c$2() && _tmpl$4();
|
|
835
846
|
})(), null);
|
|
836
847
|
createRenderEffect((_p$) => {
|
|
837
|
-
|
|
838
|
-
_v$ !== _p$.
|
|
839
|
-
_p$.
|
|
848
|
+
var _v$ = mergeClasses("z-fieldset", props.class), _v$2 = props.style;
|
|
849
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
850
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
840
851
|
return _p$;
|
|
841
852
|
}, {
|
|
842
|
-
|
|
843
|
-
|
|
853
|
+
e: void 0,
|
|
854
|
+
t: void 0
|
|
844
855
|
});
|
|
845
856
|
return _el$;
|
|
846
857
|
})();
|
|
847
858
|
}
|
|
848
|
-
|
|
859
|
+
var _tmpl$$3 = /* @__PURE__ */ template(`<div>`);
|
|
849
860
|
function Row(props) {
|
|
850
861
|
return (() => {
|
|
851
|
-
|
|
862
|
+
var _el$ = _tmpl$$3();
|
|
852
863
|
insert(_el$, () => props.children);
|
|
853
864
|
createRenderEffect((_p$) => {
|
|
854
|
-
|
|
855
|
-
_v$ !== _p$.
|
|
856
|
-
_p$.
|
|
865
|
+
var _v$ = mergeClasses("z-row", props.class), _v$2 = props.style;
|
|
866
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
867
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
857
868
|
return _p$;
|
|
858
869
|
}, {
|
|
859
|
-
|
|
860
|
-
|
|
870
|
+
e: void 0,
|
|
871
|
+
t: void 0
|
|
861
872
|
});
|
|
862
873
|
return _el$;
|
|
863
874
|
})();
|
|
864
875
|
}
|
|
865
|
-
|
|
876
|
+
var _tmpl$$2 = /* @__PURE__ */ template(`<select>`), _tmpl$2 = /* @__PURE__ */ template(`<option>`);
|
|
866
877
|
function Select(props) {
|
|
867
878
|
return (() => {
|
|
868
|
-
|
|
879
|
+
var _el$ = _tmpl$$2();
|
|
869
880
|
_el$.addEventListener("change", (e) => {
|
|
870
881
|
const option = props.options[Number(e.target.value)];
|
|
871
882
|
props.onChange(option.value);
|
|
@@ -875,68 +886,70 @@ function Select(props) {
|
|
|
875
886
|
return props.options;
|
|
876
887
|
},
|
|
877
888
|
children: (option, index) => (() => {
|
|
878
|
-
|
|
889
|
+
var _el$2 = _tmpl$2();
|
|
879
890
|
insert(_el$2, () => option.label);
|
|
880
891
|
createRenderEffect(() => _el$2.value = index());
|
|
881
892
|
return _el$2;
|
|
882
893
|
})()
|
|
883
894
|
}));
|
|
884
895
|
createRenderEffect((_p$) => {
|
|
885
|
-
|
|
886
|
-
_v$ !== _p$.
|
|
887
|
-
_p$.
|
|
888
|
-
_v$3 !== _p$.
|
|
889
|
-
_v$4 !== _p$.
|
|
890
|
-
_v$5 !== _p$.
|
|
896
|
+
var _v$ = mergeClasses("z-select", props.class), _v$2 = props.style, _v$3 = props.id, _v$4 = props.invalid, _v$5 = props.errorId;
|
|
897
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
898
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
899
|
+
_v$3 !== _p$.a && setAttribute(_el$, "id", _p$.a = _v$3);
|
|
900
|
+
_v$4 !== _p$.o && setAttribute(_el$, "aria-invalid", _p$.o = _v$4);
|
|
901
|
+
_v$5 !== _p$.i && setAttribute(_el$, "aria-errormessage", _p$.i = _v$5);
|
|
891
902
|
return _p$;
|
|
892
903
|
}, {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
904
|
+
e: void 0,
|
|
905
|
+
t: void 0,
|
|
906
|
+
a: void 0,
|
|
907
|
+
o: void 0,
|
|
908
|
+
i: void 0
|
|
898
909
|
});
|
|
899
910
|
createRenderEffect(() => _el$.value = props.options.findIndex((it) => it.value === props.value));
|
|
900
911
|
return _el$;
|
|
901
912
|
})();
|
|
902
913
|
}
|
|
903
|
-
|
|
914
|
+
var _tmpl$$1 = /* @__PURE__ */ template(`<div>`);
|
|
904
915
|
function Spinner(props) {
|
|
905
916
|
return (() => {
|
|
906
|
-
|
|
917
|
+
var _el$ = _tmpl$$1();
|
|
907
918
|
createRenderEffect((_p$) => {
|
|
908
|
-
|
|
909
|
-
_v$ !== _p$.
|
|
910
|
-
_p$.
|
|
919
|
+
var _v$ = mergeClasses(`z-spinner z-spinner--${props.size ?? "normal"}`, props.class), _v$2 = props.style;
|
|
920
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
921
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
911
922
|
return _p$;
|
|
912
923
|
}, {
|
|
913
|
-
|
|
914
|
-
|
|
924
|
+
e: void 0,
|
|
925
|
+
t: void 0
|
|
915
926
|
});
|
|
916
927
|
return _el$;
|
|
917
928
|
})();
|
|
918
929
|
}
|
|
919
|
-
|
|
930
|
+
var _tmpl$ = /* @__PURE__ */ template(`<input>`);
|
|
920
931
|
function TextBox(props) {
|
|
921
932
|
return (() => {
|
|
922
|
-
|
|
933
|
+
var _el$ = _tmpl$();
|
|
923
934
|
_el$.$$input = (e) => props.onChange(e.target.value);
|
|
924
935
|
createRenderEffect((_p$) => {
|
|
925
|
-
|
|
926
|
-
_v$ !== _p$.
|
|
927
|
-
_p$.
|
|
928
|
-
_v$3 !== _p$.
|
|
929
|
-
_v$4 !== _p$.
|
|
930
|
-
_v$5 !== _p$.
|
|
931
|
-
_v$6 !== _p$.
|
|
936
|
+
var _v$ = mergeClasses("z-textbox", props.class), _v$2 = props.style, _v$3 = props.autocomplete ?? "off", _v$4 = props.hidden ? "password" : "text", _v$5 = props.id, _v$6 = props.invalid, _v$7 = props.errorId;
|
|
937
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
938
|
+
_p$.t = style(_el$, _v$2, _p$.t);
|
|
939
|
+
_v$3 !== _p$.a && setAttribute(_el$, "autocomplete", _p$.a = _v$3);
|
|
940
|
+
_v$4 !== _p$.o && setAttribute(_el$, "type", _p$.o = _v$4);
|
|
941
|
+
_v$5 !== _p$.i && setAttribute(_el$, "id", _p$.i = _v$5);
|
|
942
|
+
_v$6 !== _p$.n && setAttribute(_el$, "aria-invalid", _p$.n = _v$6);
|
|
943
|
+
_v$7 !== _p$.s && setAttribute(_el$, "aria-errormessage", _p$.s = _v$7);
|
|
932
944
|
return _p$;
|
|
933
945
|
}, {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
946
|
+
e: void 0,
|
|
947
|
+
t: void 0,
|
|
948
|
+
a: void 0,
|
|
949
|
+
o: void 0,
|
|
950
|
+
i: void 0,
|
|
951
|
+
n: void 0,
|
|
952
|
+
s: void 0
|
|
940
953
|
});
|
|
941
954
|
createRenderEffect(() => _el$.value = props.value);
|
|
942
955
|
return _el$;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lundal/zed-solid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"@fortawesome/free-regular-svg-icons": "6",
|
|
19
19
|
"@fortawesome/free-solid-svg-icons": "6",
|
|
20
20
|
"@lundal/zed-css": "file:../css",
|
|
21
|
-
"@solidjs/router": "0.
|
|
21
|
+
"@solidjs/router": "0.13",
|
|
22
22
|
"solid-js": "1",
|
|
23
23
|
"prettier": "3",
|
|
24
24
|
"typescript": "5",
|
|
25
|
-
"vite": "
|
|
26
|
-
"vite-plugin-dts": "
|
|
25
|
+
"vite": "5",
|
|
26
|
+
"vite-plugin-dts": "3",
|
|
27
27
|
"vite-plugin-libcss": "1",
|
|
28
28
|
"vite-plugin-solid": "2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@solidjs/router": "0.
|
|
31
|
+
"@solidjs/router": "0.13",
|
|
32
32
|
"solid-js": "1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|