@wssto2/vue-core 0.1.0 → 0.2.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 (95) hide show
  1. package/README.md +20 -9
  2. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-CKghARkW.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-CeKK8_g5.js} +2 -2
  3. package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-BZb4qKXo.js → AlertDialog.vue_vue_type_script_setup_true_lang-e4hzkzg3.js} +1 -1
  4. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-B82bl36A.js → AsyncSection.vue_vue_type_script_setup_true_lang-CWLB3xsR.js} +1 -1
  5. package/dist/Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js +51 -0
  6. package/dist/Button.vue_vue_type_script_setup_true_lang-B1eZgLae.js +182 -0
  7. package/dist/CountryFlag.vue_vue_type_script_setup_true_lang-Kry_vPPZ.js +299 -0
  8. package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-Bx5O1RZJ.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-DyhYHRyz.js} +1 -1
  9. package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-DH6EB8br.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CvwoT1JF.js} +1 -1
  10. package/dist/{Menu.vue_vue_type_script_setup_true_lang-D44EHXQZ.js → Menu.vue_vue_type_script_setup_true_lang-CrMj6KPD.js} +1 -1
  11. package/dist/{Modal.vue_vue_type_script_setup_true_lang-DYQgaUtj.js → Modal.vue_vue_type_script_setup_true_lang-BQZM49gC.js} +138 -128
  12. package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-DDVQXJRB.js → PhotoViewer.vue_vue_type_script_setup_true_lang-ElDizaW2.js} +1 -1
  13. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-DGcKX_OJ.js → SectionList.vue_vue_type_script_setup_true_lang-L9ita_Kx.js} +2 -2
  14. package/dist/SelectField.vue_vue_type_script_setup_true_lang-DZTrU8NJ.js +661 -0
  15. package/dist/{Sheet.vue_vue_type_script_setup_true_lang-BLBD5ps8.js → Sheet.vue_vue_type_script_setup_true_lang-CtkJ-4e3.js} +1 -1
  16. package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-BJWPVyfT.js → Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js} +1 -1
  17. package/dist/app/application.d.ts +5 -0
  18. package/dist/app/environment.d.ts +2 -0
  19. package/dist/app/index.js +75 -72
  20. package/dist/button/index.d.ts +1 -1
  21. package/dist/button/index.js +5 -3
  22. package/dist/button/shortcut.d.ts +28 -2
  23. package/dist/collection/CollectionPage.vue.d.ts +1 -0
  24. package/dist/collection/CollectionRows.vue.d.ts +59 -0
  25. package/dist/collection/CollectionTable.vue.d.ts +1 -1
  26. package/dist/collection/DataTable.vue.d.ts +47 -0
  27. package/dist/collection/RowActions.vue.d.ts +19 -0
  28. package/dist/collection/columns.d.ts +2 -0
  29. package/dist/collection/index.d.ts +4 -2
  30. package/dist/collection/index.js +1752 -1610
  31. package/dist/collection/rowLayout.d.ts +10 -0
  32. package/dist/collection/slots.d.ts +6 -3
  33. package/dist/describeError-l5T9b8Uv.js +41 -0
  34. package/dist/dialogStack-DZZg55w0.js +31 -0
  35. package/dist/form/CommandDialog.vue.d.ts +12 -1
  36. package/dist/form/FormGroup.vue.d.ts +1 -1
  37. package/dist/form/MultiSelectField.vue.d.ts +4 -1
  38. package/dist/form/NumberField.vue.d.ts +6 -0
  39. package/dist/form/OptionList.vue.d.ts +6 -2
  40. package/dist/form/SelectField.vue.d.ts +4 -1
  41. package/dist/form/index.d.ts +2 -0
  42. package/dist/form/index.js +1940 -2008
  43. package/dist/form/suggestions.d.ts +11 -0
  44. package/dist/form/useOptions.d.ts +60 -0
  45. package/dist/i18n/describeError.d.ts +31 -0
  46. package/dist/i18n/index.d.ts +26 -0
  47. package/dist/i18n/index.js +22 -20
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/internal/CountryFlag.vue.d.ts +10 -0
  51. package/dist/modal/Modal.vue.d.ts +4 -0
  52. package/dist/modal/ShortcutHelp.vue.d.ts +2 -0
  53. package/dist/modal/index.d.ts +2 -0
  54. package/dist/modal/index.js +64 -6
  55. package/dist/modal/placement.d.ts +22 -0
  56. package/dist/{options-CjSz2dQK.js → options-DAkBtYkI.js} +3 -3
  57. package/dist/overlay/Popover.vue.d.ts +3 -0
  58. package/dist/overlay/dialogStack.d.ts +9 -0
  59. package/dist/overlay/index.d.ts +1 -1
  60. package/dist/overlay/index.js +18 -17
  61. package/dist/page/index.js +4 -4
  62. package/dist/phone/index.js +247 -540
  63. package/dist/platform/AccessGate.vue.d.ts +50 -0
  64. package/dist/platform/index.d.ts +2 -0
  65. package/dist/platform/index.js +86 -66
  66. package/dist/resource/index.js +42 -42
  67. package/dist/shell/AccountMenuItem.vue.d.ts +3 -0
  68. package/dist/shell/NavigationList.vue.d.ts +1 -1
  69. package/dist/shell/index.js +406 -394
  70. package/dist/state/Badge.vue.d.ts +17 -10
  71. package/dist/state/hue.d.ts +8 -0
  72. package/dist/state/index.d.ts +2 -0
  73. package/dist/state/index.js +92 -56
  74. package/dist/state/useLoad.d.ts +41 -0
  75. package/dist/styles.css +1 -1
  76. package/dist/testing/app.d.ts +61 -0
  77. package/dist/testing/async.d.ts +12 -0
  78. package/dist/testing/collection.d.ts +18 -0
  79. package/dist/testing/format.d.ts +9 -0
  80. package/dist/testing/i18n.d.ts +16 -0
  81. package/dist/testing/index.d.ts +14 -0
  82. package/dist/testing/index.js +178 -0
  83. package/dist/testing/media.d.ts +23 -0
  84. package/dist/testing/platform.d.ts +40 -0
  85. package/dist/testing/transport.d.ts +40 -0
  86. package/dist/{toast-BTeX0r66.js → toast-DvrHQ6Ag.js} +45 -43
  87. package/dist/{useDialog-wmyNx2j_.js → useDialog-CXR3hN0G.js} +1 -1
  88. package/package.json +5 -1
  89. package/src/styles/theme.css +60 -0
  90. package/dist/Badge.vue_vue_type_script_setup_true_lang-DKc6ugmr.js +0 -31
  91. package/dist/Button.vue_vue_type_script_setup_true_lang-3f0emVNU.js +0 -141
  92. package/dist/SelectField.vue_vue_type_script_setup_true_lang-SyFWE33A.js +0 -422
  93. package/dist/dialogStack-DiTG1rZc.js +0 -26
  94. package/dist/phone/CountryFlag.vue.d.ts +0 -10
  95. /package/dist/{phone → internal}/flagLoaders.d.ts +0 -0
@@ -0,0 +1,50 @@
1
+ import type { Permission } from "./index";
2
+ /** Exactly one of `permission`, `any` or `all`; the others are not allowed, so two requirements cannot be mixed. */
3
+ export type AccessGateProps = {
4
+ permission: Permission;
5
+ any?: never;
6
+ all?: never;
7
+ } | {
8
+ permission?: never;
9
+ any: readonly Permission[];
10
+ all?: never;
11
+ } | {
12
+ permission?: never;
13
+ any?: never;
14
+ all: readonly Permission[];
15
+ };
16
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
17
+ permission: Permission;
18
+ any?: never;
19
+ all?: never;
20
+ } | {
21
+ permission?: never;
22
+ any: readonly Permission[];
23
+ all?: never;
24
+ } | {
25
+ permission?: never;
26
+ any?: never;
27
+ all: readonly Permission[];
28
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
29
+ permission: Permission;
30
+ any?: never;
31
+ all?: never;
32
+ } | {
33
+ permission?: never;
34
+ any: readonly Permission[];
35
+ all?: never;
36
+ } | {
37
+ permission?: never;
38
+ any?: never;
39
+ all: readonly Permission[];
40
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
41
+ default?: (props: {}) => any;
42
+ } & {
43
+ fallback?: (props: {}) => any;
44
+ }>;
45
+ export default _default;
46
+ type __VLS_WithSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
@@ -24,3 +24,5 @@ export interface PermissionRegistry {
24
24
  }
25
25
  /** Every permission identifier the application declared; any string until it declares some. */
26
26
  export type Permission = keyof PermissionRegistry extends never ? string : Extract<keyof PermissionRegistry, string>;
27
+ export { default as AccessGate } from "./AccessGate.vue";
28
+ export type { AccessGateProps } from "./AccessGate.vue";
@@ -1,108 +1,128 @@
1
- var N = Object.defineProperty;
2
- var B = (s) => {
1
+ var E = Object.defineProperty;
2
+ var x = (s) => {
3
3
  throw TypeError(s);
4
4
  };
5
- var E = (s, t, e) => t in s ? N(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
- var $ = (s, t, e) => E(s, typeof t != "symbol" ? t + "" : t, e), w = (s, t, e) => t.has(s) || B("Cannot " + e);
7
- var o = (s, t, e) => (w(s, t, "read from private field"), e ? e.call(s) : t.get(s)), h = (s, t, e) => t.has(s) ? B("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), f = (s, t, e, n) => (w(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), u = (s, t, e) => (w(s, t, "access private method"), e);
8
- import { b as J, c as L, a as M, d as T, h as q, i as F, p as K, e as z, f as D, u as G } from "../platform-jqlKVJ2e.js";
9
- import { M as Q, d as R } from "../context-Ch1r4fdN.js";
10
- class d extends Error {
11
- constructor(e, n = [], r) {
5
+ var N = (s, t, e) => t in s ? E(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
+ var $ = (s, t, e) => N(s, typeof t != "symbol" ? t + "" : t, e), w = (s, t, e) => t.has(s) || x("Cannot " + e);
7
+ var i = (s, t, e) => (w(s, t, "read from private field"), e ? e.call(s) : t.get(s)), f = (s, t, e) => t.has(s) ? x("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), u = (s, t, e, n) => (w(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), h = (s, t, e) => (w(s, t, "access private method"), e);
8
+ import { u as C } from "../platform-jqlKVJ2e.js";
9
+ import { b as F, c as K, a as z, d as D, h as H, i as Q, p as R, e as U, f as V } from "../platform-jqlKVJ2e.js";
10
+ import { M as X, d as Y } from "../context-Ch1r4fdN.js";
11
+ import { defineComponent as O, computed as P, renderSlot as B } from "vue";
12
+ class m extends Error {
13
+ constructor(e, n = [], o) {
12
14
  super(n.length > 0 ? `${e}: ${n.join("; ")}` : e);
13
15
  $(this, "issues");
14
16
  $(this, "cause");
15
- this.name = "BootstrapError", this.issues = n, this.cause = r?.cause;
17
+ this.name = "BootstrapError", this.issues = n, this.cause = o?.cause;
16
18
  }
17
19
  }
18
- const x = (s) => s === null ? "null" : Array.isArray(s) ? "array" : typeof s, j = (s) => typeof s == "object" && s !== null && !Array.isArray(s);
19
- var a, c, p, m, l, g;
20
+ const A = (s) => s === null ? "null" : Array.isArray(s) ? "array" : typeof s, S = (s) => typeof s == "object" && s !== null && !Array.isArray(s);
21
+ var a, c, p, g, l, d;
20
22
  const b = class b {
21
23
  /** @internal use the `fields` passed to `extend`. */
22
- constructor(t, e, n, r = !1) {
23
- h(this, l);
24
- h(this, a);
25
- h(this, c);
26
- h(this, p);
27
- h(this, m);
28
- f(this, a, t), f(this, c, e), f(this, p, n), f(this, m, r);
24
+ constructor(t, e, n, o = !1) {
25
+ f(this, l);
26
+ f(this, a);
27
+ f(this, c);
28
+ f(this, p);
29
+ f(this, g);
30
+ u(this, a, t), u(this, c, e), u(this, p, n), u(this, g, o);
29
31
  }
30
32
  /** Records a problem with `key`; for values `raw` returns that the application validates itself. */
31
33
  fail(t, e) {
32
- o(this, m) || o(this, p).push(`${o(this, c)}${t}: ${e}`);
34
+ i(this, g) || i(this, p).push(`${i(this, c)}${t}: ${e}`);
33
35
  }
34
36
  /** The value as sent, unchecked. Validate it and report with `fail`. */
35
37
  raw(t) {
36
- return o(this, a)[t];
38
+ return i(this, a)[t];
37
39
  }
38
40
  string(t, ...e) {
39
- return u(this, l, g).call(this, t, "string", (n) => typeof n == "string", e);
41
+ return h(this, l, d).call(this, t, "string", (n) => typeof n == "string", e);
40
42
  }
41
43
  number(t, ...e) {
42
- return u(this, l, g).call(this, t, "number", (n) => typeof n == "number" && Number.isFinite(n), e);
44
+ return h(this, l, d).call(this, t, "number", (n) => typeof n == "number" && Number.isFinite(n), e);
43
45
  }
44
46
  boolean(t, ...e) {
45
- return u(this, l, g).call(this, t, "boolean", (n) => typeof n == "boolean", e);
47
+ return h(this, l, d).call(this, t, "boolean", (n) => typeof n == "boolean", e);
46
48
  }
47
49
  stringList(t, ...e) {
48
- return u(this, l, g).call(this, t, "array of strings", (n) => Array.isArray(n) && n.every((r) => typeof r == "string"), e);
50
+ return h(this, l, d).call(this, t, "array of strings", (n) => Array.isArray(n) && n.every((o) => typeof o == "string"), e);
49
51
  }
50
52
  /** A nested object, read with the same checks; issues are reported as `parent.child`. */
51
53
  section(t) {
52
- const e = o(this, a)[t];
53
- return j(e) ? new b(e, `${o(this, c)}${t}.`, o(this, p)) : (this.fail(t, `expected object, got ${x(e)}`), new b({}, `${o(this, c)}${t}.`, o(this, p), !0));
54
+ const e = i(this, a)[t];
55
+ return S(e) ? new b(e, `${i(this, c)}${t}.`, i(this, p)) : (this.fail(t, `expected object, got ${A(e)}`), new b({}, `${i(this, c)}${t}.`, i(this, p), !0));
54
56
  }
55
57
  };
56
- a = new WeakMap(), c = new WeakMap(), p = new WeakMap(), m = new WeakMap(), l = new WeakSet(), g = function(t, e, n, r) {
57
- const i = o(this, a)[t];
58
- return i === void 0 && r.length > 0 ? r[0] : n(i) ? i : (this.fail(t, `expected ${e}, got ${i === void 0 ? "nothing (missing)" : x(i)}`), null);
58
+ a = new WeakMap(), c = new WeakMap(), p = new WeakMap(), g = new WeakMap(), l = new WeakSet(), d = function(t, e, n, o) {
59
+ const r = i(this, a)[t];
60
+ return r === void 0 && o.length > 0 ? o[0] : n(r) ? r : (this.fail(t, `expected ${e}, got ${r === void 0 ? "nothing (missing)" : A(r)}`), null);
59
61
  };
60
- let A = b;
61
- function O(s, t) {
62
- if (!j(s))
63
- throw new d("Invalid bootstrap config", [`expected a JSON object, got ${x(s)}`]);
64
- const e = [], n = new A(s, "", e), r = n.string("locale");
65
- r === "" && n.fail("locale", "must not be empty");
66
- const i = {
62
+ let v = b;
63
+ function _(s, t) {
64
+ if (!S(s))
65
+ throw new m("Invalid bootstrap config", [`expected a JSON object, got ${A(s)}`]);
66
+ const e = [], n = new v(s, "", e), o = n.string("locale");
67
+ o === "" && n.fail("locale", "must not be empty");
68
+ const r = {
67
69
  apiBase: n.string("api_base", ""),
68
- locale: r,
70
+ locale: o,
69
71
  appName: n.string("app_name", null),
70
72
  capabilities: n.stringList("capabilities", [])
71
73
  }, y = t?.(n) ?? {};
72
- if (e.length > 0) throw new d("Invalid bootstrap config", e);
73
- return { ...y, ...i };
74
+ if (e.length > 0) throw new m("Invalid bootstrap config", e);
75
+ return { ...y, ...r };
74
76
  }
75
- function C(s = {}) {
76
- const { element: t = "app-state", extend: e } = s, n = typeof t == "string" ? document.getElementById(t) : t, r = typeof t == "string" ? `#${t}` : "the given element";
77
+ function L(s = {}) {
78
+ const { element: t = "app-state", extend: e } = s, n = typeof t == "string" ? document.getElementById(t) : t, o = typeof t == "string" ? `#${t}` : "the given element";
77
79
  if (!n)
78
- throw new d(
79
- `Bootstrap config not found: the page has no ${r} element (expected <script id="app-state" type="application/json">)`
80
+ throw new m(
81
+ `Bootstrap config not found: the page has no ${o} element (expected <script id="app-state" type="application/json">)`
80
82
  );
81
- const i = n.textContent?.trim() ?? "";
82
- if (i === "") throw new d(`Bootstrap config is empty: ${r} has no content`);
83
+ const r = n.textContent?.trim() ?? "";
84
+ if (r === "") throw new m(`Bootstrap config is empty: ${o} has no content`);
83
85
  let y;
84
86
  try {
85
- y = JSON.parse(i);
86
- } catch (S) {
87
- throw new d(`Bootstrap config in ${r} is not valid JSON`, [], { cause: S });
87
+ y = JSON.parse(r);
88
+ } catch (j) {
89
+ throw new m(`Bootstrap config in ${o} is not valid JSON`, [], { cause: j });
88
90
  }
89
- return O(y, e);
91
+ return _(y, e);
90
92
  }
93
+ const M = /* @__PURE__ */ O({
94
+ __name: "AccessGate",
95
+ props: {
96
+ permission: {},
97
+ any: {},
98
+ all: {}
99
+ },
100
+ setup(s) {
101
+ const t = s, e = C().access, n = P(() => {
102
+ if (t.permission !== void 0) return e.can(t.permission);
103
+ if (t.any !== void 0) return e.canAny(t.any);
104
+ if (t.all !== void 0) return e.canAll(t.all);
105
+ throw new Error("AccessGate needs one of the props permission, any or all.");
106
+ });
107
+ return (o, r) => n.value ? B(o.$slots, "default", {}, void 0, void 0, 0) : B(o.$slots, "fallback", {}, void 0, void 0, 1);
108
+ }
109
+ });
91
110
  export {
92
- d as BootstrapError,
93
- A as BootstrapFields,
94
- Q as MissingContextError,
95
- J as beforeSignOutTimeout,
96
- L as createAccessClient,
97
- M as createPlatform,
98
- T as createSession,
99
- R as defineFeatureContext,
100
- q as httpSessionAdapter,
101
- F as installPlatform,
102
- O as parseBootstrap,
103
- K as parseNavigation,
104
- z as parseSessionPayload,
105
- D as platformKey,
106
- C as readBootstrap,
107
- G as usePlatform
111
+ M as AccessGate,
112
+ m as BootstrapError,
113
+ v as BootstrapFields,
114
+ X as MissingContextError,
115
+ F as beforeSignOutTimeout,
116
+ K as createAccessClient,
117
+ z as createPlatform,
118
+ D as createSession,
119
+ Y as defineFeatureContext,
120
+ H as httpSessionAdapter,
121
+ Q as installPlatform,
122
+ _ as parseBootstrap,
123
+ R as parseNavigation,
124
+ U as parseSessionPayload,
125
+ V as platformKey,
126
+ L as readBootstrap,
127
+ C as usePlatform
108
128
  };
@@ -1,64 +1,64 @@
1
- import { computed as f, toValue as K, shallowRef as F, watch as P, getCurrentScope as M, onScopeDispose as J, provide as U, hasInjectionContext as O, inject as W, defineComponent as V, openBlock as c, createElementBlock as $, unref as a, createBlock as h, withCtx as d, createVNode as b, normalizeClass as k, createElementVNode as q, toDisplayString as z, createSlots as j, renderSlot as _, createCommentVNode as G } from "vue";
1
+ import { computed as f, toValue as K, shallowRef as F, watch as P, getCurrentScope as M, onScopeDispose as J, provide as U, hasInjectionContext as O, inject as W, defineComponent as V, openBlock as c, createElementBlock as R, unref as a, createBlock as h, withCtx as d, createVNode as b, normalizeClass as k, createElementVNode as q, toDisplayString as z, createSlots as j, renderSlot as _, createCommentVNode as G } from "vue";
2
2
  import { useI18n as C } from "vue-i18n";
3
3
  import { i as S } from "../error-Bb_dr_Ay.js";
4
4
  import { useRoute as H, useRouter as Q, RouterLink as I } from "vue-router";
5
5
  import { M as N } from "../context-Ch1r4fdN.js";
6
- import { u as T } from "../Button.vue_vue_type_script_setup_true_lang-3f0emVNU.js";
6
+ import { u as T } from "../Button.vue_vue_type_script_setup_true_lang-B1eZgLae.js";
7
7
  import { _ as w } from "../Icon.vue_vue_type_script_lang-DtC4_mkz.js";
8
- import { _ as D } from "../Tooltip.vue_vue_type_script_setup_true_lang-BJWPVyfT.js";
9
- import { a as X } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-CKghARkW.js";
10
- import { _ as Y } from "../AsyncSection.vue_vue_type_script_setup_true_lang-B82bl36A.js";
8
+ import { _ as D } from "../Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js";
9
+ import { a as X } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-CeKK8_g5.js";
10
+ import { _ as Y } from "../AsyncSection.vue_vue_type_script_setup_true_lang-CWLB3xsR.js";
11
11
  import { _ as Z } from "../EmptyState.vue_vue_type_script_setup_true_lang-BeGpHMUP.js";
12
12
  function ee(t) {
13
13
  if (!/^\d+$/.test(t)) return null;
14
14
  const e = Number(t);
15
15
  return Number.isSafeInteger(e) && e > 0 ? e : null;
16
16
  }
17
- const te = (t) => typeof t == "object" && t !== null && "state" in t && "reload" in t && "id" in t, oe = (t) => typeof t == "object" && t !== null && "id" in t;
18
- function re(t) {
19
- const { t: e } = C(), r = te(t.for) ? t.for : null, i = f(() => r ? r.id.value : K(t.for)), u = f(() => r !== null && r.data.value === null), o = F({ status: "loading" });
17
+ const te = (t) => typeof t == "object" && t !== null && "state" in t && "reload" in t && "id" in t, re = (t) => typeof t == "object" && t !== null && "id" in t;
18
+ function oe(t) {
19
+ const { t: e } = C(), o = te(t.for) ? t.for : null, i = f(() => o ? o.id.value : K(t.for)), u = f(() => o !== null && o.data.value === null), r = F({ status: "loading" });
20
20
  let n = null, s = 0, m = null;
21
21
  const y = t.errorMessage ?? ((l) => S(l) && l.kind === "network" ? e("core.resource.offline") : S(l) && l.kind === "forbidden" ? e("core.no_access.body") : e("core.resource.unavailable"));
22
- function R() {
22
+ function $() {
23
23
  return m?.abort(), m = null, ++s;
24
24
  }
25
25
  async function A() {
26
- const l = i.value, p = R();
26
+ const l = i.value, p = $();
27
27
  if (u.value) {
28
- n = null, o.value = { status: "loading" };
28
+ n = null, r.value = { status: "loading" };
29
29
  return;
30
30
  }
31
31
  if (l === null) {
32
- n = null, o.value = { status: "failed", reason: "notFound", error: e("core.resource.not_found.body") };
32
+ n = null, r.value = { status: "failed", reason: "notFound", error: e("core.resource.not_found.body") };
33
33
  return;
34
34
  }
35
- const g = n === l && "value" in o.value ? o.value : null;
36
- g ? o.value = { status: "refreshing", value: g.value } : (n = null, o.value = { status: "loading" });
35
+ const g = n === l && "value" in r.value ? r.value : null;
36
+ g ? r.value = { status: "refreshing", value: g.value } : (n = null, r.value = { status: "loading" });
37
37
  const L = new AbortController();
38
38
  m = L;
39
39
  try {
40
40
  const v = await t.load(l, { signal: L.signal });
41
41
  if (p !== s) return;
42
- n = l, o.value = { status: "loaded", value: v };
42
+ n = l, r.value = { status: "loaded", value: v };
43
43
  } catch (v) {
44
44
  if (p !== s) return;
45
- S(v) && v.kind === "notFound" ? (n = null, o.value = { status: "failed", reason: "notFound", error: e("core.resource.not_found.body") }) : g ? o.value = { status: "stale", value: g.value, error: y(v) } : (n = null, o.value = { status: "failed", reason: "unavailable", error: y(v) });
45
+ S(v) && v.kind === "notFound" ? (n = null, r.value = { status: "failed", reason: "notFound", error: e("core.resource.not_found.body") }) : g ? r.value = { status: "stale", value: g.value, error: y(v) } : (n = null, r.value = { status: "failed", reason: "unavailable", error: y(v) });
46
46
  }
47
47
  }
48
48
  function B(l) {
49
- const p = i.value, g = t.identify ? t.identify(l) : oe(l) ? l.id : p;
50
- return p === null || g !== p ? !1 : (R(), n = p, o.value = { status: "loaded", value: l }, !0);
49
+ const p = i.value, g = t.identify ? t.identify(l) : re(l) ? l.id : p;
50
+ return p === null || g !== p ? !1 : ($(), n = p, r.value = { status: "loaded", value: l }, !0);
51
51
  }
52
- return P([i, u], () => void A(), { immediate: !0, flush: "sync" }), M() && J(R), {
52
+ return P([i, u], () => void A(), { immediate: !0, flush: "sync" }), M() && J($), {
53
53
  id: i,
54
- state: f(() => o.value),
55
- data: f(() => "value" in o.value ? o.value.value : null),
54
+ state: f(() => r.value),
55
+ data: f(() => "value" in r.value ? r.value.value : null),
56
56
  reload: A,
57
57
  update: B
58
58
  };
59
59
  }
60
60
  function he(t) {
61
- const e = H(), r = t.parse ?? ee, i = F(null);
61
+ const e = H(), o = t.parse ?? ee, i = F(null);
62
62
  let u = !1;
63
63
  P(
64
64
  () => e.params[t.param],
@@ -66,19 +66,19 @@ function he(t) {
66
66
  if (n === void 0 && u) return;
67
67
  u = !0;
68
68
  const s = Array.isArray(n) ? n[0] : n;
69
- i.value = s === void 0 ? null : r(s);
69
+ i.value = s === void 0 ? null : o(s);
70
70
  },
71
71
  { immediate: !0, flush: "sync" }
72
72
  );
73
- const o = re({ ...t, for: i });
74
- return t.key && U(t.key, o), o;
73
+ const r = oe({ ...t, for: i });
74
+ return t.key && U(t.key, r), r;
75
75
  }
76
76
  function ye(t) {
77
77
  const e = t.description ?? "route resource";
78
78
  if (!O()) throw new N(e, "outside-setup");
79
- const r = W(t, null);
80
- if (!r) throw new N(e, "not-provided");
81
- return r;
79
+ const o = W(t, null);
80
+ if (!o) throw new N(e, "not-provided");
81
+ return o;
82
82
  }
83
83
  const ne = ["aria-label"], se = {
84
84
  class: "min-w-14 px-1 text-center text-footnote tabular-nums text-content-muted compact:px-1.5",
@@ -90,13 +90,13 @@ const ne = ["aria-label"], se = {
90
90
  neighbors: {}
91
91
  },
92
92
  setup(t) {
93
- const e = t, { t: r } = C(), i = Q(), u = (o, n) => T({ key: o }, () => {
93
+ const e = t, { t: o } = C(), i = Q(), u = (r, n) => T({ key: r, group: "record", label: () => o(`core.resource.pager.${n}`) }, () => {
94
94
  const s = e.neighbors[n];
95
95
  if (!s) return !1;
96
96
  i.push(s);
97
97
  });
98
- return u("j", "next"), u("ArrowRight", "next"), u("k", "previous"), u("ArrowLeft", "previous"), (o, n) => (c(), $("nav", {
99
- "aria-label": a(r)("core.resource.pager.records"),
98
+ return u("j", "next"), u("ArrowRight", "next"), u("k", "previous"), u("ArrowLeft", "previous"), (r, n) => (c(), R("nav", {
99
+ "aria-label": a(o)("core.resource.pager.records"),
100
100
  "data-test": "record-pager",
101
101
  class: "inline-flex shrink-0 items-center rounded-button bg-fill p-0.5 compact:gap-0.5 compact:bg-surface-overlay compact:p-1 compact:shadow-float"
102
102
  }, [
@@ -104,12 +104,12 @@ const ne = ["aria-label"], se = {
104
104
  key: 0,
105
105
  side: "bottom",
106
106
  delay: 300,
107
- text: `${a(r)("core.resource.pager.previous")} (← / K)`
107
+ text: `${a(o)("core.resource.pager.previous")} (← / K)`
108
108
  }, {
109
109
  default: d(() => [
110
110
  b(a(I), {
111
111
  to: e.neighbors.previous,
112
- "aria-label": a(r)("core.resource.pager.previous"),
112
+ "aria-label": a(o)("core.resource.pager.previous"),
113
113
  "aria-keyshortcuts": "ArrowLeft K",
114
114
  "data-test": "pager-previous",
115
115
  class: k(x)
@@ -124,7 +124,7 @@ const ne = ["aria-label"], se = {
124
124
  }, 8, ["to", "aria-label"])
125
125
  ]),
126
126
  _: 1
127
- }, 8, ["text"])) : (c(), $("span", {
127
+ }, 8, ["text"])) : (c(), R("span", {
128
128
  key: 1,
129
129
  class: k([x, E]),
130
130
  "aria-hidden": "true"
@@ -139,12 +139,12 @@ const ne = ["aria-label"], se = {
139
139
  key: 2,
140
140
  side: "bottom",
141
141
  delay: 300,
142
- text: `${a(r)("core.resource.pager.next")} (→ / J)`
142
+ text: `${a(o)("core.resource.pager.next")} (→ / J)`
143
143
  }, {
144
144
  default: d(() => [
145
145
  b(a(I), {
146
146
  to: e.neighbors.next,
147
- "aria-label": a(r)("core.resource.pager.next"),
147
+ "aria-label": a(o)("core.resource.pager.next"),
148
148
  "aria-keyshortcuts": "ArrowRight J",
149
149
  "data-test": "pager-next",
150
150
  class: k(x)
@@ -159,7 +159,7 @@ const ne = ["aria-label"], se = {
159
159
  }, 8, ["to", "aria-label"])
160
160
  ]),
161
161
  _: 1
162
- }, 8, ["text"])) : (c(), $("span", {
162
+ }, 8, ["text"])) : (c(), R("span", {
163
163
  key: 3,
164
164
  class: k([x, E]),
165
165
  "aria-hidden": "true"
@@ -182,7 +182,7 @@ const ne = ["aria-label"], se = {
182
182
  width: { default: "content" }
183
183
  },
184
184
  setup(t) {
185
- const e = t, { t: r } = C(), i = f(() => e.resource.state.value), u = f(() => e.resource.data.value), o = f(() => i.value.status === "failed" && "reason" in i.value && i.value.reason === "notFound"), n = f(() => e.back ?? e.list?.back ?? null);
185
+ const e = t, { t: o } = C(), i = f(() => e.resource.state.value), u = f(() => e.resource.data.value), r = f(() => i.value.status === "failed" && "reason" in i.value && i.value.reason === "notFound"), n = f(() => e.back ?? e.list?.back ?? null);
186
186
  return (s, m) => (c(), h(X, {
187
187
  title: e.title,
188
188
  "document-title": e.title,
@@ -191,10 +191,10 @@ const ne = ["aria-label"], se = {
191
191
  width: e.width
192
192
  }, j({
193
193
  default: d(() => [
194
- o.value ? (c(), h(Z, {
194
+ r.value ? (c(), h(Z, {
195
195
  key: 0,
196
- title: a(r)("core.resource.not_found.title"),
197
- description: a(r)("core.resource.not_found.body"),
196
+ title: a(o)("core.resource.not_found.title"),
197
+ description: a(o)("core.resource.not_found.body"),
198
198
  icon: "errorWarningLine"
199
199
  }, null, 8, ["title", "description"])) : (c(), h(Y, {
200
200
  key: 1,
@@ -244,7 +244,7 @@ export {
244
244
  ae as RecordPager,
245
245
  ke as ResourcePage,
246
246
  ee as positiveInteger,
247
- re as useResource,
247
+ oe as useResource,
248
248
  he as useRouteResource,
249
249
  ye as useRouteResourceContext
250
250
  };
@@ -21,6 +21,8 @@ type __VLS_Props = {
21
21
  /** Makes the row a choice; the chosen one has a tick. */
22
22
  selected?: boolean;
23
23
  tone?: "critical";
24
+ /** A country flag (ISO 3166-1 code) in place of the icon: the row of a language. */
25
+ flag?: string;
24
26
  };
25
27
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
28
  click: () => any;
@@ -32,5 +34,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
32
34
  to: RouteLocationRaw;
33
35
  selected: boolean;
34
36
  checked: boolean;
37
+ flag: string;
35
38
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
39
  export default _default;
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
23
23
  onSelect?: ((to: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric) => any) | undefined;
24
24
  }>, {
25
25
  label: string;
26
- items: readonly NavigationItem[];
27
26
  appearance: "rail" | "drawer";
27
+ items: readonly NavigationItem[];
28
28
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
29
  export default _default;