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