@paraxe/vue 1.0.2 → 1.0.4
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/forms/Checkbox.d.ts +1 -1
- package/dist/forms/ChoiceGroup.d.ts +1 -1
- package/dist/forms/Input.d.ts +5 -7
- package/dist/forms/Select.d.ts +4 -4
- package/dist/forms/Textarea.d.ts +1 -1
- package/dist/index.js +103 -97
- package/package.json +1 -1
- package/pnpm-workspace.yaml +2 -0
- package/src/forms/Input.vue +10 -9
- package/src/forms/Select.vue +17 -16
- package/dist/.loba-build.json +0 -5
package/dist/forms/Checkbox.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
14
14
|
onChange?: ((value: boolean) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
16
|
disabled: boolean;
|
|
17
|
-
value: boolean;
|
|
18
17
|
required: boolean;
|
|
18
|
+
value: boolean;
|
|
19
19
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -19,8 +19,8 @@ declare const __VLS_base: import('vue').DefineComponent<ChoiceGroupProps, {}, {}
|
|
|
19
19
|
"onUpdate:modelValue"?: ((value: string | number | (string | number)[] | null) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
21
|
disabled: boolean;
|
|
22
|
-
multiple: boolean;
|
|
23
22
|
modelValue: string | number | Array<string | number> | null;
|
|
23
|
+
multiple: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
26
|
declare const _default: typeof __VLS_export;
|
package/dist/forms/Input.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputType } from '@paraxe/core';
|
|
2
2
|
interface Props {
|
|
3
|
-
type
|
|
3
|
+
type?: InputType;
|
|
4
4
|
placeholder?: string;
|
|
5
|
-
|
|
5
|
+
modelValue?: string;
|
|
6
6
|
required?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
readonly?: boolean;
|
|
@@ -10,16 +10,14 @@ interface Props {
|
|
|
10
10
|
success?: boolean;
|
|
11
11
|
}
|
|
12
12
|
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
-
|
|
14
|
-
change: (value: string) => any;
|
|
13
|
+
"update:modelValue": (value: string) => any;
|
|
15
14
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
16
|
-
|
|
17
|
-
onChange?: ((value: string) => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
18
16
|
}>, {
|
|
19
17
|
disabled: boolean;
|
|
20
18
|
type: InputType;
|
|
21
19
|
placeholder: string;
|
|
22
|
-
|
|
20
|
+
modelValue: string;
|
|
23
21
|
required: boolean;
|
|
24
22
|
readonly: boolean;
|
|
25
23
|
error: boolean;
|
package/dist/forms/Select.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface Props {
|
|
2
|
-
|
|
2
|
+
modelValue?: string;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
error?: boolean;
|
|
5
5
|
success?: boolean;
|
|
@@ -9,12 +9,12 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_1) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
-
|
|
12
|
+
"update:modelValue": (value: string) => any;
|
|
13
13
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
14
|
-
|
|
14
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
16
|
disabled: boolean;
|
|
17
|
-
|
|
17
|
+
modelValue: string;
|
|
18
18
|
error: boolean;
|
|
19
19
|
success: boolean;
|
|
20
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
package/dist/forms/Textarea.d.ts
CHANGED
|
@@ -14,10 +14,10 @@ declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {},
|
|
|
14
14
|
onChange?: ((value: string) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
16
|
disabled: boolean;
|
|
17
|
-
value: string;
|
|
18
17
|
readonly: boolean;
|
|
19
18
|
error: boolean;
|
|
20
19
|
success: boolean;
|
|
20
|
+
value: string;
|
|
21
21
|
maxlength: number;
|
|
22
22
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const _default: typeof __VLS_export;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as m, computed as b, openBlock as n, createElementBlock as d, normalizeClass as f, renderSlot as u, createBlock as T, resolveDynamicComponent as A, withCtx as
|
|
2
|
-
const oe = ["disabled"],
|
|
1
|
+
import { defineComponent as m, computed as b, openBlock as n, createElementBlock as d, normalizeClass as f, renderSlot as u, createBlock as T, resolveDynamicComponent as A, withCtx as L, createCommentVNode as $, createElementVNode as p, createTextVNode as R, toDisplayString as S, ref as V, provide as M, inject as z, withDirectives as te, vShow as ae, useModel as se, watch as K, mergeModels as Q, withKeys as j, withModifiers as Y, unref as N, Fragment as q, renderList as G, normalizeStyle as W, useSlots as le, onMounted as J, onBeforeUnmount as O, Teleport as U, nextTick as Z } from "vue";
|
|
2
|
+
const oe = ["disabled"], It = /* @__PURE__ */ m({
|
|
3
3
|
__name: "Button",
|
|
4
4
|
props: {
|
|
5
5
|
variant: { default: "primary" },
|
|
@@ -28,7 +28,7 @@ const oe = ["disabled"], Lt = /* @__PURE__ */ m({
|
|
|
28
28
|
u(r.$slots, "default")
|
|
29
29
|
], 10, oe));
|
|
30
30
|
}
|
|
31
|
-
}),
|
|
31
|
+
}), Lt = /* @__PURE__ */ m({
|
|
32
32
|
__name: "Card",
|
|
33
33
|
props: {
|
|
34
34
|
variant: { default: "default" },
|
|
@@ -42,7 +42,7 @@ const oe = ["disabled"], Lt = /* @__PURE__ */ m({
|
|
|
42
42
|
return (s, l) => (n(), T(A(e.as), {
|
|
43
43
|
class: f(t.value)
|
|
44
44
|
}, {
|
|
45
|
-
default:
|
|
45
|
+
default: L(() => [
|
|
46
46
|
u(s.$slots, "default")
|
|
47
47
|
]),
|
|
48
48
|
_: 3
|
|
@@ -53,29 +53,34 @@ const oe = ["disabled"], Lt = /* @__PURE__ */ m({
|
|
|
53
53
|
props: {
|
|
54
54
|
type: { default: "text" },
|
|
55
55
|
placeholder: { default: "" },
|
|
56
|
-
|
|
56
|
+
modelValue: { default: "" },
|
|
57
57
|
required: { type: Boolean, default: !1 },
|
|
58
58
|
disabled: { type: Boolean, default: !1 },
|
|
59
59
|
readonly: { type: Boolean, default: !1 },
|
|
60
60
|
error: { type: Boolean, default: !1 },
|
|
61
61
|
success: { type: Boolean, default: !1 }
|
|
62
62
|
},
|
|
63
|
-
emits: ["
|
|
63
|
+
emits: ["update:modelValue"],
|
|
64
64
|
setup(a, { emit: e }) {
|
|
65
65
|
const t = a, s = e, l = b(() => ({
|
|
66
66
|
"input-error": t.error,
|
|
67
67
|
"input-success": t.success
|
|
68
68
|
}));
|
|
69
|
-
|
|
69
|
+
function o(r) {
|
|
70
|
+
s(
|
|
71
|
+
"update:modelValue",
|
|
72
|
+
r.target.value
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return (r, i) => (n(), d("input", {
|
|
70
76
|
class: f(["input", l.value]),
|
|
71
77
|
type: t.type,
|
|
72
78
|
placeholder: t.placeholder,
|
|
73
|
-
value: t.
|
|
79
|
+
value: t.modelValue,
|
|
74
80
|
required: t.required,
|
|
75
81
|
disabled: t.disabled,
|
|
76
82
|
readonly: t.readonly,
|
|
77
|
-
onInput:
|
|
78
|
-
onChange: r[1] || (r[1] = (i) => s("change", i.target.value))
|
|
83
|
+
onInput: o
|
|
79
84
|
}, null, 42, ne));
|
|
80
85
|
}
|
|
81
86
|
}), H = (a, e) => {
|
|
@@ -159,7 +164,7 @@ const At = /* @__PURE__ */ H(ie, [["render", de]]), Mt = /* @__PURE__ */ m({
|
|
|
159
164
|
return (s, l) => (n(), T(A(a.level), {
|
|
160
165
|
class: f(t.value)
|
|
161
166
|
}, {
|
|
162
|
-
default:
|
|
167
|
+
default: L(() => [
|
|
163
168
|
u(s.$slots, "default")
|
|
164
169
|
]),
|
|
165
170
|
_: 3
|
|
@@ -183,7 +188,7 @@ const At = /* @__PURE__ */ H(ie, [["render", de]]), Mt = /* @__PURE__ */ m({
|
|
|
183
188
|
return (s, l) => (n(), T(A(e.as), {
|
|
184
189
|
class: f(t.value)
|
|
185
190
|
}, {
|
|
186
|
-
default:
|
|
191
|
+
default: L(() => [
|
|
187
192
|
u(s.$slots, "default")
|
|
188
193
|
]),
|
|
189
194
|
_: 3
|
|
@@ -240,7 +245,7 @@ function be(a, e) {
|
|
|
240
245
|
const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
|
|
241
246
|
key: 0,
|
|
242
247
|
"aria-hidden": "true"
|
|
243
|
-
}, _e = { key: 1 },
|
|
248
|
+
}, _e = { key: 1 }, ye = /* @__PURE__ */ m({
|
|
244
249
|
__name: "Label",
|
|
245
250
|
props: {
|
|
246
251
|
for: { default: void 0 },
|
|
@@ -260,7 +265,7 @@ const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
|
|
|
260
265
|
e.required ? (n(), d("span", he, "*")) : e.optional ? (n(), d("span", _e, "(optional)")) : $("", !0)
|
|
261
266
|
], 10, ve));
|
|
262
267
|
}
|
|
263
|
-
}),
|
|
268
|
+
}), ge = ["src", "alt"], jt = /* @__PURE__ */ m({
|
|
264
269
|
__name: "Image",
|
|
265
270
|
props: {
|
|
266
271
|
src: {},
|
|
@@ -282,7 +287,7 @@ const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
|
|
|
282
287
|
p("img", {
|
|
283
288
|
src: e.src,
|
|
284
289
|
alt: e.alt
|
|
285
|
-
}, null, 8,
|
|
290
|
+
}, null, 8, ge)
|
|
286
291
|
], 2));
|
|
287
292
|
}
|
|
288
293
|
}), $e = { class: "form-field" }, Ht = /* @__PURE__ */ m({
|
|
@@ -299,14 +304,14 @@ const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
|
|
|
299
304
|
setup(a) {
|
|
300
305
|
const e = a;
|
|
301
306
|
return (t, s) => (n(), d("div", $e, [
|
|
302
|
-
e.label ? (n(), T(
|
|
307
|
+
e.label ? (n(), T(ye, {
|
|
303
308
|
key: 0,
|
|
304
309
|
for: e.id,
|
|
305
310
|
required: e.required,
|
|
306
311
|
optional: e.optional,
|
|
307
312
|
disabled: e.disabled
|
|
308
313
|
}, {
|
|
309
|
-
default:
|
|
314
|
+
default: L(() => [
|
|
310
315
|
R(S(e.label), 1)
|
|
311
316
|
]),
|
|
312
317
|
_: 1
|
|
@@ -316,7 +321,7 @@ const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
|
|
|
316
321
|
key: 1,
|
|
317
322
|
tone: "muted"
|
|
318
323
|
}, {
|
|
319
|
-
default:
|
|
324
|
+
default: L(() => [
|
|
320
325
|
R(S(e.description), 1)
|
|
321
326
|
]),
|
|
322
327
|
_: 1
|
|
@@ -325,7 +330,7 @@ const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
|
|
|
325
330
|
key: 2,
|
|
326
331
|
tone: "accent"
|
|
327
332
|
}, {
|
|
328
|
-
default:
|
|
333
|
+
default: L(() => [
|
|
329
334
|
R(S(e.error), 1)
|
|
330
335
|
]),
|
|
331
336
|
_: 1
|
|
@@ -369,26 +374,27 @@ const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
|
|
|
369
374
|
}), we = ["value", "disabled"], Wt = /* @__PURE__ */ m({
|
|
370
375
|
__name: "Select",
|
|
371
376
|
props: {
|
|
372
|
-
|
|
377
|
+
modelValue: { default: "" },
|
|
373
378
|
disabled: { type: Boolean, default: !1 },
|
|
374
379
|
error: { type: Boolean, default: !1 },
|
|
375
380
|
success: { type: Boolean, default: !1 }
|
|
376
381
|
},
|
|
377
|
-
emits: ["
|
|
382
|
+
emits: ["update:modelValue"],
|
|
378
383
|
setup(a, { emit: e }) {
|
|
379
|
-
const t = a, s = e
|
|
384
|
+
const t = a, s = e;
|
|
385
|
+
function l(r) {
|
|
386
|
+
const i = r.target;
|
|
387
|
+
s("update:modelValue", i.value);
|
|
388
|
+
}
|
|
389
|
+
const o = b(() => ({
|
|
380
390
|
"input-error": t.error,
|
|
381
391
|
"input-success": t.success
|
|
382
392
|
}));
|
|
383
|
-
function o(r) {
|
|
384
|
-
const i = r.target;
|
|
385
|
-
s("change", i.value);
|
|
386
|
-
}
|
|
387
393
|
return (r, i) => (n(), d("select", {
|
|
388
|
-
class: f(["select",
|
|
389
|
-
value: t.
|
|
394
|
+
class: f(["select", o.value]),
|
|
395
|
+
value: t.modelValue,
|
|
390
396
|
disabled: t.disabled,
|
|
391
|
-
onChange:
|
|
397
|
+
onChange: l
|
|
392
398
|
}, [
|
|
393
399
|
u(r.$slots, "default")
|
|
394
400
|
], 42, we));
|
|
@@ -495,7 +501,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
495
501
|
}), Te = {
|
|
496
502
|
key: 0,
|
|
497
503
|
class: "empty-state-icon"
|
|
498
|
-
}, De = { class: "empty-state-content" },
|
|
504
|
+
}, De = { class: "empty-state-content" }, Ie = {
|
|
499
505
|
key: 1,
|
|
500
506
|
class: "empty-state-actions"
|
|
501
507
|
}, Yt = /* @__PURE__ */ m({
|
|
@@ -510,21 +516,21 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
510
516
|
return (s, l) => (n(), T(A(e.as), {
|
|
511
517
|
class: f(t.value)
|
|
512
518
|
}, {
|
|
513
|
-
default:
|
|
519
|
+
default: L(() => [
|
|
514
520
|
s.$slots.icon ? (n(), d("div", Te, [
|
|
515
521
|
u(s.$slots, "icon")
|
|
516
522
|
])) : $("", !0),
|
|
517
523
|
p("div", De, [
|
|
518
524
|
u(s.$slots, "default")
|
|
519
525
|
]),
|
|
520
|
-
s.$slots.actions ? (n(), d("div",
|
|
526
|
+
s.$slots.actions ? (n(), d("div", Ie, [
|
|
521
527
|
u(s.$slots, "actions")
|
|
522
528
|
])) : $("", !0)
|
|
523
529
|
]),
|
|
524
530
|
_: 3
|
|
525
531
|
}, 8, ["class"]));
|
|
526
532
|
}
|
|
527
|
-
}),
|
|
533
|
+
}), Le = { class: "list" }, Zt = /* @__PURE__ */ m({
|
|
528
534
|
__name: "List",
|
|
529
535
|
props: /* @__PURE__ */ Q({
|
|
530
536
|
selectable: { type: Boolean, default: !1 },
|
|
@@ -561,15 +567,15 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
561
567
|
s.value
|
|
562
568
|
);
|
|
563
569
|
t.multiple ? c.has(i) ? c.delete(i) : c.add(i) : c.has(i) ? c.clear() : (c.clear(), c.add(i)), s.value = c;
|
|
564
|
-
const
|
|
565
|
-
l.value = t.multiple ?
|
|
570
|
+
const y = [...c];
|
|
571
|
+
l.value = t.multiple ? y : y[0] ?? null;
|
|
566
572
|
}
|
|
567
573
|
return M("loba-list", {
|
|
568
574
|
selectable: t.selectable,
|
|
569
575
|
multiple: t.multiple,
|
|
570
576
|
isSelected: o,
|
|
571
577
|
toggleSelection: r
|
|
572
|
-
}), (i, c) => (n(), d("div",
|
|
578
|
+
}), (i, c) => (n(), d("div", Le, [
|
|
573
579
|
u(i.$slots, "default")
|
|
574
580
|
]));
|
|
575
581
|
}
|
|
@@ -643,13 +649,13 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
643
649
|
l.value
|
|
644
650
|
)
|
|
645
651
|
), r = b(() => {
|
|
646
|
-
const
|
|
652
|
+
const g = l.value, B = o.value, k = Math.max(
|
|
647
653
|
0,
|
|
648
654
|
t.siblingCount
|
|
649
655
|
);
|
|
650
|
-
if (
|
|
656
|
+
if (g <= 7)
|
|
651
657
|
return Array.from(
|
|
652
|
-
{ length:
|
|
658
|
+
{ length: g },
|
|
653
659
|
(F, ee) => ee + 1
|
|
654
660
|
);
|
|
655
661
|
const _ = Math.max(
|
|
@@ -657,20 +663,20 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
657
663
|
1
|
|
658
664
|
), w = Math.min(
|
|
659
665
|
B + k,
|
|
660
|
-
|
|
661
|
-
), v = _ > 2, C = w <
|
|
666
|
+
g
|
|
667
|
+
), v = _ > 2, C = w < g - 1, x = [1];
|
|
662
668
|
v && x.push("...");
|
|
663
|
-
const
|
|
664
|
-
for (let F =
|
|
669
|
+
const I = v ? _ : 2, P = C ? w : g - 1;
|
|
670
|
+
for (let F = I; F <= P; F++)
|
|
665
671
|
x.push(F);
|
|
666
|
-
return C && x.push("..."), x.push(
|
|
672
|
+
return C && x.push("..."), x.push(g), x;
|
|
667
673
|
}), i = b(() => ({
|
|
668
674
|
pagination: !0,
|
|
669
675
|
"pagination-compact": t.compact
|
|
670
676
|
}));
|
|
671
|
-
function c(
|
|
677
|
+
function c(g) {
|
|
672
678
|
const B = Math.min(
|
|
673
|
-
Math.max(
|
|
679
|
+
Math.max(g, 1),
|
|
674
680
|
l.value
|
|
675
681
|
);
|
|
676
682
|
B !== o.value && s(
|
|
@@ -678,7 +684,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
678
684
|
B
|
|
679
685
|
);
|
|
680
686
|
}
|
|
681
|
-
function
|
|
687
|
+
function y() {
|
|
682
688
|
c(o.value - 1);
|
|
683
689
|
}
|
|
684
690
|
function D() {
|
|
@@ -690,7 +696,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
690
696
|
function h() {
|
|
691
697
|
c(l.value);
|
|
692
698
|
}
|
|
693
|
-
return (
|
|
699
|
+
return (g, B) => (n(), d("nav", {
|
|
694
700
|
class: f(i.value),
|
|
695
701
|
"aria-label": "Pagination"
|
|
696
702
|
}, [
|
|
@@ -711,7 +717,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
711
717
|
type: "button",
|
|
712
718
|
disabled: o.value === 1,
|
|
713
719
|
"aria-label": "Previous page",
|
|
714
|
-
onClick:
|
|
720
|
+
onClick: y
|
|
715
721
|
}, " ‹ ", 10, ze)
|
|
716
722
|
]),
|
|
717
723
|
p("div", Ke, [
|
|
@@ -785,7 +791,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
785
791
|
);
|
|
786
792
|
return typeof w == "string" || typeof w == "number" ? w : t.rows.indexOf(_);
|
|
787
793
|
}
|
|
788
|
-
function
|
|
794
|
+
function y(_) {
|
|
789
795
|
return r.value.has(
|
|
790
796
|
c(_)
|
|
791
797
|
);
|
|
@@ -796,17 +802,17 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
796
802
|
const _ = l.value, w = o.value;
|
|
797
803
|
return [...t.rows].sort(
|
|
798
804
|
(v, C) => {
|
|
799
|
-
const x = i(v, _),
|
|
800
|
-
if (x ===
|
|
805
|
+
const x = i(v, _), I = i(C, _);
|
|
806
|
+
if (x === I)
|
|
801
807
|
return 0;
|
|
802
808
|
if (x == null)
|
|
803
809
|
return 1;
|
|
804
|
-
if (
|
|
810
|
+
if (I == null)
|
|
805
811
|
return -1;
|
|
806
|
-
if (typeof x == "number" && typeof
|
|
807
|
-
return w === "asc" ? x -
|
|
812
|
+
if (typeof x == "number" && typeof I == "number")
|
|
813
|
+
return w === "asc" ? x - I : I - x;
|
|
808
814
|
const P = String(x).localeCompare(
|
|
809
|
-
String(
|
|
815
|
+
String(I),
|
|
810
816
|
void 0,
|
|
811
817
|
{
|
|
812
818
|
numeric: !0,
|
|
@@ -836,7 +842,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
836
842
|
)
|
|
837
843
|
);
|
|
838
844
|
}
|
|
839
|
-
function
|
|
845
|
+
function g(_) {
|
|
840
846
|
return l.value !== _.key ? "" : o.value === "asc" ? "↑" : "↓";
|
|
841
847
|
}
|
|
842
848
|
function B(_) {
|
|
@@ -872,7 +878,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
872
878
|
]
|
|
873
879
|
}, [
|
|
874
880
|
p("span", null, S(v.label), 1),
|
|
875
|
-
a.sortable && v.sortable ? (n(), d("span", Ne, S(
|
|
881
|
+
a.sortable && v.sortable ? (n(), d("span", Ne, S(g(v)), 1)) : $("", !0)
|
|
876
882
|
], 46, He))), 128))
|
|
877
883
|
])
|
|
878
884
|
]),
|
|
@@ -880,7 +886,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
880
886
|
(n(!0), d(q, null, G(D.value, (v) => (n(), d("tr", {
|
|
881
887
|
key: c(v),
|
|
882
888
|
class: f({
|
|
883
|
-
"table-row--selected":
|
|
889
|
+
"table-row--selected": y(v)
|
|
884
890
|
}),
|
|
885
891
|
onClick: (C) => a.selectable && h(v)
|
|
886
892
|
}, [
|
|
@@ -1053,12 +1059,12 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1053
1059
|
function i(c) {
|
|
1054
1060
|
if (!t.disabled) {
|
|
1055
1061
|
if (t.multiple) {
|
|
1056
|
-
const
|
|
1062
|
+
const y = new Set(
|
|
1057
1063
|
o.value
|
|
1058
1064
|
);
|
|
1059
|
-
|
|
1065
|
+
y.has(c) ? y.delete(c) : y.add(c), s(
|
|
1060
1066
|
"update:modelValue",
|
|
1061
|
-
[...
|
|
1067
|
+
[...y]
|
|
1062
1068
|
);
|
|
1063
1069
|
return;
|
|
1064
1070
|
}
|
|
@@ -1076,7 +1082,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1076
1082
|
isSelected: r,
|
|
1077
1083
|
toggleChoice: i
|
|
1078
1084
|
}
|
|
1079
|
-
), (c,
|
|
1085
|
+
), (c, y) => (n(), d("div", {
|
|
1080
1086
|
class: f(l.value),
|
|
1081
1087
|
role: "group"
|
|
1082
1088
|
}, [
|
|
@@ -1109,7 +1115,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1109
1115
|
function i() {
|
|
1110
1116
|
o.value || s.toggleChoice(e.value);
|
|
1111
1117
|
}
|
|
1112
|
-
return (c,
|
|
1118
|
+
return (c, y) => (n(), d("button", {
|
|
1113
1119
|
type: "button",
|
|
1114
1120
|
class: f(r.value),
|
|
1115
1121
|
disabled: o.value,
|
|
@@ -1214,7 +1220,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1214
1220
|
"aria-disabled": e.disabled ? "true" : void 0,
|
|
1215
1221
|
onClick: r
|
|
1216
1222
|
}, {
|
|
1217
|
-
default:
|
|
1223
|
+
default: L(() => [
|
|
1218
1224
|
i.$slots.icon ? (n(), d("span", nt, [
|
|
1219
1225
|
u(i.$slots, "icon")
|
|
1220
1226
|
])) : $("", !0),
|
|
@@ -1387,7 +1393,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1387
1393
|
function c() {
|
|
1388
1394
|
t.closeOnBackdrop && i();
|
|
1389
1395
|
}
|
|
1390
|
-
function
|
|
1396
|
+
function y(h) {
|
|
1391
1397
|
if (!t.modelValue || !l.value)
|
|
1392
1398
|
return;
|
|
1393
1399
|
if (h.key === "Escape" && t.closeOnEscape) {
|
|
@@ -1396,16 +1402,16 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1396
1402
|
}
|
|
1397
1403
|
if (h.key !== "Tab")
|
|
1398
1404
|
return;
|
|
1399
|
-
const
|
|
1405
|
+
const g = Array.from(
|
|
1400
1406
|
l.value.querySelectorAll(
|
|
1401
1407
|
r
|
|
1402
1408
|
)
|
|
1403
1409
|
);
|
|
1404
|
-
if (
|
|
1410
|
+
if (g.length === 0) {
|
|
1405
1411
|
h.preventDefault();
|
|
1406
1412
|
return;
|
|
1407
1413
|
}
|
|
1408
|
-
const B =
|
|
1414
|
+
const B = g[0], k = g[g.length - 1];
|
|
1409
1415
|
if (h.shiftKey && document.activeElement === B) {
|
|
1410
1416
|
h.preventDefault(), k.focus();
|
|
1411
1417
|
return;
|
|
@@ -1428,14 +1434,14 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1428
1434
|
), J(() => {
|
|
1429
1435
|
t.modelValue && D(), document.addEventListener(
|
|
1430
1436
|
"keydown",
|
|
1431
|
-
|
|
1437
|
+
y
|
|
1432
1438
|
);
|
|
1433
1439
|
}), O(() => {
|
|
1434
1440
|
document.removeEventListener(
|
|
1435
1441
|
"keydown",
|
|
1436
|
-
|
|
1442
|
+
y
|
|
1437
1443
|
), E();
|
|
1438
|
-
}), (h,
|
|
1444
|
+
}), (h, g) => (n(), T(U, { to: "body" }, [
|
|
1439
1445
|
a.modelValue ? (n(), d("div", _t, [
|
|
1440
1446
|
p("button", {
|
|
1441
1447
|
class: "dialog-backdrop",
|
|
@@ -1456,7 +1462,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1456
1462
|
])) : $("", !0)
|
|
1457
1463
|
]));
|
|
1458
1464
|
}
|
|
1459
|
-
}),
|
|
1465
|
+
}), yt = { class: "drawer-content" }, va = /* @__PURE__ */ m({
|
|
1460
1466
|
__name: "Drawer",
|
|
1461
1467
|
props: {
|
|
1462
1468
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1482,7 +1488,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1482
1488
|
function c() {
|
|
1483
1489
|
t.closeOnBackdrop && i();
|
|
1484
1490
|
}
|
|
1485
|
-
function
|
|
1491
|
+
function y(h) {
|
|
1486
1492
|
if (!t.modelValue || !l.value)
|
|
1487
1493
|
return;
|
|
1488
1494
|
if (h.key === "Escape" && t.closeOnEscape) {
|
|
@@ -1491,16 +1497,16 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1491
1497
|
}
|
|
1492
1498
|
if (h.key !== "Tab")
|
|
1493
1499
|
return;
|
|
1494
|
-
const
|
|
1500
|
+
const g = Array.from(
|
|
1495
1501
|
l.value.querySelectorAll(
|
|
1496
1502
|
r
|
|
1497
1503
|
)
|
|
1498
1504
|
);
|
|
1499
|
-
if (
|
|
1505
|
+
if (g.length === 0) {
|
|
1500
1506
|
h.preventDefault();
|
|
1501
1507
|
return;
|
|
1502
1508
|
}
|
|
1503
|
-
const B =
|
|
1509
|
+
const B = g[0], k = g[g.length - 1];
|
|
1504
1510
|
if (h.shiftKey && document.activeElement === B) {
|
|
1505
1511
|
h.preventDefault(), k.focus();
|
|
1506
1512
|
return;
|
|
@@ -1523,14 +1529,14 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1523
1529
|
), J(() => {
|
|
1524
1530
|
document.addEventListener(
|
|
1525
1531
|
"keydown",
|
|
1526
|
-
|
|
1532
|
+
y
|
|
1527
1533
|
), t.modelValue && D();
|
|
1528
1534
|
}), O(() => {
|
|
1529
1535
|
document.removeEventListener(
|
|
1530
1536
|
"keydown",
|
|
1531
|
-
|
|
1537
|
+
y
|
|
1532
1538
|
), E();
|
|
1533
|
-
}), (h,
|
|
1539
|
+
}), (h, g) => (n(), T(U, { to: "body" }, [
|
|
1534
1540
|
a.modelValue ? (n(), d("div", {
|
|
1535
1541
|
key: 0,
|
|
1536
1542
|
class: f(["drawer", {
|
|
@@ -1554,14 +1560,14 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1554
1560
|
role: "dialog",
|
|
1555
1561
|
"aria-modal": "true"
|
|
1556
1562
|
}, [
|
|
1557
|
-
p("div",
|
|
1563
|
+
p("div", yt, [
|
|
1558
1564
|
u(h.$slots, "default")
|
|
1559
1565
|
])
|
|
1560
1566
|
], 512)
|
|
1561
1567
|
], 2)) : $("", !0)
|
|
1562
1568
|
]));
|
|
1563
1569
|
}
|
|
1564
|
-
}),
|
|
1570
|
+
}), gt = {
|
|
1565
1571
|
key: 0,
|
|
1566
1572
|
class: "popover-content",
|
|
1567
1573
|
role: "dialog"
|
|
@@ -1581,8 +1587,8 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1581
1587
|
function r(c) {
|
|
1582
1588
|
if (!s.value)
|
|
1583
1589
|
return;
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1590
|
+
const y = c.target;
|
|
1591
|
+
y instanceof Node && !s.value.contains(y) && o();
|
|
1586
1592
|
}
|
|
1587
1593
|
function i(c) {
|
|
1588
1594
|
c.key === "Escape" && o();
|
|
@@ -1603,7 +1609,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1603
1609
|
"keydown",
|
|
1604
1610
|
i
|
|
1605
1611
|
);
|
|
1606
|
-
}), (c,
|
|
1612
|
+
}), (c, y) => (n(), d("div", {
|
|
1607
1613
|
ref_key: "popover",
|
|
1608
1614
|
ref: s,
|
|
1609
1615
|
class: f(["popover", {
|
|
@@ -1617,7 +1623,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1617
1623
|
}, [
|
|
1618
1624
|
u(c.$slots, "trigger")
|
|
1619
1625
|
]),
|
|
1620
|
-
t.value ? (n(), d("div",
|
|
1626
|
+
t.value ? (n(), d("div", gt, [
|
|
1621
1627
|
u(c.$slots, "default")
|
|
1622
1628
|
])) : $("", !0)
|
|
1623
1629
|
], 2));
|
|
@@ -1664,7 +1670,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1664
1670
|
}), wt = { class: "alert-content" }, Ct = {
|
|
1665
1671
|
key: 0,
|
|
1666
1672
|
class: "alert-actions"
|
|
1667
|
-
},
|
|
1673
|
+
}, ya = /* @__PURE__ */ m({
|
|
1668
1674
|
__name: "Alert",
|
|
1669
1675
|
props: {
|
|
1670
1676
|
variant: { default: "info" },
|
|
@@ -1701,7 +1707,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1701
1707
|
}), Bt = ["aria-valuemin", "aria-valuemax", "aria-valuenow"], xt = { class: "progress-track" }, Vt = {
|
|
1702
1708
|
key: 0,
|
|
1703
1709
|
class: "progress-label"
|
|
1704
|
-
},
|
|
1710
|
+
}, ga = /* @__PURE__ */ m({
|
|
1705
1711
|
__name: "Progress",
|
|
1706
1712
|
props: {
|
|
1707
1713
|
value: { default: 0 },
|
|
@@ -1802,15 +1808,15 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1802
1808
|
}
|
|
1803
1809
|
return K(
|
|
1804
1810
|
() => t.modelValue,
|
|
1805
|
-
(
|
|
1806
|
-
l.value =
|
|
1811
|
+
(y) => {
|
|
1812
|
+
l.value = y, y ? c() : r();
|
|
1807
1813
|
},
|
|
1808
1814
|
{
|
|
1809
1815
|
immediate: !0
|
|
1810
1816
|
}
|
|
1811
1817
|
), O(() => {
|
|
1812
1818
|
r();
|
|
1813
|
-
}), (
|
|
1819
|
+
}), (y, D) => (n(), T(U, { to: "body" }, [
|
|
1814
1820
|
l.value ? (n(), d("div", {
|
|
1815
1821
|
key: 0,
|
|
1816
1822
|
class: f(["toast", {
|
|
@@ -1823,7 +1829,7 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1823
1829
|
p("div", St, [
|
|
1824
1830
|
a.title ? (n(), d("div", Et, S(a.title), 1)) : $("", !0),
|
|
1825
1831
|
p("div", Tt, [
|
|
1826
|
-
u(
|
|
1832
|
+
u(y.$slots, "default")
|
|
1827
1833
|
])
|
|
1828
1834
|
]),
|
|
1829
1835
|
a.dismissible ? (n(), d("button", {
|
|
@@ -1840,13 +1846,13 @@ const Qt = /* @__PURE__ */ H(Ve, [["render", Ee]]), Xt = /* @__PURE__ */ m({
|
|
|
1840
1846
|
export {
|
|
1841
1847
|
Jt as Accordion,
|
|
1842
1848
|
Ut as AccordionItem,
|
|
1843
|
-
|
|
1849
|
+
ya as Alert,
|
|
1844
1850
|
Xt as Badge,
|
|
1845
1851
|
fa as Breadcrumb,
|
|
1846
1852
|
ma as Breadcrumbs,
|
|
1847
|
-
|
|
1853
|
+
It as Button,
|
|
1848
1854
|
Rt as ButtonGroup,
|
|
1849
|
-
|
|
1855
|
+
Lt as Card,
|
|
1850
1856
|
sa as Checkbox,
|
|
1851
1857
|
ia as Choice,
|
|
1852
1858
|
na as ChoiceGroup,
|
|
@@ -1861,12 +1867,12 @@ export {
|
|
|
1861
1867
|
Ot as Heading,
|
|
1862
1868
|
jt as Image,
|
|
1863
1869
|
qt as Input,
|
|
1864
|
-
|
|
1870
|
+
ye as Label,
|
|
1865
1871
|
Zt as List,
|
|
1866
1872
|
ea as ListItem,
|
|
1867
1873
|
ta as Pagination,
|
|
1868
1874
|
ha as Popover,
|
|
1869
|
-
|
|
1875
|
+
ga as Progress,
|
|
1870
1876
|
la as Radio,
|
|
1871
1877
|
At as Section,
|
|
1872
1878
|
Ft as SectionHeader,
|
package/package.json
CHANGED
package/src/forms/Input.vue
CHANGED
|
@@ -3,7 +3,7 @@ import { computed } from "vue";
|
|
|
3
3
|
import type { InputType } from "@paraxe/core";
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
|
-
type
|
|
6
|
+
type?: InputType;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
modelValue?: string;
|
|
9
9
|
required?: boolean;
|
|
@@ -32,23 +32,24 @@ const inputClasses = computed(() => ({
|
|
|
32
32
|
"input-error": props.error,
|
|
33
33
|
"input-success": props.success,
|
|
34
34
|
}));
|
|
35
|
+
|
|
36
|
+
function handleInput(event: Event): void {
|
|
37
|
+
emit(
|
|
38
|
+
"update:modelValue",
|
|
39
|
+
(event.target as HTMLInputElement).value,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
35
42
|
</script>
|
|
36
43
|
|
|
37
44
|
<template>
|
|
38
45
|
<input
|
|
39
|
-
class="input"
|
|
40
|
-
:class="inputClasses"
|
|
46
|
+
:class="['input', inputClasses]"
|
|
41
47
|
:type="props.type"
|
|
42
48
|
:placeholder="props.placeholder"
|
|
43
49
|
:value="props.modelValue"
|
|
44
50
|
:required="props.required"
|
|
45
51
|
:disabled="props.disabled"
|
|
46
52
|
:readonly="props.readonly"
|
|
47
|
-
@input="
|
|
48
|
-
emit(
|
|
49
|
-
'update:modelValue',
|
|
50
|
-
($event.target as HTMLInputElement).value,
|
|
51
|
-
)
|
|
52
|
-
"
|
|
53
|
+
@input="handleInput"
|
|
53
54
|
/>
|
|
54
55
|
</template>
|
package/src/forms/Select.vue
CHANGED
|
@@ -2,42 +2,43 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
|
-
|
|
5
|
+
modelValue?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
error?: boolean;
|
|
8
8
|
success?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
-
|
|
12
|
+
modelValue: "",
|
|
13
13
|
disabled: false,
|
|
14
14
|
error: false,
|
|
15
15
|
success: false,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const emit = defineEmits<{
|
|
19
|
-
|
|
19
|
+
"update:modelValue": [value: string];
|
|
20
20
|
}>();
|
|
21
21
|
|
|
22
|
+
function handleChange(event: Event) {
|
|
23
|
+
const target = event.target as HTMLSelectElement;
|
|
24
|
+
emit("update:modelValue", target.value);
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
const selectClasses = computed(() => ({
|
|
23
28
|
"input-error": props.error,
|
|
24
29
|
"input-success": props.success,
|
|
25
30
|
}));
|
|
26
31
|
|
|
27
|
-
function handleChange(event: Event) {
|
|
28
|
-
const target = event.target as HTMLSelectElement;
|
|
29
|
-
emit("change", target.value);
|
|
30
|
-
}
|
|
31
32
|
</script>
|
|
32
33
|
|
|
33
34
|
<template>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
<select
|
|
36
|
+
class="select"
|
|
37
|
+
:class="selectClasses"
|
|
38
|
+
:value="props.modelValue"
|
|
39
|
+
:disabled="props.disabled"
|
|
40
|
+
@change="handleChange"
|
|
41
|
+
>
|
|
42
|
+
<slot />
|
|
43
|
+
</select>
|
|
43
44
|
</template>
|