@wssto2/vue-core 0.12.0 → 0.13.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.
Files changed (122) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +4 -2
  3. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-CzQbD2Pc.js → AccessGate.vue_vue_type_script_setup_true_lang-DEzXovsY.js} +1 -1
  4. package/dist/{Activity-CdkJW68R.js → Activity-ChfxdvXf.js} +24 -23
  5. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-lPj9hPqV.js} +33 -33
  6. package/dist/{Changes-DxK_QfiB.js → Changes-BCa43_mO.js} +18 -17
  7. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js → CollectionPage.vue_vue_type_script_setup_true_lang-C1GCvyZx.js} +6 -6
  8. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-C_ZytnW-.js → DataTable.vue_vue_type_script_setup_true_lang-B9r9M5Gt.js} +1 -1
  9. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CeNwBbJT.js → DateField.vue_vue_type_script_setup_true_lang-B5UUY1OO.js} +2 -2
  10. package/dist/{DeadLetters-DnA7LP1w.js → DeadLetters-wFTqhISU.js} +5 -5
  11. package/dist/{General-2matxl2Y.js → General-jW7u4MjH.js} +16 -15
  12. package/dist/{IncidentRecord-Bt3G4HlX.js → IncidentRecord-CXzgLKqI.js} +6 -6
  13. package/dist/{IncidentsList-2iwgqp9J.js → IncidentsList-D1MySyXb.js} +6 -6
  14. package/dist/{NewRolePage-DhGFwvk3.js → NewRolePage-CQ5UVaHs.js} +3 -3
  15. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-B3UrXNqH.js → NumberField.vue_vue_type_script_setup_true_lang-YVgf5CP6.js} +1 -1
  16. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-DbGZSNQc.js → PersonAccess.vue_vue_type_script_setup_true_lang-CWCt9_dM.js} +2 -2
  17. package/dist/{ProfilePage-CpuyDBAv.js → ProfilePage-Ca3x3UAH.js} +79 -77
  18. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DqGc3Jyo.js → RecordHeader.vue_vue_type_script_setup_true_lang-Do_ATJwT.js} +1 -1
  19. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js → ResourcePage.vue_vue_type_script_setup_true_lang-Coz91xht.js} +1 -1
  20. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-C0FIotFA.js → RoleEditor.vue_vue_type_script_setup_true_lang-d_aaeXTT.js} +2 -2
  21. package/dist/{RolePage-DaNv049g.js → RolePage-BUj1w1m1.js} +5 -5
  22. package/dist/{RolesPage-6hlzJes_.js → RolesPage-NKzBUsrM.js} +3 -3
  23. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DfKEhTFv.js} +2 -2
  24. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-FJbWxME_.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-4nbhEpv_.js} +10 -9
  25. package/dist/{ServiceAccountRecord-0-JF5lRx.js → ServiceAccountRecord-ClbyeLhL.js} +8 -8
  26. package/dist/{ServiceAccountsList-DcsnOcf-.js → ServiceAccountsList-B2VDnYxD.js} +5 -5
  27. package/dist/{Sessions-DgWhpk-i.js → Sessions-BjkciyHH.js} +23 -21
  28. package/dist/{SettingsPage-BXPWATYU.js → SettingsPage-Csb14qsx.js} +7 -7
  29. package/dist/{SignIn-DPoUwHZd.js → SignIn-DPFMv4C7.js} +14 -12
  30. package/dist/{SignInPage-OyrVemro.js → SignInPage-DukoFqkt.js} +2 -2
  31. package/dist/{SignIns-BMDrZVVp.js → SignIns-DvdpNkiS.js} +23 -22
  32. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-D-Em4glH.js → TimeField.vue_vue_type_script_setup_true_lang-DpDXHH7u.js} +2 -2
  33. package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-ClZAAUMd.js → Timestamp.vue_vue_type_script_setup_true_lang-DlEUKWra.js} +1 -1
  34. package/dist/{UserRecord-BW-gdCqi.js → UserRecord-B9SeSWQh.js} +57 -55
  35. package/dist/{UsersList-B3ZF_1Dj.js → UsersList-CREG8q3l.js} +4 -4
  36. package/dist/access/index.js +4 -4
  37. package/dist/app/application.d.ts +14 -6
  38. package/dist/app/current.d.ts +11 -0
  39. package/dist/app/environment.d.ts +8 -0
  40. package/dist/app/index.d.ts +1 -0
  41. package/dist/app/index.js +14 -12
  42. package/dist/application-DomS6sbx.js +435 -0
  43. package/dist/collection/http.d.ts +16 -1
  44. package/dist/collection/index.d.ts +1 -1
  45. package/dist/collection/index.js +34 -32
  46. package/dist/content/Money.vue.d.ts +1 -1
  47. package/dist/content/index.js +151 -158
  48. package/dist/{contributions-CeG4bszd.js → contributions-obnyn03x.js} +1 -1
  49. package/dist/current-B0lHKTWr.js +17 -0
  50. package/dist/form/DateField.vue.d.ts +2 -2
  51. package/dist/form/DateTimeField.vue.d.ts +2 -2
  52. package/dist/form/MoneyField.vue.d.ts +1 -1
  53. package/dist/form/NumberField.vue.d.ts +1 -1
  54. package/dist/form/date/MonthYearPanel.vue.d.ts +1 -1
  55. package/dist/form/date/days.d.ts +3 -3
  56. package/dist/form/index.d.ts +2 -0
  57. package/dist/form/index.js +1111 -1081
  58. package/dist/form/zodErrorMap.d.ts +35 -0
  59. package/dist/format/format.d.ts +51 -6
  60. package/dist/format/index.d.ts +1 -1
  61. package/dist/format/index.js +1 -1
  62. package/dist/format-DoKs29bZ.js +118 -0
  63. package/dist/{guards-Biv_SlGn.js → guards-DGcSfTEh.js} +1 -1
  64. package/dist/http-DOEfFCDA.js +107 -0
  65. package/dist/i18n/index.js +15 -15
  66. package/dist/identity/index.d.ts +2 -0
  67. package/dist/identity/index.js +43 -40
  68. package/dist/identity/usePreferences.d.ts +19 -0
  69. package/dist/incidents/clientErrorReporter.d.ts +2 -1
  70. package/dist/incidents/index.js +1 -1
  71. package/dist/{index-kEHY7hcG.js → index-CRxU_Wh2.js} +61 -61
  72. package/dist/{index-Cq9TuOqH.js → index-DZikGJ8L.js} +457 -511
  73. package/dist/{index-ClJeyW3F.js → index-D_yyd4C2.js} +4 -4
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/internal/intlLocale.d.ts +5 -2
  77. package/dist/modules/identity/entities.d.ts +7 -2
  78. package/dist/modules/identity/routes.d.ts +5 -2
  79. package/dist/modules/identity/schemas.d.ts +6 -2
  80. package/dist/{navigation-TnVFYRaX.js → navigation-CctcxT51.js} +1 -1
  81. package/dist/{neighbors-OyvGi233.js → neighbors-Csfan8Ho.js} +1 -1
  82. package/dist/notifications/index.js +1 -1
  83. package/dist/onboarding/Tip.vue.d.ts +41 -0
  84. package/dist/onboarding/index.d.ts +1 -0
  85. package/dist/onboarding/index.js +145 -0
  86. package/dist/onboarding/tips.d.ts +5 -0
  87. package/dist/page/index.js +3 -3
  88. package/dist/phone/index.js +74 -74
  89. package/dist/phone/phone.d.ts +3 -3
  90. package/dist/platform/httpSession.d.ts +1 -1
  91. package/dist/platform/index.d.ts +2 -0
  92. package/dist/platform/index.js +16 -13
  93. package/dist/platform/preferences.d.ts +35 -0
  94. package/dist/platform/session.d.ts +6 -1
  95. package/dist/platform-DtISOEt7.js +284 -0
  96. package/dist/playwright/session.d.ts +7 -11
  97. package/dist/preferences-hYhrw8Uy.js +91 -0
  98. package/dist/resource/index.d.ts +1 -0
  99. package/dist/resource/index.js +24 -8
  100. package/dist/resource/read.d.ts +16 -0
  101. package/dist/router/index.js +3 -3
  102. package/dist/{rowLayout-BsKEzEME.js → rowLayout-y1IB_h2r.js} +2 -2
  103. package/dist/{sections-CvUwZ-S1.js → sections-fkW_IJLc.js} +1 -1
  104. package/dist/{serverMessages-B6GHgi40.js → serverMessages-Ddghrewh.js} +1 -1
  105. package/dist/shell/darkMode.d.ts +13 -8
  106. package/dist/shell/index.js +396 -384
  107. package/dist/{state-6KSYsVw0.js → state-CXMexi0l.js} +1 -1
  108. package/dist/styles.css +1 -1
  109. package/dist/testing/app.d.ts +11 -0
  110. package/dist/testing/format.d.ts +4 -2
  111. package/dist/testing/index.d.ts +1 -1
  112. package/dist/testing/index.js +96 -89
  113. package/dist/testing/platform.d.ts +2 -0
  114. package/dist/usePreferences-B8LIZp_f.js +47 -0
  115. package/dist/{useTypedEntry-C_Bk4sI0.js → useTypedEntry-DKs8I1yP.js} +279 -280
  116. package/package.json +6 -2
  117. package/src/styles/components.css +17 -0
  118. package/dist/application-CuzT-0vW.js +0 -420
  119. package/dist/format-D8KUBmbS.js +0 -87
  120. package/dist/http-Dm0uXY9O.js +0 -95
  121. package/dist/intlLocale-CeRU44qJ.js +0 -4
  122. package/dist/platform-BQOX_Ntw.js +0 -283
@@ -0,0 +1,435 @@
1
+ var _e = Object.defineProperty;
2
+ var Ce = (e, n, o) => n in e ? _e(e, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[n] = o;
3
+ var ae = (e, n, o) => Ce(e, typeof n != "symbol" ? n + "" : n, o);
4
+ import { effectScope as V, watch as G, defineComponent as ye, openBlock as Fe, createElementBlock as Ie, createVNode as ne, unref as _, withCtx as ie, createTextVNode as Te, toDisplayString as Pe, shallowRef as qe, computed as De, h as ce, createApp as We } from "vue";
5
+ import { useI18n as Be, createI18n as He } from "vue-i18n";
6
+ import { createRouter as Ve, isNavigationFailure as Ge } from "vue-router";
7
+ import { i as Je } from "./leaveGuard-Cc8yeLxM.js";
8
+ import { c as ze, i as Qe, f as Ue } from "./format-DoKs29bZ.js";
9
+ import { coreMessages as le, createMessageRuntime as Xe } from "./i18n/index.js";
10
+ import { i as Ye, a as Ze } from "./Icon.vue_vue_type_script_lang-BhhsFYwp.js";
11
+ import { i as et, b as tt } from "./bottomDock-BZEiOPYZ.js";
12
+ import { i as st, p as ot } from "./chrome-nUcmVu8G.js";
13
+ import { i as rt, g as at } from "./platform-DtISOEt7.js";
14
+ import { c as nt, A as it, r as ue } from "./access-DmAceEo5.js";
15
+ import { c as ct, _ as lt } from "./NoAccess.vue_vue_type_script_setup_true_lang-BHzZtZ50.js";
16
+ import { i as ut } from "./guards-DGcSfTEh.js";
17
+ import { b as ft, c as dt, n as fe } from "./navigation-CctcxT51.js";
18
+ import { c as pt, s as de } from "./contributions-obnyn03x.js";
19
+ import { a as pe } from "./environment-Dva-SG8D.js";
20
+ import { b as me, c as he } from "./describeError-B-NMa--w.js";
21
+ import { b as mt } from "./current-B0lHKTWr.js";
22
+ import { _ as ht } from "./Button.vue_vue_type_script_setup_true_lang-C74hcb0N.js";
23
+ import { _ as gt } from "./EmptyState.vue_vue_type_script_setup_true_lang-DbZiO2RF.js";
24
+ import { i as wt } from "./feature-DdUAfyi4.js";
25
+ function vt(e) {
26
+ const { platform: n } = e, o = V();
27
+ let i = null, v = null, b = !1;
28
+ function S(l, m) {
29
+ const h = new AbortController(), u = { controller: h, stops: [] };
30
+ for (const R of l)
31
+ try {
32
+ const E = m(R, h.signal);
33
+ typeof E == "function" && u.stops.push({ owned: R, stop: E });
34
+ } catch (E) {
35
+ e.onError(E, R);
36
+ }
37
+ return u;
38
+ }
39
+ function M(l) {
40
+ if (l) {
41
+ l.controller.abort();
42
+ for (const { owned: m, stop: h } of l.stops.reverse())
43
+ try {
44
+ h();
45
+ } catch (u) {
46
+ e.onError(u, m);
47
+ }
48
+ }
49
+ }
50
+ const A = (l) => e.effects.filter((m) => m.effect.scope === l), L = (l) => l.status !== "authenticated" ? null : e.sessionKey ? e.sessionKey(l) : String(l.user.id);
51
+ return {
52
+ start() {
53
+ if (b || i) return;
54
+ i = S(
55
+ A("app"),
56
+ (m, h) => m.effect.start({ signal: h, platform: n, report: (u) => e.onError(u, m) })
57
+ );
58
+ const l = A("session");
59
+ o.run(
60
+ () => G(
61
+ () => L(n.session.state.value),
62
+ (m) => {
63
+ M(v), v = null;
64
+ const h = n.session.state.value;
65
+ m === null || h.status !== "authenticated" || (v = S(
66
+ l,
67
+ (u, R) => u.effect.start({ signal: R, platform: n, user: h.user, report: (E) => e.onError(E, u) })
68
+ ));
69
+ },
70
+ { immediate: !0, flush: "sync" }
71
+ )
72
+ );
73
+ },
74
+ dispose() {
75
+ b || (b = !0, o.stop(), M(v), M(i), v = i = null);
76
+ }
77
+ };
78
+ }
79
+ const yt = { class: "mx-auto flex min-h-screen max-w-content items-center justify-center p-screen-padding" }, bt = /* @__PURE__ */ ye({
80
+ __name: "StartupFailure",
81
+ props: {
82
+ kind: {}
83
+ },
84
+ emits: ["retry"],
85
+ setup(e) {
86
+ const { t: n } = Be();
87
+ return (o, i) => (Fe(), Ie("div", yt, [
88
+ ne(_(gt), {
89
+ title: _(n)("core.startup.title"),
90
+ description: _(n)(e.kind === "startup" ? "core.startup.other" : `core.startup.${e.kind}`),
91
+ icon: "errorWarningLine"
92
+ }, {
93
+ actions: ie(() => [
94
+ ne(_(ht), {
95
+ prominence: "primary",
96
+ icon: "refreshLine",
97
+ onClick: i[0] || (i[0] = (v) => o.$emit("retry"))
98
+ }, {
99
+ default: ie(() => [
100
+ Te(Pe(_(n)("core.actions.retry")), 1)
101
+ ]),
102
+ _: 1
103
+ })
104
+ ]),
105
+ _: 1
106
+ }, 8, ["title", "description"])
107
+ ]));
108
+ }
109
+ });
110
+ class ge extends Error {
111
+ constructor(o) {
112
+ super(`The application composition is invalid:
113
+ ${o.map((i) => ` - [${i.owner}] ${i.message}`).join(`
114
+ `)}`);
115
+ ae(this, "issues");
116
+ this.name = "ApplicationError", this.issues = o;
117
+ }
118
+ }
119
+ const we = "application", w = (e) => `feature "${e.id}"`;
120
+ function* J(e, n = "") {
121
+ for (const o of e) {
122
+ const i = o.path.startsWith("/") ? o.path : `${n.replace(/\/$/, "")}/${o.path}`;
123
+ yield { record: o, path: i }, o.children && (yield* J(o.children, i));
124
+ }
125
+ }
126
+ function $t(e) {
127
+ const n = [], o = (s, r) => n.push({ owner: s, message: r }), i = [];
128
+ e.features.forEach((s, r) => {
129
+ wt(s) ? i.push(s) : o(we, `features[${r}] was not created with defineFeature().`);
130
+ });
131
+ const v = /* @__PURE__ */ new Map();
132
+ for (const s of i)
133
+ v.has(s.id) ? o(w(s), `the feature id "${s.id}" is used twice in the features list.`) : v.set(s.id, s);
134
+ for (const s of i)
135
+ for (const r of s.requires)
136
+ v.has(r) || o(w(s), `requires the feature "${r}", which is not in the features list.`);
137
+ const b = [], S = /* @__PURE__ */ new Set(), M = (s) => {
138
+ if (S.has(s.id)) return;
139
+ const r = b.indexOf(s.id);
140
+ if (r !== -1) {
141
+ o(w(s), `requirements form a cycle: ${[...b.slice(r), s.id].join(" -> ")}.`), S.add(s.id);
142
+ return;
143
+ }
144
+ b.push(s.id);
145
+ for (const c of s.requires) {
146
+ const f = v.get(c);
147
+ f && M(f);
148
+ }
149
+ b.pop(), S.add(s.id);
150
+ };
151
+ i.forEach(M);
152
+ const A = new Set(e.platform.config.capabilities);
153
+ for (const s of i)
154
+ for (const r of s.backend)
155
+ A.has(r) || o(w(s), `needs the backend capability "${r}", which the server does not report.`);
156
+ const L = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
157
+ for (const s of i) {
158
+ for (const r of s.routes) {
159
+ const c = r.path.length > 1 ? r.path.replace(/\/$/, "") : r.path, f = l.get(c);
160
+ f ? o(w(s), `declares the path "${r.path}", which feature "${f.id}" declares too.`) : l.set(c, s);
161
+ }
162
+ for (const { record: r } of J(s.routes)) {
163
+ if (r.meta && "feature" in r.meta && o(w(s), `the route "${String(r.name ?? r.path)}" sets meta.feature, which the runtime owns.`), typeof r.name != "string") continue;
164
+ const c = L.get(r.name);
165
+ c ? o(w(s), `declares the route name "${r.name}", which feature "${c.id}" declares too.`) : L.set(r.name, s);
166
+ }
167
+ }
168
+ const m = new Set(e.reservedContexts), h = /* @__PURE__ */ new Map();
169
+ for (const s of i)
170
+ for (const { key: r } of s.contexts) {
171
+ const c = r.description ?? "a context";
172
+ m.has(r) && o(w(s), `provides the context "${c}", which the runtime provides itself.`);
173
+ const f = h.get(r);
174
+ f ? o(w(s), `provides the context "${c}", which feature "${f.id}" provides too.`) : h.set(r, s);
175
+ }
176
+ const u = /* @__PURE__ */ new Map(), R = (s, r) => {
177
+ for (const c of r) {
178
+ const f = u.get(c.namespace);
179
+ f ? o(s, `declares the message namespace "${c.namespace}", which ${f} declares too.`) : u.set(c.namespace, s);
180
+ for (const k of Object.keys(c.loaders))
181
+ e.supportedLocales.includes(k) || o(s, `the namespace "${c.namespace}" has a loader for "${k}", which is not a supported locale (${e.supportedLocales.join(", ")}).`);
182
+ }
183
+ };
184
+ for (const s of i) R(w(s), s.messages);
185
+ R(we, e.messages);
186
+ const E = (s) => u.has(s);
187
+ for (const s of i)
188
+ for (const { record: r } of J(s.routes))
189
+ for (const c of r.meta?.messages ?? [])
190
+ E(c) || o(w(s), `the route "${String(r.name ?? r.path)}" needs the message namespace "${c}", which nobody declares.`);
191
+ const C = /* @__PURE__ */ new Map();
192
+ for (const s of i)
193
+ for (const r of s.contributions) {
194
+ const c = C.get(r.id);
195
+ c ? o(w(s), `declares the shell contribution "${r.id}", which feature "${c.id}" declares too.`) : C.set(r.id, s), e.shellSlots && !r.optional && !e.shellSlots.includes(r.slot) && o(w(s), `contributes "${r.id}" to the slot "${r.slot}", which the shell does not render (it renders ${e.shellSlots.join(", ") || "none"}). Mark it optional to leave it out instead.`);
196
+ for (const f of r.messages ?? [])
197
+ E(f) || o(w(s), `the contribution "${r.id}" needs the message namespace "${f}", which nobody declares.`);
198
+ }
199
+ const F = /* @__PURE__ */ new Map();
200
+ for (const s of i)
201
+ for (const r of s.effects) {
202
+ const c = F.get(r.id);
203
+ c ? o(w(s), `declares the effect "${r.id}", which feature "${c.id}" declares too.`) : F.set(r.id, s);
204
+ const f = r.scope;
205
+ f !== "app" && f !== "session" && o(w(s), `the effect "${r.id}" has the scope "${f}"; use "app" or "session".`);
206
+ }
207
+ return { features: i, issues: n };
208
+ }
209
+ const Et = (e, n, o) => He({
210
+ legacy: !1,
211
+ locale: e,
212
+ fallbackLocale: n,
213
+ pluralRules: o?.pluralRules && { ...o.pluralRules },
214
+ ...o?.missingWarn === !1 && { missingWarn: !1, fallbackWarn: !1 },
215
+ messages: {}
216
+ }), kt = (e) => typeof e == "object" && e !== null && "component" in e && "slots" in e;
217
+ function be(e, n) {
218
+ return e.map((o) => ({
219
+ ...o,
220
+ meta: { ...o.meta, feature: n },
221
+ ...o.children && { children: be(o.children, n) }
222
+ }));
223
+ }
224
+ const ve = (e) => [...new Set(e)];
225
+ function Qt(e) {
226
+ const { platform: n } = e, o = e.locale?.supported ?? Object.keys(le), i = e.locale?.fallback ?? "en", v = e.shell === void 0 ? void 0 : kt(e.shell) ? e.shell : { component: e.shell, slots: void 0, progress: void 0 }, b = [];
227
+ o.includes(i) || b.push({ owner: "application", message: `the fallback locale "${i}" is not among the supported locales (${o.join(", ")}).` });
228
+ for (const t of Object.keys(e.locale?.flags ?? {}))
229
+ o.includes(t) || b.push({ owner: "application", message: `locale.flags names the locale "${t}", which is not among the supported locales (${o.join(", ")}).` });
230
+ const S = e.locale?.initial ?? (o.includes(n.config.locale) ? n.config.locale : i);
231
+ o.includes(S) || b.push({ owner: "application", message: `the initial locale "${S}" is not among the supported locales (${o.join(", ")}).` });
232
+ const M = [at, Ue, ot, tt, Ze, fe, de, ue, pe, me, he], A = $t({
233
+ features: e.features,
234
+ platform: n,
235
+ messages: e.messages ?? [],
236
+ reservedContexts: M,
237
+ supportedLocales: o,
238
+ shellSlots: v?.slots
239
+ }), L = [...b, ...A.issues], l = A.features, m = ft(
240
+ l.flatMap((t) => t.navigation.map((a) => ({ feature: t.id, binding: a }))),
241
+ e.navigation
242
+ );
243
+ for (const t of m.issues) L.push({ owner: "navigation", message: t });
244
+ if (L.length > 0) throw new ge(L);
245
+ const h = Et(S, i, e.i18n), u = h.global;
246
+ for (const [t, a] of Object.entries(le)) u.mergeLocaleMessage(t, a);
247
+ for (const [t, a] of Object.entries(e.i18n?.messages ?? {})) u.mergeLocaleMessage(t, a);
248
+ const { currencySymbol: R, intlLocale: E, datePattern: C, numberSymbols: F, emptyNumber: s, ...r } = e.formatting ?? {}, c = ze({
249
+ locale: () => u.locale.value,
250
+ formatters: r,
251
+ currencySymbol: R,
252
+ intlLocale: E,
253
+ datePattern: C,
254
+ numberSymbols: F,
255
+ emptyNumber: s,
256
+ translate: (t) => u.t(t)
257
+ }), f = [...l.flatMap((t) => t.messages), ...e.messages ?? []], k = (t) => (e.onError ?? St)({ ...t, route: y.currentRoute.value.matched.length > 0 ? y.currentRoute.value.fullPath : null }), z = (t, a) => k({ source: "handled", error: t, detail: a?.detail }), O = Xe({
258
+ target: u,
259
+ namespaces: f,
260
+ fallback: i,
261
+ supported: o,
262
+ onFailure: (t) => k({ source: "messages", error: t.error, detail: `${t.namespace} (${t.locale})`, feature: $e.get(t.namespace) })
263
+ }), $e = new Map(l.flatMap((t) => t.messages.map((a) => [a.namespace, t.id]))), y = Ve({
264
+ history: e.router?.history ?? ct(),
265
+ routes: l.flatMap((t) => be(t.routes, t.id)),
266
+ scrollBehavior: e.router?.scrollBehavior ?? ((t, a) => t.name === a.name ? !1 : { top: 0 })
267
+ }), I = e.router?.login ?? { name: "login" }, Ee = e.router?.home ?? { path: "/" }, T = [], Q = (t) => {
268
+ try {
269
+ return y.resolve(t).matched.length > 0 ? null : "matches no route";
270
+ } catch (a) {
271
+ const p = a instanceof Error ? a.message : String(a);
272
+ return p.startsWith("No match for") ? "matches no route" : `cannot be resolved (${p})`;
273
+ }
274
+ };
275
+ if (l.some((t) => t.routes.some((a) => a.meta?.public !== !0))) {
276
+ const t = Q(I) ?? (y.resolve(I).meta.public === !0 ? null : "is not public (meta.public: true)");
277
+ t && T.push({ owner: "application", message: `the login route ${JSON.stringify(I)} ${t.replace("matches no route", "does not exist")}, but protected routes are installed: an anonymous visitor would have nowhere to go. Install a feature with the login route or set router.login.` });
278
+ }
279
+ for (const { feature: t, binding: a } of m.destinations.values()) {
280
+ const p = Q(a.to);
281
+ p && T.push({ owner: `feature "${t}"`, message: `the destination "${a.destination}" is bound to ${JSON.stringify(a.to)}, which ${p}.` });
282
+ }
283
+ if (T.length > 0) throw new ge(T);
284
+ const j = qe({ status: "idle" }), P = {
285
+ state: j,
286
+ locale: De(() => u.locale.value),
287
+ locales: o,
288
+ localeFlags: e.locale?.flags ?? {},
289
+ setLocale: async (t) => {
290
+ const a = u.locale.value, p = await O.setLocale(t);
291
+ if (p && u.locale.value !== a) {
292
+ const g = (K) => k({ source: "locale", error: K, detail: t });
293
+ try {
294
+ Promise.resolve(e.locale?.onChange?.(t)).catch(g);
295
+ } catch (K) {
296
+ g(K);
297
+ }
298
+ }
299
+ return p;
300
+ },
301
+ retry: () => H(),
302
+ report: z
303
+ }, D = {
304
+ contributions: l.flatMap((t) => t.contributions.map((a) => ({ feature: t.id, contribution: a }))),
305
+ effects: l.flatMap((t) => t.effects.map((a) => ({ feature: t.id, effect: a })))
306
+ }, U = vt({
307
+ effects: D.effects,
308
+ platform: n,
309
+ sessionKey: e.sessionKey,
310
+ onError: (t, a) => k({ source: "effect", error: t, feature: a.feature, detail: a.effect.id })
311
+ }), ke = new Map(l.map((t) => [t.id, t.messages.map((a) => a.namespace)])), X = (t) => ve(D.contributions.filter(({ contribution: a }) => a.scope === t).flatMap(({ contribution: a }) => a.messages ?? [])), Se = X("always"), Re = X("authenticated");
312
+ async function xe(t) {
313
+ const a = t.matched.flatMap((g) => [...ke.get(g.meta.feature ?? "") ?? [], ...g.meta.messages ?? []]), p = n.session.state.value.status === "authenticated";
314
+ await O.load(ve([...a, ...Se, ...p ? Re : []]));
315
+ }
316
+ let W = null;
317
+ function B(t) {
318
+ const a = t.meta.titleKey, p = W?.documentTitle.value ?? (a && u.te(a) ? u.t(a) : null), g = (e.router?.documentTitle ?? Rt)(p, n.config.appName);
319
+ g !== "" && (document.title = g);
320
+ }
321
+ const Me = dt({ session: n.session, router: y, i18n: u, destinations: m.destinations }), Le = pt(D.contributions, n.session), Ae = nt({ router: y, access: n.access, noAccess: e.noAccess ?? lt }), je = ye({
322
+ name: "ApplicationRoot",
323
+ setup() {
324
+ return () => {
325
+ const t = j.value;
326
+ return t.status === "failed" ? ce(bt, { kind: t.kind, onRetry: () => void H() }) : t.status !== "ready" ? null : ce(v?.component ?? it);
327
+ };
328
+ }
329
+ }), d = We(je);
330
+ rt(d, n), d.use(h), Qe(d, c), W = st(d), et(d), Je(d), e.icons && Ye(d, ...Array.isArray(e.icons) ? e.icons : [e.icons]), d.provide(pe, P), e.describeError && d.provide(me, e.describeError), e.describeFieldError && d.provide(he, e.describeFieldError), d.provide(fe, Me), d.provide(de, Le), d.provide(ue, Ae);
331
+ for (const t of l) for (const { key: a, value: p } of t.contexts) d.provide(a, p);
332
+ let x = !1, Y = !1, Z = !1, ee = !1;
333
+ const N = [];
334
+ function Ne() {
335
+ const t = d.config.errorHandler;
336
+ d.config.errorHandler = ($, Oe, re) => {
337
+ k({ source: "vue", error: $, detail: re }), t?.($, Oe, re);
338
+ };
339
+ const a = ($) => k({ source: "unhandledrejection", error: $.reason }), p = ($) => {
340
+ $.error && k({ source: "window", error: $.error });
341
+ };
342
+ window.addEventListener("unhandledrejection", a), window.addEventListener("error", p), N.push(() => {
343
+ window.removeEventListener("unhandledrejection", a), window.removeEventListener("error", p);
344
+ });
345
+ const g = l.some(($) => $.holdsExpiredSession);
346
+ n.session.holdExpired(g), N.push(() => n.session.holdExpired(!1)), N.push(
347
+ ut({
348
+ router: y,
349
+ session: n.session,
350
+ login: I,
351
+ home: Ee,
352
+ holdExpired: g,
353
+ prepare: xe,
354
+ afterNavigation: B,
355
+ progress: e.router?.progress ?? v?.progress,
356
+ onError: ($) => k({ source: "router", error: $ })
357
+ })
358
+ );
359
+ const K = V();
360
+ K.run(() => G(() => W?.documentTitle.value, () => B(y.currentRoute.value))), N.push(() => K.stop());
361
+ const oe = V();
362
+ oe.run(
363
+ () => G(
364
+ () => u.locale.value,
365
+ ($) => {
366
+ document.documentElement.lang = $, B(y.currentRoute.value);
367
+ },
368
+ { immediate: !0 }
369
+ )
370
+ ), N.push(() => oe.stop());
371
+ }
372
+ const q = (t, a) => {
373
+ j.value = { status: "failed", kind: t, error: a };
374
+ };
375
+ async function te() {
376
+ j.value = { status: "starting" };
377
+ const t = await n.session.restore();
378
+ if (x) return;
379
+ if (t.status === "failed") return q("session", t.error);
380
+ const a = t.status === "authenticated" ? t.user.locale : void 0;
381
+ if (typeof a == "string" && a !== u.locale.value && o.includes(a) && await P.setLocale(a), x) return;
382
+ const p = await O.loadEssential();
383
+ if (!x) {
384
+ if (p.length > 0) return q("messages", p[0].error);
385
+ try {
386
+ const g = await y.replace(y.options.history.location);
387
+ if (x) return;
388
+ if (Ge(g)) return q("startup", g);
389
+ } catch (g) {
390
+ x || q("startup", g);
391
+ return;
392
+ }
393
+ ee || (d.use(y), ee = !0), j.value = { status: "ready" }, U.start();
394
+ }
395
+ }
396
+ async function H() {
397
+ x || j.value.status !== "failed" || (await O.retry(), await te());
398
+ }
399
+ const se = {
400
+ app: d,
401
+ platform: n,
402
+ format: c,
403
+ router: y,
404
+ i18n: h,
405
+ state: j,
406
+ locale: P.locale,
407
+ setLocale: P.setLocale,
408
+ report: z,
409
+ async mount(t) {
410
+ if (x) throw new Error("This application was disposed; create a new one with createApplication().");
411
+ if (Y) throw new Error("This application is already mounted.");
412
+ Y = !0, Ne(), await te(), !x && (d.mount(t), Z = !0);
413
+ },
414
+ retry: H,
415
+ dispose() {
416
+ if (!x) {
417
+ x = !0, Ke(), U.dispose(), O.dispose(), Z && d.unmount();
418
+ for (const t of N.reverse()) t();
419
+ y.options.history.destroy();
420
+ }
421
+ }
422
+ }, Ke = mt(se);
423
+ return se;
424
+ }
425
+ function St(e) {
426
+ console.error(`[vue-core] ${e.source}${e.feature ? ` (${e.feature})` : ""}${e.detail ? `: ${e.detail}` : ""}`, e.error);
427
+ }
428
+ function Rt(e, n) {
429
+ return [e, n].filter((o) => !!o).join(" · ");
430
+ }
431
+ export {
432
+ ge as A,
433
+ Qt as c,
434
+ St as d
435
+ };
@@ -1,4 +1,4 @@
1
- import type { ApiResult, HttpClient, ListResult, PageMeta, QueryValue } from "../client";
1
+ import type { ApiResult, ApiRoute, HttpClient, ListResult, PageMeta, QueryValue } from "../client";
2
2
  import type { CollectionLoader, ListMeta, ListPage, CollectionQuery } from "./types";
3
3
  /**
4
4
  * The query parameters go-core's datatable reads: `page`, `per_page`, `order_col`, `order_dir`,
@@ -25,3 +25,18 @@ export declare function readListPage<Row, Meta extends ListMeta = ListMeta>(resu
25
25
  export declare function httpList<Row, Sort extends string = string, Filter extends string = string, View extends string = string, Meta extends ListMeta = ListMeta>(http: HttpClient, path: string, options?: {
26
26
  params?: (query: CollectionQuery<Sort, Filter, View>) => Record<string, QueryValue>;
27
27
  }): CollectionLoader<Row, Sort, Filter, View, Meta>;
28
+ /**
29
+ * `httpList` over the current application's client, read when the list loads: a definition declares it at module level, before the
30
+ * application exists (`createApplication` makes it later; `currentApplication`).
31
+ *
32
+ * export const tickets = defineCollection({ id: "tickets", stateVersion: 1, load: listLoader<Ticket>("/v1/tickets"), key: (row) => row.id });
33
+ */
34
+ export declare function listLoader<Row, Sort extends string = string, Filter extends string = string, View extends string = string, Meta extends ListMeta = ListMeta>(path: string, options?: {
35
+ params?: (query: CollectionQuery<Sort, Filter, View>) => Record<string, QueryValue>;
36
+ }): CollectionLoader<Row, Sort, Filter, View, Meta>;
37
+ /**
38
+ * `listLoader` over a typed route (`route.Page` in Go): the route asked through the current application's client with the collection's
39
+ * query. A route with path parameters takes them as `pathParams`. The list's filters and paging are the route's free-form query
40
+ * parameters. `Meta` is what the list's `meta` holds besides the library's own keys, so a page reads it without a cast.
41
+ */
42
+ export declare function routeListLoader<Row, Sort extends string = string, Filter extends string = string, View extends string = string, Meta extends ListMeta = ListMeta>(route: ApiRoute<object, readonly Row[]>, pathParams?: Readonly<Record<string, string | number>>): CollectionLoader<Row, Sort, Filter, View, Meta>;
@@ -3,7 +3,7 @@ export type { CollectionDefaults, CollectionDefinition, CollectionDefinitionInpu
3
3
  export { useCollection } from "./useCollection";
4
4
  export type { Collection, CollectionDisplay, LinkedQuery, SavedViewsHandle, UseCollectionOptions } from "./useCollection";
5
5
  export type { CollectionLoader, ListMeta, ListPage, CollectionQuery, CollectionStateSource, LoadContext, SortDirection } from "./types";
6
- export { httpList, listParams, readListPage } from "./http";
6
+ export { httpList, listLoader, listParams, readListPage, routeListLoader } from "./http";
7
7
  export { LIST_CONTEXT_PARAM } from "./location";
8
8
  export type { CollectionColumns, Column, ColumnKey, ColumnKind, ColumnValue, MobileRole, RowAction, SlotKey, TableColumns } from "./columns";
9
9
  export type { FilterDescriptor, FilterOption, ViewDescriptor } from "./filters";
@@ -1,17 +1,17 @@
1
- import { D as K, d as Q, h as W, l as Y, r as ee } from "../http-Dm0uXY9O.js";
2
- import { _ as se, a as oe, u as ie } from "../CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js";
3
- import { L as ne } from "../state-6KSYsVw0.js";
4
- import { a as re, u as ce } from "../neighbors-OyvGi233.js";
1
+ import { D as K, d as Q, h as W, l as Y, a as ee, r as te, b as se } from "../http-DOEfFCDA.js";
2
+ import { _ as ie, a as ae, u as ne } from "../CollectionPage.vue_vue_type_script_setup_true_lang-C1GCvyZx.js";
3
+ import { L as re } from "../state-CXMexi0l.js";
4
+ import { a as de, u as ue } from "../neighbors-Csfan8Ho.js";
5
5
  import { r as p } from "../route-goWMxDUN.js";
6
- import { b as ue, a as fe } from "../rowLayout-BsKEzEME.js";
7
- import { _ as me } from "../DataTable.vue_vue_type_script_setup_true_lang-C_ZytnW-.js";
8
- import { defineComponent as h, openBlock as c, createElementBlock as u, Fragment as P, renderList as E, createBlock as w, unref as d, withCtx as g, normalizeClass as v, createVNode as _, createCommentVNode as y, shallowRef as S, useTemplateRef as T, watch as D, renderSlot as R } from "vue";
6
+ import { b as pe, a as me } from "../rowLayout-y1IB_h2r.js";
7
+ import { _ as _e } from "../DataTable.vue_vue_type_script_setup_true_lang-B9r9M5Gt.js";
8
+ import { defineComponent as h, openBlock as c, createElementBlock as u, Fragment as P, renderList as E, createBlock as w, unref as d, withCtx as g, normalizeClass as v, createVNode as _, createCommentVNode as y, shallowRef as S, useTemplateRef as T, watch as L, renderSlot as D } from "vue";
9
9
  import { _ as b } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
10
- import { _ as z } from "../Tooltip.vue_vue_type_script_setup_true_lang-Dtg5Y6pf.js";
11
- import { D as _e, u as be } from "../datePresets-DB13HHHd.js";
12
- import { _ as xe, h as he } from "../Highlight.vue_vue_type_script_setup_true_lang-DZGBmwcX.js";
13
- import { useI18n as A } from "vue-i18n";
14
- import { _ as L } from "../Modal.vue_vue_type_script_setup_true_lang-DDS0iEnn.js";
10
+ import { _ as R } from "../Tooltip.vue_vue_type_script_setup_true_lang-Dtg5Y6pf.js";
11
+ import { D as ke, u as xe } from "../datePresets-DB13HHHd.js";
12
+ import { _ as we, h as ge } from "../Highlight.vue_vue_type_script_setup_true_lang-DZGBmwcX.js";
13
+ import { useI18n as z } from "vue-i18n";
14
+ import { _ as A } from "../Modal.vue_vue_type_script_setup_true_lang-DDS0iEnn.js";
15
15
  const m = {
16
16
  index: p("GET", "/v1/saved-views"),
17
17
  store: p("POST", "/v1/saved-views"),
@@ -65,7 +65,7 @@ const $ = {
65
65
  setup(a) {
66
66
  const e = a, i = (o) => o.tone === "critical" ? "text-status-danger-content hover:bg-status-danger-surface" : "text-content-link hover:bg-tint-soft";
67
67
  return (o, s) => e.actions.length > 0 ? (c(), u("div", $, [
68
- (c(!0), u(P, null, E(e.actions, (t) => (c(), w(d(z), {
68
+ (c(!0), u(P, null, E(e.actions, (t) => (c(), w(d(R), {
69
69
  key: t.key,
70
70
  text: t.label,
71
71
  side: "left"
@@ -131,15 +131,15 @@ const J = /* @__PURE__ */ h({
131
131
  size: { default: "lg" }
132
132
  },
133
133
  setup(a) {
134
- const e = a, { t: i } = A(), o = T("modal");
134
+ const e = a, { t: i } = z(), o = T("modal");
135
135
  let s = !1, t = !1;
136
- D(() => e.picker.state.value.open, (n) => {
136
+ L(() => e.picker.state.value.open, (n) => {
137
137
  n ? (s = !0, o.value?.present()) : s && (t = !0, o.value?.dismiss());
138
138
  }, { flush: "post" });
139
139
  function l() {
140
140
  s = !1, t ? t = !1 : e.picker.cancel();
141
141
  }
142
- return (n, r) => (c(), w(d(L), {
142
+ return (n, r) => (c(), w(d(A), {
143
143
  ref_key: "modal",
144
144
  ref: o,
145
145
  title: e.picker.state.value.options?.title ?? e.title ?? d(i)("core.collection.pick_label"),
@@ -149,7 +149,7 @@ const J = /* @__PURE__ */ h({
149
149
  onDismissed: l
150
150
  }, {
151
151
  default: g(() => [
152
- e.picker.state.value.options ? R(n.$slots, "default", {
152
+ e.picker.state.value.options ? D(n.$slots, "default", {
153
153
  options: e.picker.state.value.options,
154
154
  select: e.picker.select
155
155
  }, void 0, void 0, 0) : y("", !0)
@@ -159,27 +159,29 @@ const J = /* @__PURE__ */ h({
159
159
  }
160
160
  });
161
161
  export {
162
- ue as CollectionCell,
163
- se as CollectionPage,
164
- oe as CollectionTable,
165
- _e as DATE_PRESETS,
162
+ pe as CollectionCell,
163
+ ie as CollectionPage,
164
+ ae as CollectionTable,
165
+ ke as DATE_PRESETS,
166
166
  K as DEFAULT_PAGE_SIZES,
167
- me as DataTable,
168
- xe as Highlight,
169
- ne as LIST_CONTEXT_PARAM,
167
+ _e as DataTable,
168
+ we as Highlight,
169
+ re as LIST_CONTEXT_PARAM,
170
170
  J as PickerModal,
171
- fe as RecordIdentity,
171
+ me as RecordIdentity,
172
172
  U as RowActions,
173
173
  G as createMemorySavedViews,
174
174
  H as createPicker,
175
175
  Q as defineCollection,
176
- he as highlightParts,
176
+ ge as highlightParts,
177
177
  W as httpList,
178
- Y as listParams,
179
- ee as readListPage,
178
+ Y as listLoader,
179
+ ee as listParams,
180
+ te as readListPage,
181
+ se as routeListLoader,
180
182
  j as serverSavedViews,
181
- ie as useCollection,
182
- re as useCollectionBack,
183
- ce as useCollectionNeighbors,
184
- be as useDatePresetFilter
183
+ ne as useCollection,
184
+ de as useCollectionBack,
185
+ ue as useCollectionNeighbors,
186
+ xe as useDatePresetFilter
185
187
  };
@@ -23,8 +23,8 @@ type __VLS_Props = {
23
23
  };
24
24
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
25
25
  symbol: boolean;
26
- decimals: number;
27
26
  whole: boolean;
27
+ decimals: number;
28
28
  emptyZero: boolean;
29
29
  signed: boolean;
30
30
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;