@wssto2/vue-core 0.17.0 → 0.18.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/CHANGELOG.md +12 -0
- package/README.md +1 -0
- package/dist/collection/DynamicCollection.vue.d.ts +69 -0
- package/dist/collection/definition.d.ts +4 -4
- package/dist/collection/dynamicColumns.d.ts +13 -0
- package/dist/collection/index.d.ts +1 -0
- package/dist/collection/index.js +195 -146
- package/dist/form/dynamic/DynamicForm.vue.d.ts +46 -0
- package/dist/form/dynamic/RepeatField.vue.d.ts +47 -0
- package/dist/form/dynamic/ResourceField.vue.d.ts +38 -0
- package/dist/form/dynamic/ResourcePickerList.vue.d.ts +12 -0
- package/dist/form/dynamic/RichTextField.vue.d.ts +40 -0
- package/dist/form/dynamic/localeMode.d.ts +5 -0
- package/dist/form/dynamic/resources.d.ts +34 -0
- package/dist/form/dynamic/schema.d.ts +73 -0
- package/dist/form/dynamic/validator.d.ts +30 -0
- package/dist/form/dynamic/visibility.d.ts +12 -0
- package/dist/form/index.d.ts +11 -0
- package/dist/form/index.js +1989 -1179
- package/dist/i18n/index.js +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/resources-BZLlAtoS.js +62 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -1
package/dist/form/index.js
CHANGED
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { f as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { ref as
|
|
6
|
-
import { a as
|
|
7
|
-
import { M as
|
|
8
|
-
import { _ as
|
|
1
|
+
import { a as St, _ as it, c as Ft, f as qt, E as Bt } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
|
|
2
|
+
import { b as Ir, d as Ar, p as Nr, r as Pr, u as Kr, e as Gr, g as Hr } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
|
|
3
|
+
import { f as Me } from "../useCommand-DQKvro1n.js";
|
|
4
|
+
import { _ as Yr, a as Jr, u as Zr } from "../useCommand-DQKvro1n.js";
|
|
5
|
+
import { ref as H, computed as q, defineComponent as J, openBlock as d, createBlock as z, mergeProps as N, unref as s, createSlots as ie, withCtx as k, createElementVNode as x, normalizeClass as W, createElementBlock as g, Fragment as ee, renderList as ce, createVNode as U, createCommentVNode as j, toDisplayString as B, renderSlot as R, mergeDefaults as me, useModel as ke, useId as Ie, withKeys as Fe, withModifiers as he, createTextVNode as Z, mergeModels as ve, useTemplateRef as oe, shallowRef as We, watch as be, normalizeProps as Re, guardReactiveProps as Ue, nextTick as we, provide as ut, inject as De, onBeforeUnmount as ze, getCurrentScope as Lt, onScopeDispose as Tt, toValue as Dt, shallowReactive as Ye, normalizeStyle as zt, resolveDynamicComponent as jt, onMounted as dt, withDirectives as ct, vModelText as mt } from "vue";
|
|
6
|
+
import { a as ft } from "../leaveGuard-Cc8yeLxM.js";
|
|
7
|
+
import { M as Qr, c as en, i as tn, l as an, u as ln } from "../leaveGuard-Cc8yeLxM.js";
|
|
8
|
+
import { _ as rn } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CrGrjrlO.js";
|
|
9
9
|
import { u as sn } from "../useResourceForm-zVuWerSn.js";
|
|
10
|
-
import { _ as
|
|
11
|
-
import { _ as ye, u as
|
|
12
|
-
import { g as
|
|
13
|
-
import { u as
|
|
10
|
+
import { _ as ue } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
|
|
11
|
+
import { _ as ye, u as Ae } from "../options-mOOX6JSS.js";
|
|
12
|
+
import { g as dn, m as cn } from "../options-mOOX6JSS.js";
|
|
13
|
+
import { u as qe, f as fe, b as pe, a as pt, _ as Ot, e as Mt, g as Rt } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
|
|
14
14
|
import { c as fn } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
|
|
15
|
-
import { useI18n as
|
|
16
|
-
import { b as
|
|
17
|
-
import { a as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { _ as at } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
|
|
25
|
-
import { u as lt } from "../format-C_HXlOYQ.js";
|
|
15
|
+
import { useI18n as re } from "vue-i18n";
|
|
16
|
+
import { b as Ut } from "../controlSurface-t7OEFESJ.js";
|
|
17
|
+
import { a as Et, _ as Je } from "../TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js";
|
|
18
|
+
import { u as It, l as At } from "../suggestions-DeMgs_ki.js";
|
|
19
|
+
import { r as vn } from "../suggestions-DeMgs_ki.js";
|
|
20
|
+
import { o as Ce, q as Nt, m as Pt, s as Se, u as Ze, i as Kt, e as Be, k as Gt, _ as Ht, l as Wt, c as Yt, b as Jt, t as Oe, g as Zt, v as Xt } from "../useTypedEntry-BsMV66Yc.js";
|
|
21
|
+
import { u as Qt, a as ea, s as ta, _ as aa } from "../DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js";
|
|
22
|
+
import { _ as vt } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
|
|
23
|
+
import { u as bt } from "../format-C_HXlOYQ.js";
|
|
26
24
|
import { u as Ne } from "../mediaQuery-CygcXmFW.js";
|
|
27
|
-
import { _ as
|
|
28
|
-
import { u as
|
|
29
|
-
import { _ as
|
|
30
|
-
import { _ as
|
|
31
|
-
import { _ as
|
|
32
|
-
import { a as
|
|
33
|
-
import { _ as
|
|
34
|
-
import { _ as
|
|
35
|
-
import { b as
|
|
36
|
-
import {
|
|
37
|
-
import { _ as
|
|
38
|
-
import { _ as
|
|
39
|
-
import { _ as
|
|
40
|
-
import { _ as
|
|
41
|
-
import { _ as
|
|
42
|
-
import { _ as
|
|
43
|
-
import { _ as
|
|
44
|
-
import { p as
|
|
45
|
-
import { u as
|
|
46
|
-
import { u as
|
|
47
|
-
import { matchedRouteKey as
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
import { _ as Pe } from "../Popover.vue_vue_type_script_setup_true_lang-BK8HL_V0.js";
|
|
26
|
+
import { u as la } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
|
|
27
|
+
import { _ as yn } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
|
|
28
|
+
import { _ as ae } from "../Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
|
|
29
|
+
import { _ as hn } from "../FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js";
|
|
30
|
+
import { a as yt } from "../environment-Dva-SG8D.js";
|
|
31
|
+
import { _ as gt } from "../NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js";
|
|
32
|
+
import { _ as oa } from "../Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js";
|
|
33
|
+
import { b as ra, a as Xe, _ as na } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
|
|
34
|
+
import { u as _n } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
|
|
35
|
+
import { _ as wn, b as $n, a as Vn, u as Cn } from "../useGroupSheet-CRw3MUmX.js";
|
|
36
|
+
import { _ as Qe } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js";
|
|
37
|
+
import { _ as Fn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js";
|
|
38
|
+
import { _ as sa } from "../SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js";
|
|
39
|
+
import { _ as et } from "../TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js";
|
|
40
|
+
import { _ as ia } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js";
|
|
41
|
+
import { _ as ua, a as da } from "../SectionList.vue_vue_type_script_setup_true_lang-CodyVezo.js";
|
|
42
|
+
import { p as ca } from "../sectionIndex-BS0ic5W7.js";
|
|
43
|
+
import { u as ma } from "../useSaveChrome-DB9OwIjT.js";
|
|
44
|
+
import { u as Bn } from "../useRecordDialog-0azHxxvm.js";
|
|
45
|
+
import { matchedRouteKey as fa, onBeforeRouteLeave as pa } from "vue-router";
|
|
46
|
+
import { t as Ke, c as ht, _ as kt } from "../resources-BZLlAtoS.js";
|
|
47
|
+
function va(l) {
|
|
48
|
+
const t = H(null);
|
|
50
49
|
return {
|
|
51
|
-
isDirty:
|
|
50
|
+
isDirty: q(() => t.value !== null && JSON.stringify(l()) !== t.value),
|
|
52
51
|
markClean: () => t.value = JSON.stringify(l())
|
|
53
52
|
};
|
|
54
53
|
}
|
|
55
|
-
function
|
|
56
|
-
const t =
|
|
54
|
+
function kr(l) {
|
|
55
|
+
const t = H(!1), e = va(l), { confirmDiscard: a } = ft(() => t.value && e.isDirty.value);
|
|
57
56
|
return {
|
|
58
57
|
/** The sheet was just filled: its current values are the baseline. */
|
|
59
58
|
opened: () => {
|
|
@@ -66,46 +65,46 @@ function po(l) {
|
|
|
66
65
|
beforeDismiss: a
|
|
67
66
|
};
|
|
68
67
|
}
|
|
69
|
-
const
|
|
68
|
+
const tt = (l, t) => {
|
|
70
69
|
const e = Number(t);
|
|
71
70
|
if (Number.isInteger(e) && Math.abs(e) < 1e4) return String(e);
|
|
72
71
|
const a = Number.isInteger(e) ? 0 : 2;
|
|
73
72
|
return l.number(e, { minimumFractionDigits: a, maximumFractionDigits: a });
|
|
74
73
|
};
|
|
75
|
-
function
|
|
76
|
-
const { t: e, te: a } = l.global,
|
|
77
|
-
return (
|
|
78
|
-
switch (
|
|
74
|
+
function _r({ i18n: l, format: t }) {
|
|
75
|
+
const { t: e, te: a } = l.global, r = (u) => `validation_errors.${u}`, i = (u) => `core.validation_errors.${u}`, p = (u, b) => ({ message: e(a(r(u)) ? r(u) : i(u), b) });
|
|
76
|
+
return (u) => {
|
|
77
|
+
switch (u.code) {
|
|
79
78
|
case "invalid_type":
|
|
80
|
-
return
|
|
79
|
+
return p("required");
|
|
81
80
|
case "too_small":
|
|
82
|
-
return
|
|
81
|
+
return u.origin === "string" ? Number(u.minimum) === 1 ? p("required") : p("min", { min: Number(u.minimum) }) : u.origin === "number" ? p("min_value", { min: tt(t, u.minimum) }) : void 0;
|
|
83
82
|
case "too_big":
|
|
84
|
-
return
|
|
83
|
+
return u.origin === "string" ? p("max", { max: Number(u.maximum) }) : u.origin === "number" ? p("max_value", { max: tt(t, u.maximum) }) : void 0;
|
|
85
84
|
case "invalid_format":
|
|
86
|
-
return
|
|
85
|
+
return u.format !== void 0 && ["email", "url", "date", "datetime"].includes(u.format) ? p(u.format) : void 0;
|
|
87
86
|
case "custom": {
|
|
88
|
-
const
|
|
89
|
-
if (typeof
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
return
|
|
87
|
+
const b = u.params?.code;
|
|
88
|
+
if (typeof b != "string") return;
|
|
89
|
+
if (b === "required") return p("required");
|
|
90
|
+
const _ = a(r(b)) ? r(b) : a(i(b)) ? i(b) : null;
|
|
91
|
+
return _ === null ? void 0 : { message: e(_) };
|
|
93
92
|
}
|
|
94
93
|
default:
|
|
95
94
|
return;
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
97
|
}
|
|
99
|
-
const
|
|
98
|
+
const ba = ["id", "aria-label", "aria-describedby", "aria-invalid"], ya = ["name", "value", "checked", "disabled", "onChange"], ga = { class: "min-w-0 flex-1" }, ha = { class: "block text-body font-semibold text-content-strong" }, ka = {
|
|
100
99
|
key: 0,
|
|
101
100
|
class: "mt-0.5 block text-footnote text-content-muted"
|
|
102
|
-
},
|
|
101
|
+
}, _a = {
|
|
103
102
|
key: 1,
|
|
104
103
|
class: "flex size-5 shrink-0 items-center justify-center rounded-full bg-control-on text-white",
|
|
105
104
|
"aria-hidden": "true"
|
|
106
|
-
},
|
|
105
|
+
}, xr = /* @__PURE__ */ J({
|
|
107
106
|
__name: "CardSelectField",
|
|
108
|
-
props: /* @__PURE__ */
|
|
107
|
+
props: /* @__PURE__ */ me({
|
|
109
108
|
label: {},
|
|
110
109
|
labelHidden: { type: Boolean },
|
|
111
110
|
hint: {},
|
|
@@ -119,90 +118,90 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
|
|
|
119
118
|
modelValue: {},
|
|
120
119
|
options: {},
|
|
121
120
|
columns: {}
|
|
122
|
-
}, { ...
|
|
121
|
+
}, { ...pe, modelValue: null, columns: 2 }),
|
|
123
122
|
emits: ["update:modelValue"],
|
|
124
123
|
setup(l, { emit: t }) {
|
|
125
|
-
const e = l, a = t, { editable:
|
|
126
|
-
return (
|
|
127
|
-
value: e.options.find((
|
|
124
|
+
const e = l, a = t, { editable: r } = qe(e), i = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" }, p = q(() => i[e.columns]);
|
|
125
|
+
return (u, b) => (d(), z(ye, N(s(fe)(e), {
|
|
126
|
+
value: e.options.find((_) => _.value === e.modelValue)?.label ?? null,
|
|
128
127
|
"row-layout": "stacked"
|
|
129
|
-
}),
|
|
130
|
-
default:
|
|
131
|
-
|
|
132
|
-
id:
|
|
128
|
+
}), ie({
|
|
129
|
+
default: k(({ id: _, describedby: V, invalid: $ }) => [
|
|
130
|
+
x("div", {
|
|
131
|
+
id: _,
|
|
133
132
|
role: "radiogroup",
|
|
134
133
|
"aria-label": e.label,
|
|
135
|
-
"aria-describedby":
|
|
134
|
+
"aria-describedby": V,
|
|
136
135
|
"aria-invalid": $ || void 0,
|
|
137
|
-
class:
|
|
136
|
+
class: W(["grid w-full gap-2.5", p.value]),
|
|
138
137
|
"data-test": "card-select"
|
|
139
138
|
}, [
|
|
140
|
-
(d(!0),
|
|
141
|
-
key:
|
|
142
|
-
class:
|
|
139
|
+
(d(!0), g(ee, null, ce(e.options, (n) => (d(), g("label", {
|
|
140
|
+
key: n.value,
|
|
141
|
+
class: W(["relative flex items-center gap-3 rounded-group bg-fill p-3.5 transition-colors duration-motion-fast focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-border-focus", [n.value === e.modelValue ? "bg-tint-soft ring-[1.5px] ring-inset ring-border-selected" : "hover:bg-fill-strong", e.disabled || !s(r) || n.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"]])
|
|
143
142
|
}, [
|
|
144
|
-
|
|
143
|
+
x("input", {
|
|
145
144
|
type: "radio",
|
|
146
145
|
class: "sr-only",
|
|
147
|
-
name: e.name ??
|
|
148
|
-
value:
|
|
149
|
-
checked:
|
|
150
|
-
disabled: e.disabled || !s(
|
|
151
|
-
onChange: (
|
|
152
|
-
}, null, 40,
|
|
153
|
-
|
|
146
|
+
name: e.name ?? _,
|
|
147
|
+
value: n.value,
|
|
148
|
+
checked: n.value === e.modelValue,
|
|
149
|
+
disabled: e.disabled || !s(r) || n.disabled,
|
|
150
|
+
onChange: (c) => a("update:modelValue", n.value)
|
|
151
|
+
}, null, 40, ya),
|
|
152
|
+
n.icon ? (d(), g("span", {
|
|
154
153
|
key: 0,
|
|
155
|
-
class:
|
|
154
|
+
class: W(["flex size-9 shrink-0 items-center justify-center rounded-control", n.value === e.modelValue ? "bg-control-on text-white" : "bg-fill-strong text-content-muted"])
|
|
156
155
|
}, [
|
|
157
|
-
|
|
158
|
-
name:
|
|
156
|
+
U(s(ue), {
|
|
157
|
+
name: n.icon,
|
|
159
158
|
size: 18
|
|
160
159
|
}, null, 8, ["name"])
|
|
161
|
-
], 2)) :
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
160
|
+
], 2)) : j("", !0),
|
|
161
|
+
x("span", ga, [
|
|
162
|
+
x("span", ha, B(n.label), 1),
|
|
163
|
+
n.description ? (d(), g("span", ka, B(n.description), 1)) : j("", !0)
|
|
165
164
|
]),
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
n.value === e.modelValue ? (d(), g("span", _a, [
|
|
166
|
+
U(s(ue), {
|
|
168
167
|
name: "checkCustom",
|
|
169
168
|
size: 12
|
|
170
169
|
})
|
|
171
|
-
])) :
|
|
170
|
+
])) : j("", !0)
|
|
172
171
|
], 2))), 128))
|
|
173
|
-
], 10,
|
|
172
|
+
], 10, ba)
|
|
174
173
|
]),
|
|
175
174
|
_: 2
|
|
176
175
|
}, [
|
|
177
|
-
|
|
176
|
+
u.$slots.trailing ? {
|
|
178
177
|
name: "trailing",
|
|
179
|
-
fn:
|
|
180
|
-
|
|
178
|
+
fn: k(() => [
|
|
179
|
+
R(u.$slots, "trailing")
|
|
181
180
|
]),
|
|
182
181
|
key: "0"
|
|
183
182
|
} : void 0,
|
|
184
|
-
|
|
183
|
+
u.$slots.labelTrailing ? {
|
|
185
184
|
name: "labelTrailing",
|
|
186
|
-
fn:
|
|
187
|
-
|
|
185
|
+
fn: k(() => [
|
|
186
|
+
R(u.$slots, "labelTrailing")
|
|
188
187
|
]),
|
|
189
188
|
key: "1"
|
|
190
189
|
} : void 0,
|
|
191
|
-
|
|
190
|
+
u.$slots.readonly ? {
|
|
192
191
|
name: "readonly",
|
|
193
|
-
fn:
|
|
194
|
-
|
|
192
|
+
fn: k(() => [
|
|
193
|
+
R(u.$slots, "readonly")
|
|
195
194
|
]),
|
|
196
195
|
key: "2"
|
|
197
196
|
} : void 0
|
|
198
197
|
]), 1040, ["value"]));
|
|
199
198
|
}
|
|
200
|
-
}),
|
|
199
|
+
}), xa = ["data-field-error"], wa = ["aria-checked", "aria-disabled", "aria-describedby", "aria-invalid", "tabindex", "onKeydown"], $a = { class: "flex min-w-0 flex-1 flex-col items-start" }, Va = {
|
|
201
200
|
key: 0,
|
|
202
201
|
class: "flex shrink-0 items-center gap-2.5"
|
|
203
|
-
},
|
|
202
|
+
}, Ca = ["id"], wr = /* @__PURE__ */ J({
|
|
204
203
|
__name: "CheckboxField",
|
|
205
|
-
props: /* @__PURE__ */
|
|
204
|
+
props: /* @__PURE__ */ ve({
|
|
206
205
|
label: {},
|
|
207
206
|
description: { default: void 0 },
|
|
208
207
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -214,77 +213,77 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
|
|
|
214
213
|
}),
|
|
215
214
|
emits: ["update:modelValue"],
|
|
216
215
|
setup(l) {
|
|
217
|
-
const t = l, e =
|
|
216
|
+
const t = l, e = ke(l, "modelValue"), a = !!pt(), r = Ie(), i = () => {
|
|
218
217
|
t.disabled || (e.value = !e.value);
|
|
219
218
|
};
|
|
220
|
-
return (
|
|
219
|
+
return (p, u) => (d(), g("div", {
|
|
221
220
|
class: "group/check",
|
|
222
221
|
"data-field-error": t.error ? "true" : void 0
|
|
223
222
|
}, [
|
|
224
|
-
|
|
223
|
+
x("div", {
|
|
225
224
|
role: "checkbox",
|
|
226
225
|
"aria-checked": e.value,
|
|
227
226
|
"aria-disabled": t.disabled || void 0,
|
|
228
|
-
"aria-describedby": t.error ? `${s(
|
|
227
|
+
"aria-describedby": t.error ? `${s(r)}-error` : void 0,
|
|
229
228
|
"aria-invalid": t.error ? !0 : void 0,
|
|
230
229
|
tabindex: t.disabled ? -1 : 0,
|
|
231
230
|
"data-test": "checkbox",
|
|
232
|
-
class:
|
|
233
|
-
onClick:
|
|
231
|
+
class: W(["flex items-center transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", [t.variant === "row" ? "gap-3 pl-row-inset focus-visible:-outline-offset-2" : "gap-2.5 rounded-control px-2 py-1.5 focus-visible:outline-offset-1", a && t.variant === "row" ? "group-first/check:rounded-t-group group-last/check:rounded-b-group" : "", t.disabled ? "cursor-not-allowed" : t.variant === "row" ? "cursor-pointer hover:bg-fill/60 active:bg-fill" : "cursor-pointer hover:bg-fill"]]),
|
|
232
|
+
onClick: i,
|
|
234
233
|
onKeydown: [
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
Fe(he(i, ["prevent"]), ["space"]),
|
|
235
|
+
Fe(he(i, ["prevent"]), ["enter"])
|
|
237
236
|
]
|
|
238
237
|
}, [
|
|
239
|
-
|
|
240
|
-
class:
|
|
238
|
+
x("span", {
|
|
239
|
+
class: W(["flex shrink-0 items-center justify-center rounded-full border-2", [t.variant === "row" ? "size-5.5" : "size-5", e.value ? t.disabled ? "border-content-disabled bg-content-disabled text-white" : "border-control-on bg-control-on text-white" : "border-border-control"]]),
|
|
241
240
|
"aria-hidden": "true"
|
|
242
241
|
}, [
|
|
243
|
-
e.value ? (d(),
|
|
242
|
+
e.value ? (d(), z(s(ue), {
|
|
244
243
|
key: 0,
|
|
245
244
|
name: "checkCustom",
|
|
246
245
|
size: 12
|
|
247
|
-
})) :
|
|
246
|
+
})) : j("", !0)
|
|
248
247
|
], 2),
|
|
249
|
-
|
|
250
|
-
class:
|
|
248
|
+
x("div", {
|
|
249
|
+
class: W(["flex min-w-0 flex-1 items-center gap-3", t.variant === "row" ? "min-h-row border-t border-border-separator py-2 pr-row-inset group-first/check:border-t-0" : ""])
|
|
251
250
|
}, [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
class:
|
|
255
|
-
},
|
|
256
|
-
t.description ? (d(),
|
|
251
|
+
x("div", $a, [
|
|
252
|
+
x("p", {
|
|
253
|
+
class: W(["w-full text-body", [t.variant === "row" ? "break-words" : "truncate", t.disabled ? "text-content-muted" : e.value ? "text-content-strong" : "text-content"]])
|
|
254
|
+
}, B(t.label), 3),
|
|
255
|
+
t.description ? (d(), g("p", {
|
|
257
256
|
key: 0,
|
|
258
|
-
class:
|
|
259
|
-
},
|
|
260
|
-
|
|
257
|
+
class: W(["tabular-nums text-content-muted", t.variant === "row" ? "text-footnote" : "text-xs"])
|
|
258
|
+
}, B(t.description), 3)) : j("", !0),
|
|
259
|
+
R(p.$slots, "default")
|
|
261
260
|
]),
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
])) :
|
|
261
|
+
p.$slots.trailing ? (d(), g("div", Va, [
|
|
262
|
+
R(p.$slots, "trailing")
|
|
263
|
+
])) : j("", !0)
|
|
265
264
|
], 2)
|
|
266
|
-
], 42,
|
|
267
|
-
t.error ? (d(),
|
|
265
|
+
], 42, wa),
|
|
266
|
+
t.error ? (d(), g("p", {
|
|
268
267
|
key: 0,
|
|
269
|
-
id: `${s(
|
|
268
|
+
id: `${s(r)}-error`,
|
|
270
269
|
role: "alert",
|
|
271
270
|
class: "flex items-start gap-1.5 px-2 pt-1 text-footnote text-content-destructive"
|
|
272
271
|
}, [
|
|
273
|
-
|
|
272
|
+
U(s(ue), {
|
|
274
273
|
name: "alertTriangle",
|
|
275
274
|
size: 14,
|
|
276
275
|
class: "mt-px shrink-0"
|
|
277
276
|
}),
|
|
278
|
-
|
|
279
|
-
], 8,
|
|
280
|
-
], 8,
|
|
277
|
+
Z(" " + B(t.error), 1)
|
|
278
|
+
], 8, Ca)) : j("", !0)
|
|
279
|
+
], 8, xa));
|
|
281
280
|
}
|
|
282
|
-
}),
|
|
281
|
+
}), Sa = {
|
|
283
282
|
key: 0,
|
|
284
283
|
class: "text-body text-content-muted"
|
|
285
|
-
},
|
|
284
|
+
}, Fa = ["id", "aria-label", "aria-describedby", "aria-invalid"], qa = ["aria-pressed", "disabled", "onClick"], $r = /* @__PURE__ */ J({
|
|
286
285
|
__name: "ChoiceChips",
|
|
287
|
-
props: /* @__PURE__ */
|
|
286
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
288
287
|
label: {},
|
|
289
288
|
labelHidden: { type: Boolean },
|
|
290
289
|
hint: {},
|
|
@@ -296,77 +295,77 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
|
|
|
296
295
|
presentation: {},
|
|
297
296
|
name: {},
|
|
298
297
|
options: {}
|
|
299
|
-
}, { ...
|
|
298
|
+
}, { ...pe }), {
|
|
300
299
|
modelValue: { default: () => [] },
|
|
301
300
|
modelModifiers: {}
|
|
302
301
|
}),
|
|
303
302
|
emits: ["update:modelValue"],
|
|
304
303
|
setup(l) {
|
|
305
|
-
const t = l, e =
|
|
306
|
-
return (
|
|
307
|
-
value: t.options.filter((
|
|
304
|
+
const t = l, e = ke(l, "modelValue"), a = (r) => e.value = e.value.includes(r) ? e.value.filter((i) => i !== r) : [...e.value, r];
|
|
305
|
+
return (r, i) => (d(), z(ye, N(s(fe)(t), {
|
|
306
|
+
value: t.options.filter((p) => e.value.includes(p.value)).map((p) => p.label).join(", ") || null,
|
|
308
307
|
"row-layout": "stacked"
|
|
309
|
-
}),
|
|
310
|
-
default:
|
|
311
|
-
t.options.length === 0 ? (d(),
|
|
308
|
+
}), ie({
|
|
309
|
+
default: k(({ id: p, describedby: u, invalid: b }) => [
|
|
310
|
+
t.options.length === 0 ? (d(), g("span", Sa, "—")) : (d(), g("div", {
|
|
312
311
|
key: 1,
|
|
313
|
-
id:
|
|
312
|
+
id: p,
|
|
314
313
|
role: "group",
|
|
315
314
|
"aria-label": t.label,
|
|
316
|
-
"aria-describedby":
|
|
317
|
-
"aria-invalid":
|
|
315
|
+
"aria-describedby": u,
|
|
316
|
+
"aria-invalid": b || void 0,
|
|
318
317
|
class: "flex flex-wrap gap-1.5 py-1",
|
|
319
318
|
"data-test": "choice-chips"
|
|
320
319
|
}, [
|
|
321
|
-
(d(!0),
|
|
322
|
-
key:
|
|
320
|
+
(d(!0), g(ee, null, ce(t.options, (_) => (d(), g("button", {
|
|
321
|
+
key: _.value,
|
|
323
322
|
type: "button",
|
|
324
|
-
"aria-pressed": e.value.includes(
|
|
325
|
-
disabled: t.disabled ||
|
|
326
|
-
class:
|
|
327
|
-
onClick: (
|
|
323
|
+
"aria-pressed": e.value.includes(_.value),
|
|
324
|
+
disabled: t.disabled || _.disabled,
|
|
325
|
+
class: W(["inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-full px-3 text-subheadline transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-60", e.value.includes(_.value) ? "bg-tint-soft font-semibold text-content-link" : "bg-fill font-medium text-content-strong hover:bg-fill-strong"]),
|
|
326
|
+
onClick: (V) => a(_.value)
|
|
328
327
|
}, [
|
|
329
|
-
e.value.includes(
|
|
328
|
+
e.value.includes(_.value) ? (d(), z(s(ue), {
|
|
330
329
|
key: 0,
|
|
331
330
|
name: "checkCustom",
|
|
332
331
|
size: 12
|
|
333
|
-
})) :
|
|
334
|
-
|
|
335
|
-
], 10,
|
|
336
|
-
], 8,
|
|
332
|
+
})) : j("", !0),
|
|
333
|
+
Z(" " + B(_.label), 1)
|
|
334
|
+
], 10, qa))), 128))
|
|
335
|
+
], 8, Fa))
|
|
337
336
|
]),
|
|
338
337
|
_: 2
|
|
339
338
|
}, [
|
|
340
|
-
|
|
339
|
+
r.$slots.trailing ? {
|
|
341
340
|
name: "trailing",
|
|
342
|
-
fn:
|
|
343
|
-
|
|
341
|
+
fn: k(() => [
|
|
342
|
+
R(r.$slots, "trailing")
|
|
344
343
|
]),
|
|
345
344
|
key: "0"
|
|
346
345
|
} : void 0,
|
|
347
|
-
|
|
346
|
+
r.$slots.labelTrailing ? {
|
|
348
347
|
name: "labelTrailing",
|
|
349
|
-
fn:
|
|
350
|
-
|
|
348
|
+
fn: k(() => [
|
|
349
|
+
R(r.$slots, "labelTrailing")
|
|
351
350
|
]),
|
|
352
351
|
key: "1"
|
|
353
352
|
} : void 0,
|
|
354
|
-
|
|
353
|
+
r.$slots.readonly ? {
|
|
355
354
|
name: "readonly",
|
|
356
|
-
fn:
|
|
357
|
-
|
|
355
|
+
fn: k(() => [
|
|
356
|
+
R(r.$slots, "readonly")
|
|
358
357
|
]),
|
|
359
358
|
key: "2"
|
|
360
359
|
} : void 0
|
|
361
360
|
]), 1040, ["value"]));
|
|
362
361
|
}
|
|
363
|
-
}),
|
|
362
|
+
}), Ba = {
|
|
364
363
|
key: 0,
|
|
365
364
|
class: "flex shrink-0 items-center",
|
|
366
365
|
"data-test": "field-value"
|
|
367
|
-
},
|
|
366
|
+
}, La = ["id", "value", "name", "placeholder", "disabled", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-required", "aria-invalid", "aria-describedby"], Ta = { class: "block break-words text-body text-content-strong" }, Vr = /* @__PURE__ */ J({
|
|
368
367
|
__name: "ComboField",
|
|
369
|
-
props: /* @__PURE__ */
|
|
368
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
370
369
|
label: {},
|
|
371
370
|
labelHidden: { type: Boolean },
|
|
372
371
|
hint: {},
|
|
@@ -387,104 +386,104 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
|
|
|
387
386
|
recents: {},
|
|
388
387
|
width: {},
|
|
389
388
|
rowLayout: {}
|
|
390
|
-
}, { ...
|
|
389
|
+
}, { ...pe, options: void 0, search: void 0, selected: null, placeholder: void 0, minLength: 1, debounce: 300, limit: 30, recents: void 0, width: "md", rowLayout: void 0 }), {
|
|
391
390
|
modelValue: { default: null },
|
|
392
391
|
modelModifiers: {}
|
|
393
392
|
}),
|
|
394
|
-
emits: /* @__PURE__ */
|
|
393
|
+
emits: /* @__PURE__ */ ve(["picked", "focus", "blur"], ["update:modelValue"]),
|
|
395
394
|
setup(l, { expose: t, emit: e }) {
|
|
396
|
-
const a = l,
|
|
395
|
+
const a = l, r = ke(l, "modelValue"), i = e, { t: p } = re(), u = !!pt(), b = Ae("text", () => a.error ? "error" : a.disabled ? "locked" : "rest"), _ = q(() => a.rowLayout === "stacked"), V = q(() => u && !_.value ? Ut(a.width) : "w-full"), $ = oe("input"), n = oe("anchor"), c = We(null), m = We(""), h = It({
|
|
397
396
|
source: () => a.search ?? a.options,
|
|
398
397
|
minLength: () => a.minLength,
|
|
399
398
|
debounce: () => a.debounce,
|
|
400
399
|
limit: () => a.limit,
|
|
401
400
|
listAllWhenEmpty: !0,
|
|
402
401
|
recents: () => a.recents
|
|
403
|
-
}), { items:
|
|
404
|
-
const
|
|
405
|
-
return
|
|
402
|
+
}), { items: v, open: y, status: S, highlighted: L, showingRecent: T } = h, C = q(() => {
|
|
403
|
+
const D = r.value;
|
|
404
|
+
return D === null ? null : [c.value, a.selected, ...a.options ?? []].find((Q) => Q?.value === D) ?? null;
|
|
406
405
|
});
|
|
407
|
-
|
|
408
|
-
|
|
406
|
+
be(C, (D) => {
|
|
407
|
+
y.value || (m.value = D?.label ?? "");
|
|
409
408
|
}, { immediate: !0 });
|
|
410
|
-
function
|
|
411
|
-
|
|
409
|
+
function P(D) {
|
|
410
|
+
m.value = D.target.value, h.ask(m.value), m.value === "" && (r.value = null, c.value = null);
|
|
412
411
|
}
|
|
413
|
-
function
|
|
414
|
-
|
|
412
|
+
function Y(D) {
|
|
413
|
+
i("focus", D), a.disabled || h.show("");
|
|
415
414
|
}
|
|
416
|
-
function
|
|
417
|
-
|
|
415
|
+
function M(D) {
|
|
416
|
+
h.close(), h.remember(D), c.value = D, r.value = D.value, m.value = D.label, i("picked", D);
|
|
418
417
|
}
|
|
419
|
-
function
|
|
420
|
-
|
|
418
|
+
function O(D) {
|
|
419
|
+
h.close(), m.value = C.value?.label ?? "", i("blur", D);
|
|
421
420
|
}
|
|
422
|
-
const
|
|
423
|
-
return t({ focus: () => $.value?.focus() }), (
|
|
424
|
-
value:
|
|
421
|
+
const X = q(() => At(y.value, v.value.length, S.value, !0));
|
|
422
|
+
return t({ focus: () => $.value?.focus() }), (D, Q) => (d(), z(ye, N(s(fe)(a), {
|
|
423
|
+
value: C.value?.label ?? null,
|
|
425
424
|
"row-layout": a.rowLayout
|
|
426
|
-
}),
|
|
427
|
-
default:
|
|
428
|
-
|
|
425
|
+
}), ie({
|
|
426
|
+
default: k(({ id: te, describedby: ne, invalid: le }) => [
|
|
427
|
+
x("div", {
|
|
429
428
|
ref_key: "anchor",
|
|
430
|
-
ref:
|
|
431
|
-
class:
|
|
429
|
+
ref: n,
|
|
430
|
+
class: W(["flex items-center gap-1.5", [s(b), V.value]])
|
|
432
431
|
}, [
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
option:
|
|
432
|
+
D.$slots.value && C.value ? (d(), g("span", Ba, [
|
|
433
|
+
R(D.$slots, "value", {
|
|
434
|
+
option: C.value
|
|
436
435
|
})
|
|
437
|
-
])) :
|
|
438
|
-
|
|
439
|
-
id:
|
|
436
|
+
])) : j("", !0),
|
|
437
|
+
x("input", {
|
|
438
|
+
id: te,
|
|
440
439
|
ref_key: "input",
|
|
441
440
|
ref: $,
|
|
442
441
|
role: "combobox",
|
|
443
442
|
type: "text",
|
|
444
443
|
autocomplete: "off",
|
|
445
|
-
value:
|
|
444
|
+
value: m.value,
|
|
446
445
|
name: a.name,
|
|
447
446
|
placeholder: a.placeholder,
|
|
448
447
|
disabled: a.disabled,
|
|
449
448
|
required: a.required,
|
|
450
449
|
"aria-autocomplete": "list",
|
|
451
|
-
"aria-expanded":
|
|
452
|
-
"aria-controls": `${
|
|
453
|
-
"aria-activedescendant":
|
|
450
|
+
"aria-expanded": X.value,
|
|
451
|
+
"aria-controls": `${te}-list`,
|
|
452
|
+
"aria-activedescendant": X.value && s(v).length > 0 ? `${te}-option-${s(L)}` : void 0,
|
|
454
453
|
"aria-required": a.required || void 0,
|
|
455
|
-
"aria-invalid":
|
|
456
|
-
"aria-describedby":
|
|
457
|
-
class:
|
|
458
|
-
onInput:
|
|
459
|
-
onFocus:
|
|
460
|
-
onBlur:
|
|
461
|
-
onKeydown:
|
|
462
|
-
}, null, 42,
|
|
463
|
-
|
|
454
|
+
"aria-invalid": le || void 0,
|
|
455
|
+
"aria-describedby": ne,
|
|
456
|
+
class: W(["block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed", u && !_.value ? "compact:text-right" : ""]),
|
|
457
|
+
onInput: P,
|
|
458
|
+
onFocus: Y,
|
|
459
|
+
onBlur: O,
|
|
460
|
+
onKeydown: Q[0] || (Q[0] = (de) => s(h).keydown(de, { pick: M, enterNeedsMove: !1 }))
|
|
461
|
+
}, null, 42, La),
|
|
462
|
+
U(s(ue), {
|
|
464
463
|
name: "search",
|
|
465
464
|
size: 14,
|
|
466
465
|
class: "shrink-0 text-content-muted"
|
|
467
466
|
})
|
|
468
467
|
], 2),
|
|
469
|
-
|
|
470
|
-
id:
|
|
471
|
-
anchor:
|
|
472
|
-
open: s(
|
|
473
|
-
items: s(
|
|
474
|
-
highlighted: s(
|
|
475
|
-
query:
|
|
476
|
-
status: s(
|
|
477
|
-
recent: s(
|
|
468
|
+
U(Et, {
|
|
469
|
+
id: te,
|
|
470
|
+
anchor: n.value,
|
|
471
|
+
open: s(y),
|
|
472
|
+
items: s(v),
|
|
473
|
+
highlighted: s(L),
|
|
474
|
+
query: m.value,
|
|
475
|
+
status: s(S),
|
|
476
|
+
recent: s(T),
|
|
478
477
|
"empty-message": !0,
|
|
479
|
-
selected:
|
|
480
|
-
hint: s(
|
|
481
|
-
onPick:
|
|
482
|
-
onHover:
|
|
483
|
-
},
|
|
484
|
-
|
|
478
|
+
selected: r.value,
|
|
479
|
+
hint: s(p)("core.form.suggestions.keys_pick"),
|
|
480
|
+
onPick: M,
|
|
481
|
+
onHover: Q[1] || (Q[1] = (de) => s(h).highlight(de))
|
|
482
|
+
}, ie({ _: 2 }, [
|
|
483
|
+
D.$slots.option ? {
|
|
485
484
|
name: "option",
|
|
486
|
-
fn:
|
|
487
|
-
|
|
485
|
+
fn: k((de) => [
|
|
486
|
+
R(D.$slots, "option", Re(Ue(de)))
|
|
488
487
|
]),
|
|
489
488
|
key: "0"
|
|
490
489
|
} : void 0
|
|
@@ -492,32 +491,32 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
|
|
|
492
491
|
]),
|
|
493
492
|
_: 2
|
|
494
493
|
}, [
|
|
495
|
-
|
|
494
|
+
D.$slots.trailing ? {
|
|
496
495
|
name: "trailing",
|
|
497
|
-
fn:
|
|
498
|
-
|
|
496
|
+
fn: k(() => [
|
|
497
|
+
R(D.$slots, "trailing")
|
|
499
498
|
]),
|
|
500
499
|
key: "0"
|
|
501
500
|
} : void 0,
|
|
502
|
-
|
|
501
|
+
D.$slots.labelTrailing ? {
|
|
503
502
|
name: "labelTrailing",
|
|
504
|
-
fn:
|
|
505
|
-
|
|
503
|
+
fn: k(() => [
|
|
504
|
+
R(D.$slots, "labelTrailing")
|
|
506
505
|
]),
|
|
507
506
|
key: "1"
|
|
508
507
|
} : void 0,
|
|
509
|
-
|
|
508
|
+
D.$slots.readonly ? {
|
|
510
509
|
name: "readonly",
|
|
511
|
-
fn:
|
|
512
|
-
|
|
510
|
+
fn: k(() => [
|
|
511
|
+
R(D.$slots, "readonly")
|
|
513
512
|
]),
|
|
514
513
|
key: "2"
|
|
515
|
-
} :
|
|
514
|
+
} : D.$slots.value && C.value ? {
|
|
516
515
|
name: "readonly",
|
|
517
|
-
fn:
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
option:
|
|
516
|
+
fn: k(() => [
|
|
517
|
+
x("span", Ta, [
|
|
518
|
+
R(D.$slots, "value", {
|
|
519
|
+
option: C.value
|
|
521
520
|
})
|
|
522
521
|
])
|
|
523
522
|
]),
|
|
@@ -525,40 +524,40 @@ const Wt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Jt = ["name
|
|
|
525
524
|
} : void 0
|
|
526
525
|
]), 1040, ["value", "row-layout"]));
|
|
527
526
|
}
|
|
528
|
-
}),
|
|
529
|
-
function
|
|
527
|
+
}), _t = /^(0000-00-00|1970-01-01|0001-01-01)/, at = (l) => String(l).padStart(2, "0"), xt = (l) => Pt(l.getFullYear(), l.getMonth() + 1, l.getDate()), Da = (l) => `${at(l.getHours())}:${at(l.getMinutes())}`;
|
|
528
|
+
function za(l) {
|
|
530
529
|
if (l == null || l === "") return null;
|
|
531
|
-
if (l instanceof Date) return Number.isNaN(l.getTime()) ? null :
|
|
532
|
-
if (
|
|
530
|
+
if (l instanceof Date) return Number.isNaN(l.getTime()) ? null : xt(l);
|
|
531
|
+
if (_t.test(l)) return null;
|
|
533
532
|
const t = /^(\d{4}-\d{2}-\d{2})/.exec(l);
|
|
534
|
-
return t &&
|
|
533
|
+
return t && Nt(t[1]) ? t[1] : null;
|
|
535
534
|
}
|
|
536
|
-
function
|
|
537
|
-
if (l == null || l === "" || typeof l == "string" &&
|
|
538
|
-
const t = l instanceof Date ? l :
|
|
535
|
+
function wt(l) {
|
|
536
|
+
if (l == null || l === "" || typeof l == "string" && _t.test(l)) return null;
|
|
537
|
+
const t = l instanceof Date ? l : ja(l);
|
|
539
538
|
if (Number.isNaN(t.getTime())) return null;
|
|
540
|
-
const e =
|
|
541
|
-
return e ?
|
|
539
|
+
const e = xt(t);
|
|
540
|
+
return e ? Ce(e, Da(t)) : null;
|
|
542
541
|
}
|
|
543
|
-
function
|
|
542
|
+
function ja(l) {
|
|
544
543
|
const t = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(l);
|
|
545
544
|
return t ? new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]), Number(t[4] ?? 0), Number(t[5] ?? 0), Number(t[6] ?? 0)) : new Date(l);
|
|
546
545
|
}
|
|
547
|
-
function
|
|
548
|
-
return
|
|
546
|
+
function Cr(l = /* @__PURE__ */ new Date()) {
|
|
547
|
+
return wt(l) ?? "";
|
|
549
548
|
}
|
|
550
|
-
const
|
|
549
|
+
const Oa = {
|
|
551
550
|
key: 0,
|
|
552
551
|
class: "whitespace-normal"
|
|
553
|
-
},
|
|
552
|
+
}, Ma = { class: "whitespace-nowrap" }, Ra = { class: "whitespace-nowrap" }, Ua = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], Ea = ["aria-label", "onClick"], Ia = {
|
|
554
553
|
class: "-m-3 flex",
|
|
555
554
|
"data-test": "date-time-popover"
|
|
556
|
-
},
|
|
555
|
+
}, Aa = { class: "flex w-75 flex-col gap-2.5 border-r border-border-separator p-3.5" }, Na = {
|
|
557
556
|
key: 0,
|
|
558
557
|
class: "border-t border-border-separator pt-2.5"
|
|
559
|
-
},
|
|
558
|
+
}, Pa = { class: "flex w-48 flex-col gap-2.5 px-3 py-3.5" }, Ka = ["for"], Ga = ["id", "value", "placeholder", "aria-invalid"], Ha = ["onClick"], Wa = /* @__PURE__ */ J({
|
|
560
559
|
__name: "DateTimeField",
|
|
561
|
-
props: /* @__PURE__ */
|
|
560
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
562
561
|
label: {},
|
|
563
562
|
labelHidden: { type: Boolean },
|
|
564
563
|
hint: {},
|
|
@@ -575,190 +574,190 @@ const pa = {
|
|
|
575
574
|
openOn: {},
|
|
576
575
|
minuteStep: {},
|
|
577
576
|
quickPicks: {}
|
|
578
|
-
}, { ...
|
|
577
|
+
}, { ...pe, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, minuteStep: 1, quickPicks: void 0 }), {
|
|
579
578
|
modelValue: { default: null },
|
|
580
579
|
modelModifiers: {}
|
|
581
580
|
}),
|
|
582
|
-
emits: /* @__PURE__ */
|
|
581
|
+
emits: /* @__PURE__ */ ve(["focus", "blur"], ["update:modelValue"]),
|
|
583
582
|
setup(l, { expose: t, emit: e }) {
|
|
584
|
-
const a = l,
|
|
585
|
-
function
|
|
586
|
-
const { date:
|
|
587
|
-
if (!
|
|
588
|
-
let
|
|
589
|
-
if (
|
|
590
|
-
const
|
|
591
|
-
if ("error" in
|
|
592
|
-
|
|
583
|
+
const a = l, r = ke(l, "modelValue"), i = e, { t: p } = re(), u = bt(), b = Ne(), _ = oe("input"), V = oe("popover"), $ = oe("calendar"), n = oe("sheet"), c = q(() => ({ min: a.min?.slice(0, 10), max: a.max?.slice(0, 10), disabled: a.disabledDates })), m = q(() => a.min && a.min.length === 10 ? `${a.min}T00:00` : a.min), h = q(() => a.max && a.max.length === 10 ? `${a.max}T23:59` : a.max), v = (o, f) => !Zt(f, { disabled: a.disabledDates }) && (!m.value || o >= m.value) && (!h.value || o <= h.value), y = Qt(() => c.value), S = la(() => a.minuteStep), L = q(() => Se(r.value));
|
|
584
|
+
function T(o) {
|
|
585
|
+
const { date: f, time: E } = ta(o), G = f === null ? L.value.day ?? Be() : y.parse(f);
|
|
586
|
+
if (!G) return { error: y.invalidMessage() };
|
|
587
|
+
let F = L.value.time ?? Oe(a.minuteStep);
|
|
588
|
+
if (E !== null) {
|
|
589
|
+
const I = S.parse(E);
|
|
590
|
+
if ("error" in I) return I;
|
|
591
|
+
F = I.value;
|
|
593
592
|
}
|
|
594
|
-
const
|
|
595
|
-
return
|
|
593
|
+
const K = Ce(G, F);
|
|
594
|
+
return v(K, G) ? { value: K } : { error: y.unavailableMessage() };
|
|
596
595
|
}
|
|
597
|
-
const
|
|
598
|
-
get: () =>
|
|
599
|
-
set: (
|
|
600
|
-
|
|
596
|
+
const C = Ze({ model: r, display: (o) => `${u.date(Se(o).day)} ${Se(o).time ?? ""}`.trim(), parse: T }), P = q({
|
|
597
|
+
get: () => L.value.time,
|
|
598
|
+
set: (o) => {
|
|
599
|
+
o && Kt(o) && (r.value = Ce(L.value.day ?? Be(), o));
|
|
601
600
|
}
|
|
602
|
-
}),
|
|
603
|
-
const
|
|
604
|
-
return
|
|
605
|
-
}),
|
|
606
|
-
function
|
|
607
|
-
|
|
601
|
+
}), Y = Ze({ model: P, display: (o) => o, parse: S.parse }), M = ea(() => a.quickPicks ?? (b.value ? void 0 : []), () => b.value, () => c.value), O = q(() => a.error || C.message.value || Y.message.value), X = q(() => r.value ? u.dateTime(r.value) : null), D = Ae("date", () => O.value ? "error" : a.disabled ? "locked" : "rest"), Q = q(() => {
|
|
602
|
+
const o = C.typed.value;
|
|
603
|
+
return o ? Se(o).day ?? null : null;
|
|
604
|
+
}), te = q(() => Q.value ?? (Gt(L.value.day) ? L.value.day : null)), ne = q(() => C.typed.value ? Se(C.typed.value).time : L.value.time);
|
|
605
|
+
function le(o) {
|
|
606
|
+
o && C.set(Ce(o, L.value.time ?? Oe(a.minuteStep)));
|
|
608
607
|
}
|
|
609
|
-
function
|
|
610
|
-
|
|
608
|
+
function de(o) {
|
|
609
|
+
o && C.set(Ce(L.value.day ?? Be(), o));
|
|
611
610
|
}
|
|
612
|
-
function
|
|
613
|
-
|
|
611
|
+
function _e(o) {
|
|
612
|
+
C.set(Ce(Be(), Oe(a.minuteStep))), o();
|
|
614
613
|
}
|
|
615
|
-
const
|
|
616
|
-
async function
|
|
617
|
-
a.disabled || (
|
|
614
|
+
const ge = Ie();
|
|
615
|
+
async function w(o) {
|
|
616
|
+
a.disabled || (V.value?.present(), o && (await we(), await we(), $.value?.focus()));
|
|
618
617
|
}
|
|
619
|
-
function
|
|
620
|
-
|
|
618
|
+
function A(o) {
|
|
619
|
+
o.key === "Enter" ? (C.commit(), V.value?.dismiss()) : o.key === "ArrowDown" && (o.preventDefault(), w(!0));
|
|
621
620
|
}
|
|
622
|
-
return t({ focus: () =>
|
|
623
|
-
value:
|
|
621
|
+
return t({ focus: () => _.value?.focus() }), (o, f) => (d(), z(ye, N({ ...s(fe)(a), error: O.value }, {
|
|
622
|
+
value: X.value,
|
|
624
623
|
"value-style": "numeric"
|
|
625
|
-
}),
|
|
626
|
-
default:
|
|
627
|
-
s(
|
|
628
|
-
|
|
624
|
+
}), ie({
|
|
625
|
+
default: k(({ id: E, describedby: G, invalid: F }) => [
|
|
626
|
+
s(b) ? (d(), g(ee, { key: 0 }, [
|
|
627
|
+
U(vt, N({ id: E, "aria-describedby": G }, {
|
|
629
628
|
disabled: a.disabled,
|
|
630
|
-
invalid:
|
|
631
|
-
placeholder: s(
|
|
632
|
-
onClick:
|
|
629
|
+
invalid: F,
|
|
630
|
+
placeholder: s(p)("core.form.select.choose"),
|
|
631
|
+
onClick: f[0] || (f[0] = (K) => n.value?.present())
|
|
633
632
|
}), {
|
|
634
|
-
default:
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
])) :
|
|
633
|
+
default: k(() => [
|
|
634
|
+
r.value ? (d(), g("span", Oa, [
|
|
635
|
+
x("span", Ma, B(s(u).date(L.value.day)), 1),
|
|
636
|
+
f[8] || (f[8] = Z(B(" "), -1)),
|
|
637
|
+
x("span", Ra, B(L.value.time), 1)
|
|
638
|
+
])) : j("", !0)
|
|
640
639
|
]),
|
|
641
640
|
_: 1
|
|
642
641
|
}, 16, ["disabled", "invalid", "placeholder"]),
|
|
643
|
-
|
|
642
|
+
U(Ht, {
|
|
644
643
|
ref_key: "sheet",
|
|
645
|
-
ref:
|
|
646
|
-
title: a.label ?? s(
|
|
644
|
+
ref: n,
|
|
645
|
+
title: a.label ?? s(p)("core.form.date.calendar"),
|
|
647
646
|
mode: "datetime",
|
|
648
|
-
"model-value":
|
|
649
|
-
min:
|
|
650
|
-
max:
|
|
647
|
+
"model-value": r.value,
|
|
648
|
+
min: c.value.min,
|
|
649
|
+
max: c.value.max,
|
|
651
650
|
"disabled-dates": a.disabledDates,
|
|
652
651
|
"open-on": a.openOn,
|
|
653
|
-
shortcuts: s(
|
|
652
|
+
shortcuts: s(M),
|
|
654
653
|
step: a.minuteStep,
|
|
655
654
|
clearable: !a.required,
|
|
656
|
-
"onUpdate:modelValue": s(
|
|
655
|
+
"onUpdate:modelValue": s(C).set
|
|
657
656
|
}, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "step", "clearable", "onUpdate:modelValue"])
|
|
658
|
-
], 64)) : (d(),
|
|
657
|
+
], 64)) : (d(), z(Pe, {
|
|
659
658
|
key: 1,
|
|
660
659
|
ref_key: "popover",
|
|
661
|
-
ref:
|
|
662
|
-
label: a.label ?? s(
|
|
660
|
+
ref: V,
|
|
661
|
+
label: a.label ?? s(p)("core.form.date.calendar"),
|
|
663
662
|
width: "auto",
|
|
664
663
|
placement: "bottom-start",
|
|
665
664
|
arrow: !1,
|
|
666
665
|
autofocus: !1
|
|
667
666
|
}, {
|
|
668
|
-
trigger:
|
|
669
|
-
|
|
670
|
-
class:
|
|
667
|
+
trigger: k(({ attrs: K, presented: I }) => [
|
|
668
|
+
x("div", {
|
|
669
|
+
class: W(["inline-flex max-w-full items-center gap-2", s(D)])
|
|
671
670
|
}, [
|
|
672
|
-
|
|
673
|
-
id:
|
|
671
|
+
x("input", N({
|
|
672
|
+
id: E,
|
|
674
673
|
ref_key: "input",
|
|
675
|
-
ref:
|
|
676
|
-
},
|
|
674
|
+
ref: _
|
|
675
|
+
}, K, {
|
|
677
676
|
type: "text",
|
|
678
677
|
role: "combobox",
|
|
679
678
|
autocomplete: "off",
|
|
680
679
|
size: "20",
|
|
681
680
|
name: a.name,
|
|
682
|
-
value: s(
|
|
683
|
-
placeholder: s(
|
|
681
|
+
value: s(C).text.value,
|
|
682
|
+
placeholder: s(y).placeholder.value,
|
|
684
683
|
disabled: a.disabled,
|
|
685
684
|
required: a.required,
|
|
686
685
|
"aria-required": a.required || void 0,
|
|
687
|
-
"aria-invalid":
|
|
688
|
-
"aria-describedby":
|
|
686
|
+
"aria-invalid": F || void 0,
|
|
687
|
+
"aria-describedby": G,
|
|
689
688
|
class: "block min-h-7 min-w-0 border-0 bg-transparent py-1 pl-2.5 text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
|
|
690
|
-
onInput:
|
|
691
|
-
onFocus:
|
|
692
|
-
onBlur:
|
|
693
|
-
s(
|
|
689
|
+
onInput: f[1] || (f[1] = (se) => s(C).input(se.target.value)),
|
|
690
|
+
onFocus: f[2] || (f[2] = (se) => i("focus", se)),
|
|
691
|
+
onBlur: f[3] || (f[3] = (se) => {
|
|
692
|
+
s(C).commit(), i("blur", se);
|
|
694
693
|
}),
|
|
695
|
-
onKeydown:
|
|
696
|
-
onClick:
|
|
697
|
-
}), null, 16,
|
|
698
|
-
a.disabled ?
|
|
694
|
+
onKeydown: A,
|
|
695
|
+
onClick: f[4] || (f[4] = (se) => w(!1))
|
|
696
|
+
}), null, 16, Ua),
|
|
697
|
+
a.disabled ? j("", !0) : (d(), g("button", {
|
|
699
698
|
key: 0,
|
|
700
699
|
type: "button",
|
|
701
700
|
tabindex: "-1",
|
|
702
|
-
"aria-label": s(
|
|
701
|
+
"aria-label": s(p)("core.form.date.open"),
|
|
703
702
|
class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
|
|
704
|
-
onClick: (
|
|
703
|
+
onClick: (se) => I ? V.value?.dismiss() : w(!0)
|
|
705
704
|
}, [
|
|
706
|
-
|
|
705
|
+
U(s(ue), {
|
|
707
706
|
name: "calendarLine",
|
|
708
707
|
size: 18
|
|
709
708
|
})
|
|
710
|
-
], 8,
|
|
709
|
+
], 8, Ea))
|
|
711
710
|
], 2)
|
|
712
711
|
]),
|
|
713
|
-
default:
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
712
|
+
default: k(({ dismiss: K }) => [
|
|
713
|
+
x("div", Ia, [
|
|
714
|
+
x("div", Aa, [
|
|
715
|
+
U(Wt, {
|
|
717
716
|
ref_key: "calendar",
|
|
718
717
|
ref: $,
|
|
719
|
-
"model-value":
|
|
720
|
-
min:
|
|
721
|
-
max:
|
|
718
|
+
"model-value": te.value,
|
|
719
|
+
min: c.value.min,
|
|
720
|
+
max: c.value.max,
|
|
722
721
|
"disabled-dates": a.disabledDates,
|
|
723
722
|
"open-on": a.openOn,
|
|
724
|
-
"onUpdate:modelValue":
|
|
723
|
+
"onUpdate:modelValue": le
|
|
725
724
|
}, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on"]),
|
|
726
|
-
s(
|
|
727
|
-
|
|
728
|
-
items: s(
|
|
729
|
-
selected:
|
|
730
|
-
onPick:
|
|
725
|
+
s(M).length > 0 ? (d(), g("div", Na, [
|
|
726
|
+
U(Yt, {
|
|
727
|
+
items: s(M),
|
|
728
|
+
selected: te.value,
|
|
729
|
+
onPick: le
|
|
731
730
|
}, null, 8, ["items", "selected"])
|
|
732
|
-
])) :
|
|
731
|
+
])) : j("", !0)
|
|
733
732
|
]),
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
for: s(
|
|
733
|
+
x("div", Pa, [
|
|
734
|
+
x("label", {
|
|
735
|
+
for: s(ge),
|
|
737
736
|
class: "text-footnote font-semibold text-content-muted"
|
|
738
|
-
},
|
|
739
|
-
|
|
740
|
-
id: s(
|
|
737
|
+
}, B(s(p)("core.form.time.label")), 9, Ka),
|
|
738
|
+
x("input", {
|
|
739
|
+
id: s(ge),
|
|
741
740
|
type: "text",
|
|
742
741
|
autocomplete: "off",
|
|
743
742
|
inputmode: "numeric",
|
|
744
|
-
value: s(
|
|
745
|
-
placeholder: s(
|
|
746
|
-
"aria-invalid": s(
|
|
743
|
+
value: s(Y).text.value,
|
|
744
|
+
placeholder: s(S).placeholder.value,
|
|
745
|
+
"aria-invalid": s(Y).message.value ? !0 : void 0,
|
|
747
746
|
class: "rounded-control bg-fill p-1.5 text-center text-[20px] font-semibold tabular-nums text-content-strong placeholder:text-base placeholder:font-normal placeholder:text-content-disabled focus:outline-2 focus:outline-border-focus",
|
|
748
|
-
onInput:
|
|
749
|
-
onBlur:
|
|
750
|
-
onKeydown:
|
|
751
|
-
}, null, 40,
|
|
752
|
-
|
|
753
|
-
"model-value":
|
|
747
|
+
onInput: f[5] || (f[5] = (I) => s(Y).input(I.target.value)),
|
|
748
|
+
onBlur: f[6] || (f[6] = (I) => s(Y).commit()),
|
|
749
|
+
onKeydown: f[7] || (f[7] = Fe(he((I) => s(Y).commit(), ["prevent"]), ["enter"]))
|
|
750
|
+
}, null, 40, Ga),
|
|
751
|
+
U(Jt, {
|
|
752
|
+
"model-value": ne.value,
|
|
754
753
|
step: a.minuteStep,
|
|
755
|
-
"onUpdate:modelValue":
|
|
754
|
+
"onUpdate:modelValue": de
|
|
756
755
|
}, null, 8, ["model-value", "step"]),
|
|
757
|
-
|
|
756
|
+
x("button", {
|
|
758
757
|
type: "button",
|
|
759
758
|
class: "cursor-pointer self-start rounded-full bg-tint-soft px-2.5 py-1.5 text-footnote font-medium text-content-link focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
760
|
-
onClick: (
|
|
761
|
-
},
|
|
759
|
+
onClick: (I) => _e(K)
|
|
760
|
+
}, B(s(p)("core.form.time.now")), 9, Ha)
|
|
762
761
|
])
|
|
763
762
|
])
|
|
764
763
|
]),
|
|
@@ -767,51 +766,51 @@ const pa = {
|
|
|
767
766
|
]),
|
|
768
767
|
_: 2
|
|
769
768
|
}, [
|
|
770
|
-
|
|
769
|
+
o.$slots.trailing ? {
|
|
771
770
|
name: "trailing",
|
|
772
|
-
fn:
|
|
773
|
-
|
|
771
|
+
fn: k(() => [
|
|
772
|
+
R(o.$slots, "trailing")
|
|
774
773
|
]),
|
|
775
774
|
key: "0"
|
|
776
775
|
} : void 0,
|
|
777
|
-
|
|
776
|
+
o.$slots.labelTrailing ? {
|
|
778
777
|
name: "labelTrailing",
|
|
779
|
-
fn:
|
|
780
|
-
|
|
778
|
+
fn: k(() => [
|
|
779
|
+
R(o.$slots, "labelTrailing")
|
|
781
780
|
]),
|
|
782
781
|
key: "1"
|
|
783
782
|
} : void 0,
|
|
784
|
-
|
|
783
|
+
o.$slots.readonly ? {
|
|
785
784
|
name: "readonly",
|
|
786
|
-
fn:
|
|
787
|
-
|
|
785
|
+
fn: k(() => [
|
|
786
|
+
R(o.$slots, "readonly")
|
|
788
787
|
]),
|
|
789
788
|
key: "2"
|
|
790
789
|
} : void 0
|
|
791
790
|
]), 1040, ["value"]));
|
|
792
791
|
}
|
|
793
792
|
});
|
|
794
|
-
function
|
|
793
|
+
function $t(l, t = {}) {
|
|
795
794
|
const e = t.accept ?? [];
|
|
796
795
|
if (e.length > 0) {
|
|
797
|
-
const a = l.name.lastIndexOf("."),
|
|
798
|
-
if (!e.some((
|
|
799
|
-
const
|
|
800
|
-
return
|
|
796
|
+
const a = l.name.lastIndexOf("."), r = a === -1 ? "" : l.name.slice(a).toLowerCase(), i = l.type.toLowerCase();
|
|
797
|
+
if (!e.some((u) => {
|
|
798
|
+
const b = u.trim().toLowerCase();
|
|
799
|
+
return b.startsWith(".") ? b === r : b.endsWith("/*") ? i.startsWith(b.slice(0, -1)) : b === i;
|
|
801
800
|
})) return "invalid_type";
|
|
802
801
|
}
|
|
803
802
|
return (t.maxSize ?? 0) > 0 && l.size > (t.maxSize ?? 0) ? "too_large" : null;
|
|
804
803
|
}
|
|
805
|
-
function
|
|
804
|
+
function Le(l) {
|
|
806
805
|
return l < 1024 ? `${l} B` : l < 1024 * 1024 ? `${Math.round(l / 1024)} KB` : `${(l / (1024 * 1024)).toFixed(l % (1024 * 1024) === 0 ? 0 : 1)} MB`;
|
|
807
806
|
}
|
|
808
|
-
const
|
|
807
|
+
const Ya = { class: "w-full" }, Ja = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], Za = {
|
|
809
808
|
key: 0,
|
|
810
809
|
class: "flex items-center gap-3 rounded-group bg-fill p-3",
|
|
811
810
|
"data-test": "file-selected"
|
|
812
|
-
},
|
|
811
|
+
}, Xa = { class: "min-w-0 flex-1" }, Qa = { class: "truncate text-body font-medium text-content-strong" }, el = { class: "text-footnote text-content-muted" }, tl = ["disabled", "aria-label", "title"], al = ["aria-disabled"], ll = { class: "font-semibold text-content-link" }, ol = { class: "text-content-muted" }, Sr = /* @__PURE__ */ J({
|
|
813
812
|
__name: "FileField",
|
|
814
|
-
props: /* @__PURE__ */
|
|
813
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
815
814
|
label: {},
|
|
816
815
|
labelHidden: { type: Boolean },
|
|
817
816
|
hint: {},
|
|
@@ -825,91 +824,91 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
825
824
|
variant: {},
|
|
826
825
|
accept: {},
|
|
827
826
|
maxSize: {}
|
|
828
|
-
}, { ...
|
|
827
|
+
}, { ...pe, variant: "button", accept: () => [], maxSize: 0 }), {
|
|
829
828
|
modelValue: { default: null },
|
|
830
829
|
modelModifiers: {}
|
|
831
830
|
}),
|
|
832
831
|
emits: ["update:modelValue"],
|
|
833
832
|
setup(l, { expose: t }) {
|
|
834
|
-
const e = l, a =
|
|
833
|
+
const e = l, a = ke(l, "modelValue"), { t: r } = re(), i = oe("chooser"), p = H(!1), u = H(null), b = q(() => {
|
|
835
834
|
if (e.hint) return e.hint;
|
|
836
835
|
const $ = [];
|
|
837
|
-
return e.accept.length && $.push(
|
|
836
|
+
return e.accept.length && $.push(r("core.form.file.allowed", { formats: e.accept.map((n) => n.replace(/^\./, "").toUpperCase()).join(", ") })), e.maxSize > 0 && $.push(r("core.form.file.max_size", { size: Le(e.maxSize) })), $.join(" · ") || void 0;
|
|
838
837
|
});
|
|
839
|
-
function
|
|
838
|
+
function _($) {
|
|
840
839
|
if (!$) return;
|
|
841
|
-
const
|
|
842
|
-
|
|
840
|
+
const n = $t($, { accept: e.accept, maxSize: e.maxSize });
|
|
841
|
+
n ? (u.value = n === "invalid_type" ? r("core.form.file.invalid_type") : r("core.form.file.too_large", { size: Le(e.maxSize) }), a.value = null) : (u.value = null, a.value = $);
|
|
843
842
|
}
|
|
844
|
-
function
|
|
845
|
-
a.value = null,
|
|
843
|
+
function V() {
|
|
844
|
+
a.value = null, u.value = null;
|
|
846
845
|
}
|
|
847
|
-
return
|
|
848
|
-
!$ &&
|
|
849
|
-
}), t({ clear:
|
|
846
|
+
return be(a, ($) => {
|
|
847
|
+
!$ && i.value && (i.value.value = "");
|
|
848
|
+
}), t({ clear: V }), ($, n) => (d(), z(ye, N({ ...s(fe)(e), hint: b.value, error: u.value ?? e.error }, {
|
|
850
849
|
value: a.value?.name ?? null,
|
|
851
850
|
"row-layout": "stacked"
|
|
852
|
-
}),
|
|
853
|
-
default:
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
id:
|
|
851
|
+
}), ie({
|
|
852
|
+
default: k(({ id: c, describedby: m, invalid: h }) => [
|
|
853
|
+
x("div", Ya, [
|
|
854
|
+
x("input", {
|
|
855
|
+
id: c,
|
|
857
856
|
ref_key: "chooser",
|
|
858
|
-
ref:
|
|
857
|
+
ref: i,
|
|
859
858
|
type: "file",
|
|
860
859
|
class: "sr-only",
|
|
861
860
|
tabindex: "-1",
|
|
862
861
|
accept: e.accept.join(",") || void 0,
|
|
863
862
|
disabled: e.disabled,
|
|
864
|
-
"aria-describedby":
|
|
865
|
-
"aria-invalid":
|
|
866
|
-
onChange:
|
|
867
|
-
}, null, 40,
|
|
868
|
-
a.value ? (d(),
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
863
|
+
"aria-describedby": m,
|
|
864
|
+
"aria-invalid": h || void 0,
|
|
865
|
+
onChange: n[0] || (n[0] = (v) => _(v.target.files?.[0]))
|
|
866
|
+
}, null, 40, Ja),
|
|
867
|
+
a.value ? (d(), g("div", Za, [
|
|
868
|
+
x("div", Xa, [
|
|
869
|
+
x("p", Qa, B(a.value.name), 1),
|
|
870
|
+
x("p", el, B(s(Le)(a.value.size)), 1)
|
|
872
871
|
]),
|
|
873
|
-
|
|
872
|
+
x("button", {
|
|
874
873
|
type: "button",
|
|
875
874
|
disabled: e.disabled,
|
|
876
|
-
"aria-label": s(
|
|
877
|
-
title: s(
|
|
875
|
+
"aria-label": s(r)("core.form.file.remove"),
|
|
876
|
+
title: s(r)("core.form.file.remove"),
|
|
878
877
|
class: "flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-not-allowed",
|
|
879
|
-
onClick:
|
|
878
|
+
onClick: V
|
|
880
879
|
}, [
|
|
881
|
-
|
|
880
|
+
U(s(ue), {
|
|
882
881
|
name: "close",
|
|
883
882
|
size: 14
|
|
884
883
|
})
|
|
885
|
-
], 8,
|
|
886
|
-
])) : e.variant === "dropzone" ? (d(),
|
|
884
|
+
], 8, tl)
|
|
885
|
+
])) : e.variant === "dropzone" ? (d(), g("div", {
|
|
887
886
|
key: 1,
|
|
888
887
|
role: "button",
|
|
889
888
|
tabindex: "0",
|
|
890
889
|
"data-test": "file-dropzone",
|
|
891
890
|
"aria-disabled": e.disabled || void 0,
|
|
892
|
-
class:
|
|
893
|
-
onClick:
|
|
891
|
+
class: W(["cursor-pointer rounded-group border-2 border-dashed p-6 text-center text-body transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", p.value ? "border-border-focus bg-tint-soft" : "border-border-control hover:bg-fill"]),
|
|
892
|
+
onClick: n[1] || (n[1] = (v) => !e.disabled && i.value?.click()),
|
|
894
893
|
onKeydown: [
|
|
895
|
-
|
|
896
|
-
|
|
894
|
+
n[2] || (n[2] = Fe(he((v) => !e.disabled && i.value?.click(), ["prevent"]), ["enter"])),
|
|
895
|
+
n[3] || (n[3] = Fe(he((v) => !e.disabled && i.value?.click(), ["prevent"]), ["space"]))
|
|
897
896
|
],
|
|
898
|
-
onDragover:
|
|
899
|
-
onDragleave:
|
|
900
|
-
onDrop:
|
|
901
|
-
|
|
897
|
+
onDragover: n[4] || (n[4] = he((v) => p.value = !0, ["prevent"])),
|
|
898
|
+
onDragleave: n[5] || (n[5] = he((v) => p.value = !1, ["prevent"])),
|
|
899
|
+
onDrop: n[6] || (n[6] = he((v) => {
|
|
900
|
+
p.value = !1, e.disabled || _(v.dataTransfer?.files?.[0]);
|
|
902
901
|
}, ["prevent"]))
|
|
903
902
|
}, [
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
], 42,
|
|
903
|
+
x("span", ll, B(s(r)("core.form.file.choose")), 1),
|
|
904
|
+
x("span", ol, B(" " + s(r)("core.form.file.drop")), 1)
|
|
905
|
+
], 42, al)) : (d(), z(ae, {
|
|
907
906
|
key: 2,
|
|
908
907
|
disabled: e.disabled,
|
|
909
|
-
onClick:
|
|
908
|
+
onClick: n[7] || (n[7] = (v) => i.value?.click())
|
|
910
909
|
}, {
|
|
911
|
-
default:
|
|
912
|
-
|
|
910
|
+
default: k(() => [
|
|
911
|
+
Z(B(s(r)("core.form.file.choose")), 1)
|
|
913
912
|
]),
|
|
914
913
|
_: 1
|
|
915
914
|
}, 8, ["disabled"]))
|
|
@@ -919,28 +918,28 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
919
918
|
}, [
|
|
920
919
|
$.$slots.trailing ? {
|
|
921
920
|
name: "trailing",
|
|
922
|
-
fn:
|
|
923
|
-
|
|
921
|
+
fn: k(() => [
|
|
922
|
+
R($.$slots, "trailing")
|
|
924
923
|
]),
|
|
925
924
|
key: "0"
|
|
926
925
|
} : void 0,
|
|
927
926
|
$.$slots.labelTrailing ? {
|
|
928
927
|
name: "labelTrailing",
|
|
929
|
-
fn:
|
|
930
|
-
|
|
928
|
+
fn: k(() => [
|
|
929
|
+
R($.$slots, "labelTrailing")
|
|
931
930
|
]),
|
|
932
931
|
key: "1"
|
|
933
932
|
} : void 0,
|
|
934
933
|
$.$slots.readonly ? {
|
|
935
934
|
name: "readonly",
|
|
936
|
-
fn:
|
|
937
|
-
|
|
935
|
+
fn: k(() => [
|
|
936
|
+
R($.$slots, "readonly")
|
|
938
937
|
]),
|
|
939
938
|
key: "2"
|
|
940
939
|
} : void 0
|
|
941
940
|
]), 1040, ["value"]));
|
|
942
941
|
}
|
|
943
|
-
}),
|
|
942
|
+
}), rl = ["disabled"], Fr = /* @__PURE__ */ J({
|
|
944
943
|
__name: "FormGroupButton",
|
|
945
944
|
props: {
|
|
946
945
|
label: {},
|
|
@@ -950,16 +949,16 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
950
949
|
emits: ["click"],
|
|
951
950
|
setup(l, { emit: t }) {
|
|
952
951
|
const e = l, a = t;
|
|
953
|
-
return (
|
|
954
|
-
default:
|
|
955
|
-
|
|
956
|
-
default:
|
|
957
|
-
|
|
952
|
+
return (r, i) => (d(), z(St, null, {
|
|
953
|
+
default: k(() => [
|
|
954
|
+
U(Ot, { layout: "stacked" }, {
|
|
955
|
+
default: k(() => [
|
|
956
|
+
x("button", {
|
|
958
957
|
type: "button",
|
|
959
958
|
disabled: e.disabled,
|
|
960
|
-
class:
|
|
961
|
-
onClick:
|
|
962
|
-
},
|
|
959
|
+
class: W(["w-full py-1 text-center text-body focus-visible:outline-2 focus-visible:outline-border-focus disabled:text-content-disabled", e.tone === "critical" ? "text-content-destructive" : "text-content-link"]),
|
|
960
|
+
onClick: i[0] || (i[0] = (p) => a("click"))
|
|
961
|
+
}, B(e.label), 11, rl)
|
|
963
962
|
]),
|
|
964
963
|
_: 1
|
|
965
964
|
})
|
|
@@ -967,31 +966,31 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
967
966
|
_: 1
|
|
968
967
|
}));
|
|
969
968
|
}
|
|
970
|
-
}),
|
|
969
|
+
}), qr = /* @__PURE__ */ J({
|
|
971
970
|
__name: "FormIndent",
|
|
972
971
|
setup(l) {
|
|
973
|
-
return
|
|
972
|
+
return ut(Mt, Rt() + 1), (t, e) => R(t.$slots, "default");
|
|
974
973
|
}
|
|
975
974
|
});
|
|
976
|
-
function
|
|
975
|
+
function nl(l, t) {
|
|
977
976
|
return t.filter((e) => (l?.[e] ?? "").trim() === "");
|
|
978
977
|
}
|
|
979
|
-
const
|
|
978
|
+
const sl = ["id", "aria-labelledby"], il = ["id", "value", "lang", "name", "rows", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], ul = ["id", "value", "lang", "name", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], dl = {
|
|
980
979
|
key: 0,
|
|
981
980
|
class: "mt-1.5 flex items-center gap-2"
|
|
982
|
-
},
|
|
981
|
+
}, cl = {
|
|
983
982
|
key: 0,
|
|
984
983
|
class: "flex-1 text-footnote text-status-warning-content",
|
|
985
984
|
"data-test": "i18n-missing"
|
|
986
|
-
},
|
|
985
|
+
}, ml = {
|
|
987
986
|
key: 1,
|
|
988
987
|
class: "flex-1"
|
|
989
|
-
},
|
|
988
|
+
}, fl = ["aria-label"], pl = ["id", "aria-selected", "tabindex", "aria-controls", "aria-label", "title", "onClick", "onKeydown"], vl = ["data-state"], bl = { class: "w-full" }, yl = { class: "whitespace-pre-line break-words text-body text-content-strong" }, gl = ["aria-expanded"], hl = { class: "flex-1" }, kl = {
|
|
990
989
|
key: 0,
|
|
991
990
|
class: "mt-1 flex flex-col gap-1.5"
|
|
992
|
-
},
|
|
991
|
+
}, _l = ["title"], xl = /* @__PURE__ */ J({
|
|
993
992
|
__name: "I18nField",
|
|
994
|
-
props: /* @__PURE__ */
|
|
993
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
995
994
|
label: {},
|
|
996
995
|
labelHidden: { type: Boolean },
|
|
997
996
|
hint: {},
|
|
@@ -1009,213 +1008,213 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1009
1008
|
rows: {},
|
|
1010
1009
|
placeholder: {},
|
|
1011
1010
|
maxLength: {}
|
|
1012
|
-
}, { ...
|
|
1011
|
+
}, { ...pe, locales: void 0, defaultLocale: void 0, requiredLocales: () => [], multiline: !1, rows: 3, placeholder: void 0, maxLength: void 0 }), {
|
|
1013
1012
|
modelValue: { default: () => ({}) },
|
|
1014
1013
|
modelModifiers: {}
|
|
1015
1014
|
}),
|
|
1016
1015
|
emits: ["update:modelValue"],
|
|
1017
1016
|
setup(l, { expose: t }) {
|
|
1018
|
-
const e = l, a =
|
|
1019
|
-
function
|
|
1017
|
+
const e = l, a = ke(l, "modelValue"), { t: r, locale: i, availableLocales: p } = re(), u = bt(), b = De(yt, null), _ = Ie(), V = oe("field"), $ = oe("root"), { editable: n } = qe(e), c = Ae(e.multiline ? "area" : "text", () => e.error || le.value ? "error" : e.disabled ? "locked" : "rest"), m = q(() => e.locales ?? b?.locales ?? p), h = q(() => e.defaultLocale ?? m.value[0] ?? ""), v = q(() => m.value.includes(h.value) ? [h.value, ...m.value.filter((F) => F !== h.value)] : m.value), y = H(null), S = q(() => y.value !== null && v.value.includes(y.value) ? y.value : v.value.includes(i.value) ? i.value : h.value), L = (F) => a.value[F] ?? "", T = (F) => L(F).trim() !== "", C = (F) => F.toUpperCase();
|
|
1018
|
+
function P(F) {
|
|
1020
1019
|
try {
|
|
1021
|
-
return new Intl.DisplayNames([
|
|
1020
|
+
return new Intl.DisplayNames([u.intlLocale], { type: "language" }).of(F) ?? C(F);
|
|
1022
1021
|
} catch {
|
|
1023
|
-
return
|
|
1022
|
+
return C(F);
|
|
1024
1023
|
}
|
|
1025
1024
|
}
|
|
1026
|
-
const
|
|
1027
|
-
function
|
|
1028
|
-
a.value = { ...a.value, [
|
|
1025
|
+
const Y = (F) => F.map(P).join(", ");
|
|
1026
|
+
function M(F, K) {
|
|
1027
|
+
a.value = { ...a.value, [F]: K };
|
|
1029
1028
|
}
|
|
1030
|
-
const
|
|
1031
|
-
function
|
|
1032
|
-
|
|
1029
|
+
const O = (F) => `${_}-tab-${F}`;
|
|
1030
|
+
function X(F, K) {
|
|
1031
|
+
y.value = F, K && we(() => V.value?.focus());
|
|
1033
1032
|
}
|
|
1034
|
-
function
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1033
|
+
function D(F, K) {
|
|
1034
|
+
const I = v.value.length - 1, se = { ArrowRight: K + 1, ArrowLeft: K - 1, Home: 0, End: I }[F.key];
|
|
1035
|
+
if (se === void 0) return;
|
|
1036
|
+
F.preventDefault();
|
|
1037
|
+
const xe = v.value[(se + v.value.length) % v.value.length];
|
|
1038
|
+
xe !== void 0 && (X(xe, !1), we(() => document.getElementById(O(xe))?.focus()));
|
|
1040
1039
|
}
|
|
1041
|
-
const
|
|
1042
|
-
function
|
|
1043
|
-
$.value?.contains(
|
|
1040
|
+
const Q = H(!1);
|
|
1041
|
+
function te(F) {
|
|
1042
|
+
$.value?.contains(F.relatedTarget) || (Q.value = !0);
|
|
1044
1043
|
}
|
|
1045
|
-
const
|
|
1046
|
-
function
|
|
1047
|
-
const
|
|
1048
|
-
a.value = { ...a.value, ...Object.fromEntries(
|
|
1044
|
+
const ne = q(() => nl(a.value, e.requiredLocales)), le = q(() => Q.value && ne.value.length > 0 ? r("core.form.i18n.required", { languages: Y(ne.value) }) : void 0), de = q(() => e.requiredLocales.length > 0 ? ne.value.length === 0 : v.value.some(T)), _e = q(() => v.value.filter((F) => !T(F) && !(le.value && ne.value.includes(F)))), ge = q(() => T(h.value) && v.value.some((F) => F !== h.value && !T(F)));
|
|
1045
|
+
function w() {
|
|
1046
|
+
const F = L(h.value);
|
|
1047
|
+
a.value = { ...a.value, ...Object.fromEntries(v.value.filter((K) => !T(K)).map((K) => [K, F])) };
|
|
1049
1048
|
}
|
|
1050
|
-
const
|
|
1051
|
-
return t({ focus: () =>
|
|
1052
|
-
value: s(
|
|
1049
|
+
const A = q(() => [i.value, h.value, ...v.value].find((F) => v.value.includes(F) && T(F))), o = q(() => v.value.filter((F) => F !== A.value)), f = q(() => o.value.filter(T).length), E = H(!1), G = q(() => e.label && !n.value && A.value ? `${e.label} · ${C(A.value)}` : e.label);
|
|
1050
|
+
return t({ focus: () => V.value?.focus() }), (F, K) => (d(), z(ye, N({ ...s(fe)(e), label: G.value, error: e.error ?? le.value, required: e.required || e.requiredLocales.length > 0 }, {
|
|
1051
|
+
value: s(n) ? de.value ? "written" : null : A.value ? L(A.value) : null,
|
|
1053
1052
|
"row-layout": "stacked"
|
|
1054
|
-
}),
|
|
1055
|
-
default:
|
|
1056
|
-
|
|
1053
|
+
}), ie({
|
|
1054
|
+
default: k(({ id: I, describedby: se, invalid: xe }) => [
|
|
1055
|
+
x("div", {
|
|
1057
1056
|
ref_key: "root",
|
|
1058
1057
|
ref: $,
|
|
1059
1058
|
class: "w-full",
|
|
1060
|
-
onFocusout:
|
|
1059
|
+
onFocusout: te
|
|
1061
1060
|
}, [
|
|
1062
|
-
|
|
1063
|
-
id: `${s(
|
|
1061
|
+
x("div", {
|
|
1062
|
+
id: `${s(_)}-panel`,
|
|
1064
1063
|
role: "tabpanel",
|
|
1065
|
-
"aria-labelledby":
|
|
1064
|
+
"aria-labelledby": O(S.value)
|
|
1066
1065
|
}, [
|
|
1067
|
-
|
|
1068
|
-
class:
|
|
1066
|
+
x("div", {
|
|
1067
|
+
class: W(["w-full", s(c)])
|
|
1069
1068
|
}, [
|
|
1070
|
-
e.multiline ? (d(),
|
|
1069
|
+
e.multiline ? (d(), g("textarea", {
|
|
1071
1070
|
key: 0,
|
|
1072
|
-
id:
|
|
1071
|
+
id: I,
|
|
1073
1072
|
ref_key: "field",
|
|
1074
|
-
ref:
|
|
1075
|
-
value:
|
|
1076
|
-
lang:
|
|
1073
|
+
ref: V,
|
|
1074
|
+
value: L(S.value),
|
|
1075
|
+
lang: S.value,
|
|
1077
1076
|
name: e.name,
|
|
1078
1077
|
rows: e.rows,
|
|
1079
1078
|
placeholder: e.placeholder,
|
|
1080
1079
|
maxlength: e.maxLength,
|
|
1081
1080
|
disabled: e.disabled,
|
|
1082
1081
|
"aria-required": e.required || void 0,
|
|
1083
|
-
"aria-invalid":
|
|
1084
|
-
"aria-describedby":
|
|
1082
|
+
"aria-invalid": xe || void 0,
|
|
1083
|
+
"aria-describedby": se,
|
|
1085
1084
|
"data-test": "i18n-input",
|
|
1086
1085
|
class: "block w-full resize-y border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
|
|
1087
|
-
onInput:
|
|
1088
|
-
}, null, 40,
|
|
1086
|
+
onInput: K[0] || (K[0] = (je) => M(S.value, je.target.value))
|
|
1087
|
+
}, null, 40, il)) : (d(), g("input", {
|
|
1089
1088
|
key: 1,
|
|
1090
|
-
id:
|
|
1089
|
+
id: I,
|
|
1091
1090
|
ref_key: "field",
|
|
1092
|
-
ref:
|
|
1093
|
-
value:
|
|
1094
|
-
lang:
|
|
1091
|
+
ref: V,
|
|
1092
|
+
value: L(S.value),
|
|
1093
|
+
lang: S.value,
|
|
1095
1094
|
type: "text",
|
|
1096
1095
|
name: e.name,
|
|
1097
1096
|
placeholder: e.placeholder,
|
|
1098
1097
|
maxlength: e.maxLength,
|
|
1099
1098
|
disabled: e.disabled,
|
|
1100
1099
|
"aria-required": e.required || void 0,
|
|
1101
|
-
"aria-invalid":
|
|
1102
|
-
"aria-describedby":
|
|
1100
|
+
"aria-invalid": xe || void 0,
|
|
1101
|
+
"aria-describedby": se,
|
|
1103
1102
|
"data-test": "i18n-input",
|
|
1104
1103
|
class: "block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
|
|
1105
|
-
onInput:
|
|
1106
|
-
}, null, 40,
|
|
1104
|
+
onInput: K[1] || (K[1] = (je) => M(S.value, je.target.value))
|
|
1105
|
+
}, null, 40, ul))
|
|
1107
1106
|
], 2)
|
|
1108
|
-
], 8,
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1107
|
+
], 8, sl),
|
|
1108
|
+
_e.value.length > 0 || ge.value ? (d(), g("div", dl, [
|
|
1109
|
+
_e.value.length > 0 ? (d(), g("p", cl, B(s(r)("core.form.i18n.missing", { languages: Y(_e.value) })), 1)) : (d(), g("span", ml)),
|
|
1110
|
+
ge.value && !e.disabled ? (d(), g("button", {
|
|
1112
1111
|
key: 2,
|
|
1113
1112
|
type: "button",
|
|
1114
1113
|
"data-test": "i18n-copy",
|
|
1115
1114
|
class: "shrink-0 cursor-pointer rounded-control bg-tint-soft px-2.5 py-1.5 text-footnote font-medium text-content-link transition-colors duration-motion-fast hover:bg-fill focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1116
|
-
onClick:
|
|
1117
|
-
},
|
|
1118
|
-
])) :
|
|
1115
|
+
onClick: w
|
|
1116
|
+
}, B(s(r)("core.form.i18n.copy", { language: C(h.value) })), 1)) : j("", !0)
|
|
1117
|
+
])) : j("", !0)
|
|
1119
1118
|
], 544)
|
|
1120
1119
|
]),
|
|
1121
|
-
labelTrailing:
|
|
1122
|
-
|
|
1120
|
+
labelTrailing: k(() => [
|
|
1121
|
+
x("div", {
|
|
1123
1122
|
role: "tablist",
|
|
1124
|
-
"aria-label": s(
|
|
1123
|
+
"aria-label": s(r)("core.form.i18n.languages"),
|
|
1125
1124
|
class: "flex shrink-0 gap-0.5 rounded-control bg-fill p-0.5",
|
|
1126
1125
|
"data-test": "i18n-tabs"
|
|
1127
1126
|
}, [
|
|
1128
|
-
(d(!0),
|
|
1129
|
-
id:
|
|
1130
|
-
key:
|
|
1127
|
+
(d(!0), g(ee, null, ce(v.value, (I, se) => (d(), g("button", {
|
|
1128
|
+
id: O(I),
|
|
1129
|
+
key: I,
|
|
1131
1130
|
type: "button",
|
|
1132
1131
|
role: "tab",
|
|
1133
|
-
"aria-selected":
|
|
1134
|
-
tabindex:
|
|
1135
|
-
"aria-controls": `${s(
|
|
1136
|
-
"aria-label": s(
|
|
1137
|
-
title:
|
|
1138
|
-
class:
|
|
1139
|
-
onClick: (
|
|
1140
|
-
onKeydown: (
|
|
1132
|
+
"aria-selected": I === S.value,
|
|
1133
|
+
tabindex: I === S.value ? 0 : -1,
|
|
1134
|
+
"aria-controls": `${s(_)}-panel`,
|
|
1135
|
+
"aria-label": s(r)(T(I) ? "core.form.i18n.tab_written" : "core.form.i18n.tab_empty", { language: P(I) }),
|
|
1136
|
+
title: P(I),
|
|
1137
|
+
class: W(["flex min-h-7 cursor-pointer items-center gap-1.5 rounded-control px-2.5 py-1 text-footnote font-semibold transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", I === S.value ? "bg-segment-selected text-content-strong shadow-sm" : "text-content-muted hover:text-content-strong"]),
|
|
1138
|
+
onClick: (xe) => X(I, !0),
|
|
1139
|
+
onKeydown: (xe) => D(xe, se)
|
|
1141
1140
|
}, [
|
|
1142
|
-
|
|
1143
|
-
|
|
1141
|
+
Z(B(C(I)) + " ", 1),
|
|
1142
|
+
x("span", {
|
|
1144
1143
|
"aria-hidden": "true",
|
|
1145
|
-
class:
|
|
1144
|
+
class: W(["size-1.5 rounded-full", T(I) ? "bg-status-success-solid" : le.value && ne.value.includes(I) ? "bg-content-destructive" : "bg-content-disabled"]),
|
|
1146
1145
|
"data-test": "i18n-dot",
|
|
1147
|
-
"data-state":
|
|
1148
|
-
}, null, 10,
|
|
1149
|
-
], 42,
|
|
1150
|
-
], 8,
|
|
1146
|
+
"data-state": T(I) ? "written" : le.value && ne.value.includes(I) ? "required" : "empty"
|
|
1147
|
+
}, null, 10, vl)
|
|
1148
|
+
], 42, pl))), 128))
|
|
1149
|
+
], 8, fl)
|
|
1151
1150
|
]),
|
|
1152
1151
|
_: 2
|
|
1153
1152
|
}, [
|
|
1154
|
-
|
|
1153
|
+
A.value ? {
|
|
1155
1154
|
name: "readonly",
|
|
1156
|
-
fn:
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1155
|
+
fn: k(() => [
|
|
1156
|
+
x("div", bl, [
|
|
1157
|
+
x("p", yl, B(L(A.value)), 1),
|
|
1158
|
+
o.value.length > 0 ? (d(), g(ee, { key: 0 }, [
|
|
1159
|
+
x("button", {
|
|
1161
1160
|
type: "button",
|
|
1162
|
-
"aria-expanded":
|
|
1161
|
+
"aria-expanded": E.value,
|
|
1163
1162
|
class: "mt-1.5 flex w-full cursor-pointer items-center gap-2 text-left text-footnote text-content-muted focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1164
|
-
onClick:
|
|
1163
|
+
onClick: K[2] || (K[2] = (I) => E.value = !E.value)
|
|
1165
1164
|
}, [
|
|
1166
|
-
|
|
1167
|
-
|
|
1165
|
+
x("span", hl, B(s(r)("core.form.i18n.more", { count: o.value.length, filled: f.value })), 1),
|
|
1166
|
+
U(s(ue), {
|
|
1168
1167
|
name: "arrowRightSLine",
|
|
1169
1168
|
size: 16,
|
|
1170
|
-
class:
|
|
1169
|
+
class: W(["shrink-0 transition-transform duration-motion-fast", E.value ? "rotate-90" : ""])
|
|
1171
1170
|
}, null, 8, ["class"])
|
|
1172
|
-
], 8,
|
|
1173
|
-
|
|
1174
|
-
(d(!0),
|
|
1175
|
-
key:
|
|
1171
|
+
], 8, gl),
|
|
1172
|
+
E.value ? (d(), g("dl", kl, [
|
|
1173
|
+
(d(!0), g(ee, null, ce(o.value, (I) => (d(), g("div", {
|
|
1174
|
+
key: I,
|
|
1176
1175
|
class: "flex gap-2 text-body"
|
|
1177
1176
|
}, [
|
|
1178
|
-
|
|
1177
|
+
x("dt", {
|
|
1179
1178
|
class: "w-8 shrink-0 text-footnote font-semibold leading-6 text-content-muted",
|
|
1180
|
-
title:
|
|
1181
|
-
}, C(
|
|
1182
|
-
|
|
1183
|
-
class:
|
|
1184
|
-
},
|
|
1179
|
+
title: P(I)
|
|
1180
|
+
}, B(C(I)), 9, _l),
|
|
1181
|
+
x("dd", {
|
|
1182
|
+
class: W(["min-w-0 flex-1 whitespace-pre-line break-words", T(I) ? "text-content-strong" : "text-content-disabled"])
|
|
1183
|
+
}, B(T(I) ? L(I) : s(r)("core.state.no_value")), 3)
|
|
1185
1184
|
]))), 128))
|
|
1186
|
-
])) :
|
|
1187
|
-
], 64)) :
|
|
1185
|
+
])) : j("", !0)
|
|
1186
|
+
], 64)) : j("", !0)
|
|
1188
1187
|
])
|
|
1189
1188
|
]),
|
|
1190
1189
|
key: "0"
|
|
1191
1190
|
} : void 0,
|
|
1192
|
-
|
|
1191
|
+
F.$slots.trailing ? {
|
|
1193
1192
|
name: "trailing",
|
|
1194
|
-
fn:
|
|
1195
|
-
|
|
1193
|
+
fn: k(() => [
|
|
1194
|
+
R(F.$slots, "trailing")
|
|
1196
1195
|
]),
|
|
1197
1196
|
key: "1"
|
|
1198
1197
|
} : void 0
|
|
1199
1198
|
]), 1040, ["value"]));
|
|
1200
1199
|
}
|
|
1201
|
-
}),
|
|
1202
|
-
function
|
|
1203
|
-
return
|
|
1200
|
+
}), wl = "unsupported_characters", $l = /[\u{10000}-\u{10FFFF}]/u;
|
|
1201
|
+
function Vl(l) {
|
|
1202
|
+
return $l.test(l);
|
|
1204
1203
|
}
|
|
1205
|
-
function
|
|
1204
|
+
function Ee(l, t, e) {
|
|
1206
1205
|
if (typeof l == "string")
|
|
1207
|
-
|
|
1206
|
+
Vl(l) && e.addIssue({ code: "custom", path: t, params: { code: wl } });
|
|
1208
1207
|
else if (Array.isArray(l))
|
|
1209
|
-
l.forEach((a,
|
|
1208
|
+
l.forEach((a, r) => Ee(a, [...t, r], e));
|
|
1210
1209
|
else if (l && typeof l == "object")
|
|
1211
|
-
for (const [a,
|
|
1210
|
+
for (const [a, r] of Object.entries(l)) Ee(r, [...t, a], e);
|
|
1212
1211
|
}
|
|
1213
|
-
function
|
|
1214
|
-
|
|
1212
|
+
function Br(l, t) {
|
|
1213
|
+
Ee(l, [], t);
|
|
1215
1214
|
}
|
|
1216
|
-
const
|
|
1215
|
+
const Lr = /* @__PURE__ */ J({
|
|
1217
1216
|
__name: "MoneyField",
|
|
1218
|
-
props: /* @__PURE__ */
|
|
1217
|
+
props: /* @__PURE__ */ me({
|
|
1219
1218
|
label: {},
|
|
1220
1219
|
labelHidden: { type: Boolean },
|
|
1221
1220
|
hint: {},
|
|
@@ -1232,50 +1231,50 @@ const To = /* @__PURE__ */ G({
|
|
|
1232
1231
|
blankZero: { type: Boolean },
|
|
1233
1232
|
negative: { type: Boolean },
|
|
1234
1233
|
width: {}
|
|
1235
|
-
}, { ...
|
|
1234
|
+
}, { ...pe, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
|
|
1236
1235
|
emits: ["update:modelValue", "focus", "blur"],
|
|
1237
1236
|
setup(l, { expose: t, emit: e }) {
|
|
1238
|
-
const a = l,
|
|
1239
|
-
return t({ focus: () =>
|
|
1237
|
+
const a = l, r = e, i = oe("field");
|
|
1238
|
+
return t({ focus: () => i.value?.focus() }), (p, u) => (d(), z(gt, N({
|
|
1240
1239
|
ref_key: "field",
|
|
1241
|
-
ref:
|
|
1240
|
+
ref: i,
|
|
1242
1241
|
"model-value": a.modelValue,
|
|
1243
|
-
"onUpdate:modelValue":
|
|
1242
|
+
"onUpdate:modelValue": u[0] || (u[0] = (b) => r("update:modelValue", b))
|
|
1244
1243
|
}, s(fe)(a), {
|
|
1245
1244
|
decimals: a.decimals,
|
|
1246
1245
|
negative: a.negative,
|
|
1247
1246
|
"blank-zero": a.blankZero,
|
|
1248
1247
|
suffix: a.currency,
|
|
1249
1248
|
width: a.width,
|
|
1250
|
-
onFocus:
|
|
1251
|
-
onBlur:
|
|
1252
|
-
}),
|
|
1253
|
-
|
|
1249
|
+
onFocus: u[1] || (u[1] = (b) => r("focus", b)),
|
|
1250
|
+
onBlur: u[2] || (u[2] = (b) => r("blur", b))
|
|
1251
|
+
}), ie({ _: 2 }, [
|
|
1252
|
+
p.$slots.trailing ? {
|
|
1254
1253
|
name: "trailing",
|
|
1255
|
-
fn:
|
|
1256
|
-
|
|
1254
|
+
fn: k(() => [
|
|
1255
|
+
R(p.$slots, "trailing")
|
|
1257
1256
|
]),
|
|
1258
1257
|
key: "0"
|
|
1259
1258
|
} : void 0,
|
|
1260
|
-
|
|
1259
|
+
p.$slots.labelTrailing ? {
|
|
1261
1260
|
name: "labelTrailing",
|
|
1262
|
-
fn:
|
|
1263
|
-
|
|
1261
|
+
fn: k(() => [
|
|
1262
|
+
R(p.$slots, "labelTrailing")
|
|
1264
1263
|
]),
|
|
1265
1264
|
key: "1"
|
|
1266
1265
|
} : void 0,
|
|
1267
|
-
|
|
1266
|
+
p.$slots.readonly ? {
|
|
1268
1267
|
name: "readonly",
|
|
1269
|
-
fn:
|
|
1270
|
-
|
|
1268
|
+
fn: k(() => [
|
|
1269
|
+
R(p.$slots, "readonly")
|
|
1271
1270
|
]),
|
|
1272
1271
|
key: "2"
|
|
1273
1272
|
} : void 0
|
|
1274
1273
|
]), 1040, ["model-value", "decimals", "negative", "blank-zero", "suffix", "width"]));
|
|
1275
1274
|
}
|
|
1276
|
-
}),
|
|
1275
|
+
}), Cl = { class: "flex flex-col gap-2" }, Sl = ["onClick"], Tr = /* @__PURE__ */ J({
|
|
1277
1276
|
__name: "MonthYearField",
|
|
1278
|
-
props: /* @__PURE__ */
|
|
1277
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
1279
1278
|
label: {},
|
|
1280
1279
|
labelHidden: { type: Boolean },
|
|
1281
1280
|
hint: {},
|
|
@@ -1289,7 +1288,7 @@ const To = /* @__PURE__ */ G({
|
|
|
1289
1288
|
minYear: {},
|
|
1290
1289
|
maxYear: {},
|
|
1291
1290
|
placeholder: {}
|
|
1292
|
-
}, { ...
|
|
1291
|
+
}, { ...pe, placeholder: void 0, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
|
|
1293
1292
|
month: { default: null },
|
|
1294
1293
|
monthModifiers: {},
|
|
1295
1294
|
year: { default: null },
|
|
@@ -1297,59 +1296,59 @@ const To = /* @__PURE__ */ G({
|
|
|
1297
1296
|
}),
|
|
1298
1297
|
emits: ["update:month", "update:year"],
|
|
1299
1298
|
setup(l) {
|
|
1300
|
-
const t = l, e =
|
|
1301
|
-
function
|
|
1302
|
-
e.value =
|
|
1299
|
+
const t = l, e = ke(l, "month"), a = ke(l, "year"), { t: r } = re(), i = q(() => e.value !== null && e.value >= 1 && e.value <= 12), p = (V, $) => r(`core.form.months.${$}.${V}`), u = q(() => i.value && a.value !== null ? r("core.form.months.with_year", { month: p(e.value, "long"), year: a.value }) : a.value !== null ? String(a.value) : i.value ? p(e.value, "long") : "");
|
|
1300
|
+
function b(V, $) {
|
|
1301
|
+
e.value = V.month, a.value = V.year, $();
|
|
1303
1302
|
}
|
|
1304
|
-
function
|
|
1305
|
-
e.value = null, a.value = null,
|
|
1303
|
+
function _(V) {
|
|
1304
|
+
e.value = null, a.value = null, V();
|
|
1306
1305
|
}
|
|
1307
|
-
return (
|
|
1308
|
-
value:
|
|
1309
|
-
}),
|
|
1310
|
-
default:
|
|
1311
|
-
|
|
1312
|
-
label: t.label ??
|
|
1306
|
+
return (V, $) => (d(), z(ye, N(s(fe)(t), {
|
|
1307
|
+
value: u.value || null
|
|
1308
|
+
}), ie({
|
|
1309
|
+
default: k(({ id: n, describedby: c, invalid: m }) => [
|
|
1310
|
+
U(Pe, {
|
|
1311
|
+
label: t.label ?? u.value,
|
|
1313
1312
|
width: "sm",
|
|
1314
1313
|
placement: "bottom-start",
|
|
1315
1314
|
arrow: !1
|
|
1316
1315
|
}, {
|
|
1317
|
-
trigger:
|
|
1318
|
-
|
|
1319
|
-
expanded:
|
|
1316
|
+
trigger: k(({ toggle: h, presented: v }) => [
|
|
1317
|
+
U(vt, N({ id: n, "aria-describedby": c }, {
|
|
1318
|
+
expanded: v,
|
|
1320
1319
|
disabled: t.disabled,
|
|
1321
|
-
invalid:
|
|
1322
|
-
placeholder: t.placeholder ?? s(
|
|
1323
|
-
onClick:
|
|
1320
|
+
invalid: m,
|
|
1321
|
+
placeholder: t.placeholder ?? s(r)("core.form.select.choose"),
|
|
1322
|
+
onClick: h
|
|
1324
1323
|
}), {
|
|
1325
|
-
default:
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1324
|
+
default: k(() => [
|
|
1325
|
+
u.value ? (d(), g(ee, { key: 0 }, [
|
|
1326
|
+
Z(B(u.value), 1),
|
|
1327
|
+
U(s(ue), {
|
|
1329
1328
|
name: "calendarLine",
|
|
1330
1329
|
size: 16,
|
|
1331
1330
|
class: "ml-2 shrink-0 text-content-muted"
|
|
1332
1331
|
})
|
|
1333
|
-
], 64)) :
|
|
1332
|
+
], 64)) : j("", !0)
|
|
1334
1333
|
]),
|
|
1335
1334
|
_: 1
|
|
1336
1335
|
}, 16, ["expanded", "disabled", "invalid", "placeholder", "onClick"])
|
|
1337
1336
|
]),
|
|
1338
|
-
default:
|
|
1339
|
-
|
|
1340
|
-
|
|
1337
|
+
default: k(({ dismiss: h }) => [
|
|
1338
|
+
x("div", Cl, [
|
|
1339
|
+
U(Xt, {
|
|
1341
1340
|
month: e.value,
|
|
1342
1341
|
year: a.value,
|
|
1343
1342
|
"min-year": t.minYear,
|
|
1344
1343
|
"max-year": t.maxYear,
|
|
1345
|
-
onPick: (
|
|
1344
|
+
onPick: (v) => b(v, h)
|
|
1346
1345
|
}, null, 8, ["month", "year", "min-year", "max-year", "onPick"]),
|
|
1347
|
-
|
|
1346
|
+
i.value || a.value !== null ? (d(), g("button", {
|
|
1348
1347
|
key: 0,
|
|
1349
1348
|
type: "button",
|
|
1350
1349
|
class: "cursor-pointer self-start rounded-control px-1 text-footnote text-content-link",
|
|
1351
|
-
onClick: (
|
|
1352
|
-
},
|
|
1350
|
+
onClick: (v) => _(h)
|
|
1351
|
+
}, B(s(r)("core.form.select.clear")), 9, Sl)) : j("", !0)
|
|
1353
1352
|
])
|
|
1354
1353
|
]),
|
|
1355
1354
|
_: 2
|
|
@@ -1357,32 +1356,32 @@ const To = /* @__PURE__ */ G({
|
|
|
1357
1356
|
]),
|
|
1358
1357
|
_: 2
|
|
1359
1358
|
}, [
|
|
1360
|
-
|
|
1359
|
+
V.$slots.trailing ? {
|
|
1361
1360
|
name: "trailing",
|
|
1362
|
-
fn:
|
|
1363
|
-
|
|
1361
|
+
fn: k(() => [
|
|
1362
|
+
R(V.$slots, "trailing")
|
|
1364
1363
|
]),
|
|
1365
1364
|
key: "0"
|
|
1366
1365
|
} : void 0,
|
|
1367
|
-
|
|
1366
|
+
V.$slots.labelTrailing ? {
|
|
1368
1367
|
name: "labelTrailing",
|
|
1369
|
-
fn:
|
|
1370
|
-
|
|
1368
|
+
fn: k(() => [
|
|
1369
|
+
R(V.$slots, "labelTrailing")
|
|
1371
1370
|
]),
|
|
1372
1371
|
key: "1"
|
|
1373
1372
|
} : void 0,
|
|
1374
|
-
|
|
1373
|
+
V.$slots.readonly ? {
|
|
1375
1374
|
name: "readonly",
|
|
1376
|
-
fn:
|
|
1377
|
-
|
|
1375
|
+
fn: k(() => [
|
|
1376
|
+
R(V.$slots, "readonly")
|
|
1378
1377
|
]),
|
|
1379
1378
|
key: "2"
|
|
1380
1379
|
} : void 0
|
|
1381
1380
|
]), 1040, ["value"]));
|
|
1382
1381
|
}
|
|
1383
|
-
}),
|
|
1382
|
+
}), Fl = { class: "flex min-w-0 flex-wrap items-center gap-1.5 py-0.5" }, ql = { class: "truncate" }, Bl = ["disabled", "aria-label", "onClick"], Ll = ["id", "disabled", "aria-expanded", "aria-invalid", "aria-describedby", "aria-busy"], Tl = ["id", "disabled", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], Dl = { class: "max-h-72 overflow-y-auto" }, zl = { class: "flex items-center justify-between gap-2" }, lt = "inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-control bg-fill px-2.5 py-1 text-body text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-45", jl = /* @__PURE__ */ J({
|
|
1384
1383
|
__name: "MultiSelectField",
|
|
1385
|
-
props: /* @__PURE__ */
|
|
1384
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
1386
1385
|
label: {},
|
|
1387
1386
|
labelHidden: { type: Boolean },
|
|
1388
1387
|
hint: {},
|
|
@@ -1397,114 +1396,114 @@ const To = /* @__PURE__ */ G({
|
|
|
1397
1396
|
selected: {},
|
|
1398
1397
|
placeholder: {},
|
|
1399
1398
|
searchFrom: {}
|
|
1400
|
-
}, { ...
|
|
1399
|
+
}, { ...pe, selected: () => [], placeholder: void 0, searchFrom: 9 }), {
|
|
1401
1400
|
modelValue: { default: () => [] },
|
|
1402
1401
|
modelModifiers: {}
|
|
1403
1402
|
}),
|
|
1404
1403
|
emits: ["update:modelValue"],
|
|
1405
1404
|
setup(l) {
|
|
1406
|
-
const t = l, e =
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1409
|
-
}),
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1412
|
-
})),
|
|
1413
|
-
function
|
|
1414
|
-
|
|
1405
|
+
const t = l, e = ke(l, "modelValue"), { t: a } = re(), r = Ne(), i = oe("sheet"), p = H(!1), u = ra(() => t.options, (n) => {
|
|
1406
|
+
const c = e.value.filter((m) => n.some((h) => h.value === m));
|
|
1407
|
+
c.length !== e.value.length && (e.value = c);
|
|
1408
|
+
}), b = q(() => e.value.flatMap((n) => {
|
|
1409
|
+
const c = u.known.value.find((m) => m.value === n) ?? t.selected.find((m) => m.value === n);
|
|
1410
|
+
return c ? [c] : [];
|
|
1411
|
+
})), _ = q(() => t.placeholder ?? a("core.form.select.choose"));
|
|
1412
|
+
function V(n) {
|
|
1413
|
+
n !== null && (e.value = e.value.includes(n) ? e.value.filter((c) => c !== n) : [...e.value, n]);
|
|
1415
1414
|
}
|
|
1416
|
-
const $ = (
|
|
1417
|
-
return (
|
|
1418
|
-
value:
|
|
1415
|
+
const $ = (n) => e.value = e.value.filter((c) => c !== n);
|
|
1416
|
+
return (n, c) => (d(), z(ye, N(s(fe)(t), {
|
|
1417
|
+
value: b.value.length ? b.value.map((m) => m.label).join(", ") : null,
|
|
1419
1418
|
"row-layout": "stacked"
|
|
1420
|
-
}),
|
|
1421
|
-
default:
|
|
1422
|
-
|
|
1423
|
-
(d(!0),
|
|
1424
|
-
key: String(
|
|
1419
|
+
}), ie({
|
|
1420
|
+
default: k(({ id: m, describedby: h, invalid: v }) => [
|
|
1421
|
+
x("div", Fl, [
|
|
1422
|
+
(d(!0), g(ee, null, ce(b.value, (y) => (d(), g("span", {
|
|
1423
|
+
key: String(y.value),
|
|
1425
1424
|
"data-test": "chip",
|
|
1426
1425
|
class: "inline-flex min-h-7 max-w-full items-center gap-1 rounded-full bg-tint-soft pl-3 pr-1 text-subheadline font-medium text-content-link"
|
|
1427
1426
|
}, [
|
|
1428
|
-
|
|
1429
|
-
|
|
1427
|
+
x("span", ql, B(y.label), 1),
|
|
1428
|
+
x("button", {
|
|
1430
1429
|
type: "button",
|
|
1431
1430
|
disabled: t.disabled,
|
|
1432
|
-
"aria-label": `${s(a)("core.form.select.clear")}: ${
|
|
1431
|
+
"aria-label": `${s(a)("core.form.select.clear")}: ${y.label}`,
|
|
1433
1432
|
class: "flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-fill focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-not-allowed",
|
|
1434
|
-
onClick: (
|
|
1433
|
+
onClick: (S) => $(y.value)
|
|
1435
1434
|
}, [
|
|
1436
|
-
|
|
1435
|
+
U(s(ue), {
|
|
1437
1436
|
name: "close",
|
|
1438
1437
|
size: 12
|
|
1439
1438
|
})
|
|
1440
|
-
], 8,
|
|
1439
|
+
], 8, Bl)
|
|
1441
1440
|
]))), 128)),
|
|
1442
|
-
s(
|
|
1441
|
+
s(r) ? (d(), g("button", {
|
|
1443
1442
|
key: 0,
|
|
1444
|
-
id:
|
|
1443
|
+
id: m,
|
|
1445
1444
|
type: "button",
|
|
1446
1445
|
disabled: t.disabled,
|
|
1447
1446
|
"aria-haspopup": "dialog",
|
|
1448
|
-
"aria-expanded":
|
|
1449
|
-
"aria-invalid":
|
|
1450
|
-
"aria-describedby":
|
|
1451
|
-
"aria-busy": s(
|
|
1452
|
-
class:
|
|
1453
|
-
onClick:
|
|
1447
|
+
"aria-expanded": p.value,
|
|
1448
|
+
"aria-invalid": v || void 0,
|
|
1449
|
+
"aria-describedby": h,
|
|
1450
|
+
"aria-busy": s(u).loading.value || void 0,
|
|
1451
|
+
class: W(lt),
|
|
1452
|
+
onClick: c[0] || (c[0] = (y) => i.value?.present())
|
|
1454
1453
|
}, [
|
|
1455
|
-
s(
|
|
1454
|
+
s(u).loading.value ? (d(), z(s(ue), {
|
|
1456
1455
|
key: 0,
|
|
1457
1456
|
name: "loader4Line",
|
|
1458
1457
|
size: 14,
|
|
1459
1458
|
class: "shrink-0 animate-spin"
|
|
1460
|
-
})) :
|
|
1461
|
-
|
|
1462
|
-
], 8,
|
|
1459
|
+
})) : j("", !0),
|
|
1460
|
+
Z(" " + B(b.value.length ? s(a)("core.actions.edit") : _.value), 1)
|
|
1461
|
+
], 8, Ll)) : (d(), z(Pe, {
|
|
1463
1462
|
key: 1,
|
|
1464
|
-
label: t.label ??
|
|
1463
|
+
label: t.label ?? _.value,
|
|
1465
1464
|
width: "lg",
|
|
1466
1465
|
"match-trigger-width": "",
|
|
1467
1466
|
placement: "bottom-start",
|
|
1468
1467
|
arrow: !1
|
|
1469
1468
|
}, {
|
|
1470
|
-
trigger:
|
|
1471
|
-
|
|
1472
|
-
id:
|
|
1469
|
+
trigger: k(({ toggle: y, attrs: S }) => [
|
|
1470
|
+
x("button", N({
|
|
1471
|
+
id: m,
|
|
1473
1472
|
type: "button"
|
|
1474
|
-
},
|
|
1473
|
+
}, S, {
|
|
1475
1474
|
"aria-haspopup": "listbox",
|
|
1476
1475
|
disabled: t.disabled,
|
|
1477
|
-
"aria-invalid":
|
|
1478
|
-
"aria-describedby":
|
|
1479
|
-
"aria-busy": s(
|
|
1480
|
-
class:
|
|
1481
|
-
onClick:
|
|
1476
|
+
"aria-invalid": v || void 0,
|
|
1477
|
+
"aria-describedby": h,
|
|
1478
|
+
"aria-busy": s(u).loading.value || void 0,
|
|
1479
|
+
class: lt,
|
|
1480
|
+
onClick: y
|
|
1482
1481
|
}), [
|
|
1483
|
-
s(
|
|
1482
|
+
s(u).loading.value ? (d(), z(s(ue), {
|
|
1484
1483
|
key: 0,
|
|
1485
1484
|
name: "loader4Line",
|
|
1486
1485
|
size: 14,
|
|
1487
1486
|
class: "shrink-0 animate-spin"
|
|
1488
|
-
})) :
|
|
1489
|
-
|
|
1490
|
-
], 16,
|
|
1487
|
+
})) : j("", !0),
|
|
1488
|
+
Z(" " + B(b.value.length ? s(a)("core.actions.edit") : _.value), 1)
|
|
1489
|
+
], 16, Tl)
|
|
1491
1490
|
]),
|
|
1492
|
-
default:
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
options: s(
|
|
1496
|
-
status: s(
|
|
1491
|
+
default: k(() => [
|
|
1492
|
+
x("div", Dl, [
|
|
1493
|
+
U(Xe, {
|
|
1494
|
+
options: s(u).rows.value,
|
|
1495
|
+
status: s(u).status.value,
|
|
1497
1496
|
"model-value": e.value,
|
|
1498
1497
|
multiple: "",
|
|
1499
1498
|
"search-from": t.searchFrom,
|
|
1500
1499
|
presentation: "plain",
|
|
1501
|
-
onSelect:
|
|
1502
|
-
onRetry:
|
|
1503
|
-
},
|
|
1504
|
-
|
|
1500
|
+
onSelect: V,
|
|
1501
|
+
onRetry: c[1] || (c[1] = (y) => s(u).reload())
|
|
1502
|
+
}, ie({ _: 2 }, [
|
|
1503
|
+
n.$slots.option ? {
|
|
1505
1504
|
name: "option",
|
|
1506
|
-
fn:
|
|
1507
|
-
|
|
1505
|
+
fn: k((y) => [
|
|
1506
|
+
R(n.$slots, "option", Re(Ue(y)))
|
|
1508
1507
|
]),
|
|
1509
1508
|
key: "0"
|
|
1510
1509
|
} : void 0
|
|
@@ -1514,88 +1513,88 @@ const To = /* @__PURE__ */ G({
|
|
|
1514
1513
|
_: 2
|
|
1515
1514
|
}, 1032, ["label"]))
|
|
1516
1515
|
]),
|
|
1517
|
-
s(
|
|
1516
|
+
s(r) ? (d(), z(oa, {
|
|
1518
1517
|
key: 0,
|
|
1519
1518
|
ref_key: "sheet",
|
|
1520
|
-
ref:
|
|
1521
|
-
title: t.label ??
|
|
1519
|
+
ref: i,
|
|
1520
|
+
title: t.label ?? _.value,
|
|
1522
1521
|
grouped: "",
|
|
1523
|
-
onPresented:
|
|
1524
|
-
onDismissed:
|
|
1522
|
+
onPresented: c[5] || (c[5] = (y) => p.value = !0),
|
|
1523
|
+
onDismissed: c[6] || (c[6] = (y) => p.value = !1)
|
|
1525
1524
|
}, {
|
|
1526
|
-
footer:
|
|
1527
|
-
|
|
1528
|
-
|
|
1525
|
+
footer: k(() => [
|
|
1526
|
+
x("div", zl, [
|
|
1527
|
+
U(ae, {
|
|
1529
1528
|
prominence: "plain",
|
|
1530
1529
|
disabled: e.value.length === 0,
|
|
1531
|
-
onClick:
|
|
1530
|
+
onClick: c[3] || (c[3] = (y) => e.value = [])
|
|
1532
1531
|
}, {
|
|
1533
|
-
default:
|
|
1534
|
-
|
|
1532
|
+
default: k(() => [
|
|
1533
|
+
Z(B(s(a)("core.form.select.clear")), 1)
|
|
1535
1534
|
]),
|
|
1536
1535
|
_: 1
|
|
1537
1536
|
}, 8, ["disabled"]),
|
|
1538
|
-
|
|
1537
|
+
U(ae, {
|
|
1539
1538
|
prominence: "primary",
|
|
1540
|
-
onClick:
|
|
1539
|
+
onClick: c[4] || (c[4] = (y) => i.value?.dismiss())
|
|
1541
1540
|
}, {
|
|
1542
|
-
default:
|
|
1543
|
-
|
|
1541
|
+
default: k(() => [
|
|
1542
|
+
Z(B(s(a)("core.form.select.done")), 1)
|
|
1544
1543
|
]),
|
|
1545
1544
|
_: 1
|
|
1546
1545
|
})
|
|
1547
1546
|
])
|
|
1548
1547
|
]),
|
|
1549
|
-
default:
|
|
1550
|
-
|
|
1551
|
-
options: s(
|
|
1552
|
-
status: s(
|
|
1548
|
+
default: k(() => [
|
|
1549
|
+
U(Xe, {
|
|
1550
|
+
options: s(u).rows.value,
|
|
1551
|
+
status: s(u).status.value,
|
|
1553
1552
|
"model-value": e.value,
|
|
1554
1553
|
multiple: "",
|
|
1555
1554
|
"search-from": t.searchFrom,
|
|
1556
|
-
onSelect:
|
|
1557
|
-
onRetry:
|
|
1558
|
-
},
|
|
1559
|
-
|
|
1555
|
+
onSelect: V,
|
|
1556
|
+
onRetry: c[2] || (c[2] = (y) => s(u).reload())
|
|
1557
|
+
}, ie({ _: 2 }, [
|
|
1558
|
+
n.$slots.option ? {
|
|
1560
1559
|
name: "option",
|
|
1561
|
-
fn:
|
|
1562
|
-
|
|
1560
|
+
fn: k((y) => [
|
|
1561
|
+
R(n.$slots, "option", Re(Ue(y)))
|
|
1563
1562
|
]),
|
|
1564
1563
|
key: "0"
|
|
1565
1564
|
} : void 0
|
|
1566
1565
|
]), 1032, ["options", "status", "model-value", "search-from"])
|
|
1567
1566
|
]),
|
|
1568
1567
|
_: 3
|
|
1569
|
-
}, 8, ["title"])) :
|
|
1568
|
+
}, 8, ["title"])) : j("", !0)
|
|
1570
1569
|
]),
|
|
1571
1570
|
_: 2
|
|
1572
1571
|
}, [
|
|
1573
|
-
|
|
1572
|
+
n.$slots.trailing ? {
|
|
1574
1573
|
name: "trailing",
|
|
1575
|
-
fn:
|
|
1576
|
-
|
|
1574
|
+
fn: k(() => [
|
|
1575
|
+
R(n.$slots, "trailing")
|
|
1577
1576
|
]),
|
|
1578
1577
|
key: "0"
|
|
1579
1578
|
} : void 0,
|
|
1580
|
-
|
|
1579
|
+
n.$slots.labelTrailing ? {
|
|
1581
1580
|
name: "labelTrailing",
|
|
1582
|
-
fn:
|
|
1583
|
-
|
|
1581
|
+
fn: k(() => [
|
|
1582
|
+
R(n.$slots, "labelTrailing")
|
|
1584
1583
|
]),
|
|
1585
1584
|
key: "1"
|
|
1586
1585
|
} : void 0,
|
|
1587
|
-
|
|
1586
|
+
n.$slots.readonly ? {
|
|
1588
1587
|
name: "readonly",
|
|
1589
|
-
fn:
|
|
1590
|
-
|
|
1588
|
+
fn: k(() => [
|
|
1589
|
+
R(n.$slots, "readonly")
|
|
1591
1590
|
]),
|
|
1592
1591
|
key: "2"
|
|
1593
1592
|
} : void 0
|
|
1594
1593
|
]), 1040, ["value"]));
|
|
1595
1594
|
}
|
|
1596
|
-
}),
|
|
1595
|
+
}), Ol = ["aria-label"], Ml = ["src"], Rl = { class: "flex flex-wrap items-center gap-3" }, Ul = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], El = ["aria-label"], Il = ["src"], Dr = /* @__PURE__ */ J({
|
|
1597
1596
|
__name: "PhotoField",
|
|
1598
|
-
props: /* @__PURE__ */
|
|
1597
|
+
props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
|
|
1599
1598
|
label: {},
|
|
1600
1599
|
labelHidden: { type: Boolean },
|
|
1601
1600
|
hint: {},
|
|
@@ -1608,181 +1607,181 @@ const To = /* @__PURE__ */ G({
|
|
|
1608
1607
|
name: {},
|
|
1609
1608
|
accept: {},
|
|
1610
1609
|
maxSize: {}
|
|
1611
|
-
}, { ...
|
|
1610
|
+
}, { ...pe, accept: () => ["image/jpeg", "image/png", "image/webp", "image/gif"], maxSize: 5 * 1024 * 1024 }), {
|
|
1612
1611
|
modelValue: { default: null },
|
|
1613
1612
|
modelModifiers: {}
|
|
1614
1613
|
}),
|
|
1615
1614
|
emits: ["update:modelValue"],
|
|
1616
1615
|
setup(l) {
|
|
1617
|
-
const t = l, e =
|
|
1618
|
-
function
|
|
1619
|
-
|
|
1616
|
+
const t = l, e = ke(l, "modelValue"), { t: a } = re(), r = oe("chooser"), i = H(null), p = H(null);
|
|
1617
|
+
function u() {
|
|
1618
|
+
p.value && URL.revokeObjectURL(p.value), p.value = null;
|
|
1620
1619
|
}
|
|
1621
|
-
|
|
1620
|
+
be(
|
|
1622
1621
|
e,
|
|
1623
|
-
(
|
|
1624
|
-
|
|
1622
|
+
(n) => {
|
|
1623
|
+
u(), n instanceof File && (p.value = URL.createObjectURL(n)), n === null && r.value && (r.value.value = "");
|
|
1625
1624
|
},
|
|
1626
1625
|
{ immediate: !0 }
|
|
1627
|
-
),
|
|
1628
|
-
const
|
|
1629
|
-
function $(
|
|
1630
|
-
if (!
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1626
|
+
), ze(u);
|
|
1627
|
+
const b = q(() => e.value instanceof File ? p.value : e.value), _ = oe("viewer"), V = q(() => b.value ? [{ src: b.value, alt: t.label ?? a("core.viewer.label"), downloadName: e.value instanceof File ? e.value.name : void 0 }] : []);
|
|
1628
|
+
function $(n) {
|
|
1629
|
+
if (!n) return;
|
|
1630
|
+
const c = $t(n, { accept: t.accept, maxSize: t.maxSize });
|
|
1631
|
+
c ? i.value = c === "invalid_type" ? a("core.form.file.invalid_type") : a("core.form.file.too_large", { size: Le(t.maxSize) }) : (i.value = null, e.value = n);
|
|
1633
1632
|
}
|
|
1634
|
-
return (
|
|
1635
|
-
value:
|
|
1633
|
+
return (n, c) => (d(), z(ye, N({ ...s(fe)(t), error: i.value ?? t.error }, {
|
|
1634
|
+
value: b.value ? s(a)("core.form.file.choose") : null,
|
|
1636
1635
|
"row-layout": "stacked"
|
|
1637
|
-
}),
|
|
1638
|
-
readonly:
|
|
1639
|
-
|
|
1636
|
+
}), ie({
|
|
1637
|
+
readonly: k(() => [
|
|
1638
|
+
b.value ? (d(), g("button", {
|
|
1640
1639
|
key: 0,
|
|
1641
1640
|
type: "button",
|
|
1642
1641
|
"aria-label": s(a)("core.viewer.open"),
|
|
1643
1642
|
"data-test": "photo-open",
|
|
1644
1643
|
class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
1645
|
-
onClick:
|
|
1644
|
+
onClick: c[0] || (c[0] = (m) => _.value?.present(0))
|
|
1646
1645
|
}, [
|
|
1647
|
-
|
|
1648
|
-
src:
|
|
1646
|
+
x("img", {
|
|
1647
|
+
src: b.value,
|
|
1649
1648
|
alt: "",
|
|
1650
1649
|
class: "size-40 rounded-group object-cover"
|
|
1651
|
-
}, null, 8,
|
|
1652
|
-
], 8,
|
|
1653
|
-
|
|
1650
|
+
}, null, 8, Ml)
|
|
1651
|
+
], 8, Ol)) : j("", !0),
|
|
1652
|
+
b.value ? (d(), z(Qe, {
|
|
1654
1653
|
key: 1,
|
|
1655
1654
|
ref_key: "viewer",
|
|
1656
|
-
ref:
|
|
1657
|
-
items:
|
|
1658
|
-
}, null, 8, ["items"])) :
|
|
1655
|
+
ref: _,
|
|
1656
|
+
items: V.value
|
|
1657
|
+
}, null, 8, ["items"])) : j("", !0)
|
|
1659
1658
|
]),
|
|
1660
|
-
default:
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
id:
|
|
1659
|
+
default: k(({ id: m, describedby: h, invalid: v }) => [
|
|
1660
|
+
x("div", Rl, [
|
|
1661
|
+
x("input", {
|
|
1662
|
+
id: m,
|
|
1664
1663
|
ref_key: "chooser",
|
|
1665
|
-
ref:
|
|
1664
|
+
ref: r,
|
|
1666
1665
|
type: "file",
|
|
1667
1666
|
class: "sr-only",
|
|
1668
1667
|
tabindex: "-1",
|
|
1669
1668
|
accept: t.accept.join(","),
|
|
1670
1669
|
disabled: t.disabled,
|
|
1671
|
-
"aria-describedby":
|
|
1672
|
-
"aria-invalid":
|
|
1673
|
-
onChange:
|
|
1674
|
-
}, null, 40,
|
|
1675
|
-
|
|
1670
|
+
"aria-describedby": h,
|
|
1671
|
+
"aria-invalid": v || void 0,
|
|
1672
|
+
onChange: c[1] || (c[1] = (y) => $(y.target.files?.[0]))
|
|
1673
|
+
}, null, 40, Ul),
|
|
1674
|
+
b.value ? (d(), g("button", {
|
|
1676
1675
|
key: 0,
|
|
1677
1676
|
type: "button",
|
|
1678
1677
|
"aria-label": s(a)("core.viewer.open"),
|
|
1679
1678
|
"data-test": "photo-open",
|
|
1680
1679
|
class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
1681
|
-
onClick:
|
|
1680
|
+
onClick: c[2] || (c[2] = (y) => _.value?.present(0))
|
|
1682
1681
|
}, [
|
|
1683
|
-
|
|
1684
|
-
src:
|
|
1682
|
+
x("img", {
|
|
1683
|
+
src: b.value,
|
|
1685
1684
|
alt: "",
|
|
1686
1685
|
"data-test": "photo-preview",
|
|
1687
1686
|
class: "size-28 rounded-group object-cover"
|
|
1688
|
-
}, null, 8,
|
|
1689
|
-
], 8,
|
|
1690
|
-
|
|
1687
|
+
}, null, 8, Il)
|
|
1688
|
+
], 8, El)) : j("", !0),
|
|
1689
|
+
U(ae, {
|
|
1691
1690
|
disabled: t.disabled,
|
|
1692
|
-
onClick:
|
|
1691
|
+
onClick: c[3] || (c[3] = (y) => r.value?.click())
|
|
1693
1692
|
}, {
|
|
1694
|
-
default:
|
|
1695
|
-
|
|
1693
|
+
default: k(() => [
|
|
1694
|
+
Z(B(s(a)("core.form.file.choose")), 1)
|
|
1696
1695
|
]),
|
|
1697
1696
|
_: 1
|
|
1698
1697
|
}, 8, ["disabled"]),
|
|
1699
|
-
|
|
1698
|
+
b.value ? (d(), z(ae, {
|
|
1700
1699
|
key: 1,
|
|
1701
1700
|
prominence: "plain",
|
|
1702
1701
|
tone: "critical",
|
|
1703
1702
|
disabled: t.disabled,
|
|
1704
|
-
onClick:
|
|
1705
|
-
e.value = null,
|
|
1703
|
+
onClick: c[4] || (c[4] = (y) => {
|
|
1704
|
+
e.value = null, i.value = null;
|
|
1706
1705
|
})
|
|
1707
1706
|
}, {
|
|
1708
|
-
default:
|
|
1709
|
-
|
|
1707
|
+
default: k(() => [
|
|
1708
|
+
Z(B(s(a)("core.form.file.remove")), 1)
|
|
1710
1709
|
]),
|
|
1711
1710
|
_: 1
|
|
1712
|
-
}, 8, ["disabled"])) :
|
|
1711
|
+
}, 8, ["disabled"])) : j("", !0)
|
|
1713
1712
|
]),
|
|
1714
|
-
|
|
1713
|
+
b.value ? (d(), z(Qe, {
|
|
1715
1714
|
key: 0,
|
|
1716
1715
|
ref_key: "viewer",
|
|
1717
|
-
ref:
|
|
1718
|
-
items:
|
|
1719
|
-
}, null, 8, ["items"])) :
|
|
1716
|
+
ref: _,
|
|
1717
|
+
items: V.value
|
|
1718
|
+
}, null, 8, ["items"])) : j("", !0)
|
|
1720
1719
|
]),
|
|
1721
1720
|
_: 2
|
|
1722
1721
|
}, [
|
|
1723
|
-
|
|
1722
|
+
n.$slots.trailing ? {
|
|
1724
1723
|
name: "trailing",
|
|
1725
|
-
fn:
|
|
1726
|
-
|
|
1724
|
+
fn: k(() => [
|
|
1725
|
+
R(n.$slots, "trailing")
|
|
1727
1726
|
]),
|
|
1728
1727
|
key: "0"
|
|
1729
1728
|
} : void 0,
|
|
1730
|
-
|
|
1729
|
+
n.$slots.labelTrailing ? {
|
|
1731
1730
|
name: "labelTrailing",
|
|
1732
|
-
fn:
|
|
1733
|
-
|
|
1731
|
+
fn: k(() => [
|
|
1732
|
+
R(n.$slots, "labelTrailing")
|
|
1734
1733
|
]),
|
|
1735
1734
|
key: "1"
|
|
1736
1735
|
} : void 0
|
|
1737
1736
|
]), 1040, ["value"]));
|
|
1738
1737
|
}
|
|
1739
|
-
}),
|
|
1738
|
+
}), Al = { hidden: "" }, Nl = /* @__PURE__ */ J({
|
|
1740
1739
|
__name: "EditorChrome",
|
|
1741
1740
|
props: {
|
|
1742
1741
|
options: {}
|
|
1743
1742
|
},
|
|
1744
1743
|
setup(l) {
|
|
1745
|
-
return
|
|
1744
|
+
return ma(l.options), (e, a) => (d(), g("span", Al));
|
|
1746
1745
|
}
|
|
1747
1746
|
});
|
|
1748
|
-
function
|
|
1749
|
-
const t =
|
|
1747
|
+
function Pl(l) {
|
|
1748
|
+
const t = H(0);
|
|
1750
1749
|
let e = 0;
|
|
1751
1750
|
const a = () => {
|
|
1752
1751
|
e || (e = requestAnimationFrame(() => {
|
|
1753
1752
|
e = 0, t.value++;
|
|
1754
1753
|
}));
|
|
1755
|
-
},
|
|
1756
|
-
|
|
1754
|
+
}, r = typeof MutationObserver > "u" ? null : new MutationObserver(a);
|
|
1755
|
+
be(
|
|
1757
1756
|
() => l.sections.value,
|
|
1758
|
-
(
|
|
1759
|
-
|
|
1760
|
-
for (const
|
|
1761
|
-
|
|
1757
|
+
(u) => {
|
|
1758
|
+
r?.disconnect();
|
|
1759
|
+
for (const b of u)
|
|
1760
|
+
r?.observe(b.element, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["data-field-error", "data-field-required", "data-field-filled"] });
|
|
1762
1761
|
a();
|
|
1763
1762
|
},
|
|
1764
1763
|
{ immediate: !0 }
|
|
1765
|
-
),
|
|
1766
|
-
|
|
1764
|
+
), Lt() && Tt(() => {
|
|
1765
|
+
r?.disconnect(), e && cancelAnimationFrame(e);
|
|
1767
1766
|
});
|
|
1768
|
-
const
|
|
1769
|
-
l.sections.value.map((
|
|
1770
|
-
|
|
1767
|
+
const i = q(() => (t.value, Object.fromEntries(
|
|
1768
|
+
l.sections.value.map((u) => [
|
|
1769
|
+
u.id,
|
|
1771
1770
|
{
|
|
1772
|
-
errors:
|
|
1773
|
-
required: { total:
|
|
1771
|
+
errors: u.element.querySelectorAll("[data-field-error]").length,
|
|
1772
|
+
required: { total: u.element.querySelectorAll("[data-field-required]").length, filled: u.element.querySelectorAll("[data-field-required][data-field-filled]").length }
|
|
1774
1773
|
}
|
|
1775
1774
|
])
|
|
1776
|
-
))),
|
|
1777
|
-
return { states:
|
|
1775
|
+
))), p = q(() => Object.values(i.value).reduce((u, b) => ({ filled: u.filled + b.required.filled, total: u.total + b.required.total }), { filled: 0, total: 0 }));
|
|
1776
|
+
return { states: i, totals: p };
|
|
1778
1777
|
}
|
|
1779
|
-
const
|
|
1778
|
+
const Kl = {
|
|
1780
1779
|
class: "grid min-w-0 grid-cols-1 items-start gap-8 lg:grid-cols-[12.5rem_minmax(0,1fr)]",
|
|
1781
1780
|
"data-test": "editor-page"
|
|
1782
|
-
},
|
|
1781
|
+
}, Gl = {
|
|
1783
1782
|
key: 0,
|
|
1784
1783
|
class: "sticky top-[calc(var(--app-bar-height)+1.5rem+var(--shell-banner-h,0px))] hidden min-w-0 flex-col gap-4 self-start lg:flex"
|
|
1785
|
-
},
|
|
1784
|
+
}, zr = /* @__PURE__ */ J({
|
|
1786
1785
|
__name: "EditorPage",
|
|
1787
1786
|
props: {
|
|
1788
1787
|
title: {},
|
|
@@ -1795,10 +1794,10 @@ const xl = {
|
|
|
1795
1794
|
},
|
|
1796
1795
|
emits: ["save", "cancel"],
|
|
1797
1796
|
setup(l, { emit: t }) {
|
|
1798
|
-
const e = l, a = t, { t:
|
|
1797
|
+
const e = l, a = t, { t: r } = re(), i = Ne(), p = ca(), { states: u, totals: b } = Pl(p), _ = oe("content"), V = q(
|
|
1799
1798
|
() => e.form ? {
|
|
1800
1799
|
form: e.form,
|
|
1801
|
-
label: () => e.saveLabel ??
|
|
1800
|
+
label: () => e.saveLabel ?? r("core.actions.save"),
|
|
1802
1801
|
allowed: () => e.canSave,
|
|
1803
1802
|
disabledWhileClean: () => e.disabledWhileClean,
|
|
1804
1803
|
save: () => {
|
|
@@ -1809,90 +1808,90 @@ const xl = {
|
|
|
1809
1808
|
}
|
|
1810
1809
|
} : null
|
|
1811
1810
|
);
|
|
1812
|
-
|
|
1811
|
+
be(
|
|
1813
1812
|
() => e.form?.failure.value,
|
|
1814
|
-
async (
|
|
1815
|
-
|
|
1813
|
+
async (n) => {
|
|
1814
|
+
n?.kind === "invalid" && (await we(), await Me(_.value ?? document, p));
|
|
1816
1815
|
}
|
|
1817
1816
|
);
|
|
1818
|
-
function $(
|
|
1819
|
-
const
|
|
1820
|
-
|
|
1817
|
+
function $(n) {
|
|
1818
|
+
const c = p.sections.value.find((m) => m.id === n)?.element;
|
|
1819
|
+
c && we(() => Me(c));
|
|
1821
1820
|
}
|
|
1822
|
-
return (
|
|
1821
|
+
return (n, c) => (d(), z(ia, {
|
|
1823
1822
|
title: e.title,
|
|
1824
1823
|
back: e.back,
|
|
1825
1824
|
width: "content"
|
|
1826
|
-
},
|
|
1827
|
-
default:
|
|
1828
|
-
|
|
1825
|
+
}, ie({
|
|
1826
|
+
default: k(() => [
|
|
1827
|
+
V.value ? (d(), z(Nl, {
|
|
1829
1828
|
key: 0,
|
|
1830
|
-
options:
|
|
1831
|
-
}, null, 8, ["options"])) :
|
|
1832
|
-
|
|
1833
|
-
s(
|
|
1834
|
-
|
|
1829
|
+
options: V.value
|
|
1830
|
+
}, null, 8, ["options"])) : j("", !0),
|
|
1831
|
+
x("div", Kl, [
|
|
1832
|
+
s(i) ? j("", !0) : (d(), g("aside", Gl, [
|
|
1833
|
+
U(ua, {
|
|
1835
1834
|
standalone: "",
|
|
1836
|
-
states: s(
|
|
1837
|
-
progress: s(
|
|
1835
|
+
states: s(u),
|
|
1836
|
+
progress: s(b),
|
|
1838
1837
|
onSelect: $
|
|
1839
1838
|
}, null, 8, ["states", "progress"]),
|
|
1840
|
-
|
|
1839
|
+
R(n.$slots, "aside")
|
|
1841
1840
|
])),
|
|
1842
|
-
|
|
1841
|
+
x("div", {
|
|
1843
1842
|
ref_key: "content",
|
|
1844
|
-
ref:
|
|
1843
|
+
ref: _,
|
|
1845
1844
|
class: "flex min-w-0 flex-col gap-section-gap"
|
|
1846
1845
|
}, [
|
|
1847
|
-
e.form ? (d(),
|
|
1846
|
+
e.form ? (d(), z(it, {
|
|
1848
1847
|
key: 0,
|
|
1849
1848
|
form: e.form,
|
|
1850
1849
|
label: e.fieldLabel,
|
|
1851
|
-
scope:
|
|
1852
|
-
}, null, 8, ["form", "label", "scope"])) :
|
|
1853
|
-
|
|
1850
|
+
scope: _.value
|
|
1851
|
+
}, null, 8, ["form", "label", "scope"])) : j("", !0),
|
|
1852
|
+
R(n.$slots, "default")
|
|
1854
1853
|
], 512)
|
|
1855
1854
|
]),
|
|
1856
|
-
s(
|
|
1855
|
+
s(i) ? (d(), z(da, {
|
|
1857
1856
|
key: 1,
|
|
1858
|
-
states: s(
|
|
1859
|
-
}, null, 8, ["states"])) :
|
|
1857
|
+
states: s(u)
|
|
1858
|
+
}, null, 8, ["states"])) : j("", !0)
|
|
1860
1859
|
]),
|
|
1861
1860
|
_: 2
|
|
1862
1861
|
}, [
|
|
1863
|
-
|
|
1862
|
+
n.$slots.header ? {
|
|
1864
1863
|
name: "header",
|
|
1865
|
-
fn:
|
|
1866
|
-
|
|
1864
|
+
fn: k(() => [
|
|
1865
|
+
R(n.$slots, "header")
|
|
1867
1866
|
]),
|
|
1868
1867
|
key: "0"
|
|
1869
1868
|
} : void 0,
|
|
1870
|
-
|
|
1869
|
+
n.$slots.pager ? {
|
|
1871
1870
|
name: "pager",
|
|
1872
|
-
fn:
|
|
1873
|
-
|
|
1871
|
+
fn: k(() => [
|
|
1872
|
+
R(n.$slots, "pager")
|
|
1874
1873
|
]),
|
|
1875
1874
|
key: "1"
|
|
1876
1875
|
} : void 0,
|
|
1877
|
-
|
|
1876
|
+
n.$slots.notices ? {
|
|
1878
1877
|
name: "notices",
|
|
1879
|
-
fn:
|
|
1880
|
-
|
|
1878
|
+
fn: k(() => [
|
|
1879
|
+
R(n.$slots, "notices")
|
|
1881
1880
|
]),
|
|
1882
1881
|
key: "2"
|
|
1883
1882
|
} : void 0,
|
|
1884
|
-
|
|
1883
|
+
n.$slots.bottom ? {
|
|
1885
1884
|
name: "bottom",
|
|
1886
|
-
fn:
|
|
1887
|
-
|
|
1885
|
+
fn: k(() => [
|
|
1886
|
+
R(n.$slots, "bottom")
|
|
1888
1887
|
]),
|
|
1889
1888
|
key: "3"
|
|
1890
1889
|
} : void 0
|
|
1891
1890
|
]), 1032, ["title", "back"]));
|
|
1892
1891
|
}
|
|
1893
|
-
}),
|
|
1892
|
+
}), Hl = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], jr = /* @__PURE__ */ J({
|
|
1894
1893
|
__name: "NumberCell",
|
|
1895
|
-
props: /* @__PURE__ */
|
|
1894
|
+
props: /* @__PURE__ */ ve({
|
|
1896
1895
|
label: {},
|
|
1897
1896
|
min: { default: 0 },
|
|
1898
1897
|
max: { default: 9999 },
|
|
@@ -1906,13 +1905,13 @@ const xl = {
|
|
|
1906
1905
|
}),
|
|
1907
1906
|
emits: ["update:modelValue"],
|
|
1908
1907
|
setup(l) {
|
|
1909
|
-
const t = l, e =
|
|
1910
|
-
function a(
|
|
1911
|
-
const
|
|
1912
|
-
e.value =
|
|
1908
|
+
const t = l, e = ke(l, "modelValue");
|
|
1909
|
+
function a(i) {
|
|
1910
|
+
const p = i.target.value.replace(/\D/g, "");
|
|
1911
|
+
e.value = p === "" ? null : Math.min(t.max, Math.max(t.min, Number(p)));
|
|
1913
1912
|
}
|
|
1914
|
-
const
|
|
1915
|
-
return (
|
|
1913
|
+
const r = (i) => i.target.value = e.value === null ? "" : String(e.value);
|
|
1914
|
+
return (i, p) => (d(), g("input", {
|
|
1916
1915
|
value: e.value ?? "",
|
|
1917
1916
|
type: "text",
|
|
1918
1917
|
inputmode: "numeric",
|
|
@@ -1921,22 +1920,22 @@ const xl = {
|
|
|
1921
1920
|
disabled: t.disabled,
|
|
1922
1921
|
"aria-invalid": t.invalid || void 0,
|
|
1923
1922
|
placeholder: t.placeholder,
|
|
1924
|
-
class:
|
|
1923
|
+
class: W(["rounded-control bg-fill px-2 py-1 text-right text-body tabular-nums text-content-strong transition-[background-color,box-shadow] duration-motion-fast ease-motion-standard placeholder:text-content-disabled focus:bg-surface-cell focus:outline-none focus:ring-[1.5px] focus:ring-inset focus:ring-border-focus disabled:opacity-45", [t.wide ? "w-28" : "w-16", t.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : ""]]),
|
|
1925
1924
|
onInput: a,
|
|
1926
|
-
onBlur:
|
|
1927
|
-
}, null, 42,
|
|
1925
|
+
onBlur: r
|
|
1926
|
+
}, null, 42, Hl));
|
|
1928
1927
|
}
|
|
1929
|
-
}),
|
|
1930
|
-
function
|
|
1928
|
+
}), Ge = "vue-core:step-draft:";
|
|
1929
|
+
function He(l) {
|
|
1931
1930
|
try {
|
|
1932
1931
|
return (l.storage === "local" ? window.localStorage : window.sessionStorage) ?? null;
|
|
1933
1932
|
} catch {
|
|
1934
1933
|
return null;
|
|
1935
1934
|
}
|
|
1936
1935
|
}
|
|
1937
|
-
function
|
|
1936
|
+
function Wl(l) {
|
|
1938
1937
|
try {
|
|
1939
|
-
const t =
|
|
1938
|
+
const t = He(l)?.getItem(Ge + l.key);
|
|
1940
1939
|
if (!t) return null;
|
|
1941
1940
|
const e = JSON.parse(t);
|
|
1942
1941
|
return !e || e.version !== (l.version ?? 1) || typeof e.values != "object" || e.values === null || typeof e.step != "string" || !Array.isArray(e.passed) ? null : e;
|
|
@@ -1944,308 +1943,308 @@ function _l(l) {
|
|
|
1944
1943
|
return null;
|
|
1945
1944
|
}
|
|
1946
1945
|
}
|
|
1947
|
-
function
|
|
1946
|
+
function Yl(l, t) {
|
|
1948
1947
|
try {
|
|
1949
|
-
const e =
|
|
1948
|
+
const e = He(l);
|
|
1950
1949
|
if (!e) return !1;
|
|
1951
|
-
const a = (
|
|
1952
|
-
return e.setItem(
|
|
1950
|
+
const a = (r, i) => typeof Blob < "u" && i instanceof Blob ? null : i;
|
|
1951
|
+
return e.setItem(Ge + l.key, JSON.stringify({ version: l.version ?? 1, ...t }, a)), !0;
|
|
1953
1952
|
} catch {
|
|
1954
1953
|
return !1;
|
|
1955
1954
|
}
|
|
1956
1955
|
}
|
|
1957
|
-
function
|
|
1956
|
+
function ot(l) {
|
|
1958
1957
|
try {
|
|
1959
|
-
|
|
1958
|
+
He(l)?.removeItem(Ge + l.key);
|
|
1960
1959
|
} catch {
|
|
1961
1960
|
}
|
|
1962
1961
|
}
|
|
1963
|
-
function
|
|
1962
|
+
function Jl(l, t) {
|
|
1964
1963
|
for (const [e, a] of Object.entries(l)) {
|
|
1965
1964
|
if (!(e in t)) continue;
|
|
1966
|
-
const
|
|
1967
|
-
(
|
|
1965
|
+
const r = t[e];
|
|
1966
|
+
(r === null || a === null || a === void 0 || typeof r == typeof a && Array.isArray(r) === Array.isArray(a)) && (l[e] = r);
|
|
1968
1967
|
}
|
|
1969
1968
|
}
|
|
1970
|
-
function
|
|
1971
|
-
const { t: e } =
|
|
1969
|
+
function Or(l, t) {
|
|
1970
|
+
const { t: e } = re(), a = q(() => Dt(t.steps));
|
|
1972
1971
|
if (a.value.length === 0) throw new Error("useStepForm: a flow needs at least one step.");
|
|
1973
|
-
const
|
|
1974
|
-
let
|
|
1975
|
-
const
|
|
1976
|
-
() => a.value.map((
|
|
1977
|
-
const
|
|
1972
|
+
const r = H(a.value[0].name), i = Ye(/* @__PURE__ */ new Set()), p = Ye(/* @__PURE__ */ new Set([a.value[0].name])), u = H(null), b = H(!1), _ = H(0), V = H(!1), $ = H(!1);
|
|
1973
|
+
let n = !1, c = 0;
|
|
1974
|
+
const m = q(() => Math.max(0, a.value.findIndex((f) => f.name === r.value))), h = (f) => f.fields?.filter((E) => l.errors.has(E)).length ?? 0, v = q(
|
|
1975
|
+
() => a.value.map((f, E) => {
|
|
1976
|
+
const G = h(f), F = E === m.value;
|
|
1978
1977
|
return {
|
|
1979
|
-
name:
|
|
1980
|
-
label:
|
|
1981
|
-
position:
|
|
1982
|
-
state:
|
|
1983
|
-
errors:
|
|
1984
|
-
reachable: !
|
|
1978
|
+
name: f.name,
|
|
1979
|
+
label: f.label,
|
|
1980
|
+
position: E + 1,
|
|
1981
|
+
state: F ? "current" : i.has(f.name) && G === 0 ? "done" : "todo",
|
|
1982
|
+
errors: G,
|
|
1983
|
+
reachable: !F && (p.has(f.name) || E < m.value)
|
|
1985
1984
|
};
|
|
1986
1985
|
})
|
|
1987
|
-
),
|
|
1988
|
-
function
|
|
1989
|
-
const
|
|
1990
|
-
|
|
1986
|
+
), y = q(() => v.value[m.value]), S = q(() => v.value.length), L = q(() => m.value === 0), T = q(() => m.value === S.value - 1), C = q(() => b.value || l.submitting.value);
|
|
1987
|
+
function P(f) {
|
|
1988
|
+
const E = a.value[f];
|
|
1989
|
+
E && (u.value = f > m.value ? "forward" : "back", r.value = E.name, p.add(E.name), c = f, V.value = !1);
|
|
1991
1990
|
}
|
|
1992
|
-
|
|
1993
|
-
() => a.value.map((
|
|
1991
|
+
be(
|
|
1992
|
+
() => a.value.map((f) => f.name).join("\0"),
|
|
1994
1993
|
() => {
|
|
1995
|
-
const
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
}),
|
|
1999
|
-
for (const
|
|
1994
|
+
const f = a.value, E = f.findIndex((F) => F.name === r.value), G = E === -1 ? Math.min(c, f.length - 1) : E;
|
|
1995
|
+
r.value = f[G].name, c = G, f.forEach((F, K) => {
|
|
1996
|
+
K > G && (i.delete(F.name), p.delete(F.name));
|
|
1997
|
+
}), p.add(r.value);
|
|
1998
|
+
for (const F of [i, p]) for (const K of [...F]) f.some((I) => I.name === K) || F.delete(K);
|
|
2000
1999
|
}
|
|
2001
2000
|
);
|
|
2002
|
-
function
|
|
2003
|
-
const
|
|
2004
|
-
if (!
|
|
2005
|
-
const
|
|
2006
|
-
return
|
|
2001
|
+
function Y(f) {
|
|
2002
|
+
const E = f.fields;
|
|
2003
|
+
if (!E?.length) return !0;
|
|
2004
|
+
const G = Object.entries(l.errors.all()).filter(([K]) => !E.includes(qt(K))), F = l.check(f.fields);
|
|
2005
|
+
return G.length > 0 && l.errors.set({ ...Object.fromEntries(G), ...l.errors.all() }), F;
|
|
2007
2006
|
}
|
|
2008
|
-
async function
|
|
2009
|
-
if (!
|
|
2010
|
-
return
|
|
2011
|
-
if (!
|
|
2012
|
-
|
|
2007
|
+
async function M(f) {
|
|
2008
|
+
if (!Y(f))
|
|
2009
|
+
return _.value++, !1;
|
|
2010
|
+
if (!f.beforeNext) return !0;
|
|
2011
|
+
b.value = !0;
|
|
2013
2012
|
try {
|
|
2014
|
-
if (await
|
|
2013
|
+
if (await f.beforeNext()) return !0;
|
|
2015
2014
|
} finally {
|
|
2016
|
-
|
|
2015
|
+
b.value = !1;
|
|
2017
2016
|
}
|
|
2018
|
-
return
|
|
2017
|
+
return _.value++, !1;
|
|
2019
2018
|
}
|
|
2020
|
-
async function
|
|
2021
|
-
const
|
|
2022
|
-
if (
|
|
2023
|
-
return
|
|
2024
|
-
if (
|
|
2025
|
-
const
|
|
2026
|
-
|
|
2019
|
+
async function O() {
|
|
2020
|
+
const f = await l.submit(t.submit, t.submitOptions);
|
|
2021
|
+
if (f.status === "saved" || f.status === "saved-refresh-failed")
|
|
2022
|
+
return n = !0, le(), t.onSaved?.(f.value), !0;
|
|
2023
|
+
if (f.status === "failed" && (_.value++, y.value.errors === 0)) {
|
|
2024
|
+
const E = v.value.findIndex((G) => G.errors > 0);
|
|
2025
|
+
E !== -1 && P(E);
|
|
2027
2026
|
}
|
|
2028
2027
|
return !1;
|
|
2029
2028
|
}
|
|
2030
|
-
async function
|
|
2031
|
-
if (
|
|
2032
|
-
const
|
|
2033
|
-
return await
|
|
2029
|
+
async function X() {
|
|
2030
|
+
if (C.value) return !1;
|
|
2031
|
+
const f = a.value[m.value];
|
|
2032
|
+
return await M(f) ? (i.add(f.name), m.value < S.value - 1 ? (P(m.value + 1), !0) : O()) : !1;
|
|
2034
2033
|
}
|
|
2035
|
-
async function
|
|
2036
|
-
if (
|
|
2037
|
-
const
|
|
2038
|
-
if (
|
|
2039
|
-
if (
|
|
2040
|
-
return
|
|
2041
|
-
if (!
|
|
2042
|
-
for (;
|
|
2043
|
-
return
|
|
2034
|
+
async function D(f) {
|
|
2035
|
+
if (C.value) return !1;
|
|
2036
|
+
const E = a.value.findIndex((G) => G.name === f);
|
|
2037
|
+
if (E === -1) return !1;
|
|
2038
|
+
if (E <= m.value)
|
|
2039
|
+
return E < m.value && P(E), !0;
|
|
2040
|
+
if (!p.has(f)) return !1;
|
|
2041
|
+
for (; m.value < E; ) if (!await X()) return !1;
|
|
2042
|
+
return m.value === E;
|
|
2044
2043
|
}
|
|
2045
|
-
const
|
|
2046
|
-
let
|
|
2047
|
-
function
|
|
2048
|
-
if (
|
|
2044
|
+
const Q = t.draft;
|
|
2045
|
+
let te;
|
|
2046
|
+
function ne() {
|
|
2047
|
+
if (te = void 0, !(!Q || n)) {
|
|
2049
2048
|
if (!l.dirty.value) {
|
|
2050
|
-
|
|
2049
|
+
ot(Q), $.value = !1;
|
|
2051
2050
|
return;
|
|
2052
2051
|
}
|
|
2053
|
-
$.value =
|
|
2052
|
+
$.value = Yl(Q, { values: Ft(l.values), step: r.value, passed: [...i] });
|
|
2054
2053
|
}
|
|
2055
2054
|
}
|
|
2056
|
-
function
|
|
2057
|
-
|
|
2055
|
+
function le() {
|
|
2056
|
+
n = !0, clearTimeout(te), te = void 0, $.value = !1, Q && ot(Q);
|
|
2058
2057
|
}
|
|
2059
|
-
if (
|
|
2060
|
-
const
|
|
2061
|
-
if (
|
|
2062
|
-
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2065
|
-
for (const
|
|
2066
|
-
for (const
|
|
2067
|
-
|
|
2058
|
+
if (Q) {
|
|
2059
|
+
const f = Wl(Q);
|
|
2060
|
+
if (f) {
|
|
2061
|
+
Jl(l.values, f.values);
|
|
2062
|
+
const E = a.value.map((G) => G.name);
|
|
2063
|
+
E.includes(f.step) && (r.value = f.step);
|
|
2064
|
+
for (const G of f.passed) E.includes(G) && i.add(G);
|
|
2065
|
+
for (const G of [...i, r.value]) p.add(G);
|
|
2066
|
+
c = m.value, V.value = l.dirty.value, $.value = V.value;
|
|
2068
2067
|
}
|
|
2069
|
-
|
|
2070
|
-
[() => l.values,
|
|
2068
|
+
be(
|
|
2069
|
+
[() => l.values, r, () => [...i].join("\0")],
|
|
2071
2070
|
() => {
|
|
2072
|
-
|
|
2071
|
+
n || (clearTimeout(te), te = setTimeout(ne, 400));
|
|
2073
2072
|
},
|
|
2074
2073
|
{ deep: !0 }
|
|
2075
|
-
),
|
|
2076
|
-
|
|
2074
|
+
), ze(() => {
|
|
2075
|
+
te !== void 0 && (clearTimeout(te), ne());
|
|
2077
2076
|
});
|
|
2078
2077
|
}
|
|
2079
|
-
const { confirmDiscard:
|
|
2080
|
-
|
|
2081
|
-
async function
|
|
2082
|
-
const
|
|
2083
|
-
return
|
|
2078
|
+
const { confirmDiscard: de } = ft(() => !n && l.dirty.value);
|
|
2079
|
+
De(fa, null) && pa(() => (n || le(), !0));
|
|
2080
|
+
async function _e() {
|
|
2081
|
+
const f = await de();
|
|
2082
|
+
return f && le(), f;
|
|
2084
2083
|
}
|
|
2085
|
-
function
|
|
2086
|
-
l.reset(),
|
|
2084
|
+
function ge() {
|
|
2085
|
+
l.reset(), i.clear(), p.clear(), u.value = null, r.value = a.value[0].name, p.add(r.value), c = 0, V.value = !1, le(), n = !1;
|
|
2087
2086
|
}
|
|
2088
|
-
const
|
|
2089
|
-
const
|
|
2090
|
-
return $.value &&
|
|
2091
|
-
}),
|
|
2092
|
-
const
|
|
2093
|
-
return
|
|
2094
|
-
}),
|
|
2087
|
+
const w = q(() => {
|
|
2088
|
+
const f = [e("core.steps.position", { current: m.value + 1, total: S.value }), y.value.label];
|
|
2089
|
+
return $.value && f.push(e("core.steps.draft_saved")), f.join(" · ");
|
|
2090
|
+
}), A = q(() => {
|
|
2091
|
+
const f = a.value[m.value];
|
|
2092
|
+
return f.nextLabel ? f.nextLabel : T.value ? t.submitLabel ?? e("core.actions.save") : e("core.steps.next_named", { step: a.value[m.value + 1].label });
|
|
2093
|
+
}), o = q(() => L.value ? null : a.value[m.value - 1].label);
|
|
2095
2094
|
return {
|
|
2096
|
-
steps:
|
|
2097
|
-
current:
|
|
2098
|
-
index:
|
|
2099
|
-
count:
|
|
2100
|
-
isFirst:
|
|
2101
|
-
isLast:
|
|
2102
|
-
busy:
|
|
2103
|
-
direction:
|
|
2104
|
-
subtitle:
|
|
2105
|
-
nextLabel:
|
|
2106
|
-
backLabel:
|
|
2107
|
-
restored:
|
|
2108
|
-
refusals:
|
|
2095
|
+
steps: v,
|
|
2096
|
+
current: y,
|
|
2097
|
+
index: m,
|
|
2098
|
+
count: S,
|
|
2099
|
+
isFirst: L,
|
|
2100
|
+
isLast: T,
|
|
2101
|
+
busy: C,
|
|
2102
|
+
direction: u,
|
|
2103
|
+
subtitle: w,
|
|
2104
|
+
nextLabel: A,
|
|
2105
|
+
backLabel: o,
|
|
2106
|
+
restored: V,
|
|
2107
|
+
refusals: _,
|
|
2109
2108
|
errors: l.errors,
|
|
2110
2109
|
failure: l.failure,
|
|
2111
|
-
next:
|
|
2112
|
-
back: () =>
|
|
2113
|
-
goTo:
|
|
2114
|
-
restart:
|
|
2115
|
-
confirmDiscard:
|
|
2116
|
-
bindDialog: () => ({ subtitle:
|
|
2110
|
+
next: X,
|
|
2111
|
+
back: () => P(m.value - 1),
|
|
2112
|
+
goTo: D,
|
|
2113
|
+
restart: ge,
|
|
2114
|
+
confirmDiscard: _e,
|
|
2115
|
+
bindDialog: () => ({ subtitle: w.value, primaryLabel: A.value, status: C.value ? "processing" : "idle", beforeDismiss: _e })
|
|
2117
2116
|
};
|
|
2118
2117
|
}
|
|
2119
|
-
const
|
|
2118
|
+
const Zl = {
|
|
2120
2119
|
class: "flex flex-wrap items-center gap-2.5 border-t border-border-separator pt-3.5",
|
|
2121
2120
|
"data-test": "step-navigation"
|
|
2122
|
-
},
|
|
2121
|
+
}, Xl = /* @__PURE__ */ J({
|
|
2123
2122
|
__name: "StepNavigation",
|
|
2124
2123
|
props: {
|
|
2125
2124
|
flow: {}
|
|
2126
2125
|
},
|
|
2127
2126
|
emits: ["cancel"],
|
|
2128
2127
|
setup(l) {
|
|
2129
|
-
const t = l, { t: e } =
|
|
2130
|
-
return (a,
|
|
2131
|
-
t.flow.backLabel.value ? (d(),
|
|
2128
|
+
const t = l, { t: e } = re();
|
|
2129
|
+
return (a, r) => (d(), g("div", Zl, [
|
|
2130
|
+
t.flow.backLabel.value ? (d(), z(ae, {
|
|
2132
2131
|
key: 0,
|
|
2133
2132
|
prominence: "plain",
|
|
2134
2133
|
icon: "arrowLeftSLine",
|
|
2135
2134
|
disabled: t.flow.busy.value,
|
|
2136
2135
|
"data-test": "step-back",
|
|
2137
|
-
onClick:
|
|
2136
|
+
onClick: r[0] || (r[0] = (i) => t.flow.back())
|
|
2138
2137
|
}, {
|
|
2139
|
-
default:
|
|
2140
|
-
|
|
2138
|
+
default: k(() => [
|
|
2139
|
+
Z(B(t.flow.backLabel.value), 1)
|
|
2141
2140
|
]),
|
|
2142
2141
|
_: 1
|
|
2143
|
-
}, 8, ["disabled"])) :
|
|
2144
|
-
|
|
2145
|
-
|
|
2142
|
+
}, 8, ["disabled"])) : j("", !0),
|
|
2143
|
+
r[3] || (r[3] = x("div", { class: "grow" }, null, -1)),
|
|
2144
|
+
U(ae, {
|
|
2146
2145
|
prominence: "plain",
|
|
2147
2146
|
"data-test": "step-cancel",
|
|
2148
|
-
onClick:
|
|
2147
|
+
onClick: r[1] || (r[1] = (i) => a.$emit("cancel"))
|
|
2149
2148
|
}, {
|
|
2150
|
-
default:
|
|
2151
|
-
|
|
2149
|
+
default: k(() => [
|
|
2150
|
+
Z(B(s(e)("core.actions.cancel")), 1)
|
|
2152
2151
|
]),
|
|
2153
2152
|
_: 1
|
|
2154
2153
|
}),
|
|
2155
|
-
|
|
2154
|
+
U(ae, {
|
|
2156
2155
|
prominence: "primary",
|
|
2157
2156
|
processing: t.flow.busy.value,
|
|
2158
2157
|
"data-test": "step-next",
|
|
2159
|
-
onClick:
|
|
2158
|
+
onClick: r[2] || (r[2] = (i) => t.flow.next())
|
|
2160
2159
|
}, {
|
|
2161
|
-
default:
|
|
2162
|
-
|
|
2160
|
+
default: k(() => [
|
|
2161
|
+
Z(B(t.flow.nextLabel.value), 1)
|
|
2163
2162
|
]),
|
|
2164
2163
|
_: 1
|
|
2165
2164
|
}, 8, ["processing"])
|
|
2166
2165
|
]));
|
|
2167
2166
|
}
|
|
2168
|
-
}),
|
|
2167
|
+
}), Ql = ["aria-label"], eo = ["aria-current"], to = ["aria-label"], ao = {
|
|
2169
2168
|
key: 2,
|
|
2170
2169
|
class: "sr-only"
|
|
2171
|
-
},
|
|
2170
|
+
}, lo = {
|
|
2172
2171
|
key: 1,
|
|
2173
2172
|
"data-test": "step-dots",
|
|
2174
2173
|
class: "flex justify-center gap-1.5",
|
|
2175
2174
|
"aria-hidden": "true"
|
|
2176
|
-
},
|
|
2175
|
+
}, oo = ["data-state"], ro = /* @__PURE__ */ J({
|
|
2177
2176
|
__name: "StepProgress",
|
|
2178
2177
|
props: {
|
|
2179
2178
|
flow: {},
|
|
2180
2179
|
progress: { default: "bar" }
|
|
2181
2180
|
},
|
|
2182
2181
|
setup(l) {
|
|
2183
|
-
const t = l, { t: e } =
|
|
2184
|
-
return (a,
|
|
2182
|
+
const t = l, { t: e } = re();
|
|
2183
|
+
return (a, r) => t.progress === "bar" ? (d(), g("ol", {
|
|
2185
2184
|
key: 0,
|
|
2186
2185
|
"aria-label": s(e)("core.steps.label"),
|
|
2187
2186
|
"data-test": "step-bar",
|
|
2188
2187
|
class: "grid min-w-0 gap-2",
|
|
2189
|
-
style:
|
|
2188
|
+
style: zt({ gridTemplateColumns: `repeat(${t.flow.count.value}, minmax(0, 1fr))` })
|
|
2190
2189
|
}, [
|
|
2191
|
-
(d(!0),
|
|
2192
|
-
key:
|
|
2190
|
+
(d(!0), g(ee, null, ce(t.flow.steps.value, (i) => (d(), g("li", {
|
|
2191
|
+
key: i.name,
|
|
2193
2192
|
class: "flex min-w-0",
|
|
2194
|
-
"aria-current":
|
|
2193
|
+
"aria-current": i.state === "current" ? "step" : void 0
|
|
2195
2194
|
}, [
|
|
2196
|
-
(d(),
|
|
2197
|
-
type:
|
|
2198
|
-
disabled:
|
|
2199
|
-
"data-test": `step-${
|
|
2200
|
-
"data-state":
|
|
2201
|
-
class:
|
|
2202
|
-
onClick: (
|
|
2195
|
+
(d(), z(jt(i.reachable ? "button" : "div"), {
|
|
2196
|
+
type: i.reachable ? "button" : void 0,
|
|
2197
|
+
disabled: i.reachable ? t.flow.busy.value : void 0,
|
|
2198
|
+
"data-test": `step-${i.name}`,
|
|
2199
|
+
"data-state": i.errors > 0 ? "error" : i.state,
|
|
2200
|
+
class: W(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left", i.reachable ? "cursor-pointer rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-default" : ""]),
|
|
2201
|
+
onClick: (p) => i.reachable ? t.flow.goTo(i.name) : void 0
|
|
2203
2202
|
}, {
|
|
2204
|
-
default:
|
|
2205
|
-
|
|
2206
|
-
class:
|
|
2203
|
+
default: k(() => [
|
|
2204
|
+
x("span", {
|
|
2205
|
+
class: W(["h-1 rounded-full transition-colors duration-motion-normal", i.errors > 0 ? "bg-status-danger-solid" : i.state === "current" ? "bg-tint" : i.state === "done" ? "bg-control-on" : "bg-fill-strong"]),
|
|
2207
2206
|
"aria-hidden": "true"
|
|
2208
2207
|
}, null, 2),
|
|
2209
|
-
|
|
2210
|
-
class:
|
|
2208
|
+
x("span", {
|
|
2209
|
+
class: W(["flex min-w-0 items-center gap-1.5 text-footnote", i.state === "current" ? "font-bold text-content-strong" : i.state === "done" ? "font-medium text-content-link" : "font-medium text-content-muted"])
|
|
2211
2210
|
}, [
|
|
2212
|
-
|
|
2211
|
+
i.state === "done" ? (d(), z(s(ue), {
|
|
2213
2212
|
key: 0,
|
|
2214
2213
|
name: "checkCustom",
|
|
2215
2214
|
size: 12,
|
|
2216
2215
|
class: "shrink-0"
|
|
2217
|
-
})) :
|
|
2218
|
-
|
|
2219
|
-
class:
|
|
2220
|
-
},
|
|
2221
|
-
|
|
2216
|
+
})) : j("", !0),
|
|
2217
|
+
x("span", {
|
|
2218
|
+
class: W(["truncate", i.reachable ? "group-hover:text-content-link" : ""])
|
|
2219
|
+
}, B(i.position) + ". " + B(i.label), 3),
|
|
2220
|
+
i.errors > 0 ? (d(), g("span", {
|
|
2222
2221
|
key: 1,
|
|
2223
2222
|
"data-test": "step-errors",
|
|
2224
|
-
"aria-label": s(e)("core.form.sections.errors", { count:
|
|
2223
|
+
"aria-label": s(e)("core.form.sections.errors", { count: i.errors }),
|
|
2225
2224
|
class: "min-w-4.5 shrink-0 rounded-full bg-status-danger-solid px-1.5 text-center text-caption font-semibold text-white"
|
|
2226
|
-
},
|
|
2227
|
-
|
|
2225
|
+
}, B(i.errors), 9, to)) : j("", !0),
|
|
2226
|
+
i.state === "done" ? (d(), g("span", ao, B(s(e)("core.steps.done")), 1)) : j("", !0)
|
|
2228
2227
|
], 2)
|
|
2229
2228
|
]),
|
|
2230
2229
|
_: 2
|
|
2231
2230
|
}, 1032, ["type", "disabled", "data-test", "data-state", "class", "onClick"]))
|
|
2232
|
-
], 8,
|
|
2233
|
-
], 12,
|
|
2234
|
-
(d(!0),
|
|
2235
|
-
key:
|
|
2236
|
-
class:
|
|
2237
|
-
"data-state":
|
|
2238
|
-
}, null, 10,
|
|
2231
|
+
], 8, eo))), 128))
|
|
2232
|
+
], 12, Ql)) : (d(), g("div", lo, [
|
|
2233
|
+
(d(!0), g(ee, null, ce(t.flow.steps.value, (i) => (d(), g("span", {
|
|
2234
|
+
key: i.name,
|
|
2235
|
+
class: W(["h-1.5 rounded-full transition-all duration-motion-fast", [i.state === "current" ? "w-4.5" : "w-1.5", i.errors > 0 ? "bg-status-danger-solid" : i.state === "todo" && i.position > t.flow.index.value ? "bg-fill-strong" : "bg-tint"]]),
|
|
2236
|
+
"data-state": i.errors > 0 ? "error" : i.state
|
|
2237
|
+
}, null, 10, oo))), 128))
|
|
2239
2238
|
]));
|
|
2240
2239
|
}
|
|
2241
|
-
}),
|
|
2240
|
+
}), no = ["data-step"], so = {
|
|
2242
2241
|
class: "sr-only",
|
|
2243
2242
|
"aria-live": "polite"
|
|
2244
|
-
},
|
|
2243
|
+
}, io = {
|
|
2245
2244
|
key: 1,
|
|
2246
2245
|
"data-test": "step-restored",
|
|
2247
2246
|
class: "flex items-center gap-2 text-footnote text-content-muted"
|
|
2248
|
-
},
|
|
2247
|
+
}, Mr = /* @__PURE__ */ J({
|
|
2249
2248
|
__name: "StepForm",
|
|
2250
2249
|
props: {
|
|
2251
2250
|
flow: {},
|
|
@@ -2254,156 +2253,967 @@ const Fl = {
|
|
|
2254
2253
|
},
|
|
2255
2254
|
emits: ["cancel"],
|
|
2256
2255
|
setup(l) {
|
|
2257
|
-
const t = l, { t: e } =
|
|
2258
|
-
function
|
|
2259
|
-
for (let
|
|
2260
|
-
const
|
|
2261
|
-
if ((
|
|
2256
|
+
const t = l, { t: e } = re(), a = oe("body"), r = oe("root");
|
|
2257
|
+
function i(p) {
|
|
2258
|
+
for (let u = p.parentElement; u; u = u.parentElement) {
|
|
2259
|
+
const b = getComputedStyle(u).overflowY;
|
|
2260
|
+
if ((b === "auto" || b === "scroll") && u.scrollHeight > u.clientHeight) return p.getBoundingClientRect().top < u.getBoundingClientRect().top;
|
|
2262
2261
|
}
|
|
2263
|
-
return
|
|
2262
|
+
return p.getBoundingClientRect().top < 0;
|
|
2264
2263
|
}
|
|
2265
|
-
return
|
|
2266
|
-
await
|
|
2267
|
-
}),
|
|
2268
|
-
await
|
|
2269
|
-
}), (
|
|
2264
|
+
return be(() => t.flow.current.value.name, async () => {
|
|
2265
|
+
await we(), r.value && i(r.value) && r.value.scrollIntoView?.({ block: "start" }), a.value?.focus({ preventScroll: !0 });
|
|
2266
|
+
}), be(() => t.flow.refusals.value, async () => {
|
|
2267
|
+
await we(), a.value && await Me(a.value);
|
|
2268
|
+
}), (p, u) => (d(), g("div", {
|
|
2270
2269
|
ref_key: "root",
|
|
2271
|
-
ref:
|
|
2270
|
+
ref: r,
|
|
2272
2271
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
2273
2272
|
"data-test": "step-form",
|
|
2274
2273
|
"data-step": t.flow.current.value.name
|
|
2275
2274
|
}, [
|
|
2276
|
-
t.progress !== "none" ? (d(),
|
|
2275
|
+
t.progress !== "none" ? (d(), z(ro, {
|
|
2277
2276
|
key: 0,
|
|
2278
2277
|
flow: t.flow,
|
|
2279
2278
|
progress: t.progress
|
|
2280
|
-
}, null, 8, ["flow", "progress"])) :
|
|
2281
|
-
|
|
2282
|
-
t.flow.restored.value ? (d(),
|
|
2283
|
-
|
|
2284
|
-
|
|
2279
|
+
}, null, 8, ["flow", "progress"])) : j("", !0),
|
|
2280
|
+
x("p", so, B(t.flow.subtitle.value), 1),
|
|
2281
|
+
t.flow.restored.value ? (d(), g("div", io, [
|
|
2282
|
+
x("span", null, B(s(e)("core.steps.restored")), 1),
|
|
2283
|
+
U(ae, {
|
|
2285
2284
|
prominence: "link",
|
|
2286
2285
|
size: "sm",
|
|
2287
|
-
onClick:
|
|
2286
|
+
onClick: u[0] || (u[0] = (b) => t.flow.restart())
|
|
2288
2287
|
}, {
|
|
2289
|
-
default:
|
|
2290
|
-
|
|
2288
|
+
default: k(() => [
|
|
2289
|
+
Z(B(s(e)("core.steps.start_over")), 1)
|
|
2291
2290
|
]),
|
|
2292
2291
|
_: 1
|
|
2293
2292
|
})
|
|
2294
|
-
])) :
|
|
2295
|
-
(d(),
|
|
2293
|
+
])) : j("", !0),
|
|
2294
|
+
(d(), z(it, {
|
|
2296
2295
|
key: t.flow.current.value.name,
|
|
2297
2296
|
form: t.flow
|
|
2298
2297
|
}, null, 8, ["form"])),
|
|
2299
|
-
(d(),
|
|
2298
|
+
(d(), g("form", {
|
|
2300
2299
|
key: t.flow.current.value.name,
|
|
2301
2300
|
ref_key: "body",
|
|
2302
2301
|
ref: a,
|
|
2303
2302
|
tabindex: "-1",
|
|
2304
2303
|
novalidate: "",
|
|
2305
2304
|
"data-test": "step-body",
|
|
2306
|
-
class:
|
|
2307
|
-
onSubmit:
|
|
2305
|
+
class: W(["flex min-w-0 flex-col gap-group-gap outline-none", t.flow.direction.value === "back" ? "animate-step-back" : t.flow.direction.value === "forward" ? "animate-step-in" : ""]),
|
|
2306
|
+
onSubmit: u[1] || (u[1] = he((b) => t.flow.next(), ["prevent"]))
|
|
2308
2307
|
}, [
|
|
2309
|
-
|
|
2310
|
-
|
|
2308
|
+
R(p.$slots, t.flow.current.value.name),
|
|
2309
|
+
u[3] || (u[3] = x("button", {
|
|
2311
2310
|
type: "submit",
|
|
2312
2311
|
class: "sr-only",
|
|
2313
2312
|
tabindex: "-1",
|
|
2314
2313
|
"aria-hidden": "true"
|
|
2315
2314
|
}, null, -1))
|
|
2316
2315
|
], 34)),
|
|
2317
|
-
t.navigation === "inline" ? (d(),
|
|
2316
|
+
t.navigation === "inline" ? (d(), z(Xl, {
|
|
2318
2317
|
key: 2,
|
|
2319
2318
|
flow: t.flow,
|
|
2320
|
-
onCancel:
|
|
2321
|
-
}, null, 8, ["flow"])) :
|
|
2322
|
-
], 8,
|
|
2319
|
+
onCancel: u[2] || (u[2] = (b) => p.$emit("cancel"))
|
|
2320
|
+
}, null, 8, ["flow"])) : j("", !0)
|
|
2321
|
+
], 8, no));
|
|
2322
|
+
}
|
|
2323
|
+
}), rt = Symbol("vue-core.dynamicForm.locale"), uo = { class: "flex w-full flex-col gap-3" }, co = { class: "mb-2 flex items-center justify-between" }, mo = { class: "text-sm font-medium text-muted" }, fo = {
|
|
2324
|
+
key: 0,
|
|
2325
|
+
class: "flex gap-1"
|
|
2326
|
+
}, po = { key: 0 }, vo = /* @__PURE__ */ J({
|
|
2327
|
+
__name: "RepeatField",
|
|
2328
|
+
props: /* @__PURE__ */ me({
|
|
2329
|
+
label: {},
|
|
2330
|
+
labelHidden: { type: Boolean },
|
|
2331
|
+
hint: {},
|
|
2332
|
+
error: {},
|
|
2333
|
+
required: { type: Boolean },
|
|
2334
|
+
editable: { type: Boolean },
|
|
2335
|
+
disabled: { type: Boolean },
|
|
2336
|
+
lockedReason: {},
|
|
2337
|
+
presentation: {},
|
|
2338
|
+
name: {},
|
|
2339
|
+
fields: {},
|
|
2340
|
+
modelValue: {},
|
|
2341
|
+
locales: {},
|
|
2342
|
+
defaultLocale: {},
|
|
2343
|
+
errors: {},
|
|
2344
|
+
resources: {},
|
|
2345
|
+
addLabel: {},
|
|
2346
|
+
localeMode: {}
|
|
2347
|
+
}, { ...pe, modelValue: () => [], locales: void 0, defaultLocale: void 0, errors: () => ({}), resources: void 0, addLabel: void 0, localeMode: "perField" }),
|
|
2348
|
+
emits: ["update:modelValue"],
|
|
2349
|
+
setup(l, { emit: t }) {
|
|
2350
|
+
const e = l, a = t, { t: r } = re(), { editable: i } = qe(e);
|
|
2351
|
+
let p = 0;
|
|
2352
|
+
const u = H([]);
|
|
2353
|
+
be(() => e.modelValue.length, (m) => {
|
|
2354
|
+
for (; u.value.length < m; ) u.value.push(p++);
|
|
2355
|
+
u.value.length = m;
|
|
2356
|
+
}, { immediate: !0 });
|
|
2357
|
+
const b = (m) => a("update:modelValue", m), _ = () => {
|
|
2358
|
+
u.value.push(p++), b([...e.modelValue, {}]);
|
|
2359
|
+
}, V = (m) => {
|
|
2360
|
+
u.value.splice(m, 1), b(e.modelValue.filter((h, v) => v !== m));
|
|
2361
|
+
};
|
|
2362
|
+
function $(m, h) {
|
|
2363
|
+
const v = m + h;
|
|
2364
|
+
if (v < 0 || v >= e.modelValue.length) return;
|
|
2365
|
+
const y = [...e.modelValue];
|
|
2366
|
+
[y[m], y[v]] = [y[v], y[m]], [u.value[m], u.value[v]] = [u.value[v], u.value[m]], b(y);
|
|
2367
|
+
}
|
|
2368
|
+
const n = (m, h) => b(e.modelValue.map((v, y) => y === m ? h : { ...v }));
|
|
2369
|
+
function c(m) {
|
|
2370
|
+
const h = `${m}.`;
|
|
2371
|
+
return Object.fromEntries(Object.entries(e.errors).filter(([v]) => v.startsWith(h)).map(([v, y]) => [v.slice(h.length), y]));
|
|
2372
|
+
}
|
|
2373
|
+
return (m, h) => (d(), z(ye, N(s(fe)(e), {
|
|
2374
|
+
"row-layout": "stacked",
|
|
2375
|
+
value: null,
|
|
2376
|
+
error: e.error ?? e.errors[""]?.[0]
|
|
2377
|
+
}), {
|
|
2378
|
+
default: k(() => [
|
|
2379
|
+
x("div", uo, [
|
|
2380
|
+
(d(!0), g(ee, null, ce(e.modelValue, (v, y) => (d(), g("div", {
|
|
2381
|
+
key: u.value[y],
|
|
2382
|
+
class: "rounded-md border border-border p-3",
|
|
2383
|
+
"data-repeat-row": ""
|
|
2384
|
+
}, [
|
|
2385
|
+
x("div", co, [
|
|
2386
|
+
x("span", mo, B(s(r)("core.form.dynamic.repeat.row", { n: y + 1 })), 1),
|
|
2387
|
+
s(i) && !e.disabled ? (d(), g("div", fo, [
|
|
2388
|
+
U(ae, N({
|
|
2389
|
+
size: "xs",
|
|
2390
|
+
prominence: "plain",
|
|
2391
|
+
icon: "arrowUpSLine",
|
|
2392
|
+
disabled: y === 0
|
|
2393
|
+
}, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.up", { n: y + 1 }) }, {
|
|
2394
|
+
"data-move": "up",
|
|
2395
|
+
onClick: (S) => $(y, -1)
|
|
2396
|
+
}), null, 16, ["disabled", "onClick"]),
|
|
2397
|
+
U(ae, N({
|
|
2398
|
+
size: "xs",
|
|
2399
|
+
prominence: "plain",
|
|
2400
|
+
icon: "arrowDownSLine",
|
|
2401
|
+
disabled: y === e.modelValue.length - 1
|
|
2402
|
+
}, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.down", { n: y + 1 }) }, {
|
|
2403
|
+
"data-move": "down",
|
|
2404
|
+
onClick: (S) => $(y, 1)
|
|
2405
|
+
}), null, 16, ["disabled", "onClick"]),
|
|
2406
|
+
U(ae, N({
|
|
2407
|
+
size: "xs",
|
|
2408
|
+
prominence: "plain",
|
|
2409
|
+
tone: "critical",
|
|
2410
|
+
icon: "deleteBin2Line"
|
|
2411
|
+
}, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.remove", { n: y + 1 }) }, {
|
|
2412
|
+
"data-remove": "",
|
|
2413
|
+
onClick: (S) => V(y)
|
|
2414
|
+
}), null, 16, ["onClick"])
|
|
2415
|
+
])) : j("", !0)
|
|
2416
|
+
]),
|
|
2417
|
+
U(Io, {
|
|
2418
|
+
schema: { fields: e.fields },
|
|
2419
|
+
"model-value": v,
|
|
2420
|
+
locales: e.locales,
|
|
2421
|
+
"default-locale": e.defaultLocale,
|
|
2422
|
+
errors: c(y),
|
|
2423
|
+
resources: e.resources,
|
|
2424
|
+
readonly: !s(i) || e.disabled,
|
|
2425
|
+
"locale-mode": e.localeMode,
|
|
2426
|
+
"onUpdate:modelValue": (S) => n(y, S)
|
|
2427
|
+
}, null, 8, ["schema", "model-value", "locales", "default-locale", "errors", "resources", "readonly", "locale-mode", "onUpdate:modelValue"])
|
|
2428
|
+
]))), 128)),
|
|
2429
|
+
s(i) && !e.disabled ? (d(), g("div", po, [
|
|
2430
|
+
U(ae, {
|
|
2431
|
+
icon: "addLine",
|
|
2432
|
+
"data-add": "",
|
|
2433
|
+
onClick: _
|
|
2434
|
+
}, {
|
|
2435
|
+
default: k(() => [
|
|
2436
|
+
Z(B(e.addLabel ?? s(r)("core.form.dynamic.repeat.add")), 1)
|
|
2437
|
+
]),
|
|
2438
|
+
_: 1
|
|
2439
|
+
})
|
|
2440
|
+
])) : j("", !0)
|
|
2441
|
+
])
|
|
2442
|
+
]),
|
|
2443
|
+
_: 1
|
|
2444
|
+
}, 16, ["error"]));
|
|
2445
|
+
}
|
|
2446
|
+
}), bo = { class: "flex flex-col gap-3 p-4" }, yo = ["placeholder", "aria-label"], go = {
|
|
2447
|
+
key: 0,
|
|
2448
|
+
role: "alert",
|
|
2449
|
+
class: "text-sm text-critical"
|
|
2450
|
+
}, ho = {
|
|
2451
|
+
key: 1,
|
|
2452
|
+
class: "text-sm text-muted"
|
|
2453
|
+
}, ko = {
|
|
2454
|
+
key: 2,
|
|
2455
|
+
class: "text-sm text-muted"
|
|
2456
|
+
}, _o = {
|
|
2457
|
+
key: 3,
|
|
2458
|
+
class: "grid grid-cols-3 gap-2 sm:grid-cols-4"
|
|
2459
|
+
}, xo = ["onClick"], wo = ["src", "alt"], $o = {
|
|
2460
|
+
key: 0,
|
|
2461
|
+
class: "truncate text-xs"
|
|
2462
|
+
}, Vo = { class: "flex justify-between" }, Vt = /* @__PURE__ */ J({
|
|
2463
|
+
__name: "ResourcePickerList",
|
|
2464
|
+
props: {
|
|
2465
|
+
source: {},
|
|
2466
|
+
accept: {}
|
|
2467
|
+
},
|
|
2468
|
+
emits: ["select"],
|
|
2469
|
+
setup(l, { emit: t }) {
|
|
2470
|
+
const e = l, a = t, { t: r } = re(), i = H(""), p = H(1), u = H(1), b = H([]), _ = H("loading");
|
|
2471
|
+
let V = null, $;
|
|
2472
|
+
async function n() {
|
|
2473
|
+
V?.abort();
|
|
2474
|
+
const h = V = new AbortController();
|
|
2475
|
+
_.value = "loading";
|
|
2476
|
+
try {
|
|
2477
|
+
const v = await e.source.list({ search: i.value.trim(), page: p.value, pageSize: 24, ...e.accept !== void 0 ? { accept: e.accept } : {} }, { signal: h.signal });
|
|
2478
|
+
if (h.signal.aborted) return;
|
|
2479
|
+
b.value = v.rows, u.value = Math.max(1, v.lastPage), _.value = "loaded";
|
|
2480
|
+
} catch {
|
|
2481
|
+
h.signal.aborted || (_.value = "failed");
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
function c() {
|
|
2485
|
+
clearTimeout($), $ = setTimeout(() => {
|
|
2486
|
+
p.value = 1, n();
|
|
2487
|
+
}, 250);
|
|
2488
|
+
}
|
|
2489
|
+
function m(h) {
|
|
2490
|
+
p.value += h, n();
|
|
2491
|
+
}
|
|
2492
|
+
return dt(() => void n()), ze(() => {
|
|
2493
|
+
clearTimeout($), V?.abort();
|
|
2494
|
+
}), (h, v) => (d(), g("div", bo, [
|
|
2495
|
+
ct(x("input", {
|
|
2496
|
+
"onUpdate:modelValue": v[0] || (v[0] = (y) => i.value = y),
|
|
2497
|
+
type: "search",
|
|
2498
|
+
class: "w-full rounded-md border border-border bg-surface px-3 py-2 text-sm",
|
|
2499
|
+
placeholder: s(r)("core.form.dynamic.resource.search"),
|
|
2500
|
+
"aria-label": s(r)("core.form.dynamic.resource.search"),
|
|
2501
|
+
onInput: c
|
|
2502
|
+
}, null, 40, yo), [
|
|
2503
|
+
[mt, i.value]
|
|
2504
|
+
]),
|
|
2505
|
+
_.value === "failed" ? (d(), g("p", go, B(s(r)("core.form.dynamic.resource.failed")), 1)) : _.value === "loading" && b.value.length === 0 ? (d(), g("p", ho, B(s(r)("core.form.dynamic.resource.loading")), 1)) : b.value.length === 0 ? (d(), g("p", ko, B(s(r)("core.form.dynamic.resource.empty")), 1)) : (d(), g("ul", _o, [
|
|
2506
|
+
(d(!0), g(ee, null, ce(b.value, (y) => (d(), g("li", {
|
|
2507
|
+
key: y.id
|
|
2508
|
+
}, [
|
|
2509
|
+
x("button", {
|
|
2510
|
+
type: "button",
|
|
2511
|
+
class: "flex w-full flex-col gap-1 rounded-md border border-border p-1 text-left hover:border-accent focus-visible:outline-2",
|
|
2512
|
+
onClick: (S) => a("select", y)
|
|
2513
|
+
}, [
|
|
2514
|
+
x("img", {
|
|
2515
|
+
src: s(Ke)(e.source, y.id),
|
|
2516
|
+
alt: y.name ?? "",
|
|
2517
|
+
class: "aspect-square w-full rounded object-cover",
|
|
2518
|
+
loading: "lazy"
|
|
2519
|
+
}, null, 8, wo),
|
|
2520
|
+
y.name ? (d(), g("span", $o, B(y.name), 1)) : j("", !0)
|
|
2521
|
+
], 8, xo)
|
|
2522
|
+
]))), 128))
|
|
2523
|
+
])),
|
|
2524
|
+
x("div", Vo, [
|
|
2525
|
+
U(ae, {
|
|
2526
|
+
prominence: "plain",
|
|
2527
|
+
disabled: p.value <= 1,
|
|
2528
|
+
onClick: v[1] || (v[1] = (y) => m(-1))
|
|
2529
|
+
}, {
|
|
2530
|
+
default: k(() => [
|
|
2531
|
+
Z(B(s(r)("core.form.dynamic.resource.previous")), 1)
|
|
2532
|
+
]),
|
|
2533
|
+
_: 1
|
|
2534
|
+
}, 8, ["disabled"]),
|
|
2535
|
+
U(ae, {
|
|
2536
|
+
prominence: "plain",
|
|
2537
|
+
disabled: p.value >= u.value,
|
|
2538
|
+
onClick: v[2] || (v[2] = (y) => m(1))
|
|
2539
|
+
}, {
|
|
2540
|
+
default: k(() => [
|
|
2541
|
+
Z(B(s(r)("core.form.dynamic.resource.next")), 1)
|
|
2542
|
+
]),
|
|
2543
|
+
_: 1
|
|
2544
|
+
}, 8, ["disabled"])
|
|
2545
|
+
])
|
|
2546
|
+
]));
|
|
2547
|
+
}
|
|
2548
|
+
}), Co = ["id"], So = ["src"], Fo = {
|
|
2549
|
+
key: 0,
|
|
2550
|
+
class: "mt-1 flex justify-between"
|
|
2551
|
+
}, qo = {
|
|
2552
|
+
key: 0,
|
|
2553
|
+
class: "text-sm text-muted"
|
|
2554
|
+
}, Bo = /* @__PURE__ */ J({
|
|
2555
|
+
__name: "ResourceField",
|
|
2556
|
+
props: /* @__PURE__ */ me({
|
|
2557
|
+
label: {},
|
|
2558
|
+
labelHidden: { type: Boolean },
|
|
2559
|
+
hint: {},
|
|
2560
|
+
error: {},
|
|
2561
|
+
required: { type: Boolean },
|
|
2562
|
+
editable: { type: Boolean },
|
|
2563
|
+
disabled: { type: Boolean },
|
|
2564
|
+
lockedReason: {},
|
|
2565
|
+
presentation: {},
|
|
2566
|
+
name: {},
|
|
2567
|
+
source: {},
|
|
2568
|
+
multiple: { type: Boolean },
|
|
2569
|
+
accept: {},
|
|
2570
|
+
modelValue: {}
|
|
2571
|
+
}, { ...pe, multiple: !1, accept: void 0, modelValue: void 0 }),
|
|
2572
|
+
emits: ["update:modelValue"],
|
|
2573
|
+
setup(l, { emit: t }) {
|
|
2574
|
+
const e = l, a = t, { t: r } = re(), { editable: i } = qe(e), p = ht(), u = q(() => Array.isArray(e.modelValue) ? [...e.modelValue] : e.modelValue === null || e.modelValue === void 0 || e.modelValue === "" ? [] : [e.modelValue]);
|
|
2575
|
+
function b($) {
|
|
2576
|
+
a("update:modelValue", e.multiple ? $ : $[0] ?? null);
|
|
2577
|
+
}
|
|
2578
|
+
async function _($) {
|
|
2579
|
+
const n = await p.pick({ title: e.label ?? r("core.form.dynamic.resource.title") });
|
|
2580
|
+
if (!n) return;
|
|
2581
|
+
const c = [...u.value];
|
|
2582
|
+
e.multiple && $ === void 0 ? c.push(n.id) : c[$ ?? 0] = n.id, b(c);
|
|
2583
|
+
}
|
|
2584
|
+
const V = ($) => b(u.value.filter((n, c) => c !== $));
|
|
2585
|
+
return ($, n) => (d(), z(ye, N(s(fe)(e), {
|
|
2586
|
+
"row-layout": "stacked",
|
|
2587
|
+
value: u.value.length > 0 ? u.value.join(", ") : null
|
|
2588
|
+
}), {
|
|
2589
|
+
default: k(({ id: c }) => [
|
|
2590
|
+
x("div", {
|
|
2591
|
+
id: c,
|
|
2592
|
+
class: "flex flex-wrap items-start gap-2"
|
|
2593
|
+
}, [
|
|
2594
|
+
(d(!0), g(ee, null, ce(u.value, (m, h) => (d(), g("div", {
|
|
2595
|
+
key: `${m}-${h}`,
|
|
2596
|
+
class: "relative w-24",
|
|
2597
|
+
"data-resource": ""
|
|
2598
|
+
}, [
|
|
2599
|
+
x("img", {
|
|
2600
|
+
src: s(Ke)(e.source, m),
|
|
2601
|
+
alt: "",
|
|
2602
|
+
class: "aspect-square w-full rounded-md border border-border object-cover"
|
|
2603
|
+
}, null, 8, So),
|
|
2604
|
+
s(i) && !e.disabled ? (d(), g("div", Fo, [
|
|
2605
|
+
U(ae, {
|
|
2606
|
+
size: "xs",
|
|
2607
|
+
prominence: "plain",
|
|
2608
|
+
onClick: (v) => _(h)
|
|
2609
|
+
}, {
|
|
2610
|
+
default: k(() => [
|
|
2611
|
+
Z(B(s(r)("core.form.dynamic.resource.change")), 1)
|
|
2612
|
+
]),
|
|
2613
|
+
_: 1
|
|
2614
|
+
}, 8, ["onClick"]),
|
|
2615
|
+
U(ae, N({
|
|
2616
|
+
size: "xs",
|
|
2617
|
+
prominence: "plain",
|
|
2618
|
+
tone: "critical",
|
|
2619
|
+
icon: "close"
|
|
2620
|
+
}, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.resource.remove") }, {
|
|
2621
|
+
onClick: (v) => V(h)
|
|
2622
|
+
}), null, 16, ["onClick"])
|
|
2623
|
+
])) : j("", !0)
|
|
2624
|
+
]))), 128)),
|
|
2625
|
+
u.value.length === 0 && !s(i) ? (d(), g("p", qo, B(s(r)("core.form.dynamic.resource.none")), 1)) : j("", !0),
|
|
2626
|
+
s(i) && !e.disabled && (e.multiple || u.value.length === 0) ? (d(), z(ae, {
|
|
2627
|
+
key: 1,
|
|
2628
|
+
icon: "addLine",
|
|
2629
|
+
onClick: n[0] || (n[0] = (m) => _())
|
|
2630
|
+
}, {
|
|
2631
|
+
default: k(() => [
|
|
2632
|
+
Z(B(s(r)("core.form.dynamic.resource.choose")), 1)
|
|
2633
|
+
]),
|
|
2634
|
+
_: 1
|
|
2635
|
+
})) : j("", !0)
|
|
2636
|
+
], 8, Co),
|
|
2637
|
+
U(kt, { picker: s(p) }, {
|
|
2638
|
+
default: k(({ select: m }) => [
|
|
2639
|
+
U(Vt, {
|
|
2640
|
+
source: e.source,
|
|
2641
|
+
accept: e.accept,
|
|
2642
|
+
onSelect: m
|
|
2643
|
+
}, null, 8, ["source", "accept", "onSelect"])
|
|
2644
|
+
]),
|
|
2645
|
+
_: 1
|
|
2646
|
+
}, 8, ["picker"])
|
|
2647
|
+
]),
|
|
2648
|
+
_: 1
|
|
2649
|
+
}, 16, ["value"]));
|
|
2650
|
+
}
|
|
2651
|
+
}), Lo = { class: "w-full rounded-md border border-border bg-surface" }, To = ["aria-label"], Do = ["data-tool", "aria-label", "title", "aria-pressed", "disabled", "onClick"], zo = ["aria-label", "placeholder"], jo = {
|
|
2652
|
+
key: 2,
|
|
2653
|
+
role: "alert",
|
|
2654
|
+
class: "p-3 text-sm text-critical"
|
|
2655
|
+
}, Oo = ["id"], nt = /* @__PURE__ */ J({
|
|
2656
|
+
__name: "RichTextField",
|
|
2657
|
+
props: /* @__PURE__ */ me({
|
|
2658
|
+
label: {},
|
|
2659
|
+
labelHidden: { type: Boolean },
|
|
2660
|
+
hint: {},
|
|
2661
|
+
error: {},
|
|
2662
|
+
required: { type: Boolean },
|
|
2663
|
+
editable: { type: Boolean },
|
|
2664
|
+
disabled: { type: Boolean },
|
|
2665
|
+
lockedReason: {},
|
|
2666
|
+
presentation: {},
|
|
2667
|
+
name: {},
|
|
2668
|
+
modelValue: {},
|
|
2669
|
+
images: {},
|
|
2670
|
+
video: { type: Boolean },
|
|
2671
|
+
placeholder: {}
|
|
2672
|
+
}, { ...pe, modelValue: "", images: void 0, video: !1, placeholder: void 0 }),
|
|
2673
|
+
emits: ["update:modelValue"],
|
|
2674
|
+
setup(l, { emit: t }) {
|
|
2675
|
+
const e = l, a = t, { t: r } = re(), { editable: i } = qe(e), p = oe("host"), u = H(!1), b = H(!1), _ = ht(), V = H(null), $ = H("");
|
|
2676
|
+
let n = null, c = "", m = null;
|
|
2677
|
+
const h = H({}), v = () => n ? n.getText().trim() === "" && !n.root.querySelector("img, iframe") ? "" : n.getSemanticHTML() : "";
|
|
2678
|
+
function y(M) {
|
|
2679
|
+
n && (n.setContents(n.clipboard.convert({ html: M }), "silent"), c = v());
|
|
2680
|
+
}
|
|
2681
|
+
dt(async () => {
|
|
2682
|
+
try {
|
|
2683
|
+
const { default: M } = await import("quill");
|
|
2684
|
+
if (!p.value) return;
|
|
2685
|
+
n = new M(p.value, { modules: { toolbar: !1 }, placeholder: e.placeholder, readOnly: !i.value || e.disabled });
|
|
2686
|
+
} catch {
|
|
2687
|
+
u.value = !0;
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2690
|
+
y(e.modelValue), n.on("text-change", (M, O, X) => {
|
|
2691
|
+
c = v(), X === "user" && a("update:modelValue", c);
|
|
2692
|
+
}), n.on("selection-change", (M) => {
|
|
2693
|
+
M && (m = M, h.value = n?.getFormat(M) ?? {});
|
|
2694
|
+
}), b.value = !0;
|
|
2695
|
+
}), ze(() => n?.disable()), be(() => e.modelValue, (M) => {
|
|
2696
|
+
M !== c && y(M);
|
|
2697
|
+
}), be(() => !i.value || e.disabled, (M) => n?.enable(!M));
|
|
2698
|
+
const S = (M, O) => {
|
|
2699
|
+
if (!n) return;
|
|
2700
|
+
n.focus();
|
|
2701
|
+
const X = n.getFormat();
|
|
2702
|
+
n.format(M, X[M] === O ? !1 : O, "user"), h.value = n.getFormat();
|
|
2703
|
+
}, L = (M, O = !0) => h.value[M] === O;
|
|
2704
|
+
function T(M) {
|
|
2705
|
+
m = n?.getSelection() ?? m, $.value = "", V.value = M;
|
|
2706
|
+
}
|
|
2707
|
+
async function C() {
|
|
2708
|
+
const M = $.value.trim(), O = V.value;
|
|
2709
|
+
if (V.value = null, !n || M === "" || !O) return;
|
|
2710
|
+
n.focus(), m && n.setSelection(m);
|
|
2711
|
+
const X = m ?? { index: n.getLength() };
|
|
2712
|
+
O === "link" ? n.format("link", M, "user") : n.insertEmbed(X.index, "video", M, "user");
|
|
2713
|
+
}
|
|
2714
|
+
async function P() {
|
|
2715
|
+
m = n?.getSelection() ?? m;
|
|
2716
|
+
const M = await _.pick({ title: r("core.form.dynamic.rich_text.image") });
|
|
2717
|
+
if (!M || !n || !e.images) return;
|
|
2718
|
+
const O = { thumbnail: e.images.image ?? e.images.thumbnail };
|
|
2719
|
+
n.insertEmbed(m?.index ?? n.getLength(), "image", Ke(O, M.id), "user");
|
|
2720
|
+
}
|
|
2721
|
+
const Y = q(() => [
|
|
2722
|
+
{ key: "heading", label: r("core.form.dynamic.rich_text.heading"), text: "H", on: L("header", 2), run: () => S("header", 2) },
|
|
2723
|
+
{ key: "bold", label: r("core.form.dynamic.rich_text.bold"), text: "B", on: L("bold"), run: () => S("bold", !0) },
|
|
2724
|
+
{ key: "italic", label: r("core.form.dynamic.rich_text.italic"), text: "I", on: L("italic"), run: () => S("italic", !0) },
|
|
2725
|
+
{ key: "bullets", label: r("core.form.dynamic.rich_text.bullets"), text: "•", on: L("list", "bullet"), run: () => S("list", "bullet") },
|
|
2726
|
+
{ key: "numbers", label: r("core.form.dynamic.rich_text.numbers"), text: "1.", on: L("list", "ordered"), run: () => S("list", "ordered") },
|
|
2727
|
+
{ key: "link", label: r("core.form.dynamic.rich_text.link"), text: "↗", on: typeof h.value.link == "string", run: () => T("link") },
|
|
2728
|
+
...e.images ? [{ key: "image", label: r("core.form.dynamic.rich_text.image"), text: "▣", on: !1, run: () => void P() }] : [],
|
|
2729
|
+
...e.video ? [{ key: "video", label: r("core.form.dynamic.rich_text.video"), text: "▶", on: !1, run: () => T("video") }] : []
|
|
2730
|
+
]);
|
|
2731
|
+
return (M, O) => (d(), z(ye, N(s(fe)(e), {
|
|
2732
|
+
"row-layout": "stacked",
|
|
2733
|
+
value: null
|
|
2734
|
+
}), {
|
|
2735
|
+
default: k(({ id: X }) => [
|
|
2736
|
+
x("div", Lo, [
|
|
2737
|
+
s(i) && !e.disabled ? (d(), g("div", {
|
|
2738
|
+
key: 0,
|
|
2739
|
+
class: "flex flex-wrap gap-1 border-b border-border p-1",
|
|
2740
|
+
role: "toolbar",
|
|
2741
|
+
"aria-label": e.label
|
|
2742
|
+
}, [
|
|
2743
|
+
(d(!0), g(ee, null, ce(Y.value, (D) => (d(), g("button", {
|
|
2744
|
+
key: D.key,
|
|
2745
|
+
type: "button",
|
|
2746
|
+
"data-tool": D.key,
|
|
2747
|
+
"aria-label": D.label,
|
|
2748
|
+
title: D.label,
|
|
2749
|
+
"aria-pressed": D.on,
|
|
2750
|
+
disabled: !b.value,
|
|
2751
|
+
class: "min-w-8 rounded px-2 py-1 text-sm font-medium hover:bg-surface-muted aria-pressed:bg-surface-muted",
|
|
2752
|
+
onMousedown: O[0] || (O[0] = he(() => {
|
|
2753
|
+
}, ["prevent"])),
|
|
2754
|
+
onClick: D.run
|
|
2755
|
+
}, B(D.text), 41, Do))), 128))
|
|
2756
|
+
], 8, To)) : j("", !0),
|
|
2757
|
+
V.value ? (d(), g("form", {
|
|
2758
|
+
key: 1,
|
|
2759
|
+
class: "flex gap-2 border-b border-border p-2",
|
|
2760
|
+
onSubmit: he(C, ["prevent"])
|
|
2761
|
+
}, [
|
|
2762
|
+
ct(x("input", {
|
|
2763
|
+
"onUpdate:modelValue": O[1] || (O[1] = (D) => $.value = D),
|
|
2764
|
+
type: "url",
|
|
2765
|
+
class: "w-full rounded-md border border-border bg-surface px-2 py-1 text-sm",
|
|
2766
|
+
"aria-label": V.value === "link" ? s(r)("core.form.dynamic.rich_text.link_prompt") : s(r)("core.form.dynamic.rich_text.video_prompt"),
|
|
2767
|
+
placeholder: V.value === "link" ? s(r)("core.form.dynamic.rich_text.link_prompt") : s(r)("core.form.dynamic.rich_text.video_prompt")
|
|
2768
|
+
}, null, 8, zo), [
|
|
2769
|
+
[mt, $.value]
|
|
2770
|
+
]),
|
|
2771
|
+
U(ae, {
|
|
2772
|
+
type: "submit",
|
|
2773
|
+
size: "sm"
|
|
2774
|
+
}, {
|
|
2775
|
+
default: k(() => [...O[2] || (O[2] = [
|
|
2776
|
+
Z("OK", -1)
|
|
2777
|
+
])]),
|
|
2778
|
+
_: 1
|
|
2779
|
+
})
|
|
2780
|
+
], 32)) : j("", !0),
|
|
2781
|
+
u.value ? (d(), g("p", jo, B(s(r)("core.form.dynamic.rich_text.failed")), 1)) : j("", !0),
|
|
2782
|
+
x("div", {
|
|
2783
|
+
id: X,
|
|
2784
|
+
ref_key: "host",
|
|
2785
|
+
ref: p,
|
|
2786
|
+
class: W(["min-h-32 px-3 py-2 text-sm [&_.ql-clipboard]:absolute [&_.ql-clipboard]:-left-[100000px] [&_.ql-editor]:min-h-28 [&_.ql-editor]:outline-none [&_.ql-editor_h2]:text-lg [&_.ql-editor_h2]:font-semibold [&_.ql-editor_img]:max-w-full [&_.ql-editor_ol]:pl-6 [&_.ql-editor_li[data-list=bullet]]:list-disc [&_.ql-editor_li[data-list=ordered]]:list-decimal [&_.ql-editor_a]:text-accent [&_.ql-editor_a]:underline [&_.ql-ui]:hidden [&_.ql-editor.ql-blank::before]:text-muted [&_.ql-editor.ql-blank::before]:content-[attr(data-placeholder)]", { hidden: u.value }])
|
|
2787
|
+
}, null, 10, Oo)
|
|
2788
|
+
]),
|
|
2789
|
+
e.images ? (d(), z(kt, {
|
|
2790
|
+
key: 0,
|
|
2791
|
+
picker: s(_)
|
|
2792
|
+
}, {
|
|
2793
|
+
default: k(({ select: D }) => [
|
|
2794
|
+
U(Vt, {
|
|
2795
|
+
source: e.images,
|
|
2796
|
+
accept: "image/*",
|
|
2797
|
+
onSelect: D
|
|
2798
|
+
}, null, 8, ["source", "onSelect"])
|
|
2799
|
+
]),
|
|
2800
|
+
_: 1
|
|
2801
|
+
}, 8, ["picker"])) : j("", !0)
|
|
2802
|
+
]),
|
|
2803
|
+
_: 1
|
|
2804
|
+
}, 16));
|
|
2323
2805
|
}
|
|
2324
2806
|
});
|
|
2807
|
+
function $e(l) {
|
|
2808
|
+
return l == null ? !0 : typeof l == "string" ? l.trim() === "" : Array.isArray(l) ? l.length === 0 : typeof l == "object" ? Object.values(l).every($e) : !1;
|
|
2809
|
+
}
|
|
2810
|
+
function Te(l, t) {
|
|
2811
|
+
if (l === t) return !0;
|
|
2812
|
+
if (typeof l != "object" || typeof t != "object" || l === null || t === null || Array.isArray(l) !== Array.isArray(t)) return !1;
|
|
2813
|
+
const e = l, a = t, r = Object.keys(e);
|
|
2814
|
+
return r.length === Object.keys(a).length && r.every((i) => i in a && Te(e[i], a[i]));
|
|
2815
|
+
}
|
|
2816
|
+
function Mo(l, t) {
|
|
2817
|
+
const e = t[l.field];
|
|
2818
|
+
return "eq" in l ? Te(e, l.eq) : "ne" in l ? !Te(e, l.ne) : "in" in l ? Array.isArray(l.in) ? l.in.some((a) => Te(e, a)) : null : "empty" in l ? $e(e) : "not_empty" in l ? !$e(e) : null;
|
|
2819
|
+
}
|
|
2820
|
+
function Ct(l, t) {
|
|
2821
|
+
if (!l) return !0;
|
|
2822
|
+
const e = (l.all ?? l.any ?? []).map((a) => Mo(a, t)).filter((a) => a !== null);
|
|
2823
|
+
return e.length === 0 ? !0 : l.all ? e.every(Boolean) : e.some(Boolean);
|
|
2824
|
+
}
|
|
2825
|
+
const Ro = {
|
|
2826
|
+
class: "flex w-full flex-col gap-4",
|
|
2827
|
+
"data-dynamic-form": ""
|
|
2828
|
+
}, Uo = ["aria-label"], Eo = ["id", "aria-selected", "data-locale", "data-error", "onClick"], Io = /* @__PURE__ */ J({
|
|
2829
|
+
__name: "DynamicForm",
|
|
2830
|
+
props: {
|
|
2831
|
+
schema: {},
|
|
2832
|
+
modelValue: { default: () => ({}) },
|
|
2833
|
+
locales: { default: void 0 },
|
|
2834
|
+
defaultLocale: { default: void 0 },
|
|
2835
|
+
errors: { default: () => ({}) },
|
|
2836
|
+
readonly: { type: Boolean, default: !1 },
|
|
2837
|
+
localeMode: { default: "perField" },
|
|
2838
|
+
resources: { default: void 0 }
|
|
2839
|
+
},
|
|
2840
|
+
emits: ["update:modelValue"],
|
|
2841
|
+
setup(l, { emit: t }) {
|
|
2842
|
+
const e = l, a = t, { t: r, availableLocales: i } = re(), p = De(yt, null), u = q(() => e.locales ?? p?.locales ?? i), b = q(() => e.defaultLocale ?? u.value[0] ?? ""), _ = q(() => e.errors instanceof Bt ? e.errors.all() : e.errors);
|
|
2843
|
+
function V(w) {
|
|
2844
|
+
const A = _.value[w]?.[0];
|
|
2845
|
+
if (A !== void 0) return A;
|
|
2846
|
+
const o = Object.keys(_.value).find((f) => f.startsWith(`${w}.`));
|
|
2847
|
+
return o === void 0 ? void 0 : _.value[o]?.[0];
|
|
2848
|
+
}
|
|
2849
|
+
const $ = (w) => Object.fromEntries(Object.entries(_.value).filter(([A]) => A.startsWith(`${w}.`)).map(([A, o]) => [A.slice(w.length + 1), o])), n = q(() => e.schema.fields.filter((w) => Ct(w.visible_when, e.modelValue)));
|
|
2850
|
+
function c(w, A) {
|
|
2851
|
+
a("update:modelValue", { ...e.modelValue, [w]: A });
|
|
2852
|
+
}
|
|
2853
|
+
const m = (w) => !!w.translatable && (w.kind === "text" || w.kind === "textarea" || w.kind === "rich_text"), h = (w) => m(w) && (e.localeMode === "form" || w.kind === "rich_text"), v = De(rt, null), y = q(() => e.localeMode === "form" && v !== null), S = H(null), L = q(() => y.value && v ? v.value : S.value !== null && u.value.includes(S.value) ? S.value : b.value), T = q(() => !y.value && n.value.some(h));
|
|
2854
|
+
ut(rt, L);
|
|
2855
|
+
const C = (w) => typeof e.modelValue[w.key] == "object" && e.modelValue[w.key] !== null ? e.modelValue[w.key] : {}, P = (w) => _.value[`${w.key}.${L.value}`]?.[0] ?? _.value[w.key]?.[0], Y = (w) => n.value.some((A) => m(A) && _.value[`${A.key}.${w}`] !== void 0);
|
|
2856
|
+
function M(w, A, o) {
|
|
2857
|
+
c(w.key, { ...C(w), [A]: o });
|
|
2858
|
+
}
|
|
2859
|
+
const O = (w, A = w.key) => ({
|
|
2860
|
+
label: w.label,
|
|
2861
|
+
hint: w.props?.hint,
|
|
2862
|
+
required: w.required === !0,
|
|
2863
|
+
error: w.kind === "collection" ? _.value[w.key]?.[0] : V(w.key),
|
|
2864
|
+
editable: !e.readonly,
|
|
2865
|
+
name: w.key,
|
|
2866
|
+
"data-field-key": A
|
|
2867
|
+
}), X = (w, A) => w.validation?.some((o) => o.rule === A) === !0, D = (w) => {
|
|
2868
|
+
const A = w.validation?.find((o) => o.rule === "max")?.args?.[0];
|
|
2869
|
+
return typeof A == "number" ? A : void 0;
|
|
2870
|
+
}, Q = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], te = (w) => typeof e.modelValue[w.key] == "number" ? e.modelValue[w.key] : null, ne = (w) => typeof e.modelValue[w.key] == "string" && e.modelValue[w.key] !== "" ? e.modelValue[w.key] : null, le = (w) => {
|
|
2871
|
+
const A = e.modelValue[w.key];
|
|
2872
|
+
return typeof A == "string" || typeof A == "number" ? A : null;
|
|
2873
|
+
}, de = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], _e = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], ge = (w) => typeof e.modelValue[w.key] == "string" ? e.modelValue[w.key] : "";
|
|
2874
|
+
return (w, A) => (d(), g("div", Ro, [
|
|
2875
|
+
T.value ? (d(), g("div", {
|
|
2876
|
+
key: 0,
|
|
2877
|
+
role: "tablist",
|
|
2878
|
+
"aria-label": s(r)("core.form.dynamic.language"),
|
|
2879
|
+
class: "flex gap-1"
|
|
2880
|
+
}, [
|
|
2881
|
+
(d(!0), g(ee, null, ce(u.value, (o) => (d(), g("button", {
|
|
2882
|
+
id: `dynamic-locale-${o}`,
|
|
2883
|
+
key: o,
|
|
2884
|
+
type: "button",
|
|
2885
|
+
role: "tab",
|
|
2886
|
+
"aria-selected": o === L.value,
|
|
2887
|
+
"data-locale": o,
|
|
2888
|
+
"data-error": Y(o) || void 0,
|
|
2889
|
+
class: "rounded-md px-3 py-1 text-sm font-medium uppercase aria-selected:bg-surface-muted data-[error]:text-critical",
|
|
2890
|
+
onClick: (f) => S.value = o
|
|
2891
|
+
}, B(o), 9, Eo))), 128))
|
|
2892
|
+
], 8, Uo)) : j("", !0),
|
|
2893
|
+
(d(!0), g(ee, null, ce(n.value, (o) => (d(), g(ee, {
|
|
2894
|
+
key: o.key
|
|
2895
|
+
}, [
|
|
2896
|
+
m(o) ? (d(), g(ee, { key: 0 }, [
|
|
2897
|
+
h(o) ? (d(), g(ee, { key: 0 }, [
|
|
2898
|
+
o.kind === "rich_text" ? (d(), z(nt, N({
|
|
2899
|
+
key: 0,
|
|
2900
|
+
ref_for: !0
|
|
2901
|
+
}, O(o), {
|
|
2902
|
+
error: P(o),
|
|
2903
|
+
"model-value": C(o)[L.value] ?? "",
|
|
2904
|
+
images: e.resources,
|
|
2905
|
+
video: o.props?.video,
|
|
2906
|
+
"onUpdate:modelValue": (f) => M(o, L.value, f)
|
|
2907
|
+
}), null, 16, ["error", "model-value", "images", "video", "onUpdate:modelValue"])) : o.kind === "textarea" ? (d(), z(et, N({
|
|
2908
|
+
key: 1,
|
|
2909
|
+
ref_for: !0
|
|
2910
|
+
}, O(o), {
|
|
2911
|
+
error: P(o),
|
|
2912
|
+
"model-value": C(o)[L.value] ?? "",
|
|
2913
|
+
rows: o.props?.rows,
|
|
2914
|
+
placeholder: o.props?.placeholder,
|
|
2915
|
+
"max-length": D(o),
|
|
2916
|
+
"onUpdate:modelValue": (f) => M(o, L.value, f)
|
|
2917
|
+
}), null, 16, ["error", "model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : (d(), z(Je, N({
|
|
2918
|
+
key: 2,
|
|
2919
|
+
ref_for: !0
|
|
2920
|
+
}, O(o), {
|
|
2921
|
+
error: P(o),
|
|
2922
|
+
"model-value": C(o)[L.value] ?? "",
|
|
2923
|
+
placeholder: o.props?.placeholder,
|
|
2924
|
+
"max-length": D(o),
|
|
2925
|
+
"onUpdate:modelValue": (f) => M(o, L.value, f)
|
|
2926
|
+
}), null, 16, ["error", "model-value", "placeholder", "max-length", "onUpdate:modelValue"]))
|
|
2927
|
+
], 64)) : (d(), z(xl, N({
|
|
2928
|
+
key: 1,
|
|
2929
|
+
ref_for: !0
|
|
2930
|
+
}, O(o), {
|
|
2931
|
+
"model-value": C(o),
|
|
2932
|
+
locales: u.value,
|
|
2933
|
+
"default-locale": b.value,
|
|
2934
|
+
"required-locales": o.required ? [b.value] : [],
|
|
2935
|
+
multiline: o.kind === "textarea",
|
|
2936
|
+
rows: o.props?.rows,
|
|
2937
|
+
placeholder: o.props?.placeholder,
|
|
2938
|
+
"max-length": D(o),
|
|
2939
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2940
|
+
}), null, 16, ["model-value", "locales", "default-locale", "required-locales", "multiline", "rows", "placeholder", "max-length", "onUpdate:modelValue"]))
|
|
2941
|
+
], 64)) : o.kind === "text" ? (d(), z(Je, N({
|
|
2942
|
+
key: 1,
|
|
2943
|
+
ref_for: !0
|
|
2944
|
+
}, O(o), {
|
|
2945
|
+
type: X(o, "email") ? "email" : X(o, "url") ? "url" : "text",
|
|
2946
|
+
"model-value": ge(o),
|
|
2947
|
+
placeholder: o.props?.placeholder,
|
|
2948
|
+
"max-length": D(o),
|
|
2949
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2950
|
+
}), null, 16, ["type", "model-value", "placeholder", "max-length", "onUpdate:modelValue"])) : o.kind === "textarea" ? (d(), z(et, N({
|
|
2951
|
+
key: 2,
|
|
2952
|
+
ref_for: !0
|
|
2953
|
+
}, O(o), {
|
|
2954
|
+
"model-value": ge(o),
|
|
2955
|
+
rows: o.props?.rows,
|
|
2956
|
+
placeholder: o.props?.placeholder,
|
|
2957
|
+
"max-length": D(o),
|
|
2958
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2959
|
+
}), null, 16, ["model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : o.kind === "rich_text" ? (d(), z(nt, N({
|
|
2960
|
+
key: 3,
|
|
2961
|
+
ref_for: !0
|
|
2962
|
+
}, O(o), {
|
|
2963
|
+
"model-value": ge(o),
|
|
2964
|
+
images: e.resources,
|
|
2965
|
+
video: o.props?.video,
|
|
2966
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2967
|
+
}), null, 16, ["model-value", "images", "video", "onUpdate:modelValue"])) : o.kind === "number" ? (d(), z(gt, N({
|
|
2968
|
+
key: 4,
|
|
2969
|
+
ref_for: !0
|
|
2970
|
+
}, O(o), {
|
|
2971
|
+
"model-value": te(o),
|
|
2972
|
+
placeholder: o.props?.placeholder,
|
|
2973
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2974
|
+
}), null, 16, ["model-value", "placeholder", "onUpdate:modelValue"])) : o.kind === "boolean" ? (d(), z(sa, N({
|
|
2975
|
+
key: 5,
|
|
2976
|
+
ref_for: !0
|
|
2977
|
+
}, O(o), {
|
|
2978
|
+
"model-value": e.modelValue[o.key] === !0,
|
|
2979
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2980
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "select" ? (d(), z(na, N({
|
|
2981
|
+
key: 6,
|
|
2982
|
+
ref_for: !0
|
|
2983
|
+
}, O(o), {
|
|
2984
|
+
options: o.options ?? [],
|
|
2985
|
+
"model-value": le(o),
|
|
2986
|
+
clearable: !o.required,
|
|
2987
|
+
placeholder: o.props?.placeholder,
|
|
2988
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2989
|
+
}), null, 16, ["options", "model-value", "clearable", "placeholder", "onUpdate:modelValue"])) : o.kind === "multi_select" ? (d(), z(jl, N({
|
|
2990
|
+
key: 7,
|
|
2991
|
+
ref_for: !0
|
|
2992
|
+
}, O(o), {
|
|
2993
|
+
options: o.options ?? [],
|
|
2994
|
+
"model-value": de(o),
|
|
2995
|
+
placeholder: o.props?.placeholder,
|
|
2996
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
2997
|
+
}), null, 16, ["options", "model-value", "placeholder", "onUpdate:modelValue"])) : o.kind === "date" ? (d(), z(aa, N({
|
|
2998
|
+
key: 8,
|
|
2999
|
+
ref_for: !0
|
|
3000
|
+
}, O(o), {
|
|
3001
|
+
"model-value": ne(o),
|
|
3002
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
3003
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "datetime" ? (d(), z(Wa, N({
|
|
3004
|
+
key: 9,
|
|
3005
|
+
ref_for: !0
|
|
3006
|
+
}, O(o), {
|
|
3007
|
+
"model-value": ne(o),
|
|
3008
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
3009
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "image" || o.kind === "document" || o.kind === "gallery" ? (d(), g(ee, { key: 10 }, [
|
|
3010
|
+
e.resources ? (d(), z(Bo, N({
|
|
3011
|
+
key: 0,
|
|
3012
|
+
ref_for: !0
|
|
3013
|
+
}, O(o), {
|
|
3014
|
+
source: e.resources,
|
|
3015
|
+
multiple: o.kind === "gallery",
|
|
3016
|
+
accept: o.props?.accept ?? (o.kind === "image" ? "image/*" : void 0),
|
|
3017
|
+
"model-value": o.kind === "gallery" ? Q(o) : e.modelValue[o.key],
|
|
3018
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
3019
|
+
}), null, 16, ["source", "multiple", "accept", "model-value", "onUpdate:modelValue"])) : j("", !0)
|
|
3020
|
+
], 64)) : o.kind === "collection" ? (d(), z(vo, N({
|
|
3021
|
+
key: 11,
|
|
3022
|
+
ref_for: !0
|
|
3023
|
+
}, O(o), {
|
|
3024
|
+
fields: o.children ?? [],
|
|
3025
|
+
"model-value": _e(o),
|
|
3026
|
+
locales: u.value,
|
|
3027
|
+
"default-locale": b.value,
|
|
3028
|
+
errors: $(o.key),
|
|
3029
|
+
resources: e.resources,
|
|
3030
|
+
"add-label": o.props?.addLabel,
|
|
3031
|
+
"locale-mode": e.localeMode,
|
|
3032
|
+
"onUpdate:modelValue": (f) => c(o.key, f)
|
|
3033
|
+
}), null, 16, ["fields", "model-value", "locales", "default-locale", "errors", "resources", "add-label", "locale-mode", "onUpdate:modelValue"])) : j("", !0)
|
|
3034
|
+
], 64))), 128))
|
|
3035
|
+
]));
|
|
3036
|
+
}
|
|
3037
|
+
}), Ve = (l) => {
|
|
3038
|
+
const [t] = l.args ?? [];
|
|
3039
|
+
if (typeof t != "number" || !Number.isFinite(t)) throw new Error(`buildValidator: the "${l.rule}" rule needs a number argument.`);
|
|
3040
|
+
return t;
|
|
3041
|
+
}, st = (l) => typeof l == "string" || typeof l == "number";
|
|
3042
|
+
function Rr(l, t) {
|
|
3043
|
+
const e = t.zod, { messages: a = {} } = t, r = e.any().refine(() => !1, { params: { code: "required" }, ...a.required !== void 0 ? { error: a.required } : {} }), i = (c) => c !== void 0 ? { error: c } : {};
|
|
3044
|
+
function p(c) {
|
|
3045
|
+
const m = c.validation ?? [], h = (T) => m.find((C) => C.rule === T), v = h("min"), y = h("max"), S = () => {
|
|
3046
|
+
let T = e.string(i(a.type));
|
|
3047
|
+
v && (T = T.min(Ve(v))), y && (T = T.max(Ve(y)));
|
|
3048
|
+
const C = [T];
|
|
3049
|
+
h("email") && C.push(e.email(i(a.email))), h("url") && C.push(e.url(i(a.url)));
|
|
3050
|
+
const P = h("regex")?.args?.[0];
|
|
3051
|
+
if (typeof P == "string") C.push(e.string().regex(new RegExp(P), i(a.regex)));
|
|
3052
|
+
else if (h("regex")) throw new Error(`buildValidator: the "regex" rule of "${c.key}" needs a pattern string.`);
|
|
3053
|
+
return C;
|
|
3054
|
+
}, L = (T) => {
|
|
3055
|
+
let C = e.array(T);
|
|
3056
|
+
return v && (C = C.min(Ve(v))), y && (C = C.max(Ve(y))), C;
|
|
3057
|
+
};
|
|
3058
|
+
switch (c.kind) {
|
|
3059
|
+
case "text":
|
|
3060
|
+
case "textarea":
|
|
3061
|
+
case "rich_text":
|
|
3062
|
+
return c.translatable ? [e.record(e.string(), e.unknown()).superRefine((T, C) => {
|
|
3063
|
+
for (const [P, Y] of Object.entries(T))
|
|
3064
|
+
if (!$e(Y))
|
|
3065
|
+
for (const M of S()) for (const O of M.safeParse(Y).error?.issues ?? []) C.addIssue({ ...O, path: [P, ...O.path] });
|
|
3066
|
+
})] : S();
|
|
3067
|
+
case "number": {
|
|
3068
|
+
let T = e.number(i(a.type));
|
|
3069
|
+
return v && (T = T.min(Ve(v))), y && (T = T.max(Ve(y))), [T];
|
|
3070
|
+
}
|
|
3071
|
+
case "boolean":
|
|
3072
|
+
return [e.boolean(i(a.type))];
|
|
3073
|
+
case "select": {
|
|
3074
|
+
const T = (c.options ?? []).map((C) => C.value);
|
|
3075
|
+
return [e.union([e.string(), e.number()], i(a.type)).refine((C) => T.includes(C), { params: { code: "invalid_choice" } })];
|
|
3076
|
+
}
|
|
3077
|
+
case "multi_select": {
|
|
3078
|
+
const T = (c.options ?? []).map((C) => C.value);
|
|
3079
|
+
return [L(e.union([e.string(), e.number()])), e.array(e.unknown()).refine((C) => C.every((P) => T.includes(P)), { params: { code: "invalid_choice" } })];
|
|
3080
|
+
}
|
|
3081
|
+
case "date":
|
|
3082
|
+
return [e.string(i(a.type)).refine((T) => za(T) !== null, { params: { code: "date" } })];
|
|
3083
|
+
case "datetime":
|
|
3084
|
+
return [e.string(i(a.type)).refine((T) => wt(T) !== null, { params: { code: "datetime" } })];
|
|
3085
|
+
case "image":
|
|
3086
|
+
case "document":
|
|
3087
|
+
return [e.custom(st, i(a.type))];
|
|
3088
|
+
case "gallery":
|
|
3089
|
+
return [L(e.custom(st))];
|
|
3090
|
+
case "collection":
|
|
3091
|
+
return [L(e.record(e.string(), e.unknown()))];
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
const u = /* @__PURE__ */ new Map(), b = (c) => {
|
|
3095
|
+
for (const m of c)
|
|
3096
|
+
u.set(m, p(m)), m.children && b(m.children);
|
|
3097
|
+
};
|
|
3098
|
+
b(l.fields);
|
|
3099
|
+
const _ = (c, m) => c.kind === "boolean" ? m == null : $e(m), V = (c) => c.required === !0 || c.validation?.some((m) => m.rule === "required") === !0, $ = (c, m) => {
|
|
3100
|
+
if (!c.translatable || typeof m != "object" || m === null) return _(c, m);
|
|
3101
|
+
const h = m;
|
|
3102
|
+
return t.defaultLocale !== void 0 ? $e(h[t.defaultLocale]) : $e(h);
|
|
3103
|
+
};
|
|
3104
|
+
function n(c, m, h, v) {
|
|
3105
|
+
const y = {};
|
|
3106
|
+
for (const S of c) {
|
|
3107
|
+
if (!Ct(S.visible_when, m)) continue;
|
|
3108
|
+
const L = m[S.key], T = [...h, S.key];
|
|
3109
|
+
if (y[S.key] = L, S.kind === "text" || S.kind === "textarea" || S.kind === "rich_text" ? $(S, L) : _(S, L)) {
|
|
3110
|
+
if (V(S)) for (const P of r.safeParse(L).error?.issues ?? []) v.push({ path: T, message: P.message });
|
|
3111
|
+
continue;
|
|
3112
|
+
}
|
|
3113
|
+
for (const P of u.get(S) ?? [])
|
|
3114
|
+
for (const Y of P.safeParse(L).error?.issues ?? [])
|
|
3115
|
+
v.push({ path: [...T, ...Y.path], message: Y.message });
|
|
3116
|
+
S.kind === "collection" && S.children && Array.isArray(L) && L.every((P) => typeof P == "object" && P !== null) && (y[S.key] = L.map((P, Y) => n(S.children, P, [...T, Y], v)));
|
|
3117
|
+
}
|
|
3118
|
+
return y;
|
|
3119
|
+
}
|
|
3120
|
+
return {
|
|
3121
|
+
safeParse(c) {
|
|
3122
|
+
const m = typeof c == "object" && c !== null ? c : {}, h = [], v = n(l.fields, m, [], h);
|
|
3123
|
+
return h.length > 0 ? { success: !1, error: { issues: h } } : { success: !0, data: v };
|
|
3124
|
+
}
|
|
3125
|
+
};
|
|
3126
|
+
}
|
|
2325
3127
|
export {
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
3128
|
+
Wt as Calendar,
|
|
3129
|
+
xr as CardSelectField,
|
|
3130
|
+
wr as CheckboxField,
|
|
3131
|
+
$r as ChoiceChips,
|
|
3132
|
+
Vr as ComboField,
|
|
3133
|
+
Yr as CommandDialog,
|
|
3134
|
+
aa as DateField,
|
|
3135
|
+
Wa as DateTimeField,
|
|
3136
|
+
Io as DynamicForm,
|
|
3137
|
+
zr as EditorPage,
|
|
3138
|
+
Bt as ErrorBag,
|
|
2336
3139
|
ye as Field,
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
3140
|
+
Sr as FileField,
|
|
3141
|
+
it as FormErrors,
|
|
3142
|
+
St as FormGroup,
|
|
3143
|
+
Fr as FormGroupButton,
|
|
3144
|
+
qr as FormIndent,
|
|
3145
|
+
Ot as FormRow,
|
|
3146
|
+
hn as FormView,
|
|
3147
|
+
Ir as GroupEditAction,
|
|
3148
|
+
wn as GroupSheet,
|
|
3149
|
+
xl as I18nField,
|
|
3150
|
+
rn as LeaveGuardRoot,
|
|
3151
|
+
Qr as MissingLeaveGuardRootError,
|
|
3152
|
+
Lr as MoneyField,
|
|
3153
|
+
Tr as MonthYearField,
|
|
3154
|
+
jl as MultiSelectField,
|
|
3155
|
+
jr as NumberCell,
|
|
3156
|
+
gt as NumberField,
|
|
3157
|
+
Xe as OptionList,
|
|
3158
|
+
$n as OtpInput,
|
|
3159
|
+
Dr as PhotoField,
|
|
3160
|
+
Vn as RecordGroupScope,
|
|
3161
|
+
vo as RepeatField,
|
|
3162
|
+
Bo as ResourceField,
|
|
3163
|
+
nt as RichTextField,
|
|
3164
|
+
Fn as SegmentedField,
|
|
3165
|
+
na as SelectField,
|
|
3166
|
+
Mr as StepForm,
|
|
3167
|
+
Xl as StepNavigation,
|
|
3168
|
+
ro as StepProgress,
|
|
3169
|
+
sa as SwitchField,
|
|
3170
|
+
Je as TextField,
|
|
3171
|
+
et as TextareaField,
|
|
3172
|
+
yn as TimeField,
|
|
3173
|
+
Rr as buildValidator,
|
|
3174
|
+
$t as checkFile,
|
|
3175
|
+
Ar as createFieldGroups,
|
|
3176
|
+
en as createLeaveGuard,
|
|
3177
|
+
wt as dateTimeValue,
|
|
3178
|
+
za as dateValue,
|
|
3179
|
+
Ct as evaluateVisibility,
|
|
3180
|
+
pe as fieldDefaults,
|
|
3181
|
+
Jr as fieldKey,
|
|
2374
3182
|
fe as fieldProps,
|
|
2375
|
-
|
|
3183
|
+
Me as focusFirstError,
|
|
2376
3184
|
fn as formEditableKey,
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
3185
|
+
Le as formatBytes,
|
|
3186
|
+
dn as groupOptions,
|
|
3187
|
+
Vl as hasUnsupportedCharacters,
|
|
3188
|
+
tn as installLeaveGuard,
|
|
3189
|
+
$e as isEmptyValue,
|
|
3190
|
+
an as leaveGuardKey,
|
|
3191
|
+
cn as matchOptions,
|
|
3192
|
+
nl as missingLocales,
|
|
3193
|
+
Cr as now,
|
|
3194
|
+
ja as parseDateValue,
|
|
3195
|
+
Nr as provideRecordGroups,
|
|
3196
|
+
vn as recentChoicesKey,
|
|
3197
|
+
Pr as recordGroupsKey,
|
|
3198
|
+
Br as refineStorableText,
|
|
3199
|
+
Ke as thumbnailUrl,
|
|
3200
|
+
Be as today,
|
|
3201
|
+
wl as unsupportedCharactersCode,
|
|
3202
|
+
Zr as useCommand,
|
|
3203
|
+
va as useDirtySnapshot,
|
|
3204
|
+
qe as useFieldMode,
|
|
3205
|
+
Kr as useForm,
|
|
3206
|
+
Cn as useGroupSheet,
|
|
3207
|
+
Gr as useHiddenFieldErrors,
|
|
3208
|
+
ft as useLeaveGuard,
|
|
3209
|
+
ln as useLeaveGuardContext,
|
|
3210
|
+
_n as useOptions,
|
|
3211
|
+
Bn as useRecordDialog,
|
|
3212
|
+
Hr as useRecordGroups,
|
|
2403
3213
|
sn as useResourceForm,
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
3214
|
+
ma as useSaveChrome,
|
|
3215
|
+
Pl as useSectionStates,
|
|
3216
|
+
kr as useSheetDiscardGuard,
|
|
3217
|
+
Or as useStepForm,
|
|
3218
|
+
_r as zodErrorMap
|
|
2409
3219
|
};
|