@wssto2/vue-core 0.4.20 → 0.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +460 -0
- package/dist/{Activity-C0NvjIi5.js → Activity-Cu_mAn_m.js} +1 -1
- package/dist/{Changes-hoMHeAZt.js → Changes-DW_3-MwX.js} +1 -1
- package/dist/{DeadLetters-O6QReswO.js → DeadLetters-CpcMccCc.js} +1 -1
- package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js → FormErrors.vue_vue_type_script_setup_true_lang-4WQz-TYS.js} +75 -74
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js → FormView.vue_vue_type_script_setup_true_lang-CbvMRBOc.js} +1 -1
- package/dist/{General-9Sgxb74n.js → General-Dbc3qDRz.js} +3 -3
- package/dist/{NewRolePage-D-LunWMH.js → NewRolePage-DPHFJ0I8.js} +2 -2
- package/dist/{ProfilePage-DJUDCyEr.js → ProfilePage-Cc7eiyV2.js} +3 -3
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-D-b-O6SG.js → RoleEditor.vue_vue_type_script_setup_true_lang-2fpYYCXj.js} +3 -3
- package/dist/{RolePage-Ha-EgoEJ.js → RolePage-C0jmkQkO.js} +3 -3
- package/dist/{RolesPage-8uWWCClN.js → RolesPage-eb4gqxdW.js} +1 -1
- package/dist/{Sessions-Dz4KYMu9.js → Sessions-DSDcj8Yd.js} +1 -1
- package/dist/{SettingsPage-D47NSOYW.js → SettingsPage-BF7MW1GH.js} +3 -3
- package/dist/{SignIn-CNv68Tba.js → SignIn-BR8-RVIk.js} +1 -1
- package/dist/{SignInPage-CsjC4aiV.js → SignInPage-Dcws582A.js} +2 -2
- package/dist/{SignIns-CgsNf8uf.js → SignIns-3u7YgKqh.js} +1 -1
- package/dist/{UserRecord-B9r_9U1z.js → UserRecord-AtZIwCO9.js} +3 -3
- package/dist/{UsersList-BBLa3OCv.js → UsersList-1IeQnvOL.js} +3 -3
- package/dist/access/index.js +1 -1
- package/dist/form/CommandDialog.vue.d.ts +4 -1
- package/dist/form/MonthYearField.vue.d.ts +3 -1
- package/dist/form/index.js +728 -717
- package/dist/form/useCommand.d.ts +21 -0
- package/dist/form/useForm.d.ts +1 -1
- package/dist/identity/index.js +1 -1
- package/dist/{index-Dxu7ZfCC.js → index--CxZ33h0.js} +12 -12
- package/dist/{index-D-0JNiFF.js → index-DBTK_iMB.js} +2 -2
- package/dist/{index-D6BjUQJT.js → index-Du3Ti2Zp.js} +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{status-BLTC7wi1.js → status-QOGPjIHu.js} +1 -1
- package/dist/useCommand-CT1RF_IB.js +169 -0
- package/dist/{useResourceForm-CP2lCwmD.js → useResourceForm-CQuniKhd.js} +1 -1
- package/package.json +3 -2
- package/dist/useCommand-YN9EMb7s.js +0 -138
package/dist/form/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { _ as Me, s as He, c as Se, f as et } from "../FormErrors.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { E as Ko, u as Ao, a as Ho } from "../FormErrors.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { f as De, u as st } from "../useCommand-
|
|
4
|
-
import { _ as Yo, a as Wo } from "../useCommand-
|
|
5
|
-
import { ref as N, computed as k, defineComponent as P, openBlock as
|
|
1
|
+
import { _ as Me, s as He, c as Se, f as et } from "../FormErrors.vue_vue_type_script_setup_true_lang-4WQz-TYS.js";
|
|
2
|
+
import { E as Ko, u as Ao, a as Ho } from "../FormErrors.vue_vue_type_script_setup_true_lang-4WQz-TYS.js";
|
|
3
|
+
import { f as De, u as st } from "../useCommand-CT1RF_IB.js";
|
|
4
|
+
import { _ as Yo, a as Wo } from "../useCommand-CT1RF_IB.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
7
|
import { M as Zo, c as Xo, i as Qo, l as en, u as tn } from "../leaveGuard-Cc8yeLxM.js";
|
|
8
8
|
import { _ as ln } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-Cv7KlA5y.js";
|
|
9
|
-
import { u as nn } from "../useResourceForm-
|
|
9
|
+
import { u as nn } from "../useResourceForm-CQuniKhd.js";
|
|
10
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
|
|
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
12
|
import { useI18n as oe } from "vue-i18n";
|
|
13
13
|
import { b as gt } from "../controlSurface-t7OEFESJ.js";
|
|
14
14
|
import { a as yt } from "../TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
|
|
15
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
17
|
import { r as dn } from "../suggestions-DHJFKB26.js";
|
|
18
|
-
import { s as $e, u as Ye, i as
|
|
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
19
|
import { u as Lt, a as Tt, s as zt } from "../DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js";
|
|
20
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";
|
|
@@ -23,11 +23,11 @@ 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
25
|
import { u as Vt } from "../TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js";
|
|
26
|
-
import { _ as
|
|
26
|
+
import { _ as mn } from "../TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js";
|
|
27
27
|
import { _ as ge } from "../Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
28
28
|
import { _ as qt, r as Rt } from "../FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
|
|
29
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
|
|
30
|
+
import { _ as wn } from "../FormView.vue_vue_type_script_setup_true_lang-CbvMRBOc.js";
|
|
31
31
|
import { i as Ot } from "../intlLocale-CeRU44qJ.js";
|
|
32
32
|
import { a as Mt } from "../environment-Dva-SG8D.js";
|
|
33
33
|
import { _ as jt } from "../NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.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 Zt(
|
|
52
|
+
function Zt(l) {
|
|
53
53
|
const t = N(null);
|
|
54
54
|
return {
|
|
55
|
-
isDirty: k(() => t.value !== null && JSON.stringify(
|
|
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 ko(
|
|
60
|
-
const t = N(!1), e = Zt(
|
|
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: () => {
|
|
@@ -77,7 +77,7 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
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
82
|
props: /* @__PURE__ */ ce({
|
|
83
83
|
label: {},
|
|
@@ -93,38 +93,38 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["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 (
|
|
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
101
|
value: e.options.find((h) => h.value === e.modelValue)?.label ?? null,
|
|
102
102
|
"row-layout": "stacked"
|
|
103
103
|
}), ee({
|
|
104
|
-
default:
|
|
105
|
-
|
|
104
|
+
default: v(({ id: h, describedby: x, invalid: w }) => [
|
|
105
|
+
b("div", {
|
|
106
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
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
126
|
}, null, 40, Qt),
|
|
127
|
-
r.icon ? (
|
|
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
|
}, [
|
|
@@ -133,11 +133,11 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
133
133
|
size: 18
|
|
134
134
|
}, null, 8, ["name"])
|
|
135
135
|
], 2)) : T("", !0),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
r.description ? (
|
|
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 ? (
|
|
140
|
+
r.value === e.modelValue ? (u(), y("span", la, [
|
|
141
141
|
M(s(te), {
|
|
142
142
|
name: "checkCustom",
|
|
143
143
|
size: 12
|
|
@@ -148,24 +148,24 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
148
148
|
]),
|
|
149
149
|
_: 2
|
|
150
150
|
}, [
|
|
151
|
-
|
|
151
|
+
i.$slots.trailing ? {
|
|
152
152
|
name: "trailing",
|
|
153
|
-
fn:
|
|
154
|
-
C(
|
|
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
|
-
C(
|
|
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
|
-
C(
|
|
167
|
+
fn: v(() => [
|
|
168
|
+
C(i.$slots, "readonly")
|
|
169
169
|
]),
|
|
170
170
|
key: "2"
|
|
171
171
|
} : void 0
|
|
@@ -174,7 +174,7 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["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
179
|
props: /* @__PURE__ */ se({
|
|
180
180
|
label: {},
|
|
@@ -187,59 +187,59 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["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(be(
|
|
209
|
-
Ce(be(
|
|
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
228
|
}, _(t.label), 3),
|
|
229
|
-
t.description ? (
|
|
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
232
|
}, _(t.description), 3)) : T("", !0),
|
|
233
|
-
C(
|
|
233
|
+
C(d.$slots, "default")
|
|
234
234
|
]),
|
|
235
|
-
|
|
236
|
-
C(
|
|
235
|
+
d.$slots.trailing ? (u(), y("div", ra, [
|
|
236
|
+
C(d.$slots, "trailing")
|
|
237
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
|
}, [
|
|
@@ -269,37 +269,37 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["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
282
|
}), ee({
|
|
283
|
-
default:
|
|
284
|
-
t.options.length === 0 ? (
|
|
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
|
-
(
|
|
294
|
+
(u(!0), y(ue, null, we(t.options, (h) => (u(), y("button", {
|
|
295
295
|
key: h.value,
|
|
296
296
|
type: "button",
|
|
297
297
|
"aria-pressed": e.value.includes(h.value),
|
|
298
298
|
disabled: t.disabled || h.disabled,
|
|
299
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: (
|
|
300
|
+
onClick: (x) => a(h.value)
|
|
301
301
|
}, [
|
|
302
|
-
e.value.includes(h.value) ? (
|
|
302
|
+
e.value.includes(h.value) ? (u(), O(s(te), {
|
|
303
303
|
key: 0,
|
|
304
304
|
name: "checkCustom",
|
|
305
305
|
size: 12
|
|
@@ -310,24 +310,24 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
310
310
|
]),
|
|
311
311
|
_: 2
|
|
312
312
|
}, [
|
|
313
|
-
|
|
313
|
+
o.$slots.trailing ? {
|
|
314
314
|
name: "trailing",
|
|
315
|
-
fn:
|
|
316
|
-
C(
|
|
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
|
-
C(
|
|
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
|
-
C(
|
|
329
|
+
fn: v(() => [
|
|
330
|
+
C(o.$slots, "readonly")
|
|
331
331
|
]),
|
|
332
332
|
key: "2"
|
|
333
333
|
} : void 0
|
|
@@ -337,7 +337,7 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
337
337
|
key: 0,
|
|
338
338
|
class: "flex shrink-0 items-center",
|
|
339
339
|
"data-test": "field-value"
|
|
340
|
-
},
|
|
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({
|
|
341
341
|
__name: "ComboField",
|
|
342
342
|
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
343
343
|
label: {},
|
|
@@ -360,13 +360,13 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
360
360
|
recents: {},
|
|
361
361
|
width: {},
|
|
362
362
|
rowLayout: {}
|
|
363
|
-
}, { ...
|
|
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 }), {
|
|
364
364
|
modelValue: { default: null },
|
|
365
365
|
modelModifiers: {}
|
|
366
366
|
}),
|
|
367
367
|
emits: /* @__PURE__ */ se(["picked", "focus", "blur"], ["update:modelValue"]),
|
|
368
|
-
setup(
|
|
369
|
-
const a =
|
|
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({
|
|
370
370
|
source: () => a.search ?? a.options,
|
|
371
371
|
minLength: () => a.minLength,
|
|
372
372
|
debounce: () => a.debounce,
|
|
@@ -374,44 +374,44 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
374
374
|
listAllWhenEmpty: !0,
|
|
375
375
|
recents: () => a.recents
|
|
376
376
|
}), { items: z, open: $, status: I, highlighted: F, showingRecent: E } = S, R = k(() => {
|
|
377
|
-
const D =
|
|
377
|
+
const D = o.value;
|
|
378
378
|
return D === null ? null : [f.value, a.selected, ...a.options ?? []].find((A) => A?.value === D) ?? null;
|
|
379
379
|
});
|
|
380
380
|
de(R, (D) => {
|
|
381
381
|
$.value || (g.value = D?.label ?? "");
|
|
382
382
|
}, { immediate: !0 });
|
|
383
383
|
function Z(D) {
|
|
384
|
-
g.value = D.target.value, S.ask(g.value), g.value === "" && (
|
|
384
|
+
g.value = D.target.value, S.ask(g.value), g.value === "" && (o.value = null, f.value = null);
|
|
385
385
|
}
|
|
386
386
|
function W(D) {
|
|
387
|
-
|
|
387
|
+
n("focus", D), a.disabled || S.show("");
|
|
388
388
|
}
|
|
389
389
|
function J(D) {
|
|
390
|
-
S.close(), S.remember(D), f.value = D,
|
|
390
|
+
S.close(), S.remember(D), f.value = D, o.value = D.value, g.value = D.label, n("picked", D);
|
|
391
391
|
}
|
|
392
392
|
function ae(D) {
|
|
393
|
-
S.close(), g.value = R.value?.label ?? "",
|
|
393
|
+
S.close(), g.value = R.value?.label ?? "", n("blur", D);
|
|
394
394
|
}
|
|
395
|
-
const
|
|
396
|
-
return t({ focus: () =>
|
|
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
397
|
value: R.value?.label ?? null,
|
|
398
398
|
"row-layout": a.rowLayout
|
|
399
399
|
}), ee({
|
|
400
|
-
default:
|
|
401
|
-
|
|
400
|
+
default: v(({ id: G, describedby: ne, invalid: re }) => [
|
|
401
|
+
b("div", {
|
|
402
402
|
ref_key: "anchor",
|
|
403
403
|
ref: r,
|
|
404
|
-
class: j(["flex items-center gap-1.5", [s(
|
|
404
|
+
class: j(["flex items-center gap-1.5", [s(m), x.value]])
|
|
405
405
|
}, [
|
|
406
|
-
D.$slots.value && R.value ? (
|
|
406
|
+
D.$slots.value && R.value ? (u(), y("span", fa, [
|
|
407
407
|
C(D.$slots, "value", {
|
|
408
408
|
option: R.value
|
|
409
409
|
})
|
|
410
410
|
])) : T("", !0),
|
|
411
|
-
|
|
411
|
+
b("input", {
|
|
412
412
|
id: G,
|
|
413
413
|
ref_key: "input",
|
|
414
|
-
ref:
|
|
414
|
+
ref: w,
|
|
415
415
|
role: "combobox",
|
|
416
416
|
type: "text",
|
|
417
417
|
autocomplete: "off",
|
|
@@ -421,18 +421,18 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
421
421
|
disabled: a.disabled,
|
|
422
422
|
required: a.required,
|
|
423
423
|
"aria-autocomplete": "list",
|
|
424
|
-
"aria-expanded":
|
|
424
|
+
"aria-expanded": me.value,
|
|
425
425
|
"aria-controls": `${G}-list`,
|
|
426
|
-
"aria-activedescendant":
|
|
426
|
+
"aria-activedescendant": me.value && s(z).length > 0 ? `${G}-option-${s(F)}` : void 0,
|
|
427
427
|
"aria-required": a.required || void 0,
|
|
428
428
|
"aria-invalid": re || void 0,
|
|
429
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",
|
|
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
431
|
onInput: Z,
|
|
432
432
|
onFocus: W,
|
|
433
433
|
onBlur: ae,
|
|
434
434
|
onKeydown: A[0] || (A[0] = (le) => s(S).keydown(le, { pick: J, enterNeedsMove: !1 }))
|
|
435
|
-
}, null, 42,
|
|
435
|
+
}, null, 42, va),
|
|
436
436
|
M(s(te), {
|
|
437
437
|
name: "search",
|
|
438
438
|
size: 14,
|
|
@@ -449,14 +449,14 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
449
449
|
status: s(I),
|
|
450
450
|
recent: s(E),
|
|
451
451
|
"empty-message": !0,
|
|
452
|
-
selected:
|
|
453
|
-
hint: s(
|
|
452
|
+
selected: o.value,
|
|
453
|
+
hint: s(d)("core.form.suggestions.keys_pick"),
|
|
454
454
|
onPick: J,
|
|
455
455
|
onHover: A[1] || (A[1] = (le) => s(S).highlight(le))
|
|
456
456
|
}, ee({ _: 2 }, [
|
|
457
457
|
D.$slots.option ? {
|
|
458
458
|
name: "option",
|
|
459
|
-
fn:
|
|
459
|
+
fn: v((le) => [
|
|
460
460
|
C(D.$slots, "option", Ve(qe(le)))
|
|
461
461
|
]),
|
|
462
462
|
key: "0"
|
|
@@ -467,28 +467,28 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
467
467
|
}, [
|
|
468
468
|
D.$slots.trailing ? {
|
|
469
469
|
name: "trailing",
|
|
470
|
-
fn:
|
|
470
|
+
fn: v(() => [
|
|
471
471
|
C(D.$slots, "trailing")
|
|
472
472
|
]),
|
|
473
473
|
key: "0"
|
|
474
474
|
} : void 0,
|
|
475
475
|
D.$slots.labelTrailing ? {
|
|
476
476
|
name: "labelTrailing",
|
|
477
|
-
fn:
|
|
477
|
+
fn: v(() => [
|
|
478
478
|
C(D.$slots, "labelTrailing")
|
|
479
479
|
]),
|
|
480
480
|
key: "1"
|
|
481
481
|
} : void 0,
|
|
482
482
|
D.$slots.readonly ? {
|
|
483
483
|
name: "readonly",
|
|
484
|
-
fn:
|
|
484
|
+
fn: v(() => [
|
|
485
485
|
C(D.$slots, "readonly")
|
|
486
486
|
]),
|
|
487
487
|
key: "2"
|
|
488
488
|
} : D.$slots.value && R.value ? {
|
|
489
489
|
name: "readonly",
|
|
490
|
-
fn:
|
|
491
|
-
|
|
490
|
+
fn: v(() => [
|
|
491
|
+
b("span", ma, [
|
|
492
492
|
C(D.$slots, "value", {
|
|
493
493
|
option: R.value
|
|
494
494
|
})
|
|
@@ -504,7 +504,7 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
504
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 = {
|
|
505
505
|
class: "-m-3 flex",
|
|
506
506
|
"data-test": "date-time-popover"
|
|
507
|
-
},
|
|
507
|
+
}, wa = { class: "flex w-75 flex-col gap-2.5 border-r border-border-separator p-3.5" }, xa = {
|
|
508
508
|
key: 0,
|
|
509
509
|
class: "border-t border-border-separator pt-2.5"
|
|
510
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({
|
|
@@ -526,34 +526,34 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
526
526
|
openOn: {},
|
|
527
527
|
minuteStep: {},
|
|
528
528
|
quickPicks: {}
|
|
529
|
-
}, { ...
|
|
529
|
+
}, { ...ve, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, minuteStep: 1, quickPicks: void 0 }), {
|
|
530
530
|
modelValue: { default: null },
|
|
531
531
|
modelModifiers: {}
|
|
532
532
|
}),
|
|
533
533
|
emits: /* @__PURE__ */ se(["focus", "blur"], ["update:modelValue"]),
|
|
534
|
-
setup(
|
|
535
|
-
const a =
|
|
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
536
|
function E(L) {
|
|
537
|
-
const { date:
|
|
538
|
-
if (!
|
|
537
|
+
const { date: c, time: V } = zt(L), p = c === null ? F.value.day ?? Fe() : $.parse(c);
|
|
538
|
+
if (!p) return { error: $.invalidMessage() };
|
|
539
539
|
let q = F.value.time ?? ze(a.minuteStep);
|
|
540
540
|
if (V !== null) {
|
|
541
541
|
const K = I.parse(V);
|
|
542
542
|
if ("error" in K) return K;
|
|
543
543
|
q = K.value;
|
|
544
544
|
}
|
|
545
|
-
const B = _e(
|
|
546
|
-
return z(B,
|
|
545
|
+
const B = _e(p, q);
|
|
546
|
+
return z(B, p) ? { value: B } : { error: $.unavailableMessage() };
|
|
547
547
|
}
|
|
548
|
-
const R = Ye({ model:
|
|
548
|
+
const R = Ye({ model: o, display: (L) => `${i.date($e(L).day)} ${$e(L).time ?? ""}`.trim(), parse: E }), Z = k({
|
|
549
549
|
get: () => F.value.time,
|
|
550
550
|
set: (L) => {
|
|
551
|
-
L &&
|
|
551
|
+
L && wt(L) && (o.value = _e(F.value.day ?? Fe(), L));
|
|
552
552
|
}
|
|
553
|
-
}), W = Ye({ model: Z, display: (L) => L, parse: I.parse }), J = Tt(() => a.quickPicks ?? (
|
|
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
554
|
const L = R.typed.value;
|
|
555
555
|
return L ? $e(L).day ?? null : null;
|
|
556
|
-
}), G = k(() => A.value ?? (
|
|
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
557
|
function re(L) {
|
|
558
558
|
L && R.set(_e(L, F.value.time ?? ze(a.minuteStep)));
|
|
559
559
|
}
|
|
@@ -563,30 +563,30 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
563
563
|
function ke(L) {
|
|
564
564
|
R.set(_e(Fe(), ze(a.minuteStep))), L();
|
|
565
565
|
}
|
|
566
|
-
const
|
|
566
|
+
const xe = je();
|
|
567
567
|
async function X(L) {
|
|
568
|
-
a.disabled || (
|
|
568
|
+
a.disabled || (x.value?.present(), L && (await he(), await he(), w.value?.focus()));
|
|
569
569
|
}
|
|
570
570
|
function pe(L) {
|
|
571
|
-
L.key === "Enter" ? (R.commit(),
|
|
571
|
+
L.key === "Enter" ? (R.commit(), x.value?.dismiss()) : L.key === "ArrowDown" && (L.preventDefault(), X(!0));
|
|
572
572
|
}
|
|
573
|
-
return t({ focus: () => h.value?.focus() }), (L,
|
|
574
|
-
value:
|
|
573
|
+
return t({ focus: () => h.value?.focus() }), (L, c) => (u(), O(ye, Q({ ...s(fe)(a), error: ae.value }, {
|
|
574
|
+
value: me.value,
|
|
575
575
|
"value-style": "numeric"
|
|
576
576
|
}), ee({
|
|
577
|
-
default:
|
|
578
|
-
s(
|
|
579
|
-
M(ot, Q({ id: V, "aria-describedby":
|
|
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
580
|
disabled: a.disabled,
|
|
581
581
|
invalid: q,
|
|
582
|
-
placeholder: s(
|
|
583
|
-
onClick:
|
|
582
|
+
placeholder: s(d)("core.form.select.choose"),
|
|
583
|
+
onClick: c[0] || (c[0] = (B) => r.value?.present())
|
|
584
584
|
}), {
|
|
585
|
-
default:
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
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
590
|
])) : T("", !0)
|
|
591
591
|
]),
|
|
592
592
|
_: 1
|
|
@@ -594,9 +594,9 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
594
594
|
M($t, {
|
|
595
595
|
ref_key: "sheet",
|
|
596
596
|
ref: r,
|
|
597
|
-
title: a.label ?? s(
|
|
597
|
+
title: a.label ?? s(d)("core.form.date.calendar"),
|
|
598
598
|
mode: "datetime",
|
|
599
|
-
"model-value":
|
|
599
|
+
"model-value": o.value,
|
|
600
600
|
min: f.value.min,
|
|
601
601
|
max: f.value.max,
|
|
602
602
|
"disabled-dates": a.disabledDates,
|
|
@@ -606,21 +606,21 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
606
606
|
clearable: !a.required,
|
|
607
607
|
"onUpdate:modelValue": s(R).set
|
|
608
608
|
}, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "step", "clearable", "onUpdate:modelValue"])
|
|
609
|
-
], 64)) : (
|
|
609
|
+
], 64)) : (u(), O(Pe, {
|
|
610
610
|
key: 1,
|
|
611
611
|
ref_key: "popover",
|
|
612
|
-
ref:
|
|
613
|
-
label: a.label ?? s(
|
|
612
|
+
ref: x,
|
|
613
|
+
label: a.label ?? s(d)("core.form.date.calendar"),
|
|
614
614
|
width: "auto",
|
|
615
615
|
placement: "bottom-start",
|
|
616
616
|
arrow: !1,
|
|
617
617
|
autofocus: !1
|
|
618
618
|
}, {
|
|
619
|
-
trigger:
|
|
620
|
-
|
|
619
|
+
trigger: v(({ attrs: B, presented: K }) => [
|
|
620
|
+
b("div", {
|
|
621
621
|
class: j(["inline-flex max-w-full items-center gap-2", s(D)])
|
|
622
622
|
}, [
|
|
623
|
-
|
|
623
|
+
b("input", Q({
|
|
624
624
|
id: V,
|
|
625
625
|
ref_key: "input",
|
|
626
626
|
ref: h
|
|
@@ -636,23 +636,23 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
636
636
|
required: a.required,
|
|
637
637
|
"aria-required": a.required || void 0,
|
|
638
638
|
"aria-invalid": q || void 0,
|
|
639
|
-
"aria-describedby":
|
|
639
|
+
"aria-describedby": p,
|
|
640
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",
|
|
641
|
-
onInput:
|
|
642
|
-
onFocus:
|
|
643
|
-
onBlur:
|
|
644
|
-
s(R).commit(),
|
|
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
645
|
}),
|
|
646
646
|
onKeydown: pe,
|
|
647
|
-
onClick:
|
|
647
|
+
onClick: c[4] || (c[4] = (U) => X(!1))
|
|
648
648
|
}), null, 16, ya),
|
|
649
|
-
a.disabled ? T("", !0) : (
|
|
649
|
+
a.disabled ? T("", !0) : (u(), y("button", {
|
|
650
650
|
key: 0,
|
|
651
651
|
type: "button",
|
|
652
652
|
tabindex: "-1",
|
|
653
|
-
"aria-label": s(
|
|
653
|
+
"aria-label": s(d)("core.form.date.open"),
|
|
654
654
|
class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
|
|
655
|
-
onClick: (
|
|
655
|
+
onClick: (U) => K ? x.value?.dismiss() : X(!0)
|
|
656
656
|
}, [
|
|
657
657
|
M(s(te), {
|
|
658
658
|
name: "calendarLine",
|
|
@@ -661,12 +661,12 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
661
661
|
], 8, ha))
|
|
662
662
|
], 2)
|
|
663
663
|
]),
|
|
664
|
-
default:
|
|
665
|
-
|
|
666
|
-
|
|
664
|
+
default: v(({ dismiss: B }) => [
|
|
665
|
+
b("div", ka, [
|
|
666
|
+
b("div", wa, [
|
|
667
667
|
M(_t, {
|
|
668
668
|
ref_key: "calendar",
|
|
669
|
-
ref:
|
|
669
|
+
ref: w,
|
|
670
670
|
"model-value": G.value,
|
|
671
671
|
min: f.value.min,
|
|
672
672
|
max: f.value.max,
|
|
@@ -674,7 +674,7 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
674
674
|
"open-on": a.openOn,
|
|
675
675
|
"onUpdate:modelValue": re
|
|
676
676
|
}, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on"]),
|
|
677
|
-
s(J).length > 0 ? (
|
|
677
|
+
s(J).length > 0 ? (u(), y("div", xa, [
|
|
678
678
|
M(St, {
|
|
679
679
|
items: s(J),
|
|
680
680
|
selected: G.value,
|
|
@@ -682,13 +682,13 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
682
682
|
}, null, 8, ["items", "selected"])
|
|
683
683
|
])) : T("", !0)
|
|
684
684
|
]),
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
for: s(
|
|
685
|
+
b("div", $a, [
|
|
686
|
+
b("label", {
|
|
687
|
+
for: s(xe),
|
|
688
688
|
class: "text-footnote font-semibold text-content-muted"
|
|
689
|
-
}, _(s(
|
|
690
|
-
|
|
691
|
-
id: s(
|
|
689
|
+
}, _(s(d)("core.form.time.label")), 9, _a),
|
|
690
|
+
b("input", {
|
|
691
|
+
id: s(xe),
|
|
692
692
|
type: "text",
|
|
693
693
|
autocomplete: "off",
|
|
694
694
|
inputmode: "numeric",
|
|
@@ -696,20 +696,20 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
696
696
|
placeholder: s(I).placeholder.value,
|
|
697
697
|
"aria-invalid": s(W).message.value ? !0 : void 0,
|
|
698
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",
|
|
699
|
-
onInput:
|
|
700
|
-
onBlur:
|
|
701
|
-
onKeydown:
|
|
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
702
|
}, null, 40, Sa),
|
|
703
703
|
M(Ct, {
|
|
704
704
|
"model-value": ne.value,
|
|
705
705
|
step: a.minuteStep,
|
|
706
706
|
"onUpdate:modelValue": le
|
|
707
707
|
}, null, 8, ["model-value", "step"]),
|
|
708
|
-
|
|
708
|
+
b("button", {
|
|
709
709
|
type: "button",
|
|
710
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",
|
|
711
711
|
onClick: (K) => ke(B)
|
|
712
|
-
}, _(s(
|
|
712
|
+
}, _(s(d)("core.form.time.now")), 9, Ca)
|
|
713
713
|
])
|
|
714
714
|
])
|
|
715
715
|
]),
|
|
@@ -720,21 +720,21 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
720
720
|
}, [
|
|
721
721
|
L.$slots.trailing ? {
|
|
722
722
|
name: "trailing",
|
|
723
|
-
fn:
|
|
723
|
+
fn: v(() => [
|
|
724
724
|
C(L.$slots, "trailing")
|
|
725
725
|
]),
|
|
726
726
|
key: "0"
|
|
727
727
|
} : void 0,
|
|
728
728
|
L.$slots.labelTrailing ? {
|
|
729
729
|
name: "labelTrailing",
|
|
730
|
-
fn:
|
|
730
|
+
fn: v(() => [
|
|
731
731
|
C(L.$slots, "labelTrailing")
|
|
732
732
|
]),
|
|
733
733
|
key: "1"
|
|
734
734
|
} : void 0,
|
|
735
735
|
L.$slots.readonly ? {
|
|
736
736
|
name: "readonly",
|
|
737
|
-
fn:
|
|
737
|
+
fn: v(() => [
|
|
738
738
|
C(L.$slots, "readonly")
|
|
739
739
|
]),
|
|
740
740
|
key: "2"
|
|
@@ -742,19 +742,19 @@ const Xt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Qt = ["name
|
|
|
742
742
|
]), 1040, ["value"]));
|
|
743
743
|
}
|
|
744
744
|
});
|
|
745
|
-
function nt(
|
|
745
|
+
function nt(l, t = {}) {
|
|
746
746
|
const e = t.accept ?? [];
|
|
747
747
|
if (e.length > 0) {
|
|
748
|
-
const a =
|
|
749
|
-
if (!e.some((
|
|
750
|
-
const
|
|
751
|
-
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;
|
|
752
752
|
})) return "invalid_type";
|
|
753
753
|
}
|
|
754
|
-
return (t.maxSize ?? 0) > 0 &&
|
|
754
|
+
return (t.maxSize ?? 0) > 0 && l.size > (t.maxSize ?? 0) ? "too_large" : null;
|
|
755
755
|
}
|
|
756
|
-
function Be(
|
|
757
|
-
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`;
|
|
758
758
|
}
|
|
759
759
|
const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], La = {
|
|
760
760
|
key: 0,
|
|
@@ -776,37 +776,37 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
776
776
|
variant: {},
|
|
777
777
|
accept: {},
|
|
778
778
|
maxSize: {}
|
|
779
|
-
}, { ...
|
|
779
|
+
}, { ...ve, variant: "button", accept: () => [], maxSize: 0 }), {
|
|
780
780
|
modelValue: { default: null },
|
|
781
781
|
modelModifiers: {}
|
|
782
782
|
}),
|
|
783
783
|
emits: ["update:modelValue"],
|
|
784
|
-
setup(
|
|
785
|
-
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(() => {
|
|
786
786
|
if (e.hint) return e.hint;
|
|
787
|
-
const
|
|
788
|
-
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;
|
|
789
789
|
});
|
|
790
|
-
function h(
|
|
791
|
-
if (!
|
|
792
|
-
const r = nt(
|
|
793
|
-
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);
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
a.value = null,
|
|
795
|
+
function x() {
|
|
796
|
+
a.value = null, i.value = null;
|
|
797
797
|
}
|
|
798
|
-
return de(a, (
|
|
799
|
-
!
|
|
800
|
-
}), 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 }, {
|
|
801
801
|
value: a.value?.name ?? null,
|
|
802
802
|
"row-layout": "stacked"
|
|
803
803
|
}), ee({
|
|
804
|
-
default:
|
|
805
|
-
|
|
806
|
-
|
|
804
|
+
default: v(({ id: f, describedby: g, invalid: S }) => [
|
|
805
|
+
b("div", Fa, [
|
|
806
|
+
b("input", {
|
|
807
807
|
id: f,
|
|
808
808
|
ref_key: "chooser",
|
|
809
|
-
ref:
|
|
809
|
+
ref: n,
|
|
810
810
|
type: "file",
|
|
811
811
|
class: "sr-only",
|
|
812
812
|
tabindex: "-1",
|
|
@@ -816,51 +816,51 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
816
816
|
"aria-invalid": S || void 0,
|
|
817
817
|
onChange: r[0] || (r[0] = (z) => h(z.target.files?.[0]))
|
|
818
818
|
}, null, 40, Ba),
|
|
819
|
-
a.value ? (
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
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)
|
|
823
823
|
]),
|
|
824
|
-
|
|
824
|
+
b("button", {
|
|
825
825
|
type: "button",
|
|
826
826
|
disabled: e.disabled,
|
|
827
|
-
"aria-label": s(
|
|
828
|
-
title: s(
|
|
827
|
+
"aria-label": s(o)("core.form.file.remove"),
|
|
828
|
+
title: s(o)("core.form.file.remove"),
|
|
829
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",
|
|
830
|
-
onClick:
|
|
830
|
+
onClick: x
|
|
831
831
|
}, [
|
|
832
832
|
M(s(te), {
|
|
833
833
|
name: "close",
|
|
834
834
|
size: 14
|
|
835
835
|
})
|
|
836
836
|
], 8, Va)
|
|
837
|
-
])) : e.variant === "dropzone" ? (
|
|
837
|
+
])) : e.variant === "dropzone" ? (u(), y("div", {
|
|
838
838
|
key: 1,
|
|
839
839
|
role: "button",
|
|
840
840
|
tabindex: "0",
|
|
841
841
|
"data-test": "file-dropzone",
|
|
842
842
|
"aria-disabled": e.disabled || void 0,
|
|
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",
|
|
844
|
-
onClick: r[1] || (r[1] = (z) => !e.disabled &&
|
|
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()),
|
|
845
845
|
onKeydown: [
|
|
846
|
-
r[2] || (r[2] = Ce(be((z) => !e.disabled &&
|
|
847
|
-
r[3] || (r[3] = Ce(be((z) => !e.disabled &&
|
|
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"]))
|
|
848
848
|
],
|
|
849
|
-
onDragover: r[4] || (r[4] = be((z) =>
|
|
850
|
-
onDragleave: r[5] || (r[5] = be((z) =>
|
|
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
851
|
onDrop: r[6] || (r[6] = be((z) => {
|
|
852
|
-
|
|
852
|
+
d.value = !1, e.disabled || h(z.dataTransfer?.files?.[0]);
|
|
853
853
|
}, ["prevent"]))
|
|
854
854
|
}, [
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
], 42, qa)) : (
|
|
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, {
|
|
858
858
|
key: 2,
|
|
859
859
|
disabled: e.disabled,
|
|
860
|
-
onClick: r[7] || (r[7] = (z) =>
|
|
860
|
+
onClick: r[7] || (r[7] = (z) => n.value?.click())
|
|
861
861
|
}, {
|
|
862
|
-
default:
|
|
863
|
-
Y(_(s(
|
|
862
|
+
default: v(() => [
|
|
863
|
+
Y(_(s(o)("core.form.file.choose")), 1)
|
|
864
864
|
]),
|
|
865
865
|
_: 1
|
|
866
866
|
}, 8, ["disabled"]))
|
|
@@ -868,24 +868,24 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
868
868
|
]),
|
|
869
869
|
_: 2
|
|
870
870
|
}, [
|
|
871
|
-
|
|
871
|
+
w.$slots.trailing ? {
|
|
872
872
|
name: "trailing",
|
|
873
|
-
fn:
|
|
874
|
-
C(
|
|
873
|
+
fn: v(() => [
|
|
874
|
+
C(w.$slots, "trailing")
|
|
875
875
|
]),
|
|
876
876
|
key: "0"
|
|
877
877
|
} : void 0,
|
|
878
|
-
|
|
878
|
+
w.$slots.labelTrailing ? {
|
|
879
879
|
name: "labelTrailing",
|
|
880
|
-
fn:
|
|
881
|
-
C(
|
|
880
|
+
fn: v(() => [
|
|
881
|
+
C(w.$slots, "labelTrailing")
|
|
882
882
|
]),
|
|
883
883
|
key: "1"
|
|
884
884
|
} : void 0,
|
|
885
|
-
|
|
885
|
+
w.$slots.readonly ? {
|
|
886
886
|
name: "readonly",
|
|
887
|
-
fn:
|
|
888
|
-
C(
|
|
887
|
+
fn: v(() => [
|
|
888
|
+
C(w.$slots, "readonly")
|
|
889
889
|
]),
|
|
890
890
|
key: "2"
|
|
891
891
|
} : void 0
|
|
@@ -899,17 +899,17 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
899
899
|
disabled: { type: Boolean, default: !1 }
|
|
900
900
|
},
|
|
901
901
|
emits: ["click"],
|
|
902
|
-
setup(
|
|
903
|
-
const e =
|
|
904
|
-
return (
|
|
905
|
-
default:
|
|
906
|
-
M(
|
|
907
|
-
default:
|
|
908
|
-
|
|
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", {
|
|
909
909
|
type: "button",
|
|
910
910
|
disabled: e.disabled,
|
|
911
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"]),
|
|
912
|
-
onClick:
|
|
912
|
+
onClick: n[0] || (n[0] = (d) => a("click"))
|
|
913
913
|
}, _(e.label), 11, Ma)
|
|
914
914
|
]),
|
|
915
915
|
_: 1
|
|
@@ -920,12 +920,12 @@ const Fa = { class: "w-full" }, Ba = ["id", "accept", "disabled", "aria-describe
|
|
|
920
920
|
}
|
|
921
921
|
}), Bo = /* @__PURE__ */ P({
|
|
922
922
|
__name: "FormIndent",
|
|
923
|
-
setup(
|
|
924
|
-
return Re(
|
|
923
|
+
setup(l) {
|
|
924
|
+
return Re(mt, pt() + 1), (t, e) => C(t.$slots, "default");
|
|
925
925
|
}
|
|
926
926
|
});
|
|
927
|
-
function ja(
|
|
928
|
-
return t.filter((e) => (
|
|
927
|
+
function ja(l, t) {
|
|
928
|
+
return t.filter((e) => (l?.[e] ?? "").trim() === "");
|
|
929
929
|
}
|
|
930
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 = {
|
|
931
931
|
key: 0,
|
|
@@ -960,65 +960,65 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
960
960
|
rows: {},
|
|
961
961
|
placeholder: {},
|
|
962
962
|
maxLength: {}
|
|
963
|
-
}, { ...
|
|
963
|
+
}, { ...ve, locales: void 0, defaultLocale: void 0, requiredLocales: () => [], multiline: !1, rows: 3, placeholder: void 0, maxLength: void 0 }), {
|
|
964
964
|
modelValue: { default: () => ({}) },
|
|
965
965
|
modelModifiers: {}
|
|
966
966
|
}),
|
|
967
967
|
emits: ["update:modelValue"],
|
|
968
|
-
setup(
|
|
969
|
-
const e =
|
|
970
|
-
function R(
|
|
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) {
|
|
971
971
|
try {
|
|
972
|
-
return new Intl.DisplayNames([Ot(
|
|
972
|
+
return new Intl.DisplayNames([Ot(n.value)], { type: "language" }).of(p) ?? E(p);
|
|
973
973
|
} catch {
|
|
974
|
-
return E(
|
|
974
|
+
return E(p);
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
|
-
const Z = (
|
|
978
|
-
function W(
|
|
979
|
-
a.value = { ...a.value, [
|
|
977
|
+
const Z = (p) => p.map(R).join(", ");
|
|
978
|
+
function W(p, q) {
|
|
979
|
+
a.value = { ...a.value, [p]: q };
|
|
980
980
|
}
|
|
981
|
-
const J = (
|
|
982
|
-
function ae(
|
|
983
|
-
z.value =
|
|
981
|
+
const J = (p) => `${m}-tab-${p}`;
|
|
982
|
+
function ae(p, q) {
|
|
983
|
+
z.value = p, q && he(() => h.value?.focus());
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
const B = S.value.length - 1, K = { ArrowRight: q + 1, ArrowLeft: q - 1, Home: 0, End: B }[
|
|
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
987
|
if (K === void 0) return;
|
|
988
|
-
|
|
989
|
-
const
|
|
990
|
-
|
|
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()));
|
|
991
991
|
}
|
|
992
992
|
const D = N(!1);
|
|
993
|
-
function A(
|
|
994
|
-
|
|
993
|
+
function A(p) {
|
|
994
|
+
x.value?.contains(p.relatedTarget) || (D.value = !0);
|
|
995
995
|
}
|
|
996
|
-
const G = k(() => ja(a.value, e.requiredLocales)), ne = k(() => D.value && G.value.length > 0 ?
|
|
997
|
-
function
|
|
998
|
-
const
|
|
999
|
-
a.value = { ...a.value, ...Object.fromEntries(S.value.filter((q) => !F(q)).map((q) => [q,
|
|
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])) };
|
|
1000
1000
|
}
|
|
1001
|
-
const X = k(() => [
|
|
1002
|
-
return t({ focus: () => h.value?.focus() }), (
|
|
1003
|
-
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,
|
|
1004
1004
|
"row-layout": "stacked"
|
|
1005
1005
|
}), ee({
|
|
1006
|
-
default:
|
|
1007
|
-
|
|
1006
|
+
default: v(({ id: B, describedby: K, invalid: U }) => [
|
|
1007
|
+
b("div", {
|
|
1008
1008
|
ref_key: "root",
|
|
1009
|
-
ref:
|
|
1009
|
+
ref: x,
|
|
1010
1010
|
class: "w-full",
|
|
1011
1011
|
onFocusout: A
|
|
1012
1012
|
}, [
|
|
1013
|
-
|
|
1014
|
-
id: `${s(
|
|
1013
|
+
b("div", {
|
|
1014
|
+
id: `${s(m)}-panel`,
|
|
1015
1015
|
role: "tabpanel",
|
|
1016
1016
|
"aria-labelledby": J($.value)
|
|
1017
1017
|
}, [
|
|
1018
|
-
|
|
1018
|
+
b("div", {
|
|
1019
1019
|
class: j(["w-full", s(r)])
|
|
1020
1020
|
}, [
|
|
1021
|
-
e.multiline ? (
|
|
1021
|
+
e.multiline ? (u(), y("textarea", {
|
|
1022
1022
|
key: 0,
|
|
1023
1023
|
id: B,
|
|
1024
1024
|
ref_key: "field",
|
|
@@ -1031,12 +1031,12 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1031
1031
|
maxlength: e.maxLength,
|
|
1032
1032
|
disabled: e.disabled,
|
|
1033
1033
|
"aria-required": e.required || void 0,
|
|
1034
|
-
"aria-invalid":
|
|
1034
|
+
"aria-invalid": U || void 0,
|
|
1035
1035
|
"aria-describedby": K,
|
|
1036
1036
|
"data-test": "i18n-input",
|
|
1037
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",
|
|
1038
1038
|
onInput: q[0] || (q[0] = (Te) => W($.value, Te.target.value))
|
|
1039
|
-
}, null, 40, Ia)) : (
|
|
1039
|
+
}, null, 40, Ia)) : (u(), y("input", {
|
|
1040
1040
|
key: 1,
|
|
1041
1041
|
id: B,
|
|
1042
1042
|
ref_key: "field",
|
|
@@ -1049,7 +1049,7 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1049
1049
|
maxlength: e.maxLength,
|
|
1050
1050
|
disabled: e.disabled,
|
|
1051
1051
|
"aria-required": e.required || void 0,
|
|
1052
|
-
"aria-invalid":
|
|
1052
|
+
"aria-invalid": U || void 0,
|
|
1053
1053
|
"aria-describedby": K,
|
|
1054
1054
|
"data-test": "i18n-input",
|
|
1055
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",
|
|
@@ -1057,41 +1057,41 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1057
1057
|
}, null, 40, Ga))
|
|
1058
1058
|
], 2)
|
|
1059
1059
|
], 8, Ea),
|
|
1060
|
-
le.value.length > 0 || ke.value ? (
|
|
1061
|
-
le.value.length > 0 ? (
|
|
1062
|
-
ke.value && !e.disabled ? (
|
|
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", {
|
|
1063
1063
|
key: 2,
|
|
1064
1064
|
type: "button",
|
|
1065
1065
|
"data-test": "i18n-copy",
|
|
1066
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",
|
|
1067
|
-
onClick:
|
|
1068
|
-
}, _(s(
|
|
1067
|
+
onClick: xe
|
|
1068
|
+
}, _(s(o)("core.form.i18n.copy", { language: E(g.value) })), 1)) : T("", !0)
|
|
1069
1069
|
])) : T("", !0)
|
|
1070
1070
|
], 544)
|
|
1071
1071
|
]),
|
|
1072
|
-
labelTrailing:
|
|
1073
|
-
|
|
1072
|
+
labelTrailing: v(() => [
|
|
1073
|
+
b("div", {
|
|
1074
1074
|
role: "tablist",
|
|
1075
|
-
"aria-label": s(
|
|
1075
|
+
"aria-label": s(o)("core.form.i18n.languages"),
|
|
1076
1076
|
class: "flex shrink-0 gap-0.5 rounded-control bg-fill p-0.5",
|
|
1077
1077
|
"data-test": "i18n-tabs"
|
|
1078
1078
|
}, [
|
|
1079
|
-
(
|
|
1079
|
+
(u(!0), y(ue, null, we(S.value, (B, K) => (u(), y("button", {
|
|
1080
1080
|
id: J(B),
|
|
1081
1081
|
key: B,
|
|
1082
1082
|
type: "button",
|
|
1083
1083
|
role: "tab",
|
|
1084
1084
|
"aria-selected": B === $.value,
|
|
1085
1085
|
tabindex: B === $.value ? 0 : -1,
|
|
1086
|
-
"aria-controls": `${s(
|
|
1087
|
-
"aria-label": s(
|
|
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
1088
|
title: R(B),
|
|
1089
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: (
|
|
1091
|
-
onKeydown: (
|
|
1090
|
+
onClick: (U) => ae(B, !0),
|
|
1091
|
+
onKeydown: (U) => me(U, K)
|
|
1092
1092
|
}, [
|
|
1093
1093
|
Y(_(E(B)) + " ", 1),
|
|
1094
|
-
|
|
1094
|
+
b("span", {
|
|
1095
1095
|
"aria-hidden": "true",
|
|
1096
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"]),
|
|
1097
1097
|
"data-test": "i18n-dot",
|
|
@@ -1104,35 +1104,35 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1104
1104
|
}, [
|
|
1105
1105
|
X.value ? {
|
|
1106
1106
|
name: "readonly",
|
|
1107
|
-
fn:
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
pe.value.length > 0 ? (
|
|
1111
|
-
|
|
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", {
|
|
1112
1112
|
type: "button",
|
|
1113
|
-
"aria-expanded":
|
|
1113
|
+
"aria-expanded": c.value,
|
|
1114
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",
|
|
1115
|
-
onClick: q[2] || (q[2] = (B) =>
|
|
1115
|
+
onClick: q[2] || (q[2] = (B) => c.value = !c.value)
|
|
1116
1116
|
}, [
|
|
1117
|
-
|
|
1117
|
+
b("span", Za, _(s(o)("core.form.i18n.more", { count: pe.value.length, filled: L.value })), 1),
|
|
1118
1118
|
M(s(te), {
|
|
1119
1119
|
name: "arrowRightSLine",
|
|
1120
1120
|
size: 16,
|
|
1121
|
-
class: j(["shrink-0 transition-transform duration-motion-fast",
|
|
1121
|
+
class: j(["shrink-0 transition-transform duration-motion-fast", c.value ? "rotate-90" : ""])
|
|
1122
1122
|
}, null, 8, ["class"])
|
|
1123
1123
|
], 8, Ja),
|
|
1124
|
-
|
|
1125
|
-
(
|
|
1124
|
+
c.value ? (u(), y("dl", Xa, [
|
|
1125
|
+
(u(!0), y(ue, null, we(pe.value, (B) => (u(), y("div", {
|
|
1126
1126
|
key: B,
|
|
1127
1127
|
class: "flex gap-2 text-body"
|
|
1128
1128
|
}, [
|
|
1129
|
-
|
|
1129
|
+
b("dt", {
|
|
1130
1130
|
class: "w-8 shrink-0 text-footnote font-semibold leading-6 text-content-muted",
|
|
1131
1131
|
title: R(B)
|
|
1132
1132
|
}, _(E(B)), 9, Qa),
|
|
1133
|
-
|
|
1133
|
+
b("dd", {
|
|
1134
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(
|
|
1135
|
+
}, _(F(B) ? I(B) : s(o)("core.state.no_value")), 3)
|
|
1136
1136
|
]))), 128))
|
|
1137
1137
|
])) : T("", !0)
|
|
1138
1138
|
], 64)) : T("", !0)
|
|
@@ -1140,10 +1140,10 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1140
1140
|
]),
|
|
1141
1141
|
key: "0"
|
|
1142
1142
|
} : void 0,
|
|
1143
|
-
|
|
1143
|
+
p.$slots.trailing ? {
|
|
1144
1144
|
name: "trailing",
|
|
1145
|
-
fn:
|
|
1146
|
-
C(
|
|
1145
|
+
fn: v(() => [
|
|
1146
|
+
C(p.$slots, "trailing")
|
|
1147
1147
|
]),
|
|
1148
1148
|
key: "1"
|
|
1149
1149
|
} : void 0
|
|
@@ -1168,42 +1168,42 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1168
1168
|
blankZero: { type: Boolean },
|
|
1169
1169
|
negative: { type: Boolean },
|
|
1170
1170
|
width: {}
|
|
1171
|
-
}, { ...
|
|
1171
|
+
}, { ...ve, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
|
|
1172
1172
|
emits: ["update:modelValue", "focus", "blur"],
|
|
1173
|
-
setup(
|
|
1174
|
-
const a =
|
|
1175
|
-
return t({ focus: () =>
|
|
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({
|
|
1176
1176
|
ref_key: "field",
|
|
1177
|
-
ref:
|
|
1177
|
+
ref: n,
|
|
1178
1178
|
"model-value": a.modelValue,
|
|
1179
|
-
"onUpdate:modelValue":
|
|
1179
|
+
"onUpdate:modelValue": i[0] || (i[0] = (m) => o("update:modelValue", m))
|
|
1180
1180
|
}, s(fe)(a), {
|
|
1181
1181
|
decimals: a.decimals,
|
|
1182
1182
|
negative: a.negative,
|
|
1183
1183
|
"blank-zero": a.blankZero,
|
|
1184
1184
|
suffix: a.currency,
|
|
1185
1185
|
width: a.width,
|
|
1186
|
-
onFocus:
|
|
1187
|
-
onBlur:
|
|
1186
|
+
onFocus: i[1] || (i[1] = (m) => o("focus", m)),
|
|
1187
|
+
onBlur: i[2] || (i[2] = (m) => o("blur", m))
|
|
1188
1188
|
}), ee({ _: 2 }, [
|
|
1189
|
-
|
|
1189
|
+
d.$slots.trailing ? {
|
|
1190
1190
|
name: "trailing",
|
|
1191
|
-
fn:
|
|
1192
|
-
C(
|
|
1191
|
+
fn: v(() => [
|
|
1192
|
+
C(d.$slots, "trailing")
|
|
1193
1193
|
]),
|
|
1194
1194
|
key: "0"
|
|
1195
1195
|
} : void 0,
|
|
1196
|
-
|
|
1196
|
+
d.$slots.labelTrailing ? {
|
|
1197
1197
|
name: "labelTrailing",
|
|
1198
|
-
fn:
|
|
1199
|
-
C(
|
|
1198
|
+
fn: v(() => [
|
|
1199
|
+
C(d.$slots, "labelTrailing")
|
|
1200
1200
|
]),
|
|
1201
1201
|
key: "1"
|
|
1202
1202
|
} : void 0,
|
|
1203
|
-
|
|
1203
|
+
d.$slots.readonly ? {
|
|
1204
1204
|
name: "readonly",
|
|
1205
|
-
fn:
|
|
1206
|
-
C(
|
|
1205
|
+
fn: v(() => [
|
|
1206
|
+
C(d.$slots, "readonly")
|
|
1207
1207
|
]),
|
|
1208
1208
|
key: "2"
|
|
1209
1209
|
} : void 0
|
|
@@ -1223,42 +1223,44 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1223
1223
|
presentation: {},
|
|
1224
1224
|
name: {},
|
|
1225
1225
|
minYear: {},
|
|
1226
|
-
maxYear: {}
|
|
1227
|
-
|
|
1226
|
+
maxYear: {},
|
|
1227
|
+
placeholder: {}
|
|
1228
|
+
}, { ...ve, placeholder: void 0, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
|
|
1228
1229
|
month: { default: null },
|
|
1229
1230
|
monthModifiers: {},
|
|
1230
1231
|
year: { default: null },
|
|
1231
1232
|
yearModifiers: {}
|
|
1232
1233
|
}),
|
|
1233
1234
|
emits: ["update:month", "update:year"],
|
|
1234
|
-
setup(
|
|
1235
|
-
const t =
|
|
1236
|
-
function
|
|
1237
|
-
e.value =
|
|
1235
|
+
setup(l) {
|
|
1236
|
+
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") : "");
|
|
1237
|
+
function m(x, w) {
|
|
1238
|
+
e.value = x.month, a.value = x.year, w();
|
|
1238
1239
|
}
|
|
1239
|
-
function h(
|
|
1240
|
-
e.value = null, a.value = null,
|
|
1240
|
+
function h(x) {
|
|
1241
|
+
e.value = null, a.value = null, x();
|
|
1241
1242
|
}
|
|
1242
|
-
return (
|
|
1243
|
-
value:
|
|
1243
|
+
return (x, w) => (u(), O(ye, Q(s(fe)(t), {
|
|
1244
|
+
value: i.value || null
|
|
1244
1245
|
}), ee({
|
|
1245
|
-
default:
|
|
1246
|
+
default: v(({ id: r, describedby: f, invalid: g }) => [
|
|
1246
1247
|
M(Pe, {
|
|
1247
|
-
label: t.label ??
|
|
1248
|
+
label: t.label ?? i.value,
|
|
1248
1249
|
width: "sm",
|
|
1249
1250
|
placement: "bottom-start",
|
|
1250
1251
|
arrow: !1
|
|
1251
1252
|
}, {
|
|
1252
|
-
trigger:
|
|
1253
|
+
trigger: v(({ toggle: S, presented: z }) => [
|
|
1253
1254
|
M(ot, Q({ id: r, "aria-describedby": f }, {
|
|
1254
1255
|
expanded: z,
|
|
1255
1256
|
disabled: t.disabled,
|
|
1256
1257
|
invalid: g,
|
|
1258
|
+
placeholder: t.placeholder ?? s(o)("core.form.select.choose"),
|
|
1257
1259
|
onClick: S
|
|
1258
1260
|
}), {
|
|
1259
|
-
default:
|
|
1260
|
-
|
|
1261
|
-
Y(_(
|
|
1261
|
+
default: v(() => [
|
|
1262
|
+
i.value ? (u(), y(ue, { key: 0 }, [
|
|
1263
|
+
Y(_(i.value), 1),
|
|
1262
1264
|
M(s(te), {
|
|
1263
1265
|
name: "calendarLine",
|
|
1264
1266
|
size: 16,
|
|
@@ -1267,23 +1269,23 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1267
1269
|
], 64)) : T("", !0)
|
|
1268
1270
|
]),
|
|
1269
1271
|
_: 1
|
|
1270
|
-
}, 16, ["expanded", "disabled", "invalid", "onClick"])
|
|
1272
|
+
}, 16, ["expanded", "disabled", "invalid", "placeholder", "onClick"])
|
|
1271
1273
|
]),
|
|
1272
|
-
default:
|
|
1273
|
-
|
|
1274
|
+
default: v(({ dismiss: S }) => [
|
|
1275
|
+
b("div", el, [
|
|
1274
1276
|
M(Bt, {
|
|
1275
1277
|
month: e.value,
|
|
1276
1278
|
year: a.value,
|
|
1277
1279
|
"min-year": t.minYear,
|
|
1278
1280
|
"max-year": t.maxYear,
|
|
1279
|
-
onPick: (z) =>
|
|
1281
|
+
onPick: (z) => m(z, S)
|
|
1280
1282
|
}, null, 8, ["month", "year", "min-year", "max-year", "onPick"]),
|
|
1281
|
-
|
|
1283
|
+
n.value || a.value !== null ? (u(), y("button", {
|
|
1282
1284
|
key: 0,
|
|
1283
1285
|
type: "button",
|
|
1284
1286
|
class: "cursor-pointer self-start rounded-control px-1 text-footnote text-content-link",
|
|
1285
1287
|
onClick: (z) => h(S)
|
|
1286
|
-
}, _(s(
|
|
1288
|
+
}, _(s(o)("core.form.select.clear")), 9, tl)) : T("", !0)
|
|
1287
1289
|
])
|
|
1288
1290
|
]),
|
|
1289
1291
|
_: 2
|
|
@@ -1291,24 +1293,24 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1291
1293
|
]),
|
|
1292
1294
|
_: 2
|
|
1293
1295
|
}, [
|
|
1294
|
-
|
|
1296
|
+
x.$slots.trailing ? {
|
|
1295
1297
|
name: "trailing",
|
|
1296
|
-
fn:
|
|
1297
|
-
C(
|
|
1298
|
+
fn: v(() => [
|
|
1299
|
+
C(x.$slots, "trailing")
|
|
1298
1300
|
]),
|
|
1299
1301
|
key: "0"
|
|
1300
1302
|
} : void 0,
|
|
1301
|
-
|
|
1303
|
+
x.$slots.labelTrailing ? {
|
|
1302
1304
|
name: "labelTrailing",
|
|
1303
|
-
fn:
|
|
1304
|
-
C(
|
|
1305
|
+
fn: v(() => [
|
|
1306
|
+
C(x.$slots, "labelTrailing")
|
|
1305
1307
|
]),
|
|
1306
1308
|
key: "1"
|
|
1307
1309
|
} : void 0,
|
|
1308
|
-
|
|
1310
|
+
x.$slots.readonly ? {
|
|
1309
1311
|
name: "readonly",
|
|
1310
|
-
fn:
|
|
1311
|
-
C(
|
|
1312
|
+
fn: v(() => [
|
|
1313
|
+
C(x.$slots, "readonly")
|
|
1312
1314
|
]),
|
|
1313
1315
|
key: "2"
|
|
1314
1316
|
} : void 0
|
|
@@ -1331,41 +1333,41 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1331
1333
|
selected: {},
|
|
1332
1334
|
placeholder: {},
|
|
1333
1335
|
searchFrom: {}
|
|
1334
|
-
}, { ...
|
|
1336
|
+
}, { ...ve, selected: () => [], placeholder: void 0, searchFrom: 9 }), {
|
|
1335
1337
|
modelValue: { default: () => [] },
|
|
1336
1338
|
modelModifiers: {}
|
|
1337
1339
|
}),
|
|
1338
1340
|
emits: ["update:modelValue"],
|
|
1339
|
-
setup(
|
|
1340
|
-
const t =
|
|
1341
|
+
setup(l) {
|
|
1342
|
+
const t = l, e = ie(l, "modelValue"), { t: a } = oe(), o = Ne(), n = H("sheet"), d = N(!1), i = It(() => t.options, (r) => {
|
|
1341
1343
|
const f = e.value.filter((g) => r.some((S) => S.value === g));
|
|
1342
1344
|
f.length !== e.value.length && (e.value = f);
|
|
1343
|
-
}),
|
|
1344
|
-
const f =
|
|
1345
|
+
}), m = k(() => e.value.flatMap((r) => {
|
|
1346
|
+
const f = i.known.value.find((g) => g.value === r) ?? t.selected.find((g) => g.value === r);
|
|
1345
1347
|
return f ? [f] : [];
|
|
1346
1348
|
})), h = k(() => t.placeholder ?? a("core.form.select.choose"));
|
|
1347
|
-
function
|
|
1349
|
+
function x(r) {
|
|
1348
1350
|
r !== null && (e.value = e.value.includes(r) ? e.value.filter((f) => f !== r) : [...e.value, r]);
|
|
1349
1351
|
}
|
|
1350
|
-
const
|
|
1351
|
-
return (r, f) => (
|
|
1352
|
-
value:
|
|
1352
|
+
const w = (r) => e.value = e.value.filter((f) => f !== r);
|
|
1353
|
+
return (r, f) => (u(), O(ye, Q(s(fe)(t), {
|
|
1354
|
+
value: m.value.length ? m.value.map((g) => g.label).join(", ") : null,
|
|
1353
1355
|
"row-layout": "stacked"
|
|
1354
1356
|
}), ee({
|
|
1355
|
-
default:
|
|
1356
|
-
|
|
1357
|
-
(
|
|
1357
|
+
default: v(({ id: g, describedby: S, invalid: z }) => [
|
|
1358
|
+
b("div", al, [
|
|
1359
|
+
(u(!0), y(ue, null, we(m.value, ($) => (u(), y("span", {
|
|
1358
1360
|
key: String($.value),
|
|
1359
1361
|
"data-test": "chip",
|
|
1360
1362
|
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"
|
|
1361
1363
|
}, [
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
+
b("span", ll, _($.label), 1),
|
|
1365
|
+
b("button", {
|
|
1364
1366
|
type: "button",
|
|
1365
1367
|
disabled: t.disabled,
|
|
1366
1368
|
"aria-label": `${s(a)("core.form.select.clear")}: ${$.label}`,
|
|
1367
1369
|
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",
|
|
1368
|
-
onClick: (I) =>
|
|
1370
|
+
onClick: (I) => w($.value)
|
|
1369
1371
|
}, [
|
|
1370
1372
|
M(s(te), {
|
|
1371
1373
|
name: "close",
|
|
@@ -1373,27 +1375,27 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1373
1375
|
})
|
|
1374
1376
|
], 8, ol)
|
|
1375
1377
|
]))), 128)),
|
|
1376
|
-
s(
|
|
1378
|
+
s(o) ? (u(), y("button", {
|
|
1377
1379
|
key: 0,
|
|
1378
1380
|
id: g,
|
|
1379
1381
|
type: "button",
|
|
1380
1382
|
disabled: t.disabled,
|
|
1381
1383
|
"aria-haspopup": "dialog",
|
|
1382
|
-
"aria-expanded":
|
|
1384
|
+
"aria-expanded": d.value,
|
|
1383
1385
|
"aria-invalid": z || void 0,
|
|
1384
1386
|
"aria-describedby": S,
|
|
1385
|
-
"aria-busy": s(
|
|
1387
|
+
"aria-busy": s(i).loading.value || void 0,
|
|
1386
1388
|
class: j(Xe),
|
|
1387
|
-
onClick: f[0] || (f[0] = ($) =>
|
|
1389
|
+
onClick: f[0] || (f[0] = ($) => n.value?.present())
|
|
1388
1390
|
}, [
|
|
1389
|
-
s(
|
|
1391
|
+
s(i).loading.value ? (u(), O(s(te), {
|
|
1390
1392
|
key: 0,
|
|
1391
1393
|
name: "loader4Line",
|
|
1392
1394
|
size: 14,
|
|
1393
1395
|
class: "shrink-0 animate-spin"
|
|
1394
1396
|
})) : T("", !0),
|
|
1395
|
-
Y(" " + _(
|
|
1396
|
-
], 8, nl)) : (
|
|
1397
|
+
Y(" " + _(m.value.length ? s(a)("core.actions.edit") : h.value), 1)
|
|
1398
|
+
], 8, nl)) : (u(), O(Pe, {
|
|
1397
1399
|
key: 1,
|
|
1398
1400
|
label: t.label ?? h.value,
|
|
1399
1401
|
width: "lg",
|
|
@@ -1401,8 +1403,8 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1401
1403
|
placement: "bottom-start",
|
|
1402
1404
|
arrow: !1
|
|
1403
1405
|
}, {
|
|
1404
|
-
trigger:
|
|
1405
|
-
|
|
1406
|
+
trigger: v(({ toggle: $, attrs: I }) => [
|
|
1407
|
+
b("button", Q({
|
|
1406
1408
|
id: g,
|
|
1407
1409
|
type: "button"
|
|
1408
1410
|
}, I, {
|
|
@@ -1410,34 +1412,34 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1410
1412
|
disabled: t.disabled,
|
|
1411
1413
|
"aria-invalid": z || void 0,
|
|
1412
1414
|
"aria-describedby": S,
|
|
1413
|
-
"aria-busy": s(
|
|
1415
|
+
"aria-busy": s(i).loading.value || void 0,
|
|
1414
1416
|
class: Xe,
|
|
1415
1417
|
onClick: $
|
|
1416
1418
|
}), [
|
|
1417
|
-
s(
|
|
1419
|
+
s(i).loading.value ? (u(), O(s(te), {
|
|
1418
1420
|
key: 0,
|
|
1419
1421
|
name: "loader4Line",
|
|
1420
1422
|
size: 14,
|
|
1421
1423
|
class: "shrink-0 animate-spin"
|
|
1422
1424
|
})) : T("", !0),
|
|
1423
|
-
Y(" " + _(
|
|
1425
|
+
Y(" " + _(m.value.length ? s(a)("core.actions.edit") : h.value), 1)
|
|
1424
1426
|
], 16, sl)
|
|
1425
1427
|
]),
|
|
1426
|
-
default:
|
|
1427
|
-
|
|
1428
|
+
default: v(() => [
|
|
1429
|
+
b("div", rl, [
|
|
1428
1430
|
M(We, {
|
|
1429
|
-
options: s(
|
|
1430
|
-
status: s(
|
|
1431
|
+
options: s(i).rows.value,
|
|
1432
|
+
status: s(i).status.value,
|
|
1431
1433
|
"model-value": e.value,
|
|
1432
1434
|
multiple: "",
|
|
1433
1435
|
"search-from": t.searchFrom,
|
|
1434
1436
|
presentation: "plain",
|
|
1435
|
-
onSelect:
|
|
1436
|
-
onRetry: f[1] || (f[1] = ($) => s(
|
|
1437
|
+
onSelect: x,
|
|
1438
|
+
onRetry: f[1] || (f[1] = ($) => s(i).reload())
|
|
1437
1439
|
}, ee({ _: 2 }, [
|
|
1438
1440
|
r.$slots.option ? {
|
|
1439
1441
|
name: "option",
|
|
1440
|
-
fn:
|
|
1442
|
+
fn: v(($) => [
|
|
1441
1443
|
C(r.$slots, "option", Ve(qe($)))
|
|
1442
1444
|
]),
|
|
1443
1445
|
key: "0"
|
|
@@ -1448,51 +1450,51 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1448
1450
|
_: 2
|
|
1449
1451
|
}, 1032, ["label"]))
|
|
1450
1452
|
]),
|
|
1451
|
-
s(
|
|
1453
|
+
s(o) ? (u(), O(Et, {
|
|
1452
1454
|
key: 0,
|
|
1453
1455
|
ref_key: "sheet",
|
|
1454
|
-
ref:
|
|
1456
|
+
ref: n,
|
|
1455
1457
|
title: t.label ?? h.value,
|
|
1456
1458
|
grouped: "",
|
|
1457
|
-
onPresented: f[5] || (f[5] = ($) =>
|
|
1458
|
-
onDismissed: f[6] || (f[6] = ($) =>
|
|
1459
|
+
onPresented: f[5] || (f[5] = ($) => d.value = !0),
|
|
1460
|
+
onDismissed: f[6] || (f[6] = ($) => d.value = !1)
|
|
1459
1461
|
}, {
|
|
1460
|
-
footer:
|
|
1461
|
-
|
|
1462
|
+
footer: v(() => [
|
|
1463
|
+
b("div", il, [
|
|
1462
1464
|
M(ge, {
|
|
1463
1465
|
prominence: "plain",
|
|
1464
1466
|
disabled: e.value.length === 0,
|
|
1465
1467
|
onClick: f[3] || (f[3] = ($) => e.value = [])
|
|
1466
1468
|
}, {
|
|
1467
|
-
default:
|
|
1469
|
+
default: v(() => [
|
|
1468
1470
|
Y(_(s(a)("core.form.select.clear")), 1)
|
|
1469
1471
|
]),
|
|
1470
1472
|
_: 1
|
|
1471
1473
|
}, 8, ["disabled"]),
|
|
1472
1474
|
M(ge, {
|
|
1473
1475
|
prominence: "primary",
|
|
1474
|
-
onClick: f[4] || (f[4] = ($) =>
|
|
1476
|
+
onClick: f[4] || (f[4] = ($) => n.value?.dismiss())
|
|
1475
1477
|
}, {
|
|
1476
|
-
default:
|
|
1478
|
+
default: v(() => [
|
|
1477
1479
|
Y(_(s(a)("core.form.select.done")), 1)
|
|
1478
1480
|
]),
|
|
1479
1481
|
_: 1
|
|
1480
1482
|
})
|
|
1481
1483
|
])
|
|
1482
1484
|
]),
|
|
1483
|
-
default:
|
|
1485
|
+
default: v(() => [
|
|
1484
1486
|
M(We, {
|
|
1485
|
-
options: s(
|
|
1486
|
-
status: s(
|
|
1487
|
+
options: s(i).rows.value,
|
|
1488
|
+
status: s(i).status.value,
|
|
1487
1489
|
"model-value": e.value,
|
|
1488
1490
|
multiple: "",
|
|
1489
1491
|
"search-from": t.searchFrom,
|
|
1490
|
-
onSelect:
|
|
1491
|
-
onRetry: f[2] || (f[2] = ($) => s(
|
|
1492
|
+
onSelect: x,
|
|
1493
|
+
onRetry: f[2] || (f[2] = ($) => s(i).reload())
|
|
1492
1494
|
}, ee({ _: 2 }, [
|
|
1493
1495
|
r.$slots.option ? {
|
|
1494
1496
|
name: "option",
|
|
1495
|
-
fn:
|
|
1497
|
+
fn: v(($) => [
|
|
1496
1498
|
C(r.$slots, "option", Ve(qe($)))
|
|
1497
1499
|
]),
|
|
1498
1500
|
key: "0"
|
|
@@ -1506,28 +1508,28 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1506
1508
|
}, [
|
|
1507
1509
|
r.$slots.trailing ? {
|
|
1508
1510
|
name: "trailing",
|
|
1509
|
-
fn:
|
|
1511
|
+
fn: v(() => [
|
|
1510
1512
|
C(r.$slots, "trailing")
|
|
1511
1513
|
]),
|
|
1512
1514
|
key: "0"
|
|
1513
1515
|
} : void 0,
|
|
1514
1516
|
r.$slots.labelTrailing ? {
|
|
1515
1517
|
name: "labelTrailing",
|
|
1516
|
-
fn:
|
|
1518
|
+
fn: v(() => [
|
|
1517
1519
|
C(r.$slots, "labelTrailing")
|
|
1518
1520
|
]),
|
|
1519
1521
|
key: "1"
|
|
1520
1522
|
} : void 0,
|
|
1521
1523
|
r.$slots.readonly ? {
|
|
1522
1524
|
name: "readonly",
|
|
1523
|
-
fn:
|
|
1525
|
+
fn: v(() => [
|
|
1524
1526
|
C(r.$slots, "readonly")
|
|
1525
1527
|
]),
|
|
1526
1528
|
key: "2"
|
|
1527
1529
|
} : void 0
|
|
1528
1530
|
]), 1040, ["value"]));
|
|
1529
1531
|
}
|
|
1530
|
-
}), ul = ["aria-label"], dl = ["src"], cl = { class: "flex flex-wrap items-center gap-3" }, fl = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"],
|
|
1532
|
+
}), 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({
|
|
1531
1533
|
__name: "PhotoField",
|
|
1532
1534
|
props: /* @__PURE__ */ se(/* @__PURE__ */ ce({
|
|
1533
1535
|
label: {},
|
|
@@ -1542,35 +1544,35 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1542
1544
|
name: {},
|
|
1543
1545
|
accept: {},
|
|
1544
1546
|
maxSize: {}
|
|
1545
|
-
}, { ...
|
|
1547
|
+
}, { ...ve, accept: () => ["image/jpeg", "image/png", "image/webp", "image/gif"], maxSize: 5 * 1024 * 1024 }), {
|
|
1546
1548
|
modelValue: { default: null },
|
|
1547
1549
|
modelModifiers: {}
|
|
1548
1550
|
}),
|
|
1549
1551
|
emits: ["update:modelValue"],
|
|
1550
|
-
setup(
|
|
1551
|
-
const t =
|
|
1552
|
-
function
|
|
1553
|
-
|
|
1552
|
+
setup(l) {
|
|
1553
|
+
const t = l, e = ie(l, "modelValue"), { t: a } = oe(), o = H("chooser"), n = N(null), d = N(null);
|
|
1554
|
+
function i() {
|
|
1555
|
+
d.value && URL.revokeObjectURL(d.value), d.value = null;
|
|
1554
1556
|
}
|
|
1555
1557
|
de(
|
|
1556
1558
|
e,
|
|
1557
1559
|
(r) => {
|
|
1558
|
-
|
|
1560
|
+
i(), r instanceof File && (d.value = URL.createObjectURL(r)), r === null && o.value && (o.value.value = "");
|
|
1559
1561
|
},
|
|
1560
1562
|
{ immediate: !0 }
|
|
1561
|
-
), Ee(
|
|
1562
|
-
const
|
|
1563
|
-
function
|
|
1563
|
+
), Ee(i);
|
|
1564
|
+
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 }] : []);
|
|
1565
|
+
function w(r) {
|
|
1564
1566
|
if (!r) return;
|
|
1565
1567
|
const f = nt(r, { accept: t.accept, maxSize: t.maxSize });
|
|
1566
|
-
f ?
|
|
1568
|
+
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);
|
|
1567
1569
|
}
|
|
1568
|
-
return (r, f) => (
|
|
1569
|
-
value:
|
|
1570
|
+
return (r, f) => (u(), O(ye, Q({ ...s(fe)(t), error: n.value ?? t.error }, {
|
|
1571
|
+
value: m.value ? s(a)("core.form.file.choose") : null,
|
|
1570
1572
|
"row-layout": "stacked"
|
|
1571
1573
|
}), ee({
|
|
1572
|
-
readonly:
|
|
1573
|
-
|
|
1574
|
+
readonly: v(() => [
|
|
1575
|
+
m.value ? (u(), y("button", {
|
|
1574
1576
|
key: 0,
|
|
1575
1577
|
type: "button",
|
|
1576
1578
|
"aria-label": s(a)("core.viewer.open"),
|
|
@@ -1578,25 +1580,25 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1578
1580
|
class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
1579
1581
|
onClick: f[0] || (f[0] = (g) => h.value?.present(0))
|
|
1580
1582
|
}, [
|
|
1581
|
-
|
|
1582
|
-
src:
|
|
1583
|
+
b("img", {
|
|
1584
|
+
src: m.value,
|
|
1583
1585
|
alt: "",
|
|
1584
1586
|
class: "size-40 rounded-group object-cover"
|
|
1585
1587
|
}, null, 8, dl)
|
|
1586
1588
|
], 8, ul)) : T("", !0),
|
|
1587
|
-
|
|
1589
|
+
m.value ? (u(), O(Je, {
|
|
1588
1590
|
key: 1,
|
|
1589
1591
|
ref_key: "viewer",
|
|
1590
1592
|
ref: h,
|
|
1591
|
-
items:
|
|
1593
|
+
items: x.value
|
|
1592
1594
|
}, null, 8, ["items"])) : T("", !0)
|
|
1593
1595
|
]),
|
|
1594
|
-
default:
|
|
1595
|
-
|
|
1596
|
-
|
|
1596
|
+
default: v(({ id: g, describedby: S, invalid: z }) => [
|
|
1597
|
+
b("div", cl, [
|
|
1598
|
+
b("input", {
|
|
1597
1599
|
id: g,
|
|
1598
1600
|
ref_key: "chooser",
|
|
1599
|
-
ref:
|
|
1601
|
+
ref: o,
|
|
1600
1602
|
type: "file",
|
|
1601
1603
|
class: "sr-only",
|
|
1602
1604
|
tabindex: "-1",
|
|
@@ -1604,9 +1606,9 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1604
1606
|
disabled: t.disabled,
|
|
1605
1607
|
"aria-describedby": S,
|
|
1606
1608
|
"aria-invalid": z || void 0,
|
|
1607
|
-
onChange: f[1] || (f[1] = ($) =>
|
|
1609
|
+
onChange: f[1] || (f[1] = ($) => w($.target.files?.[0]))
|
|
1608
1610
|
}, null, 40, fl),
|
|
1609
|
-
|
|
1611
|
+
m.value ? (u(), y("button", {
|
|
1610
1612
|
key: 0,
|
|
1611
1613
|
type: "button",
|
|
1612
1614
|
"aria-label": s(a)("core.viewer.open"),
|
|
@@ -1614,56 +1616,56 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1614
1616
|
class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
1615
1617
|
onClick: f[2] || (f[2] = ($) => h.value?.present(0))
|
|
1616
1618
|
}, [
|
|
1617
|
-
|
|
1618
|
-
src:
|
|
1619
|
+
b("img", {
|
|
1620
|
+
src: m.value,
|
|
1619
1621
|
alt: "",
|
|
1620
1622
|
"data-test": "photo-preview",
|
|
1621
1623
|
class: "size-28 rounded-group object-cover"
|
|
1622
|
-
}, null, 8,
|
|
1623
|
-
], 8,
|
|
1624
|
+
}, null, 8, ml)
|
|
1625
|
+
], 8, vl)) : T("", !0),
|
|
1624
1626
|
M(ge, {
|
|
1625
1627
|
disabled: t.disabled,
|
|
1626
|
-
onClick: f[3] || (f[3] = ($) =>
|
|
1628
|
+
onClick: f[3] || (f[3] = ($) => o.value?.click())
|
|
1627
1629
|
}, {
|
|
1628
|
-
default:
|
|
1630
|
+
default: v(() => [
|
|
1629
1631
|
Y(_(s(a)("core.form.file.choose")), 1)
|
|
1630
1632
|
]),
|
|
1631
1633
|
_: 1
|
|
1632
1634
|
}, 8, ["disabled"]),
|
|
1633
|
-
|
|
1635
|
+
m.value ? (u(), O(ge, {
|
|
1634
1636
|
key: 1,
|
|
1635
1637
|
prominence: "plain",
|
|
1636
1638
|
tone: "critical",
|
|
1637
1639
|
disabled: t.disabled,
|
|
1638
1640
|
onClick: f[4] || (f[4] = ($) => {
|
|
1639
|
-
e.value = null,
|
|
1641
|
+
e.value = null, n.value = null;
|
|
1640
1642
|
})
|
|
1641
1643
|
}, {
|
|
1642
|
-
default:
|
|
1644
|
+
default: v(() => [
|
|
1643
1645
|
Y(_(s(a)("core.form.file.remove")), 1)
|
|
1644
1646
|
]),
|
|
1645
1647
|
_: 1
|
|
1646
1648
|
}, 8, ["disabled"])) : T("", !0)
|
|
1647
1649
|
]),
|
|
1648
|
-
|
|
1650
|
+
m.value ? (u(), O(Je, {
|
|
1649
1651
|
key: 0,
|
|
1650
1652
|
ref_key: "viewer",
|
|
1651
1653
|
ref: h,
|
|
1652
|
-
items:
|
|
1654
|
+
items: x.value
|
|
1653
1655
|
}, null, 8, ["items"])) : T("", !0)
|
|
1654
1656
|
]),
|
|
1655
1657
|
_: 2
|
|
1656
1658
|
}, [
|
|
1657
1659
|
r.$slots.trailing ? {
|
|
1658
1660
|
name: "trailing",
|
|
1659
|
-
fn:
|
|
1661
|
+
fn: v(() => [
|
|
1660
1662
|
C(r.$slots, "trailing")
|
|
1661
1663
|
]),
|
|
1662
1664
|
key: "0"
|
|
1663
1665
|
} : void 0,
|
|
1664
1666
|
r.$slots.labelTrailing ? {
|
|
1665
1667
|
name: "labelTrailing",
|
|
1666
|
-
fn:
|
|
1668
|
+
fn: v(() => [
|
|
1667
1669
|
C(r.$slots, "labelTrailing")
|
|
1668
1670
|
]),
|
|
1669
1671
|
key: "1"
|
|
@@ -1682,67 +1684,67 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1682
1684
|
fieldLabel: { type: Function, default: void 0 }
|
|
1683
1685
|
},
|
|
1684
1686
|
emits: ["saved"],
|
|
1685
|
-
setup(
|
|
1686
|
-
const e =
|
|
1687
|
-
let
|
|
1688
|
-
de(() => e.sheet.open.value, (
|
|
1689
|
-
|
|
1687
|
+
setup(l, { emit: t }) {
|
|
1688
|
+
const e = l, a = t, { t: o } = oe(), n = H("modal"), d = H("body"), i = N(!1);
|
|
1689
|
+
let m = null;
|
|
1690
|
+
de(() => e.sheet.open.value, (w) => {
|
|
1691
|
+
w ? (i.value = !1, n.value?.present()) : n.value?.dismiss();
|
|
1690
1692
|
}), rt(() => {
|
|
1691
|
-
e.sheet.open.value &&
|
|
1693
|
+
e.sheet.open.value && n.value?.present();
|
|
1692
1694
|
}), Ee(() => {
|
|
1693
|
-
|
|
1695
|
+
m && clearTimeout(m);
|
|
1694
1696
|
});
|
|
1695
1697
|
async function h() {
|
|
1696
|
-
await e.sheet.save() && (
|
|
1698
|
+
await e.sheet.save() && (i.value = !0, a("saved"), m = setTimeout(() => e.sheet.dismiss(), Nt));
|
|
1697
1699
|
}
|
|
1698
|
-
const
|
|
1699
|
-
return (
|
|
1700
|
+
const x = k(() => e.sheet.saving.value ? "processing" : i.value ? "done" : "idle");
|
|
1701
|
+
return (w, r) => (u(), O(Gt, {
|
|
1700
1702
|
ref_key: "modal",
|
|
1701
|
-
ref:
|
|
1703
|
+
ref: n,
|
|
1702
1704
|
size: e.size,
|
|
1703
1705
|
grouped: "",
|
|
1704
1706
|
title: e.title,
|
|
1705
1707
|
subtitle: e.subtitle,
|
|
1706
1708
|
"before-dismiss": e.sheet.beforeDismiss,
|
|
1707
|
-
"primary-label": e.editable ? s(
|
|
1708
|
-
status:
|
|
1709
|
-
"processing-label": s(
|
|
1710
|
-
"done-label": s(
|
|
1709
|
+
"primary-label": e.editable ? s(o)("core.actions.save") : void 0,
|
|
1710
|
+
status: x.value,
|
|
1711
|
+
"processing-label": s(o)("core.actions.saving"),
|
|
1712
|
+
"done-label": s(o)("core.actions.saved"),
|
|
1711
1713
|
onPrimary: h,
|
|
1712
1714
|
onDismissed: r[0] || (r[0] = (f) => e.sheet.closed())
|
|
1713
1715
|
}, {
|
|
1714
|
-
default:
|
|
1715
|
-
|
|
1716
|
+
default: v(() => [
|
|
1717
|
+
b("div", {
|
|
1716
1718
|
ref_key: "body",
|
|
1717
|
-
ref:
|
|
1719
|
+
ref: d,
|
|
1718
1720
|
class: "flex min-w-0 flex-col gap-group-gap"
|
|
1719
1721
|
}, [
|
|
1720
|
-
e.sheet.notice.value ? (
|
|
1722
|
+
e.sheet.notice.value ? (u(), O(Ze, {
|
|
1721
1723
|
key: 0,
|
|
1722
1724
|
tone: "warning",
|
|
1723
1725
|
"data-test": "group-sheet-notice"
|
|
1724
1726
|
}, {
|
|
1725
|
-
default:
|
|
1726
|
-
|
|
1727
|
+
default: v(() => [
|
|
1728
|
+
b("p", pl, _(e.sheet.notice.value), 1)
|
|
1727
1729
|
]),
|
|
1728
1730
|
_: 1
|
|
1729
1731
|
})) : T("", !0),
|
|
1730
|
-
e.sheet.foreignGroups.value.length ? (
|
|
1732
|
+
e.sheet.foreignGroups.value.length ? (u(), O(Ze, {
|
|
1731
1733
|
key: 1,
|
|
1732
1734
|
tone: "warning",
|
|
1733
1735
|
"data-test": "group-sheet-foreign"
|
|
1734
1736
|
}, {
|
|
1735
|
-
default:
|
|
1736
|
-
|
|
1737
|
+
default: v(() => [
|
|
1738
|
+
b("p", bl, _(s(o)("core.form.group.foreign", { groups: e.sheet.foreignGroups.value.map(e.groupLabel).join(", ") })), 1)
|
|
1737
1739
|
]),
|
|
1738
1740
|
_: 1
|
|
1739
1741
|
})) : T("", !0),
|
|
1740
1742
|
M(Me, {
|
|
1741
1743
|
form: e.sheet.form,
|
|
1742
1744
|
label: e.fieldLabel,
|
|
1743
|
-
scope:
|
|
1745
|
+
scope: d.value
|
|
1744
1746
|
}, null, 8, ["form", "label", "scope"]),
|
|
1745
|
-
C(
|
|
1747
|
+
C(w.$slots, "default")
|
|
1746
1748
|
], 512)
|
|
1747
1749
|
]),
|
|
1748
1750
|
_: 3
|
|
@@ -1754,9 +1756,9 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1754
1756
|
only: {},
|
|
1755
1757
|
editable: { type: Boolean }
|
|
1756
1758
|
},
|
|
1757
|
-
setup(
|
|
1758
|
-
const t =
|
|
1759
|
-
return Re(Rt, { only: it(t, "only") }), Re(bt, k(() => t.editable)), (e, a) => (
|
|
1759
|
+
setup(l) {
|
|
1760
|
+
const t = l;
|
|
1761
|
+
return Re(Rt, { only: it(t, "only") }), Re(bt, k(() => t.editable)), (e, a) => (u(), y("div", {
|
|
1760
1762
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
1761
1763
|
"data-test": "record-group-scope",
|
|
1762
1764
|
"data-group": t.only
|
|
@@ -1765,51 +1767,51 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
|
|
|
1765
1767
|
], 8, gl));
|
|
1766
1768
|
}
|
|
1767
1769
|
});
|
|
1768
|
-
function Oo(
|
|
1769
|
-
const { form: t } =
|
|
1770
|
-
if (
|
|
1771
|
-
const e = () => typeof
|
|
1770
|
+
function Oo(l) {
|
|
1771
|
+
const { form: t } = l;
|
|
1772
|
+
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.");
|
|
1773
|
+
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
1774
|
let h = {};
|
|
1773
|
-
const
|
|
1775
|
+
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);
|
|
1774
1776
|
function f() {
|
|
1775
|
-
h =
|
|
1777
|
+
h = x(a()), m.value = Se(h);
|
|
1776
1778
|
}
|
|
1777
1779
|
function g() {
|
|
1778
|
-
f(),
|
|
1780
|
+
f(), d.value = [], i.value = null, t.dismissFailure(), o.value = !0;
|
|
1779
1781
|
}
|
|
1780
1782
|
function S() {
|
|
1781
|
-
if (
|
|
1782
|
-
|
|
1783
|
+
if (o.value) {
|
|
1784
|
+
w.value && Object.assign(t.values, Se(h));
|
|
1783
1785
|
for (const F of e()) t.errors.clear(F);
|
|
1784
|
-
t.dismissFailure(),
|
|
1786
|
+
t.dismissFailure(), o.value = !1;
|
|
1785
1787
|
}
|
|
1786
1788
|
}
|
|
1787
1789
|
function z(F) {
|
|
1788
|
-
const E = new Set(e()), R = Oe(
|
|
1790
|
+
const E = new Set(e()), R = Oe(l.group), Z = /* @__PURE__ */ new Set();
|
|
1789
1791
|
for (const W of Object.keys(F.all())) {
|
|
1790
1792
|
const J = et(W);
|
|
1791
1793
|
if (E.has(J)) continue;
|
|
1792
|
-
const ae =
|
|
1794
|
+
const ae = l.groupOf?.(J) ?? l.fallbackGroup;
|
|
1793
1795
|
ae && ae !== R && Z.add(ae);
|
|
1794
1796
|
}
|
|
1795
|
-
|
|
1797
|
+
d.value = [...Z];
|
|
1796
1798
|
}
|
|
1797
1799
|
async function $(F) {
|
|
1798
|
-
const E = Se(
|
|
1800
|
+
const E = Se(x(e().filter((R) => !He(t.values[R], m.value[R]))));
|
|
1799
1801
|
try {
|
|
1800
1802
|
await F.reload();
|
|
1801
1803
|
} catch {
|
|
1802
1804
|
return;
|
|
1803
1805
|
}
|
|
1804
|
-
t.rebase?.() && (f(), Object.assign(t.values, E),
|
|
1806
|
+
t.rebase?.() && (f(), Object.assign(t.values, E), i.value = F.message());
|
|
1805
1807
|
}
|
|
1806
1808
|
async function I() {
|
|
1807
|
-
if (
|
|
1808
|
-
|
|
1809
|
+
if (n.value) return !1;
|
|
1810
|
+
n.value = !0, d.value = [], i.value = null;
|
|
1809
1811
|
try {
|
|
1810
|
-
const F =
|
|
1812
|
+
const F = l.onSaved ? () => l.onSaved?.() : void 0;
|
|
1811
1813
|
let E;
|
|
1812
|
-
if (
|
|
1814
|
+
if (l.save) E = await t.submitFields(e(), l.save, { refresh: F });
|
|
1813
1815
|
else if (t.save) E = await t.save({ refresh: F });
|
|
1814
1816
|
else throw new Error("useGroupSheet: the form has no full-record save(), so give the sheet its own `save` for a dedicated endpoint.");
|
|
1815
1817
|
switch (E.status) {
|
|
@@ -1820,23 +1822,23 @@ function Oo(o) {
|
|
|
1820
1822
|
case "aborted":
|
|
1821
1823
|
return !1;
|
|
1822
1824
|
case "failed":
|
|
1823
|
-
return E.failure.kind === "conflict" &&
|
|
1825
|
+
return E.failure.kind === "conflict" && l.rebase ? await $(l.rebase) : z(t.errors), !1;
|
|
1824
1826
|
}
|
|
1825
1827
|
} finally {
|
|
1826
|
-
|
|
1828
|
+
n.value = !1;
|
|
1827
1829
|
}
|
|
1828
1830
|
}
|
|
1829
1831
|
return {
|
|
1830
|
-
open:
|
|
1831
|
-
saving:
|
|
1832
|
-
dirty:
|
|
1833
|
-
foreignGroups:
|
|
1834
|
-
notice:
|
|
1832
|
+
open: o,
|
|
1833
|
+
saving: n,
|
|
1834
|
+
dirty: w,
|
|
1835
|
+
foreignGroups: d,
|
|
1836
|
+
notice: i,
|
|
1835
1837
|
failure: t.failure,
|
|
1836
1838
|
form: t,
|
|
1837
1839
|
present: g,
|
|
1838
1840
|
dismiss: () => {
|
|
1839
|
-
|
|
1841
|
+
o.value = !1;
|
|
1840
1842
|
},
|
|
1841
1843
|
save: I,
|
|
1842
1844
|
beforeDismiss: r,
|
|
@@ -1848,45 +1850,45 @@ const yl = { hidden: "" }, hl = /* @__PURE__ */ P({
|
|
|
1848
1850
|
props: {
|
|
1849
1851
|
options: {}
|
|
1850
1852
|
},
|
|
1851
|
-
setup(
|
|
1852
|
-
return Yt(
|
|
1853
|
+
setup(l) {
|
|
1854
|
+
return Yt(l.options), (e, a) => (u(), y("span", yl));
|
|
1853
1855
|
}
|
|
1854
1856
|
});
|
|
1855
|
-
function kl(
|
|
1857
|
+
function kl(l) {
|
|
1856
1858
|
const t = N(0);
|
|
1857
1859
|
let e = 0;
|
|
1858
1860
|
const a = () => {
|
|
1859
1861
|
e || (e = requestAnimationFrame(() => {
|
|
1860
1862
|
e = 0, t.value++;
|
|
1861
1863
|
}));
|
|
1862
|
-
},
|
|
1864
|
+
}, o = typeof MutationObserver > "u" ? null : new MutationObserver(a);
|
|
1863
1865
|
de(
|
|
1864
|
-
() =>
|
|
1865
|
-
(
|
|
1866
|
-
|
|
1867
|
-
for (const
|
|
1868
|
-
|
|
1866
|
+
() => l.sections.value,
|
|
1867
|
+
(i) => {
|
|
1868
|
+
o?.disconnect();
|
|
1869
|
+
for (const m of i)
|
|
1870
|
+
o?.observe(m.element, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["data-field-error", "data-field-required", "data-field-filled"] });
|
|
1869
1871
|
a();
|
|
1870
1872
|
},
|
|
1871
1873
|
{ immediate: !0 }
|
|
1872
1874
|
), ut() && dt(() => {
|
|
1873
|
-
|
|
1875
|
+
o?.disconnect(), e && cancelAnimationFrame(e);
|
|
1874
1876
|
});
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1877
|
-
|
|
1877
|
+
const n = k(() => (t.value, Object.fromEntries(
|
|
1878
|
+
l.sections.value.map((i) => [
|
|
1879
|
+
i.id,
|
|
1878
1880
|
{
|
|
1879
|
-
errors:
|
|
1880
|
-
required: { total:
|
|
1881
|
+
errors: i.element.querySelectorAll("[data-field-error]").length,
|
|
1882
|
+
required: { total: i.element.querySelectorAll("[data-field-required]").length, filled: i.element.querySelectorAll("[data-field-required][data-field-filled]").length }
|
|
1881
1883
|
}
|
|
1882
1884
|
])
|
|
1883
|
-
))),
|
|
1884
|
-
return { states:
|
|
1885
|
+
))), 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 }));
|
|
1886
|
+
return { states: n, totals: d };
|
|
1885
1887
|
}
|
|
1886
|
-
const
|
|
1888
|
+
const wl = {
|
|
1887
1889
|
class: "grid min-w-0 grid-cols-1 items-start gap-8 lg:grid-cols-[12.5rem_minmax(0,1fr)]",
|
|
1888
1890
|
"data-test": "editor-page"
|
|
1889
|
-
},
|
|
1891
|
+
}, xl = {
|
|
1890
1892
|
key: 0,
|
|
1891
1893
|
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"
|
|
1892
1894
|
}, Mo = /* @__PURE__ */ P({
|
|
@@ -1900,11 +1902,11 @@ const xl = {
|
|
|
1900
1902
|
fieldLabel: { type: Function, default: void 0 }
|
|
1901
1903
|
},
|
|
1902
1904
|
emits: ["save", "cancel"],
|
|
1903
|
-
setup(
|
|
1904
|
-
const e =
|
|
1905
|
+
setup(l, { emit: t }) {
|
|
1906
|
+
const e = l, a = t, { t: o } = oe(), n = Ne(), d = Ut(), { states: i, totals: m } = kl(d), h = H("content"), x = k(
|
|
1905
1907
|
() => e.form ? {
|
|
1906
1908
|
form: e.form,
|
|
1907
|
-
label: () => e.saveLabel ??
|
|
1909
|
+
label: () => e.saveLabel ?? o("core.actions.save"),
|
|
1908
1910
|
allowed: () => e.canSave,
|
|
1909
1911
|
disabledWhileClean: !1,
|
|
1910
1912
|
// a create page: an untouched form is submitted to learn what is missing
|
|
@@ -1919,39 +1921,39 @@ const xl = {
|
|
|
1919
1921
|
de(
|
|
1920
1922
|
() => e.form?.failure.value,
|
|
1921
1923
|
async (r) => {
|
|
1922
|
-
r?.kind === "invalid" && (await he(), await De(h.value ?? document,
|
|
1924
|
+
r?.kind === "invalid" && (await he(), await De(h.value ?? document, d));
|
|
1923
1925
|
}
|
|
1924
1926
|
);
|
|
1925
|
-
function
|
|
1926
|
-
const f =
|
|
1927
|
+
function w(r) {
|
|
1928
|
+
const f = d.sections.value.find((g) => g.id === r)?.element;
|
|
1927
1929
|
f && he(() => De(f));
|
|
1928
1930
|
}
|
|
1929
|
-
return (r, f) => (
|
|
1931
|
+
return (r, f) => (u(), O(Kt, {
|
|
1930
1932
|
title: e.title,
|
|
1931
1933
|
back: e.back,
|
|
1932
1934
|
width: "content"
|
|
1933
1935
|
}, ee({
|
|
1934
|
-
default:
|
|
1935
|
-
|
|
1936
|
+
default: v(() => [
|
|
1937
|
+
x.value ? (u(), O(hl, {
|
|
1936
1938
|
key: 0,
|
|
1937
|
-
options:
|
|
1939
|
+
options: x.value
|
|
1938
1940
|
}, null, 8, ["options"])) : T("", !0),
|
|
1939
|
-
|
|
1940
|
-
s(
|
|
1941
|
+
b("div", wl, [
|
|
1942
|
+
s(n) ? T("", !0) : (u(), y("aside", xl, [
|
|
1941
1943
|
M(At, {
|
|
1942
1944
|
standalone: "",
|
|
1943
|
-
states: s(
|
|
1944
|
-
progress: s(
|
|
1945
|
-
onSelect:
|
|
1945
|
+
states: s(i),
|
|
1946
|
+
progress: s(m),
|
|
1947
|
+
onSelect: w
|
|
1946
1948
|
}, null, 8, ["states", "progress"]),
|
|
1947
1949
|
C(r.$slots, "aside")
|
|
1948
1950
|
])),
|
|
1949
|
-
|
|
1951
|
+
b("div", {
|
|
1950
1952
|
ref_key: "content",
|
|
1951
1953
|
ref: h,
|
|
1952
1954
|
class: "flex min-w-0 flex-col gap-section-gap"
|
|
1953
1955
|
}, [
|
|
1954
|
-
e.form ? (
|
|
1956
|
+
e.form ? (u(), O(Me, {
|
|
1955
1957
|
key: 0,
|
|
1956
1958
|
form: e.form,
|
|
1957
1959
|
label: e.fieldLabel,
|
|
@@ -1960,37 +1962,37 @@ const xl = {
|
|
|
1960
1962
|
C(r.$slots, "default")
|
|
1961
1963
|
], 512)
|
|
1962
1964
|
]),
|
|
1963
|
-
s(
|
|
1965
|
+
s(n) ? (u(), O(Ht, {
|
|
1964
1966
|
key: 1,
|
|
1965
|
-
states: s(
|
|
1967
|
+
states: s(i)
|
|
1966
1968
|
}, null, 8, ["states"])) : T("", !0)
|
|
1967
1969
|
]),
|
|
1968
1970
|
_: 2
|
|
1969
1971
|
}, [
|
|
1970
1972
|
r.$slots.header ? {
|
|
1971
1973
|
name: "header",
|
|
1972
|
-
fn:
|
|
1974
|
+
fn: v(() => [
|
|
1973
1975
|
C(r.$slots, "header")
|
|
1974
1976
|
]),
|
|
1975
1977
|
key: "0"
|
|
1976
1978
|
} : void 0,
|
|
1977
1979
|
r.$slots.pager ? {
|
|
1978
1980
|
name: "pager",
|
|
1979
|
-
fn:
|
|
1981
|
+
fn: v(() => [
|
|
1980
1982
|
C(r.$slots, "pager")
|
|
1981
1983
|
]),
|
|
1982
1984
|
key: "1"
|
|
1983
1985
|
} : void 0,
|
|
1984
1986
|
r.$slots.notices ? {
|
|
1985
1987
|
name: "notices",
|
|
1986
|
-
fn:
|
|
1988
|
+
fn: v(() => [
|
|
1987
1989
|
C(r.$slots, "notices")
|
|
1988
1990
|
]),
|
|
1989
1991
|
key: "2"
|
|
1990
1992
|
} : void 0,
|
|
1991
1993
|
r.$slots.bottom ? {
|
|
1992
1994
|
name: "bottom",
|
|
1993
|
-
fn:
|
|
1995
|
+
fn: v(() => [
|
|
1994
1996
|
C(r.$slots, "bottom")
|
|
1995
1997
|
]),
|
|
1996
1998
|
key: "3"
|
|
@@ -1998,17 +2000,17 @@ const xl = {
|
|
|
1998
2000
|
]), 1032, ["title", "back"]));
|
|
1999
2001
|
}
|
|
2000
2002
|
});
|
|
2001
|
-
function jo(
|
|
2003
|
+
function jo(l) {
|
|
2002
2004
|
const t = Le(null);
|
|
2003
2005
|
let e = null;
|
|
2004
2006
|
const a = st({
|
|
2005
|
-
...
|
|
2006
|
-
done:
|
|
2007
|
-
run(
|
|
2008
|
-
const
|
|
2009
|
-
if (
|
|
2010
|
-
if (!
|
|
2011
|
-
return
|
|
2007
|
+
...l,
|
|
2008
|
+
done: l.done ? (o) => l.done?.(o, { editing: e }) : void 0,
|
|
2009
|
+
run(o, n) {
|
|
2010
|
+
const d = e = t.value;
|
|
2011
|
+
if (d === null) return l.create(o, n);
|
|
2012
|
+
if (!l.update) throw new Error("useRecordDialog: edit() needs an `update`.");
|
|
2013
|
+
return l.update(d, o, n);
|
|
2012
2014
|
}
|
|
2013
2015
|
});
|
|
2014
2016
|
return {
|
|
@@ -2018,8 +2020,8 @@ function jo(o) {
|
|
|
2018
2020
|
create() {
|
|
2019
2021
|
t.value = null, a.present();
|
|
2020
2022
|
},
|
|
2021
|
-
edit(
|
|
2022
|
-
t.value =
|
|
2023
|
+
edit(o) {
|
|
2024
|
+
t.value = o, a.present(l.toValues?.(o));
|
|
2023
2025
|
}
|
|
2024
2026
|
};
|
|
2025
2027
|
}
|
|
@@ -2038,14 +2040,14 @@ const $l = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], E
|
|
|
2038
2040
|
modelModifiers: {}
|
|
2039
2041
|
}),
|
|
2040
2042
|
emits: ["update:modelValue"],
|
|
2041
|
-
setup(
|
|
2042
|
-
const t =
|
|
2043
|
-
function a(
|
|
2044
|
-
const
|
|
2045
|
-
e.value =
|
|
2043
|
+
setup(l) {
|
|
2044
|
+
const t = l, e = ie(l, "modelValue");
|
|
2045
|
+
function a(n) {
|
|
2046
|
+
const d = n.target.value.replace(/\D/g, "");
|
|
2047
|
+
e.value = d === "" ? null : Math.min(t.max, Math.max(t.min, Number(d)));
|
|
2046
2048
|
}
|
|
2047
|
-
const
|
|
2048
|
-
return (
|
|
2049
|
+
const o = (n) => n.target.value = e.value === null ? "" : String(e.value);
|
|
2050
|
+
return (n, d) => (u(), y("input", {
|
|
2049
2051
|
value: e.value ?? "",
|
|
2050
2052
|
type: "text",
|
|
2051
2053
|
inputmode: "numeric",
|
|
@@ -2056,151 +2058,151 @@ const $l = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], E
|
|
|
2056
2058
|
placeholder: t.placeholder,
|
|
2057
2059
|
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" : ""]]),
|
|
2058
2060
|
onInput: a,
|
|
2059
|
-
onBlur:
|
|
2061
|
+
onBlur: o
|
|
2060
2062
|
}, null, 42, $l));
|
|
2061
2063
|
}
|
|
2062
2064
|
}), Ke = "vue-core:step-draft:";
|
|
2063
|
-
function Ae(
|
|
2065
|
+
function Ae(l) {
|
|
2064
2066
|
try {
|
|
2065
|
-
return (
|
|
2067
|
+
return (l.storage === "local" ? window.localStorage : window.sessionStorage) ?? null;
|
|
2066
2068
|
} catch {
|
|
2067
2069
|
return null;
|
|
2068
2070
|
}
|
|
2069
2071
|
}
|
|
2070
|
-
function _l(
|
|
2072
|
+
function _l(l) {
|
|
2071
2073
|
try {
|
|
2072
|
-
const t = Ae(
|
|
2074
|
+
const t = Ae(l)?.getItem(Ke + l.key);
|
|
2073
2075
|
if (!t) return null;
|
|
2074
2076
|
const e = JSON.parse(t);
|
|
2075
|
-
return !e || e.version !== (
|
|
2077
|
+
return !e || e.version !== (l.version ?? 1) || typeof e.values != "object" || e.values === null || typeof e.step != "string" || !Array.isArray(e.passed) ? null : e;
|
|
2076
2078
|
} catch {
|
|
2077
2079
|
return null;
|
|
2078
2080
|
}
|
|
2079
2081
|
}
|
|
2080
|
-
function Sl(
|
|
2082
|
+
function Sl(l, t) {
|
|
2081
2083
|
try {
|
|
2082
|
-
const e = Ae(
|
|
2084
|
+
const e = Ae(l);
|
|
2083
2085
|
if (!e) return !1;
|
|
2084
|
-
const a = (
|
|
2085
|
-
return e.setItem(Ke +
|
|
2086
|
+
const a = (o, n) => typeof Blob < "u" && n instanceof Blob ? null : n;
|
|
2087
|
+
return e.setItem(Ke + l.key, JSON.stringify({ version: l.version ?? 1, ...t }, a)), !0;
|
|
2086
2088
|
} catch {
|
|
2087
2089
|
return !1;
|
|
2088
2090
|
}
|
|
2089
2091
|
}
|
|
2090
|
-
function Qe(
|
|
2092
|
+
function Qe(l) {
|
|
2091
2093
|
try {
|
|
2092
|
-
Ae(
|
|
2094
|
+
Ae(l)?.removeItem(Ke + l.key);
|
|
2093
2095
|
} catch {
|
|
2094
2096
|
}
|
|
2095
2097
|
}
|
|
2096
|
-
function Cl(
|
|
2097
|
-
for (const [e, a] of Object.entries(
|
|
2098
|
+
function Cl(l, t) {
|
|
2099
|
+
for (const [e, a] of Object.entries(l)) {
|
|
2098
2100
|
if (!(e in t)) continue;
|
|
2099
|
-
const
|
|
2100
|
-
(
|
|
2101
|
+
const o = t[e];
|
|
2102
|
+
(o === null || a === null || a === void 0 || typeof o == typeof a && Array.isArray(o) === Array.isArray(a)) && (l[e] = o);
|
|
2101
2103
|
}
|
|
2102
2104
|
}
|
|
2103
|
-
function Io(
|
|
2105
|
+
function Io(l, t) {
|
|
2104
2106
|
const { t: e } = oe(), a = k(() => Oe(t.steps));
|
|
2105
2107
|
if (a.value.length === 0) throw new Error("useStepForm: a flow needs at least one step.");
|
|
2106
|
-
const
|
|
2108
|
+
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);
|
|
2107
2109
|
let r = !1, f = 0;
|
|
2108
|
-
const g = k(() => Math.max(0, a.value.findIndex((
|
|
2109
|
-
() => a.value.map((
|
|
2110
|
-
const
|
|
2110
|
+
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(
|
|
2111
|
+
() => a.value.map((c, V) => {
|
|
2112
|
+
const p = S(c), q = V === g.value;
|
|
2111
2113
|
return {
|
|
2112
|
-
name:
|
|
2113
|
-
label:
|
|
2114
|
+
name: c.name,
|
|
2115
|
+
label: c.label,
|
|
2114
2116
|
position: V + 1,
|
|
2115
|
-
state: q ? "current" :
|
|
2116
|
-
errors:
|
|
2117
|
-
reachable: !q && (
|
|
2117
|
+
state: q ? "current" : n.has(c.name) && p === 0 ? "done" : "todo",
|
|
2118
|
+
errors: p,
|
|
2119
|
+
reachable: !q && (d.has(c.name) || V < g.value)
|
|
2118
2120
|
};
|
|
2119
2121
|
})
|
|
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(() =>
|
|
2121
|
-
function Z(
|
|
2122
|
-
const V = a.value[
|
|
2123
|
-
V && (
|
|
2122
|
+
), $ = 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);
|
|
2123
|
+
function Z(c) {
|
|
2124
|
+
const V = a.value[c];
|
|
2125
|
+
V && (i.value = c > g.value ? "forward" : "back", o.value = V.name, d.add(V.name), f = c, x.value = !1);
|
|
2124
2126
|
}
|
|
2125
2127
|
de(
|
|
2126
|
-
() => a.value.map((
|
|
2128
|
+
() => a.value.map((c) => c.name).join("\0"),
|
|
2127
2129
|
() => {
|
|
2128
|
-
const
|
|
2129
|
-
|
|
2130
|
-
B >
|
|
2131
|
-
}),
|
|
2132
|
-
for (const q of [
|
|
2130
|
+
const c = a.value, V = c.findIndex((q) => q.name === o.value), p = V === -1 ? Math.min(f, c.length - 1) : V;
|
|
2131
|
+
o.value = c[p].name, f = p, c.forEach((q, B) => {
|
|
2132
|
+
B > p && (n.delete(q.name), d.delete(q.name));
|
|
2133
|
+
}), d.add(o.value);
|
|
2134
|
+
for (const q of [n, d]) for (const B of [...q]) c.some((K) => K.name === B) || q.delete(B);
|
|
2133
2135
|
}
|
|
2134
2136
|
);
|
|
2135
|
-
function W(
|
|
2136
|
-
const V =
|
|
2137
|
+
function W(c) {
|
|
2138
|
+
const V = c.fields;
|
|
2137
2139
|
if (!V?.length) return !0;
|
|
2138
|
-
const
|
|
2139
|
-
return
|
|
2140
|
+
const p = Object.entries(l.errors.all()).filter(([B]) => !V.includes(et(B))), q = l.check(c.fields);
|
|
2141
|
+
return p.length > 0 && l.errors.set({ ...Object.fromEntries(p), ...l.errors.all() }), q;
|
|
2140
2142
|
}
|
|
2141
|
-
async function J(
|
|
2142
|
-
if (!W(
|
|
2143
|
+
async function J(c) {
|
|
2144
|
+
if (!W(c))
|
|
2143
2145
|
return h.value++, !1;
|
|
2144
|
-
if (!
|
|
2145
|
-
|
|
2146
|
+
if (!c.beforeNext) return !0;
|
|
2147
|
+
m.value = !0;
|
|
2146
2148
|
try {
|
|
2147
|
-
if (await
|
|
2149
|
+
if (await c.beforeNext()) return !0;
|
|
2148
2150
|
} finally {
|
|
2149
|
-
|
|
2151
|
+
m.value = !1;
|
|
2150
2152
|
}
|
|
2151
2153
|
return h.value++, !1;
|
|
2152
2154
|
}
|
|
2153
2155
|
async function ae() {
|
|
2154
|
-
const
|
|
2155
|
-
if (
|
|
2156
|
-
return r = !0, re(), t.onSaved?.(
|
|
2157
|
-
if (
|
|
2158
|
-
const V = z.value.findIndex((
|
|
2156
|
+
const c = await l.submit(t.submit, t.submitOptions);
|
|
2157
|
+
if (c.status === "saved" || c.status === "saved-refresh-failed")
|
|
2158
|
+
return r = !0, re(), t.onSaved?.(c.value), !0;
|
|
2159
|
+
if (c.status === "failed" && (h.value++, $.value.errors === 0)) {
|
|
2160
|
+
const V = z.value.findIndex((p) => p.errors > 0);
|
|
2159
2161
|
V !== -1 && Z(V);
|
|
2160
2162
|
}
|
|
2161
2163
|
return !1;
|
|
2162
2164
|
}
|
|
2163
|
-
async function
|
|
2165
|
+
async function me() {
|
|
2164
2166
|
if (R.value) return !1;
|
|
2165
|
-
const
|
|
2166
|
-
return await J(
|
|
2167
|
+
const c = a.value[g.value];
|
|
2168
|
+
return await J(c) ? (n.add(c.name), g.value < I.value - 1 ? (Z(g.value + 1), !0) : ae()) : !1;
|
|
2167
2169
|
}
|
|
2168
|
-
async function D(
|
|
2170
|
+
async function D(c) {
|
|
2169
2171
|
if (R.value) return !1;
|
|
2170
|
-
const V = a.value.findIndex((
|
|
2172
|
+
const V = a.value.findIndex((p) => p.name === c);
|
|
2171
2173
|
if (V === -1) return !1;
|
|
2172
2174
|
if (V <= g.value)
|
|
2173
2175
|
return V < g.value && Z(V), !0;
|
|
2174
|
-
if (!
|
|
2175
|
-
for (; g.value < V; ) if (!await
|
|
2176
|
+
if (!d.has(c)) return !1;
|
|
2177
|
+
for (; g.value < V; ) if (!await me()) return !1;
|
|
2176
2178
|
return g.value === V;
|
|
2177
2179
|
}
|
|
2178
2180
|
const A = t.draft;
|
|
2179
2181
|
let G;
|
|
2180
2182
|
function ne() {
|
|
2181
2183
|
if (G = void 0, !(!A || r)) {
|
|
2182
|
-
if (!
|
|
2183
|
-
Qe(A),
|
|
2184
|
+
if (!l.dirty.value) {
|
|
2185
|
+
Qe(A), w.value = !1;
|
|
2184
2186
|
return;
|
|
2185
2187
|
}
|
|
2186
|
-
|
|
2188
|
+
w.value = Sl(A, { values: Se(l.values), step: o.value, passed: [...n] });
|
|
2187
2189
|
}
|
|
2188
2190
|
}
|
|
2189
2191
|
function re() {
|
|
2190
|
-
r = !0, clearTimeout(G), G = void 0,
|
|
2192
|
+
r = !0, clearTimeout(G), G = void 0, w.value = !1, A && Qe(A);
|
|
2191
2193
|
}
|
|
2192
2194
|
if (A) {
|
|
2193
|
-
const
|
|
2194
|
-
if (
|
|
2195
|
-
Cl(
|
|
2196
|
-
const V = a.value.map((
|
|
2197
|
-
V.includes(
|
|
2198
|
-
for (const
|
|
2199
|
-
for (const
|
|
2200
|
-
f = g.value,
|
|
2195
|
+
const c = _l(A);
|
|
2196
|
+
if (c) {
|
|
2197
|
+
Cl(l.values, c.values);
|
|
2198
|
+
const V = a.value.map((p) => p.name);
|
|
2199
|
+
V.includes(c.step) && (o.value = c.step);
|
|
2200
|
+
for (const p of c.passed) V.includes(p) && n.add(p);
|
|
2201
|
+
for (const p of [...n, o.value]) d.add(p);
|
|
2202
|
+
f = g.value, x.value = l.dirty.value, w.value = x.value;
|
|
2201
2203
|
}
|
|
2202
2204
|
de(
|
|
2203
|
-
[() =>
|
|
2205
|
+
[() => l.values, o, () => [...n].join("\0")],
|
|
2204
2206
|
() => {
|
|
2205
2207
|
r || (clearTimeout(G), G = setTimeout(ne, 400));
|
|
2206
2208
|
},
|
|
@@ -2209,21 +2211,21 @@ function Io(o, t) {
|
|
|
2209
2211
|
G !== void 0 && (clearTimeout(G), ne());
|
|
2210
2212
|
});
|
|
2211
2213
|
}
|
|
2212
|
-
const { confirmDiscard: le } = Ie(() => !r &&
|
|
2214
|
+
const { confirmDiscard: le } = Ie(() => !r && l.dirty.value);
|
|
2213
2215
|
tt(Wt, null) && Jt(() => (r || re(), !0));
|
|
2214
2216
|
async function ke() {
|
|
2215
|
-
const
|
|
2216
|
-
return
|
|
2217
|
+
const c = await le();
|
|
2218
|
+
return c && re(), c;
|
|
2217
2219
|
}
|
|
2218
|
-
function
|
|
2219
|
-
|
|
2220
|
+
function xe() {
|
|
2221
|
+
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;
|
|
2220
2222
|
}
|
|
2221
2223
|
const X = k(() => {
|
|
2222
|
-
const
|
|
2223
|
-
return
|
|
2224
|
+
const c = [e("core.steps.position", { current: g.value + 1, total: I.value }), $.value.label];
|
|
2225
|
+
return w.value && c.push(e("core.steps.draft_saved")), c.join(" · ");
|
|
2224
2226
|
}), pe = k(() => {
|
|
2225
|
-
const
|
|
2226
|
-
return
|
|
2227
|
+
const c = a.value[g.value];
|
|
2228
|
+
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
2229
|
}), L = k(() => F.value ? null : a.value[g.value - 1].label);
|
|
2228
2230
|
return {
|
|
2229
2231
|
steps: z,
|
|
@@ -2233,18 +2235,18 @@ function Io(o, t) {
|
|
|
2233
2235
|
isFirst: F,
|
|
2234
2236
|
isLast: E,
|
|
2235
2237
|
busy: R,
|
|
2236
|
-
direction:
|
|
2238
|
+
direction: i,
|
|
2237
2239
|
subtitle: X,
|
|
2238
2240
|
nextLabel: pe,
|
|
2239
2241
|
backLabel: L,
|
|
2240
|
-
restored:
|
|
2242
|
+
restored: x,
|
|
2241
2243
|
refusals: h,
|
|
2242
|
-
errors:
|
|
2243
|
-
failure:
|
|
2244
|
-
next:
|
|
2244
|
+
errors: l.errors,
|
|
2245
|
+
failure: l.failure,
|
|
2246
|
+
next: me,
|
|
2245
2247
|
back: () => Z(g.value - 1),
|
|
2246
2248
|
goTo: D,
|
|
2247
|
-
restart:
|
|
2249
|
+
restart: xe,
|
|
2248
2250
|
confirmDiscard: ke,
|
|
2249
2251
|
bindDialog: () => ({ subtitle: X.value, primaryLabel: pe.value, status: R.value ? "processing" : "idle", beforeDismiss: ke })
|
|
2250
2252
|
};
|
|
@@ -2258,29 +2260,29 @@ const Fl = {
|
|
|
2258
2260
|
flow: {}
|
|
2259
2261
|
},
|
|
2260
2262
|
emits: ["cancel"],
|
|
2261
|
-
setup(
|
|
2262
|
-
const t =
|
|
2263
|
-
return (a,
|
|
2264
|
-
t.flow.backLabel.value ? (
|
|
2263
|
+
setup(l) {
|
|
2264
|
+
const t = l, { t: e } = oe();
|
|
2265
|
+
return (a, o) => (u(), y("div", Fl, [
|
|
2266
|
+
t.flow.backLabel.value ? (u(), O(ge, {
|
|
2265
2267
|
key: 0,
|
|
2266
2268
|
prominence: "plain",
|
|
2267
2269
|
icon: "arrowLeftSLine",
|
|
2268
2270
|
disabled: t.flow.busy.value,
|
|
2269
2271
|
"data-test": "step-back",
|
|
2270
|
-
onClick:
|
|
2272
|
+
onClick: o[0] || (o[0] = (n) => t.flow.back())
|
|
2271
2273
|
}, {
|
|
2272
|
-
default:
|
|
2274
|
+
default: v(() => [
|
|
2273
2275
|
Y(_(t.flow.backLabel.value), 1)
|
|
2274
2276
|
]),
|
|
2275
2277
|
_: 1
|
|
2276
2278
|
}, 8, ["disabled"])) : T("", !0),
|
|
2277
|
-
|
|
2279
|
+
o[3] || (o[3] = b("div", { class: "grow" }, null, -1)),
|
|
2278
2280
|
M(ge, {
|
|
2279
2281
|
prominence: "plain",
|
|
2280
2282
|
"data-test": "step-cancel",
|
|
2281
|
-
onClick:
|
|
2283
|
+
onClick: o[1] || (o[1] = (n) => a.$emit("cancel"))
|
|
2282
2284
|
}, {
|
|
2283
|
-
default:
|
|
2285
|
+
default: v(() => [
|
|
2284
2286
|
Y(_(s(e)("core.actions.cancel")), 1)
|
|
2285
2287
|
]),
|
|
2286
2288
|
_: 1
|
|
@@ -2289,9 +2291,9 @@ const Fl = {
|
|
|
2289
2291
|
prominence: "primary",
|
|
2290
2292
|
processing: t.flow.busy.value,
|
|
2291
2293
|
"data-test": "step-next",
|
|
2292
|
-
onClick:
|
|
2294
|
+
onClick: o[2] || (o[2] = (n) => t.flow.next())
|
|
2293
2295
|
}, {
|
|
2294
|
-
default:
|
|
2296
|
+
default: v(() => [
|
|
2295
2297
|
Y(_(t.flow.nextLabel.value), 1)
|
|
2296
2298
|
]),
|
|
2297
2299
|
_: 1
|
|
@@ -2312,62 +2314,62 @@ const Fl = {
|
|
|
2312
2314
|
flow: {},
|
|
2313
2315
|
progress: { default: "bar" }
|
|
2314
2316
|
},
|
|
2315
|
-
setup(
|
|
2316
|
-
const t =
|
|
2317
|
-
return (a,
|
|
2317
|
+
setup(l) {
|
|
2318
|
+
const t = l, { t: e } = oe();
|
|
2319
|
+
return (a, o) => t.progress === "bar" ? (u(), y("ol", {
|
|
2318
2320
|
key: 0,
|
|
2319
2321
|
"aria-label": s(e)("core.steps.label"),
|
|
2320
2322
|
"data-test": "step-bar",
|
|
2321
2323
|
class: "grid min-w-0 gap-2",
|
|
2322
2324
|
style: ct({ gridTemplateColumns: `repeat(${t.flow.count.value}, minmax(0, 1fr))` })
|
|
2323
2325
|
}, [
|
|
2324
|
-
(
|
|
2325
|
-
key:
|
|
2326
|
+
(u(!0), y(ue, null, we(t.flow.steps.value, (n) => (u(), y("li", {
|
|
2327
|
+
key: n.name,
|
|
2326
2328
|
class: "flex min-w-0",
|
|
2327
|
-
"aria-current":
|
|
2329
|
+
"aria-current": n.state === "current" ? "step" : void 0
|
|
2328
2330
|
}, [
|
|
2329
|
-
(
|
|
2330
|
-
type:
|
|
2331
|
-
disabled:
|
|
2332
|
-
"data-test": `step-${
|
|
2333
|
-
"data-state":
|
|
2334
|
-
class: j(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left",
|
|
2335
|
-
onClick: (
|
|
2331
|
+
(u(), O(ft(n.reachable ? "button" : "div"), {
|
|
2332
|
+
type: n.reachable ? "button" : void 0,
|
|
2333
|
+
disabled: n.reachable ? t.flow.busy.value : void 0,
|
|
2334
|
+
"data-test": `step-${n.name}`,
|
|
2335
|
+
"data-state": n.errors > 0 ? "error" : n.state,
|
|
2336
|
+
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" : ""]),
|
|
2337
|
+
onClick: (d) => n.reachable ? t.flow.goTo(n.name) : void 0
|
|
2336
2338
|
}, {
|
|
2337
|
-
default:
|
|
2338
|
-
|
|
2339
|
-
class: j(["h-1 rounded-full transition-colors duration-motion-normal",
|
|
2339
|
+
default: v(() => [
|
|
2340
|
+
b("span", {
|
|
2341
|
+
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"]),
|
|
2340
2342
|
"aria-hidden": "true"
|
|
2341
2343
|
}, null, 2),
|
|
2342
|
-
|
|
2343
|
-
class: j(["flex min-w-0 items-center gap-1.5 text-footnote",
|
|
2344
|
+
b("span", {
|
|
2345
|
+
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"])
|
|
2344
2346
|
}, [
|
|
2345
|
-
|
|
2347
|
+
n.state === "done" ? (u(), O(s(te), {
|
|
2346
2348
|
key: 0,
|
|
2347
2349
|
name: "checkCustom",
|
|
2348
2350
|
size: 12,
|
|
2349
2351
|
class: "shrink-0"
|
|
2350
2352
|
})) : T("", !0),
|
|
2351
|
-
|
|
2352
|
-
class: j(["truncate",
|
|
2353
|
-
}, _(
|
|
2354
|
-
|
|
2353
|
+
b("span", {
|
|
2354
|
+
class: j(["truncate", n.reachable ? "group-hover:text-content-link" : ""])
|
|
2355
|
+
}, _(n.position) + ". " + _(n.label), 3),
|
|
2356
|
+
n.errors > 0 ? (u(), y("span", {
|
|
2355
2357
|
key: 1,
|
|
2356
2358
|
"data-test": "step-errors",
|
|
2357
|
-
"aria-label": s(e)("core.form.sections.errors", { count:
|
|
2359
|
+
"aria-label": s(e)("core.form.sections.errors", { count: n.errors }),
|
|
2358
2360
|
class: "min-w-4.5 shrink-0 rounded-full bg-status-danger-solid px-1.5 text-center text-caption font-semibold text-white"
|
|
2359
|
-
}, _(
|
|
2360
|
-
|
|
2361
|
+
}, _(n.errors), 9, zl)) : T("", !0),
|
|
2362
|
+
n.state === "done" ? (u(), y("span", Dl, _(s(e)("core.steps.done")), 1)) : T("", !0)
|
|
2361
2363
|
], 2)
|
|
2362
2364
|
]),
|
|
2363
2365
|
_: 2
|
|
2364
2366
|
}, 1032, ["type", "disabled", "data-test", "data-state", "class", "onClick"]))
|
|
2365
2367
|
], 8, Tl))), 128))
|
|
2366
|
-
], 12, Ll)) : (
|
|
2367
|
-
(
|
|
2368
|
-
key:
|
|
2369
|
-
class: j(["h-1.5 rounded-full transition-all duration-motion-fast", [
|
|
2370
|
-
"data-state":
|
|
2368
|
+
], 12, Ll)) : (u(), y("div", Vl, [
|
|
2369
|
+
(u(!0), y(ue, null, we(t.flow.steps.value, (n) => (u(), y("span", {
|
|
2370
|
+
key: n.name,
|
|
2371
|
+
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"]]),
|
|
2372
|
+
"data-state": n.errors > 0 ? "error" : n.state
|
|
2371
2373
|
}, null, 10, ql))), 128))
|
|
2372
2374
|
]));
|
|
2373
2375
|
}
|
|
@@ -2386,41 +2388,50 @@ const Fl = {
|
|
|
2386
2388
|
navigation: { default: "inline" }
|
|
2387
2389
|
},
|
|
2388
2390
|
emits: ["cancel"],
|
|
2389
|
-
setup(
|
|
2390
|
-
const t =
|
|
2391
|
+
setup(l) {
|
|
2392
|
+
const t = l, { t: e } = oe(), a = H("body"), o = H("root");
|
|
2393
|
+
function n(d) {
|
|
2394
|
+
for (let i = d.parentElement; i; i = i.parentElement) {
|
|
2395
|
+
const m = getComputedStyle(i).overflowY;
|
|
2396
|
+
if ((m === "auto" || m === "scroll") && i.scrollHeight > i.clientHeight) return d.getBoundingClientRect().top < i.getBoundingClientRect().top;
|
|
2397
|
+
}
|
|
2398
|
+
return d.getBoundingClientRect().top < 0;
|
|
2399
|
+
}
|
|
2391
2400
|
return de(() => t.flow.current.value.name, async () => {
|
|
2392
|
-
await he(), a.value?.focus();
|
|
2401
|
+
await he(), o.value && n(o.value) && o.value.scrollIntoView?.({ block: "start" }), a.value?.focus({ preventScroll: !0 });
|
|
2393
2402
|
}), de(() => t.flow.refusals.value, async () => {
|
|
2394
2403
|
await he(), a.value && await De(a.value);
|
|
2395
|
-
}), (
|
|
2404
|
+
}), (d, i) => (u(), y("div", {
|
|
2405
|
+
ref_key: "root",
|
|
2406
|
+
ref: o,
|
|
2396
2407
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
2397
2408
|
"data-test": "step-form",
|
|
2398
2409
|
"data-step": t.flow.current.value.name
|
|
2399
2410
|
}, [
|
|
2400
|
-
t.progress !== "none" ? (
|
|
2411
|
+
t.progress !== "none" ? (u(), O(Rl, {
|
|
2401
2412
|
key: 0,
|
|
2402
2413
|
flow: t.flow,
|
|
2403
2414
|
progress: t.progress
|
|
2404
2415
|
}, null, 8, ["flow", "progress"])) : T("", !0),
|
|
2405
|
-
|
|
2406
|
-
t.flow.restored.value ? (
|
|
2407
|
-
|
|
2416
|
+
b("p", Ml, _(t.flow.subtitle.value), 1),
|
|
2417
|
+
t.flow.restored.value ? (u(), y("div", jl, [
|
|
2418
|
+
b("span", null, _(s(e)("core.steps.restored")), 1),
|
|
2408
2419
|
M(ge, {
|
|
2409
2420
|
prominence: "link",
|
|
2410
2421
|
size: "sm",
|
|
2411
|
-
onClick:
|
|
2422
|
+
onClick: i[0] || (i[0] = (m) => t.flow.restart())
|
|
2412
2423
|
}, {
|
|
2413
|
-
default:
|
|
2424
|
+
default: v(() => [
|
|
2414
2425
|
Y(_(s(e)("core.steps.start_over")), 1)
|
|
2415
2426
|
]),
|
|
2416
2427
|
_: 1
|
|
2417
2428
|
})
|
|
2418
2429
|
])) : T("", !0),
|
|
2419
|
-
(
|
|
2430
|
+
(u(), O(Me, {
|
|
2420
2431
|
key: t.flow.current.value.name,
|
|
2421
2432
|
form: t.flow
|
|
2422
2433
|
}, null, 8, ["form"])),
|
|
2423
|
-
(
|
|
2434
|
+
(u(), y("form", {
|
|
2424
2435
|
key: t.flow.current.value.name,
|
|
2425
2436
|
ref_key: "body",
|
|
2426
2437
|
ref: a,
|
|
@@ -2428,28 +2439,28 @@ const Fl = {
|
|
|
2428
2439
|
novalidate: "",
|
|
2429
2440
|
"data-test": "step-body",
|
|
2430
2441
|
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" : ""]),
|
|
2431
|
-
onSubmit:
|
|
2442
|
+
onSubmit: i[1] || (i[1] = be((m) => t.flow.next(), ["prevent"]))
|
|
2432
2443
|
}, [
|
|
2433
|
-
C(
|
|
2434
|
-
|
|
2444
|
+
C(d.$slots, t.flow.current.value.name),
|
|
2445
|
+
i[3] || (i[3] = b("button", {
|
|
2435
2446
|
type: "submit",
|
|
2436
2447
|
class: "sr-only",
|
|
2437
2448
|
tabindex: "-1",
|
|
2438
2449
|
"aria-hidden": "true"
|
|
2439
2450
|
}, null, -1))
|
|
2440
2451
|
], 34)),
|
|
2441
|
-
t.navigation === "inline" ? (
|
|
2452
|
+
t.navigation === "inline" ? (u(), O(Bl, {
|
|
2442
2453
|
key: 2,
|
|
2443
2454
|
flow: t.flow,
|
|
2444
|
-
onCancel:
|
|
2455
|
+
onCancel: i[2] || (i[2] = (m) => d.$emit("cancel"))
|
|
2445
2456
|
}, null, 8, ["flow"])) : T("", !0)
|
|
2446
2457
|
], 8, Ol));
|
|
2447
2458
|
}
|
|
2448
2459
|
});
|
|
2449
2460
|
export {
|
|
2450
2461
|
_t as Calendar,
|
|
2451
|
-
|
|
2452
|
-
|
|
2462
|
+
wo as CardSelectField,
|
|
2463
|
+
xo as CheckboxField,
|
|
2453
2464
|
$o as ChoiceChips,
|
|
2454
2465
|
_o as ComboField,
|
|
2455
2466
|
Yo as CommandDialog,
|
|
@@ -2463,8 +2474,8 @@ export {
|
|
|
2463
2474
|
qt as FormGroup,
|
|
2464
2475
|
Fo as FormGroupButton,
|
|
2465
2476
|
Bo as FormIndent,
|
|
2466
|
-
|
|
2467
|
-
|
|
2477
|
+
vt as FormRow,
|
|
2478
|
+
wn as FormView,
|
|
2468
2479
|
bn as GroupEditAction,
|
|
2469
2480
|
qo as GroupSheet,
|
|
2470
2481
|
Lo as I18nField,
|
|
@@ -2487,11 +2498,11 @@ export {
|
|
|
2487
2498
|
Vn as SwitchField,
|
|
2488
2499
|
rn as TextField,
|
|
2489
2500
|
Rn as TextareaField,
|
|
2490
|
-
|
|
2501
|
+
mn as TimeField,
|
|
2491
2502
|
nt as checkFile,
|
|
2492
2503
|
gn as createFieldGroups,
|
|
2493
2504
|
Xo as createLeaveGuard,
|
|
2494
|
-
|
|
2505
|
+
ve as fieldDefaults,
|
|
2495
2506
|
Wo as fieldKey,
|
|
2496
2507
|
fe as fieldProps,
|
|
2497
2508
|
De as focusFirstError,
|