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