@wirecore/wirelayer-vue 0.4.0 → 0.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 +3 -1
- package/dist/{Button-DZ_ZGl7X.js → Button-BpMOPs8b.js} +7 -8
- package/dist/{ContextMenu-R23YbbaS.js → ContextMenu-C5JKyNlX.js} +132 -111
- package/dist/{Field-BdIPugFP.js → Field-B1EsNF84.js} +20 -17
- package/dist/{Highlight-DvGcm2QR.js → Highlight-Cg8DvCfq.js} +1 -1
- package/dist/{Input-C59NJK4m.js → Input-BhnYMKjE.js} +5 -4
- package/dist/{InputStatus-CUyF9-GR.js → InputStatus-D7kBGlew.js} +4 -1
- package/dist/{Select-BlEjQWBP.js → Select-DAuYpE1c.js} +3 -1
- package/dist/{Tree-B39xwNbU.js → Tree-DWxqSrO6.js} +2 -2
- package/dist/chart/Chart.vue.d.ts +10 -4
- package/dist/chart/Chart.vue.d.ts.map +1 -1
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart.js +29 -23
- package/dist/code.js +1 -1
- package/dist/components/Badge/Badge.vue.d.ts +2 -0
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Button/Button.vue.d.ts +5 -0
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/ChipGroup/ChipGroup.vue.d.ts +1 -1
- package/dist/components/ChipGroup/ChipGroup.vue.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.vue.d.ts +6 -1
- package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.vue.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePickerBase.vue.d.ts +2 -0
- package/dist/components/DatePicker/DatePickerBase.vue.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts.map +1 -1
- package/dist/components/Dialog/DialogContent.vue.d.ts +10 -6
- package/dist/components/Dialog/DialogContent.vue.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerContent.vue.d.ts +5 -5
- package/dist/components/Drawer/DrawerContent.vue.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.vue.d.ts +5 -5
- package/dist/components/EmptyState/EmptyState.vue.d.ts.map +1 -1
- package/dist/components/Field/Field.vue.d.ts +12 -2
- package/dist/components/Field/Field.vue.d.ts.map +1 -1
- package/dist/components/Field/context.d.ts +3 -1
- package/dist/components/Field/context.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.vue.d.ts +11 -0
- package/dist/components/FileUpload/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.vue.d.ts +2 -0
- package/dist/components/IconButton/IconButton.vue.d.ts.map +1 -1
- package/dist/components/LocaleProvider/LocaleProvider.vue.d.ts +1 -0
- package/dist/components/LocaleProvider/LocaleProvider.vue.d.ts.map +1 -1
- package/dist/components/MonthPicker/MonthPicker.vue.d.ts +2 -0
- package/dist/components/MonthPicker/MonthPicker.vue.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +6 -1
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts +2 -2
- package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
- package/dist/components/Select/Select.vue.d.ts +6 -1
- package/dist/components/Select/Select.vue.d.ts.map +1 -1
- package/dist/components/Select/types.d.ts +2 -0
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Toast/Toaster.vue.d.ts +12 -2
- package/dist/components/Toast/Toaster.vue.d.ts.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.vue.d.ts +9 -2
- package/dist/components/ToggleButton/ToggleButton.vue.d.ts.map +1 -1
- package/dist/components/YearPicker/YearPicker.vue.d.ts +2 -0
- package/dist/components/YearPicker/YearPicker.vue.d.ts.map +1 -1
- package/dist/data-table/DataTable.vue.d.ts +28 -2
- package/dist/data-table/DataTable.vue.d.ts.map +1 -1
- package/dist/data-table/FilterMenu.vue.d.ts +10 -0
- package/dist/data-table/FilterMenu.vue.d.ts.map +1 -1
- package/dist/data-table/ValueInput.vue.d.ts +19 -1
- package/dist/data-table/ValueInput.vue.d.ts.map +1 -1
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.d.ts.map +1 -1
- package/dist/data-table/types.d.ts +23 -1
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/data-table.js +1452 -1331
- package/dist/editor.js +1 -1
- package/dist/form/FormField.vue.d.ts +10 -5
- package/dist/form/FormField.vue.d.ts.map +1 -1
- package/dist/form.js +122 -106
- package/dist/index.js +4780 -4714
- package/dist/pdf.js +4 -4
- package/dist/{useTree-Dt7NO7cp.js → useTree-H8XsFHMk.js} +2 -2
- package/dist/utils/list.d.ts.map +1 -1
- package/dist/virtual.js +2 -2
- package/llms-full.txt +7025 -0
- package/llms.txt +311 -0
- package/package.json +6 -4
package/dist/editor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, n as t } from "./recipes-BlM9aKyt.js";
|
|
2
|
-
import { t as n } from "./Button-
|
|
2
|
+
import { t as n } from "./Button-BpMOPs8b.js";
|
|
3
3
|
import { t as r } from "./Checkbox-D9f77jtl.js";
|
|
4
4
|
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, nextTick as ee, normalizeClass as p, normalizeStyle as te, onBeforeUnmount as ne, openBlock as m, ref as h, renderList as g, resolveDynamicComponent as re, toDisplayString as _, unref as v, useAttrs as ie, useId as ae, useTemplateRef as y, vModelText as b, watch as oe, withCtx as x, withDirectives as S, withKeys as se, withModifiers as C } from "vue";
|
|
5
5
|
import { Baseline as ce, Bold as le, Code as ue, CodeXml as de, Heading2 as fe, Heading3 as pe, Highlighter as me, Image as he, Italic as ge, Link as _e, List as ve, ListChecks as ye, ListCollapse as be, ListOrdered as xe, Minus as Se, Pilcrow as Ce, Redo2 as we, SquareCode as Te, Strikethrough as Ee, Subscript as De, Superscript as Oe, Table as ke, TextAlignCenter as Ae, TextAlignEnd as je, TextAlignJustify as Me, TextAlignStart as Ne, TextQuote as Pe, Underline as Fe, Undo2 as Ie } from "@lucide/vue";
|
|
@@ -11,11 +11,16 @@ export interface FormFieldProps {
|
|
|
11
11
|
optional?: boolean;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
type __VLS_Slots = {
|
|
15
|
+
default?(props: {
|
|
16
|
+
field: AnyFieldApi;
|
|
17
|
+
}): unknown;
|
|
18
|
+
/** Own content of the label (instead of `label`) */
|
|
19
|
+
label?(): unknown;
|
|
20
|
+
/** Own helper text, e.g. with a link – part of the control's description (instead of `helperText`) */
|
|
21
|
+
'helper-text'?(): unknown;
|
|
22
|
+
/** Own confirmation (instead of `success`) */
|
|
23
|
+
success?(): unknown;
|
|
19
24
|
};
|
|
20
25
|
declare const __VLS_base: import("vue").DefineComponent<FormFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
26
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.vue.d.ts","sourceRoot":"","sources":["../../src/form/FormField.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormField.vue.d.ts","sourceRoot":"","sources":["../../src/form/FormField.vue"],"names":[],"mappings":"AAuDA,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKhE,MAAM,WAAW,cAAc;IAC3B,uEAAuE;IACvE,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAKD,KAAK,WAAW,GAAG;IACf,OAAO,CAAC,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC;IACjD,oDAAoD;IACpD,KAAK,CAAC,IAAI,OAAO,CAAC;IAClB,sGAAsG;IACtG,aAAa,CAAC,IAAI,OAAO,CAAC;IAC1B,8CAA8C;IAC9C,OAAO,CAAC,IAAI,OAAO,CAAC;CACvB,CAAC;AAyEF,QAAA,MAAM,UAAU,wSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
package/dist/form.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { a as e, i as t, n } from "./recipes-BlM9aKyt.js";
|
|
2
|
-
import { t as r } from "./Button-
|
|
3
|
-
import { t as i } from "./Field-
|
|
4
|
-
import { n as a, t as o } from "./Input-
|
|
5
|
-
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f,
|
|
6
|
-
import { ArrowDown as j, ArrowUp as
|
|
7
|
-
import { combineValidators as
|
|
8
|
-
import { useStore as
|
|
2
|
+
import { t as r } from "./Button-BpMOPs8b.js";
|
|
3
|
+
import { t as i } from "./Field-B1EsNF84.js";
|
|
4
|
+
import { n as a, t as o } from "./Input-BhnYMKjE.js";
|
|
5
|
+
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, mergeProps as v, nextTick as y, normalizeClass as b, normalizeProps as ee, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useAttrs as D, useId as O, useTemplateRef as k, withCtx as A } from "vue";
|
|
6
|
+
import { ArrowDown as j, ArrowUp as te, Plus as ne, Trash2 as re } from "@lucide/vue";
|
|
7
|
+
import { combineValidators as M, createValidator as N, createValidators as P, formList as F, hasLength as I, isEmail as L, isIban as R, isInRange as z, isInteger as B, isPhone as V, isRequired as H, isUrl as U, keyValueEditor as W, matchesField as G, matchesPattern as K, visuallyHidden as q } from "@wirecore/wirelayer-recipes";
|
|
8
|
+
import { useStore as J } from "@tanstack/vue-form";
|
|
9
9
|
//#region src/form/bind.ts
|
|
10
|
-
var
|
|
10
|
+
var Y = (e) => ({
|
|
11
11
|
name: e.name,
|
|
12
12
|
modelValue: e.state.value ?? "",
|
|
13
13
|
"onUpdate:modelValue": (t) => e.handleChange(t ?? ""),
|
|
14
14
|
onBlur: e.handleBlur
|
|
15
|
-
}),
|
|
15
|
+
}), ie = (e) => ({
|
|
16
16
|
name: e.name,
|
|
17
17
|
checked: e.state.value,
|
|
18
18
|
"onUpdate:checked": (t) => e.handleChange(t === !0),
|
|
19
19
|
onBlur: e.handleBlur
|
|
20
|
-
}),
|
|
20
|
+
}), ae = (e) => ({
|
|
21
21
|
name: e.name,
|
|
22
22
|
modelValue: e.state.value,
|
|
23
23
|
"onUpdate:modelValue": (t) => e.handleChange(t),
|
|
@@ -25,7 +25,7 @@ var te = (e) => ({
|
|
|
25
25
|
});
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/form/errors.ts
|
|
28
|
-
function
|
|
28
|
+
function X(e) {
|
|
29
29
|
for (let t of e) {
|
|
30
30
|
if (typeof t == "string" && t) return t;
|
|
31
31
|
if (t && typeof t == "object" && "message" in t && typeof t.message == "string") return t.message;
|
|
@@ -33,19 +33,19 @@ function Z(e) {
|
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/form/errors-summary.ts
|
|
36
|
-
function
|
|
37
|
-
let n =
|
|
36
|
+
function oe(e, t = {}) {
|
|
37
|
+
let n = J(e.store, (e) => e.fieldMeta), r = J(e.store, (e) => e.submissionAttempts), i = (e) => typeof t.ids == "function" ? t.ids(e) : t.ids?.[e] ?? e;
|
|
38
38
|
return {
|
|
39
39
|
errors: c(() => Object.entries(n.value).map(([e, t]) => ({
|
|
40
40
|
id: i(e),
|
|
41
|
-
message: t?.isTouched &&
|
|
41
|
+
message: t?.isTouched && X(t.errors ?? []) || ""
|
|
42
42
|
})).filter((e) => !!e.message)),
|
|
43
43
|
attempts: c(() => r.value)
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/form/FormField.vue
|
|
48
|
-
var
|
|
48
|
+
var se = /* @__PURE__ */ g({
|
|
49
49
|
__name: "FormField",
|
|
50
50
|
props: {
|
|
51
51
|
field: {},
|
|
@@ -57,7 +57,7 @@ var ae = /* @__PURE__ */ h({
|
|
|
57
57
|
disabled: { type: Boolean }
|
|
58
58
|
},
|
|
59
59
|
setup(e) {
|
|
60
|
-
let t =
|
|
60
|
+
let t = J(e.field.store, (e) => e.meta), n = c(() => t.value.isTouched ? X(t.value.errors) : void 0);
|
|
61
61
|
return (t, r) => (x(), l(i, {
|
|
62
62
|
label: e.label,
|
|
63
63
|
"helper-text": e.helperText,
|
|
@@ -66,10 +66,26 @@ var ae = /* @__PURE__ */ h({
|
|
|
66
66
|
required: e.required,
|
|
67
67
|
optional: e.optional,
|
|
68
68
|
disabled: e.disabled
|
|
69
|
-
}, {
|
|
69
|
+
}, p({
|
|
70
70
|
default: A(() => [w(t.$slots, "default", { field: e.field })]),
|
|
71
|
-
_:
|
|
72
|
-
},
|
|
71
|
+
_: 2
|
|
72
|
+
}, [
|
|
73
|
+
t.$slots.label ? {
|
|
74
|
+
name: "label",
|
|
75
|
+
fn: A(() => [w(t.$slots, "label")]),
|
|
76
|
+
key: "0"
|
|
77
|
+
} : void 0,
|
|
78
|
+
t.$slots["helper-text"] ? {
|
|
79
|
+
name: "helper-text",
|
|
80
|
+
fn: A(() => [w(t.$slots, "helper-text")]),
|
|
81
|
+
key: "1"
|
|
82
|
+
} : void 0,
|
|
83
|
+
t.$slots.success ? {
|
|
84
|
+
name: "success",
|
|
85
|
+
fn: A(() => [w(t.$slots, "success")]),
|
|
86
|
+
key: "2"
|
|
87
|
+
} : void 0
|
|
88
|
+
]), 1032, [
|
|
73
89
|
"label",
|
|
74
90
|
"helper-text",
|
|
75
91
|
"success",
|
|
@@ -79,7 +95,7 @@ var ae = /* @__PURE__ */ h({
|
|
|
79
95
|
"disabled"
|
|
80
96
|
]));
|
|
81
97
|
}
|
|
82
|
-
}),
|
|
98
|
+
}), ce = ["aria-label", "onKeydown"], le = "input, select, textarea, button:not(:disabled), [tabindex]", Z = "input, select, textarea, button, [tabindex]", Q = /* @__PURE__ */ g({
|
|
83
99
|
inheritAttrs: !1,
|
|
84
100
|
__name: "FormList",
|
|
85
101
|
props: {
|
|
@@ -97,126 +113,126 @@ var ae = /* @__PURE__ */ h({
|
|
|
97
113
|
classes: {}
|
|
98
114
|
},
|
|
99
115
|
setup(t) {
|
|
100
|
-
let i = t, o = n("formList",
|
|
101
|
-
async function
|
|
102
|
-
await
|
|
103
|
-
let n =
|
|
104
|
-
n && (t?.(n) ?? n.querySelector(
|
|
116
|
+
let i = t, o = n("formList", F, () => i.classes), l = D(), p = e().formList, g = o(), v = k("list"), O = J(i.field.store, (e) => e.value), M = c(() => O.value?.length ?? 0), N = c(() => i.max !== void 0 && M.value >= i.max), P = c(() => M.value <= i.min), I = S(""), L = (e) => (i.itemLabel ?? p.item)(e + 1), R = q(), z = () => [...v.value?.querySelectorAll(":scope > li") ?? []];
|
|
117
|
+
async function B(e, t) {
|
|
118
|
+
await y();
|
|
119
|
+
let n = z()[e];
|
|
120
|
+
n && (t?.(n) ?? n.querySelector(le))?.focus();
|
|
105
121
|
}
|
|
106
|
-
let
|
|
107
|
-
function
|
|
108
|
-
if (
|
|
109
|
-
let e =
|
|
110
|
-
i.field.pushValue(i.newItem()),
|
|
122
|
+
let V = (e) => e.querySelector("[data-action=up]:not(:disabled)") ?? e.querySelector("[data-action=down]:not(:disabled)");
|
|
123
|
+
function H() {
|
|
124
|
+
if (N.value) return;
|
|
125
|
+
let e = M.value;
|
|
126
|
+
i.field.pushValue(i.newItem()), I.value = p.added(L(e)), B(e);
|
|
111
127
|
}
|
|
112
|
-
async function
|
|
113
|
-
if (
|
|
114
|
-
let t =
|
|
115
|
-
i.field.removeValue(e),
|
|
116
|
-
let n =
|
|
117
|
-
(n[Math.min(e, n.length - 1)]?.querySelector("[data-action=\"remove\"]:not(:disabled)") ??
|
|
128
|
+
async function U(e) {
|
|
129
|
+
if (P.value) return;
|
|
130
|
+
let t = L(e);
|
|
131
|
+
i.field.removeValue(e), I.value = p.removed(t), await y();
|
|
132
|
+
let n = z();
|
|
133
|
+
(n[Math.min(e, n.length - 1)]?.querySelector("[data-action=\"remove\"]:not(:disabled)") ?? v.value?.parentElement?.querySelector("[data-action=\"add\"]"))?.focus();
|
|
118
134
|
}
|
|
119
|
-
function
|
|
135
|
+
function W(e, t, n = V) {
|
|
120
136
|
let r = e + t;
|
|
121
|
-
r < 0 || r >=
|
|
137
|
+
r < 0 || r >= M.value || (i.field.moveValue(e, r), I.value = p.moved(L(e), r + 1), B(r, n));
|
|
122
138
|
}
|
|
123
|
-
function
|
|
139
|
+
function G(e, t) {
|
|
124
140
|
if (!i.reorderable || !t.altKey || t.key !== "ArrowUp" && t.key !== "ArrowDown") return;
|
|
125
141
|
t.preventDefault();
|
|
126
|
-
let n = [...t.currentTarget.querySelectorAll(
|
|
127
|
-
|
|
128
|
-
let t = e.querySelectorAll(
|
|
129
|
-
return t && !t.matches(":disabled") ? t :
|
|
142
|
+
let n = [...t.currentTarget.querySelectorAll(Z)].indexOf(t.target);
|
|
143
|
+
W(e, t.key === "ArrowUp" ? -1 : 1, (e) => {
|
|
144
|
+
let t = e.querySelectorAll(Z)[n];
|
|
145
|
+
return t && !t.matches(":disabled") ? t : V(e);
|
|
130
146
|
});
|
|
131
147
|
}
|
|
132
|
-
return (e, n) => (x(), d("fieldset",
|
|
148
|
+
return (e, n) => (x(), d("fieldset", ee(_({
|
|
133
149
|
...E(l),
|
|
134
|
-
class: E(
|
|
150
|
+
class: E(g).base({ class: b(E(l).class) })
|
|
135
151
|
})), [
|
|
136
|
-
f("legend", { class:
|
|
152
|
+
f("legend", { class: b(E(g).legend()) }, T(t.label), 3),
|
|
137
153
|
f("ol", {
|
|
138
154
|
ref_key: "list",
|
|
139
|
-
ref:
|
|
140
|
-
class:
|
|
141
|
-
}, [(x(!0), d(s, null, C(E(
|
|
155
|
+
ref: v,
|
|
156
|
+
class: b(E(g).list())
|
|
157
|
+
}, [(x(!0), d(s, null, C(E(O) ?? [], (n, r) => (x(), d("li", {
|
|
142
158
|
key: r,
|
|
143
|
-
class:
|
|
144
|
-
"aria-label":
|
|
145
|
-
onKeydown: (e) =>
|
|
159
|
+
class: b(E(g).item()),
|
|
160
|
+
"aria-label": L(r),
|
|
161
|
+
onKeydown: (e) => G(r, e)
|
|
146
162
|
}, [
|
|
147
163
|
f("span", {
|
|
148
|
-
class:
|
|
164
|
+
class: b(E(g).index()),
|
|
149
165
|
"aria-hidden": "true"
|
|
150
166
|
}, T(r + 1), 3),
|
|
151
|
-
f("div", { class:
|
|
167
|
+
f("div", { class: b(E(g).body()) }, [w(e.$slots, "item", {
|
|
152
168
|
index: r,
|
|
153
|
-
itemLabel:
|
|
154
|
-
remove: () =>
|
|
155
|
-
moveUp: () =>
|
|
156
|
-
moveDown: () =>
|
|
169
|
+
itemLabel: L(r),
|
|
170
|
+
remove: () => U(r),
|
|
171
|
+
moveUp: () => W(r, -1),
|
|
172
|
+
moveDown: () => W(r, 1)
|
|
157
173
|
})], 2),
|
|
158
|
-
f("div", { class:
|
|
159
|
-
icon: E(
|
|
160
|
-
label: E(
|
|
174
|
+
f("div", { class: b(E(g).actions()) }, [t.reorderable ? (x(), d(s, { key: 0 }, [h(a, {
|
|
175
|
+
icon: E(te),
|
|
176
|
+
label: E(p).moveUp(L(r)),
|
|
161
177
|
variant: "text",
|
|
162
178
|
size: "sm",
|
|
163
179
|
"data-action": "up",
|
|
164
180
|
disabled: r === 0,
|
|
165
|
-
onClick: (e) =>
|
|
181
|
+
onClick: (e) => W(r, -1)
|
|
166
182
|
}, null, 8, [
|
|
167
183
|
"icon",
|
|
168
184
|
"label",
|
|
169
185
|
"disabled",
|
|
170
186
|
"onClick"
|
|
171
|
-
]),
|
|
187
|
+
]), h(a, {
|
|
172
188
|
icon: E(j),
|
|
173
|
-
label: E(
|
|
189
|
+
label: E(p).moveDown(L(r)),
|
|
174
190
|
variant: "text",
|
|
175
191
|
size: "sm",
|
|
176
192
|
"data-action": "down",
|
|
177
|
-
disabled: r ===
|
|
178
|
-
onClick: (e) =>
|
|
193
|
+
disabled: r === M.value - 1,
|
|
194
|
+
onClick: (e) => W(r, 1)
|
|
179
195
|
}, null, 8, [
|
|
180
196
|
"icon",
|
|
181
197
|
"label",
|
|
182
198
|
"disabled",
|
|
183
199
|
"onClick"
|
|
184
|
-
])], 64)) : u("", !0),
|
|
185
|
-
icon: E(
|
|
186
|
-
label: E(
|
|
200
|
+
])], 64)) : u("", !0), h(a, {
|
|
201
|
+
icon: E(re),
|
|
202
|
+
label: E(p).remove(L(r)),
|
|
187
203
|
variant: "text",
|
|
188
204
|
size: "sm",
|
|
189
205
|
"data-action": "remove",
|
|
190
|
-
disabled:
|
|
191
|
-
onClick: (e) =>
|
|
206
|
+
disabled: P.value,
|
|
207
|
+
onClick: (e) => U(r)
|
|
192
208
|
}, null, 8, [
|
|
193
209
|
"icon",
|
|
194
210
|
"label",
|
|
195
211
|
"disabled",
|
|
196
212
|
"onClick"
|
|
197
213
|
])], 2)
|
|
198
|
-
], 42,
|
|
199
|
-
f("div", { class:
|
|
214
|
+
], 42, ce))), 128))], 2),
|
|
215
|
+
f("div", { class: b(E(g).footer()) }, [h(r, {
|
|
200
216
|
variant: "outline",
|
|
201
217
|
size: "sm",
|
|
202
|
-
"leading-icon": E(
|
|
218
|
+
"leading-icon": E(ne),
|
|
203
219
|
"data-action": "add",
|
|
204
|
-
disabled:
|
|
205
|
-
onClick:
|
|
220
|
+
disabled: N.value,
|
|
221
|
+
onClick: H
|
|
206
222
|
}, {
|
|
207
|
-
default: A(() => [
|
|
223
|
+
default: A(() => [m(T(t.addLabel ?? E(p).add), 1)]),
|
|
208
224
|
_: 1
|
|
209
225
|
}, 8, ["leading-icon", "disabled"]), t.max !== void 0 || t.min > 0 ? (x(), d("span", {
|
|
210
226
|
key: 0,
|
|
211
|
-
class:
|
|
212
|
-
}, T([t.min > 0 ? E(
|
|
227
|
+
class: b(E(g).hint())
|
|
228
|
+
}, T([t.min > 0 ? E(p).min(t.min) : "", t.max === void 0 ? "" : E(p).max(t.max)].filter(Boolean).join(" · ")), 3)) : u("", !0)], 2),
|
|
213
229
|
f("span", {
|
|
214
230
|
role: "status",
|
|
215
|
-
class:
|
|
216
|
-
}, T(
|
|
231
|
+
class: b(E(R))
|
|
232
|
+
}, T(I.value), 3)
|
|
217
233
|
], 16));
|
|
218
234
|
}
|
|
219
|
-
}),
|
|
235
|
+
}), $ = ["id"], ue = /* @__PURE__ */ g({
|
|
220
236
|
inheritAttrs: !1,
|
|
221
237
|
__name: "KeyValueEditor",
|
|
222
238
|
props: {
|
|
@@ -235,20 +251,20 @@ var ae = /* @__PURE__ */ h({
|
|
|
235
251
|
classes: {}
|
|
236
252
|
},
|
|
237
253
|
setup(t) {
|
|
238
|
-
let r = t, i = n("keyValueEditor",
|
|
254
|
+
let r = t, i = n("keyValueEditor", W, () => r.classes), a = D(), s = e().keyValueEditor, f = i(), p = O(), m = J(r.field.store, (e) => e.value ?? []), g = c(() => {
|
|
239
255
|
let e = /* @__PURE__ */ new Map();
|
|
240
|
-
for (let t of
|
|
256
|
+
for (let t of m.value) t.key.trim() && e.set(t.key.trim(), (e.get(t.key.trim()) ?? 0) + 1);
|
|
241
257
|
return new Set([...e].filter(([, e]) => e > 1).map(([e]) => e));
|
|
242
|
-
}),
|
|
243
|
-
function
|
|
258
|
+
}), _ = (e) => r.uniqueKeys && g.value.has(m.value[e]?.key.trim() ?? "");
|
|
259
|
+
function y(e, t, n) {
|
|
244
260
|
r.field.replaceValue(e, {
|
|
245
|
-
...
|
|
261
|
+
...m.value[e],
|
|
246
262
|
[t]: n
|
|
247
263
|
});
|
|
248
264
|
}
|
|
249
|
-
return (e, n) => (x(), l(
|
|
265
|
+
return (e, n) => (x(), l(Q, v({
|
|
250
266
|
...E(a),
|
|
251
|
-
class: E(f).base({ class:
|
|
267
|
+
class: E(f).base({ class: b(E(a).class) })
|
|
252
268
|
}, {
|
|
253
269
|
field: t.field,
|
|
254
270
|
label: t.label,
|
|
@@ -262,14 +278,14 @@ var ae = /* @__PURE__ */ h({
|
|
|
262
278
|
max: t.max
|
|
263
279
|
}), {
|
|
264
280
|
item: A(({ index: e, itemLabel: n }) => [
|
|
265
|
-
|
|
266
|
-
"model-value": E(
|
|
281
|
+
h(o, {
|
|
282
|
+
"model-value": E(m)[e]?.key ?? "",
|
|
267
283
|
"aria-label": `${t.keyLabel ?? E(s).key}, ${n}`,
|
|
268
284
|
placeholder: t.keyPlaceholder,
|
|
269
|
-
invalid:
|
|
270
|
-
"aria-describedby":
|
|
271
|
-
class:
|
|
272
|
-
"onUpdate:modelValue": (t) =>
|
|
285
|
+
invalid: _(e),
|
|
286
|
+
"aria-describedby": _(e) ? `${E(p)}-${e}` : void 0,
|
|
287
|
+
class: b(E(f).cell()),
|
|
288
|
+
"onUpdate:modelValue": (t) => y(e, "key", t ?? "")
|
|
273
289
|
}, null, 8, [
|
|
274
290
|
"model-value",
|
|
275
291
|
"aria-label",
|
|
@@ -279,12 +295,12 @@ var ae = /* @__PURE__ */ h({
|
|
|
279
295
|
"class",
|
|
280
296
|
"onUpdate:modelValue"
|
|
281
297
|
]),
|
|
282
|
-
|
|
283
|
-
"model-value": E(
|
|
298
|
+
h(o, {
|
|
299
|
+
"model-value": E(m)[e]?.value ?? "",
|
|
284
300
|
"aria-label": `${t.valueLabel ?? E(s).value}, ${n}`,
|
|
285
301
|
placeholder: t.valuePlaceholder,
|
|
286
|
-
class:
|
|
287
|
-
"onUpdate:modelValue": (t) =>
|
|
302
|
+
class: b(E(f).cell()),
|
|
303
|
+
"onUpdate:modelValue": (t) => y(e, "value", t ?? "")
|
|
288
304
|
}, null, 8, [
|
|
289
305
|
"model-value",
|
|
290
306
|
"aria-label",
|
|
@@ -292,11 +308,11 @@ var ae = /* @__PURE__ */ h({
|
|
|
292
308
|
"class",
|
|
293
309
|
"onUpdate:modelValue"
|
|
294
310
|
]),
|
|
295
|
-
|
|
311
|
+
_(e) ? (x(), d("p", {
|
|
296
312
|
key: 0,
|
|
297
313
|
id: `${E(p)}-${e}`,
|
|
298
|
-
class:
|
|
299
|
-
}, T(E(s).duplicate), 11,
|
|
314
|
+
class: b(E(f).error())
|
|
315
|
+
}, T(E(s).duplicate), 11, $)) : u("", !0)
|
|
300
316
|
]),
|
|
301
317
|
_: 1
|
|
302
318
|
}, 16, [
|
|
@@ -311,11 +327,11 @@ var ae = /* @__PURE__ */ h({
|
|
|
311
327
|
});
|
|
312
328
|
//#endregion
|
|
313
329
|
//#region src/form/validators.ts
|
|
314
|
-
function
|
|
330
|
+
function de() {
|
|
315
331
|
let e = t();
|
|
316
|
-
return
|
|
332
|
+
return P(e.value.translations.validation, e.value.locale);
|
|
317
333
|
}
|
|
318
|
-
async function
|
|
334
|
+
async function fe(e, t) {
|
|
319
335
|
await Promise.all(t.map((t) => e.validateField(t, "change")));
|
|
320
336
|
for (let n of t) e.setFieldMeta(n, ((e) => ({
|
|
321
337
|
...e,
|
|
@@ -324,4 +340,4 @@ async function de(e, t) {
|
|
|
324
340
|
return t.every((t) => !e.getFieldMeta(t)?.errors?.some(Boolean));
|
|
325
341
|
}
|
|
326
342
|
//#endregion
|
|
327
|
-
export {
|
|
343
|
+
export { Q as FieldArray, Q as FormList, se as FormField, ue as KeyValueEditor, ie as bindCheckbox, Y as bindInput, ae as bindValue, M as combineValidators, N as createValidator, X as firstError, I as hasLength, L as isEmail, R as isIban, z as isInRange, B as isInteger, V as isPhone, H as isRequired, U as isUrl, G as matchesField, K as matchesPattern, oe as useFormErrors, de as useValidators, fe as validateFields };
|