@wssto2/vue-core 0.4.12 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Activity-DdnEG7EW.js → Activity-BdSvn0GP.js} +3 -3
- package/dist/{Changes-CBM8york.js → Changes-BQO--N9F.js} +3 -3
- package/dist/{DeadLetters-DBUALYXL.js → DeadLetters-OmeiADEi.js} +3 -3
- package/dist/{General-Cvb-tLsE.js → General-CBwFLiKQ.js} +3 -3
- package/dist/{NewRolePage-Dm7urTx0.js → NewRolePage-CblUW2gA.js} +3 -3
- package/dist/{ProfilePage-B1-66cXB.js → ProfilePage-BOoDDbmB.js} +3 -3
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CDZjkiU5.js → RoleEditor.vue_vue_type_script_setup_true_lang-BCE5yrwy.js} +1 -1
- package/dist/{RolePage-CQc_wV3b.js → RolePage-xDsFL_eC.js} +4 -4
- package/dist/{RolesPage-CG7InZ_u.js → RolesPage-C39wsF6X.js} +2 -2
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-ROl9_pdO.js → SectionNavigator.vue_vue_type_script_setup_true_lang-D5Cnb4_O.js} +102 -102
- package/dist/{Sessions-CIVLL9X4.js → Sessions-m_i4aTfw.js} +3 -3
- package/dist/{SettingsPage-BNdeH-_0.js → SettingsPage-ktKvQQnE.js} +3 -3
- package/dist/{SignIn-B8FbIWMH.js → SignIn-CkoEixY4.js} +3 -3
- package/dist/{SignInPage-DIo9fK1d.js → SignInPage-DVcpFz3G.js} +1 -1
- package/dist/{SignIns-nH3zghoi.js → SignIns-BnVAtncZ.js} +3 -3
- package/dist/{UserRecord-DVm0mIrA.js → UserRecord-Cg69_mbU.js} +7 -7
- package/dist/{UsersList-C3cNr0MI.js → UsersList-BFmBDGs7.js} +3 -3
- package/dist/access/index.js +1 -1
- package/dist/app/application.d.ts +7 -0
- package/dist/app/index.js +143 -142
- package/dist/{describeError-Ctga6GcS.js → describeError-CvGmajU0.js} +20 -13
- package/dist/{fieldMessages-C3Rpbktw.js → fieldMessages-D_dpSe19.js} +1 -1
- package/dist/i18n/describeError.d.ts +11 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +7 -6
- package/dist/identity/index.js +1 -1
- package/dist/{index-Cz4LtYKa.js → index-B416VXmR.js} +2 -2
- package/dist/{index-BesWsiIg.js → index-KcCoCfr-.js} +5 -5
- package/dist/{index-CM_Uh_xF.js → index-RNF5-9uf.js} +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/page/SectionNavigator.vue.d.ts +5 -4
- package/dist/page/index.js +1 -1
- package/dist/resource/index.js +1 -1
- package/dist/resource/resource.d.ts +1 -1
- package/dist/{routeResource-DstM0hvf.js → routeResource-BwEFXzIX.js} +36 -32
- package/dist/state/index.js +1 -1
- package/dist/state/useLoad.d.ts +7 -0
- package/dist/{status-cZWwrYGN.js → status-OZUHZpWl.js} +1 -1
- package/dist/useLoad-DuEsLECT.js +43 -0
- package/package.json +1 -1
- package/dist/useLoad-CYRVx6HW.js +0 -39
|
@@ -15,6 +15,7 @@ import type { SectionStep } from "./types";
|
|
|
15
15
|
* | compact | `compact="segmented"` (default) | a segmented control of short labels, pinned under the phone nav bar while the section scrolls |
|
|
16
16
|
* | compact | `compact="rows"` | drill-in rows at the top of the first section; every other section goes back to it |
|
|
17
17
|
* | compact | `compact="auto"` | segmented up to five sections, rows beyond |
|
|
18
|
+
* | any | `hub` | no navigation: the first section is the record's hub, and its own content leads to the others (a workflow record's to-dos); every other section goes back to it, and a long form in one lists its sections beside it on wide screens |
|
|
18
19
|
*
|
|
19
20
|
* `steps` makes the record a workflow instead: the sections are large tiles in order, on every width (the `desktop` and `compact` variants
|
|
20
21
|
* do not apply). Each tile is the section's link with its number (a ✓ once done), its label (short on phones), one line saying where the step
|
|
@@ -36,8 +37,8 @@ import type { SectionStep } from "./types";
|
|
|
36
37
|
type __VLS_Props = {
|
|
37
38
|
/** The accessible name of the navigation ("Parts of the dealer"). */
|
|
38
39
|
label: string;
|
|
39
|
-
desktop?: "sidebar" | "segments";
|
|
40
|
-
compact?: "segmented" | "rows" | "auto";
|
|
40
|
+
desktop?: "sidebar" | "segments" | "hub";
|
|
41
|
+
compact?: "segmented" | "rows" | "auto" | "hub";
|
|
41
42
|
/** The back label of a nested section on compact screens, and the record's name in the path of a page inside a section. */
|
|
42
43
|
backLabel?: string;
|
|
43
44
|
/** A quiet count per section route name ("Locations 4"). */
|
|
@@ -51,8 +52,8 @@ type __VLS_Slots = {
|
|
|
51
52
|
summary?: () => unknown;
|
|
52
53
|
};
|
|
53
54
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
54
|
-
compact: "segmented" | "rows" | "auto";
|
|
55
|
-
desktop: "sidebar" | "segments";
|
|
55
|
+
compact: "segmented" | "rows" | "auto" | "hub";
|
|
56
|
+
desktop: "sidebar" | "segments" | "hub";
|
|
56
57
|
backLabel: string;
|
|
57
58
|
counts: Readonly<Record<string, string | number>>;
|
|
58
59
|
steps: Readonly<Record<string, SectionStep>>;
|
package/dist/page/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { _ as ue } from "../RecordHeader.vue_vue_type_script_setup_true_lang-D87
|
|
|
8
8
|
import { c as pe, i as fe, p as me, a as be, u as ge, b as ve } from "../chrome-nUcmVu8G.js";
|
|
9
9
|
import { s as z, u as I } from "../sectionIndex-BS0ic5W7.js";
|
|
10
10
|
import { p as _e, a as xe } from "../sectionIndex-BS0ic5W7.js";
|
|
11
|
-
import { _ as ye } from "../SectionNavigator.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { _ as ye } from "../SectionNavigator.vue_vue_type_script_setup_true_lang-D5Cnb4_O.js";
|
|
12
12
|
import { a as Se, _ as Ce } from "../SectionList.vue_vue_type_script_setup_true_lang-B0p_8xQG.js";
|
|
13
13
|
import { _ as A } from "../Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js";
|
|
14
14
|
const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex", "onClick"], R = { class: "relative" }, E = {
|
package/dist/resource/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as o, u as r, a, b as u } from "../routeResource-
|
|
1
|
+
import { p as o, u as r, a, b as u } from "../routeResource-BwEFXzIX.js";
|
|
2
2
|
import { _ as R, a as c } from "../ResourcePage.vue_vue_type_script_setup_true_lang-Da0M-hen.js";
|
|
3
3
|
export {
|
|
4
4
|
R as RecordPager,
|
|
@@ -48,7 +48,7 @@ export interface ResourceOptions<T, Id extends ResourceId = number> {
|
|
|
48
48
|
readonly load: (id: Id, context: ResourceContext) => Promise<T>;
|
|
49
49
|
/** Which identity a value belongs to, for `update`; by default its `id`. A value with neither is taken to be the current one. */
|
|
50
50
|
readonly identify?: (value: T) => Id;
|
|
51
|
-
/** The text of a failed read; by default a sentence per kind of failure, in the app's language. */
|
|
51
|
+
/** The text of a failed read; by default the application's describer, then a sentence per kind of failure, in the app's language. */
|
|
52
52
|
readonly errorMessage?: (error: unknown) => string;
|
|
53
53
|
}
|
|
54
54
|
/** The default identity: a positive safe integer written in digits. */
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import { computed as f, toValue as
|
|
1
|
+
import { computed as f, toValue as A, shallowRef as w, watch as R, getCurrentScope as C, onScopeDispose as I, provide as j, hasInjectionContext as E, inject as F } from "vue";
|
|
2
2
|
import { useRoute as M } from "vue-router";
|
|
3
3
|
import { M as h } from "./context-Ch1r4fdN.js";
|
|
4
4
|
import { useI18n as S } from "vue-i18n";
|
|
5
5
|
import { a as p } from "./error-CD7x0Jrz.js";
|
|
6
|
-
|
|
6
|
+
import { a as _ } from "./describeError-CvGmajU0.js";
|
|
7
|
+
function D(e) {
|
|
7
8
|
if (!/^\d+$/.test(e)) return null;
|
|
8
9
|
const n = Number(e);
|
|
9
10
|
return Number.isSafeInteger(n) && n > 0 ? n : null;
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const { t: n } = S(),
|
|
14
|
-
let u = null,
|
|
15
|
-
const g = e.errorMessage ?? ((r) =>
|
|
12
|
+
const N = (e) => typeof e == "object" && e !== null && "state" in e && "reload" in e && "id" in e, O = (e) => typeof e == "object" && e !== null && "id" in e;
|
|
13
|
+
function V(e) {
|
|
14
|
+
const { t: n } = S(), s = N(e.for) ? e.for : null, a = f(() => s ? s.id.value : A(e.for)), d = f(() => s !== null && s.data.value === null), t = w({ status: "loading" });
|
|
15
|
+
let u = null, l = 0, v = null;
|
|
16
|
+
const k = _(), g = e.errorMessage ?? ((r) => {
|
|
17
|
+
const o = k?.(r);
|
|
18
|
+
return o !== void 0 ? o : p(r) && r.kind === "network" ? n("core.resource.offline") : p(r) && r.kind === "forbidden" ? n("core.no_access.body") : n("core.resource.unavailable");
|
|
19
|
+
});
|
|
16
20
|
function m() {
|
|
17
|
-
return v?.abort(), v = null, ++
|
|
21
|
+
return v?.abort(), v = null, ++l;
|
|
18
22
|
}
|
|
19
23
|
async function y() {
|
|
20
|
-
const r =
|
|
24
|
+
const r = a.value, o = m();
|
|
21
25
|
if (d.value) {
|
|
22
26
|
u = null, t.value = { status: "loading" };
|
|
23
27
|
return;
|
|
@@ -32,51 +36,51 @@ function D(e) {
|
|
|
32
36
|
v = b;
|
|
33
37
|
try {
|
|
34
38
|
const c = await e.load(r, { signal: b.signal });
|
|
35
|
-
if (
|
|
39
|
+
if (o !== l) return;
|
|
36
40
|
u = r, t.value = { status: "loaded", value: c };
|
|
37
41
|
} catch (c) {
|
|
38
|
-
if (
|
|
42
|
+
if (o !== l) return;
|
|
39
43
|
p(c) && c.kind === "notFound" ? (u = null, t.value = { status: "failed", reason: "notFound", error: n("core.resource.not_found.body") }) : i ? t.value = { status: "stale", value: i.value, error: g(c) } : (u = null, t.value = { status: "failed", reason: "unavailable", error: g(c) });
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
return
|
|
46
|
+
function x(r) {
|
|
47
|
+
const o = a.value, i = e.identify ? e.identify(r) : O(r) ? r.id : o;
|
|
48
|
+
return o === null || i !== o ? !1 : (m(), u = o, t.value = { status: "loaded", value: r }, !0);
|
|
45
49
|
}
|
|
46
|
-
return
|
|
47
|
-
id:
|
|
50
|
+
return R([a, d], () => void y(), { immediate: !0, flush: "sync" }), C() && I(m), {
|
|
51
|
+
id: a,
|
|
48
52
|
state: f(() => t.value),
|
|
49
53
|
data: f(() => "value" in t.value ? t.value.value : null),
|
|
50
54
|
reload: y,
|
|
51
|
-
update:
|
|
55
|
+
update: x
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
|
-
function
|
|
55
|
-
const n = M(),
|
|
58
|
+
function J(e) {
|
|
59
|
+
const n = M(), s = e.parse ?? D, a = w(null);
|
|
56
60
|
let d = !1;
|
|
57
|
-
|
|
61
|
+
R(
|
|
58
62
|
() => n.params[e.param],
|
|
59
63
|
(u) => {
|
|
60
64
|
if (u === void 0 && d) return;
|
|
61
65
|
d = !0;
|
|
62
|
-
const
|
|
63
|
-
|
|
66
|
+
const l = Array.isArray(u) ? u[0] : u;
|
|
67
|
+
a.value = l === void 0 ? null : s(l);
|
|
64
68
|
},
|
|
65
69
|
{ immediate: !0, flush: "sync" }
|
|
66
70
|
);
|
|
67
|
-
const t =
|
|
71
|
+
const t = V({ ...e, for: a });
|
|
68
72
|
return e.key && j(e.key, t), t;
|
|
69
73
|
}
|
|
70
|
-
function
|
|
74
|
+
function K(e) {
|
|
71
75
|
const n = e.description ?? "route resource";
|
|
72
|
-
if (!
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
return
|
|
76
|
+
if (!E()) throw new h(n, "outside-setup");
|
|
77
|
+
const s = F(e, null);
|
|
78
|
+
if (!s) throw new h(n, "not-provided");
|
|
79
|
+
return s;
|
|
76
80
|
}
|
|
77
81
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
J as a,
|
|
83
|
+
K as b,
|
|
84
|
+
D as p,
|
|
85
|
+
V as u
|
|
82
86
|
};
|
package/dist/state/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { _ as q } from "../EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp
|
|
|
7
7
|
import { defineComponent as m, computed as k, openBlock as e, createElementBlock as n, normalizeClass as p, createVNode as d, unref as i, createElementVNode as u, renderSlot as f, createBlock as S, toDisplayString as l, createCommentVNode as c } from "vue";
|
|
8
8
|
import { _ as x } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
9
9
|
import { useI18n as g } from "vue-i18n";
|
|
10
|
-
import { u as J } from "../useLoad-
|
|
10
|
+
import { u as J } from "../useLoad-DuEsLECT.js";
|
|
11
11
|
import { D as Q, W as X, u as Y } from "../useWaitStatus-fsacMl4W.js";
|
|
12
12
|
const b = ["amber", "lime", "teal", "cyan", "blue", "indigo", "violet", "fuchsia", "pink"], V = /* @__PURE__ */ m({
|
|
13
13
|
__name: "FieldNote",
|
package/dist/state/useLoad.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ import type { AsyncState } from "./async";
|
|
|
3
3
|
export interface LoadContext {
|
|
4
4
|
/** Aborted when the load is no longer wanted: a newer load or an `update` superseded it, the watch source changed, the scope ended. */
|
|
5
5
|
readonly signal: AbortSignal;
|
|
6
|
+
/**
|
|
7
|
+
* Ends this load with nothing to show and nothing to report, for a page that is leaving instead (a 403 that
|
|
8
|
+
* redirects): the state stays as it is (loading, or the value on screen) and no error flashes on the way out.
|
|
9
|
+
*
|
|
10
|
+
* if (isForbidden(error)) { void router.replace(elsewhere); return abandon(); }
|
|
11
|
+
*/
|
|
12
|
+
readonly abandon: () => never;
|
|
6
13
|
}
|
|
7
14
|
export interface LoadOptions {
|
|
8
15
|
/**
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { shallowRef as S, watch as k, getCurrentScope as C, onScopeDispose as D, computed as v } from "vue";
|
|
2
|
+
import { useI18n as E } from "vue-i18n";
|
|
3
|
+
import { u as x } from "./describeError-CvGmajU0.js";
|
|
4
|
+
const f = Symbol("vue-core.load.abandoned");
|
|
5
|
+
function M(m, t = {}) {
|
|
6
|
+
const { t: g } = E(), b = x(), p = t.errorMessage ?? ((a) => b(a, { fallback: g("core.resource.unavailable") })), e = S({ status: "loading" });
|
|
7
|
+
let u = 0, s = null;
|
|
8
|
+
function n() {
|
|
9
|
+
return s?.abort(), s = null, ++u;
|
|
10
|
+
}
|
|
11
|
+
async function l() {
|
|
12
|
+
const a = n(), i = e.value, r = "value" in i ? i : null;
|
|
13
|
+
e.value = r ? { status: "refreshing", value: r.value } : { status: "loading" };
|
|
14
|
+
const c = new AbortController();
|
|
15
|
+
s = c;
|
|
16
|
+
try {
|
|
17
|
+
const o = await m({ signal: c.signal, abandon: w });
|
|
18
|
+
a === u && (e.value = { status: "loaded", value: o });
|
|
19
|
+
} catch (o) {
|
|
20
|
+
if (a !== u || o === f) return;
|
|
21
|
+
const d = p(o);
|
|
22
|
+
e.value = r ? { status: "stale", value: r.value, error: d } : { status: "failed", error: d };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function w() {
|
|
26
|
+
throw f;
|
|
27
|
+
}
|
|
28
|
+
function h(a) {
|
|
29
|
+
n(), e.value = { status: "loaded", value: a };
|
|
30
|
+
}
|
|
31
|
+
function y() {
|
|
32
|
+
e.value = { status: "loading" }, l();
|
|
33
|
+
}
|
|
34
|
+
return t.watch !== void 0 ? k(t.watch, y, { immediate: t.immediate ?? !0 }) : (t.immediate ?? !0) && l(), C() && D(n), {
|
|
35
|
+
state: v(() => e.value),
|
|
36
|
+
data: v(() => "value" in e.value ? e.value.value : null),
|
|
37
|
+
reload: l,
|
|
38
|
+
update: h
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
M as u
|
|
43
|
+
};
|
package/package.json
CHANGED
package/dist/useLoad-CYRVx6HW.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { shallowRef as h, watch as k, getCurrentScope as y, onScopeDispose as C, computed as v } from "vue";
|
|
2
|
-
import { useI18n as D } from "vue-i18n";
|
|
3
|
-
import { u as E } from "./describeError-Ctga6GcS.js";
|
|
4
|
-
function I(f, t = {}) {
|
|
5
|
-
const { t: m } = D(), g = E(), p = t.errorMessage ?? ((a) => g(a, { fallback: m("core.resource.unavailable") })), e = h({ status: "loading" });
|
|
6
|
-
let s = 0, u = null;
|
|
7
|
-
function l() {
|
|
8
|
-
return u?.abort(), u = null, ++s;
|
|
9
|
-
}
|
|
10
|
-
async function o() {
|
|
11
|
-
const a = l(), i = e.value, r = "value" in i ? i : null;
|
|
12
|
-
e.value = r ? { status: "refreshing", value: r.value } : { status: "loading" };
|
|
13
|
-
const c = new AbortController();
|
|
14
|
-
u = c;
|
|
15
|
-
try {
|
|
16
|
-
const n = await f({ signal: c.signal });
|
|
17
|
-
a === s && (e.value = { status: "loaded", value: n });
|
|
18
|
-
} catch (n) {
|
|
19
|
-
if (a !== s) return;
|
|
20
|
-
const d = p(n);
|
|
21
|
-
e.value = r ? { status: "stale", value: r.value, error: d } : { status: "failed", error: d };
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function w(a) {
|
|
25
|
-
l(), e.value = { status: "loaded", value: a };
|
|
26
|
-
}
|
|
27
|
-
function b() {
|
|
28
|
-
e.value = { status: "loading" }, o();
|
|
29
|
-
}
|
|
30
|
-
return t.watch !== void 0 ? k(t.watch, b, { immediate: t.immediate ?? !0 }) : (t.immediate ?? !0) && o(), y() && C(l), {
|
|
31
|
-
state: v(() => e.value),
|
|
32
|
-
data: v(() => "value" in e.value ? e.value.value : null),
|
|
33
|
-
reload: o,
|
|
34
|
-
update: w
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
I as u
|
|
39
|
-
};
|