@wssto2/vue-core 0.16.0 → 0.18.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 +5 -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-DOUuIkZR.js → Activity-CiYn5E6A.js} +7 -7
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-d_dPurWG.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js} +1 -1
- package/dist/{Changes-BfcbVgmu.js → Changes-Cy8STpLX.js} +3 -3
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-B5hSkJ2N.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-CuMvfXH8.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-B5vcSEhP.js → General-CwTPC5UP.js} +10 -10
- package/dist/{IncidentRecord-wmStcEag.js → IncidentRecord-hXEGuLGg.js} +13 -13
- package/dist/{IncidentsList-CFx5tsxP.js → IncidentsList-C41VyDwK.js} +6 -6
- package/dist/{NewRolePage-CZxAp7LR.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-B-T8kBcc.js → ProfilePage-DGEsIycR.js} +13 -13
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-Bt5mT19g.js → RecordHeader.vue_vue_type_script_setup_true_lang-B3BnYg1x.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-DOiFuJnH.js → ResourcePage.vue_vue_type_script_setup_true_lang-1iZtj3rh.js} +1 -1
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CqSsNPCw.js → RoleEditor.vue_vue_type_script_setup_true_lang-BslSDDiM.js} +9 -9
- package/dist/{RolePage-zcUWpuDE.js → RolePage-C08ZUqw1.js} +9 -9
- package/dist/{RolesPage-C7_zWw-c.js → RolesPage-FOuY1VKg.js} +10 -10
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BlCx9dVL.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-C2D_D5Hi.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CDr4WNIb.js} +9 -9
- package/dist/{ServiceAccountRecord-BYxpHzTR.js → ServiceAccountRecord-kWwIQGZb.js} +12 -12
- package/dist/{ServiceAccountsList-BUuK-RUj.js → ServiceAccountsList-CKy9_YHP.js} +8 -8
- package/dist/{Sessions-Cm-Kilwl.js → Sessions-BDc8gdYH.js} +4 -4
- package/dist/{SettingsPage-Bavl0K-F.js → SettingsPage-t-8kmFVT.js} +13 -13
- package/dist/{SignIn-SfEhFiyM.js → SignIn-CqtkvtCZ.js} +7 -7
- package/dist/{SignInPage-BU0n2ehq.js → SignInPage-DcdNKZIb.js} +4 -4
- package/dist/{SignIns-Ahbn5cO6.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-3pCKMHkq.js → UserRecord-CwZCr9Im.js} +10 -10
- package/dist/{UsersList-vw3aDpvo.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-CHPpOssP.js → application-CDSweJb9.js} +144 -142
- package/dist/collection/DynamicCollection.vue.d.ts +69 -0
- package/dist/collection/authors.d.ts +27 -0
- package/dist/collection/definition.d.ts +4 -4
- package/dist/collection/dynamicColumns.d.ts +13 -0
- package/dist/collection/index.d.ts +3 -0
- package/dist/collection/index.js +196 -142
- 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/dynamic/DynamicForm.vue.d.ts +46 -0
- package/dist/form/dynamic/RepeatField.vue.d.ts +47 -0
- package/dist/form/dynamic/ResourceField.vue.d.ts +38 -0
- package/dist/form/dynamic/ResourcePickerList.vue.d.ts +12 -0
- package/dist/form/dynamic/RichTextField.vue.d.ts +40 -0
- package/dist/form/dynamic/localeMode.d.ts +5 -0
- package/dist/form/dynamic/resources.d.ts +34 -0
- package/dist/form/dynamic/schema.d.ts +73 -0
- package/dist/form/dynamic/validator.d.ts +30 -0
- package/dist/form/dynamic/visibility.d.ts +12 -0
- package/dist/form/index.d.ts +12 -0
- package/dist/form/index.js +2100 -1260
- 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 +86 -75
- 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-D9_xqF5g.js → index-1HS7O2-e.js} +9 -9
- package/dist/{index-nByFc1eL.js → index-BA2w8uwD.js} +86 -86
- package/dist/{index-Ct7W_gYE.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-BpypL3Wb.js → neighbors-Dg_LU9ry.js} +1 -1
- 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/index.js +3 -3
- 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/resources-BZLlAtoS.js +62 -0
- package/dist/router/index.js +3 -3
- package/dist/{rowLayout-QKfNHsML.js → rowLayout-PIuD7MGo.js} +2 -2
- package/dist/{sections-CSpJN0Z7.js → sections-BpiRLntE.js} +1 -1
- package/dist/{serverMessages-Ce8-MK4e.js → serverMessages-C_KkDvpT.js} +1 -1
- package/dist/shell/index.js +4 -4
- 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/{useTypedEntry-CITij2C_.js → useTypedEntry-BsMV66Yc.js} +46 -45
- package/package.json +6 -1
- package/dist/format-Cp1h0vsC.js +0 -125
- package/dist/options-B48UiYsG.js +0 -368
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var ae = (e, n, o) =>
|
|
4
|
-
import { effectScope as V, watch as G, defineComponent as ye, openBlock as
|
|
1
|
+
var Oe = Object.defineProperty;
|
|
2
|
+
var _e = (e, n, o) => n in e ? Oe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[n] = o;
|
|
3
|
+
var ae = (e, n, o) => _e(e, typeof n != "symbol" ? n + "" : n, o);
|
|
4
|
+
import { effectScope as V, watch as G, defineComponent as ye, openBlock as Ce, createElementBlock as Ie, createVNode as ne, unref as O, withCtx as ie, createTextVNode as Te, toDisplayString as Pe, shallowRef as qe, computed as De, h as ce, createApp as We } from "vue";
|
|
5
5
|
import { useI18n as Be, createI18n as He } from "vue-i18n";
|
|
6
6
|
import { createRouter as Ve, isNavigationFailure as Ge } from "vue-router";
|
|
7
7
|
import { i as Je } from "./leaveGuard-Cc8yeLxM.js";
|
|
8
|
-
import { c as ze, i as Qe, f as Ue } from "./format-
|
|
9
|
-
import { coreMessages as le, createMessageRuntime as
|
|
10
|
-
import { i as
|
|
11
|
-
import { i as
|
|
12
|
-
import { i as
|
|
13
|
-
import { i as
|
|
14
|
-
import { c as
|
|
15
|
-
import { c as
|
|
16
|
-
import { i as
|
|
17
|
-
import { b as
|
|
18
|
-
import { c as
|
|
8
|
+
import { c as ze, i as Qe, f as Ue } from "./format-C_HXlOYQ.js";
|
|
9
|
+
import { messageLoaders as Xe, coreMessages as le, createMessageRuntime as Ye } from "./i18n/index.js";
|
|
10
|
+
import { i as Ze, a as et } from "./Icon.vue_vue_type_script_lang-BhhsFYwp.js";
|
|
11
|
+
import { i as tt, b as st } from "./bottomDock-BZEiOPYZ.js";
|
|
12
|
+
import { i as ot, p as rt } from "./chrome-kMBKIB1N.js";
|
|
13
|
+
import { i as at, g as nt } from "./platform-DU9QFts8.js";
|
|
14
|
+
import { c as it, A as ct, r as ue } from "./access-DmAceEo5.js";
|
|
15
|
+
import { c as lt, _ as ut } from "./NoAccess.vue_vue_type_script_setup_true_lang-BHzZtZ50.js";
|
|
16
|
+
import { i as ft } from "./guards-CNJ0ATVC.js";
|
|
17
|
+
import { b as dt, c as pt, n as fe } from "./navigation-d-JAPBGA.js";
|
|
18
|
+
import { c as mt, s as de } from "./contributions-B0x5x5xD.js";
|
|
19
19
|
import { a as pe } from "./environment-Dva-SG8D.js";
|
|
20
20
|
import { b as me, c as he } from "./describeError-B-NMa--w.js";
|
|
21
|
-
import { b as
|
|
22
|
-
import { _ as
|
|
23
|
-
import { _ as
|
|
24
|
-
import { i as
|
|
25
|
-
function
|
|
21
|
+
import { b as ht } from "./current-CslcEPXp.js";
|
|
22
|
+
import { _ as gt } from "./Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
|
|
23
|
+
import { _ as wt } from "./EmptyState.vue_vue_type_script_setup_true_lang-DbZiO2RF.js";
|
|
24
|
+
import { i as vt } from "./feature-DdUAfyi4.js";
|
|
25
|
+
function yt(e) {
|
|
26
26
|
const { platform: n } = e, o = V();
|
|
27
27
|
let i = null, v = null, b = !1;
|
|
28
28
|
function S(l, m) {
|
|
@@ -36,7 +36,7 @@ function vt(e) {
|
|
|
36
36
|
}
|
|
37
37
|
return u;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function L(l) {
|
|
40
40
|
if (l) {
|
|
41
41
|
l.controller.abort();
|
|
42
42
|
for (const { owned: m, stop: h } of l.stops.reverse())
|
|
@@ -47,7 +47,7 @@ function vt(e) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const A = (l) => e.effects.filter((m) => m.effect.scope === l),
|
|
50
|
+
const A = (l) => e.effects.filter((m) => m.effect.scope === l), M = (l) => l.status !== "authenticated" ? null : e.sessionKey ? e.sessionKey(l) : String(l.user.id);
|
|
51
51
|
return {
|
|
52
52
|
start() {
|
|
53
53
|
if (b || i) return;
|
|
@@ -58,9 +58,9 @@ function vt(e) {
|
|
|
58
58
|
const l = A("session");
|
|
59
59
|
o.run(
|
|
60
60
|
() => G(
|
|
61
|
-
() =>
|
|
61
|
+
() => M(n.session.state.value),
|
|
62
62
|
(m) => {
|
|
63
|
-
|
|
63
|
+
L(v), v = null;
|
|
64
64
|
const h = n.session.state.value;
|
|
65
65
|
m === null || h.status !== "authenticated" || (v = S(
|
|
66
66
|
l,
|
|
@@ -72,11 +72,11 @@ function vt(e) {
|
|
|
72
72
|
);
|
|
73
73
|
},
|
|
74
74
|
dispose() {
|
|
75
|
-
b || (b = !0, o.stop(),
|
|
75
|
+
b || (b = !0, o.stop(), L(v), L(i), v = i = null);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const bt = { class: "mx-auto flex min-h-screen max-w-content items-center justify-center p-screen-padding" }, $t = /* @__PURE__ */ ye({
|
|
80
80
|
__name: "StartupFailure",
|
|
81
81
|
props: {
|
|
82
82
|
kind: {}
|
|
@@ -84,20 +84,20 @@ const yt = { class: "mx-auto flex min-h-screen max-w-content items-center justif
|
|
|
84
84
|
emits: ["retry"],
|
|
85
85
|
setup(e) {
|
|
86
86
|
const { t: n } = Be();
|
|
87
|
-
return (o, i) => (
|
|
88
|
-
ne(
|
|
89
|
-
title:
|
|
90
|
-
description:
|
|
87
|
+
return (o, i) => (Ce(), Ie("div", bt, [
|
|
88
|
+
ne(O(wt), {
|
|
89
|
+
title: O(n)("core.startup.title"),
|
|
90
|
+
description: O(n)(e.kind === "startup" ? "core.startup.other" : `core.startup.${e.kind}`),
|
|
91
91
|
icon: "errorWarningLine"
|
|
92
92
|
}, {
|
|
93
93
|
actions: ie(() => [
|
|
94
|
-
ne(
|
|
94
|
+
ne(O(gt), {
|
|
95
95
|
prominence: "primary",
|
|
96
96
|
icon: "refreshLine",
|
|
97
97
|
onClick: i[0] || (i[0] = (v) => o.$emit("retry"))
|
|
98
98
|
}, {
|
|
99
99
|
default: ie(() => [
|
|
100
|
-
Te(Pe(
|
|
100
|
+
Te(Pe(O(n)("core.actions.retry")), 1)
|
|
101
101
|
]),
|
|
102
102
|
_: 1
|
|
103
103
|
})
|
|
@@ -123,61 +123,61 @@ function* J(e, n = "") {
|
|
|
123
123
|
yield { record: o, path: i }, o.children && (yield* J(o.children, i));
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
const n = [], o = (s,
|
|
128
|
-
e.features.forEach((s,
|
|
129
|
-
|
|
126
|
+
function Et(e) {
|
|
127
|
+
const n = [], o = (s, a) => n.push({ owner: s, message: a }), i = [];
|
|
128
|
+
e.features.forEach((s, a) => {
|
|
129
|
+
vt(s) ? i.push(s) : o(we, `features[${a}] was not created with defineFeature().`);
|
|
130
130
|
});
|
|
131
131
|
const v = /* @__PURE__ */ new Map();
|
|
132
132
|
for (const s of i)
|
|
133
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
134
|
for (const s of i)
|
|
135
|
-
for (const
|
|
136
|
-
v.has(
|
|
137
|
-
const b = [], S = /* @__PURE__ */ new Set(),
|
|
135
|
+
for (const a of s.requires)
|
|
136
|
+
v.has(a) || o(w(s), `requires the feature "${a}", which is not in the features list.`);
|
|
137
|
+
const b = [], S = /* @__PURE__ */ new Set(), L = (s) => {
|
|
138
138
|
if (S.has(s.id)) return;
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
o(w(s), `requirements form a cycle: ${[...b.slice(
|
|
139
|
+
const a = b.indexOf(s.id);
|
|
140
|
+
if (a !== -1) {
|
|
141
|
+
o(w(s), `requirements form a cycle: ${[...b.slice(a), s.id].join(" -> ")}.`), S.add(s.id);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
b.push(s.id);
|
|
145
145
|
for (const c of s.requires) {
|
|
146
146
|
const f = v.get(c);
|
|
147
|
-
f &&
|
|
147
|
+
f && L(f);
|
|
148
148
|
}
|
|
149
149
|
b.pop(), S.add(s.id);
|
|
150
150
|
};
|
|
151
|
-
i.forEach(
|
|
151
|
+
i.forEach(L);
|
|
152
152
|
const A = new Set(e.platform.config.capabilities);
|
|
153
153
|
for (const s of i)
|
|
154
|
-
for (const
|
|
155
|
-
A.has(
|
|
156
|
-
const
|
|
154
|
+
for (const a of s.backend)
|
|
155
|
+
A.has(a) || o(w(s), `needs the backend capability "${a}", which the server does not report.`);
|
|
156
|
+
const M = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
157
157
|
for (const s of i) {
|
|
158
|
-
for (const
|
|
159
|
-
const c =
|
|
160
|
-
f ? o(w(s), `declares the path "${
|
|
158
|
+
for (const a of s.routes) {
|
|
159
|
+
const c = a.path.length > 1 ? a.path.replace(/\/$/, "") : a.path, f = l.get(c);
|
|
160
|
+
f ? o(w(s), `declares the path "${a.path}", which feature "${f.id}" declares too.`) : l.set(c, s);
|
|
161
161
|
}
|
|
162
|
-
for (const { record:
|
|
163
|
-
if (
|
|
164
|
-
const c =
|
|
165
|
-
c ? o(w(s), `declares the route name "${
|
|
162
|
+
for (const { record: a } of J(s.routes)) {
|
|
163
|
+
if (a.meta && "feature" in a.meta && o(w(s), `the route "${String(a.name ?? a.path)}" sets meta.feature, which the runtime owns.`), typeof a.name != "string") continue;
|
|
164
|
+
const c = M.get(a.name);
|
|
165
|
+
c ? o(w(s), `declares the route name "${a.name}", which feature "${c.id}" declares too.`) : M.set(a.name, s);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
const m = new Set(e.reservedContexts), h = /* @__PURE__ */ new Map();
|
|
169
169
|
for (const s of i)
|
|
170
|
-
for (const { key:
|
|
171
|
-
const c =
|
|
172
|
-
m.has(
|
|
173
|
-
const f = h.get(
|
|
174
|
-
f ? o(w(s), `provides the context "${c}", which feature "${f.id}" provides too.`) : h.set(
|
|
170
|
+
for (const { key: a } of s.contexts) {
|
|
171
|
+
const c = a.description ?? "a context";
|
|
172
|
+
m.has(a) && o(w(s), `provides the context "${c}", which the runtime provides itself.`);
|
|
173
|
+
const f = h.get(a);
|
|
174
|
+
f ? o(w(s), `provides the context "${c}", which feature "${f.id}" provides too.`) : h.set(a, s);
|
|
175
175
|
}
|
|
176
|
-
const u = /* @__PURE__ */ new Map(), R = (s,
|
|
177
|
-
for (const c of
|
|
176
|
+
const u = /* @__PURE__ */ new Map(), R = (s, a) => {
|
|
177
|
+
for (const c of a) {
|
|
178
178
|
const f = u.get(c.namespace);
|
|
179
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.
|
|
180
|
+
for (const k of Object.keys(Xe(c, e.localeFiles)))
|
|
181
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
182
|
}
|
|
183
183
|
};
|
|
@@ -185,35 +185,35 @@ function $t(e) {
|
|
|
185
185
|
R(we, e.messages);
|
|
186
186
|
const E = (s) => u.has(s);
|
|
187
187
|
for (const s of i)
|
|
188
|
-
for (const { record:
|
|
189
|
-
for (const c of
|
|
190
|
-
E(c) || o(w(s), `the route "${String(
|
|
191
|
-
const
|
|
188
|
+
for (const { record: a } of J(s.routes))
|
|
189
|
+
for (const c of a.meta?.messages ?? [])
|
|
190
|
+
E(c) || o(w(s), `the route "${String(a.name ?? a.path)}" needs the message namespace "${c}", which nobody declares.`);
|
|
191
|
+
const _ = /* @__PURE__ */ new Map();
|
|
192
192
|
for (const s of i)
|
|
193
|
-
for (const
|
|
194
|
-
const c =
|
|
195
|
-
c ? o(w(s), `declares the shell contribution "${
|
|
196
|
-
for (const f of
|
|
197
|
-
E(f) || o(w(s), `the contribution "${
|
|
193
|
+
for (const a of s.contributions) {
|
|
194
|
+
const c = _.get(a.id);
|
|
195
|
+
c ? o(w(s), `declares the shell contribution "${a.id}", which feature "${c.id}" declares too.`) : _.set(a.id, s), e.shellSlots && !a.optional && !e.shellSlots.includes(a.slot) && o(w(s), `contributes "${a.id}" to the slot "${a.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 a.messages ?? [])
|
|
197
|
+
E(f) || o(w(s), `the contribution "${a.id}" needs the message namespace "${f}", which nobody declares.`);
|
|
198
198
|
}
|
|
199
|
-
const
|
|
199
|
+
const C = /* @__PURE__ */ new Map();
|
|
200
200
|
for (const s of i)
|
|
201
|
-
for (const
|
|
202
|
-
const c =
|
|
203
|
-
c ? o(w(s), `declares the effect "${
|
|
204
|
-
const f =
|
|
205
|
-
f !== "app" && f !== "session" && o(w(s), `the effect "${
|
|
201
|
+
for (const a of s.effects) {
|
|
202
|
+
const c = C.get(a.id);
|
|
203
|
+
c ? o(w(s), `declares the effect "${a.id}", which feature "${c.id}" declares too.`) : C.set(a.id, s);
|
|
204
|
+
const f = a.scope;
|
|
205
|
+
f !== "app" && f !== "session" && o(w(s), `the effect "${a.id}" has the scope "${f}"; use "app" or "session".`);
|
|
206
206
|
}
|
|
207
207
|
return { features: i, issues: n };
|
|
208
208
|
}
|
|
209
|
-
const
|
|
209
|
+
const kt = (e, n, o) => He({
|
|
210
210
|
legacy: !1,
|
|
211
211
|
locale: e,
|
|
212
212
|
fallbackLocale: n,
|
|
213
213
|
pluralRules: o?.pluralRules && { ...o.pluralRules },
|
|
214
214
|
...o?.missingWarn === !1 && { missingWarn: !1, fallbackWarn: !1 },
|
|
215
215
|
messages: {}
|
|
216
|
-
}),
|
|
216
|
+
}), St = (e) => typeof e == "object" && e !== null && "component" in e && "slots" in e;
|
|
217
217
|
function be(e, n) {
|
|
218
218
|
return e.map((o) => ({
|
|
219
219
|
...o,
|
|
@@ -222,63 +222,65 @@ function be(e, n) {
|
|
|
222
222
|
}));
|
|
223
223
|
}
|
|
224
224
|
const ve = (e) => [...new Set(e)];
|
|
225
|
-
function
|
|
226
|
-
const { platform: n } = e, o = e.locale?.supported ?? Object.keys(le), i = e.locale?.fallback ?? "en", v = e.shell === void 0 ? void 0 :
|
|
225
|
+
function Ut(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 : St(e.shell) ? e.shell : { component: e.shell, slots: void 0, progress: void 0 }, b = [];
|
|
227
227
|
o.includes(i) || b.push({ owner: "application", message: `the fallback locale "${i}" is not among the supported locales (${o.join(", ")}).` });
|
|
228
228
|
for (const t of Object.keys(e.locale?.flags ?? {}))
|
|
229
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
230
|
const S = e.locale?.initial ?? (o.includes(n.config.locale) ? n.config.locale : i);
|
|
231
231
|
o.includes(S) || b.push({ owner: "application", message: `the initial locale "${S}" is not among the supported locales (${o.join(", ")}).` });
|
|
232
|
-
const
|
|
232
|
+
const L = [nt, Ue, rt, st, et, fe, de, ue, pe, me, he], A = Et({
|
|
233
233
|
features: e.features,
|
|
234
234
|
platform: n,
|
|
235
235
|
messages: e.messages ?? [],
|
|
236
|
-
reservedContexts:
|
|
236
|
+
reservedContexts: L,
|
|
237
237
|
supportedLocales: o,
|
|
238
|
+
localeFiles: e.localeFiles,
|
|
238
239
|
shellSlots: v?.slots
|
|
239
|
-
}),
|
|
240
|
-
l.flatMap((t) => t.navigation.map((
|
|
240
|
+
}), M = [...b, ...A.issues], l = A.features, m = dt(
|
|
241
|
+
l.flatMap((t) => t.navigation.map((r) => ({ feature: t.id, binding: r }))),
|
|
241
242
|
e.navigation
|
|
242
243
|
);
|
|
243
|
-
for (const t of m.issues)
|
|
244
|
-
if (
|
|
245
|
-
const h =
|
|
246
|
-
for (const [t,
|
|
247
|
-
for (const [t,
|
|
248
|
-
const { currencySymbol: R, intlLocale: E, datePattern:
|
|
244
|
+
for (const t of m.issues) M.push({ owner: "navigation", message: t });
|
|
245
|
+
if (M.length > 0) throw new ge(M);
|
|
246
|
+
const h = kt(S, i, e.i18n), u = h.global;
|
|
247
|
+
for (const [t, r] of Object.entries(le)) u.mergeLocaleMessage(t, r);
|
|
248
|
+
for (const [t, r] of Object.entries(e.i18n?.messages ?? {})) u.mergeLocaleMessage(t, r);
|
|
249
|
+
const { currencySymbol: R, intlLocale: E, datePattern: _, numberSymbols: C, emptyNumber: s, ...a } = e.formatting ?? {}, c = ze({
|
|
249
250
|
locale: () => u.locale.value,
|
|
250
|
-
formatters:
|
|
251
|
+
formatters: a,
|
|
251
252
|
currencySymbol: R,
|
|
252
253
|
intlLocale: E,
|
|
253
|
-
datePattern:
|
|
254
|
-
numberSymbols:
|
|
254
|
+
datePattern: _,
|
|
255
|
+
numberSymbols: C,
|
|
255
256
|
emptyNumber: s,
|
|
256
|
-
translate: (t) => u.t(t)
|
|
257
|
-
}), f = [...l.flatMap((t) => t.messages), ...e.messages ?? []], k = (t) => (e.onError ??
|
|
257
|
+
translate: (t, r) => u.t(t, r ?? {})
|
|
258
|
+
}), f = [...l.flatMap((t) => t.messages), ...e.messages ?? []], k = (t) => (e.onError ?? Rt)({ ...t, route: y.currentRoute.value.matched.length > 0 ? y.currentRoute.value.fullPath : null }), z = (t, r) => k({ source: "handled", error: t, detail: r?.detail }), K = Ye({
|
|
258
259
|
target: u,
|
|
259
260
|
namespaces: f,
|
|
260
261
|
fallback: i,
|
|
261
262
|
supported: o,
|
|
263
|
+
localeFiles: e.localeFiles,
|
|
262
264
|
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((
|
|
264
|
-
history: e.router?.history ??
|
|
265
|
+
}), $e = new Map(l.flatMap((t) => t.messages.map((r) => [r.namespace, t.id]))), y = Ve({
|
|
266
|
+
history: e.router?.history ?? lt(),
|
|
265
267
|
routes: l.flatMap((t) => be(t.routes, t.id)),
|
|
266
|
-
scrollBehavior: e.router?.scrollBehavior ?? ((t,
|
|
268
|
+
scrollBehavior: e.router?.scrollBehavior ?? ((t, r) => t.name === r.name ? !1 : { top: 0 })
|
|
267
269
|
}), I = e.router?.login ?? { name: "login" }, Ee = e.router?.home ?? { path: "/" }, T = [], Q = (t) => {
|
|
268
270
|
try {
|
|
269
271
|
return y.resolve(t).matched.length > 0 ? null : "matches no route";
|
|
270
|
-
} catch (
|
|
271
|
-
const p =
|
|
272
|
+
} catch (r) {
|
|
273
|
+
const p = r instanceof Error ? r.message : String(r);
|
|
272
274
|
return p.startsWith("No match for") ? "matches no route" : `cannot be resolved (${p})`;
|
|
273
275
|
}
|
|
274
276
|
};
|
|
275
|
-
if (l.some((t) => t.routes.some((
|
|
277
|
+
if (l.some((t) => t.routes.some((r) => r.meta?.public !== !0))) {
|
|
276
278
|
const t = Q(I) ?? (y.resolve(I).meta.public === !0 ? null : "is not public (meta.public: true)");
|
|
277
279
|
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
280
|
}
|
|
279
|
-
for (const { feature: t, binding:
|
|
280
|
-
const p = Q(
|
|
281
|
-
p && T.push({ owner: `feature "${t}"`, message: `the destination "${
|
|
281
|
+
for (const { feature: t, binding: r } of m.destinations.values()) {
|
|
282
|
+
const p = Q(r.to);
|
|
283
|
+
p && T.push({ owner: `feature "${t}"`, message: `the destination "${r.destination}" is bound to ${JSON.stringify(r.to)}, which ${p}.` });
|
|
282
284
|
}
|
|
283
285
|
if (T.length > 0) throw new ge(T);
|
|
284
286
|
const j = qe({ status: "idle" }), P = {
|
|
@@ -287,13 +289,13 @@ function Qt(e) {
|
|
|
287
289
|
locales: o,
|
|
288
290
|
localeFlags: e.locale?.flags ?? {},
|
|
289
291
|
setLocale: async (t) => {
|
|
290
|
-
const
|
|
291
|
-
if (p && u.locale.value !==
|
|
292
|
-
const g = (
|
|
292
|
+
const r = u.locale.value, p = await K.setLocale(t);
|
|
293
|
+
if (p && u.locale.value !== r) {
|
|
294
|
+
const g = (F) => k({ source: "locale", error: F, detail: t });
|
|
293
295
|
try {
|
|
294
296
|
Promise.resolve(e.locale?.onChange?.(t)).catch(g);
|
|
295
|
-
} catch (
|
|
296
|
-
g(
|
|
297
|
+
} catch (F) {
|
|
298
|
+
g(F);
|
|
297
299
|
}
|
|
298
300
|
}
|
|
299
301
|
return p;
|
|
@@ -301,50 +303,50 @@ function Qt(e) {
|
|
|
301
303
|
retry: () => H(),
|
|
302
304
|
report: z
|
|
303
305
|
}, D = {
|
|
304
|
-
contributions: l.flatMap((t) => t.contributions.map((
|
|
305
|
-
effects: l.flatMap((t) => t.effects.map((
|
|
306
|
-
}, U =
|
|
306
|
+
contributions: l.flatMap((t) => t.contributions.map((r) => ({ feature: t.id, contribution: r }))),
|
|
307
|
+
effects: l.flatMap((t) => t.effects.map((r) => ({ feature: t.id, effect: r })))
|
|
308
|
+
}, U = yt({
|
|
307
309
|
effects: D.effects,
|
|
308
310
|
platform: n,
|
|
309
311
|
sessionKey: e.sessionKey,
|
|
310
|
-
onError: (t,
|
|
311
|
-
}), ke = new Map(l.map((t) => [t.id, t.messages.map((
|
|
312
|
+
onError: (t, r) => k({ source: "effect", error: t, feature: r.feature, detail: r.effect.id })
|
|
313
|
+
}), ke = new Map(l.map((t) => [t.id, t.messages.map((r) => r.namespace)])), X = (t) => ve(D.contributions.filter(({ contribution: r }) => r.scope === t).flatMap(({ contribution: r }) => r.messages ?? [])), Se = X("always"), Re = X("authenticated");
|
|
312
314
|
async function xe(t) {
|
|
313
|
-
const
|
|
314
|
-
await
|
|
315
|
+
const r = t.matched.flatMap((g) => [...ke.get(g.meta.feature ?? "") ?? [], ...g.meta.messages ?? []]), p = n.session.state.value.status === "authenticated";
|
|
316
|
+
await K.load(ve([...r, ...Se, ...p ? Re : []]));
|
|
315
317
|
}
|
|
316
318
|
let W = null;
|
|
317
319
|
function B(t) {
|
|
318
|
-
const
|
|
320
|
+
const r = t.meta.titleKey, p = W?.documentTitle.value ?? (r && u.te(r) ? u.t(r) : null), g = (e.router?.documentTitle ?? xt)(p, n.config.appName);
|
|
319
321
|
g !== "" && (document.title = g);
|
|
320
322
|
}
|
|
321
|
-
const
|
|
323
|
+
const Le = pt({ session: n.session, router: y, i18n: u, destinations: m.destinations }), Me = mt(D.contributions, n.session), Ae = it({ router: y, access: n.access, noAccess: e.noAccess ?? ut }), je = ye({
|
|
322
324
|
name: "ApplicationRoot",
|
|
323
325
|
setup() {
|
|
324
326
|
return () => {
|
|
325
327
|
const t = j.value;
|
|
326
|
-
return t.status === "failed" ? ce(
|
|
328
|
+
return t.status === "failed" ? ce($t, { kind: t.kind, onRetry: () => void H() }) : t.status !== "ready" ? null : ce(v?.component ?? ct);
|
|
327
329
|
};
|
|
328
330
|
}
|
|
329
331
|
}), d = We(je);
|
|
330
|
-
|
|
331
|
-
for (const t of l) for (const { key:
|
|
332
|
+
at(d, n), d.use(h), Qe(d, c), W = ot(d), tt(d), Je(d), e.icons && Ze(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, Le), d.provide(de, Me), d.provide(ue, Ae);
|
|
333
|
+
for (const t of l) for (const { key: r, value: p } of t.contexts) d.provide(r, p);
|
|
332
334
|
let x = !1, Y = !1, Z = !1, ee = !1;
|
|
333
335
|
const N = [];
|
|
334
336
|
function Ne() {
|
|
335
337
|
const t = d.config.errorHandler;
|
|
336
|
-
d.config.errorHandler = ($,
|
|
337
|
-
k({ source: "vue", error: $, detail: re }), t?.($,
|
|
338
|
+
d.config.errorHandler = ($, Ke, re) => {
|
|
339
|
+
k({ source: "vue", error: $, detail: re }), t?.($, Ke, re);
|
|
338
340
|
};
|
|
339
|
-
const
|
|
341
|
+
const r = ($) => k({ source: "unhandledrejection", error: $.reason }), p = ($) => {
|
|
340
342
|
$.error && k({ source: "window", error: $.error });
|
|
341
343
|
};
|
|
342
|
-
window.addEventListener("unhandledrejection",
|
|
343
|
-
window.removeEventListener("unhandledrejection",
|
|
344
|
+
window.addEventListener("unhandledrejection", r), window.addEventListener("error", p), N.push(() => {
|
|
345
|
+
window.removeEventListener("unhandledrejection", r), window.removeEventListener("error", p);
|
|
344
346
|
});
|
|
345
347
|
const g = l.some(($) => $.holdsExpiredSession);
|
|
346
348
|
n.session.holdExpired(g), N.push(() => n.session.holdExpired(!1)), N.push(
|
|
347
|
-
|
|
349
|
+
ft({
|
|
348
350
|
router: y,
|
|
349
351
|
session: n.session,
|
|
350
352
|
login: I,
|
|
@@ -356,8 +358,8 @@ function Qt(e) {
|
|
|
356
358
|
onError: ($) => k({ source: "router", error: $ })
|
|
357
359
|
})
|
|
358
360
|
);
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
+
const F = V();
|
|
362
|
+
F.run(() => G(() => W?.documentTitle.value, () => B(y.currentRoute.value))), N.push(() => F.stop());
|
|
361
363
|
const oe = V();
|
|
362
364
|
oe.run(
|
|
363
365
|
() => G(
|
|
@@ -369,17 +371,17 @@ function Qt(e) {
|
|
|
369
371
|
)
|
|
370
372
|
), N.push(() => oe.stop());
|
|
371
373
|
}
|
|
372
|
-
const q = (t,
|
|
373
|
-
j.value = { status: "failed", kind: t, error:
|
|
374
|
+
const q = (t, r) => {
|
|
375
|
+
j.value = { status: "failed", kind: t, error: r };
|
|
374
376
|
};
|
|
375
377
|
async function te() {
|
|
376
378
|
j.value = { status: "starting" };
|
|
377
379
|
const t = await n.session.restore();
|
|
378
380
|
if (x) return;
|
|
379
381
|
if (t.status === "failed") return q("session", t.error);
|
|
380
|
-
const
|
|
381
|
-
if (typeof
|
|
382
|
-
const p = await
|
|
382
|
+
const r = t.status === "authenticated" ? t.user.locale : void 0;
|
|
383
|
+
if (typeof r == "string" && r !== u.locale.value && o.includes(r) && await P.setLocale(r), x) return;
|
|
384
|
+
const p = await K.loadEssential();
|
|
383
385
|
if (!x) {
|
|
384
386
|
if (p.length > 0) return q("messages", p[0].error);
|
|
385
387
|
try {
|
|
@@ -394,7 +396,7 @@ function Qt(e) {
|
|
|
394
396
|
}
|
|
395
397
|
}
|
|
396
398
|
async function H() {
|
|
397
|
-
x || j.value.status !== "failed" || (await
|
|
399
|
+
x || j.value.status !== "failed" || (await K.retry(), await te());
|
|
398
400
|
}
|
|
399
401
|
const se = {
|
|
400
402
|
app: d,
|
|
@@ -414,22 +416,22 @@ function Qt(e) {
|
|
|
414
416
|
retry: H,
|
|
415
417
|
dispose() {
|
|
416
418
|
if (!x) {
|
|
417
|
-
x = !0,
|
|
419
|
+
x = !0, Fe(), U.dispose(), K.dispose(), Z && d.unmount();
|
|
418
420
|
for (const t of N.reverse()) t();
|
|
419
421
|
y.options.history.destroy();
|
|
420
422
|
}
|
|
421
423
|
}
|
|
422
|
-
},
|
|
424
|
+
}, Fe = ht(se);
|
|
423
425
|
return se;
|
|
424
426
|
}
|
|
425
|
-
function
|
|
427
|
+
function Rt(e) {
|
|
426
428
|
console.error(`[vue-core] ${e.source}${e.feature ? ` (${e.feature})` : ""}${e.detail ? `: ${e.detail}` : ""}`, e.error);
|
|
427
429
|
}
|
|
428
|
-
function
|
|
430
|
+
function xt(e, n) {
|
|
429
431
|
return [e, n].filter((o) => !!o).join(" · ");
|
|
430
432
|
}
|
|
431
433
|
export {
|
|
432
434
|
ge as A,
|
|
433
|
-
|
|
434
|
-
|
|
435
|
+
Ut as c,
|
|
436
|
+
Rt as d
|
|
435
437
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { RouteLocationRaw } from "vue-router";
|
|
2
|
+
import type { IconName } from "../icon";
|
|
3
|
+
import type { PageAction } from "../page";
|
|
4
|
+
import type { FormSchema } from "../form/dynamic/schema";
|
|
5
|
+
import type { RowAction } from "./columns";
|
|
6
|
+
import type { CollectionLoader, CollectionStateSource } from "./types";
|
|
7
|
+
type Row = Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* A list page generated from a typed schema: a column per listable field, sort on the fields the backend can order by, and a
|
|
10
|
+
* filter per select, boolean and date field, all from the same schema. It is `defineCollection` + `useCollection` +
|
|
11
|
+
* `CollectionPage` with `Row = Record<string, unknown>`; the loader is yours (it receives the query with those sort and filter keys).
|
|
12
|
+
*
|
|
13
|
+
* <DynamicCollection id="content.news" :schema="schema" :load="api.entries" title="News" :record-route="(row) => `/news/${row.id}`" thumbnail="/media/{id}/thumb" />
|
|
14
|
+
*
|
|
15
|
+
* Cells: text, number, date and datetime as the standard kinds; boolean as a yes / no badge; select as a badge with the option's label;
|
|
16
|
+
* translated text in the current language; image as a picture from `thumbnail`. The first text field (or `titleField`) is the
|
|
17
|
+
* record's name and links to it. A `#cell-<key>` slot replaces any cell. The schema is read once, when the page is set up: key the
|
|
18
|
+
* component by the type to show another.
|
|
19
|
+
*
|
|
20
|
+
* Filters: a select offers its options, a boolean "yes" / "no" (the values `"true"` and `"false"`), a date the date presets.
|
|
21
|
+
*/
|
|
22
|
+
type __VLS_Props = {
|
|
23
|
+
schema: FormSchema;
|
|
24
|
+
/** The list's identity (saved views and logs use it). */
|
|
25
|
+
id: string;
|
|
26
|
+
load: CollectionLoader<Row, string, string, string>;
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
icon?: IconName;
|
|
30
|
+
actions?: readonly PageAction[];
|
|
31
|
+
/** Where a row's record lives. */
|
|
32
|
+
recordRoute?: (row: Row) => RouteLocationRaw;
|
|
33
|
+
rowActions?: (row: Row) => RowAction[];
|
|
34
|
+
/** Default: the URL's query under `q`. */
|
|
35
|
+
state?: CollectionStateSource;
|
|
36
|
+
/** The field that names the record and links to it. Default: the first text field. */
|
|
37
|
+
titleField?: string;
|
|
38
|
+
/** The columns to show, in order. Default: every listable field of the schema. */
|
|
39
|
+
columns?: readonly string[];
|
|
40
|
+
/** A URL with `{id}` for the pictures of image fields. */
|
|
41
|
+
thumbnail?: string;
|
|
42
|
+
/** The language of translated text. Default: the interface's. */
|
|
43
|
+
locale?: string;
|
|
44
|
+
};
|
|
45
|
+
declare var __VLS_6: string, __VLS_7: {
|
|
46
|
+
[x: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
type __VLS_Slots = {} & {
|
|
49
|
+
[K in NonNullable<typeof __VLS_6>]?: (props: typeof __VLS_7) => any;
|
|
50
|
+
};
|
|
51
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
52
|
+
icon: IconName;
|
|
53
|
+
state: CollectionStateSource;
|
|
54
|
+
locale: string;
|
|
55
|
+
description: string;
|
|
56
|
+
actions: readonly PageAction[];
|
|
57
|
+
columns: readonly string[];
|
|
58
|
+
thumbnail: string;
|
|
59
|
+
rowActions: (row: Row) => RowAction[];
|
|
60
|
+
recordRoute: (row: Row) => RouteLocationRaw;
|
|
61
|
+
titleField: string;
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
63
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
64
|
+
export default _default;
|
|
65
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
66
|
+
new (): {
|
|
67
|
+
$slots: S;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** A person behind a record, as go-core's `meta.author` / `meta.editor` and a list's `meta.authors` carry them. */
|
|
2
|
+
export interface ResourceAuthor {
|
|
3
|
+
readonly id: number;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly email: string | null;
|
|
6
|
+
readonly phone_number: string | null;
|
|
7
|
+
readonly avatar: string | null;
|
|
8
|
+
readonly active: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** The `meta` of a record answer: who created it and who last changed it (and who switched it on or off, where the resource has that). */
|
|
11
|
+
export interface ResourceMeta {
|
|
12
|
+
readonly author: ResourceAuthor | null;
|
|
13
|
+
readonly editor: ResourceAuthor | null;
|
|
14
|
+
readonly activator?: ResourceAuthor | null;
|
|
15
|
+
readonly deactivator?: ResourceAuthor | null;
|
|
16
|
+
readonly [key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The person behind a row's `created_by` / `updated_by`: a list answer carries them once, in `meta.authors`.
|
|
20
|
+
*
|
|
21
|
+
* const creator = authorOf(page.meta, row.created_by);
|
|
22
|
+
*
|
|
23
|
+
* Null for no id, no `authors` in the meta, or an id nobody in it has. `A` is your own author type where it has more fields.
|
|
24
|
+
*/
|
|
25
|
+
export declare function authorOf<A extends {
|
|
26
|
+
readonly id: number;
|
|
27
|
+
} = ResourceAuthor>(meta: object | null | undefined, id: number | null | undefined): NoInfer<A> | null;
|
|
@@ -81,7 +81,7 @@ export interface CollectionDefinition<Row, Sort extends string = string, Filter
|
|
|
81
81
|
*/
|
|
82
82
|
export declare function defineCollection<Row, Sort extends string = string, Filter extends string = string, View extends string = string, Meta extends ListMeta = ListMeta>(input: CollectionDefinitionInput<Row, Sort, Filter, View, Meta>): CollectionDefinition<Row, Sort, Filter, View, Meta>;
|
|
83
83
|
/** The row, sort keys, filter keys and views of a definition, for typing code written against it. */
|
|
84
|
-
export type RowOf<D> = D extends CollectionDefinition<infer Row,
|
|
85
|
-
export type SortOf<D> = D extends CollectionDefinition<
|
|
86
|
-
export type FilterOf<D> = D extends CollectionDefinition<
|
|
87
|
-
export type ViewOf<D> = D extends CollectionDefinition<
|
|
84
|
+
export type RowOf<D> = D extends CollectionDefinition<infer Row, infer _S, infer _F, infer _V, infer _M> ? Row : never;
|
|
85
|
+
export type SortOf<D> = D extends CollectionDefinition<infer _R, infer Sort, infer _F, infer _V, infer _M> ? Sort : never;
|
|
86
|
+
export type FilterOf<D> = D extends CollectionDefinition<infer _R, infer _S, infer Filter, infer _V, infer _M> ? Filter : never;
|
|
87
|
+
export type ViewOf<D> = D extends CollectionDefinition<infer _R, infer _S, infer _F, infer View, infer _M> ? View : never;
|