@wssto2/vue-core 0.4.19 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Activity-CLyG5Y9o.js → Activity-DX-RK9xj.js} +3 -3
- package/dist/{Changes-xF1VMbqD.js → Changes-_nARQ9IC.js} +2 -2
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-nojILoAf.js → CollectionPage.vue_vue_type_script_setup_true_lang-BNM_cbXa.js} +2 -2
- package/dist/DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js +281 -0
- package/dist/{DeadLetters-AbbNs69D.js → DeadLetters-O6QReswO.js} +2 -2
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-C7nq7MJB.js → FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js} +2 -1
- package/dist/{General-De4Q6Wfn.js → General-CkZoXu29.js} +4 -4
- package/dist/{NewRolePage-QAv_XsT0.js → NewRolePage-OosTaMfZ.js} +2 -2
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js +161 -0
- package/dist/{ProfilePage-CjjKhkHX.js → ProfilePage-Dn8fQ3ff.js} +3 -3
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-FLJk6Kb2.js → RoleEditor.vue_vue_type_script_setup_true_lang-2IOio1Sa.js} +4 -4
- package/dist/{RolePage-De7s2sYr.js → RolePage-33RUvHYD.js} +5 -5
- package/dist/{RolesPage-TXQKtK_J.js → RolesPage-BGPoUCMP.js} +3 -3
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js +515 -0
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-CuxVe7rm.js → SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js} +1 -1
- package/dist/{Sessions-BDLI0o-z.js → Sessions-BbAdbjmG.js} +2 -2
- package/dist/{SettingsPage-Kzcqv91E.js → SettingsPage-D47NSOYW.js} +3 -3
- package/dist/{SignIn-DKo46hNK.js → SignIn-DDCRzlUq.js} +2 -2
- package/dist/{SignInPage-B2v3is80.js → SignInPage-D9jryXA7.js} +2 -2
- package/dist/{SignIns-D-_a_S6O.js → SignIns-C_5sRrB4.js} +1 -1
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-BslHroDP.js → TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js} +114 -111
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js +93 -0
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js +190 -0
- package/dist/{UserRecord-BR70ai9q.js → UserRecord-CUhbz62x.js} +5 -5
- package/dist/{UsersList-BC9S6omH.js → UsersList-BE8fnICz.js} +7 -7
- package/dist/access/index.js +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/form/ComboField.vue.d.ts +7 -3
- package/dist/form/CommandDialog.vue.d.ts +4 -1
- package/dist/form/DateField.vue.d.ts +4 -0
- package/dist/form/DateTimeField.vue.d.ts +4 -0
- package/dist/form/MoneyField.vue.d.ts +10 -5
- package/dist/form/NumberField.vue.d.ts +13 -5
- package/dist/form/SelectField.vue.d.ts +3 -1
- package/dist/form/TextField.vue.d.ts +4 -0
- package/dist/form/TextareaField.vue.d.ts +4 -0
- package/dist/form/TimeField.vue.d.ts +4 -0
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1215 -1182
- package/dist/form/options.d.ts +4 -0
- package/dist/form/useCommand.d.ts +18 -0
- package/dist/identity/index.js +1 -1
- package/dist/{index-BrqxylSS.js → index-C3HWRCEe.js} +6 -6
- package/dist/{index-B9KqrN-F.js → index-D-0JNiFF.js} +2 -2
- package/dist/{index-D8akxuKo.js → index-DiEoRV9D.js} +11 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{status-vMwum3Y9.js → status-UWWFHi9t.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/useCommand-VIZE7xG-.js +168 -0
- package/package.json +1 -1
- package/dist/DateField.vue_vue_type_script_setup_true_lang-CfPwcEM2.js +0 -278
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-djJvP6Og.js +0 -150
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-ByDo_32P.js +0 -493
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-XZRHwx-n.js +0 -91
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-BB7ZGpvP.js +0 -187
- package/dist/useCommand-YN9EMb7s.js +0 -138
package/dist/form/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { E as
|
|
3
|
-
import { f as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { ref as
|
|
1
|
+
import { _ as Me, s as He, c as Se, f as et } from "../FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
|
|
2
|
+
import { E as Ko, u as Ao, a as Ho } from "../FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
|
|
3
|
+
import { f as De, u as st } from "../useCommand-VIZE7xG-.js";
|
|
4
|
+
import { _ as Yo, a as Wo } from "../useCommand-VIZE7xG-.js";
|
|
5
|
+
import { ref as N, computed as k, defineComponent as P, openBlock as u, createBlock as O, mergeProps as Q, unref as s, createSlots as ee, withCtx as v, createElementVNode as b, normalizeClass as j, createElementBlock as y, Fragment as ue, renderList as we, createVNode as M, createCommentVNode as T, toDisplayString as _, renderSlot as C, mergeDefaults as ce, useModel as ie, useId as je, withKeys as Ce, withModifiers as be, createTextVNode as Y, mergeModels as se, useTemplateRef as H, shallowRef as Le, watch as de, normalizeProps as Ve, guardReactiveProps as qe, nextTick as he, provide as Re, inject as tt, onBeforeUnmount as Ee, onMounted as rt, toRef as it, toValue as Oe, getCurrentScope as ut, onScopeDispose as dt, shallowReactive as Ue, normalizeStyle as ct, resolveDynamicComponent as ft } from "vue";
|
|
6
6
|
import { a as Ie } from "../leaveGuard-Cc8yeLxM.js";
|
|
7
|
-
import { M as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { u as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { u as at, _ as
|
|
12
|
-
import { useI18n as
|
|
7
|
+
import { M as Zo, c as Xo, i as Qo, l as en, u as tn } from "../leaveGuard-Cc8yeLxM.js";
|
|
8
|
+
import { _ as ln } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-Cv7KlA5y.js";
|
|
9
|
+
import { u as nn } from "../useResourceForm-CP2lCwmD.js";
|
|
10
|
+
import { _ as te } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
11
|
+
import { u as at, _ as ye, f as fe, b as ve, a as lt, c as Ge, e as vt, h as mt, i as pt, d as bt } from "../control-B4SdblL6.js";
|
|
12
|
+
import { useI18n as oe } from "vue-i18n";
|
|
13
13
|
import { b as gt } from "../controlSurface-t7OEFESJ.js";
|
|
14
|
-
import { a as yt } from "../TextField.vue_vue_type_script_setup_true_lang-
|
|
15
|
-
import { _ as
|
|
14
|
+
import { a as yt } from "../TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
|
|
15
|
+
import { _ as rn } from "../TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
|
|
16
16
|
import { u as ht, l as kt } from "../suggestions-DHJFKB26.js";
|
|
17
|
-
import { r as
|
|
18
|
-
import { s as $e, u as Ye, i as
|
|
19
|
-
import { u as Lt, a as Tt, s as
|
|
20
|
-
import { _ as
|
|
17
|
+
import { r as dn } from "../suggestions-DHJFKB26.js";
|
|
18
|
+
import { s as $e, u as Ye, i as wt, o as _e, e as Fe, k as xt, _ as $t, l as _t, c as St, b as Ct, t as ze, g as Ft, q as Bt } from "../useTypedEntry-C7k7Dyl-.js";
|
|
19
|
+
import { u as Lt, a as Tt, s as zt } from "../DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js";
|
|
20
|
+
import { _ as fn } from "../DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js";
|
|
21
21
|
import { _ as ot } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
|
|
22
|
-
import { u as
|
|
22
|
+
import { u as Dt } from "../format-D8X4zsx6.js";
|
|
23
23
|
import { u as Ne } from "../mediaQuery-CygcXmFW.js";
|
|
24
24
|
import { _ as Pe } from "../Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
|
|
25
|
-
import { u as Vt } from "../TimeField.vue_vue_type_script_setup_true_lang-
|
|
26
|
-
import { _ as
|
|
27
|
-
import { _ as
|
|
28
|
-
import { _ as qt, r as Rt } from "../FormGroup.vue_vue_type_script_setup_true_lang-
|
|
29
|
-
import { a as
|
|
30
|
-
import { _ as
|
|
31
|
-
import { i as
|
|
32
|
-
import { a as
|
|
33
|
-
import { _ as jt } from "../NumberField.vue_vue_type_script_setup_true_lang-
|
|
25
|
+
import { u as Vt } from "../TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js";
|
|
26
|
+
import { _ as mn } from "../TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js";
|
|
27
|
+
import { _ as ge } from "../Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
28
|
+
import { _ as qt, r as Rt } from "../FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
|
|
29
|
+
import { a as bn, c as gn, p as yn, u as hn } from "../FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
|
|
30
|
+
import { _ as wn } from "../FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
|
|
31
|
+
import { i as Ot } from "../intlLocale-CeRU44qJ.js";
|
|
32
|
+
import { a as Mt } from "../environment-Dva-SG8D.js";
|
|
33
|
+
import { _ as jt } from "../NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js";
|
|
34
34
|
import { _ as Et } from "../Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
|
|
35
|
-
import { u as It, a as We } from "../SelectField.vue_vue_type_script_setup_true_lang-
|
|
36
|
-
import { _ as
|
|
37
|
-
import { g as
|
|
38
|
-
import { _ as
|
|
35
|
+
import { u as It, a as We } from "../SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
|
|
36
|
+
import { _ as $n, b as _n } from "../SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
|
|
37
|
+
import { g as Cn, m as Fn } from "../options-Ba_0uLWN.js";
|
|
38
|
+
import { _ as Ln } from "../OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js";
|
|
39
39
|
import { _ as Je } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-QPCW3Xi6.js";
|
|
40
|
-
import { _ as
|
|
41
|
-
import { _ as
|
|
42
|
-
import { _ as
|
|
40
|
+
import { _ as zn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js";
|
|
41
|
+
import { _ as Vn } from "../SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js";
|
|
42
|
+
import { _ as Rn } from "../TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js";
|
|
43
43
|
import { _ as Gt } from "../Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js";
|
|
44
|
-
import { _ as
|
|
44
|
+
import { _ as Ze } from "../Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js";
|
|
45
45
|
import { D as Nt } from "../useWaitStatus-fsacMl4W.js";
|
|
46
46
|
import { t as Pt } from "../toast-CqSDTWRX.js";
|
|
47
47
|
import { a as Kt } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-CxU9aNRQ.js";
|
|
@@ -49,15 +49,15 @@ import { _ as At, a as Ht } from "../SectionList.vue_vue_type_script_setup_true_
|
|
|
49
49
|
import { p as Ut } from "../sectionIndex-BS0ic5W7.js";
|
|
50
50
|
import { u as Yt } from "../useSaveChrome-7huA3FzR.js";
|
|
51
51
|
import { matchedRouteKey as Wt, onBeforeRouteLeave as Jt } from "vue-router";
|
|
52
|
-
function
|
|
53
|
-
const t =
|
|
52
|
+
function Zt(l) {
|
|
53
|
+
const t = N(null);
|
|
54
54
|
return {
|
|
55
|
-
isDirty:
|
|
56
|
-
markClean: () => t.value = JSON.stringify(
|
|
55
|
+
isDirty: k(() => t.value !== null && JSON.stringify(l()) !== t.value),
|
|
56
|
+
markClean: () => t.value = JSON.stringify(l())
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
const t =
|
|
59
|
+
function ko(l) {
|
|
60
|
+
const t = N(!1), e = Zt(l), { confirmDiscard: a } = Ie(() => t.value && e.isDirty.value);
|
|
61
61
|
return {
|
|
62
62
|
/** The sheet was just filled: its current values are the baseline. */
|
|
63
63
|
opened: () => {
|
|
@@ -70,16 +70,16 @@ function yo(o) {
|
|
|
70
70
|
beforeDismiss: a
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name", "value", "checked", "disabled", "onChange"], ea = { class: "min-w-0 flex-1" }, ta = { class: "block text-body font-semibold text-content-strong" }, aa = {
|
|
74
74
|
key: 0,
|
|
75
75
|
class: "mt-0.5 block text-footnote text-content-muted"
|
|
76
76
|
}, la = {
|
|
77
77
|
key: 1,
|
|
78
78
|
class: "flex size-5 shrink-0 items-center justify-center rounded-full bg-control-on text-white",
|
|
79
79
|
"aria-hidden": "true"
|
|
80
|
-
},
|
|
80
|
+
}, wo = /* @__PURE__ */ P({
|
|
81
81
|
__name: "CardSelectField",
|
|
82
|
-
props: /* @__PURE__ */
|
|
82
|
+
props: /* @__PURE__ */ ce({
|
|
83
83
|
label: {},
|
|
84
84
|
labelHidden: { type: Boolean },
|
|
85
85
|
hint: {},
|
|
@@ -93,79 +93,79 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
93
93
|
modelValue: {},
|
|
94
94
|
options: {},
|
|
95
95
|
columns: {}
|
|
96
|
-
}, { ...
|
|
96
|
+
}, { ...ve, modelValue: null, columns: 2 }),
|
|
97
97
|
emits: ["update:modelValue"],
|
|
98
|
-
setup(
|
|
99
|
-
const e =
|
|
100
|
-
return (
|
|
101
|
-
value: e.options.find((
|
|
98
|
+
setup(l, { emit: t }) {
|
|
99
|
+
const e = l, a = t, { editable: o } = at(e), n = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" }, d = k(() => n[e.columns]);
|
|
100
|
+
return (i, m) => (u(), O(ye, Q(s(fe)(e), {
|
|
101
|
+
value: e.options.find((h) => h.value === e.modelValue)?.label ?? null,
|
|
102
102
|
"row-layout": "stacked"
|
|
103
|
-
}),
|
|
104
|
-
default:
|
|
105
|
-
|
|
106
|
-
id:
|
|
103
|
+
}), ee({
|
|
104
|
+
default: v(({ id: h, describedby: x, invalid: w }) => [
|
|
105
|
+
b("div", {
|
|
106
|
+
id: h,
|
|
107
107
|
role: "radiogroup",
|
|
108
108
|
"aria-label": e.label,
|
|
109
|
-
"aria-describedby":
|
|
110
|
-
"aria-invalid":
|
|
111
|
-
class: j(["grid w-full gap-2.5",
|
|
109
|
+
"aria-describedby": x,
|
|
110
|
+
"aria-invalid": w || void 0,
|
|
111
|
+
class: j(["grid w-full gap-2.5", d.value]),
|
|
112
112
|
"data-test": "card-select"
|
|
113
113
|
}, [
|
|
114
|
-
(
|
|
114
|
+
(u(!0), y(ue, null, we(e.options, (r) => (u(), y("label", {
|
|
115
115
|
key: r.value,
|
|
116
|
-
class: j(["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", [r.value === e.modelValue ? "bg-tint-soft ring-[1.5px] ring-inset ring-border-selected" : "hover:bg-fill-strong", e.disabled || !s(
|
|
116
|
+
class: j(["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", [r.value === e.modelValue ? "bg-tint-soft ring-[1.5px] ring-inset ring-border-selected" : "hover:bg-fill-strong", e.disabled || !s(o) || r.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"]])
|
|
117
117
|
}, [
|
|
118
|
-
|
|
118
|
+
b("input", {
|
|
119
119
|
type: "radio",
|
|
120
120
|
class: "sr-only",
|
|
121
|
-
name: e.name ??
|
|
121
|
+
name: e.name ?? h,
|
|
122
122
|
value: r.value,
|
|
123
123
|
checked: r.value === e.modelValue,
|
|
124
|
-
disabled: e.disabled || !s(
|
|
124
|
+
disabled: e.disabled || !s(o) || r.disabled,
|
|
125
125
|
onChange: (f) => a("update:modelValue", r.value)
|
|
126
|
-
}, null, 40,
|
|
127
|
-
r.icon ? (
|
|
126
|
+
}, null, 40, Qt),
|
|
127
|
+
r.icon ? (u(), y("span", {
|
|
128
128
|
key: 0,
|
|
129
129
|
class: j(["flex size-9 shrink-0 items-center justify-center rounded-control", r.value === e.modelValue ? "bg-control-on text-white" : "bg-fill-strong text-content-muted"])
|
|
130
130
|
}, [
|
|
131
|
-
|
|
131
|
+
M(s(te), {
|
|
132
132
|
name: r.icon,
|
|
133
133
|
size: 18
|
|
134
134
|
}, null, 8, ["name"])
|
|
135
|
-
], 2)) :
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
r.description ? (
|
|
135
|
+
], 2)) : T("", !0),
|
|
136
|
+
b("span", ea, [
|
|
137
|
+
b("span", ta, _(r.label), 1),
|
|
138
|
+
r.description ? (u(), y("span", aa, _(r.description), 1)) : T("", !0)
|
|
139
139
|
]),
|
|
140
|
-
r.value === e.modelValue ? (
|
|
141
|
-
|
|
140
|
+
r.value === e.modelValue ? (u(), y("span", la, [
|
|
141
|
+
M(s(te), {
|
|
142
142
|
name: "checkCustom",
|
|
143
143
|
size: 12
|
|
144
144
|
})
|
|
145
|
-
])) :
|
|
145
|
+
])) : T("", !0)
|
|
146
146
|
], 2))), 128))
|
|
147
|
-
], 10,
|
|
147
|
+
], 10, Xt)
|
|
148
148
|
]),
|
|
149
149
|
_: 2
|
|
150
150
|
}, [
|
|
151
|
-
|
|
151
|
+
i.$slots.trailing ? {
|
|
152
152
|
name: "trailing",
|
|
153
|
-
fn:
|
|
154
|
-
|
|
153
|
+
fn: v(() => [
|
|
154
|
+
C(i.$slots, "trailing")
|
|
155
155
|
]),
|
|
156
156
|
key: "0"
|
|
157
157
|
} : void 0,
|
|
158
|
-
|
|
158
|
+
i.$slots.labelTrailing ? {
|
|
159
159
|
name: "labelTrailing",
|
|
160
|
-
fn:
|
|
161
|
-
|
|
160
|
+
fn: v(() => [
|
|
161
|
+
C(i.$slots, "labelTrailing")
|
|
162
162
|
]),
|
|
163
163
|
key: "1"
|
|
164
164
|
} : void 0,
|
|
165
|
-
|
|
165
|
+
i.$slots.readonly ? {
|
|
166
166
|
name: "readonly",
|
|
167
|
-
fn:
|
|
168
|
-
|
|
167
|
+
fn: v(() => [
|
|
168
|
+
C(i.$slots, "readonly")
|
|
169
169
|
]),
|
|
170
170
|
key: "2"
|
|
171
171
|
} : void 0
|
|
@@ -174,9 +174,9 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
174
174
|
}), oa = ["data-field-error"], na = ["aria-checked", "aria-disabled", "aria-describedby", "aria-invalid", "tabindex", "onKeydown"], sa = { class: "flex min-w-0 flex-1 flex-col items-start" }, ra = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "flex shrink-0 items-center gap-2.5"
|
|
177
|
-
}, ia = ["id"],
|
|
177
|
+
}, ia = ["id"], xo = /* @__PURE__ */ P({
|
|
178
178
|
__name: "CheckboxField",
|
|
179
|
-
props: /* @__PURE__ */
|
|
179
|
+
props: /* @__PURE__ */ se({
|
|
180
180
|
label: {},
|
|
181
181
|
description: { default: void 0 },
|
|
182
182
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -187,77 +187,77 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
187
187
|
modelModifiers: {}
|
|
188
188
|
}),
|
|
189
189
|
emits: ["update:modelValue"],
|
|
190
|
-
setup(
|
|
191
|
-
const t =
|
|
190
|
+
setup(l) {
|
|
191
|
+
const t = l, e = ie(l, "modelValue"), a = !!lt(), o = je(), n = () => {
|
|
192
192
|
t.disabled || (e.value = !e.value);
|
|
193
193
|
};
|
|
194
|
-
return (
|
|
194
|
+
return (d, i) => (u(), y("div", {
|
|
195
195
|
"data-field-error": t.error ? "true" : void 0
|
|
196
196
|
}, [
|
|
197
|
-
|
|
197
|
+
b("div", {
|
|
198
198
|
role: "checkbox",
|
|
199
199
|
"aria-checked": e.value,
|
|
200
200
|
"aria-disabled": t.disabled || void 0,
|
|
201
|
-
"aria-describedby": t.error ? `${s(
|
|
201
|
+
"aria-describedby": t.error ? `${s(o)}-error` : void 0,
|
|
202
202
|
"aria-invalid": t.error ? !0 : void 0,
|
|
203
203
|
tabindex: t.disabled ? -1 : 0,
|
|
204
204
|
"data-test": "checkbox",
|
|
205
205
|
class: j(["group/check 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" ? "first:rounded-t-group last: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"]]),
|
|
206
|
-
onClick:
|
|
206
|
+
onClick: n,
|
|
207
207
|
onKeydown: [
|
|
208
|
-
Ce(
|
|
209
|
-
Ce(
|
|
208
|
+
Ce(be(n, ["prevent"]), ["space"]),
|
|
209
|
+
Ce(be(n, ["prevent"]), ["enter"])
|
|
210
210
|
]
|
|
211
211
|
}, [
|
|
212
|
-
|
|
212
|
+
b("span", {
|
|
213
213
|
class: j(["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"]]),
|
|
214
214
|
"aria-hidden": "true"
|
|
215
215
|
}, [
|
|
216
|
-
e.value ? (
|
|
216
|
+
e.value ? (u(), O(s(te), {
|
|
217
217
|
key: 0,
|
|
218
218
|
name: "checkCustom",
|
|
219
219
|
size: 12
|
|
220
|
-
})) :
|
|
220
|
+
})) : T("", !0)
|
|
221
221
|
], 2),
|
|
222
|
-
|
|
222
|
+
b("div", {
|
|
223
223
|
class: j(["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" : ""])
|
|
224
224
|
}, [
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
b("div", sa, [
|
|
226
|
+
b("p", {
|
|
227
227
|
class: j(["w-full text-body", [t.variant === "row" ? "break-words" : "truncate", t.disabled ? "text-content-muted" : e.value ? "text-content-strong" : "text-content"]])
|
|
228
|
-
},
|
|
229
|
-
t.description ? (
|
|
228
|
+
}, _(t.label), 3),
|
|
229
|
+
t.description ? (u(), y("p", {
|
|
230
230
|
key: 0,
|
|
231
231
|
class: j(["tabular-nums text-content-muted", t.variant === "row" ? "text-footnote" : "text-xs"])
|
|
232
|
-
},
|
|
233
|
-
|
|
232
|
+
}, _(t.description), 3)) : T("", !0),
|
|
233
|
+
C(d.$slots, "default")
|
|
234
234
|
]),
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
])) :
|
|
235
|
+
d.$slots.trailing ? (u(), y("div", ra, [
|
|
236
|
+
C(d.$slots, "trailing")
|
|
237
|
+
])) : T("", !0)
|
|
238
238
|
], 2)
|
|
239
239
|
], 42, na),
|
|
240
|
-
t.error ? (
|
|
240
|
+
t.error ? (u(), y("p", {
|
|
241
241
|
key: 0,
|
|
242
|
-
id: `${s(
|
|
242
|
+
id: `${s(o)}-error`,
|
|
243
243
|
role: "alert",
|
|
244
244
|
class: "flex items-start gap-1.5 px-2 pt-1 text-footnote text-content-destructive"
|
|
245
245
|
}, [
|
|
246
|
-
|
|
246
|
+
M(s(te), {
|
|
247
247
|
name: "alertTriangle",
|
|
248
248
|
size: 14,
|
|
249
249
|
class: "mt-px shrink-0"
|
|
250
250
|
}),
|
|
251
|
-
Y(" " +
|
|
252
|
-
], 8, ia)) :
|
|
251
|
+
Y(" " + _(t.error), 1)
|
|
252
|
+
], 8, ia)) : T("", !0)
|
|
253
253
|
], 8, oa));
|
|
254
254
|
}
|
|
255
255
|
}), ua = {
|
|
256
256
|
key: 0,
|
|
257
257
|
class: "text-body text-content-muted"
|
|
258
|
-
}, da = ["id", "aria-label", "aria-describedby", "aria-invalid"], ca = ["aria-pressed", "disabled", "onClick"],
|
|
258
|
+
}, da = ["id", "aria-label", "aria-describedby", "aria-invalid"], ca = ["aria-pressed", "disabled", "onClick"], $o = /* @__PURE__ */ P({
|
|
259
259
|
__name: "ChoiceChips",
|
|
260
|
-
props: /* @__PURE__ */
|
|
260
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
261
261
|
label: {},
|
|
262
262
|
labelHidden: { type: Boolean },
|
|
263
263
|
hint: {},
|
|
@@ -269,73 +269,77 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
269
269
|
presentation: {},
|
|
270
270
|
name: {},
|
|
271
271
|
options: {}
|
|
272
|
-
}, { ...
|
|
272
|
+
}, { ...ve }), {
|
|
273
273
|
modelValue: { default: () => [] },
|
|
274
274
|
modelModifiers: {}
|
|
275
275
|
}),
|
|
276
276
|
emits: ["update:modelValue"],
|
|
277
|
-
setup(
|
|
278
|
-
const t =
|
|
279
|
-
return (
|
|
280
|
-
value: t.options.filter((
|
|
277
|
+
setup(l) {
|
|
278
|
+
const t = l, e = ie(l, "modelValue"), a = (o) => e.value = e.value.includes(o) ? e.value.filter((n) => n !== o) : [...e.value, o];
|
|
279
|
+
return (o, n) => (u(), O(ye, Q(s(fe)(t), {
|
|
280
|
+
value: t.options.filter((d) => e.value.includes(d.value)).map((d) => d.label).join(", ") || null,
|
|
281
281
|
"row-layout": "stacked"
|
|
282
|
-
}),
|
|
283
|
-
default:
|
|
284
|
-
t.options.length === 0 ? (
|
|
282
|
+
}), ee({
|
|
283
|
+
default: v(({ id: d, describedby: i, invalid: m }) => [
|
|
284
|
+
t.options.length === 0 ? (u(), y("span", ua, "—")) : (u(), y("div", {
|
|
285
285
|
key: 1,
|
|
286
|
-
id:
|
|
286
|
+
id: d,
|
|
287
287
|
role: "group",
|
|
288
288
|
"aria-label": t.label,
|
|
289
|
-
"aria-describedby":
|
|
290
|
-
"aria-invalid":
|
|
289
|
+
"aria-describedby": i,
|
|
290
|
+
"aria-invalid": m || void 0,
|
|
291
291
|
class: "flex flex-wrap gap-1.5 py-1",
|
|
292
292
|
"data-test": "choice-chips"
|
|
293
293
|
}, [
|
|
294
|
-
(
|
|
295
|
-
key:
|
|
294
|
+
(u(!0), y(ue, null, we(t.options, (h) => (u(), y("button", {
|
|
295
|
+
key: h.value,
|
|
296
296
|
type: "button",
|
|
297
|
-
"aria-pressed": e.value.includes(
|
|
298
|
-
disabled: t.disabled ||
|
|
299
|
-
class: j(["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(
|
|
300
|
-
onClick: (
|
|
297
|
+
"aria-pressed": e.value.includes(h.value),
|
|
298
|
+
disabled: t.disabled || h.disabled,
|
|
299
|
+
class: j(["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(h.value) ? "bg-tint-soft font-semibold text-content-link" : "bg-fill font-medium text-content-strong hover:bg-fill-strong"]),
|
|
300
|
+
onClick: (x) => a(h.value)
|
|
301
301
|
}, [
|
|
302
|
-
e.value.includes(
|
|
302
|
+
e.value.includes(h.value) ? (u(), O(s(te), {
|
|
303
303
|
key: 0,
|
|
304
304
|
name: "checkCustom",
|
|
305
305
|
size: 12
|
|
306
|
-
})) :
|
|
307
|
-
Y(" " +
|
|
306
|
+
})) : T("", !0),
|
|
307
|
+
Y(" " + _(h.label), 1)
|
|
308
308
|
], 10, ca))), 128))
|
|
309
309
|
], 8, da))
|
|
310
310
|
]),
|
|
311
311
|
_: 2
|
|
312
312
|
}, [
|
|
313
|
-
|
|
313
|
+
o.$slots.trailing ? {
|
|
314
314
|
name: "trailing",
|
|
315
|
-
fn:
|
|
316
|
-
|
|
315
|
+
fn: v(() => [
|
|
316
|
+
C(o.$slots, "trailing")
|
|
317
317
|
]),
|
|
318
318
|
key: "0"
|
|
319
319
|
} : void 0,
|
|
320
|
-
|
|
320
|
+
o.$slots.labelTrailing ? {
|
|
321
321
|
name: "labelTrailing",
|
|
322
|
-
fn:
|
|
323
|
-
|
|
322
|
+
fn: v(() => [
|
|
323
|
+
C(o.$slots, "labelTrailing")
|
|
324
324
|
]),
|
|
325
325
|
key: "1"
|
|
326
326
|
} : void 0,
|
|
327
|
-
|
|
327
|
+
o.$slots.readonly ? {
|
|
328
328
|
name: "readonly",
|
|
329
|
-
fn:
|
|
330
|
-
|
|
329
|
+
fn: v(() => [
|
|
330
|
+
C(o.$slots, "readonly")
|
|
331
331
|
]),
|
|
332
332
|
key: "2"
|
|
333
333
|
} : void 0
|
|
334
334
|
]), 1040, ["value"]));
|
|
335
335
|
}
|
|
336
|
-
}), fa =
|
|
336
|
+
}), fa = {
|
|
337
|
+
key: 0,
|
|
338
|
+
class: "flex shrink-0 items-center",
|
|
339
|
+
"data-test": "field-value"
|
|
340
|
+
}, va = ["id", "value", "name", "placeholder", "disabled", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-required", "aria-invalid", "aria-describedby"], ma = { class: "block break-words text-body text-content-strong" }, _o = /* @__PURE__ */ P({
|
|
337
341
|
__name: "ComboField",
|
|
338
|
-
props: /* @__PURE__ */
|
|
342
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
339
343
|
label: {},
|
|
340
344
|
labelHidden: { type: Boolean },
|
|
341
345
|
hint: {},
|
|
@@ -356,99 +360,104 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
356
360
|
recents: {},
|
|
357
361
|
width: {},
|
|
358
362
|
rowLayout: {}
|
|
359
|
-
}, { ...
|
|
363
|
+
}, { ...ve, 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 }), {
|
|
360
364
|
modelValue: { default: null },
|
|
361
365
|
modelModifiers: {}
|
|
362
366
|
}),
|
|
363
|
-
emits: /* @__PURE__ */
|
|
364
|
-
setup(
|
|
365
|
-
const a =
|
|
367
|
+
emits: /* @__PURE__ */ se(["picked", "focus", "blur"], ["update:modelValue"]),
|
|
368
|
+
setup(l, { expose: t, emit: e }) {
|
|
369
|
+
const a = l, o = ie(l, "modelValue"), n = e, { t: d } = oe(), i = !!lt(), m = Ge("text", () => a.error ? "error" : a.disabled ? "locked" : "rest"), h = k(() => a.rowLayout === "stacked"), x = k(() => i && !h.value ? gt(a.width) : "w-full"), w = H("input"), r = H("anchor"), f = Le(null), g = Le(""), S = ht({
|
|
366
370
|
source: () => a.search ?? a.options,
|
|
367
371
|
minLength: () => a.minLength,
|
|
368
372
|
debounce: () => a.debounce,
|
|
369
373
|
limit: () => a.limit,
|
|
370
374
|
listAllWhenEmpty: !0,
|
|
371
375
|
recents: () => a.recents
|
|
372
|
-
}), { items:
|
|
373
|
-
const
|
|
374
|
-
return
|
|
376
|
+
}), { items: z, open: $, status: I, highlighted: F, showingRecent: E } = S, R = k(() => {
|
|
377
|
+
const D = o.value;
|
|
378
|
+
return D === null ? null : [f.value, a.selected, ...a.options ?? []].find((A) => A?.value === D) ?? null;
|
|
375
379
|
});
|
|
376
|
-
|
|
377
|
-
|
|
380
|
+
de(R, (D) => {
|
|
381
|
+
$.value || (g.value = D?.label ?? "");
|
|
378
382
|
}, { immediate: !0 });
|
|
379
|
-
function
|
|
380
|
-
|
|
383
|
+
function Z(D) {
|
|
384
|
+
g.value = D.target.value, S.ask(g.value), g.value === "" && (o.value = null, f.value = null);
|
|
381
385
|
}
|
|
382
|
-
function
|
|
383
|
-
a.disabled || S.show("");
|
|
386
|
+
function W(D) {
|
|
387
|
+
n("focus", D), a.disabled || S.show("");
|
|
384
388
|
}
|
|
385
|
-
function
|
|
386
|
-
S.close(), S.remember(
|
|
389
|
+
function J(D) {
|
|
390
|
+
S.close(), S.remember(D), f.value = D, o.value = D.value, g.value = D.label, n("picked", D);
|
|
387
391
|
}
|
|
388
|
-
function
|
|
389
|
-
S.close(),
|
|
392
|
+
function ae(D) {
|
|
393
|
+
S.close(), g.value = R.value?.label ?? "", n("blur", D);
|
|
390
394
|
}
|
|
391
|
-
const
|
|
392
|
-
return t({ focus: () =>
|
|
393
|
-
value:
|
|
395
|
+
const me = k(() => kt($.value, z.value.length, I.value, !0));
|
|
396
|
+
return t({ focus: () => w.value?.focus() }), (D, A) => (u(), O(ye, Q(s(fe)(a), {
|
|
397
|
+
value: R.value?.label ?? null,
|
|
394
398
|
"row-layout": a.rowLayout
|
|
395
|
-
}),
|
|
396
|
-
default:
|
|
397
|
-
|
|
399
|
+
}), ee({
|
|
400
|
+
default: v(({ id: G, describedby: ne, invalid: re }) => [
|
|
401
|
+
b("div", {
|
|
398
402
|
ref_key: "anchor",
|
|
399
403
|
ref: r,
|
|
400
|
-
class: j(["flex items-center gap-1.5", [s(
|
|
404
|
+
class: j(["flex items-center gap-1.5", [s(m), x.value]])
|
|
401
405
|
}, [
|
|
402
|
-
|
|
403
|
-
|
|
406
|
+
D.$slots.value && R.value ? (u(), y("span", fa, [
|
|
407
|
+
C(D.$slots, "value", {
|
|
408
|
+
option: R.value
|
|
409
|
+
})
|
|
410
|
+
])) : T("", !0),
|
|
411
|
+
b("input", {
|
|
412
|
+
id: G,
|
|
404
413
|
ref_key: "input",
|
|
405
|
-
ref:
|
|
414
|
+
ref: w,
|
|
406
415
|
role: "combobox",
|
|
407
416
|
type: "text",
|
|
408
417
|
autocomplete: "off",
|
|
409
|
-
value:
|
|
418
|
+
value: g.value,
|
|
410
419
|
name: a.name,
|
|
411
420
|
placeholder: a.placeholder,
|
|
412
421
|
disabled: a.disabled,
|
|
413
422
|
required: a.required,
|
|
414
423
|
"aria-autocomplete": "list",
|
|
415
|
-
"aria-expanded":
|
|
416
|
-
"aria-controls": `${
|
|
417
|
-
"aria-activedescendant":
|
|
424
|
+
"aria-expanded": me.value,
|
|
425
|
+
"aria-controls": `${G}-list`,
|
|
426
|
+
"aria-activedescendant": me.value && s(z).length > 0 ? `${G}-option-${s(F)}` : void 0,
|
|
418
427
|
"aria-required": a.required || void 0,
|
|
419
|
-
"aria-invalid":
|
|
420
|
-
"aria-describedby":
|
|
421
|
-
class: j(["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",
|
|
422
|
-
onInput:
|
|
423
|
-
onFocus:
|
|
424
|
-
onBlur:
|
|
425
|
-
onKeydown: A[0] || (A[0] = (
|
|
426
|
-
}, null, 42,
|
|
427
|
-
|
|
428
|
+
"aria-invalid": re || void 0,
|
|
429
|
+
"aria-describedby": ne,
|
|
430
|
+
class: j(["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", i && !h.value ? "compact:text-right" : ""]),
|
|
431
|
+
onInput: Z,
|
|
432
|
+
onFocus: W,
|
|
433
|
+
onBlur: ae,
|
|
434
|
+
onKeydown: A[0] || (A[0] = (le) => s(S).keydown(le, { pick: J, enterNeedsMove: !1 }))
|
|
435
|
+
}, null, 42, va),
|
|
436
|
+
M(s(te), {
|
|
428
437
|
name: "search",
|
|
429
438
|
size: 14,
|
|
430
439
|
class: "shrink-0 text-content-muted"
|
|
431
440
|
})
|
|
432
441
|
], 2),
|
|
433
|
-
|
|
434
|
-
id:
|
|
442
|
+
M(yt, {
|
|
443
|
+
id: G,
|
|
435
444
|
anchor: r.value,
|
|
436
|
-
open: s(
|
|
437
|
-
items: s(
|
|
445
|
+
open: s($),
|
|
446
|
+
items: s(z),
|
|
438
447
|
highlighted: s(F),
|
|
439
|
-
query:
|
|
440
|
-
status: s(
|
|
448
|
+
query: g.value,
|
|
449
|
+
status: s(I),
|
|
441
450
|
recent: s(E),
|
|
442
451
|
"empty-message": !0,
|
|
443
|
-
selected:
|
|
444
|
-
hint: s(
|
|
445
|
-
onPick:
|
|
446
|
-
onHover: A[1] || (A[1] = (
|
|
447
|
-
},
|
|
448
|
-
|
|
452
|
+
selected: o.value,
|
|
453
|
+
hint: s(d)("core.form.suggestions.keys_pick"),
|
|
454
|
+
onPick: J,
|
|
455
|
+
onHover: A[1] || (A[1] = (le) => s(S).highlight(le))
|
|
456
|
+
}, ee({ _: 2 }, [
|
|
457
|
+
D.$slots.option ? {
|
|
449
458
|
name: "option",
|
|
450
|
-
fn:
|
|
451
|
-
|
|
459
|
+
fn: v((le) => [
|
|
460
|
+
C(D.$slots, "option", Ve(qe(le)))
|
|
452
461
|
]),
|
|
453
462
|
key: "0"
|
|
454
463
|
} : void 0
|
|
@@ -456,41 +465,51 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
456
465
|
]),
|
|
457
466
|
_: 2
|
|
458
467
|
}, [
|
|
459
|
-
|
|
468
|
+
D.$slots.trailing ? {
|
|
460
469
|
name: "trailing",
|
|
461
|
-
fn:
|
|
462
|
-
|
|
470
|
+
fn: v(() => [
|
|
471
|
+
C(D.$slots, "trailing")
|
|
463
472
|
]),
|
|
464
473
|
key: "0"
|
|
465
474
|
} : void 0,
|
|
466
|
-
|
|
475
|
+
D.$slots.labelTrailing ? {
|
|
467
476
|
name: "labelTrailing",
|
|
468
|
-
fn:
|
|
469
|
-
|
|
477
|
+
fn: v(() => [
|
|
478
|
+
C(D.$slots, "labelTrailing")
|
|
470
479
|
]),
|
|
471
480
|
key: "1"
|
|
472
481
|
} : void 0,
|
|
473
|
-
|
|
482
|
+
D.$slots.readonly ? {
|
|
474
483
|
name: "readonly",
|
|
475
|
-
fn:
|
|
476
|
-
|
|
484
|
+
fn: v(() => [
|
|
485
|
+
C(D.$slots, "readonly")
|
|
477
486
|
]),
|
|
478
487
|
key: "2"
|
|
488
|
+
} : D.$slots.value && R.value ? {
|
|
489
|
+
name: "readonly",
|
|
490
|
+
fn: v(() => [
|
|
491
|
+
b("span", ma, [
|
|
492
|
+
C(D.$slots, "value", {
|
|
493
|
+
option: R.value
|
|
494
|
+
})
|
|
495
|
+
])
|
|
496
|
+
]),
|
|
497
|
+
key: "3"
|
|
479
498
|
} : void 0
|
|
480
499
|
]), 1040, ["value", "row-layout"]));
|
|
481
500
|
}
|
|
482
|
-
}),
|
|
501
|
+
}), pa = {
|
|
483
502
|
key: 0,
|
|
484
503
|
class: "whitespace-normal"
|
|
485
|
-
},
|
|
504
|
+
}, ba = { class: "whitespace-nowrap" }, ga = { class: "whitespace-nowrap" }, ya = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], ha = ["aria-label", "onClick"], ka = {
|
|
486
505
|
class: "-m-3 flex",
|
|
487
506
|
"data-test": "date-time-popover"
|
|
488
|
-
},
|
|
507
|
+
}, wa = { class: "flex w-75 flex-col gap-2.5 border-r border-border-separator p-3.5" }, xa = {
|
|
489
508
|
key: 0,
|
|
490
509
|
class: "border-t border-border-separator pt-2.5"
|
|
491
|
-
},
|
|
510
|
+
}, $a = { class: "flex w-48 flex-col gap-2.5 px-3 py-3.5" }, _a = ["for"], Sa = ["id", "value", "placeholder", "aria-invalid"], Ca = ["onClick"], So = /* @__PURE__ */ P({
|
|
492
511
|
__name: "DateTimeField",
|
|
493
|
-
props: /* @__PURE__ */
|
|
512
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
494
513
|
label: {},
|
|
495
514
|
labelHidden: { type: Boolean },
|
|
496
515
|
hint: {},
|
|
@@ -507,187 +526,190 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
507
526
|
openOn: {},
|
|
508
527
|
minuteStep: {},
|
|
509
528
|
quickPicks: {}
|
|
510
|
-
}, { ...
|
|
529
|
+
}, { ...ve, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, minuteStep: 1, quickPicks: void 0 }), {
|
|
511
530
|
modelValue: { default: null },
|
|
512
531
|
modelModifiers: {}
|
|
513
532
|
}),
|
|
514
|
-
emits: ["update:modelValue"],
|
|
515
|
-
setup(
|
|
516
|
-
const
|
|
517
|
-
function
|
|
518
|
-
const { date:
|
|
519
|
-
if (!
|
|
520
|
-
let
|
|
521
|
-
if (
|
|
522
|
-
const
|
|
523
|
-
if ("error" in
|
|
524
|
-
|
|
533
|
+
emits: /* @__PURE__ */ se(["focus", "blur"], ["update:modelValue"]),
|
|
534
|
+
setup(l, { expose: t, emit: e }) {
|
|
535
|
+
const a = l, o = ie(l, "modelValue"), n = e, { t: d } = oe(), i = Dt(), m = Ne(), h = H("input"), x = H("popover"), w = H("calendar"), r = H("sheet"), f = k(() => ({ min: a.min?.slice(0, 10), max: a.max?.slice(0, 10), disabled: a.disabledDates })), g = k(() => a.min && a.min.length === 10 ? `${a.min}T00:00` : a.min), S = k(() => a.max && a.max.length === 10 ? `${a.max}T23:59` : a.max), z = (L, c) => !Ft(c, { disabled: a.disabledDates }) && (!g.value || L >= g.value) && (!S.value || L <= S.value), $ = Lt(() => f.value), I = Vt(() => a.minuteStep), F = k(() => $e(o.value));
|
|
536
|
+
function E(L) {
|
|
537
|
+
const { date: c, time: V } = zt(L), p = c === null ? F.value.day ?? Fe() : $.parse(c);
|
|
538
|
+
if (!p) return { error: $.invalidMessage() };
|
|
539
|
+
let q = F.value.time ?? ze(a.minuteStep);
|
|
540
|
+
if (V !== null) {
|
|
541
|
+
const K = I.parse(V);
|
|
542
|
+
if ("error" in K) return K;
|
|
543
|
+
q = K.value;
|
|
525
544
|
}
|
|
526
|
-
const
|
|
527
|
-
return
|
|
545
|
+
const B = _e(p, q);
|
|
546
|
+
return z(B, p) ? { value: B } : { error: $.unavailableMessage() };
|
|
528
547
|
}
|
|
529
|
-
const
|
|
530
|
-
get: () =>
|
|
531
|
-
set: (
|
|
532
|
-
|
|
548
|
+
const R = Ye({ model: o, display: (L) => `${i.date($e(L).day)} ${$e(L).time ?? ""}`.trim(), parse: E }), Z = k({
|
|
549
|
+
get: () => F.value.time,
|
|
550
|
+
set: (L) => {
|
|
551
|
+
L && wt(L) && (o.value = _e(F.value.day ?? Fe(), L));
|
|
533
552
|
}
|
|
534
|
-
}),
|
|
535
|
-
const
|
|
536
|
-
return
|
|
537
|
-
}),
|
|
538
|
-
function
|
|
539
|
-
|
|
553
|
+
}), W = Ye({ model: Z, display: (L) => L, parse: I.parse }), J = Tt(() => a.quickPicks ?? (m.value ? void 0 : []), () => m.value, () => f.value), ae = k(() => a.error || R.message.value || W.message.value), me = k(() => o.value ? i.dateTime(o.value) : null), D = Ge("date", () => ae.value ? "error" : a.disabled ? "locked" : "rest"), A = k(() => {
|
|
554
|
+
const L = R.typed.value;
|
|
555
|
+
return L ? $e(L).day ?? null : null;
|
|
556
|
+
}), G = k(() => A.value ?? (xt(F.value.day) ? F.value.day : null)), ne = k(() => R.typed.value ? $e(R.typed.value).time : F.value.time);
|
|
557
|
+
function re(L) {
|
|
558
|
+
L && R.set(_e(L, F.value.time ?? ze(a.minuteStep)));
|
|
540
559
|
}
|
|
541
|
-
function
|
|
542
|
-
|
|
560
|
+
function le(L) {
|
|
561
|
+
L && R.set(_e(F.value.day ?? Fe(), L));
|
|
543
562
|
}
|
|
544
|
-
function
|
|
545
|
-
|
|
563
|
+
function ke(L) {
|
|
564
|
+
R.set(_e(Fe(), ze(a.minuteStep))), L();
|
|
546
565
|
}
|
|
547
|
-
const
|
|
548
|
-
async function
|
|
549
|
-
|
|
566
|
+
const xe = je();
|
|
567
|
+
async function X(L) {
|
|
568
|
+
a.disabled || (x.value?.present(), L && (await he(), await he(), w.value?.focus()));
|
|
550
569
|
}
|
|
551
|
-
function
|
|
552
|
-
|
|
570
|
+
function pe(L) {
|
|
571
|
+
L.key === "Enter" ? (R.commit(), x.value?.dismiss()) : L.key === "ArrowDown" && (L.preventDefault(), X(!0));
|
|
553
572
|
}
|
|
554
|
-
return t({ focus: () =>
|
|
555
|
-
value:
|
|
573
|
+
return t({ focus: () => h.value?.focus() }), (L, c) => (u(), O(ye, Q({ ...s(fe)(a), error: ae.value }, {
|
|
574
|
+
value: me.value,
|
|
556
575
|
"value-style": "numeric"
|
|
557
|
-
}),
|
|
558
|
-
default:
|
|
559
|
-
s(
|
|
560
|
-
|
|
561
|
-
disabled:
|
|
562
|
-
invalid:
|
|
563
|
-
placeholder: s(
|
|
564
|
-
onClick:
|
|
576
|
+
}), ee({
|
|
577
|
+
default: v(({ id: V, describedby: p, invalid: q }) => [
|
|
578
|
+
s(m) ? (u(), y(ue, { key: 0 }, [
|
|
579
|
+
M(ot, Q({ id: V, "aria-describedby": p }, {
|
|
580
|
+
disabled: a.disabled,
|
|
581
|
+
invalid: q,
|
|
582
|
+
placeholder: s(d)("core.form.select.choose"),
|
|
583
|
+
onClick: c[0] || (c[0] = (B) => r.value?.present())
|
|
565
584
|
}), {
|
|
566
|
-
default:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
])) :
|
|
585
|
+
default: v(() => [
|
|
586
|
+
o.value ? (u(), y("span", pa, [
|
|
587
|
+
b("span", ba, _(s(i).date(F.value.day)), 1),
|
|
588
|
+
c[8] || (c[8] = Y(_(" "), -1)),
|
|
589
|
+
b("span", ga, _(F.value.time), 1)
|
|
590
|
+
])) : T("", !0)
|
|
572
591
|
]),
|
|
573
592
|
_: 1
|
|
574
593
|
}, 16, ["disabled", "invalid", "placeholder"]),
|
|
575
|
-
|
|
594
|
+
M($t, {
|
|
576
595
|
ref_key: "sheet",
|
|
577
|
-
ref:
|
|
578
|
-
title:
|
|
596
|
+
ref: r,
|
|
597
|
+
title: a.label ?? s(d)("core.form.date.calendar"),
|
|
579
598
|
mode: "datetime",
|
|
580
|
-
"model-value":
|
|
581
|
-
min:
|
|
582
|
-
max:
|
|
583
|
-
"disabled-dates":
|
|
584
|
-
"open-on":
|
|
585
|
-
shortcuts: s(
|
|
586
|
-
step:
|
|
587
|
-
clearable: !
|
|
588
|
-
"onUpdate:modelValue": s(
|
|
599
|
+
"model-value": o.value,
|
|
600
|
+
min: f.value.min,
|
|
601
|
+
max: f.value.max,
|
|
602
|
+
"disabled-dates": a.disabledDates,
|
|
603
|
+
"open-on": a.openOn,
|
|
604
|
+
shortcuts: s(J),
|
|
605
|
+
step: a.minuteStep,
|
|
606
|
+
clearable: !a.required,
|
|
607
|
+
"onUpdate:modelValue": s(R).set
|
|
589
608
|
}, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "step", "clearable", "onUpdate:modelValue"])
|
|
590
|
-
], 64)) : (
|
|
609
|
+
], 64)) : (u(), O(Pe, {
|
|
591
610
|
key: 1,
|
|
592
611
|
ref_key: "popover",
|
|
593
|
-
ref:
|
|
594
|
-
label:
|
|
612
|
+
ref: x,
|
|
613
|
+
label: a.label ?? s(d)("core.form.date.calendar"),
|
|
595
614
|
width: "auto",
|
|
596
615
|
placement: "bottom-start",
|
|
597
616
|
arrow: !1,
|
|
598
617
|
autofocus: !1
|
|
599
618
|
}, {
|
|
600
|
-
trigger:
|
|
601
|
-
|
|
602
|
-
class: j(["inline-flex max-w-full items-center gap-2", s(
|
|
619
|
+
trigger: v(({ attrs: B, presented: K }) => [
|
|
620
|
+
b("div", {
|
|
621
|
+
class: j(["inline-flex max-w-full items-center gap-2", s(D)])
|
|
603
622
|
}, [
|
|
604
|
-
|
|
605
|
-
id:
|
|
623
|
+
b("input", Q({
|
|
624
|
+
id: V,
|
|
606
625
|
ref_key: "input",
|
|
607
|
-
ref:
|
|
608
|
-
},
|
|
626
|
+
ref: h
|
|
627
|
+
}, B, {
|
|
609
628
|
type: "text",
|
|
610
629
|
role: "combobox",
|
|
611
630
|
autocomplete: "off",
|
|
612
631
|
size: "20",
|
|
613
|
-
name:
|
|
614
|
-
value: s(
|
|
615
|
-
placeholder: s(
|
|
616
|
-
disabled:
|
|
617
|
-
required:
|
|
618
|
-
"aria-required":
|
|
619
|
-
"aria-invalid":
|
|
620
|
-
"aria-describedby":
|
|
632
|
+
name: a.name,
|
|
633
|
+
value: s(R).text.value,
|
|
634
|
+
placeholder: s($).placeholder.value,
|
|
635
|
+
disabled: a.disabled,
|
|
636
|
+
required: a.required,
|
|
637
|
+
"aria-required": a.required || void 0,
|
|
638
|
+
"aria-invalid": q || void 0,
|
|
639
|
+
"aria-describedby": p,
|
|
621
640
|
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",
|
|
622
|
-
onInput:
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
641
|
+
onInput: c[1] || (c[1] = (U) => s(R).input(U.target.value)),
|
|
642
|
+
onFocus: c[2] || (c[2] = (U) => n("focus", U)),
|
|
643
|
+
onBlur: c[3] || (c[3] = (U) => {
|
|
644
|
+
s(R).commit(), n("blur", U);
|
|
645
|
+
}),
|
|
646
|
+
onKeydown: pe,
|
|
647
|
+
onClick: c[4] || (c[4] = (U) => X(!1))
|
|
648
|
+
}), null, 16, ya),
|
|
649
|
+
a.disabled ? T("", !0) : (u(), y("button", {
|
|
628
650
|
key: 0,
|
|
629
651
|
type: "button",
|
|
630
652
|
tabindex: "-1",
|
|
631
|
-
"aria-label": s(
|
|
653
|
+
"aria-label": s(d)("core.form.date.open"),
|
|
632
654
|
class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
|
|
633
|
-
onClick: (
|
|
655
|
+
onClick: (U) => K ? x.value?.dismiss() : X(!0)
|
|
634
656
|
}, [
|
|
635
|
-
|
|
657
|
+
M(s(te), {
|
|
636
658
|
name: "calendarLine",
|
|
637
659
|
size: 18
|
|
638
660
|
})
|
|
639
|
-
], 8,
|
|
661
|
+
], 8, ha))
|
|
640
662
|
], 2)
|
|
641
663
|
]),
|
|
642
|
-
default:
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
664
|
+
default: v(({ dismiss: B }) => [
|
|
665
|
+
b("div", ka, [
|
|
666
|
+
b("div", wa, [
|
|
667
|
+
M(_t, {
|
|
646
668
|
ref_key: "calendar",
|
|
647
|
-
ref:
|
|
648
|
-
"model-value":
|
|
649
|
-
min:
|
|
650
|
-
max:
|
|
651
|
-
"disabled-dates":
|
|
652
|
-
"open-on":
|
|
653
|
-
"onUpdate:modelValue":
|
|
669
|
+
ref: w,
|
|
670
|
+
"model-value": G.value,
|
|
671
|
+
min: f.value.min,
|
|
672
|
+
max: f.value.max,
|
|
673
|
+
"disabled-dates": a.disabledDates,
|
|
674
|
+
"open-on": a.openOn,
|
|
675
|
+
"onUpdate:modelValue": re
|
|
654
676
|
}, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on"]),
|
|
655
|
-
s(
|
|
656
|
-
|
|
657
|
-
items: s(
|
|
658
|
-
selected:
|
|
659
|
-
onPick:
|
|
677
|
+
s(J).length > 0 ? (u(), y("div", xa, [
|
|
678
|
+
M(St, {
|
|
679
|
+
items: s(J),
|
|
680
|
+
selected: G.value,
|
|
681
|
+
onPick: re
|
|
660
682
|
}, null, 8, ["items", "selected"])
|
|
661
|
-
])) :
|
|
683
|
+
])) : T("", !0)
|
|
662
684
|
]),
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
for: s(
|
|
685
|
+
b("div", $a, [
|
|
686
|
+
b("label", {
|
|
687
|
+
for: s(xe),
|
|
666
688
|
class: "text-footnote font-semibold text-content-muted"
|
|
667
|
-
},
|
|
668
|
-
|
|
669
|
-
id: s(
|
|
689
|
+
}, _(s(d)("core.form.time.label")), 9, _a),
|
|
690
|
+
b("input", {
|
|
691
|
+
id: s(xe),
|
|
670
692
|
type: "text",
|
|
671
693
|
autocomplete: "off",
|
|
672
694
|
inputmode: "numeric",
|
|
673
|
-
value: s(
|
|
674
|
-
placeholder: s(
|
|
675
|
-
"aria-invalid": s(
|
|
695
|
+
value: s(W).text.value,
|
|
696
|
+
placeholder: s(I).placeholder.value,
|
|
697
|
+
"aria-invalid": s(W).message.value ? !0 : void 0,
|
|
676
698
|
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",
|
|
677
|
-
onInput:
|
|
678
|
-
onBlur:
|
|
679
|
-
onKeydown:
|
|
680
|
-
}, null, 40,
|
|
681
|
-
|
|
682
|
-
"model-value":
|
|
683
|
-
step:
|
|
684
|
-
"onUpdate:modelValue":
|
|
699
|
+
onInput: c[5] || (c[5] = (K) => s(W).input(K.target.value)),
|
|
700
|
+
onBlur: c[6] || (c[6] = (K) => s(W).commit()),
|
|
701
|
+
onKeydown: c[7] || (c[7] = Ce(be((K) => s(W).commit(), ["prevent"]), ["enter"]))
|
|
702
|
+
}, null, 40, Sa),
|
|
703
|
+
M(Ct, {
|
|
704
|
+
"model-value": ne.value,
|
|
705
|
+
step: a.minuteStep,
|
|
706
|
+
"onUpdate:modelValue": le
|
|
685
707
|
}, null, 8, ["model-value", "step"]),
|
|
686
|
-
|
|
708
|
+
b("button", {
|
|
687
709
|
type: "button",
|
|
688
710
|
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",
|
|
689
|
-
onClick: (
|
|
690
|
-
},
|
|
711
|
+
onClick: (K) => ke(B)
|
|
712
|
+
}, _(s(d)("core.form.time.now")), 9, Ca)
|
|
691
713
|
])
|
|
692
714
|
])
|
|
693
715
|
]),
|
|
@@ -696,51 +718,51 @@ const Qt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Zt = ["name
|
|
|
696
718
|
]),
|
|
697
719
|
_: 2
|
|
698
720
|
}, [
|
|
699
|
-
|
|
721
|
+
L.$slots.trailing ? {
|
|
700
722
|
name: "trailing",
|
|
701
|
-
fn:
|
|
702
|
-
|
|
723
|
+
fn: v(() => [
|
|
724
|
+
C(L.$slots, "trailing")
|
|
703
725
|
]),
|
|
704
726
|
key: "0"
|
|
705
727
|
} : void 0,
|
|
706
|
-
|
|
728
|
+
L.$slots.labelTrailing ? {
|
|
707
729
|
name: "labelTrailing",
|
|
708
|
-
fn:
|
|
709
|
-
|
|
730
|
+
fn: v(() => [
|
|
731
|
+
C(L.$slots, "labelTrailing")
|
|
710
732
|
]),
|
|
711
733
|
key: "1"
|
|
712
734
|
} : void 0,
|
|
713
|
-
|
|
735
|
+
L.$slots.readonly ? {
|
|
714
736
|
name: "readonly",
|
|
715
|
-
fn:
|
|
716
|
-
|
|
737
|
+
fn: v(() => [
|
|
738
|
+
C(L.$slots, "readonly")
|
|
717
739
|
]),
|
|
718
740
|
key: "2"
|
|
719
741
|
} : void 0
|
|
720
742
|
]), 1040, ["value"]));
|
|
721
743
|
}
|
|
722
744
|
});
|
|
723
|
-
function nt(
|
|
745
|
+
function nt(l, t = {}) {
|
|
724
746
|
const e = t.accept ?? [];
|
|
725
747
|
if (e.length > 0) {
|
|
726
|
-
const a =
|
|
727
|
-
if (!e.some((
|
|
728
|
-
const
|
|
729
|
-
return
|
|
748
|
+
const a = l.name.lastIndexOf("."), o = a === -1 ? "" : l.name.slice(a).toLowerCase(), n = l.type.toLowerCase();
|
|
749
|
+
if (!e.some((i) => {
|
|
750
|
+
const m = i.trim().toLowerCase();
|
|
751
|
+
return m.startsWith(".") ? m === o : m.endsWith("/*") ? n.startsWith(m.slice(0, -1)) : m === n;
|
|
730
752
|
})) return "invalid_type";
|
|
731
753
|
}
|
|
732
|
-
return (t.maxSize ?? 0) > 0 &&
|
|
754
|
+
return (t.maxSize ?? 0) > 0 && l.size > (t.maxSize ?? 0) ? "too_large" : null;
|
|
733
755
|
}
|
|
734
|
-
function Be(
|
|
735
|
-
return
|
|
756
|
+
function Be(l) {
|
|
757
|
+
return l < 1024 ? `${l} B` : l < 1024 * 1024 ? `${Math.round(l / 1024)} KB` : `${(l / (1024 * 1024)).toFixed(l % (1024 * 1024) === 0 ? 0 : 1)} MB`;
|
|
736
758
|
}
|
|
737
|
-
const
|
|
759
|
+
const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], La = {
|
|
738
760
|
key: 0,
|
|
739
761
|
class: "flex items-center gap-3 rounded-group bg-fill p-3",
|
|
740
762
|
"data-test": "file-selected"
|
|
741
|
-
},
|
|
763
|
+
}, Ta = { class: "min-w-0 flex-1" }, za = { class: "truncate text-body font-medium text-content-strong" }, Da = { class: "text-footnote text-content-muted" }, Va = ["disabled", "aria-label", "title"], qa = ["aria-disabled"], Ra = { class: "font-semibold text-content-link" }, Oa = { class: "text-content-muted" }, Co = /* @__PURE__ */ P({
|
|
742
764
|
__name: "FileField",
|
|
743
|
-
props: /* @__PURE__ */
|
|
765
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
744
766
|
label: {},
|
|
745
767
|
labelHidden: { type: Boolean },
|
|
746
768
|
hint: {},
|
|
@@ -754,91 +776,91 @@ const Sa = { class: "w-full" }, Ca = ["id", "accept", "disabled", "aria-describe
|
|
|
754
776
|
variant: {},
|
|
755
777
|
accept: {},
|
|
756
778
|
maxSize: {}
|
|
757
|
-
}, { ...
|
|
779
|
+
}, { ...ve, variant: "button", accept: () => [], maxSize: 0 }), {
|
|
758
780
|
modelValue: { default: null },
|
|
759
781
|
modelModifiers: {}
|
|
760
782
|
}),
|
|
761
783
|
emits: ["update:modelValue"],
|
|
762
|
-
setup(
|
|
763
|
-
const e =
|
|
784
|
+
setup(l, { expose: t }) {
|
|
785
|
+
const e = l, a = ie(l, "modelValue"), { t: o } = oe(), n = H("chooser"), d = N(!1), i = N(null), m = k(() => {
|
|
764
786
|
if (e.hint) return e.hint;
|
|
765
|
-
const
|
|
766
|
-
return e.accept.length &&
|
|
787
|
+
const w = [];
|
|
788
|
+
return e.accept.length && w.push(o("core.form.file.allowed", { formats: e.accept.map((r) => r.replace(/^\./, "").toUpperCase()).join(", ") })), e.maxSize > 0 && w.push(o("core.form.file.max_size", { size: Be(e.maxSize) })), w.join(" · ") || void 0;
|
|
767
789
|
});
|
|
768
|
-
function
|
|
769
|
-
if (!
|
|
770
|
-
const r = nt(
|
|
771
|
-
r ? (
|
|
790
|
+
function h(w) {
|
|
791
|
+
if (!w) return;
|
|
792
|
+
const r = nt(w, { accept: e.accept, maxSize: e.maxSize });
|
|
793
|
+
r ? (i.value = r === "invalid_type" ? o("core.form.file.invalid_type") : o("core.form.file.too_large", { size: Be(e.maxSize) }), a.value = null) : (i.value = null, a.value = w);
|
|
772
794
|
}
|
|
773
|
-
function
|
|
774
|
-
a.value = null,
|
|
795
|
+
function x() {
|
|
796
|
+
a.value = null, i.value = null;
|
|
775
797
|
}
|
|
776
|
-
return
|
|
777
|
-
!
|
|
778
|
-
}), t({ clear:
|
|
798
|
+
return de(a, (w) => {
|
|
799
|
+
!w && n.value && (n.value.value = "");
|
|
800
|
+
}), t({ clear: x }), (w, r) => (u(), O(ye, Q({ ...s(fe)(e), hint: m.value, error: i.value ?? e.error }, {
|
|
779
801
|
value: a.value?.name ?? null,
|
|
780
802
|
"row-layout": "stacked"
|
|
781
|
-
}),
|
|
782
|
-
default:
|
|
783
|
-
|
|
784
|
-
|
|
803
|
+
}), ee({
|
|
804
|
+
default: v(({ id: f, describedby: g, invalid: S }) => [
|
|
805
|
+
b("div", Fa, [
|
|
806
|
+
b("input", {
|
|
785
807
|
id: f,
|
|
786
808
|
ref_key: "chooser",
|
|
787
|
-
ref:
|
|
809
|
+
ref: n,
|
|
788
810
|
type: "file",
|
|
789
811
|
class: "sr-only",
|
|
790
812
|
tabindex: "-1",
|
|
791
813
|
accept: e.accept.join(",") || void 0,
|
|
792
814
|
disabled: e.disabled,
|
|
793
|
-
"aria-describedby":
|
|
815
|
+
"aria-describedby": g,
|
|
794
816
|
"aria-invalid": S || void 0,
|
|
795
|
-
onChange: r[0] || (r[0] = (
|
|
796
|
-
}, null, 40,
|
|
797
|
-
a.value ? (
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
817
|
+
onChange: r[0] || (r[0] = (z) => h(z.target.files?.[0]))
|
|
818
|
+
}, null, 40, Ba),
|
|
819
|
+
a.value ? (u(), y("div", La, [
|
|
820
|
+
b("div", Ta, [
|
|
821
|
+
b("p", za, _(a.value.name), 1),
|
|
822
|
+
b("p", Da, _(s(Be)(a.value.size)), 1)
|
|
801
823
|
]),
|
|
802
|
-
|
|
824
|
+
b("button", {
|
|
803
825
|
type: "button",
|
|
804
826
|
disabled: e.disabled,
|
|
805
|
-
"aria-label": s(
|
|
806
|
-
title: s(
|
|
827
|
+
"aria-label": s(o)("core.form.file.remove"),
|
|
828
|
+
title: s(o)("core.form.file.remove"),
|
|
807
829
|
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",
|
|
808
|
-
onClick:
|
|
830
|
+
onClick: x
|
|
809
831
|
}, [
|
|
810
|
-
|
|
832
|
+
M(s(te), {
|
|
811
833
|
name: "close",
|
|
812
834
|
size: 14
|
|
813
835
|
})
|
|
814
|
-
], 8,
|
|
815
|
-
])) : e.variant === "dropzone" ? (
|
|
836
|
+
], 8, Va)
|
|
837
|
+
])) : e.variant === "dropzone" ? (u(), y("div", {
|
|
816
838
|
key: 1,
|
|
817
839
|
role: "button",
|
|
818
840
|
tabindex: "0",
|
|
819
841
|
"data-test": "file-dropzone",
|
|
820
842
|
"aria-disabled": e.disabled || void 0,
|
|
821
|
-
class: j(["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",
|
|
822
|
-
onClick: r[1] || (r[1] = (
|
|
843
|
+
class: j(["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", d.value ? "border-border-focus bg-tint-soft" : "border-border-control hover:bg-fill"]),
|
|
844
|
+
onClick: r[1] || (r[1] = (z) => !e.disabled && n.value?.click()),
|
|
823
845
|
onKeydown: [
|
|
824
|
-
r[2] || (r[2] = Ce(
|
|
825
|
-
r[3] || (r[3] = Ce(
|
|
846
|
+
r[2] || (r[2] = Ce(be((z) => !e.disabled && n.value?.click(), ["prevent"]), ["enter"])),
|
|
847
|
+
r[3] || (r[3] = Ce(be((z) => !e.disabled && n.value?.click(), ["prevent"]), ["space"]))
|
|
826
848
|
],
|
|
827
|
-
onDragover: r[4] || (r[4] =
|
|
828
|
-
onDragleave: r[5] || (r[5] =
|
|
829
|
-
onDrop: r[6] || (r[6] =
|
|
830
|
-
|
|
849
|
+
onDragover: r[4] || (r[4] = be((z) => d.value = !0, ["prevent"])),
|
|
850
|
+
onDragleave: r[5] || (r[5] = be((z) => d.value = !1, ["prevent"])),
|
|
851
|
+
onDrop: r[6] || (r[6] = be((z) => {
|
|
852
|
+
d.value = !1, e.disabled || h(z.dataTransfer?.files?.[0]);
|
|
831
853
|
}, ["prevent"]))
|
|
832
854
|
}, [
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
], 42,
|
|
855
|
+
b("span", Ra, _(s(o)("core.form.file.choose")), 1),
|
|
856
|
+
b("span", Oa, _(" " + s(o)("core.form.file.drop")), 1)
|
|
857
|
+
], 42, qa)) : (u(), O(ge, {
|
|
836
858
|
key: 2,
|
|
837
859
|
disabled: e.disabled,
|
|
838
|
-
onClick: r[7] || (r[7] = (
|
|
860
|
+
onClick: r[7] || (r[7] = (z) => n.value?.click())
|
|
839
861
|
}, {
|
|
840
|
-
default:
|
|
841
|
-
Y(
|
|
862
|
+
default: v(() => [
|
|
863
|
+
Y(_(s(o)("core.form.file.choose")), 1)
|
|
842
864
|
]),
|
|
843
865
|
_: 1
|
|
844
866
|
}, 8, ["disabled"]))
|
|
@@ -846,30 +868,30 @@ const Sa = { class: "w-full" }, Ca = ["id", "accept", "disabled", "aria-describe
|
|
|
846
868
|
]),
|
|
847
869
|
_: 2
|
|
848
870
|
}, [
|
|
849
|
-
|
|
871
|
+
w.$slots.trailing ? {
|
|
850
872
|
name: "trailing",
|
|
851
|
-
fn:
|
|
852
|
-
|
|
873
|
+
fn: v(() => [
|
|
874
|
+
C(w.$slots, "trailing")
|
|
853
875
|
]),
|
|
854
876
|
key: "0"
|
|
855
877
|
} : void 0,
|
|
856
|
-
|
|
878
|
+
w.$slots.labelTrailing ? {
|
|
857
879
|
name: "labelTrailing",
|
|
858
|
-
fn:
|
|
859
|
-
|
|
880
|
+
fn: v(() => [
|
|
881
|
+
C(w.$slots, "labelTrailing")
|
|
860
882
|
]),
|
|
861
883
|
key: "1"
|
|
862
884
|
} : void 0,
|
|
863
|
-
|
|
885
|
+
w.$slots.readonly ? {
|
|
864
886
|
name: "readonly",
|
|
865
|
-
fn:
|
|
866
|
-
|
|
887
|
+
fn: v(() => [
|
|
888
|
+
C(w.$slots, "readonly")
|
|
867
889
|
]),
|
|
868
890
|
key: "2"
|
|
869
891
|
} : void 0
|
|
870
892
|
]), 1040, ["value"]));
|
|
871
893
|
}
|
|
872
|
-
}),
|
|
894
|
+
}), Ma = ["disabled"], Fo = /* @__PURE__ */ P({
|
|
873
895
|
__name: "FormGroupButton",
|
|
874
896
|
props: {
|
|
875
897
|
label: {},
|
|
@@ -877,18 +899,18 @@ const Sa = { class: "w-full" }, Ca = ["id", "accept", "disabled", "aria-describe
|
|
|
877
899
|
disabled: { type: Boolean, default: !1 }
|
|
878
900
|
},
|
|
879
901
|
emits: ["click"],
|
|
880
|
-
setup(
|
|
881
|
-
const e =
|
|
882
|
-
return (
|
|
883
|
-
default:
|
|
884
|
-
|
|
885
|
-
default:
|
|
886
|
-
|
|
902
|
+
setup(l, { emit: t }) {
|
|
903
|
+
const e = l, a = t;
|
|
904
|
+
return (o, n) => (u(), O(qt, null, {
|
|
905
|
+
default: v(() => [
|
|
906
|
+
M(vt, { layout: "stacked" }, {
|
|
907
|
+
default: v(() => [
|
|
908
|
+
b("button", {
|
|
887
909
|
type: "button",
|
|
888
910
|
disabled: e.disabled,
|
|
889
911
|
class: j(["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"]),
|
|
890
|
-
onClick:
|
|
891
|
-
},
|
|
912
|
+
onClick: n[0] || (n[0] = (d) => a("click"))
|
|
913
|
+
}, _(e.label), 11, Ma)
|
|
892
914
|
]),
|
|
893
915
|
_: 1
|
|
894
916
|
})
|
|
@@ -896,31 +918,31 @@ const Sa = { class: "w-full" }, Ca = ["id", "accept", "disabled", "aria-describe
|
|
|
896
918
|
_: 1
|
|
897
919
|
}));
|
|
898
920
|
}
|
|
899
|
-
}),
|
|
921
|
+
}), Bo = /* @__PURE__ */ P({
|
|
900
922
|
__name: "FormIndent",
|
|
901
|
-
setup(
|
|
902
|
-
return Re(
|
|
923
|
+
setup(l) {
|
|
924
|
+
return Re(mt, pt() + 1), (t, e) => C(t.$slots, "default");
|
|
903
925
|
}
|
|
904
926
|
});
|
|
905
|
-
function
|
|
906
|
-
return t.filter((e) => (
|
|
927
|
+
function ja(l, t) {
|
|
928
|
+
return t.filter((e) => (l?.[e] ?? "").trim() === "");
|
|
907
929
|
}
|
|
908
|
-
const
|
|
930
|
+
const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], Ga = ["id", "value", "lang", "name", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], Na = {
|
|
909
931
|
key: 0,
|
|
910
932
|
class: "mt-1.5 flex items-center gap-2"
|
|
911
|
-
},
|
|
933
|
+
}, Pa = {
|
|
912
934
|
key: 0,
|
|
913
935
|
class: "flex-1 text-footnote text-status-warning-content",
|
|
914
936
|
"data-test": "i18n-missing"
|
|
915
|
-
},
|
|
937
|
+
}, Ka = {
|
|
916
938
|
key: 1,
|
|
917
939
|
class: "flex-1"
|
|
918
|
-
},
|
|
940
|
+
}, Aa = ["aria-label"], Ha = ["id", "aria-selected", "tabindex", "aria-controls", "aria-label", "title", "onClick", "onKeydown"], Ua = ["data-state"], Ya = { class: "w-full" }, Wa = { class: "whitespace-pre-line break-words text-body text-content-strong" }, Ja = ["aria-expanded"], Za = { class: "flex-1" }, Xa = {
|
|
919
941
|
key: 0,
|
|
920
942
|
class: "mt-1 flex flex-col gap-1.5"
|
|
921
|
-
},
|
|
943
|
+
}, Qa = ["title"], Lo = /* @__PURE__ */ P({
|
|
922
944
|
__name: "I18nField",
|
|
923
|
-
props: /* @__PURE__ */
|
|
945
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
924
946
|
label: {},
|
|
925
947
|
labelHidden: { type: Boolean },
|
|
926
948
|
hint: {},
|
|
@@ -938,198 +960,198 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
938
960
|
rows: {},
|
|
939
961
|
placeholder: {},
|
|
940
962
|
maxLength: {}
|
|
941
|
-
}, { ...
|
|
963
|
+
}, { ...ve, locales: void 0, defaultLocale: void 0, requiredLocales: () => [], multiline: !1, rows: 3, placeholder: void 0, maxLength: void 0 }), {
|
|
942
964
|
modelValue: { default: () => ({}) },
|
|
943
965
|
modelModifiers: {}
|
|
944
966
|
}),
|
|
945
967
|
emits: ["update:modelValue"],
|
|
946
|
-
setup(
|
|
947
|
-
const e =
|
|
948
|
-
function
|
|
968
|
+
setup(l, { expose: t }) {
|
|
969
|
+
const e = l, a = ie(l, "modelValue"), { t: o, locale: n, availableLocales: d } = oe(), i = tt(Mt, null), m = je(), h = H("field"), x = H("root"), { editable: w } = at(e), r = Ge(e.multiline ? "area" : "text", () => e.error || ne.value ? "error" : e.disabled ? "locked" : "rest"), f = k(() => e.locales ?? i?.locales ?? d), g = k(() => e.defaultLocale ?? f.value[0] ?? ""), S = k(() => f.value.includes(g.value) ? [g.value, ...f.value.filter((p) => p !== g.value)] : f.value), z = N(null), $ = k(() => z.value !== null && S.value.includes(z.value) ? z.value : S.value.includes(n.value) ? n.value : g.value), I = (p) => a.value[p] ?? "", F = (p) => I(p).trim() !== "", E = (p) => p.toUpperCase();
|
|
970
|
+
function R(p) {
|
|
949
971
|
try {
|
|
950
|
-
return new Intl.DisplayNames([
|
|
972
|
+
return new Intl.DisplayNames([Ot(n.value)], { type: "language" }).of(p) ?? E(p);
|
|
951
973
|
} catch {
|
|
952
|
-
return E(
|
|
974
|
+
return E(p);
|
|
953
975
|
}
|
|
954
976
|
}
|
|
955
|
-
const
|
|
956
|
-
function
|
|
957
|
-
a.value = { ...a.value, [
|
|
977
|
+
const Z = (p) => p.map(R).join(", ");
|
|
978
|
+
function W(p, q) {
|
|
979
|
+
a.value = { ...a.value, [p]: q };
|
|
958
980
|
}
|
|
959
|
-
const
|
|
960
|
-
function
|
|
961
|
-
|
|
981
|
+
const J = (p) => `${m}-tab-${p}`;
|
|
982
|
+
function ae(p, q) {
|
|
983
|
+
z.value = p, q && he(() => h.value?.focus());
|
|
962
984
|
}
|
|
963
|
-
function
|
|
964
|
-
const
|
|
965
|
-
if (
|
|
966
|
-
|
|
967
|
-
const
|
|
968
|
-
|
|
985
|
+
function me(p, q) {
|
|
986
|
+
const B = S.value.length - 1, K = { ArrowRight: q + 1, ArrowLeft: q - 1, Home: 0, End: B }[p.key];
|
|
987
|
+
if (K === void 0) return;
|
|
988
|
+
p.preventDefault();
|
|
989
|
+
const U = S.value[(K + S.value.length) % S.value.length];
|
|
990
|
+
U !== void 0 && (ae(U, !1), he(() => document.getElementById(J(U))?.focus()));
|
|
969
991
|
}
|
|
970
|
-
const
|
|
971
|
-
function A(
|
|
972
|
-
|
|
992
|
+
const D = N(!1);
|
|
993
|
+
function A(p) {
|
|
994
|
+
x.value?.contains(p.relatedTarget) || (D.value = !0);
|
|
973
995
|
}
|
|
974
|
-
const
|
|
975
|
-
function
|
|
976
|
-
const
|
|
977
|
-
a.value = { ...a.value, ...Object.fromEntries(S.value.filter((
|
|
996
|
+
const G = k(() => ja(a.value, e.requiredLocales)), ne = k(() => D.value && G.value.length > 0 ? o("core.form.i18n.required", { languages: Z(G.value) }) : void 0), re = k(() => e.requiredLocales.length > 0 ? G.value.length === 0 : S.value.some(F)), le = k(() => S.value.filter((p) => !F(p) && !(ne.value && G.value.includes(p)))), ke = k(() => F(g.value) && S.value.some((p) => p !== g.value && !F(p)));
|
|
997
|
+
function xe() {
|
|
998
|
+
const p = I(g.value);
|
|
999
|
+
a.value = { ...a.value, ...Object.fromEntries(S.value.filter((q) => !F(q)).map((q) => [q, p])) };
|
|
978
1000
|
}
|
|
979
|
-
const
|
|
980
|
-
return t({ focus: () =>
|
|
981
|
-
value: s(
|
|
1001
|
+
const X = k(() => [n.value, g.value, ...S.value].find((p) => S.value.includes(p) && F(p))), pe = k(() => S.value.filter((p) => p !== X.value)), L = k(() => pe.value.filter(F).length), c = N(!1), V = k(() => e.label && !w.value && X.value ? `${e.label} · ${E(X.value)}` : e.label);
|
|
1002
|
+
return t({ focus: () => h.value?.focus() }), (p, q) => (u(), O(ye, Q({ ...s(fe)(e), label: V.value, error: e.error ?? ne.value, required: e.required || e.requiredLocales.length > 0 }, {
|
|
1003
|
+
value: s(w) ? re.value ? "written" : null : X.value ? I(X.value) : null,
|
|
982
1004
|
"row-layout": "stacked"
|
|
983
|
-
}),
|
|
984
|
-
default:
|
|
985
|
-
|
|
1005
|
+
}), ee({
|
|
1006
|
+
default: v(({ id: B, describedby: K, invalid: U }) => [
|
|
1007
|
+
b("div", {
|
|
986
1008
|
ref_key: "root",
|
|
987
|
-
ref:
|
|
1009
|
+
ref: x,
|
|
988
1010
|
class: "w-full",
|
|
989
1011
|
onFocusout: A
|
|
990
1012
|
}, [
|
|
991
|
-
|
|
992
|
-
id: `${s(
|
|
1013
|
+
b("div", {
|
|
1014
|
+
id: `${s(m)}-panel`,
|
|
993
1015
|
role: "tabpanel",
|
|
994
|
-
"aria-labelledby":
|
|
1016
|
+
"aria-labelledby": J($.value)
|
|
995
1017
|
}, [
|
|
996
|
-
|
|
1018
|
+
b("div", {
|
|
997
1019
|
class: j(["w-full", s(r)])
|
|
998
1020
|
}, [
|
|
999
|
-
e.multiline ? (
|
|
1021
|
+
e.multiline ? (u(), y("textarea", {
|
|
1000
1022
|
key: 0,
|
|
1001
|
-
id:
|
|
1023
|
+
id: B,
|
|
1002
1024
|
ref_key: "field",
|
|
1003
|
-
ref:
|
|
1004
|
-
value:
|
|
1005
|
-
lang:
|
|
1025
|
+
ref: h,
|
|
1026
|
+
value: I($.value),
|
|
1027
|
+
lang: $.value,
|
|
1006
1028
|
name: e.name,
|
|
1007
1029
|
rows: e.rows,
|
|
1008
1030
|
placeholder: e.placeholder,
|
|
1009
1031
|
maxlength: e.maxLength,
|
|
1010
1032
|
disabled: e.disabled,
|
|
1011
1033
|
"aria-required": e.required || void 0,
|
|
1012
|
-
"aria-invalid":
|
|
1013
|
-
"aria-describedby":
|
|
1034
|
+
"aria-invalid": U || void 0,
|
|
1035
|
+
"aria-describedby": K,
|
|
1014
1036
|
"data-test": "i18n-input",
|
|
1015
1037
|
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",
|
|
1016
|
-
onInput:
|
|
1017
|
-
}, null, 40,
|
|
1038
|
+
onInput: q[0] || (q[0] = (Te) => W($.value, Te.target.value))
|
|
1039
|
+
}, null, 40, Ia)) : (u(), y("input", {
|
|
1018
1040
|
key: 1,
|
|
1019
|
-
id:
|
|
1041
|
+
id: B,
|
|
1020
1042
|
ref_key: "field",
|
|
1021
|
-
ref:
|
|
1022
|
-
value:
|
|
1023
|
-
lang:
|
|
1043
|
+
ref: h,
|
|
1044
|
+
value: I($.value),
|
|
1045
|
+
lang: $.value,
|
|
1024
1046
|
type: "text",
|
|
1025
1047
|
name: e.name,
|
|
1026
1048
|
placeholder: e.placeholder,
|
|
1027
1049
|
maxlength: e.maxLength,
|
|
1028
1050
|
disabled: e.disabled,
|
|
1029
1051
|
"aria-required": e.required || void 0,
|
|
1030
|
-
"aria-invalid":
|
|
1031
|
-
"aria-describedby":
|
|
1052
|
+
"aria-invalid": U || void 0,
|
|
1053
|
+
"aria-describedby": K,
|
|
1032
1054
|
"data-test": "i18n-input",
|
|
1033
1055
|
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",
|
|
1034
|
-
onInput:
|
|
1035
|
-
}, null, 40,
|
|
1056
|
+
onInput: q[1] || (q[1] = (Te) => W($.value, Te.target.value))
|
|
1057
|
+
}, null, 40, Ga))
|
|
1036
1058
|
], 2)
|
|
1037
|
-
], 8,
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1059
|
+
], 8, Ea),
|
|
1060
|
+
le.value.length > 0 || ke.value ? (u(), y("div", Na, [
|
|
1061
|
+
le.value.length > 0 ? (u(), y("p", Pa, _(s(o)("core.form.i18n.missing", { languages: Z(le.value) })), 1)) : (u(), y("span", Ka)),
|
|
1062
|
+
ke.value && !e.disabled ? (u(), y("button", {
|
|
1041
1063
|
key: 2,
|
|
1042
1064
|
type: "button",
|
|
1043
1065
|
"data-test": "i18n-copy",
|
|
1044
1066
|
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",
|
|
1045
|
-
onClick:
|
|
1046
|
-
},
|
|
1047
|
-
])) :
|
|
1067
|
+
onClick: xe
|
|
1068
|
+
}, _(s(o)("core.form.i18n.copy", { language: E(g.value) })), 1)) : T("", !0)
|
|
1069
|
+
])) : T("", !0)
|
|
1048
1070
|
], 544)
|
|
1049
1071
|
]),
|
|
1050
|
-
labelTrailing:
|
|
1051
|
-
|
|
1072
|
+
labelTrailing: v(() => [
|
|
1073
|
+
b("div", {
|
|
1052
1074
|
role: "tablist",
|
|
1053
|
-
"aria-label": s(
|
|
1075
|
+
"aria-label": s(o)("core.form.i18n.languages"),
|
|
1054
1076
|
class: "flex shrink-0 gap-0.5 rounded-control bg-fill p-0.5",
|
|
1055
1077
|
"data-test": "i18n-tabs"
|
|
1056
1078
|
}, [
|
|
1057
|
-
(
|
|
1058
|
-
id:
|
|
1059
|
-
key:
|
|
1079
|
+
(u(!0), y(ue, null, we(S.value, (B, K) => (u(), y("button", {
|
|
1080
|
+
id: J(B),
|
|
1081
|
+
key: B,
|
|
1060
1082
|
type: "button",
|
|
1061
1083
|
role: "tab",
|
|
1062
|
-
"aria-selected":
|
|
1063
|
-
tabindex:
|
|
1064
|
-
"aria-controls": `${s(
|
|
1065
|
-
"aria-label": s(
|
|
1066
|
-
title:
|
|
1067
|
-
class: j(["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",
|
|
1068
|
-
onClick: (
|
|
1069
|
-
onKeydown: (
|
|
1084
|
+
"aria-selected": B === $.value,
|
|
1085
|
+
tabindex: B === $.value ? 0 : -1,
|
|
1086
|
+
"aria-controls": `${s(m)}-panel`,
|
|
1087
|
+
"aria-label": s(o)(F(B) ? "core.form.i18n.tab_written" : "core.form.i18n.tab_empty", { language: R(B) }),
|
|
1088
|
+
title: R(B),
|
|
1089
|
+
class: j(["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", B === $.value ? "bg-segment-selected text-content-strong shadow-sm" : "text-content-muted hover:text-content-strong"]),
|
|
1090
|
+
onClick: (U) => ae(B, !0),
|
|
1091
|
+
onKeydown: (U) => me(U, K)
|
|
1070
1092
|
}, [
|
|
1071
|
-
Y(
|
|
1072
|
-
|
|
1093
|
+
Y(_(E(B)) + " ", 1),
|
|
1094
|
+
b("span", {
|
|
1073
1095
|
"aria-hidden": "true",
|
|
1074
|
-
class: j(["size-1.5 rounded-full", F(
|
|
1096
|
+
class: j(["size-1.5 rounded-full", F(B) ? "bg-status-success-solid" : ne.value && G.value.includes(B) ? "bg-content-destructive" : "bg-content-disabled"]),
|
|
1075
1097
|
"data-test": "i18n-dot",
|
|
1076
|
-
"data-state": F(
|
|
1077
|
-
}, null, 10,
|
|
1078
|
-
], 42,
|
|
1079
|
-
], 8,
|
|
1098
|
+
"data-state": F(B) ? "written" : ne.value && G.value.includes(B) ? "required" : "empty"
|
|
1099
|
+
}, null, 10, Ua)
|
|
1100
|
+
], 42, Ha))), 128))
|
|
1101
|
+
], 8, Aa)
|
|
1080
1102
|
]),
|
|
1081
1103
|
_: 2
|
|
1082
1104
|
}, [
|
|
1083
|
-
|
|
1105
|
+
X.value ? {
|
|
1084
1106
|
name: "readonly",
|
|
1085
|
-
fn:
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1107
|
+
fn: v(() => [
|
|
1108
|
+
b("div", Ya, [
|
|
1109
|
+
b("p", Wa, _(I(X.value)), 1),
|
|
1110
|
+
pe.value.length > 0 ? (u(), y(ue, { key: 0 }, [
|
|
1111
|
+
b("button", {
|
|
1090
1112
|
type: "button",
|
|
1091
|
-
"aria-expanded":
|
|
1113
|
+
"aria-expanded": c.value,
|
|
1092
1114
|
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",
|
|
1093
|
-
onClick:
|
|
1115
|
+
onClick: q[2] || (q[2] = (B) => c.value = !c.value)
|
|
1094
1116
|
}, [
|
|
1095
|
-
|
|
1096
|
-
|
|
1117
|
+
b("span", Za, _(s(o)("core.form.i18n.more", { count: pe.value.length, filled: L.value })), 1),
|
|
1118
|
+
M(s(te), {
|
|
1097
1119
|
name: "arrowRightSLine",
|
|
1098
1120
|
size: 16,
|
|
1099
|
-
class: j(["shrink-0 transition-transform duration-motion-fast",
|
|
1121
|
+
class: j(["shrink-0 transition-transform duration-motion-fast", c.value ? "rotate-90" : ""])
|
|
1100
1122
|
}, null, 8, ["class"])
|
|
1101
|
-
], 8,
|
|
1102
|
-
|
|
1103
|
-
(
|
|
1104
|
-
key:
|
|
1123
|
+
], 8, Ja),
|
|
1124
|
+
c.value ? (u(), y("dl", Xa, [
|
|
1125
|
+
(u(!0), y(ue, null, we(pe.value, (B) => (u(), y("div", {
|
|
1126
|
+
key: B,
|
|
1105
1127
|
class: "flex gap-2 text-body"
|
|
1106
1128
|
}, [
|
|
1107
|
-
|
|
1129
|
+
b("dt", {
|
|
1108
1130
|
class: "w-8 shrink-0 text-footnote font-semibold leading-6 text-content-muted",
|
|
1109
|
-
title:
|
|
1110
|
-
},
|
|
1111
|
-
|
|
1112
|
-
class: j(["min-w-0 flex-1 whitespace-pre-line break-words", F(
|
|
1113
|
-
},
|
|
1131
|
+
title: R(B)
|
|
1132
|
+
}, _(E(B)), 9, Qa),
|
|
1133
|
+
b("dd", {
|
|
1134
|
+
class: j(["min-w-0 flex-1 whitespace-pre-line break-words", F(B) ? "text-content-strong" : "text-content-disabled"])
|
|
1135
|
+
}, _(F(B) ? I(B) : s(o)("core.state.no_value")), 3)
|
|
1114
1136
|
]))), 128))
|
|
1115
|
-
])) :
|
|
1116
|
-
], 64)) :
|
|
1137
|
+
])) : T("", !0)
|
|
1138
|
+
], 64)) : T("", !0)
|
|
1117
1139
|
])
|
|
1118
1140
|
]),
|
|
1119
1141
|
key: "0"
|
|
1120
1142
|
} : void 0,
|
|
1121
|
-
|
|
1143
|
+
p.$slots.trailing ? {
|
|
1122
1144
|
name: "trailing",
|
|
1123
|
-
fn:
|
|
1124
|
-
|
|
1145
|
+
fn: v(() => [
|
|
1146
|
+
C(p.$slots, "trailing")
|
|
1125
1147
|
]),
|
|
1126
1148
|
key: "1"
|
|
1127
1149
|
} : void 0
|
|
1128
1150
|
]), 1040, ["value"]));
|
|
1129
1151
|
}
|
|
1130
|
-
}),
|
|
1152
|
+
}), To = /* @__PURE__ */ P({
|
|
1131
1153
|
__name: "MoneyField",
|
|
1132
|
-
props: /* @__PURE__ */
|
|
1154
|
+
props: /* @__PURE__ */ ce({
|
|
1133
1155
|
label: {},
|
|
1134
1156
|
labelHidden: { type: Boolean },
|
|
1135
1157
|
hint: {},
|
|
@@ -1140,54 +1162,56 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1140
1162
|
lockedReason: {},
|
|
1141
1163
|
presentation: {},
|
|
1142
1164
|
name: {},
|
|
1165
|
+
modelValue: {},
|
|
1143
1166
|
currency: {},
|
|
1144
1167
|
decimals: {},
|
|
1168
|
+
blankZero: { type: Boolean },
|
|
1145
1169
|
negative: { type: Boolean },
|
|
1146
1170
|
width: {}
|
|
1147
|
-
}, { ...
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
setup(o, { expose: t }) {
|
|
1153
|
-
const e = o, a = le(o, "modelValue"), n = H("field");
|
|
1154
|
-
return t({ focus: () => n.value?.focus() }), (l, u) => (i(), q(jt, J({
|
|
1171
|
+
}, { ...ve, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
|
|
1172
|
+
emits: ["update:modelValue", "focus", "blur"],
|
|
1173
|
+
setup(l, { expose: t, emit: e }) {
|
|
1174
|
+
const a = l, o = e, n = H("field");
|
|
1175
|
+
return t({ focus: () => n.value?.focus() }), (d, i) => (u(), O(jt, Q({
|
|
1155
1176
|
ref_key: "field",
|
|
1156
1177
|
ref: n,
|
|
1157
|
-
|
|
1158
|
-
"onUpdate:modelValue":
|
|
1159
|
-
}, s(
|
|
1160
|
-
decimals:
|
|
1161
|
-
negative:
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1178
|
+
"model-value": a.modelValue,
|
|
1179
|
+
"onUpdate:modelValue": i[0] || (i[0] = (m) => o("update:modelValue", m))
|
|
1180
|
+
}, s(fe)(a), {
|
|
1181
|
+
decimals: a.decimals,
|
|
1182
|
+
negative: a.negative,
|
|
1183
|
+
"blank-zero": a.blankZero,
|
|
1184
|
+
suffix: a.currency,
|
|
1185
|
+
width: a.width,
|
|
1186
|
+
onFocus: i[1] || (i[1] = (m) => o("focus", m)),
|
|
1187
|
+
onBlur: i[2] || (i[2] = (m) => o("blur", m))
|
|
1188
|
+
}), ee({ _: 2 }, [
|
|
1189
|
+
d.$slots.trailing ? {
|
|
1166
1190
|
name: "trailing",
|
|
1167
|
-
fn:
|
|
1168
|
-
|
|
1191
|
+
fn: v(() => [
|
|
1192
|
+
C(d.$slots, "trailing")
|
|
1169
1193
|
]),
|
|
1170
1194
|
key: "0"
|
|
1171
1195
|
} : void 0,
|
|
1172
|
-
|
|
1196
|
+
d.$slots.labelTrailing ? {
|
|
1173
1197
|
name: "labelTrailing",
|
|
1174
|
-
fn:
|
|
1175
|
-
|
|
1198
|
+
fn: v(() => [
|
|
1199
|
+
C(d.$slots, "labelTrailing")
|
|
1176
1200
|
]),
|
|
1177
1201
|
key: "1"
|
|
1178
1202
|
} : void 0,
|
|
1179
|
-
|
|
1203
|
+
d.$slots.readonly ? {
|
|
1180
1204
|
name: "readonly",
|
|
1181
|
-
fn:
|
|
1182
|
-
|
|
1205
|
+
fn: v(() => [
|
|
1206
|
+
C(d.$slots, "readonly")
|
|
1183
1207
|
]),
|
|
1184
1208
|
key: "2"
|
|
1185
1209
|
} : void 0
|
|
1186
|
-
]), 1040, ["
|
|
1210
|
+
]), 1040, ["model-value", "decimals", "negative", "blank-zero", "suffix", "width"]));
|
|
1187
1211
|
}
|
|
1188
|
-
}),
|
|
1212
|
+
}), el = { class: "flex flex-col gap-2" }, tl = ["onClick"], zo = /* @__PURE__ */ P({
|
|
1189
1213
|
__name: "MonthYearField",
|
|
1190
|
-
props: /* @__PURE__ */
|
|
1214
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
1191
1215
|
label: {},
|
|
1192
1216
|
labelHidden: { type: Boolean },
|
|
1193
1217
|
hint: {},
|
|
@@ -1200,66 +1224,66 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1200
1224
|
name: {},
|
|
1201
1225
|
minYear: {},
|
|
1202
1226
|
maxYear: {}
|
|
1203
|
-
}, { ...
|
|
1227
|
+
}, { ...ve, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
|
|
1204
1228
|
month: { default: null },
|
|
1205
1229
|
monthModifiers: {},
|
|
1206
1230
|
year: { default: null },
|
|
1207
1231
|
yearModifiers: {}
|
|
1208
1232
|
}),
|
|
1209
1233
|
emits: ["update:month", "update:year"],
|
|
1210
|
-
setup(
|
|
1211
|
-
const t =
|
|
1212
|
-
function
|
|
1213
|
-
e.value =
|
|
1234
|
+
setup(l) {
|
|
1235
|
+
const t = l, e = ie(l, "month"), a = ie(l, "year"), { t: o } = oe(), n = k(() => e.value !== null && e.value >= 1 && e.value <= 12), d = (x, w) => o(`core.form.months.${w}.${x}`), i = k(() => n.value && a.value !== null ? o("core.form.months.with_year", { month: d(e.value, "long"), year: a.value }) : a.value !== null ? String(a.value) : n.value ? d(e.value, "long") : "");
|
|
1236
|
+
function m(x, w) {
|
|
1237
|
+
e.value = x.month, a.value = x.year, w();
|
|
1214
1238
|
}
|
|
1215
|
-
function x
|
|
1216
|
-
e.value = null, a.value = null,
|
|
1239
|
+
function h(x) {
|
|
1240
|
+
e.value = null, a.value = null, x();
|
|
1217
1241
|
}
|
|
1218
|
-
return (
|
|
1219
|
-
value:
|
|
1220
|
-
}),
|
|
1221
|
-
default:
|
|
1222
|
-
|
|
1223
|
-
label: t.label ??
|
|
1242
|
+
return (x, w) => (u(), O(ye, Q(s(fe)(t), {
|
|
1243
|
+
value: i.value || null
|
|
1244
|
+
}), ee({
|
|
1245
|
+
default: v(({ id: r, describedby: f, invalid: g }) => [
|
|
1246
|
+
M(Pe, {
|
|
1247
|
+
label: t.label ?? i.value,
|
|
1224
1248
|
width: "sm",
|
|
1225
1249
|
placement: "bottom-start",
|
|
1226
1250
|
arrow: !1
|
|
1227
1251
|
}, {
|
|
1228
|
-
trigger:
|
|
1229
|
-
|
|
1230
|
-
expanded:
|
|
1252
|
+
trigger: v(({ toggle: S, presented: z }) => [
|
|
1253
|
+
M(ot, Q({ id: r, "aria-describedby": f }, {
|
|
1254
|
+
expanded: z,
|
|
1231
1255
|
disabled: t.disabled,
|
|
1232
|
-
invalid:
|
|
1256
|
+
invalid: g,
|
|
1233
1257
|
onClick: S
|
|
1234
1258
|
}), {
|
|
1235
|
-
default:
|
|
1236
|
-
|
|
1237
|
-
Y(
|
|
1238
|
-
|
|
1259
|
+
default: v(() => [
|
|
1260
|
+
i.value ? (u(), y(ue, { key: 0 }, [
|
|
1261
|
+
Y(_(i.value), 1),
|
|
1262
|
+
M(s(te), {
|
|
1239
1263
|
name: "calendarLine",
|
|
1240
1264
|
size: 16,
|
|
1241
1265
|
class: "ml-2 shrink-0 text-content-muted"
|
|
1242
1266
|
})
|
|
1243
|
-
], 64)) :
|
|
1267
|
+
], 64)) : T("", !0)
|
|
1244
1268
|
]),
|
|
1245
1269
|
_: 1
|
|
1246
1270
|
}, 16, ["expanded", "disabled", "invalid", "onClick"])
|
|
1247
1271
|
]),
|
|
1248
|
-
default:
|
|
1249
|
-
|
|
1250
|
-
|
|
1272
|
+
default: v(({ dismiss: S }) => [
|
|
1273
|
+
b("div", el, [
|
|
1274
|
+
M(Bt, {
|
|
1251
1275
|
month: e.value,
|
|
1252
1276
|
year: a.value,
|
|
1253
1277
|
"min-year": t.minYear,
|
|
1254
1278
|
"max-year": t.maxYear,
|
|
1255
|
-
onPick: (
|
|
1279
|
+
onPick: (z) => m(z, S)
|
|
1256
1280
|
}, null, 8, ["month", "year", "min-year", "max-year", "onPick"]),
|
|
1257
|
-
|
|
1281
|
+
n.value || a.value !== null ? (u(), y("button", {
|
|
1258
1282
|
key: 0,
|
|
1259
1283
|
type: "button",
|
|
1260
1284
|
class: "cursor-pointer self-start rounded-control px-1 text-footnote text-content-link",
|
|
1261
|
-
onClick: (
|
|
1262
|
-
},
|
|
1285
|
+
onClick: (z) => h(S)
|
|
1286
|
+
}, _(s(o)("core.form.select.clear")), 9, tl)) : T("", !0)
|
|
1263
1287
|
])
|
|
1264
1288
|
]),
|
|
1265
1289
|
_: 2
|
|
@@ -1267,32 +1291,32 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1267
1291
|
]),
|
|
1268
1292
|
_: 2
|
|
1269
1293
|
}, [
|
|
1270
|
-
|
|
1294
|
+
x.$slots.trailing ? {
|
|
1271
1295
|
name: "trailing",
|
|
1272
|
-
fn:
|
|
1273
|
-
|
|
1296
|
+
fn: v(() => [
|
|
1297
|
+
C(x.$slots, "trailing")
|
|
1274
1298
|
]),
|
|
1275
1299
|
key: "0"
|
|
1276
1300
|
} : void 0,
|
|
1277
|
-
|
|
1301
|
+
x.$slots.labelTrailing ? {
|
|
1278
1302
|
name: "labelTrailing",
|
|
1279
|
-
fn:
|
|
1280
|
-
|
|
1303
|
+
fn: v(() => [
|
|
1304
|
+
C(x.$slots, "labelTrailing")
|
|
1281
1305
|
]),
|
|
1282
1306
|
key: "1"
|
|
1283
1307
|
} : void 0,
|
|
1284
|
-
|
|
1308
|
+
x.$slots.readonly ? {
|
|
1285
1309
|
name: "readonly",
|
|
1286
|
-
fn:
|
|
1287
|
-
|
|
1310
|
+
fn: v(() => [
|
|
1311
|
+
C(x.$slots, "readonly")
|
|
1288
1312
|
]),
|
|
1289
1313
|
key: "2"
|
|
1290
1314
|
} : void 0
|
|
1291
1315
|
]), 1040, ["value"]));
|
|
1292
1316
|
}
|
|
1293
|
-
}),
|
|
1317
|
+
}), al = { class: "flex min-w-0 flex-wrap items-center gap-1.5 py-0.5" }, ll = { class: "truncate" }, ol = ["disabled", "aria-label", "onClick"], nl = ["id", "disabled", "aria-expanded", "aria-invalid", "aria-describedby", "aria-busy"], sl = ["id", "disabled", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], rl = { class: "max-h-72 overflow-y-auto" }, il = { class: "flex items-center justify-between gap-2" }, Xe = "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", Do = /* @__PURE__ */ P({
|
|
1294
1318
|
__name: "MultiSelectField",
|
|
1295
|
-
props: /* @__PURE__ */
|
|
1319
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
1296
1320
|
label: {},
|
|
1297
1321
|
labelHidden: { type: Boolean },
|
|
1298
1322
|
hint: {},
|
|
@@ -1307,114 +1331,114 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1307
1331
|
selected: {},
|
|
1308
1332
|
placeholder: {},
|
|
1309
1333
|
searchFrom: {}
|
|
1310
|
-
}, { ...
|
|
1334
|
+
}, { ...ve, selected: () => [], placeholder: void 0, searchFrom: 9 }), {
|
|
1311
1335
|
modelValue: { default: () => [] },
|
|
1312
1336
|
modelModifiers: {}
|
|
1313
1337
|
}),
|
|
1314
1338
|
emits: ["update:modelValue"],
|
|
1315
|
-
setup(
|
|
1316
|
-
const t =
|
|
1317
|
-
const f = e.value.filter((
|
|
1339
|
+
setup(l) {
|
|
1340
|
+
const t = l, e = ie(l, "modelValue"), { t: a } = oe(), o = Ne(), n = H("sheet"), d = N(!1), i = It(() => t.options, (r) => {
|
|
1341
|
+
const f = e.value.filter((g) => r.some((S) => S.value === g));
|
|
1318
1342
|
f.length !== e.value.length && (e.value = f);
|
|
1319
|
-
}),
|
|
1320
|
-
const f =
|
|
1343
|
+
}), m = k(() => e.value.flatMap((r) => {
|
|
1344
|
+
const f = i.known.value.find((g) => g.value === r) ?? t.selected.find((g) => g.value === r);
|
|
1321
1345
|
return f ? [f] : [];
|
|
1322
|
-
})),
|
|
1323
|
-
function
|
|
1346
|
+
})), h = k(() => t.placeholder ?? a("core.form.select.choose"));
|
|
1347
|
+
function x(r) {
|
|
1324
1348
|
r !== null && (e.value = e.value.includes(r) ? e.value.filter((f) => f !== r) : [...e.value, r]);
|
|
1325
1349
|
}
|
|
1326
|
-
const
|
|
1327
|
-
return (r, f) => (
|
|
1328
|
-
value:
|
|
1350
|
+
const w = (r) => e.value = e.value.filter((f) => f !== r);
|
|
1351
|
+
return (r, f) => (u(), O(ye, Q(s(fe)(t), {
|
|
1352
|
+
value: m.value.length ? m.value.map((g) => g.label).join(", ") : null,
|
|
1329
1353
|
"row-layout": "stacked"
|
|
1330
|
-
}),
|
|
1331
|
-
default:
|
|
1332
|
-
|
|
1333
|
-
(
|
|
1334
|
-
key: String(
|
|
1354
|
+
}), ee({
|
|
1355
|
+
default: v(({ id: g, describedby: S, invalid: z }) => [
|
|
1356
|
+
b("div", al, [
|
|
1357
|
+
(u(!0), y(ue, null, we(m.value, ($) => (u(), y("span", {
|
|
1358
|
+
key: String($.value),
|
|
1335
1359
|
"data-test": "chip",
|
|
1336
1360
|
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"
|
|
1337
1361
|
}, [
|
|
1338
|
-
|
|
1339
|
-
|
|
1362
|
+
b("span", ll, _($.label), 1),
|
|
1363
|
+
b("button", {
|
|
1340
1364
|
type: "button",
|
|
1341
1365
|
disabled: t.disabled,
|
|
1342
|
-
"aria-label": `${s(a)("core.form.select.clear")}: ${
|
|
1366
|
+
"aria-label": `${s(a)("core.form.select.clear")}: ${$.label}`,
|
|
1343
1367
|
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",
|
|
1344
|
-
onClick: (
|
|
1368
|
+
onClick: (I) => w($.value)
|
|
1345
1369
|
}, [
|
|
1346
|
-
|
|
1370
|
+
M(s(te), {
|
|
1347
1371
|
name: "close",
|
|
1348
1372
|
size: 12
|
|
1349
1373
|
})
|
|
1350
|
-
], 8,
|
|
1374
|
+
], 8, ol)
|
|
1351
1375
|
]))), 128)),
|
|
1352
|
-
s(
|
|
1376
|
+
s(o) ? (u(), y("button", {
|
|
1353
1377
|
key: 0,
|
|
1354
|
-
id:
|
|
1378
|
+
id: g,
|
|
1355
1379
|
type: "button",
|
|
1356
1380
|
disabled: t.disabled,
|
|
1357
1381
|
"aria-haspopup": "dialog",
|
|
1358
|
-
"aria-expanded":
|
|
1359
|
-
"aria-invalid":
|
|
1382
|
+
"aria-expanded": d.value,
|
|
1383
|
+
"aria-invalid": z || void 0,
|
|
1360
1384
|
"aria-describedby": S,
|
|
1361
|
-
"aria-busy": s(
|
|
1362
|
-
class: j(
|
|
1363
|
-
onClick: f[0] || (f[0] = (
|
|
1385
|
+
"aria-busy": s(i).loading.value || void 0,
|
|
1386
|
+
class: j(Xe),
|
|
1387
|
+
onClick: f[0] || (f[0] = ($) => n.value?.present())
|
|
1364
1388
|
}, [
|
|
1365
|
-
s(
|
|
1389
|
+
s(i).loading.value ? (u(), O(s(te), {
|
|
1366
1390
|
key: 0,
|
|
1367
1391
|
name: "loader4Line",
|
|
1368
1392
|
size: 14,
|
|
1369
1393
|
class: "shrink-0 animate-spin"
|
|
1370
|
-
})) :
|
|
1371
|
-
Y(" " +
|
|
1372
|
-
], 8,
|
|
1394
|
+
})) : T("", !0),
|
|
1395
|
+
Y(" " + _(m.value.length ? s(a)("core.actions.edit") : h.value), 1)
|
|
1396
|
+
], 8, nl)) : (u(), O(Pe, {
|
|
1373
1397
|
key: 1,
|
|
1374
|
-
label: t.label ??
|
|
1398
|
+
label: t.label ?? h.value,
|
|
1375
1399
|
width: "lg",
|
|
1376
1400
|
"match-trigger-width": "",
|
|
1377
1401
|
placement: "bottom-start",
|
|
1378
1402
|
arrow: !1
|
|
1379
1403
|
}, {
|
|
1380
|
-
trigger:
|
|
1381
|
-
|
|
1382
|
-
id:
|
|
1404
|
+
trigger: v(({ toggle: $, attrs: I }) => [
|
|
1405
|
+
b("button", Q({
|
|
1406
|
+
id: g,
|
|
1383
1407
|
type: "button"
|
|
1384
|
-
},
|
|
1408
|
+
}, I, {
|
|
1385
1409
|
"aria-haspopup": "listbox",
|
|
1386
1410
|
disabled: t.disabled,
|
|
1387
|
-
"aria-invalid":
|
|
1411
|
+
"aria-invalid": z || void 0,
|
|
1388
1412
|
"aria-describedby": S,
|
|
1389
|
-
"aria-busy": s(
|
|
1390
|
-
class:
|
|
1391
|
-
onClick:
|
|
1413
|
+
"aria-busy": s(i).loading.value || void 0,
|
|
1414
|
+
class: Xe,
|
|
1415
|
+
onClick: $
|
|
1392
1416
|
}), [
|
|
1393
|
-
s(
|
|
1417
|
+
s(i).loading.value ? (u(), O(s(te), {
|
|
1394
1418
|
key: 0,
|
|
1395
1419
|
name: "loader4Line",
|
|
1396
1420
|
size: 14,
|
|
1397
1421
|
class: "shrink-0 animate-spin"
|
|
1398
|
-
})) :
|
|
1399
|
-
Y(" " +
|
|
1400
|
-
], 16,
|
|
1422
|
+
})) : T("", !0),
|
|
1423
|
+
Y(" " + _(m.value.length ? s(a)("core.actions.edit") : h.value), 1)
|
|
1424
|
+
], 16, sl)
|
|
1401
1425
|
]),
|
|
1402
|
-
default:
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
options: s(
|
|
1406
|
-
status: s(
|
|
1426
|
+
default: v(() => [
|
|
1427
|
+
b("div", rl, [
|
|
1428
|
+
M(We, {
|
|
1429
|
+
options: s(i).rows.value,
|
|
1430
|
+
status: s(i).status.value,
|
|
1407
1431
|
"model-value": e.value,
|
|
1408
1432
|
multiple: "",
|
|
1409
1433
|
"search-from": t.searchFrom,
|
|
1410
1434
|
presentation: "plain",
|
|
1411
|
-
onSelect:
|
|
1412
|
-
onRetry: f[1] || (f[1] = (
|
|
1413
|
-
},
|
|
1435
|
+
onSelect: x,
|
|
1436
|
+
onRetry: f[1] || (f[1] = ($) => s(i).reload())
|
|
1437
|
+
}, ee({ _: 2 }, [
|
|
1414
1438
|
r.$slots.option ? {
|
|
1415
1439
|
name: "option",
|
|
1416
|
-
fn:
|
|
1417
|
-
|
|
1440
|
+
fn: v(($) => [
|
|
1441
|
+
C(r.$slots, "option", Ve(qe($)))
|
|
1418
1442
|
]),
|
|
1419
1443
|
key: "0"
|
|
1420
1444
|
} : void 0
|
|
@@ -1424,88 +1448,88 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1424
1448
|
_: 2
|
|
1425
1449
|
}, 1032, ["label"]))
|
|
1426
1450
|
]),
|
|
1427
|
-
s(
|
|
1451
|
+
s(o) ? (u(), O(Et, {
|
|
1428
1452
|
key: 0,
|
|
1429
1453
|
ref_key: "sheet",
|
|
1430
|
-
ref:
|
|
1431
|
-
title: t.label ??
|
|
1454
|
+
ref: n,
|
|
1455
|
+
title: t.label ?? h.value,
|
|
1432
1456
|
grouped: "",
|
|
1433
|
-
onPresented: f[5] || (f[5] = (
|
|
1434
|
-
onDismissed: f[6] || (f[6] = (
|
|
1457
|
+
onPresented: f[5] || (f[5] = ($) => d.value = !0),
|
|
1458
|
+
onDismissed: f[6] || (f[6] = ($) => d.value = !1)
|
|
1435
1459
|
}, {
|
|
1436
|
-
footer:
|
|
1437
|
-
|
|
1438
|
-
|
|
1460
|
+
footer: v(() => [
|
|
1461
|
+
b("div", il, [
|
|
1462
|
+
M(ge, {
|
|
1439
1463
|
prominence: "plain",
|
|
1440
1464
|
disabled: e.value.length === 0,
|
|
1441
|
-
onClick: f[3] || (f[3] = (
|
|
1465
|
+
onClick: f[3] || (f[3] = ($) => e.value = [])
|
|
1442
1466
|
}, {
|
|
1443
|
-
default:
|
|
1444
|
-
Y(
|
|
1467
|
+
default: v(() => [
|
|
1468
|
+
Y(_(s(a)("core.form.select.clear")), 1)
|
|
1445
1469
|
]),
|
|
1446
1470
|
_: 1
|
|
1447
1471
|
}, 8, ["disabled"]),
|
|
1448
|
-
|
|
1472
|
+
M(ge, {
|
|
1449
1473
|
prominence: "primary",
|
|
1450
|
-
onClick: f[4] || (f[4] = (
|
|
1474
|
+
onClick: f[4] || (f[4] = ($) => n.value?.dismiss())
|
|
1451
1475
|
}, {
|
|
1452
|
-
default:
|
|
1453
|
-
Y(
|
|
1476
|
+
default: v(() => [
|
|
1477
|
+
Y(_(s(a)("core.form.select.done")), 1)
|
|
1454
1478
|
]),
|
|
1455
1479
|
_: 1
|
|
1456
1480
|
})
|
|
1457
1481
|
])
|
|
1458
1482
|
]),
|
|
1459
|
-
default:
|
|
1460
|
-
|
|
1461
|
-
options: s(
|
|
1462
|
-
status: s(
|
|
1483
|
+
default: v(() => [
|
|
1484
|
+
M(We, {
|
|
1485
|
+
options: s(i).rows.value,
|
|
1486
|
+
status: s(i).status.value,
|
|
1463
1487
|
"model-value": e.value,
|
|
1464
1488
|
multiple: "",
|
|
1465
1489
|
"search-from": t.searchFrom,
|
|
1466
|
-
onSelect:
|
|
1467
|
-
onRetry: f[2] || (f[2] = (
|
|
1468
|
-
},
|
|
1490
|
+
onSelect: x,
|
|
1491
|
+
onRetry: f[2] || (f[2] = ($) => s(i).reload())
|
|
1492
|
+
}, ee({ _: 2 }, [
|
|
1469
1493
|
r.$slots.option ? {
|
|
1470
1494
|
name: "option",
|
|
1471
|
-
fn:
|
|
1472
|
-
|
|
1495
|
+
fn: v(($) => [
|
|
1496
|
+
C(r.$slots, "option", Ve(qe($)))
|
|
1473
1497
|
]),
|
|
1474
1498
|
key: "0"
|
|
1475
1499
|
} : void 0
|
|
1476
1500
|
]), 1032, ["options", "status", "model-value", "search-from"])
|
|
1477
1501
|
]),
|
|
1478
1502
|
_: 3
|
|
1479
|
-
}, 8, ["title"])) :
|
|
1503
|
+
}, 8, ["title"])) : T("", !0)
|
|
1480
1504
|
]),
|
|
1481
1505
|
_: 2
|
|
1482
1506
|
}, [
|
|
1483
1507
|
r.$slots.trailing ? {
|
|
1484
1508
|
name: "trailing",
|
|
1485
|
-
fn:
|
|
1486
|
-
|
|
1509
|
+
fn: v(() => [
|
|
1510
|
+
C(r.$slots, "trailing")
|
|
1487
1511
|
]),
|
|
1488
1512
|
key: "0"
|
|
1489
1513
|
} : void 0,
|
|
1490
1514
|
r.$slots.labelTrailing ? {
|
|
1491
1515
|
name: "labelTrailing",
|
|
1492
|
-
fn:
|
|
1493
|
-
|
|
1516
|
+
fn: v(() => [
|
|
1517
|
+
C(r.$slots, "labelTrailing")
|
|
1494
1518
|
]),
|
|
1495
1519
|
key: "1"
|
|
1496
1520
|
} : void 0,
|
|
1497
1521
|
r.$slots.readonly ? {
|
|
1498
1522
|
name: "readonly",
|
|
1499
|
-
fn:
|
|
1500
|
-
|
|
1523
|
+
fn: v(() => [
|
|
1524
|
+
C(r.$slots, "readonly")
|
|
1501
1525
|
]),
|
|
1502
1526
|
key: "2"
|
|
1503
1527
|
} : void 0
|
|
1504
1528
|
]), 1040, ["value"]));
|
|
1505
1529
|
}
|
|
1506
|
-
}),
|
|
1530
|
+
}), ul = ["aria-label"], dl = ["src"], cl = { class: "flex flex-wrap items-center gap-3" }, fl = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], vl = ["aria-label"], ml = ["src"], Vo = /* @__PURE__ */ P({
|
|
1507
1531
|
__name: "PhotoField",
|
|
1508
|
-
props: /* @__PURE__ */
|
|
1532
|
+
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
1509
1533
|
label: {},
|
|
1510
1534
|
labelHidden: { type: Boolean },
|
|
1511
1535
|
hint: {},
|
|
@@ -1518,135 +1542,135 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1518
1542
|
name: {},
|
|
1519
1543
|
accept: {},
|
|
1520
1544
|
maxSize: {}
|
|
1521
|
-
}, { ...
|
|
1545
|
+
}, { ...ve, accept: () => ["image/jpeg", "image/png", "image/webp", "image/gif"], maxSize: 5 * 1024 * 1024 }), {
|
|
1522
1546
|
modelValue: { default: null },
|
|
1523
1547
|
modelModifiers: {}
|
|
1524
1548
|
}),
|
|
1525
1549
|
emits: ["update:modelValue"],
|
|
1526
|
-
setup(
|
|
1527
|
-
const t =
|
|
1528
|
-
function
|
|
1529
|
-
|
|
1550
|
+
setup(l) {
|
|
1551
|
+
const t = l, e = ie(l, "modelValue"), { t: a } = oe(), o = H("chooser"), n = N(null), d = N(null);
|
|
1552
|
+
function i() {
|
|
1553
|
+
d.value && URL.revokeObjectURL(d.value), d.value = null;
|
|
1530
1554
|
}
|
|
1531
|
-
|
|
1555
|
+
de(
|
|
1532
1556
|
e,
|
|
1533
1557
|
(r) => {
|
|
1534
|
-
|
|
1558
|
+
i(), r instanceof File && (d.value = URL.createObjectURL(r)), r === null && o.value && (o.value.value = "");
|
|
1535
1559
|
},
|
|
1536
1560
|
{ immediate: !0 }
|
|
1537
|
-
), Ee(
|
|
1538
|
-
const
|
|
1539
|
-
function
|
|
1561
|
+
), Ee(i);
|
|
1562
|
+
const m = k(() => e.value instanceof File ? d.value : e.value), h = H("viewer"), x = k(() => m.value ? [{ src: m.value, alt: t.label ?? a("core.viewer.label"), downloadName: e.value instanceof File ? e.value.name : void 0 }] : []);
|
|
1563
|
+
function w(r) {
|
|
1540
1564
|
if (!r) return;
|
|
1541
1565
|
const f = nt(r, { accept: t.accept, maxSize: t.maxSize });
|
|
1542
|
-
f ?
|
|
1566
|
+
f ? n.value = f === "invalid_type" ? a("core.form.file.invalid_type") : a("core.form.file.too_large", { size: Be(t.maxSize) }) : (n.value = null, e.value = r);
|
|
1543
1567
|
}
|
|
1544
|
-
return (r, f) => (
|
|
1545
|
-
value:
|
|
1568
|
+
return (r, f) => (u(), O(ye, Q({ ...s(fe)(t), error: n.value ?? t.error }, {
|
|
1569
|
+
value: m.value ? s(a)("core.form.file.choose") : null,
|
|
1546
1570
|
"row-layout": "stacked"
|
|
1547
|
-
}),
|
|
1548
|
-
readonly:
|
|
1549
|
-
|
|
1571
|
+
}), ee({
|
|
1572
|
+
readonly: v(() => [
|
|
1573
|
+
m.value ? (u(), y("button", {
|
|
1550
1574
|
key: 0,
|
|
1551
1575
|
type: "button",
|
|
1552
1576
|
"aria-label": s(a)("core.viewer.open"),
|
|
1553
1577
|
"data-test": "photo-open",
|
|
1554
1578
|
class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
1555
|
-
onClick: f[0] || (f[0] = (
|
|
1579
|
+
onClick: f[0] || (f[0] = (g) => h.value?.present(0))
|
|
1556
1580
|
}, [
|
|
1557
|
-
|
|
1558
|
-
src:
|
|
1581
|
+
b("img", {
|
|
1582
|
+
src: m.value,
|
|
1559
1583
|
alt: "",
|
|
1560
1584
|
class: "size-40 rounded-group object-cover"
|
|
1561
|
-
}, null, 8,
|
|
1562
|
-
], 8,
|
|
1563
|
-
|
|
1585
|
+
}, null, 8, dl)
|
|
1586
|
+
], 8, ul)) : T("", !0),
|
|
1587
|
+
m.value ? (u(), O(Je, {
|
|
1564
1588
|
key: 1,
|
|
1565
1589
|
ref_key: "viewer",
|
|
1566
|
-
ref:
|
|
1567
|
-
items:
|
|
1568
|
-
}, null, 8, ["items"])) :
|
|
1590
|
+
ref: h,
|
|
1591
|
+
items: x.value
|
|
1592
|
+
}, null, 8, ["items"])) : T("", !0)
|
|
1569
1593
|
]),
|
|
1570
|
-
default:
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
id:
|
|
1594
|
+
default: v(({ id: g, describedby: S, invalid: z }) => [
|
|
1595
|
+
b("div", cl, [
|
|
1596
|
+
b("input", {
|
|
1597
|
+
id: g,
|
|
1574
1598
|
ref_key: "chooser",
|
|
1575
|
-
ref:
|
|
1599
|
+
ref: o,
|
|
1576
1600
|
type: "file",
|
|
1577
1601
|
class: "sr-only",
|
|
1578
1602
|
tabindex: "-1",
|
|
1579
1603
|
accept: t.accept.join(","),
|
|
1580
1604
|
disabled: t.disabled,
|
|
1581
1605
|
"aria-describedby": S,
|
|
1582
|
-
"aria-invalid":
|
|
1583
|
-
onChange: f[1] || (f[1] = (
|
|
1584
|
-
}, null, 40,
|
|
1585
|
-
|
|
1606
|
+
"aria-invalid": z || void 0,
|
|
1607
|
+
onChange: f[1] || (f[1] = ($) => w($.target.files?.[0]))
|
|
1608
|
+
}, null, 40, fl),
|
|
1609
|
+
m.value ? (u(), y("button", {
|
|
1586
1610
|
key: 0,
|
|
1587
1611
|
type: "button",
|
|
1588
1612
|
"aria-label": s(a)("core.viewer.open"),
|
|
1589
1613
|
"data-test": "photo-open",
|
|
1590
1614
|
class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
1591
|
-
onClick: f[2] || (f[2] = (
|
|
1615
|
+
onClick: f[2] || (f[2] = ($) => h.value?.present(0))
|
|
1592
1616
|
}, [
|
|
1593
|
-
|
|
1594
|
-
src:
|
|
1617
|
+
b("img", {
|
|
1618
|
+
src: m.value,
|
|
1595
1619
|
alt: "",
|
|
1596
1620
|
"data-test": "photo-preview",
|
|
1597
1621
|
class: "size-28 rounded-group object-cover"
|
|
1598
|
-
}, null, 8,
|
|
1599
|
-
], 8,
|
|
1600
|
-
|
|
1622
|
+
}, null, 8, ml)
|
|
1623
|
+
], 8, vl)) : T("", !0),
|
|
1624
|
+
M(ge, {
|
|
1601
1625
|
disabled: t.disabled,
|
|
1602
|
-
onClick: f[3] || (f[3] = (
|
|
1626
|
+
onClick: f[3] || (f[3] = ($) => o.value?.click())
|
|
1603
1627
|
}, {
|
|
1604
|
-
default:
|
|
1605
|
-
Y(
|
|
1628
|
+
default: v(() => [
|
|
1629
|
+
Y(_(s(a)("core.form.file.choose")), 1)
|
|
1606
1630
|
]),
|
|
1607
1631
|
_: 1
|
|
1608
1632
|
}, 8, ["disabled"]),
|
|
1609
|
-
|
|
1633
|
+
m.value ? (u(), O(ge, {
|
|
1610
1634
|
key: 1,
|
|
1611
1635
|
prominence: "plain",
|
|
1612
1636
|
tone: "critical",
|
|
1613
1637
|
disabled: t.disabled,
|
|
1614
|
-
onClick: f[4] || (f[4] = (
|
|
1615
|
-
e.value = null,
|
|
1638
|
+
onClick: f[4] || (f[4] = ($) => {
|
|
1639
|
+
e.value = null, n.value = null;
|
|
1616
1640
|
})
|
|
1617
1641
|
}, {
|
|
1618
|
-
default:
|
|
1619
|
-
Y(
|
|
1642
|
+
default: v(() => [
|
|
1643
|
+
Y(_(s(a)("core.form.file.remove")), 1)
|
|
1620
1644
|
]),
|
|
1621
1645
|
_: 1
|
|
1622
|
-
}, 8, ["disabled"])) :
|
|
1646
|
+
}, 8, ["disabled"])) : T("", !0)
|
|
1623
1647
|
]),
|
|
1624
|
-
|
|
1648
|
+
m.value ? (u(), O(Je, {
|
|
1625
1649
|
key: 0,
|
|
1626
1650
|
ref_key: "viewer",
|
|
1627
|
-
ref:
|
|
1628
|
-
items:
|
|
1629
|
-
}, null, 8, ["items"])) :
|
|
1651
|
+
ref: h,
|
|
1652
|
+
items: x.value
|
|
1653
|
+
}, null, 8, ["items"])) : T("", !0)
|
|
1630
1654
|
]),
|
|
1631
1655
|
_: 2
|
|
1632
1656
|
}, [
|
|
1633
1657
|
r.$slots.trailing ? {
|
|
1634
1658
|
name: "trailing",
|
|
1635
|
-
fn:
|
|
1636
|
-
|
|
1659
|
+
fn: v(() => [
|
|
1660
|
+
C(r.$slots, "trailing")
|
|
1637
1661
|
]),
|
|
1638
1662
|
key: "0"
|
|
1639
1663
|
} : void 0,
|
|
1640
1664
|
r.$slots.labelTrailing ? {
|
|
1641
1665
|
name: "labelTrailing",
|
|
1642
|
-
fn:
|
|
1643
|
-
|
|
1666
|
+
fn: v(() => [
|
|
1667
|
+
C(r.$slots, "labelTrailing")
|
|
1644
1668
|
]),
|
|
1645
1669
|
key: "1"
|
|
1646
1670
|
} : void 0
|
|
1647
1671
|
]), 1040, ["value"]));
|
|
1648
1672
|
}
|
|
1649
|
-
}),
|
|
1673
|
+
}), pl = { class: "text-footnote" }, bl = { class: "text-footnote" }, qo = /* @__PURE__ */ P({
|
|
1650
1674
|
__name: "GroupSheet",
|
|
1651
1675
|
props: {
|
|
1652
1676
|
sheet: {},
|
|
@@ -1658,134 +1682,134 @@ const Oa = ["id", "aria-labelledby"], ja = ["id", "value", "lang", "name", "rows
|
|
|
1658
1682
|
fieldLabel: { type: Function, default: void 0 }
|
|
1659
1683
|
},
|
|
1660
1684
|
emits: ["saved"],
|
|
1661
|
-
setup(
|
|
1662
|
-
const e =
|
|
1663
|
-
let
|
|
1664
|
-
|
|
1665
|
-
|
|
1685
|
+
setup(l, { emit: t }) {
|
|
1686
|
+
const e = l, a = t, { t: o } = oe(), n = H("modal"), d = H("body"), i = N(!1);
|
|
1687
|
+
let m = null;
|
|
1688
|
+
de(() => e.sheet.open.value, (w) => {
|
|
1689
|
+
w ? (i.value = !1, n.value?.present()) : n.value?.dismiss();
|
|
1666
1690
|
}), rt(() => {
|
|
1667
|
-
e.sheet.open.value &&
|
|
1691
|
+
e.sheet.open.value && n.value?.present();
|
|
1668
1692
|
}), Ee(() => {
|
|
1669
|
-
|
|
1693
|
+
m && clearTimeout(m);
|
|
1670
1694
|
});
|
|
1671
|
-
async function
|
|
1672
|
-
await e.sheet.save() && (
|
|
1695
|
+
async function h() {
|
|
1696
|
+
await e.sheet.save() && (i.value = !0, a("saved"), m = setTimeout(() => e.sheet.dismiss(), Nt));
|
|
1673
1697
|
}
|
|
1674
|
-
const
|
|
1675
|
-
return (
|
|
1698
|
+
const x = k(() => e.sheet.saving.value ? "processing" : i.value ? "done" : "idle");
|
|
1699
|
+
return (w, r) => (u(), O(Gt, {
|
|
1676
1700
|
ref_key: "modal",
|
|
1677
|
-
ref:
|
|
1701
|
+
ref: n,
|
|
1678
1702
|
size: e.size,
|
|
1679
1703
|
grouped: "",
|
|
1680
1704
|
title: e.title,
|
|
1681
1705
|
subtitle: e.subtitle,
|
|
1682
1706
|
"before-dismiss": e.sheet.beforeDismiss,
|
|
1683
|
-
"primary-label": e.editable ? s(
|
|
1684
|
-
status:
|
|
1685
|
-
"processing-label": s(
|
|
1686
|
-
"done-label": s(
|
|
1687
|
-
onPrimary:
|
|
1707
|
+
"primary-label": e.editable ? s(o)("core.actions.save") : void 0,
|
|
1708
|
+
status: x.value,
|
|
1709
|
+
"processing-label": s(o)("core.actions.saving"),
|
|
1710
|
+
"done-label": s(o)("core.actions.saved"),
|
|
1711
|
+
onPrimary: h,
|
|
1688
1712
|
onDismissed: r[0] || (r[0] = (f) => e.sheet.closed())
|
|
1689
1713
|
}, {
|
|
1690
|
-
default:
|
|
1691
|
-
|
|
1714
|
+
default: v(() => [
|
|
1715
|
+
b("div", {
|
|
1692
1716
|
ref_key: "body",
|
|
1693
|
-
ref:
|
|
1717
|
+
ref: d,
|
|
1694
1718
|
class: "flex min-w-0 flex-col gap-group-gap"
|
|
1695
1719
|
}, [
|
|
1696
|
-
e.sheet.notice.value ? (
|
|
1720
|
+
e.sheet.notice.value ? (u(), O(Ze, {
|
|
1697
1721
|
key: 0,
|
|
1698
1722
|
tone: "warning",
|
|
1699
1723
|
"data-test": "group-sheet-notice"
|
|
1700
1724
|
}, {
|
|
1701
|
-
default:
|
|
1702
|
-
|
|
1725
|
+
default: v(() => [
|
|
1726
|
+
b("p", pl, _(e.sheet.notice.value), 1)
|
|
1703
1727
|
]),
|
|
1704
1728
|
_: 1
|
|
1705
|
-
})) :
|
|
1706
|
-
e.sheet.foreignGroups.value.length ? (
|
|
1729
|
+
})) : T("", !0),
|
|
1730
|
+
e.sheet.foreignGroups.value.length ? (u(), O(Ze, {
|
|
1707
1731
|
key: 1,
|
|
1708
1732
|
tone: "warning",
|
|
1709
1733
|
"data-test": "group-sheet-foreign"
|
|
1710
1734
|
}, {
|
|
1711
|
-
default:
|
|
1712
|
-
|
|
1735
|
+
default: v(() => [
|
|
1736
|
+
b("p", bl, _(s(o)("core.form.group.foreign", { groups: e.sheet.foreignGroups.value.map(e.groupLabel).join(", ") })), 1)
|
|
1713
1737
|
]),
|
|
1714
1738
|
_: 1
|
|
1715
|
-
})) :
|
|
1716
|
-
|
|
1739
|
+
})) : T("", !0),
|
|
1740
|
+
M(Me, {
|
|
1717
1741
|
form: e.sheet.form,
|
|
1718
1742
|
label: e.fieldLabel,
|
|
1719
|
-
scope:
|
|
1743
|
+
scope: d.value
|
|
1720
1744
|
}, null, 8, ["form", "label", "scope"]),
|
|
1721
|
-
|
|
1745
|
+
C(w.$slots, "default")
|
|
1722
1746
|
], 512)
|
|
1723
1747
|
]),
|
|
1724
1748
|
_: 3
|
|
1725
1749
|
}, 8, ["size", "title", "subtitle", "before-dismiss", "primary-label", "status", "processing-label", "done-label"]));
|
|
1726
1750
|
}
|
|
1727
|
-
}),
|
|
1751
|
+
}), gl = ["data-group"], Ro = /* @__PURE__ */ P({
|
|
1728
1752
|
__name: "RecordGroupScope",
|
|
1729
1753
|
props: {
|
|
1730
1754
|
only: {},
|
|
1731
1755
|
editable: { type: Boolean }
|
|
1732
1756
|
},
|
|
1733
|
-
setup(
|
|
1734
|
-
const t =
|
|
1735
|
-
return Re(Rt, { only: it(t, "only") }), Re(bt,
|
|
1757
|
+
setup(l) {
|
|
1758
|
+
const t = l;
|
|
1759
|
+
return Re(Rt, { only: it(t, "only") }), Re(bt, k(() => t.editable)), (e, a) => (u(), y("div", {
|
|
1736
1760
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
1737
1761
|
"data-test": "record-group-scope",
|
|
1738
1762
|
"data-group": t.only
|
|
1739
1763
|
}, [
|
|
1740
|
-
|
|
1741
|
-
], 8,
|
|
1764
|
+
C(e.$slots, "default")
|
|
1765
|
+
], 8, gl));
|
|
1742
1766
|
}
|
|
1743
1767
|
});
|
|
1744
|
-
function
|
|
1745
|
-
const { form: t } =
|
|
1746
|
-
if (
|
|
1747
|
-
const e = () => typeof
|
|
1748
|
-
let
|
|
1749
|
-
const
|
|
1768
|
+
function Oo(l) {
|
|
1769
|
+
const { form: t } = l;
|
|
1770
|
+
if (l.rebase && !t.rebase) throw new Error("useGroupSheet: `rebase` needs a record form (useResourceForm), which can take the freshly read record as its base.");
|
|
1771
|
+
const e = () => typeof l.fields == "function" ? l.fields() : l.fields, a = () => Oe(l.restore) ?? e(), o = N(!1), n = N(!1), d = N([]), i = N(null), m = Le({});
|
|
1772
|
+
let h = {};
|
|
1773
|
+
const x = (F) => Object.fromEntries(F.map((E) => [E, Se(t.values[E])])), w = k(() => o.value && !He(x(a()), m.value)), { confirmDiscard: r } = Ie(() => w.value);
|
|
1750
1774
|
function f() {
|
|
1751
|
-
|
|
1775
|
+
h = x(a()), m.value = Se(h);
|
|
1752
1776
|
}
|
|
1753
|
-
function
|
|
1754
|
-
f(),
|
|
1777
|
+
function g() {
|
|
1778
|
+
f(), d.value = [], i.value = null, t.dismissFailure(), o.value = !0;
|
|
1755
1779
|
}
|
|
1756
1780
|
function S() {
|
|
1757
|
-
if (
|
|
1758
|
-
|
|
1781
|
+
if (o.value) {
|
|
1782
|
+
w.value && Object.assign(t.values, Se(h));
|
|
1759
1783
|
for (const F of e()) t.errors.clear(F);
|
|
1760
|
-
t.dismissFailure(),
|
|
1784
|
+
t.dismissFailure(), o.value = !1;
|
|
1761
1785
|
}
|
|
1762
1786
|
}
|
|
1763
|
-
function
|
|
1764
|
-
const E = new Set(e()),
|
|
1765
|
-
for (const
|
|
1766
|
-
const
|
|
1767
|
-
if (E.has(
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1787
|
+
function z(F) {
|
|
1788
|
+
const E = new Set(e()), R = Oe(l.group), Z = /* @__PURE__ */ new Set();
|
|
1789
|
+
for (const W of Object.keys(F.all())) {
|
|
1790
|
+
const J = et(W);
|
|
1791
|
+
if (E.has(J)) continue;
|
|
1792
|
+
const ae = l.groupOf?.(J) ?? l.fallbackGroup;
|
|
1793
|
+
ae && ae !== R && Z.add(ae);
|
|
1770
1794
|
}
|
|
1771
|
-
|
|
1795
|
+
d.value = [...Z];
|
|
1772
1796
|
}
|
|
1773
|
-
async function
|
|
1774
|
-
const E = Se(
|
|
1797
|
+
async function $(F) {
|
|
1798
|
+
const E = Se(x(e().filter((R) => !He(t.values[R], m.value[R]))));
|
|
1775
1799
|
try {
|
|
1776
1800
|
await F.reload();
|
|
1777
1801
|
} catch {
|
|
1778
1802
|
return;
|
|
1779
1803
|
}
|
|
1780
|
-
t.rebase?.() && (f(), Object.assign(t.values, E),
|
|
1804
|
+
t.rebase?.() && (f(), Object.assign(t.values, E), i.value = F.message());
|
|
1781
1805
|
}
|
|
1782
|
-
async function
|
|
1783
|
-
if (
|
|
1784
|
-
|
|
1806
|
+
async function I() {
|
|
1807
|
+
if (n.value) return !1;
|
|
1808
|
+
n.value = !0, d.value = [], i.value = null;
|
|
1785
1809
|
try {
|
|
1786
|
-
const F =
|
|
1810
|
+
const F = l.onSaved ? () => l.onSaved?.() : void 0;
|
|
1787
1811
|
let E;
|
|
1788
|
-
if (
|
|
1812
|
+
if (l.save) E = await t.submitFields(e(), l.save, { refresh: F });
|
|
1789
1813
|
else if (t.save) E = await t.save({ refresh: F });
|
|
1790
1814
|
else throw new Error("useGroupSheet: the form has no full-record save(), so give the sheet its own `save` for a dedicated endpoint.");
|
|
1791
1815
|
switch (E.status) {
|
|
@@ -1796,76 +1820,76 @@ function qo(o) {
|
|
|
1796
1820
|
case "aborted":
|
|
1797
1821
|
return !1;
|
|
1798
1822
|
case "failed":
|
|
1799
|
-
return E.failure.kind === "conflict" &&
|
|
1823
|
+
return E.failure.kind === "conflict" && l.rebase ? await $(l.rebase) : z(t.errors), !1;
|
|
1800
1824
|
}
|
|
1801
1825
|
} finally {
|
|
1802
|
-
|
|
1826
|
+
n.value = !1;
|
|
1803
1827
|
}
|
|
1804
1828
|
}
|
|
1805
1829
|
return {
|
|
1806
|
-
open:
|
|
1807
|
-
saving:
|
|
1808
|
-
dirty:
|
|
1809
|
-
foreignGroups:
|
|
1810
|
-
notice:
|
|
1830
|
+
open: o,
|
|
1831
|
+
saving: n,
|
|
1832
|
+
dirty: w,
|
|
1833
|
+
foreignGroups: d,
|
|
1834
|
+
notice: i,
|
|
1811
1835
|
failure: t.failure,
|
|
1812
1836
|
form: t,
|
|
1813
|
-
present:
|
|
1837
|
+
present: g,
|
|
1814
1838
|
dismiss: () => {
|
|
1815
|
-
|
|
1839
|
+
o.value = !1;
|
|
1816
1840
|
},
|
|
1817
|
-
save:
|
|
1841
|
+
save: I,
|
|
1818
1842
|
beforeDismiss: r,
|
|
1819
1843
|
closed: S
|
|
1820
1844
|
};
|
|
1821
1845
|
}
|
|
1822
|
-
const
|
|
1846
|
+
const yl = { hidden: "" }, hl = /* @__PURE__ */ P({
|
|
1823
1847
|
__name: "EditorChrome",
|
|
1824
1848
|
props: {
|
|
1825
1849
|
options: {}
|
|
1826
1850
|
},
|
|
1827
|
-
setup(
|
|
1828
|
-
return Yt(
|
|
1851
|
+
setup(l) {
|
|
1852
|
+
return Yt(l.options), (e, a) => (u(), y("span", yl));
|
|
1829
1853
|
}
|
|
1830
1854
|
});
|
|
1831
|
-
function
|
|
1832
|
-
const t =
|
|
1855
|
+
function kl(l) {
|
|
1856
|
+
const t = N(0);
|
|
1833
1857
|
let e = 0;
|
|
1834
1858
|
const a = () => {
|
|
1835
1859
|
e || (e = requestAnimationFrame(() => {
|
|
1836
1860
|
e = 0, t.value++;
|
|
1837
1861
|
}));
|
|
1838
|
-
},
|
|
1839
|
-
|
|
1840
|
-
() =>
|
|
1841
|
-
(
|
|
1842
|
-
|
|
1843
|
-
for (const
|
|
1844
|
-
|
|
1862
|
+
}, o = typeof MutationObserver > "u" ? null : new MutationObserver(a);
|
|
1863
|
+
de(
|
|
1864
|
+
() => l.sections.value,
|
|
1865
|
+
(i) => {
|
|
1866
|
+
o?.disconnect();
|
|
1867
|
+
for (const m of i)
|
|
1868
|
+
o?.observe(m.element, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["data-field-error", "data-field-required", "data-field-filled"] });
|
|
1845
1869
|
a();
|
|
1846
1870
|
},
|
|
1847
1871
|
{ immediate: !0 }
|
|
1848
1872
|
), ut() && dt(() => {
|
|
1849
|
-
|
|
1873
|
+
o?.disconnect(), e && cancelAnimationFrame(e);
|
|
1850
1874
|
});
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1853
|
-
|
|
1875
|
+
const n = k(() => (t.value, Object.fromEntries(
|
|
1876
|
+
l.sections.value.map((i) => [
|
|
1877
|
+
i.id,
|
|
1854
1878
|
{
|
|
1855
|
-
errors:
|
|
1856
|
-
required: { total:
|
|
1879
|
+
errors: i.element.querySelectorAll("[data-field-error]").length,
|
|
1880
|
+
required: { total: i.element.querySelectorAll("[data-field-required]").length, filled: i.element.querySelectorAll("[data-field-required][data-field-filled]").length }
|
|
1857
1881
|
}
|
|
1858
1882
|
])
|
|
1859
|
-
))),
|
|
1860
|
-
return { states:
|
|
1883
|
+
))), d = k(() => Object.values(n.value).reduce((i, m) => ({ filled: i.filled + m.required.filled, total: i.total + m.required.total }), { filled: 0, total: 0 }));
|
|
1884
|
+
return { states: n, totals: d };
|
|
1861
1885
|
}
|
|
1862
|
-
const
|
|
1886
|
+
const wl = {
|
|
1863
1887
|
class: "grid min-w-0 grid-cols-1 items-start gap-8 lg:grid-cols-[12.5rem_minmax(0,1fr)]",
|
|
1864
1888
|
"data-test": "editor-page"
|
|
1865
|
-
},
|
|
1889
|
+
}, xl = {
|
|
1866
1890
|
key: 0,
|
|
1867
1891
|
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"
|
|
1868
|
-
},
|
|
1892
|
+
}, Mo = /* @__PURE__ */ P({
|
|
1869
1893
|
__name: "EditorPage",
|
|
1870
1894
|
props: {
|
|
1871
1895
|
title: {},
|
|
@@ -1876,11 +1900,11 @@ const hl = {
|
|
|
1876
1900
|
fieldLabel: { type: Function, default: void 0 }
|
|
1877
1901
|
},
|
|
1878
1902
|
emits: ["save", "cancel"],
|
|
1879
|
-
setup(
|
|
1880
|
-
const e =
|
|
1903
|
+
setup(l, { emit: t }) {
|
|
1904
|
+
const e = l, a = t, { t: o } = oe(), n = Ne(), d = Ut(), { states: i, totals: m } = kl(d), h = H("content"), x = k(
|
|
1881
1905
|
() => e.form ? {
|
|
1882
1906
|
form: e.form,
|
|
1883
|
-
label: () => e.saveLabel ??
|
|
1907
|
+
label: () => e.saveLabel ?? o("core.actions.save"),
|
|
1884
1908
|
allowed: () => e.canSave,
|
|
1885
1909
|
disabledWhileClean: !1,
|
|
1886
1910
|
// a create page: an untouched form is submitted to learn what is missing
|
|
@@ -1892,99 +1916,99 @@ const hl = {
|
|
|
1892
1916
|
}
|
|
1893
1917
|
} : null
|
|
1894
1918
|
);
|
|
1895
|
-
|
|
1919
|
+
de(
|
|
1896
1920
|
() => e.form?.failure.value,
|
|
1897
1921
|
async (r) => {
|
|
1898
|
-
r?.kind === "invalid" && (await
|
|
1922
|
+
r?.kind === "invalid" && (await he(), await De(h.value ?? document, d));
|
|
1899
1923
|
}
|
|
1900
1924
|
);
|
|
1901
|
-
function
|
|
1902
|
-
const f =
|
|
1903
|
-
f &&
|
|
1925
|
+
function w(r) {
|
|
1926
|
+
const f = d.sections.value.find((g) => g.id === r)?.element;
|
|
1927
|
+
f && he(() => De(f));
|
|
1904
1928
|
}
|
|
1905
|
-
return (r, f) => (
|
|
1929
|
+
return (r, f) => (u(), O(Kt, {
|
|
1906
1930
|
title: e.title,
|
|
1907
1931
|
back: e.back,
|
|
1908
1932
|
width: "content"
|
|
1909
|
-
},
|
|
1910
|
-
default:
|
|
1911
|
-
|
|
1933
|
+
}, ee({
|
|
1934
|
+
default: v(() => [
|
|
1935
|
+
x.value ? (u(), O(hl, {
|
|
1912
1936
|
key: 0,
|
|
1913
|
-
options:
|
|
1914
|
-
}, null, 8, ["options"])) :
|
|
1915
|
-
|
|
1916
|
-
s(
|
|
1917
|
-
|
|
1937
|
+
options: x.value
|
|
1938
|
+
}, null, 8, ["options"])) : T("", !0),
|
|
1939
|
+
b("div", wl, [
|
|
1940
|
+
s(n) ? T("", !0) : (u(), y("aside", xl, [
|
|
1941
|
+
M(At, {
|
|
1918
1942
|
standalone: "",
|
|
1919
|
-
states: s(
|
|
1920
|
-
progress: s(
|
|
1921
|
-
onSelect:
|
|
1943
|
+
states: s(i),
|
|
1944
|
+
progress: s(m),
|
|
1945
|
+
onSelect: w
|
|
1922
1946
|
}, null, 8, ["states", "progress"]),
|
|
1923
|
-
|
|
1947
|
+
C(r.$slots, "aside")
|
|
1924
1948
|
])),
|
|
1925
|
-
|
|
1949
|
+
b("div", {
|
|
1926
1950
|
ref_key: "content",
|
|
1927
|
-
ref:
|
|
1951
|
+
ref: h,
|
|
1928
1952
|
class: "flex min-w-0 flex-col gap-section-gap"
|
|
1929
1953
|
}, [
|
|
1930
|
-
e.form ? (
|
|
1954
|
+
e.form ? (u(), O(Me, {
|
|
1931
1955
|
key: 0,
|
|
1932
1956
|
form: e.form,
|
|
1933
1957
|
label: e.fieldLabel,
|
|
1934
|
-
scope:
|
|
1935
|
-
}, null, 8, ["form", "label", "scope"])) :
|
|
1936
|
-
|
|
1958
|
+
scope: h.value
|
|
1959
|
+
}, null, 8, ["form", "label", "scope"])) : T("", !0),
|
|
1960
|
+
C(r.$slots, "default")
|
|
1937
1961
|
], 512)
|
|
1938
1962
|
]),
|
|
1939
|
-
s(
|
|
1963
|
+
s(n) ? (u(), O(Ht, {
|
|
1940
1964
|
key: 1,
|
|
1941
|
-
states: s(
|
|
1942
|
-
}, null, 8, ["states"])) :
|
|
1965
|
+
states: s(i)
|
|
1966
|
+
}, null, 8, ["states"])) : T("", !0)
|
|
1943
1967
|
]),
|
|
1944
1968
|
_: 2
|
|
1945
1969
|
}, [
|
|
1946
1970
|
r.$slots.header ? {
|
|
1947
1971
|
name: "header",
|
|
1948
|
-
fn:
|
|
1949
|
-
|
|
1972
|
+
fn: v(() => [
|
|
1973
|
+
C(r.$slots, "header")
|
|
1950
1974
|
]),
|
|
1951
1975
|
key: "0"
|
|
1952
1976
|
} : void 0,
|
|
1953
1977
|
r.$slots.pager ? {
|
|
1954
1978
|
name: "pager",
|
|
1955
|
-
fn:
|
|
1956
|
-
|
|
1979
|
+
fn: v(() => [
|
|
1980
|
+
C(r.$slots, "pager")
|
|
1957
1981
|
]),
|
|
1958
1982
|
key: "1"
|
|
1959
1983
|
} : void 0,
|
|
1960
1984
|
r.$slots.notices ? {
|
|
1961
1985
|
name: "notices",
|
|
1962
|
-
fn:
|
|
1963
|
-
|
|
1986
|
+
fn: v(() => [
|
|
1987
|
+
C(r.$slots, "notices")
|
|
1964
1988
|
]),
|
|
1965
1989
|
key: "2"
|
|
1966
1990
|
} : void 0,
|
|
1967
1991
|
r.$slots.bottom ? {
|
|
1968
1992
|
name: "bottom",
|
|
1969
|
-
fn:
|
|
1970
|
-
|
|
1993
|
+
fn: v(() => [
|
|
1994
|
+
C(r.$slots, "bottom")
|
|
1971
1995
|
]),
|
|
1972
1996
|
key: "3"
|
|
1973
1997
|
} : void 0
|
|
1974
1998
|
]), 1032, ["title", "back"]));
|
|
1975
1999
|
}
|
|
1976
2000
|
});
|
|
1977
|
-
function
|
|
2001
|
+
function jo(l) {
|
|
1978
2002
|
const t = Le(null);
|
|
1979
2003
|
let e = null;
|
|
1980
2004
|
const a = st({
|
|
1981
|
-
...
|
|
1982
|
-
done:
|
|
1983
|
-
run(
|
|
1984
|
-
const
|
|
1985
|
-
if (
|
|
1986
|
-
if (!
|
|
1987
|
-
return
|
|
2005
|
+
...l,
|
|
2006
|
+
done: l.done ? (o) => l.done?.(o, { editing: e }) : void 0,
|
|
2007
|
+
run(o, n) {
|
|
2008
|
+
const d = e = t.value;
|
|
2009
|
+
if (d === null) return l.create(o, n);
|
|
2010
|
+
if (!l.update) throw new Error("useRecordDialog: edit() needs an `update`.");
|
|
2011
|
+
return l.update(d, o, n);
|
|
1988
2012
|
}
|
|
1989
2013
|
});
|
|
1990
2014
|
return {
|
|
@@ -1994,14 +2018,14 @@ function Mo(o) {
|
|
|
1994
2018
|
create() {
|
|
1995
2019
|
t.value = null, a.present();
|
|
1996
2020
|
},
|
|
1997
|
-
edit(
|
|
1998
|
-
t.value =
|
|
2021
|
+
edit(o) {
|
|
2022
|
+
t.value = o, a.present(l.toValues?.(o));
|
|
1999
2023
|
}
|
|
2000
2024
|
};
|
|
2001
2025
|
}
|
|
2002
|
-
const
|
|
2026
|
+
const $l = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], Eo = /* @__PURE__ */ P({
|
|
2003
2027
|
__name: "NumberCell",
|
|
2004
|
-
props: /* @__PURE__ */
|
|
2028
|
+
props: /* @__PURE__ */ se({
|
|
2005
2029
|
label: {},
|
|
2006
2030
|
min: { default: 0 },
|
|
2007
2031
|
max: { default: 9999 },
|
|
@@ -2014,14 +2038,14 @@ const xl = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], O
|
|
|
2014
2038
|
modelModifiers: {}
|
|
2015
2039
|
}),
|
|
2016
2040
|
emits: ["update:modelValue"],
|
|
2017
|
-
setup(
|
|
2018
|
-
const t =
|
|
2019
|
-
function a(
|
|
2020
|
-
const
|
|
2021
|
-
e.value =
|
|
2041
|
+
setup(l) {
|
|
2042
|
+
const t = l, e = ie(l, "modelValue");
|
|
2043
|
+
function a(n) {
|
|
2044
|
+
const d = n.target.value.replace(/\D/g, "");
|
|
2045
|
+
e.value = d === "" ? null : Math.min(t.max, Math.max(t.min, Number(d)));
|
|
2022
2046
|
}
|
|
2023
|
-
const
|
|
2024
|
-
return (
|
|
2047
|
+
const o = (n) => n.target.value = e.value === null ? "" : String(e.value);
|
|
2048
|
+
return (n, d) => (u(), y("input", {
|
|
2025
2049
|
value: e.value ?? "",
|
|
2026
2050
|
type: "text",
|
|
2027
2051
|
inputmode: "numeric",
|
|
@@ -2032,329 +2056,329 @@ const xl = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], O
|
|
|
2032
2056
|
placeholder: t.placeholder,
|
|
2033
2057
|
class: j(["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" : ""]]),
|
|
2034
2058
|
onInput: a,
|
|
2035
|
-
onBlur:
|
|
2036
|
-
}, null, 42,
|
|
2059
|
+
onBlur: o
|
|
2060
|
+
}, null, 42, $l));
|
|
2037
2061
|
}
|
|
2038
2062
|
}), Ke = "vue-core:step-draft:";
|
|
2039
|
-
function Ae(
|
|
2063
|
+
function Ae(l) {
|
|
2040
2064
|
try {
|
|
2041
|
-
return (
|
|
2065
|
+
return (l.storage === "local" ? window.localStorage : window.sessionStorage) ?? null;
|
|
2042
2066
|
} catch {
|
|
2043
2067
|
return null;
|
|
2044
2068
|
}
|
|
2045
2069
|
}
|
|
2046
|
-
function
|
|
2070
|
+
function _l(l) {
|
|
2047
2071
|
try {
|
|
2048
|
-
const t = Ae(
|
|
2072
|
+
const t = Ae(l)?.getItem(Ke + l.key);
|
|
2049
2073
|
if (!t) return null;
|
|
2050
2074
|
const e = JSON.parse(t);
|
|
2051
|
-
return !e || e.version !== (
|
|
2075
|
+
return !e || e.version !== (l.version ?? 1) || typeof e.values != "object" || e.values === null || typeof e.step != "string" || !Array.isArray(e.passed) ? null : e;
|
|
2052
2076
|
} catch {
|
|
2053
2077
|
return null;
|
|
2054
2078
|
}
|
|
2055
2079
|
}
|
|
2056
|
-
function
|
|
2080
|
+
function Sl(l, t) {
|
|
2057
2081
|
try {
|
|
2058
|
-
const e = Ae(
|
|
2082
|
+
const e = Ae(l);
|
|
2059
2083
|
if (!e) return !1;
|
|
2060
|
-
const a = (
|
|
2061
|
-
return e.setItem(Ke +
|
|
2084
|
+
const a = (o, n) => typeof Blob < "u" && n instanceof Blob ? null : n;
|
|
2085
|
+
return e.setItem(Ke + l.key, JSON.stringify({ version: l.version ?? 1, ...t }, a)), !0;
|
|
2062
2086
|
} catch {
|
|
2063
2087
|
return !1;
|
|
2064
2088
|
}
|
|
2065
2089
|
}
|
|
2066
|
-
function
|
|
2090
|
+
function Qe(l) {
|
|
2067
2091
|
try {
|
|
2068
|
-
Ae(
|
|
2092
|
+
Ae(l)?.removeItem(Ke + l.key);
|
|
2069
2093
|
} catch {
|
|
2070
2094
|
}
|
|
2071
2095
|
}
|
|
2072
|
-
function
|
|
2073
|
-
for (const [e, a] of Object.entries(
|
|
2096
|
+
function Cl(l, t) {
|
|
2097
|
+
for (const [e, a] of Object.entries(l)) {
|
|
2074
2098
|
if (!(e in t)) continue;
|
|
2075
|
-
const
|
|
2076
|
-
(
|
|
2099
|
+
const o = t[e];
|
|
2100
|
+
(o === null || a === null || a === void 0 || typeof o == typeof a && Array.isArray(o) === Array.isArray(a)) && (l[e] = o);
|
|
2077
2101
|
}
|
|
2078
2102
|
}
|
|
2079
|
-
function
|
|
2080
|
-
const { t: e } =
|
|
2103
|
+
function Io(l, t) {
|
|
2104
|
+
const { t: e } = oe(), a = k(() => Oe(t.steps));
|
|
2081
2105
|
if (a.value.length === 0) throw new Error("useStepForm: a flow needs at least one step.");
|
|
2082
|
-
const
|
|
2106
|
+
const o = N(a.value[0].name), n = Ue(/* @__PURE__ */ new Set()), d = Ue(/* @__PURE__ */ new Set([a.value[0].name])), i = N(null), m = N(!1), h = N(0), x = N(!1), w = N(!1);
|
|
2083
2107
|
let r = !1, f = 0;
|
|
2084
|
-
const
|
|
2085
|
-
() => a.value.map((
|
|
2086
|
-
const
|
|
2108
|
+
const g = k(() => Math.max(0, a.value.findIndex((c) => c.name === o.value))), S = (c) => c.fields?.filter((V) => l.errors.has(V)).length ?? 0, z = k(
|
|
2109
|
+
() => a.value.map((c, V) => {
|
|
2110
|
+
const p = S(c), q = V === g.value;
|
|
2087
2111
|
return {
|
|
2088
|
-
name:
|
|
2089
|
-
label:
|
|
2112
|
+
name: c.name,
|
|
2113
|
+
label: c.label,
|
|
2090
2114
|
position: V + 1,
|
|
2091
|
-
state:
|
|
2092
|
-
errors:
|
|
2093
|
-
reachable: !
|
|
2115
|
+
state: q ? "current" : n.has(c.name) && p === 0 ? "done" : "todo",
|
|
2116
|
+
errors: p,
|
|
2117
|
+
reachable: !q && (d.has(c.name) || V < g.value)
|
|
2094
2118
|
};
|
|
2095
2119
|
})
|
|
2096
|
-
),
|
|
2097
|
-
function
|
|
2098
|
-
const V = a.value[
|
|
2099
|
-
V && (
|
|
2120
|
+
), $ = k(() => z.value[g.value]), I = k(() => z.value.length), F = k(() => g.value === 0), E = k(() => g.value === I.value - 1), R = k(() => m.value || l.submitting.value);
|
|
2121
|
+
function Z(c) {
|
|
2122
|
+
const V = a.value[c];
|
|
2123
|
+
V && (i.value = c > g.value ? "forward" : "back", o.value = V.name, d.add(V.name), f = c, x.value = !1);
|
|
2100
2124
|
}
|
|
2101
|
-
|
|
2102
|
-
() => a.value.map((
|
|
2125
|
+
de(
|
|
2126
|
+
() => a.value.map((c) => c.name).join("\0"),
|
|
2103
2127
|
() => {
|
|
2104
|
-
const
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
}),
|
|
2108
|
-
for (const
|
|
2128
|
+
const c = a.value, V = c.findIndex((q) => q.name === o.value), p = V === -1 ? Math.min(f, c.length - 1) : V;
|
|
2129
|
+
o.value = c[p].name, f = p, c.forEach((q, B) => {
|
|
2130
|
+
B > p && (n.delete(q.name), d.delete(q.name));
|
|
2131
|
+
}), d.add(o.value);
|
|
2132
|
+
for (const q of [n, d]) for (const B of [...q]) c.some((K) => K.name === B) || q.delete(B);
|
|
2109
2133
|
}
|
|
2110
2134
|
);
|
|
2111
|
-
function
|
|
2112
|
-
const V =
|
|
2135
|
+
function W(c) {
|
|
2136
|
+
const V = c.fields;
|
|
2113
2137
|
if (!V?.length) return !0;
|
|
2114
|
-
const
|
|
2115
|
-
return
|
|
2138
|
+
const p = Object.entries(l.errors.all()).filter(([B]) => !V.includes(et(B))), q = l.check(c.fields);
|
|
2139
|
+
return p.length > 0 && l.errors.set({ ...Object.fromEntries(p), ...l.errors.all() }), q;
|
|
2116
2140
|
}
|
|
2117
|
-
async function
|
|
2118
|
-
if (!
|
|
2119
|
-
return
|
|
2120
|
-
if (!
|
|
2121
|
-
|
|
2141
|
+
async function J(c) {
|
|
2142
|
+
if (!W(c))
|
|
2143
|
+
return h.value++, !1;
|
|
2144
|
+
if (!c.beforeNext) return !0;
|
|
2145
|
+
m.value = !0;
|
|
2122
2146
|
try {
|
|
2123
|
-
if (await
|
|
2147
|
+
if (await c.beforeNext()) return !0;
|
|
2124
2148
|
} finally {
|
|
2125
|
-
|
|
2149
|
+
m.value = !1;
|
|
2126
2150
|
}
|
|
2127
|
-
return
|
|
2151
|
+
return h.value++, !1;
|
|
2128
2152
|
}
|
|
2129
|
-
async function
|
|
2130
|
-
const
|
|
2131
|
-
if (
|
|
2132
|
-
return r = !0,
|
|
2133
|
-
if (
|
|
2134
|
-
const V =
|
|
2135
|
-
V !== -1 &&
|
|
2153
|
+
async function ae() {
|
|
2154
|
+
const c = await l.submit(t.submit, t.submitOptions);
|
|
2155
|
+
if (c.status === "saved" || c.status === "saved-refresh-failed")
|
|
2156
|
+
return r = !0, re(), t.onSaved?.(c.value), !0;
|
|
2157
|
+
if (c.status === "failed" && (h.value++, $.value.errors === 0)) {
|
|
2158
|
+
const V = z.value.findIndex((p) => p.errors > 0);
|
|
2159
|
+
V !== -1 && Z(V);
|
|
2136
2160
|
}
|
|
2137
2161
|
return !1;
|
|
2138
2162
|
}
|
|
2139
|
-
async function
|
|
2140
|
-
if (
|
|
2141
|
-
const
|
|
2142
|
-
return await
|
|
2163
|
+
async function me() {
|
|
2164
|
+
if (R.value) return !1;
|
|
2165
|
+
const c = a.value[g.value];
|
|
2166
|
+
return await J(c) ? (n.add(c.name), g.value < I.value - 1 ? (Z(g.value + 1), !0) : ae()) : !1;
|
|
2143
2167
|
}
|
|
2144
|
-
async function
|
|
2145
|
-
if (
|
|
2146
|
-
const V = a.value.findIndex((
|
|
2168
|
+
async function D(c) {
|
|
2169
|
+
if (R.value) return !1;
|
|
2170
|
+
const V = a.value.findIndex((p) => p.name === c);
|
|
2147
2171
|
if (V === -1) return !1;
|
|
2148
|
-
if (V <=
|
|
2149
|
-
return V <
|
|
2150
|
-
if (!
|
|
2151
|
-
for (;
|
|
2152
|
-
return
|
|
2172
|
+
if (V <= g.value)
|
|
2173
|
+
return V < g.value && Z(V), !0;
|
|
2174
|
+
if (!d.has(c)) return !1;
|
|
2175
|
+
for (; g.value < V; ) if (!await me()) return !1;
|
|
2176
|
+
return g.value === V;
|
|
2153
2177
|
}
|
|
2154
2178
|
const A = t.draft;
|
|
2155
|
-
let
|
|
2156
|
-
function
|
|
2157
|
-
if (
|
|
2158
|
-
if (!
|
|
2159
|
-
|
|
2179
|
+
let G;
|
|
2180
|
+
function ne() {
|
|
2181
|
+
if (G = void 0, !(!A || r)) {
|
|
2182
|
+
if (!l.dirty.value) {
|
|
2183
|
+
Qe(A), w.value = !1;
|
|
2160
2184
|
return;
|
|
2161
2185
|
}
|
|
2162
|
-
|
|
2186
|
+
w.value = Sl(A, { values: Se(l.values), step: o.value, passed: [...n] });
|
|
2163
2187
|
}
|
|
2164
2188
|
}
|
|
2165
|
-
function
|
|
2166
|
-
r = !0, clearTimeout(
|
|
2189
|
+
function re() {
|
|
2190
|
+
r = !0, clearTimeout(G), G = void 0, w.value = !1, A && Qe(A);
|
|
2167
2191
|
}
|
|
2168
2192
|
if (A) {
|
|
2169
|
-
const
|
|
2170
|
-
if (
|
|
2171
|
-
|
|
2172
|
-
const V = a.value.map((
|
|
2173
|
-
V.includes(
|
|
2174
|
-
for (const
|
|
2175
|
-
for (const
|
|
2176
|
-
f =
|
|
2193
|
+
const c = _l(A);
|
|
2194
|
+
if (c) {
|
|
2195
|
+
Cl(l.values, c.values);
|
|
2196
|
+
const V = a.value.map((p) => p.name);
|
|
2197
|
+
V.includes(c.step) && (o.value = c.step);
|
|
2198
|
+
for (const p of c.passed) V.includes(p) && n.add(p);
|
|
2199
|
+
for (const p of [...n, o.value]) d.add(p);
|
|
2200
|
+
f = g.value, x.value = l.dirty.value, w.value = x.value;
|
|
2177
2201
|
}
|
|
2178
|
-
|
|
2179
|
-
[() =>
|
|
2202
|
+
de(
|
|
2203
|
+
[() => l.values, o, () => [...n].join("\0")],
|
|
2180
2204
|
() => {
|
|
2181
|
-
r || (clearTimeout(
|
|
2205
|
+
r || (clearTimeout(G), G = setTimeout(ne, 400));
|
|
2182
2206
|
},
|
|
2183
2207
|
{ deep: !0 }
|
|
2184
2208
|
), Ee(() => {
|
|
2185
|
-
|
|
2209
|
+
G !== void 0 && (clearTimeout(G), ne());
|
|
2186
2210
|
});
|
|
2187
2211
|
}
|
|
2188
|
-
const { confirmDiscard:
|
|
2189
|
-
tt(Wt, null) && Jt(() => (r ||
|
|
2190
|
-
async function
|
|
2191
|
-
const
|
|
2192
|
-
return
|
|
2212
|
+
const { confirmDiscard: le } = Ie(() => !r && l.dirty.value);
|
|
2213
|
+
tt(Wt, null) && Jt(() => (r || re(), !0));
|
|
2214
|
+
async function ke() {
|
|
2215
|
+
const c = await le();
|
|
2216
|
+
return c && re(), c;
|
|
2193
2217
|
}
|
|
2194
|
-
function
|
|
2195
|
-
|
|
2218
|
+
function xe() {
|
|
2219
|
+
l.reset(), n.clear(), d.clear(), i.value = null, o.value = a.value[0].name, d.add(o.value), f = 0, x.value = !1, re(), r = !1;
|
|
2196
2220
|
}
|
|
2197
|
-
const
|
|
2198
|
-
const
|
|
2199
|
-
return
|
|
2200
|
-
}),
|
|
2201
|
-
const
|
|
2202
|
-
return
|
|
2203
|
-
}),
|
|
2221
|
+
const X = k(() => {
|
|
2222
|
+
const c = [e("core.steps.position", { current: g.value + 1, total: I.value }), $.value.label];
|
|
2223
|
+
return w.value && c.push(e("core.steps.draft_saved")), c.join(" · ");
|
|
2224
|
+
}), pe = k(() => {
|
|
2225
|
+
const c = a.value[g.value];
|
|
2226
|
+
return c.nextLabel ? c.nextLabel : E.value ? t.submitLabel ?? e("core.actions.save") : e("core.steps.next_named", { step: a.value[g.value + 1].label });
|
|
2227
|
+
}), L = k(() => F.value ? null : a.value[g.value - 1].label);
|
|
2204
2228
|
return {
|
|
2205
|
-
steps:
|
|
2206
|
-
current:
|
|
2207
|
-
index:
|
|
2208
|
-
count:
|
|
2229
|
+
steps: z,
|
|
2230
|
+
current: $,
|
|
2231
|
+
index: g,
|
|
2232
|
+
count: I,
|
|
2209
2233
|
isFirst: F,
|
|
2210
2234
|
isLast: E,
|
|
2211
|
-
busy:
|
|
2212
|
-
direction:
|
|
2213
|
-
subtitle:
|
|
2214
|
-
nextLabel:
|
|
2215
|
-
backLabel:
|
|
2216
|
-
restored:
|
|
2217
|
-
refusals:
|
|
2218
|
-
errors:
|
|
2219
|
-
failure:
|
|
2220
|
-
next:
|
|
2221
|
-
back: () =>
|
|
2222
|
-
goTo:
|
|
2223
|
-
restart:
|
|
2224
|
-
confirmDiscard:
|
|
2225
|
-
bindDialog: () => ({ subtitle:
|
|
2235
|
+
busy: R,
|
|
2236
|
+
direction: i,
|
|
2237
|
+
subtitle: X,
|
|
2238
|
+
nextLabel: pe,
|
|
2239
|
+
backLabel: L,
|
|
2240
|
+
restored: x,
|
|
2241
|
+
refusals: h,
|
|
2242
|
+
errors: l.errors,
|
|
2243
|
+
failure: l.failure,
|
|
2244
|
+
next: me,
|
|
2245
|
+
back: () => Z(g.value - 1),
|
|
2246
|
+
goTo: D,
|
|
2247
|
+
restart: xe,
|
|
2248
|
+
confirmDiscard: ke,
|
|
2249
|
+
bindDialog: () => ({ subtitle: X.value, primaryLabel: pe.value, status: R.value ? "processing" : "idle", beforeDismiss: ke })
|
|
2226
2250
|
};
|
|
2227
2251
|
}
|
|
2228
|
-
const
|
|
2252
|
+
const Fl = {
|
|
2229
2253
|
class: "flex flex-wrap items-center gap-2.5 border-t border-border-separator pt-3.5",
|
|
2230
2254
|
"data-test": "step-navigation"
|
|
2231
|
-
},
|
|
2255
|
+
}, Bl = /* @__PURE__ */ P({
|
|
2232
2256
|
__name: "StepNavigation",
|
|
2233
2257
|
props: {
|
|
2234
2258
|
flow: {}
|
|
2235
2259
|
},
|
|
2236
2260
|
emits: ["cancel"],
|
|
2237
|
-
setup(
|
|
2238
|
-
const t =
|
|
2239
|
-
return (a,
|
|
2240
|
-
t.flow.backLabel.value ? (
|
|
2261
|
+
setup(l) {
|
|
2262
|
+
const t = l, { t: e } = oe();
|
|
2263
|
+
return (a, o) => (u(), y("div", Fl, [
|
|
2264
|
+
t.flow.backLabel.value ? (u(), O(ge, {
|
|
2241
2265
|
key: 0,
|
|
2242
2266
|
prominence: "plain",
|
|
2243
2267
|
icon: "arrowLeftSLine",
|
|
2244
2268
|
disabled: t.flow.busy.value,
|
|
2245
2269
|
"data-test": "step-back",
|
|
2246
|
-
onClick:
|
|
2270
|
+
onClick: o[0] || (o[0] = (n) => t.flow.back())
|
|
2247
2271
|
}, {
|
|
2248
|
-
default:
|
|
2249
|
-
Y(
|
|
2272
|
+
default: v(() => [
|
|
2273
|
+
Y(_(t.flow.backLabel.value), 1)
|
|
2250
2274
|
]),
|
|
2251
2275
|
_: 1
|
|
2252
|
-
}, 8, ["disabled"])) :
|
|
2253
|
-
|
|
2254
|
-
|
|
2276
|
+
}, 8, ["disabled"])) : T("", !0),
|
|
2277
|
+
o[3] || (o[3] = b("div", { class: "grow" }, null, -1)),
|
|
2278
|
+
M(ge, {
|
|
2255
2279
|
prominence: "plain",
|
|
2256
2280
|
"data-test": "step-cancel",
|
|
2257
|
-
onClick:
|
|
2281
|
+
onClick: o[1] || (o[1] = (n) => a.$emit("cancel"))
|
|
2258
2282
|
}, {
|
|
2259
|
-
default:
|
|
2260
|
-
Y(
|
|
2283
|
+
default: v(() => [
|
|
2284
|
+
Y(_(s(e)("core.actions.cancel")), 1)
|
|
2261
2285
|
]),
|
|
2262
2286
|
_: 1
|
|
2263
2287
|
}),
|
|
2264
|
-
|
|
2288
|
+
M(ge, {
|
|
2265
2289
|
prominence: "primary",
|
|
2266
2290
|
processing: t.flow.busy.value,
|
|
2267
2291
|
"data-test": "step-next",
|
|
2268
|
-
onClick:
|
|
2292
|
+
onClick: o[2] || (o[2] = (n) => t.flow.next())
|
|
2269
2293
|
}, {
|
|
2270
|
-
default:
|
|
2271
|
-
Y(
|
|
2294
|
+
default: v(() => [
|
|
2295
|
+
Y(_(t.flow.nextLabel.value), 1)
|
|
2272
2296
|
]),
|
|
2273
2297
|
_: 1
|
|
2274
2298
|
}, 8, ["processing"])
|
|
2275
2299
|
]));
|
|
2276
2300
|
}
|
|
2277
|
-
}),
|
|
2301
|
+
}), Ll = ["aria-label"], Tl = ["aria-current"], zl = ["aria-label"], Dl = {
|
|
2278
2302
|
key: 2,
|
|
2279
2303
|
class: "sr-only"
|
|
2280
|
-
},
|
|
2304
|
+
}, Vl = {
|
|
2281
2305
|
key: 1,
|
|
2282
2306
|
"data-test": "step-dots",
|
|
2283
2307
|
class: "flex justify-center gap-1.5",
|
|
2284
2308
|
"aria-hidden": "true"
|
|
2285
|
-
},
|
|
2309
|
+
}, ql = ["data-state"], Rl = /* @__PURE__ */ P({
|
|
2286
2310
|
__name: "StepProgress",
|
|
2287
2311
|
props: {
|
|
2288
2312
|
flow: {},
|
|
2289
2313
|
progress: { default: "bar" }
|
|
2290
2314
|
},
|
|
2291
|
-
setup(
|
|
2292
|
-
const t =
|
|
2293
|
-
return (a,
|
|
2315
|
+
setup(l) {
|
|
2316
|
+
const t = l, { t: e } = oe();
|
|
2317
|
+
return (a, o) => t.progress === "bar" ? (u(), y("ol", {
|
|
2294
2318
|
key: 0,
|
|
2295
2319
|
"aria-label": s(e)("core.steps.label"),
|
|
2296
2320
|
"data-test": "step-bar",
|
|
2297
2321
|
class: "grid min-w-0 gap-2",
|
|
2298
2322
|
style: ct({ gridTemplateColumns: `repeat(${t.flow.count.value}, minmax(0, 1fr))` })
|
|
2299
2323
|
}, [
|
|
2300
|
-
(
|
|
2301
|
-
key:
|
|
2324
|
+
(u(!0), y(ue, null, we(t.flow.steps.value, (n) => (u(), y("li", {
|
|
2325
|
+
key: n.name,
|
|
2302
2326
|
class: "flex min-w-0",
|
|
2303
|
-
"aria-current":
|
|
2327
|
+
"aria-current": n.state === "current" ? "step" : void 0
|
|
2304
2328
|
}, [
|
|
2305
|
-
(
|
|
2306
|
-
type:
|
|
2307
|
-
disabled:
|
|
2308
|
-
"data-test": `step-${
|
|
2309
|
-
"data-state":
|
|
2310
|
-
class: j(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left",
|
|
2311
|
-
onClick: (
|
|
2329
|
+
(u(), O(ft(n.reachable ? "button" : "div"), {
|
|
2330
|
+
type: n.reachable ? "button" : void 0,
|
|
2331
|
+
disabled: n.reachable ? t.flow.busy.value : void 0,
|
|
2332
|
+
"data-test": `step-${n.name}`,
|
|
2333
|
+
"data-state": n.errors > 0 ? "error" : n.state,
|
|
2334
|
+
class: j(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left", n.reachable ? "cursor-pointer rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-default" : ""]),
|
|
2335
|
+
onClick: (d) => n.reachable ? t.flow.goTo(n.name) : void 0
|
|
2312
2336
|
}, {
|
|
2313
|
-
default:
|
|
2314
|
-
|
|
2315
|
-
class: j(["h-1 rounded-full transition-colors duration-motion-normal",
|
|
2337
|
+
default: v(() => [
|
|
2338
|
+
b("span", {
|
|
2339
|
+
class: j(["h-1 rounded-full transition-colors duration-motion-normal", n.errors > 0 ? "bg-status-danger-solid" : n.state === "current" ? "bg-tint" : n.state === "done" ? "bg-control-on" : "bg-fill-strong"]),
|
|
2316
2340
|
"aria-hidden": "true"
|
|
2317
2341
|
}, null, 2),
|
|
2318
|
-
|
|
2319
|
-
class: j(["flex min-w-0 items-center gap-1.5 text-footnote",
|
|
2342
|
+
b("span", {
|
|
2343
|
+
class: j(["flex min-w-0 items-center gap-1.5 text-footnote", n.state === "current" ? "font-bold text-content-strong" : n.state === "done" ? "font-medium text-content-link" : "font-medium text-content-muted"])
|
|
2320
2344
|
}, [
|
|
2321
|
-
|
|
2345
|
+
n.state === "done" ? (u(), O(s(te), {
|
|
2322
2346
|
key: 0,
|
|
2323
2347
|
name: "checkCustom",
|
|
2324
2348
|
size: 12,
|
|
2325
2349
|
class: "shrink-0"
|
|
2326
|
-
})) :
|
|
2327
|
-
|
|
2328
|
-
class: j(["truncate",
|
|
2329
|
-
},
|
|
2330
|
-
|
|
2350
|
+
})) : T("", !0),
|
|
2351
|
+
b("span", {
|
|
2352
|
+
class: j(["truncate", n.reachable ? "group-hover:text-content-link" : ""])
|
|
2353
|
+
}, _(n.position) + ". " + _(n.label), 3),
|
|
2354
|
+
n.errors > 0 ? (u(), y("span", {
|
|
2331
2355
|
key: 1,
|
|
2332
2356
|
"data-test": "step-errors",
|
|
2333
|
-
"aria-label": s(e)("core.form.sections.errors", { count:
|
|
2357
|
+
"aria-label": s(e)("core.form.sections.errors", { count: n.errors }),
|
|
2334
2358
|
class: "min-w-4.5 shrink-0 rounded-full bg-status-danger-solid px-1.5 text-center text-caption font-semibold text-white"
|
|
2335
|
-
},
|
|
2336
|
-
|
|
2359
|
+
}, _(n.errors), 9, zl)) : T("", !0),
|
|
2360
|
+
n.state === "done" ? (u(), y("span", Dl, _(s(e)("core.steps.done")), 1)) : T("", !0)
|
|
2337
2361
|
], 2)
|
|
2338
2362
|
]),
|
|
2339
2363
|
_: 2
|
|
2340
2364
|
}, 1032, ["type", "disabled", "data-test", "data-state", "class", "onClick"]))
|
|
2341
|
-
], 8,
|
|
2342
|
-
], 12,
|
|
2343
|
-
(
|
|
2344
|
-
key:
|
|
2345
|
-
class: j(["h-1.5 rounded-full transition-all duration-motion-fast", [
|
|
2346
|
-
"data-state":
|
|
2347
|
-
}, null, 10,
|
|
2365
|
+
], 8, Tl))), 128))
|
|
2366
|
+
], 12, Ll)) : (u(), y("div", Vl, [
|
|
2367
|
+
(u(!0), y(ue, null, we(t.flow.steps.value, (n) => (u(), y("span", {
|
|
2368
|
+
key: n.name,
|
|
2369
|
+
class: j(["h-1.5 rounded-full transition-all duration-motion-fast", [n.state === "current" ? "w-4.5" : "w-1.5", n.errors > 0 ? "bg-status-danger-solid" : n.state === "todo" && n.position > t.flow.index.value ? "bg-fill-strong" : "bg-tint"]]),
|
|
2370
|
+
"data-state": n.errors > 0 ? "error" : n.state
|
|
2371
|
+
}, null, 10, ql))), 128))
|
|
2348
2372
|
]));
|
|
2349
2373
|
}
|
|
2350
|
-
}),
|
|
2374
|
+
}), Ol = ["data-step"], Ml = {
|
|
2351
2375
|
class: "sr-only",
|
|
2352
2376
|
"aria-live": "polite"
|
|
2353
|
-
},
|
|
2377
|
+
}, jl = {
|
|
2354
2378
|
key: 1,
|
|
2355
2379
|
"data-test": "step-restored",
|
|
2356
2380
|
class: "flex items-center gap-2 text-footnote text-content-muted"
|
|
2357
|
-
},
|
|
2381
|
+
}, Go = /* @__PURE__ */ P({
|
|
2358
2382
|
__name: "StepForm",
|
|
2359
2383
|
props: {
|
|
2360
2384
|
flow: {},
|
|
@@ -2362,41 +2386,50 @@ const Sl = {
|
|
|
2362
2386
|
navigation: { default: "inline" }
|
|
2363
2387
|
},
|
|
2364
2388
|
emits: ["cancel"],
|
|
2365
|
-
setup(
|
|
2366
|
-
const t =
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2389
|
+
setup(l) {
|
|
2390
|
+
const t = l, { t: e } = oe(), a = H("body"), o = H("root");
|
|
2391
|
+
function n(d) {
|
|
2392
|
+
for (let i = d.parentElement; i; i = i.parentElement) {
|
|
2393
|
+
const m = getComputedStyle(i).overflowY;
|
|
2394
|
+
if ((m === "auto" || m === "scroll") && i.scrollHeight > i.clientHeight) return d.getBoundingClientRect().top < i.getBoundingClientRect().top;
|
|
2395
|
+
}
|
|
2396
|
+
return d.getBoundingClientRect().top < 0;
|
|
2397
|
+
}
|
|
2398
|
+
return de(() => t.flow.current.value.name, async () => {
|
|
2399
|
+
await he(), o.value && n(o.value) && o.value.scrollIntoView?.({ block: "start" }), a.value?.focus({ preventScroll: !0 });
|
|
2400
|
+
}), de(() => t.flow.refusals.value, async () => {
|
|
2401
|
+
await he(), a.value && await De(a.value);
|
|
2402
|
+
}), (d, i) => (u(), y("div", {
|
|
2403
|
+
ref_key: "root",
|
|
2404
|
+
ref: o,
|
|
2372
2405
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
2373
2406
|
"data-test": "step-form",
|
|
2374
2407
|
"data-step": t.flow.current.value.name
|
|
2375
2408
|
}, [
|
|
2376
|
-
t.progress !== "none" ? (
|
|
2409
|
+
t.progress !== "none" ? (u(), O(Rl, {
|
|
2377
2410
|
key: 0,
|
|
2378
2411
|
flow: t.flow,
|
|
2379
2412
|
progress: t.progress
|
|
2380
|
-
}, null, 8, ["flow", "progress"])) :
|
|
2381
|
-
|
|
2382
|
-
t.flow.restored.value ? (
|
|
2383
|
-
|
|
2384
|
-
|
|
2413
|
+
}, null, 8, ["flow", "progress"])) : T("", !0),
|
|
2414
|
+
b("p", Ml, _(t.flow.subtitle.value), 1),
|
|
2415
|
+
t.flow.restored.value ? (u(), y("div", jl, [
|
|
2416
|
+
b("span", null, _(s(e)("core.steps.restored")), 1),
|
|
2417
|
+
M(ge, {
|
|
2385
2418
|
prominence: "link",
|
|
2386
2419
|
size: "sm",
|
|
2387
|
-
onClick:
|
|
2420
|
+
onClick: i[0] || (i[0] = (m) => t.flow.restart())
|
|
2388
2421
|
}, {
|
|
2389
|
-
default:
|
|
2390
|
-
Y(
|
|
2422
|
+
default: v(() => [
|
|
2423
|
+
Y(_(s(e)("core.steps.start_over")), 1)
|
|
2391
2424
|
]),
|
|
2392
2425
|
_: 1
|
|
2393
2426
|
})
|
|
2394
|
-
])) :
|
|
2395
|
-
(
|
|
2427
|
+
])) : T("", !0),
|
|
2428
|
+
(u(), O(Me, {
|
|
2396
2429
|
key: t.flow.current.value.name,
|
|
2397
2430
|
form: t.flow
|
|
2398
2431
|
}, null, 8, ["form"])),
|
|
2399
|
-
(
|
|
2432
|
+
(u(), y("form", {
|
|
2400
2433
|
key: t.flow.current.value.name,
|
|
2401
2434
|
ref_key: "body",
|
|
2402
2435
|
ref: a,
|
|
@@ -2404,97 +2437,97 @@ const Sl = {
|
|
|
2404
2437
|
novalidate: "",
|
|
2405
2438
|
"data-test": "step-body",
|
|
2406
2439
|
class: j(["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" : ""]),
|
|
2407
|
-
onSubmit:
|
|
2440
|
+
onSubmit: i[1] || (i[1] = be((m) => t.flow.next(), ["prevent"]))
|
|
2408
2441
|
}, [
|
|
2409
|
-
|
|
2410
|
-
|
|
2442
|
+
C(d.$slots, t.flow.current.value.name),
|
|
2443
|
+
i[3] || (i[3] = b("button", {
|
|
2411
2444
|
type: "submit",
|
|
2412
2445
|
class: "sr-only",
|
|
2413
2446
|
tabindex: "-1",
|
|
2414
2447
|
"aria-hidden": "true"
|
|
2415
2448
|
}, null, -1))
|
|
2416
2449
|
], 34)),
|
|
2417
|
-
t.navigation === "inline" ? (
|
|
2450
|
+
t.navigation === "inline" ? (u(), O(Bl, {
|
|
2418
2451
|
key: 2,
|
|
2419
2452
|
flow: t.flow,
|
|
2420
|
-
onCancel:
|
|
2421
|
-
}, null, 8, ["flow"])) :
|
|
2422
|
-
], 8,
|
|
2453
|
+
onCancel: i[2] || (i[2] = (m) => d.$emit("cancel"))
|
|
2454
|
+
}, null, 8, ["flow"])) : T("", !0)
|
|
2455
|
+
], 8, Ol));
|
|
2423
2456
|
}
|
|
2424
2457
|
});
|
|
2425
2458
|
export {
|
|
2426
2459
|
_t as Calendar,
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2460
|
+
wo as CardSelectField,
|
|
2461
|
+
xo as CheckboxField,
|
|
2462
|
+
$o as ChoiceChips,
|
|
2463
|
+
_o as ComboField,
|
|
2464
|
+
Yo as CommandDialog,
|
|
2465
|
+
fn as DateField,
|
|
2466
|
+
So as DateTimeField,
|
|
2467
|
+
Mo as EditorPage,
|
|
2468
|
+
Ko as ErrorBag,
|
|
2469
|
+
ye as Field,
|
|
2470
|
+
Co as FileField,
|
|
2471
|
+
Me as FormErrors,
|
|
2439
2472
|
qt as FormGroup,
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2473
|
+
Fo as FormGroupButton,
|
|
2474
|
+
Bo as FormIndent,
|
|
2475
|
+
vt as FormRow,
|
|
2476
|
+
wn as FormView,
|
|
2477
|
+
bn as GroupEditAction,
|
|
2478
|
+
qo as GroupSheet,
|
|
2479
|
+
Lo as I18nField,
|
|
2480
|
+
ln as LeaveGuardRoot,
|
|
2481
|
+
Zo as MissingLeaveGuardRootError,
|
|
2482
|
+
To as MoneyField,
|
|
2483
|
+
zo as MonthYearField,
|
|
2484
|
+
Do as MultiSelectField,
|
|
2485
|
+
Eo as NumberCell,
|
|
2453
2486
|
jt as NumberField,
|
|
2454
2487
|
We as OptionList,
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2488
|
+
Ln as OtpInput,
|
|
2489
|
+
Vo as PhotoField,
|
|
2490
|
+
Ro as RecordGroupScope,
|
|
2491
|
+
zn as SegmentedField,
|
|
2492
|
+
$n as SelectField,
|
|
2493
|
+
Go as StepForm,
|
|
2494
|
+
Bl as StepNavigation,
|
|
2495
|
+
Rl as StepProgress,
|
|
2496
|
+
Vn as SwitchField,
|
|
2497
|
+
rn as TextField,
|
|
2498
|
+
Rn as TextareaField,
|
|
2499
|
+
mn as TimeField,
|
|
2467
2500
|
nt as checkFile,
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2501
|
+
gn as createFieldGroups,
|
|
2502
|
+
Xo as createLeaveGuard,
|
|
2503
|
+
ve as fieldDefaults,
|
|
2504
|
+
Wo as fieldKey,
|
|
2505
|
+
fe as fieldProps,
|
|
2506
|
+
De as focusFirstError,
|
|
2474
2507
|
bt as formEditableKey,
|
|
2475
2508
|
Be as formatBytes,
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2509
|
+
Cn as groupOptions,
|
|
2510
|
+
Qo as installLeaveGuard,
|
|
2511
|
+
en as leaveGuardKey,
|
|
2512
|
+
Fn as matchOptions,
|
|
2513
|
+
ja as missingLocales,
|
|
2514
|
+
yn as provideRecordGroups,
|
|
2515
|
+
dn as recentChoicesKey,
|
|
2483
2516
|
Rt as recordGroupsKey,
|
|
2484
2517
|
st as useCommand,
|
|
2485
|
-
|
|
2518
|
+
Zt as useDirtySnapshot,
|
|
2486
2519
|
at as useFieldMode,
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2520
|
+
Ao as useForm,
|
|
2521
|
+
Oo as useGroupSheet,
|
|
2522
|
+
Ho as useHiddenFieldErrors,
|
|
2490
2523
|
Ie as useLeaveGuard,
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2524
|
+
tn as useLeaveGuardContext,
|
|
2525
|
+
_n as useOptions,
|
|
2526
|
+
jo as useRecordDialog,
|
|
2527
|
+
hn as useRecordGroups,
|
|
2528
|
+
nn as useResourceForm,
|
|
2496
2529
|
Yt as useSaveChrome,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2530
|
+
kl as useSectionStates,
|
|
2531
|
+
ko as useSheetDiscardGuard,
|
|
2532
|
+
Io as useStepForm
|
|
2500
2533
|
};
|