@wssto2/vue-core 0.15.3 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +4 -3
- package/bin/architecture/engine.mjs +3 -0
- package/bin/architecture/permissions.mjs +56 -0
- package/bin/architecture/rules.mjs +17 -0
- package/bin/commands/check-architecture.mjs +19 -0
- package/bin/config.mjs +2 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-BH3f0hda.js → AccessGate.vue_vue_type_script_setup_true_lang-Bg8JFAOT.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js → ActionRow.vue_vue_type_script_setup_true_lang-B5IMNnTf.js} +4 -4
- package/dist/{Activity-DM9t5d3D.js → Activity-CiYn5E6A.js} +7 -7
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-uO4EAmBb.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js} +170 -168
- package/dist/{Changes-DYpysvfX.js → Changes-Cy8STpLX.js} +3 -3
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-qxeSTAKV.js → CollectionPage.vue_vue_type_script_setup_true_lang-Dr6nFNBB.js} +6 -6
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DbRS37n3.js → DataTable.vue_vue_type_script_setup_true_lang-D372wlxR.js} +1 -1
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-DzCvYHAf.js → DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js} +17 -16
- package/dist/{DeadLetters-vt9vhJD7.js → DeadLetters-DhJkMpd_.js} +4 -4
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js → FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js} +2 -2
- package/dist/FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js +160 -0
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js → FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js} +5 -5
- package/dist/{General-oUI2MiwO.js → General-CwTPC5UP.js} +11 -11
- package/dist/{IncidentRecord-CQdv_bN5.js → IncidentRecord-hXEGuLGg.js} +14 -14
- package/dist/{IncidentsList-DwQ0wuM8.js → IncidentsList-C41VyDwK.js} +6 -6
- package/dist/{NewRolePage-C-wbA-uW.js → NewRolePage-BYYZJkK7.js} +3 -3
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-U-_kcnGr.js → NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js} +7 -6
- package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-BPDh9s2m.js → PersonAccess.vue_vue_type_script_setup_true_lang-mYFuG-Y3.js} +56 -56
- package/dist/{ProfilePage-Di77M2cX.js → ProfilePage-DGEsIycR.js} +13 -13
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-CZtvUH5L.js → RecordHeader.vue_vue_type_script_setup_true_lang-B3BnYg1x.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-uLrX13ab.js → ResourcePage.vue_vue_type_script_setup_true_lang-1iZtj3rh.js} +1 -1
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-V2D7fhR9.js → RoleEditor.vue_vue_type_script_setup_true_lang-BslSDDiM.js} +10 -10
- package/dist/{RolePage-Crp71rRb.js → RolePage-C08ZUqw1.js} +9 -9
- package/dist/{RolesPage-DKXXnnDV.js → RolesPage-FOuY1VKg.js} +10 -10
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-5ogQCj8M.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DCTFxfPB.js} +2 -2
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js → SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js} +13 -12
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js → SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js} +10 -9
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C7WKxJ9i.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CDr4WNIb.js} +9 -9
- package/dist/{ServiceAccountRecord-CTU10RWy.js → ServiceAccountRecord-kWwIQGZb.js} +12 -12
- package/dist/{ServiceAccountsList-BVRjoswH.js → ServiceAccountsList-CKy9_YHP.js} +8 -8
- package/dist/{Sessions-BHwMrF7c.js → Sessions-BDc8gdYH.js} +4 -4
- package/dist/{SettingsPage-lRWvsMYK.js → SettingsPage-t-8kmFVT.js} +13 -13
- package/dist/{SignIn-HnujOMRY.js → SignIn-CqtkvtCZ.js} +7 -7
- package/dist/{SignInPage-c886Fvd7.js → SignInPage-DcdNKZIb.js} +4 -4
- package/dist/{SignIns-BsTlN2Zc.js → SignIns-D4-nGu0B.js} +3 -3
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js → SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js} +15 -14
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js → TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js} +7 -6
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-D2j4s96s.js → TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js} +6 -5
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-C1mLvOkc.js → TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js} +30 -29
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-jCXYFLtq.js → Timestamp.vue_vue_type_script_setup_true_lang-d_KuxWjH.js} +1 -1
- package/dist/{UserRecord-DrbpVHh9.js → UserRecord-CwZCr9Im.js} +10 -10
- package/dist/{UsersList-M5tBxrox.js → UsersList-Cn19sFgv.js} +4 -4
- package/dist/access/index.js +4 -4
- package/dist/app/application.d.ts +2 -0
- package/dist/app/index.js +2 -2
- package/dist/app/validate.d.ts +3 -1
- package/dist/{application-C900Wz0A.js → application-CDSweJb9.js} +144 -142
- package/dist/back-LcLlFodC.js +63 -0
- package/dist/{chrome-nUcmVu8G.js → chrome-kMBKIB1N.js} +2 -2
- package/dist/collection/authors.d.ts +27 -0
- package/dist/collection/index.d.ts +2 -0
- package/dist/collection/index.js +81 -76
- package/dist/config/index.d.ts +42 -0
- package/dist/config/index.js +12 -3
- package/dist/content/Panel.vue.d.ts +1 -1
- package/dist/content/index.js +2 -2
- package/dist/{contributions-9CPT-Z5v.js → contributions-B0x5x5xD.js} +1 -1
- package/dist/form/CommandDialog.vue.d.ts +1 -1
- package/dist/form/DateField.vue.d.ts +1 -1
- package/dist/form/DateTimeField.vue.d.ts +1 -1
- package/dist/form/FileField.vue.d.ts +1 -1
- package/dist/form/FormRow.vue.d.ts +2 -2
- package/dist/form/I18nField.vue.d.ts +2 -2
- package/dist/form/TextField.vue.d.ts +1 -1
- package/dist/form/TextareaField.vue.d.ts +2 -2
- package/dist/form/date/value.d.ts +21 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.js +745 -715
- package/dist/format/format.d.ts +8 -2
- package/dist/format/index.js +1 -1
- package/dist/format-C_HXlOYQ.js +136 -0
- package/dist/{guards-6fJxfUtk.js → guards-CNJ0ATVC.js} +1 -1
- package/dist/i18n/index.d.ts +14 -2
- package/dist/i18n/index.js +84 -73
- package/dist/i18n/messages.d.ts +10 -1
- package/dist/i18n/runtime.d.ts +3 -1
- package/dist/identity/index.js +3 -3
- package/dist/identity/profile/EmailChangeDialog.vue.d.ts +2 -2
- package/dist/identity/users/list.d.ts +1 -1
- package/dist/incidents/index.js +1 -1
- package/dist/{index-_hDHxrt5.js → index-1HS7O2-e.js} +9 -9
- package/dist/{index-DM_nWOYf.js → index-BA2w8uwD.js} +86 -86
- package/dist/{index-vES_D5ls.js → index-SLJWm40T.js} +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modal/DiscardChangesModal.vue.d.ts +2 -2
- package/dist/modal/Modal.vue.d.ts +2 -2
- package/dist/modal/Sheet.vue.d.ts +2 -2
- package/dist/modules/identity/routes.d.ts +1 -1
- package/dist/modules/identity/schemas.d.ts +2 -2
- package/dist/{navigation-DMJ6akat.js → navigation-d-JAPBGA.js} +1 -1
- package/dist/{neighbors-DrEahe7B.js → neighbors-Dg_LU9ry.js} +32 -31
- package/dist/notifications/index.js +1 -1
- package/dist/onboarding/index.js +1 -1
- package/dist/options-mOOX6JSS.js +214 -0
- package/dist/overlay/AlertDialog.vue.d.ts +3 -3
- package/dist/overlay/Menu.vue.d.ts +2 -2
- package/dist/overlay/PhotoViewer.vue.d.ts +2 -2
- package/dist/overlay/Popover.vue.d.ts +2 -2
- package/dist/page/SectionNavigator.vue.d.ts +1 -1
- package/dist/page/SectionPanel.vue.d.ts +1 -1
- package/dist/page/back.d.ts +37 -0
- package/dist/page/index.d.ts +1 -0
- package/dist/page/index.js +46 -42
- package/dist/phone/index.js +57 -56
- package/dist/platform/index.d.ts +10 -1
- package/dist/platform/index.js +16 -15
- package/dist/platform/platform.d.ts +4 -2
- package/dist/{platform-ORzRR3Tw.js → platform-DU9QFts8.js} +7 -6
- package/dist/playwright/config.d.ts +33 -0
- package/dist/playwright/index.d.ts +2 -0
- package/dist/playwright/index.js +192 -171
- package/dist/resource/index.js +1 -1
- package/dist/router/index.js +3 -3
- package/dist/router/sections.d.ts +1 -1
- package/dist/{rowLayout-QKfNHsML.js → rowLayout-PIuD7MGo.js} +2 -2
- package/dist/sections-BpiRLntE.js +54 -0
- package/dist/{serverMessages-Ce8-MK4e.js → serverMessages-C_KkDvpT.js} +1 -1
- package/dist/shell/index.js +5 -5
- package/dist/state/NextStepPanel.vue.d.ts +63 -0
- package/dist/state/PhaseTiles.vue.d.ts +20 -0
- package/dist/state/PhaseTrack.vue.d.ts +48 -0
- package/dist/state/RequirementList.vue.d.ts +10 -0
- package/dist/state/TodoRow.vue.d.ts +52 -0
- package/dist/state/index.d.ts +9 -0
- package/dist/state/index.js +731 -126
- package/dist/state/phaseStep.d.ts +7 -0
- package/dist/state/phaseTile.d.ts +10 -0
- package/dist/state/requirementItem.d.ts +16 -0
- package/dist/state/todoRow.d.ts +8 -0
- package/dist/{state-QDaxntgR.js → state-z1iPF1DT.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{suggestions-q_v3M7G6.js → suggestions-DeMgs_ki.js} +1 -1
- package/dist/testing/format.d.ts +1 -1
- package/dist/testing/index.js +31 -31
- package/dist/{useCommand-DAMgQ5NE.js → useCommand-DQKvro1n.js} +2 -2
- package/dist/{useGroupSheet-B-Hs4gNO.js → useGroupSheet-CRw3MUmX.js} +3 -3
- package/dist/{usePreferences-BfMXVbSO.js → usePreferences-DB29UTFD.js} +1 -1
- package/dist/{useRecordDialog-QPKFH1Ww.js → useRecordDialog-0azHxxvm.js} +1 -1
- package/dist/{useResourceForm-Oa6bk3NI.js → useResourceForm-zVuWerSn.js} +1 -1
- package/dist/{useSaveChrome-7huA3FzR.js → useSaveChrome-DB9OwIjT.js} +1 -1
- package/dist/{useTypedEntry-CITij2C_.js → useTypedEntry-BsMV66Yc.js} +46 -45
- package/package.json +1 -1
- package/dist/format-Cp1h0vsC.js +0 -125
- package/dist/options-B48UiYsG.js +0 -368
- package/dist/sections-DI_JhgQG.js +0 -53
package/dist/page/index.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { _ as W, a as X, b as Y, c as Z, p as ee, u as te, d as ae } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { _ as W, a as X, b as Y, c as Z, p as ee, u as te, d as ae } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js";
|
|
2
|
+
import { B as se, a as le, u as ne } from "../back-LcLlFodC.js";
|
|
3
|
+
import { _ as ie } from "../BottomDock.vue_vue_type_script_setup_true_lang-CjN7xYEr.js";
|
|
4
|
+
import { b as ue, i as de, u as pe } from "../bottomDock-BZEiOPYZ.js";
|
|
4
5
|
import { _ as x } from "../BottomDockPortal.vue_vue_type_script_setup_true_lang-DmwR-2SP.js";
|
|
5
|
-
import { defineComponent as
|
|
6
|
+
import { defineComponent as _, openBlock as a, createBlock as b, withCtx as c, createElementVNode as s, normalizeStyle as k, createElementBlock as l, Fragment as y, renderList as B, normalizeClass as d, unref as v, createCommentVNode as p, toDisplayString as f, useModel as C, useId as P, useTemplateRef as S, computed as $, mergeProps as T, createSlots as w, renderSlot as m, mergeModels as A } from "vue";
|
|
6
7
|
import { _ as L } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
|
|
7
|
-
import { _ as
|
|
8
|
-
import { c as
|
|
9
|
-
import { s as
|
|
10
|
-
import { p as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { a as
|
|
13
|
-
import { _ as
|
|
14
|
-
const
|
|
8
|
+
import { _ as me } from "../RecordHeader.vue_vue_type_script_setup_true_lang-B3BnYg1x.js";
|
|
9
|
+
import { c as ge, i as _e, p as ve, u as he, a as xe, b as ke } from "../chrome-kMBKIB1N.js";
|
|
10
|
+
import { s as D, u as I } from "../sectionIndex-BS0ic5W7.js";
|
|
11
|
+
import { p as Be, a as Ce } from "../sectionIndex-BS0ic5W7.js";
|
|
12
|
+
import { _ as Se } from "../SectionNavigator.vue_vue_type_script_setup_true_lang-DCTFxfPB.js";
|
|
13
|
+
import { a as Te, _ as we } from "../SectionList.vue_vue_type_script_setup_true_lang-CodyVezo.js";
|
|
14
|
+
import { _ as K } from "../Panel.vue_vue_type_script_setup_true_lang-D_Wg42hu.js";
|
|
15
|
+
const M = ["aria-label"], R = ["aria-label"], z = ["aria-selected", "tabindex", "onClick"], E = { class: "relative" }, N = {
|
|
15
16
|
key: 2,
|
|
16
17
|
class: "absolute -right-1 -top-0.5 size-2 rounded-full bg-status-warning-solid ring-2 ring-surface-cell"
|
|
17
18
|
}, H = {
|
|
18
19
|
key: 0,
|
|
19
20
|
class: "sr-only"
|
|
20
|
-
}, U = /* @__PURE__ */
|
|
21
|
+
}, U = /* @__PURE__ */ _({
|
|
21
22
|
__name: "BottomTabBar",
|
|
22
23
|
props: {
|
|
23
24
|
items: {},
|
|
@@ -50,8 +51,8 @@ const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex",
|
|
|
50
51
|
class: d(["relative flex h-14 w-full cursor-pointer flex-col items-center justify-center gap-1 px-1 transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus", e.active ? "text-content-link" : "text-content-muted active:text-content-strong"]),
|
|
51
52
|
onClick: (u) => r("select", e.value)
|
|
52
53
|
}, [
|
|
53
|
-
s("span",
|
|
54
|
-
e.icon ? (a(), b(
|
|
54
|
+
s("span", E, [
|
|
55
|
+
e.icon ? (a(), b(v(L), {
|
|
55
56
|
key: 0,
|
|
56
57
|
name: e.icon,
|
|
57
58
|
size: 22
|
|
@@ -59,23 +60,23 @@ const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex",
|
|
|
59
60
|
e.badge ? (a(), l("span", {
|
|
60
61
|
key: 1,
|
|
61
62
|
class: d(["absolute -right-2.5 -top-1.5 min-w-4 rounded-full px-1 text-center text-3xs font-semibold leading-4", e.badgeTone === "critical" ? "bg-status-danger-solid text-white" : "bg-tint text-content-on-tint"])
|
|
62
|
-
}, f(e.badge), 3)) : e.warning ? (a(), l("span",
|
|
63
|
+
}, f(e.badge), 3)) : e.warning ? (a(), l("span", N)) : p("", !0)
|
|
63
64
|
]),
|
|
64
65
|
e.warning ? (a(), l("span", H, f(e.warning), 1)) : p("", !0),
|
|
65
66
|
s("span", {
|
|
66
67
|
class: d(["w-full truncate text-center text-2xs", e.active ? "font-semibold" : "font-medium"])
|
|
67
68
|
}, f(e.label), 3)
|
|
68
|
-
], 10,
|
|
69
|
+
], 10, z)
|
|
69
70
|
]))), 128))
|
|
70
|
-
], 12,
|
|
71
|
-
], 8,
|
|
71
|
+
], 12, R)
|
|
72
|
+
], 8, M)
|
|
72
73
|
]),
|
|
73
74
|
_: 1
|
|
74
75
|
}));
|
|
75
76
|
}
|
|
76
|
-
}), q = /* @__PURE__ */
|
|
77
|
+
}), q = /* @__PURE__ */ _({
|
|
77
78
|
__name: "SectionPanel",
|
|
78
|
-
props: /* @__PURE__ */
|
|
79
|
+
props: /* @__PURE__ */ A({
|
|
79
80
|
title: {},
|
|
80
81
|
icon: { default: void 0 },
|
|
81
82
|
number: { default: void 0 },
|
|
@@ -91,13 +92,13 @@ const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex",
|
|
|
91
92
|
}),
|
|
92
93
|
emits: ["update:collapsed"],
|
|
93
94
|
setup(n) {
|
|
94
|
-
const t = n, o =
|
|
95
|
-
return I(r, () => t.title, g, { number: () => t.number, reveal: () => i.value?.expand() }), (e, u) => (a(), b(
|
|
95
|
+
const t = n, o = C(n, "collapsed"), r = t.id ?? (D(t.title) || `section-${P()}`), i = S("panel"), g = $(() => i.value?.$el ?? null);
|
|
96
|
+
return I(r, () => t.title, g, { number: () => t.number, reveal: () => i.value?.expand() }), (e, u) => (a(), b(K, T({
|
|
96
97
|
ref_key: "panel",
|
|
97
98
|
ref: i,
|
|
98
99
|
collapsed: o.value,
|
|
99
100
|
"onUpdate:collapsed": u[0] || (u[0] = (h) => o.value = h)
|
|
100
|
-
}, { id:
|
|
101
|
+
}, { id: v(r), tabindex: -1 }, {
|
|
101
102
|
title: t.title,
|
|
102
103
|
icon: t.icon,
|
|
103
104
|
number: t.number,
|
|
@@ -107,7 +108,7 @@ const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex",
|
|
|
107
108
|
flush: t.flush,
|
|
108
109
|
"heading-level": t.headingLevel,
|
|
109
110
|
class: "scroll-mt-[calc(var(--app-bar-height)+1.5rem)]"
|
|
110
|
-
}),
|
|
111
|
+
}), w({
|
|
111
112
|
default: c(() => [
|
|
112
113
|
m(e.$slots, "default")
|
|
113
114
|
]),
|
|
@@ -132,31 +133,34 @@ const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex",
|
|
|
132
133
|
});
|
|
133
134
|
export {
|
|
134
135
|
W as AdaptivePageShell,
|
|
135
|
-
se as
|
|
136
|
+
se as BACK_PARAM,
|
|
137
|
+
le as BACK_TITLE_PARAM,
|
|
138
|
+
ie as BottomDock,
|
|
136
139
|
x as BottomDockPortal,
|
|
137
140
|
U as BottomTabBar,
|
|
138
141
|
X as PageActions,
|
|
139
142
|
Y as PageToolbar,
|
|
140
|
-
|
|
143
|
+
me as RecordHeader,
|
|
141
144
|
Z as ResourceHeader,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
Te as SectionJumper,
|
|
146
|
+
we as SectionList,
|
|
147
|
+
Se as SectionNavigator,
|
|
145
148
|
q as SectionPanel,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
ue as bottomDockKey,
|
|
150
|
+
ge as createPageChrome,
|
|
151
|
+
de as installBottomDock,
|
|
152
|
+
_e as installPageChrome,
|
|
153
|
+
ve as pageChromeKey,
|
|
151
154
|
ee as pageSectionBackKey,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
Be as provideSectionIndex,
|
|
156
|
+
D as sectionId,
|
|
157
|
+
ne as useBackLinks,
|
|
158
|
+
pe as useBottomDockTarget,
|
|
155
159
|
te as useLargeTitle,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
he as useOptionalPageChrome,
|
|
161
|
+
xe as usePageChrome,
|
|
162
|
+
ke as usePageChromeContext,
|
|
159
163
|
ae as usePageSectionBack,
|
|
160
164
|
I as useSectionAnchor,
|
|
161
|
-
|
|
165
|
+
Ce as useSectionIndex
|
|
162
166
|
};
|
package/dist/phone/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as fe, useModel as me, useTemplateRef as z, ref as B, computed as g, watch as ne, nextTick as W, openBlock as w, createElementBlock as $, createElementVNode as f, normalizeClass as P, unref as
|
|
1
|
+
import { defineComponent as fe, useModel as me, useTemplateRef as z, ref as B, computed as g, watch as ne, nextTick as W, openBlock as w, createElementBlock as $, createElementVNode as f, normalizeClass as P, unref as s, createVNode as M, toDisplayString as T, normalizeStyle as xe, Fragment as ee, renderList as le, createCommentVNode as J, withModifiers as we, withDirectives as _e, vModelText as ke, mergeModels as re, inject as Ce, shallowRef as $e, onBeforeUnmount as De, createBlock as Me, mergeProps as Te, createSlots as Se, withCtx as ie, createTextVNode as Ne, renderSlot as Ie, mergeDefaults as Pe } from "vue";
|
|
2
2
|
import { useI18n as pe } from "vue-i18n";
|
|
3
|
-
import { u as ve } from "../format-
|
|
3
|
+
import { u as ve } from "../format-C_HXlOYQ.js";
|
|
4
4
|
import { b as Ve } from "../controlSurface-t7OEFESJ.js";
|
|
5
|
-
import {
|
|
5
|
+
import { f as se, u as Oe, _ as Le } from "../options-mOOX6JSS.js";
|
|
6
|
+
import { a as Re, f as Be, b as Ee } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
|
|
6
7
|
import { _ as A } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
|
|
7
8
|
import { _ as ue } from "../CountryFlag.vue_vue_type_script_setup_true_lang-Kry_vPPZ.js";
|
|
8
9
|
import { u as Fe } from "../anchored-DpuUwf-9.js";
|
|
@@ -13,7 +14,7 @@ function ye(t) {
|
|
|
13
14
|
return qe.country_calling_codes[t]?.[0];
|
|
14
15
|
}
|
|
15
16
|
const E = (t) => We(t), de = (t) => `+${E(t)}`;
|
|
16
|
-
function
|
|
17
|
+
function Mt(t, a) {
|
|
17
18
|
let e = (t ?? "").replace(/\D/g, "");
|
|
18
19
|
if (e.length < 6) return null;
|
|
19
20
|
let n = "";
|
|
@@ -67,7 +68,7 @@ function be(t) {
|
|
|
67
68
|
const a = Ye(t), e = ze(t);
|
|
68
69
|
return e === "TOO_SHORT" ? { kind: "too_short", country: a } : e === "TOO_LONG" ? { kind: "too_long", country: a } : e !== void 0 ? { kind: "invalid", country: a } : he(t)?.isValid() ? null : { kind: "invalid", country: a };
|
|
69
70
|
}
|
|
70
|
-
const
|
|
71
|
+
const Tt = (t) => be(t) === null;
|
|
71
72
|
function ge(t, a) {
|
|
72
73
|
try {
|
|
73
74
|
return new Intl.DisplayNames([a], { type: "region" }).of(t) ?? t;
|
|
@@ -76,9 +77,9 @@ function ge(t, a) {
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
function Je(t, a, e) {
|
|
79
|
-
const n =
|
|
80
|
+
const n = se(t.trim());
|
|
80
81
|
if (n === "") return e;
|
|
81
|
-
const l = n.replace(/\D/g, ""), x = new Intl.DisplayNames([a], { type: "region" }), p = (h) =>
|
|
82
|
+
const l = n.replace(/\D/g, ""), x = new Intl.DisplayNames([a], { type: "region" }), p = (h) => se(x.of(h) ?? h), _ = n.startsWith("+") || /^\d+$/.test(n);
|
|
82
83
|
return e.filter((h) => _ ? E(h).startsWith(l) : p(h).includes(n) || h.toLowerCase() === n);
|
|
83
84
|
}
|
|
84
85
|
const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tabular-nums" }, et = ["id", "aria-label"], tt = {
|
|
@@ -89,7 +90,7 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
89
90
|
key: 0,
|
|
90
91
|
class: "px-3 py-2 text-footnote text-content-muted",
|
|
91
92
|
role: "status"
|
|
92
|
-
}, at = { class: "border-t border-border-separator px-3 py-2" }, lt = ["aria-controls", "aria-activedescendant", "aria-label", "placeholder"],
|
|
93
|
+
}, at = { class: "border-t border-border-separator px-3 py-2" }, lt = ["aria-controls", "aria-activedescendant", "aria-label", "placeholder"], it = /* @__PURE__ */ fe({
|
|
93
94
|
__name: "CountryPicker",
|
|
94
95
|
props: /* @__PURE__ */ re({
|
|
95
96
|
id: {},
|
|
@@ -104,7 +105,7 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
104
105
|
setup(t, { expose: a, emit: e }) {
|
|
105
106
|
const n = t, l = me(t, "modelValue"), x = e, { t: p } = pe(), _ = ve(), h = z("root"), V = z("trigger"), k = z("panel"), K = z("search"), C = B(!1), v = B(""), d = B(0), O = g(() => {
|
|
106
107
|
const o = /* @__PURE__ */ new Map();
|
|
107
|
-
for (const
|
|
108
|
+
for (const i of te()) o.set(i, ge(i, _.intlLocale));
|
|
108
109
|
return o;
|
|
109
110
|
}), S = (o) => O.value.get(o) ?? o, D = g(() => {
|
|
110
111
|
const o = n.common.filter((c) => O.value.has(c));
|
|
@@ -112,15 +113,15 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
112
113
|
const c = Je(v.value, _.intlLocale, te());
|
|
113
114
|
return [{ title: null, countries: [...c.filter((r) => o.includes(r)), ...c.filter((r) => !o.includes(r))] }];
|
|
114
115
|
}
|
|
115
|
-
const
|
|
116
|
-
return [{ title: p("core.form.phone.common"), countries: o }, { title: p("core.form.phone.all"), countries:
|
|
117
|
-
}), y = g(() => D.value.flatMap((o) => o.countries)), F = g(() => D.value.map((o,
|
|
116
|
+
const i = te().filter((c) => !o.includes(c)).sort((c, r) => S(c).localeCompare(S(r), _.intlLocale));
|
|
117
|
+
return [{ title: p("core.form.phone.common"), countries: o }, { title: p("core.form.phone.all"), countries: i }].filter((c) => c.countries.length > 0);
|
|
118
|
+
}), y = g(() => D.value.flatMap((o) => o.countries)), F = g(() => D.value.map((o, i) => D.value.slice(0, i).reduce((c, r) => c + r.countries.length, 0))), U = (o) => `${n.id}-country-${o}`, { style: Q } = Fe(k, {
|
|
118
119
|
reference: () => V.value,
|
|
119
120
|
placement: () => "bottom-start",
|
|
120
121
|
offset: 4,
|
|
121
122
|
padding: 8,
|
|
122
|
-
fit: (o,
|
|
123
|
-
o.style.width = "min(20rem, calc(100vw - 1rem))", o.style.maxHeight = `${Math.max(200, Math.min(380,
|
|
123
|
+
fit: (o, i) => {
|
|
124
|
+
o.style.width = "min(20rem, calc(100vw - 1rem))", o.style.maxHeight = `${Math.max(200, Math.min(380, i.height))}px`;
|
|
124
125
|
}
|
|
125
126
|
});
|
|
126
127
|
async function j() {
|
|
@@ -143,14 +144,14 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
143
144
|
o.preventDefault(), d.value = Math.min(Math.max(d.value + (o.key === "ArrowDown" ? 1 : -1), 0), y.value.length - 1);
|
|
144
145
|
else if (o.key === "Enter") {
|
|
145
146
|
o.preventDefault();
|
|
146
|
-
const
|
|
147
|
-
|
|
147
|
+
const i = y.value[d.value];
|
|
148
|
+
i && L(i);
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
function R(o) {
|
|
151
152
|
(o.key === "ArrowDown" || o.key === "ArrowUp") && (o.preventDefault(), j());
|
|
152
153
|
}
|
|
153
|
-
return a({ focus: () => V.value?.focus() }), (o,
|
|
154
|
+
return a({ focus: () => V.value?.focus() }), (o, i) => (w(), $("div", {
|
|
154
155
|
ref_key: "root",
|
|
155
156
|
ref: h,
|
|
156
157
|
class: "shrink-0",
|
|
@@ -162,17 +163,17 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
162
163
|
ref: V,
|
|
163
164
|
type: "button",
|
|
164
165
|
disabled: n.disabled,
|
|
165
|
-
"aria-label":
|
|
166
|
+
"aria-label": s(p)("core.form.phone.country", { country: S(l.value) }),
|
|
166
167
|
"aria-haspopup": "listbox",
|
|
167
168
|
"aria-expanded": C.value,
|
|
168
169
|
"data-test": "country-button",
|
|
169
170
|
class: P(["flex h-full min-h-8 cursor-pointer items-center gap-1.5 whitespace-nowrap text-body font-medium text-content-strong focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus disabled:cursor-not-allowed compact:border-r compact:border-border-separator", n.surface]),
|
|
170
|
-
onClick:
|
|
171
|
+
onClick: i[0] || (i[0] = (c) => C.value ? N(!0) : j()),
|
|
171
172
|
onKeydown: R
|
|
172
173
|
}, [
|
|
173
174
|
M(ue, { country: l.value }, null, 8, ["country"]),
|
|
174
|
-
f("span", Ze, T(
|
|
175
|
-
M(
|
|
175
|
+
f("span", Ze, T(s(de)(l.value)), 1),
|
|
176
|
+
M(s(A), {
|
|
176
177
|
name: "arrowDownSLine",
|
|
177
178
|
size: 14,
|
|
178
179
|
class: "text-content-muted"
|
|
@@ -182,14 +183,14 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
182
183
|
key: 0,
|
|
183
184
|
ref_key: "panel",
|
|
184
185
|
ref: k,
|
|
185
|
-
style: xe(
|
|
186
|
+
style: xe(s(Q)),
|
|
186
187
|
"data-test": "country-list",
|
|
187
188
|
class: "z-1000 flex flex-col overflow-hidden rounded-menu bg-surface-overlay shadow-float"
|
|
188
189
|
}, [
|
|
189
190
|
f("div", {
|
|
190
191
|
id: `${n.id}-countries`,
|
|
191
192
|
role: "listbox",
|
|
192
|
-
"aria-label":
|
|
193
|
+
"aria-label": s(p)("core.form.phone.countries"),
|
|
193
194
|
class: "min-h-0 flex-1 overflow-y-auto p-2"
|
|
194
195
|
}, [
|
|
195
196
|
(w(!0), $(ee, null, le(D.value, (c, r) => (w(), $(ee, {
|
|
@@ -204,7 +205,7 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
204
205
|
"data-test": "country-option",
|
|
205
206
|
"data-country": u,
|
|
206
207
|
class: P(["flex cursor-pointer items-center gap-2.5 rounded-control px-2 py-2 text-body", (F.value[r] ?? 0) + b === d.value ? "bg-tint-soft" : "hover:bg-fill"]),
|
|
207
|
-
onMousedown:
|
|
208
|
+
onMousedown: i[1] || (i[1] = we(() => {
|
|
208
209
|
}, ["prevent"])),
|
|
209
210
|
onMouseenter: (m) => d.value = (F.value[r] ?? 0) + b,
|
|
210
211
|
onClick: (m) => L(u)
|
|
@@ -213,16 +214,16 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
213
214
|
f("span", {
|
|
214
215
|
class: P(["min-w-0 flex-1 truncate text-content-strong", u === l.value ? "font-semibold" : ""])
|
|
215
216
|
}, T(S(u)), 3),
|
|
216
|
-
f("span", nt, T(
|
|
217
|
+
f("span", nt, T(s(de)(u)), 1)
|
|
217
218
|
], 42, ot))), 128))
|
|
218
219
|
], 64))), 128)),
|
|
219
|
-
y.value.length === 0 ? (w(), $("p", rt, T(
|
|
220
|
+
y.value.length === 0 ? (w(), $("p", rt, T(s(p)("core.form.phone.no_match")), 1)) : J("", !0)
|
|
220
221
|
], 8, et),
|
|
221
222
|
f("div", at, [
|
|
222
223
|
_e(f("input", {
|
|
223
224
|
ref_key: "search",
|
|
224
225
|
ref: K,
|
|
225
|
-
"onUpdate:modelValue":
|
|
226
|
+
"onUpdate:modelValue": i[2] || (i[2] = (c) => v.value = c),
|
|
226
227
|
type: "text",
|
|
227
228
|
role: "combobox",
|
|
228
229
|
autocomplete: "off",
|
|
@@ -230,8 +231,8 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
230
231
|
"aria-expanded": "true",
|
|
231
232
|
"aria-controls": `${n.id}-countries`,
|
|
232
233
|
"aria-activedescendant": y.value[d.value] ? U(y.value[d.value]) : void 0,
|
|
233
|
-
"aria-label":
|
|
234
|
-
placeholder:
|
|
234
|
+
"aria-label": s(p)("core.form.phone.search"),
|
|
235
|
+
placeholder: s(p)("core.form.phone.search"),
|
|
235
236
|
"data-test": "country-search",
|
|
236
237
|
class: "block w-full border-0 bg-transparent p-0 text-body text-content-strong placeholder:text-content-muted focus:outline-none focus:ring-0",
|
|
237
238
|
onKeydown: G
|
|
@@ -242,14 +243,14 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
242
243
|
], 4)) : J("", !0)
|
|
243
244
|
], 544));
|
|
244
245
|
}
|
|
245
|
-
}),
|
|
246
|
+
}), st = Symbol("vue-core.phoneDefaults"), ut = { class: "w-full min-w-0" }, ct = ["id", "value", "name", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], dt = {
|
|
246
247
|
key: 0,
|
|
247
248
|
class: "mt-1.5 flex items-center gap-1.5 text-footnote text-status-success-content",
|
|
248
249
|
"data-test": "phone-kind"
|
|
249
250
|
}, ft = ["href", "aria-label", "title"], mt = ["href", "aria-label", "title"], pt = ["aria-label", "title"], vt = {
|
|
250
251
|
class: "sr-only",
|
|
251
252
|
role: "status"
|
|
252
|
-
},
|
|
253
|
+
}, St = /* @__PURE__ */ fe({
|
|
253
254
|
__name: "PhoneField",
|
|
254
255
|
props: /* @__PURE__ */ re(/* @__PURE__ */ Pe({
|
|
255
256
|
label: {},
|
|
@@ -272,7 +273,7 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
272
273
|
}),
|
|
273
274
|
emits: ["update:modelValue"],
|
|
274
275
|
setup(t, { expose: a }) {
|
|
275
|
-
const e = t, n = me(t, "modelValue"), { t: l } = pe(), x = ve(), p = Ce(
|
|
276
|
+
const e = t, n = me(t, "modelValue"), { t: l } = pe(), x = ve(), p = Ce(st, {}), _ = !!Re(), h = Oe("text", () => e.error || L.value ? "error" : e.disabled ? "locked" : "rest"), V = g(() => _ ? Ve(e.width) : "w-full"), k = z("input"), K = g(() => e.defaultCountry ?? p.defaultCountry ?? (e.commonCountries ?? p.commonCountries ?? ce)[0] ?? "HR"), C = g(() => e.commonCountries ?? p.commonCountries ?? ce), v = $e(K.value), d = B("");
|
|
276
277
|
let O = null;
|
|
277
278
|
function S(r) {
|
|
278
279
|
v.value = r.country, d.value = r.text;
|
|
@@ -315,34 +316,34 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
315
316
|
if (r)
|
|
316
317
|
return r.country ? l(`core.form.phone.${r.kind}`, { country: ge(r.country, x.intlLocale) }) : l("core.form.phone.invalid_any");
|
|
317
318
|
}), G = g(() => n.value !== "" && !L.value ? Xe(n.value) : void 0), R = g(() => He(n.value)), o = B(!1);
|
|
318
|
-
let
|
|
319
|
+
let i = null;
|
|
319
320
|
async function c() {
|
|
320
321
|
try {
|
|
321
322
|
await navigator.clipboard.writeText(R.value);
|
|
322
323
|
} catch {
|
|
323
324
|
return;
|
|
324
325
|
}
|
|
325
|
-
o.value = !0,
|
|
326
|
+
o.value = !0, i && clearTimeout(i), i = setTimeout(() => o.value = !1, 1800);
|
|
326
327
|
}
|
|
327
|
-
return De(() =>
|
|
328
|
+
return De(() => i && clearTimeout(i)), a({ focus: () => k.value?.focus() }), (r, u) => (w(), Me(Le, Te({ ...s(Be)(e), error: e.error ?? H.value }, {
|
|
328
329
|
value: n.value === "" ? null : R.value,
|
|
329
330
|
"value-style": "numeric"
|
|
330
331
|
}), Se({
|
|
331
|
-
default:
|
|
332
|
+
default: ie(({ id: b, describedby: m, invalid: I }) => [
|
|
332
333
|
f("div", ut, [
|
|
333
334
|
f("div", {
|
|
334
335
|
class: P(["flex items-stretch gap-1.5", V.value])
|
|
335
336
|
}, [
|
|
336
|
-
M(
|
|
337
|
+
M(it, {
|
|
337
338
|
id: b,
|
|
338
339
|
"model-value": v.value,
|
|
339
340
|
common: C.value,
|
|
340
341
|
disabled: e.disabled,
|
|
341
|
-
surface: `${
|
|
342
|
+
surface: `${s(h)} px-2.5`,
|
|
342
343
|
onPicked: j
|
|
343
344
|
}, null, 8, ["id", "model-value", "common", "disabled", "surface"]),
|
|
344
345
|
f("div", {
|
|
345
|
-
class: P(["min-w-0 flex-1",
|
|
346
|
+
class: P(["min-w-0 flex-1", s(h)])
|
|
346
347
|
}, [
|
|
347
348
|
f("input", {
|
|
348
349
|
id: b,
|
|
@@ -368,12 +369,12 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
368
369
|
], 2)
|
|
369
370
|
], 2),
|
|
370
371
|
G.value && !(e.error ?? H.value) ? (w(), $("p", dt, [
|
|
371
|
-
M(
|
|
372
|
+
M(s(A), {
|
|
372
373
|
name: "checkCustom",
|
|
373
374
|
size: 14,
|
|
374
375
|
class: "shrink-0"
|
|
375
376
|
}),
|
|
376
|
-
Ne(" " + T(
|
|
377
|
+
Ne(" " + T(s(l)(`core.form.phone.kind_${G.value}`)), 1)
|
|
377
378
|
])) : J("", !0)
|
|
378
379
|
])
|
|
379
380
|
]),
|
|
@@ -381,7 +382,7 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
381
382
|
}, [
|
|
382
383
|
n.value !== "" ? {
|
|
383
384
|
name: "readonly",
|
|
384
|
-
fn:
|
|
385
|
+
fn: ie(() => [
|
|
385
386
|
f("div", {
|
|
386
387
|
class: P(["flex w-full min-w-0 flex-wrap items-center gap-x-2 gap-y-1.5", _ ? "justify-end" : ""]),
|
|
387
388
|
"data-test": "phone-read"
|
|
@@ -391,24 +392,24 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
391
392
|
}, T(R.value), 3),
|
|
392
393
|
f("a", {
|
|
393
394
|
href: `tel:${n.value}`,
|
|
394
|
-
"aria-label":
|
|
395
|
-
title:
|
|
395
|
+
"aria-label": s(l)("core.form.phone.call"),
|
|
396
|
+
title: s(l)("core.form.phone.call"),
|
|
396
397
|
"data-test": "phone-call",
|
|
397
398
|
class: "flex size-9 shrink-0 items-center justify-center rounded-full bg-tint-soft 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"
|
|
398
399
|
}, [
|
|
399
|
-
M(
|
|
400
|
+
M(s(A), {
|
|
400
401
|
name: "phone",
|
|
401
402
|
size: 18
|
|
402
403
|
})
|
|
403
404
|
], 8, ft),
|
|
404
405
|
f("a", {
|
|
405
406
|
href: `sms:${n.value}`,
|
|
406
|
-
"aria-label":
|
|
407
|
-
title:
|
|
407
|
+
"aria-label": s(l)("core.form.phone.message"),
|
|
408
|
+
title: s(l)("core.form.phone.message"),
|
|
408
409
|
"data-test": "phone-message",
|
|
409
410
|
class: "flex size-9 shrink-0 items-center justify-center rounded-full bg-tint-soft 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"
|
|
410
411
|
}, [
|
|
411
|
-
M(
|
|
412
|
+
M(s(A), {
|
|
412
413
|
name: "message",
|
|
413
414
|
size: 18
|
|
414
415
|
})
|
|
@@ -419,18 +420,18 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
419
420
|
}),
|
|
420
421
|
f("button", {
|
|
421
422
|
type: "button",
|
|
422
|
-
"aria-label":
|
|
423
|
-
title:
|
|
423
|
+
"aria-label": s(l)("core.form.phone.copy"),
|
|
424
|
+
title: s(l)("core.form.phone.copy"),
|
|
424
425
|
"data-test": "phone-copy",
|
|
425
426
|
class: "flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full bg-fill text-content-strong transition-colors duration-motion-fast hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
426
427
|
onClick: c
|
|
427
428
|
}, [
|
|
428
|
-
M(
|
|
429
|
+
M(s(A), {
|
|
429
430
|
name: o.value ? "checkCustom" : "copy",
|
|
430
431
|
size: 18
|
|
431
432
|
}, null, 8, ["name"])
|
|
432
433
|
], 8, pt),
|
|
433
|
-
f("span", vt, T(o.value ?
|
|
434
|
+
f("span", vt, T(o.value ? s(l)("core.form.phone.copied") : ""), 1)
|
|
434
435
|
], 2)
|
|
435
436
|
]),
|
|
436
437
|
key: "0"
|
|
@@ -440,14 +441,14 @@ const Qe = ["id", "disabled", "aria-label", "aria-expanded"], Ze = { class: "tab
|
|
|
440
441
|
});
|
|
441
442
|
export {
|
|
442
443
|
ce as COMMON_COUNTRIES,
|
|
443
|
-
|
|
444
|
+
St as PhoneField,
|
|
444
445
|
ge as countryName,
|
|
445
446
|
de as dialCode,
|
|
446
447
|
He as formatInternational,
|
|
447
|
-
|
|
448
|
+
Tt as isValidPhone,
|
|
448
449
|
Ye as phoneCountry,
|
|
449
|
-
|
|
450
|
+
st as phoneDefaultsKey,
|
|
450
451
|
Xe as phoneKind,
|
|
451
452
|
be as phoneProblem,
|
|
452
|
-
|
|
453
|
+
Mt as whatsAppLink
|
|
453
454
|
};
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { parseNavigation } from "./navigation";
|
|
|
9
9
|
export type { NavigationNode } from "./navigation";
|
|
10
10
|
export { httpSessionAdapter, parseSessionPayload } from "./httpSession";
|
|
11
11
|
export type { HttpSessionOptions, UserParser } from "./httpSession";
|
|
12
|
-
export { createPlatform, installPlatform, platformKey, usePlatform } from "./platform";
|
|
12
|
+
export { createPlatform, installPlatform, platformKey, useAccess, usePlatform } from "./platform";
|
|
13
13
|
export type { Platform, PlatformOptions } from "./platform";
|
|
14
14
|
export { mergePatch, preferencesOf } from "./preferences";
|
|
15
15
|
export type { Preferences, PreferencesPatch } from "./preferences";
|
|
@@ -24,6 +24,15 @@ export type { BeforeSignOutHook, Session, SessionAdapter, SessionEnd, SessionImp
|
|
|
24
24
|
* declare module "@wssto2/vue-core/platform" {
|
|
25
25
|
* interface PermissionRegistry { "tickets:view": true; "tickets:update": true }
|
|
26
26
|
* }
|
|
27
|
+
*
|
|
28
|
+
* An application with a generated union declares it in one line, and may split the rest across features (each
|
|
29
|
+
* feature's `routes.ts` adds its own keys the same way):
|
|
30
|
+
*
|
|
31
|
+
* declare module "@wssto2/vue-core/platform" {
|
|
32
|
+
* interface PermissionRegistry extends Record<GeneratedPermission, true> {}
|
|
33
|
+
* }
|
|
34
|
+
*
|
|
35
|
+
* `usePlatform().access`, `useAccess()`, `AccessGate` and route `meta.access` are all typed from it.
|
|
27
36
|
*/
|
|
28
37
|
export interface PermissionRegistry {
|
|
29
38
|
}
|
package/dist/platform/index.js
CHANGED
|
@@ -5,12 +5,12 @@ var S = (s) => {
|
|
|
5
5
|
var O = (s, t, e) => t in s ? N(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
6
6
|
var $ = (s, t, e) => O(s, typeof t != "symbol" ? t + "" : t, e), w = (s, t, e) => t.has(s) || S("Cannot " + e);
|
|
7
7
|
var o = (s, t, e) => (w(s, t, "read from private field"), e ? e.call(s) : t.get(s)), l = (s, t, e) => t.has(s) ? S("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), f = (s, t, e, r) => (w(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e), h = (s, t, e) => (w(s, t, "access private method"), e);
|
|
8
|
-
import { u as v } from "../platform-
|
|
9
|
-
import { b as F, c as G, a as K, d as U, h as _, e as z, i as D, p as H, f as Q, g as R } from "../platform-
|
|
10
|
-
import { M as
|
|
11
|
-
import { m as
|
|
8
|
+
import { u as v } from "../platform-DU9QFts8.js";
|
|
9
|
+
import { b as F, c as G, a as K, d as U, h as _, e as z, i as D, p as H, f as Q, g as R, j as V } from "../platform-DU9QFts8.js";
|
|
10
|
+
import { M as X, d as Y } from "../context-Ch1r4fdN.js";
|
|
11
|
+
import { m as k, p as tt } from "../preferences-hYhrw8Uy.js";
|
|
12
12
|
import { computed as E } from "vue";
|
|
13
|
-
import { _ as
|
|
13
|
+
import { _ as st } from "../AccessGate.vue_vue_type_script_setup_true_lang-Bg8JFAOT.js";
|
|
14
14
|
class m extends Error {
|
|
15
15
|
constructor(e, r = [], n) {
|
|
16
16
|
super(r.length > 0 ? `${e}: ${r.join("; ")}` : e);
|
|
@@ -19,7 +19,7 @@ class m extends Error {
|
|
|
19
19
|
this.name = "BootstrapError", this.issues = r, this.cause = n?.cause;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
const x = (s) => s === null ? "null" : Array.isArray(s) ? "array" : typeof s,
|
|
22
|
+
const x = (s) => s === null ? "null" : Array.isArray(s) ? "array" : typeof s, j = (s) => typeof s == "object" && s !== null && !Array.isArray(s);
|
|
23
23
|
var a, c, p, d, u, g;
|
|
24
24
|
const b = class b {
|
|
25
25
|
/** @internal use the `fields` passed to `extend`. */
|
|
@@ -54,7 +54,7 @@ const b = class b {
|
|
|
54
54
|
/** A nested object, read with the same checks; issues are reported as `parent.child`. */
|
|
55
55
|
section(t) {
|
|
56
56
|
const e = o(this, a)[t];
|
|
57
|
-
return
|
|
57
|
+
return j(e) ? new b(e, `${o(this, c)}${t}.`, o(this, p)) : (this.fail(t, `expected object, got ${x(e)}`), new b({}, `${o(this, c)}${t}.`, o(this, p), !0));
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
a = new WeakMap(), c = new WeakMap(), p = new WeakMap(), d = new WeakMap(), u = new WeakSet(), g = function(t, e, r, n) {
|
|
@@ -63,7 +63,7 @@ a = new WeakMap(), c = new WeakMap(), p = new WeakMap(), d = new WeakMap(), u =
|
|
|
63
63
|
};
|
|
64
64
|
let A = b;
|
|
65
65
|
function P(s, t) {
|
|
66
|
-
if (!
|
|
66
|
+
if (!j(s))
|
|
67
67
|
throw new m("Invalid bootstrap config", [`expected a JSON object, got ${x(s)}`]);
|
|
68
68
|
const e = [], r = new A(s, "", e), n = r.string("locale");
|
|
69
69
|
n === "" && r.fail("locale", "must not be empty");
|
|
@@ -87,8 +87,8 @@ function L(s = {}) {
|
|
|
87
87
|
let y;
|
|
88
88
|
try {
|
|
89
89
|
y = JSON.parse(i);
|
|
90
|
-
} catch (
|
|
91
|
-
throw new m(`Bootstrap config in ${n} is not valid JSON`, [], { cause:
|
|
90
|
+
} catch (B) {
|
|
91
|
+
throw new m(`Bootstrap config in ${n} is not valid JSON`, [], { cause: B });
|
|
92
92
|
}
|
|
93
93
|
return P(y, e);
|
|
94
94
|
}
|
|
@@ -100,25 +100,26 @@ function M() {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
st as AccessGate,
|
|
104
104
|
m as BootstrapError,
|
|
105
105
|
A as BootstrapFields,
|
|
106
|
-
|
|
106
|
+
X as MissingContextError,
|
|
107
107
|
F as beforeSignOutTimeout,
|
|
108
108
|
G as createAccessClient,
|
|
109
109
|
K as createPlatform,
|
|
110
110
|
U as createSession,
|
|
111
|
-
|
|
111
|
+
Y as defineFeatureContext,
|
|
112
112
|
_ as heldSession,
|
|
113
113
|
z as httpSessionAdapter,
|
|
114
114
|
D as installPlatform,
|
|
115
|
-
|
|
115
|
+
k as mergePatch,
|
|
116
116
|
P as parseBootstrap,
|
|
117
117
|
H as parseNavigation,
|
|
118
118
|
Q as parseSessionPayload,
|
|
119
119
|
R as platformKey,
|
|
120
|
-
|
|
120
|
+
tt as preferencesOf,
|
|
121
121
|
L as readBootstrap,
|
|
122
|
+
V as useAccess,
|
|
122
123
|
v as usePlatform,
|
|
123
124
|
M as useSessionUser
|
|
124
125
|
};
|
|
@@ -2,7 +2,7 @@ import type { App, InjectionKey } from "vue";
|
|
|
2
2
|
import { type HttpClient, type HttpClientOptions, type Transport } from "../client";
|
|
3
3
|
import { type AccessClient, type AccessClientOptions } from "./access";
|
|
4
4
|
import type { BootstrapConfig } from "./bootstrap";
|
|
5
|
-
import type { RegisteredConfig, RegisteredUser } from "./index";
|
|
5
|
+
import type { Permission, RegisteredConfig, RegisteredUser } from "./index";
|
|
6
6
|
import { type BeforeSignOutHook, type Session, type SessionAdapter, type SessionUser } from "./session";
|
|
7
7
|
/**
|
|
8
8
|
* One application's shared services. Everything in it belongs to this instance alone. Bare `Platform` is the
|
|
@@ -13,7 +13,7 @@ export interface Platform<U extends SessionUser = RegisteredUser, C extends Boot
|
|
|
13
13
|
readonly http: HttpClient;
|
|
14
14
|
readonly session: Session<U>;
|
|
15
15
|
/** Reads the session's access; empty until the session is restored or established. */
|
|
16
|
-
readonly access: AccessClient
|
|
16
|
+
readonly access: AccessClient<Permission>;
|
|
17
17
|
}
|
|
18
18
|
export interface PlatformOptions<U extends SessionUser, C extends BootstrapConfig> extends AccessClientOptions {
|
|
19
19
|
/** The validated bootstrap config (`readBootstrap()`); its `apiBase` prefixes every request. */
|
|
@@ -65,4 +65,6 @@ export declare function createPlatform<U extends SessionUser, C extends Bootstra
|
|
|
65
65
|
}): Platform<U, C>;
|
|
66
66
|
export declare const platformKey: InjectionKey<Platform>;
|
|
67
67
|
export declare const usePlatform: () => Platform;
|
|
68
|
+
/** What the signed-in user may do: the platform's access client, typed to the registered permissions. */
|
|
69
|
+
export declare const useAccess: () => AccessClient<Permission>;
|
|
68
70
|
export declare function installPlatform(app: App, platform: Platform): void;
|