@wssto2/vue-core 0.7.0 → 0.9.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 (107) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-CkomzGrt.js → AccessGate.vue_vue_type_script_setup_true_lang-B8gpkhbw.js} +1 -1
  3. package/dist/{Activity-CW2TOQAY.js → Activity-CfG8_Pp3.js} +7 -7
  4. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-9Lt1XggN.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-DC-zSRcl.js} +1 -1
  5. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-GxAsImnO.js → AsyncSection.vue_vue_type_script_setup_true_lang-BTIUz3cG.js} +1 -1
  6. package/dist/{Button.vue_vue_type_script_setup_true_lang-DQq_0P0p.js → Button.vue_vue_type_script_setup_true_lang-Dn-cJcj3.js} +67 -65
  7. package/dist/{Changes-BCaVkeZg.js → Changes-BT__0XX0.js} +6 -6
  8. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-BmXnfM5f.js → CollectionPage.vue_vue_type_script_setup_true_lang-Bcwwr8ng.js} +7 -7
  9. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DRWrCRLr.js → DataTable.vue_vue_type_script_setup_true_lang-CJlllQII.js} +1 -1
  10. package/dist/{DateField.vue_vue_type_script_setup_true_lang-DmYp54mq.js → DateField.vue_vue_type_script_setup_true_lang-BuQY5e5x.js} +2 -2
  11. package/dist/{DeadLetters-DUM_bsL-.js → DeadLetters-Btv3u3qh.js} +4 -4
  12. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-BTADNpwB.js → FormGroup.vue_vue_type_script_setup_true_lang-Bzm3yJy5.js} +1 -1
  13. package/dist/{General-Dsh0TJ5w.js → General-Cum9U4Z3.js} +6 -6
  14. package/dist/{IncidentRecord-C9zrjNrp.js → IncidentRecord-C4K8hDJ1.js} +10 -10
  15. package/dist/{IncidentsList-ClQOjd5c.js → IncidentsList-BHfJ1cbg.js} +16 -16
  16. package/dist/{Modal.vue_vue_type_script_setup_true_lang-4MsnTWyx.js → Modal.vue_vue_type_script_setup_true_lang-BqO9X_-u.js} +1 -1
  17. package/dist/{NewRolePage-Bw2_jXcQ.js → NewRolePage-BSvYZkH4.js} +4 -4
  18. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-C3nw944P.js → NumberField.vue_vue_type_script_setup_true_lang-CLN2COfp.js} +1 -1
  19. package/dist/{PageBar.vue_vue_type_script_setup_true_lang-DPpcZxuT.js → PageBar.vue_vue_type_script_setup_true_lang-OE8VgTkY.js} +1 -1
  20. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-07pq4SrY.js → PersonAccess.vue_vue_type_script_setup_true_lang-CBQ1kv8G.js} +7 -7
  21. package/dist/{ProfilePage-CJIztbx3.js → ProfilePage-Dnn_VUoB.js} +13 -13
  22. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DPm9q1P_.js → RecordHeader.vue_vue_type_script_setup_true_lang-CU7fZpp2.js} +1 -1
  23. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-Cm3tx76N.js → ResourcePage.vue_vue_type_script_setup_true_lang-y3gyR5A-.js} +3 -3
  24. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-DuQR8hFf.js → RoleEditor.vue_vue_type_script_setup_true_lang-BcUxVL9y.js} +5 -5
  25. package/dist/{RolePage-Yv6m6u7o.js → RolePage-BIY9dEME.js} +10 -10
  26. package/dist/{RolesPage-TibtzxzQ.js → RolesPage-Be35CA_4.js} +5 -5
  27. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-DAnZbfWA.js → SectionList.vue_vue_type_script_setup_true_lang-DzoE_o8v.js} +1 -1
  28. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-ivdGWUeF.js → SectionNavigator.vue_vue_type_script_setup_true_lang-CWPD9zQJ.js} +3 -3
  29. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-iJm8qmjT.js → SelectField.vue_vue_type_script_setup_true_lang-CYiarLAK.js} +1 -1
  30. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-D2Xj5mr7.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CKIq1Ljb.js} +7 -7
  31. package/dist/{ServiceAccountRecord-Ct3TrSqZ.js → ServiceAccountRecord-QsIfylwj.js} +13 -13
  32. package/dist/{ServiceAccountsList-CaXEp73j.js → ServiceAccountsList-CVDIhuCh.js} +7 -7
  33. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-BEKTaL0g.js → SessionList.vue_vue_type_script_setup_true_lang-CkN7vR71.js} +3 -3
  34. package/dist/{Sessions-Bg4Zk9Gf.js → Sessions-Cl2DTM7s.js} +5 -5
  35. package/dist/{SettingsPage-Brq9U4tJ.js → SettingsPage-B2uWw27O.js} +10 -10
  36. package/dist/{SignIn-DB5LRNlB.js → SignIn-BHYFSMOX.js} +5 -5
  37. package/dist/{SignInPage-Ts-iTaC1.js → SignInPage--OC0hQ8M.js} +3 -3
  38. package/dist/{SignIns-bCvvmCHF.js → SignIns-CJ09NqOn.js} +5 -5
  39. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-BwoE08jT.js → TimeField.vue_vue_type_script_setup_true_lang-B140Gjqd.js} +2 -2
  40. package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-u53rHMFG.js → Timestamp.vue_vue_type_script_setup_true_lang-CAz2W69d.js} +1 -1
  41. package/dist/{UserRecord-DgK9FsvV.js → UserRecord-BjXUcHo8.js} +9 -9
  42. package/dist/{UsersList-Due2ZkbO.js → UsersList-D4-eC5tC.js} +9 -9
  43. package/dist/access/index.js +4 -4
  44. package/dist/app/application.d.ts +4 -2
  45. package/dist/app/index.js +2 -2
  46. package/dist/application-DtY0ef-w.js +420 -0
  47. package/dist/button/index.js +1 -1
  48. package/dist/button/shortcut.d.ts +7 -0
  49. package/dist/client/client.d.ts +33 -0
  50. package/dist/client/disposition.d.ts +5 -0
  51. package/dist/client/index.d.ts +1 -1
  52. package/dist/client/index.js +1 -1
  53. package/dist/client-Dr2vV3qH.js +193 -0
  54. package/dist/collection/index.d.ts +1 -1
  55. package/dist/collection/index.js +81 -60
  56. package/dist/collection/savedViews.d.ts +12 -2
  57. package/dist/content/Money.vue.d.ts +31 -0
  58. package/dist/content/index.d.ts +1 -0
  59. package/dist/content/index.js +75 -40
  60. package/dist/{contributions-BQ9dZoRw.js → contributions-DGsAIWd8.js} +1 -1
  61. package/dist/{fieldMessages-DTXpWnBd.js → fieldMessages-6UTV9yWL.js} +1 -1
  62. package/dist/form/FileField.vue.d.ts +1 -1
  63. package/dist/form/PhotoField.vue.d.ts +1 -1
  64. package/dist/form/index.js +18 -18
  65. package/dist/format/format.d.ts +9 -1
  66. package/dist/format/index.js +1 -1
  67. package/dist/format-Dn-BOb-o.js +86 -0
  68. package/dist/{guards-BFCulig0.js → guards-Cz7TOQD8.js} +1 -1
  69. package/dist/identity/index.js +1 -1
  70. package/dist/incidents/index.js +1 -1
  71. package/dist/{index-CXTJ_1NV.js → index-BB0_hxmE.js} +16 -16
  72. package/dist/{index-i-cTTVxo.js → index-C1jSzT1V.js} +7 -7
  73. package/dist/{index-D5_GAqjA.js → index-DZQ3gy3e.js} +8 -8
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/modal/index.js +15 -15
  77. package/dist/modules/savedview/entities.d.ts +7 -0
  78. package/dist/modules/savedview/routes.d.ts +13 -0
  79. package/dist/modules/savedview/schemas.d.ts +11 -0
  80. package/dist/{navigation-BSC9X7FM.js → navigation-CWj6F_cV.js} +1 -1
  81. package/dist/{neighbors-BKzihEGQ.js → neighbors-CcCaurV5.js} +1 -1
  82. package/dist/notifications/index.js +1 -1
  83. package/dist/page/index.js +5 -5
  84. package/dist/platform/index.js +3 -3
  85. package/dist/{platform-Dr4iY3b8.js → platform-BZUWAXQV.js} +1 -1
  86. package/dist/pwa/index.d.ts +2 -0
  87. package/dist/pwa/index.js +51 -0
  88. package/dist/pwa/install.d.ts +12 -0
  89. package/dist/pwa/worker.d.ts +13 -0
  90. package/dist/resource/index.js +1 -1
  91. package/dist/router/index.js +3 -3
  92. package/dist/{rowLayout-Cz-K7jeo.js → rowLayout-BLhJ9-42.js} +4 -4
  93. package/dist/{sections-BXg4_ZhO.js → sections-CmqFs-U-.js} +1 -1
  94. package/dist/shell/index.js +3 -3
  95. package/dist/state/index.js +1 -1
  96. package/dist/{state-ChVIjayU.js → state-BiYPPKoj.js} +1 -1
  97. package/dist/{status-DZ4eSnAS.js → status-Bf4nfIe0.js} +1 -1
  98. package/dist/styles.css +1 -1
  99. package/dist/testing/index.js +2 -2
  100. package/dist/{useCommand-BIZX1ReM.js → useCommand-C3QTZIIw.js} +1 -1
  101. package/dist/{useGroupSheet-DxXzdKo3.js → useGroupSheet-LAnO37WV.js} +2 -2
  102. package/dist/{useRecordDialog-BLVSz7g3.js → useRecordDialog-Da1Sfak1.js} +1 -1
  103. package/dist/{useTypedEntry-CKuGqWT8.js → useTypedEntry-DIYdA7DK.js} +1 -1
  104. package/package.json +6 -2
  105. package/dist/application-D8Nm17zA.js +0 -420
  106. package/dist/client-CZgikXPG.js +0 -151
  107. package/dist/format-D8X4zsx6.js +0 -78
@@ -0,0 +1,193 @@
1
+ import { A as S, k as C, i as q } from "./error-Bb_dr_Ay.js";
2
+ function B(t) {
3
+ if (!t) return "";
4
+ const e = new URLSearchParams();
5
+ for (const [s, r] of Object.entries(t))
6
+ if (!(r == null || r === ""))
7
+ if (Array.isArray(r)) for (const o of r) e.append(s, String(o));
8
+ else e.append(s, String(r));
9
+ return e.toString();
10
+ }
11
+ const E = (t) => typeof Blob < "u" && t instanceof Blob;
12
+ function _(t) {
13
+ const e = new FormData();
14
+ for (const [s, r] of Object.entries(t))
15
+ if (r != null)
16
+ if (Array.isArray(r))
17
+ for (const o of r) e.append(`${s}[]`, j(o));
18
+ else
19
+ e.append(s, j(r));
20
+ return e;
21
+ }
22
+ function j(t) {
23
+ return E(t) ? t : t instanceof Date ? t.toISOString() : typeof t == "object" && t !== null ? JSON.stringify(t) : String(t);
24
+ }
25
+ function F(t) {
26
+ if (t === void 0) return { body: void 0, contentType: null };
27
+ if (typeof t == "string" || t instanceof FormData || t instanceof URLSearchParams || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || E(t))
28
+ return { body: t, contentType: null };
29
+ if (typeof t == "object" && t !== null && !Array.isArray(t)) {
30
+ const e = t;
31
+ if (Object.values(e).some((s) => E(s) || Array.isArray(s) && s.some(E)))
32
+ return { body: _(e), contentType: null };
33
+ }
34
+ return { body: JSON.stringify(t), contentType: "application/json" };
35
+ }
36
+ function N() {
37
+ const t = new Uint8Array(16);
38
+ return globalThis.crypto.getRandomValues(t), Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
39
+ }
40
+ const T = "X-Request-ID", R = (t) => typeof t == "object" && t !== null && !Array.isArray(t), A = (t) => typeof t == "string" && t !== "" ? t : null;
41
+ function P(t) {
42
+ const e = t?.errors ?? t?.fields;
43
+ if (!R(e)) return {};
44
+ const s = {};
45
+ for (const [r, o] of Object.entries(e))
46
+ Array.isArray(o) ? s[r] = o.map(String) : o != null && (s[r] = [String(o)]);
47
+ return s;
48
+ }
49
+ async function H(t) {
50
+ const e = await t.text();
51
+ if (e.trim() === "") return { payload: null, readable: !0 };
52
+ try {
53
+ return { payload: JSON.parse(e), readable: !0 };
54
+ } catch {
55
+ return { payload: null, readable: !1 };
56
+ }
57
+ }
58
+ async function k(t, e) {
59
+ const s = t.headers.get(T) ?? e, { payload: r, readable: o } = await H(t), c = R(r) ? r : null;
60
+ if (!t.ok) {
61
+ const b = P(c), p = c?.params;
62
+ throw new S({
63
+ kind: C(t.status, Object.keys(b).length > 0),
64
+ message: A(c?.error) ?? A(c?.message) ?? `Request failed with status ${t.status}`,
65
+ status: t.status,
66
+ fields: b,
67
+ code: A(c?.code),
68
+ params: R(p) ? p : null,
69
+ requestId: s,
70
+ payload: r
71
+ });
72
+ }
73
+ if (!o)
74
+ throw new S({
75
+ kind: "malformed",
76
+ message: `The server answered ${t.status} with a body that is not JSON`,
77
+ status: t.status,
78
+ requestId: s
79
+ });
80
+ return c !== null && typeof c.success == "boolean" ? {
81
+ data: c.data ?? null,
82
+ meta: c.meta ?? null,
83
+ message: A(c.message),
84
+ status: t.status,
85
+ requestId: s
86
+ } : { data: r, meta: null, message: null, status: t.status, requestId: s };
87
+ }
88
+ const J = /;\s*([^\s=;]+)\s*=\s*("(?:[^"\\]|\\.)*"|[^;]*)/g;
89
+ function L(t) {
90
+ const e = /^([^']*)'[^']*'(.*)$/s.exec(t);
91
+ if (!e) return null;
92
+ const s = new TextEncoder(), r = [];
93
+ for (const [, o, c] of e[2].matchAll(/%([0-9a-f]{2})|(.)/gis)) r.push(...o ? [parseInt(o, 16)] : s.encode(c));
94
+ try {
95
+ return new TextDecoder(e[1] || "utf-8", { fatal: !0 }).decode(Uint8Array.from(r));
96
+ } catch {
97
+ return null;
98
+ }
99
+ }
100
+ const G = (t) => t.slice(Math.max(t.lastIndexOf("/"), t.lastIndexOf("\\")) + 1).trim();
101
+ function Q(t) {
102
+ if (!t) return null;
103
+ let e = null, s = null;
104
+ for (const [, r, o] of t.replace(/^[^;]*/, "").matchAll(J)) {
105
+ const c = r.toLowerCase();
106
+ if (c !== "filename" && c !== "filename*") continue;
107
+ const p = o.startsWith('"') ? o.slice(1, -1).replace(/\\(.)/g, "$1") : o.trim();
108
+ c === "filename*" ? s ?? (s = L(p)) : e ?? (e = p);
109
+ }
110
+ return G(s ?? e ?? "") || null;
111
+ }
112
+ const V = (t, e) => globalThis.fetch(t, e), M = 20, Z = (t) => /^[a-z][a-z0-9+.-]*:\/\//i.test(t);
113
+ function W(t, e, s) {
114
+ const r = Z(e) || t === "" ? e : `${t.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}`;
115
+ return s === "" ? r : `${r}${r.includes("?") ? "&" : "?"}${s}`;
116
+ }
117
+ const $ = (t, e) => new S({ kind: "aborted", message: "The request was cancelled", requestId: t, cause: e });
118
+ function K(t = {}) {
119
+ const { baseUrl: e = "", transport: s = V, credentials: r = "include" } = t, o = [], c = (n) => {
120
+ n !== null && (o.push(n), o.length > M && o.shift());
121
+ };
122
+ async function b(n, a, i, u, h, m) {
123
+ const { signal: f } = u, l = t.requestId === !1 ? null : (t.requestId ?? N)();
124
+ if (f?.aborted) throw $(l, f.reason);
125
+ const y = F(i), w = new Headers({ Accept: h }), D = t.headers ? await t.headers() : void 0;
126
+ for (const d of [D, u.headers])
127
+ d && new Headers(d).forEach((v, z) => w.set(z, v));
128
+ l !== null && !w.has(T) && w.set(T, l), y.contentType !== null && !w.has("Content-Type") && w.set("Content-Type", y.contentType);
129
+ const U = { method: n, headers: w, credentials: r, body: y.body, signal: f }, O = W(e, a, B(u.query));
130
+ try {
131
+ const d = await s(O, U);
132
+ return await m(d, l);
133
+ } catch (d) {
134
+ throw q(d) ? (c(d.requestId), d) : f?.aborted || d instanceof Error && d.name === "AbortError" ? $(l, d) : (c(l), new S({
135
+ kind: "network",
136
+ message: d instanceof Error ? d.message : "The server could not be reached",
137
+ requestId: l,
138
+ cause: d
139
+ }));
140
+ }
141
+ }
142
+ async function p(n, a, i, u, h, m) {
143
+ try {
144
+ return await b(n, a, i, u, h, m);
145
+ } catch (f) {
146
+ if (!q(f) || f.kind !== "unauthorized" || u.handleUnauthorized === !1 || !t.onUnauthorized || await t.onUnauthorized({ error: f, method: n, path: a }) !== "retry") throw f;
147
+ return b(n, a, i, u, h, m);
148
+ }
149
+ }
150
+ const g = (n, a, i, u = {}) => p(n, a, i, u, "application/json", async (h, m) => {
151
+ const f = await k(h, m);
152
+ return c(f.requestId), f;
153
+ });
154
+ function I(n, a = {}, i) {
155
+ const { accept: u = "*/*", method: h = "GET", body: m, ...f } = a;
156
+ return p(h, n, m, f, u, async (l, y) => {
157
+ l.ok || await k(l, y);
158
+ const w = l.headers.get(T) ?? y;
159
+ return c(w), i(l, w);
160
+ });
161
+ }
162
+ async function x(n, a, i = {}) {
163
+ const u = typeof a == "object" && a !== null && !Array.isArray(a) ? { ...a } : {}, h = n.path.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (f, l) => {
164
+ const y = u[l];
165
+ if (y == null || y === "")
166
+ throw new Error(`${n.method} ${n.path}: the input has no value for the path parameter "${l}"`);
167
+ return delete u[l], encodeURIComponent(String(y));
168
+ }), m = Object.keys(u).length > 0;
169
+ return n.method === "GET" || n.method === "DELETE" ? g(n.method, h, void 0, { ...i, query: { ...u, ...i.query } }) : g(n.method, h, m ? u : void 0, i);
170
+ }
171
+ return {
172
+ // the rest-tuple overload is the public contract; the implementation takes its arguments positionally
173
+ request: x,
174
+ get: (n, a) => g("GET", n, void 0, a),
175
+ post: (n, a, i) => g("POST", n, a, i),
176
+ put: (n, a, i) => g("PUT", n, a, i),
177
+ patch: (n, a, i) => g("PATCH", n, a, i),
178
+ delete: (n, a) => g("DELETE", n, void 0, a),
179
+ download: (n, a) => I(n, a, async (i, u) => ({
180
+ blob: await i.blob(),
181
+ filename: Q(i.headers.get("Content-Disposition")),
182
+ requestId: u
183
+ })),
184
+ stream: (n, a) => I(n, a, async (i) => i),
185
+ recentRequestIds: () => [...o]
186
+ };
187
+ }
188
+ export {
189
+ M as R,
190
+ T as a,
191
+ K as c,
192
+ V as f
193
+ };
@@ -11,7 +11,7 @@ export { useCollectionBack } from "./back";
11
11
  export type { CollectionBackOptions } from "./back";
12
12
  export { useCollectionNeighbors } from "./neighbors";
13
13
  export type { CollectionNeighbors, Neighbor, NeighborOptions } from "./neighbors";
14
- export { createMemorySavedViews } from "./savedViews";
14
+ export { createMemorySavedViews, serverSavedViews } from "./savedViews";
15
15
  export type { SavedView, SavedViews, SavedViewState } from "./savedViews";
16
16
  export { default as CollectionPage } from "./CollectionPage.vue";
17
17
  export { default as CollectionTable } from "./CollectionTable.vue";
@@ -1,104 +1,125 @@
1
- import { D as I, d as N } from "../definition-C7QuyV3i.js";
2
- import { _ as z, a as M, u as O } from "../CollectionPage.vue_vue_type_script_setup_true_lang-BmXnfM5f.js";
3
- import { h as j, l as U, r as G } from "../http-nz92KjdS.js";
4
- import { L as Z } from "../state-ChVIjayU.js";
5
- import { u as H, a as J } from "../neighbors-BKzihEGQ.js";
6
- import { a as Q, b as W } from "../rowLayout-Cz-K7jeo.js";
7
- import { _ as ee } from "../DataTable.vue_vue_type_script_setup_true_lang-DRWrCRLr.js";
8
- import { defineComponent as v, openBlock as l, createElementBlock as c, Fragment as h, renderList as y, createBlock as C, unref as u, withCtx as k, normalizeClass as m, createVNode as p, createCommentVNode as g } from "vue";
9
- import { _ as b } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
10
- import { _ as w } from "../Tooltip.vue_vue_type_script_setup_true_lang-mErNPt8e.js";
11
- import { D as se, u as oe } from "../datePresets-DB13HHHd.js";
12
- function L(d = {}) {
13
- const s = new Map(Object.entries(d).map(([t, e]) => [t, [...e]]));
14
- let i = 1;
15
- const a = (t) => {
16
- let e = s.get(t);
17
- return e || s.set(t, e = []), e;
1
+ import { D as q, d as z } from "../definition-C7QuyV3i.js";
2
+ import { _ as j, a as G, u as U } from "../CollectionPage.vue_vue_type_script_setup_true_lang-Bcwwr8ng.js";
3
+ import { h as X, l as Z, r as H } from "../http-nz92KjdS.js";
4
+ import { L as Q } from "../state-BiYPPKoj.js";
5
+ import { u as Y, a as ee } from "../neighbors-CcCaurV5.js";
6
+ import { route as f } from "../client/index.js";
7
+ import { b as se, a as ae } from "../rowLayout-BLhJ9-42.js";
8
+ import { _ as ne } from "../DataTable.vue_vue_type_script_setup_true_lang-CJlllQII.js";
9
+ import { defineComponent as k, openBlock as d, createElementBlock as c, Fragment as C, renderList as g, createBlock as h, unref as m, withCtx as E, normalizeClass as p, createVNode as b, createCommentVNode as S } from "vue";
10
+ import { _ } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
11
+ import { _ as T } from "../Tooltip.vue_vue_type_script_setup_true_lang-mErNPt8e.js";
12
+ import { D as ie, u as le } from "../datePresets-DB13HHHd.js";
13
+ const v = {
14
+ index: f("GET", "/v1/saved-views"),
15
+ store: f("POST", "/v1/saved-views"),
16
+ delete: f("DELETE", "/v1/saved-views/:id")
17
+ }, x = ({ id: o, name: t, state: a }) => ({ id: o, name: t, state: a });
18
+ function I(o) {
19
+ return {
20
+ async list(t, { signal: a }) {
21
+ return (await o.request(v.index, { list: t }, { signal: a })).data.map(x);
22
+ },
23
+ async save(t, a, n) {
24
+ const s = JSON.stringify({ ...n, view: n.view || void 0 });
25
+ return x((await o.request(v.store, { list_key: t, name: a, state: s })).data);
26
+ },
27
+ async remove(t, a) {
28
+ await o.request(v.delete, { id: Number(a) });
29
+ }
30
+ };
31
+ }
32
+ function O(o = {}) {
33
+ const t = new Map(Object.entries(o).map(([s, e]) => [s, [...e]]));
34
+ let a = 1;
35
+ const n = (s) => {
36
+ let e = t.get(s);
37
+ return e || t.set(s, e = []), e;
18
38
  };
19
39
  return {
20
- async list(t) {
21
- return [...a(t)];
40
+ async list(s) {
41
+ return [...n(s)];
22
42
  },
23
- async save(t, e, r) {
24
- const o = a(t), n = o.findIndex((x) => x.name === e), f = { id: n === -1 ? `view-${i++}` : o[n].id, name: e, state: r };
25
- return n === -1 ? o.push(f) : o[n] = f, f;
43
+ async save(s, e, l) {
44
+ const r = n(s), i = r.findIndex((y) => y.name === e), u = { id: i === -1 ? `view-${a++}` : r[i].id, name: e, state: l };
45
+ return i === -1 ? r.push(u) : r[i] = u, u;
26
46
  },
27
- async remove(t, e) {
28
- const r = a(t), o = r.findIndex((n) => n.id === e);
29
- o !== -1 && r.splice(o, 1);
47
+ async remove(s, e) {
48
+ const l = n(s), r = l.findIndex((i) => i.id === e);
49
+ r !== -1 && l.splice(r, 1);
30
50
  }
31
51
  };
32
52
  }
33
- const E = {
53
+ const P = {
34
54
  key: 0,
35
55
  class: "flex items-center justify-center gap-1",
36
56
  "data-test": "row-actions"
37
- }, S = ["href", "target", "rel", "aria-label", "data-action"], T = ["aria-label", "data-action", "disabled", "onClick"], _ = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus", B = /* @__PURE__ */ v({
57
+ }, A = ["href", "target", "rel", "aria-label", "data-action"], D = ["aria-label", "data-action", "disabled", "onClick"], w = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus", V = /* @__PURE__ */ k({
38
58
  __name: "RowActions",
39
59
  props: {
40
60
  actions: {},
41
61
  disabled: { type: Boolean, default: !1 }
42
62
  },
43
- setup(d) {
44
- const s = d, i = (a) => a.tone === "critical" ? "text-status-danger-content hover:bg-status-danger-surface" : "text-content-link hover:bg-tint-soft";
45
- return (a, t) => s.actions.length > 0 ? (l(), c("div", E, [
46
- (l(!0), c(h, null, y(s.actions, (e) => (l(), C(u(w), {
63
+ setup(o) {
64
+ const t = o, a = (n) => n.tone === "critical" ? "text-status-danger-content hover:bg-status-danger-surface" : "text-content-link hover:bg-tint-soft";
65
+ return (n, s) => t.actions.length > 0 ? (d(), c("div", P, [
66
+ (d(!0), c(C, null, g(t.actions, (e) => (d(), h(m(T), {
47
67
  key: e.key,
48
68
  text: e.label,
49
69
  side: "left"
50
70
  }, {
51
- default: k(() => [
52
- e.href && !s.disabled ? (l(), c("a", {
71
+ default: E(() => [
72
+ e.href && !t.disabled ? (d(), c("a", {
53
73
  key: 0,
54
74
  href: e.href,
55
75
  target: e.external ? "_blank" : void 0,
56
76
  rel: e.external ? "noopener" : void 0,
57
77
  "aria-label": e.label,
58
78
  "data-action": e.key,
59
- class: m(["inline-flex rounded-md p-1.5 transition-colors", [i(e), _]])
79
+ class: p(["inline-flex rounded-md p-1.5 transition-colors", [a(e), w]])
60
80
  }, [
61
- p(u(b), {
81
+ b(m(_), {
62
82
  name: e.icon,
63
83
  size: 18
64
84
  }, null, 8, ["name"])
65
- ], 10, S)) : (l(), c("button", {
85
+ ], 10, A)) : (d(), c("button", {
66
86
  key: 1,
67
87
  type: "button",
68
88
  "aria-label": e.label,
69
89
  "data-action": e.key,
70
- disabled: s.disabled,
71
- class: m(["inline-flex cursor-pointer rounded-md p-1.5 transition-colors disabled:pointer-events-none disabled:opacity-40", [i(e), _]]),
72
- onClick: (r) => e.onSelect?.()
90
+ disabled: t.disabled,
91
+ class: p(["inline-flex cursor-pointer rounded-md p-1.5 transition-colors disabled:pointer-events-none disabled:opacity-40", [a(e), w]]),
92
+ onClick: (l) => e.onSelect?.()
73
93
  }, [
74
- p(u(b), {
94
+ b(m(_), {
75
95
  name: e.icon,
76
96
  size: 18
77
97
  }, null, 8, ["name"])
78
- ], 10, T))
98
+ ], 10, D))
79
99
  ]),
80
100
  _: 2
81
101
  }, 1032, ["text"]))), 128))
82
- ])) : g("", !0);
102
+ ])) : S("", !0);
83
103
  }
84
104
  });
85
105
  export {
86
- Q as CollectionCell,
87
- z as CollectionPage,
88
- M as CollectionTable,
89
- se as DATE_PRESETS,
90
- I as DEFAULT_PAGE_SIZES,
91
- ee as DataTable,
92
- Z as LIST_CONTEXT_PARAM,
93
- W as RecordIdentity,
94
- B as RowActions,
95
- L as createMemorySavedViews,
96
- N as defineCollection,
97
- j as httpList,
98
- U as listParams,
99
- G as readListPage,
100
- O as useCollection,
101
- H as useCollectionBack,
102
- J as useCollectionNeighbors,
103
- oe as useDatePresetFilter
106
+ se as CollectionCell,
107
+ j as CollectionPage,
108
+ G as CollectionTable,
109
+ ie as DATE_PRESETS,
110
+ q as DEFAULT_PAGE_SIZES,
111
+ ne as DataTable,
112
+ Q as LIST_CONTEXT_PARAM,
113
+ ae as RecordIdentity,
114
+ V as RowActions,
115
+ O as createMemorySavedViews,
116
+ z as defineCollection,
117
+ X as httpList,
118
+ Z as listParams,
119
+ H as readListPage,
120
+ I as serverSavedViews,
121
+ U as useCollection,
122
+ Y as useCollectionBack,
123
+ ee as useCollectionNeighbors,
124
+ le as useDatePresetFilter
104
125
  };
@@ -1,3 +1,4 @@
1
+ import type { HttpClient } from "../client";
1
2
  /**
2
3
  * What "Saved views" stores for a list: the filters, the search and the scope, stamped with the
3
4
  * definition's `stateVersion` so a view saved before the meaning of a key changed is migrated or
@@ -15,8 +16,8 @@ export interface SavedView {
15
16
  readonly state: SavedViewState;
16
17
  }
17
18
  /**
18
- * The seam to wherever an application keeps a person's saved views (go-core has no endpoint for it
19
- * yet). The application supplies one per list (`useCollection(def, { savedViews })`); the library
19
+ * The seam to wherever an application keeps a person's saved views (`serverSavedViews` is the one for
20
+ * go-core's `savedview` module). The application supplies one per list (`useCollection(def, { savedViews })`); the library
20
21
  * only reads, saves and removes through it. A saved view belongs to the signed-in person: the
21
22
  * adapter's backend decides who that is, the library clears what it loaded when the session changes.
22
23
  */
@@ -28,5 +29,14 @@ export interface SavedViews {
28
29
  save(listId: string, name: string, state: SavedViewState): Promise<SavedView>;
29
30
  remove(listId: string, id: SavedView["id"]): Promise<void>;
30
31
  }
32
+ /**
33
+ * `SavedViews` over go-core's `savedview` module (`GET | POST /v1/saved-views`, `DELETE /v1/saved-views/:id`): the
34
+ * signed-in person's views, kept per list id. Make it in `setup` over the platform's client and pass it to
35
+ * `useCollection(def, { savedViews: serverSavedViews(usePlatform().http) })`; a list that passes none has no saved views.
36
+ *
37
+ * The state travels as the library wrote it, `version` included: a view saved without one comes back without one
38
+ * and is skipped by `useCollection` like any view of another `stateVersion`.
39
+ */
40
+ export declare function serverSavedViews(http: HttpClient): SavedViews;
31
41
  /** An in-memory `SavedViews` for tests and the playground. It forgets everything on reload; not for an application. */
32
42
  export declare function createMemorySavedViews(initial?: Readonly<Record<string, readonly SavedView[]>>): SavedViews;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * An amount in major units (12.5 is twelve and a half), in the application's number format and its
3
+ * currency symbol (`createFormatting({ currencySymbol })`). Tabular figures, so digits line up in a
4
+ * column; the symbol a step quieter than the number. A missing amount reads as zero.
5
+ *
6
+ * <Money :amount="offer.price" /> <!-- 12.000,00 € -->
7
+ * <Money :amount="row.amount" :symbol="false" /> <!-- number only -->
8
+ * <Money :amount="price" whole empty-zero /> <!-- 39.600 €, and — for null or 0 -->
9
+ * <Money :amount="correction" signed /> <!-- + 250,00 € in green, − 250,00 € in red -->
10
+ */
11
+ type __VLS_Props = {
12
+ amount: number | null | undefined;
13
+ /** Show the currency symbol (default true; nothing shows when the application set none). */
14
+ symbol?: boolean;
15
+ /** Fraction digits (default 2). */
16
+ decimals?: number;
17
+ /** Drop the fraction of an amount that has none: "39.600", not "39.600,00". */
18
+ whole?: boolean;
19
+ /** Show "—" for null or 0: a missing price, not a free item. */
20
+ emptyZero?: boolean;
21
+ /** A change rather than an amount: "+" and green when it raises, "−" and red when it lowers, plain at 0. */
22
+ signed?: boolean;
23
+ };
24
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
25
+ symbol: boolean;
26
+ decimals: number;
27
+ whole: boolean;
28
+ emptyZero: boolean;
29
+ signed: boolean;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ export default _default;
@@ -4,5 +4,6 @@ export { initialsFor } from "./initials";
4
4
  export { default as KeyValue } from "./KeyValue.vue";
5
5
  export { default as KeyValueList, type KeyValueItem } from "./KeyValueList.vue";
6
6
  export { default as MicroLabel } from "./MicroLabel.vue";
7
+ export { default as Money } from "./Money.vue";
7
8
  export { default as Panel } from "./Panel.vue";
8
9
  export { default as Timestamp } from "./Timestamp.vue";
@@ -1,78 +1,113 @@
1
- import { _ as K, i as S } from "../Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
2
- import { defineComponent as o, openBlock as t, createElementBlock as l, createElementVNode as c, toDisplayString as u, createCommentVNode as d, normalizeClass as f, Fragment as _, renderList as g, createBlock as i, createSlots as x, withCtx as p, renderSlot as m, resolveDynamicComponent as y } from "vue";
3
- import { _ as b } from "../KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js";
4
- import { _ as F } from "../Panel.vue_vue_type_script_setup_true_lang-D_Wg42hu.js";
5
- import { _ as N } from "../Timestamp.vue_vue_type_script_setup_true_lang-u53rHMFG.js";
6
- const k = {
1
+ import { _ as G, i as P } from "../Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
2
+ import { defineComponent as c, openBlock as t, createElementBlock as n, createElementVNode as _, toDisplayString as u, createCommentVNode as i, normalizeClass as p, Fragment as d, renderList as w, createBlock as b, createSlots as $, withCtx as x, renderSlot as k, resolveDynamicComponent as B, computed as r, createTextVNode as g } from "vue";
3
+ import { _ as D } from "../KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js";
4
+ import { u as M } from "../format-Dn-BOb-o.js";
5
+ import { _ as j } from "../Panel.vue_vue_type_script_setup_true_lang-D_Wg42hu.js";
6
+ import { _ as H } from "../Timestamp.vue_vue_type_script_setup_true_lang-CAz2W69d.js";
7
+ const F = {
7
8
  role: "separator",
8
9
  class: "my-2 flex items-center gap-4"
9
- }, v = {
10
+ }, V = {
10
11
  key: 0,
11
12
  class: "select-none whitespace-nowrap font-mono text-2xs uppercase tracking-widest text-content-muted"
12
- }, D = /* @__PURE__ */ o({
13
+ }, K = /* @__PURE__ */ c({
13
14
  __name: "Divider",
14
15
  props: {
15
16
  label: {}
16
17
  },
17
- setup(s) {
18
- return (a, e) => (t(), l("div", k, [
19
- e[0] || (e[0] = c("span", { class: "h-px flex-1 bg-border-separator" }, null, -1)),
20
- s.label ? (t(), l("span", v, u(s.label), 1)) : d("", !0),
21
- e[1] || (e[1] = c("span", { class: "h-px flex-1 bg-border-separator" }, null, -1))
18
+ setup(l) {
19
+ return (e, a) => (t(), n("div", F, [
20
+ a[0] || (a[0] = _("span", { class: "h-px flex-1 bg-border-separator" }, null, -1)),
21
+ l.label ? (t(), n("span", V, u(l.label), 1)) : i("", !0),
22
+ a[1] || (a[1] = _("span", { class: "h-px flex-1 bg-border-separator" }, null, -1))
22
23
  ]));
23
24
  }
24
- }), L = /* @__PURE__ */ o({
25
+ }), I = /* @__PURE__ */ c({
25
26
  __name: "KeyValueList",
26
27
  props: {
27
28
  items: {},
28
29
  columns: { default: 1 }
29
30
  },
30
- setup(s) {
31
- const a = s, e = {
31
+ setup(l) {
32
+ const e = l, a = {
32
33
  1: "grid-cols-1",
33
34
  2: "grid-cols-1 sm:grid-cols-2",
34
35
  3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
35
36
  };
36
- return (n, $) => (t(), l("dl", {
37
- class: f(["grid gap-x-6 gap-y-3", e[a.columns]])
37
+ return (s, f) => (t(), n("dl", {
38
+ class: p(["grid gap-x-6 gap-y-3", a[e.columns]])
38
39
  }, [
39
- (t(!0), l(_, null, g(a.items, (r) => (t(), i(b, {
40
- key: r.key,
41
- label: r.label,
42
- value: r.value,
43
- "data-key": r.key
44
- }, x({ _: 2 }, [
45
- n.$slots.value ? {
40
+ (t(!0), n(d, null, w(e.items, (o) => (t(), b(D, {
41
+ key: o.key,
42
+ label: o.label,
43
+ value: o.value,
44
+ "data-key": o.key
45
+ }, $({ _: 2 }, [
46
+ s.$slots.value ? {
46
47
  name: "default",
47
- fn: p(() => [
48
- m(n.$slots, "value", { item: r })
48
+ fn: x(() => [
49
+ k(s.$slots, "value", { item: o })
49
50
  ]),
50
51
  key: "0"
51
52
  } : void 0
52
53
  ]), 1032, ["label", "value", "data-key"]))), 128))
53
54
  ], 2));
54
55
  }
55
- }), V = /* @__PURE__ */ o({
56
+ }), T = /* @__PURE__ */ c({
56
57
  __name: "MicroLabel",
57
58
  props: {
58
59
  as: { default: "span" }
59
60
  },
60
- setup(s) {
61
- return (a, e) => (t(), i(y(s.as), { class: "text-2xs font-semibold uppercase tracking-[0.06em] text-content-muted" }, {
62
- default: p(() => [
63
- m(a.$slots, "default")
61
+ setup(l) {
62
+ return (e, a) => (t(), b(B(l.as), { class: "text-2xs font-semibold uppercase tracking-[0.06em] text-content-muted" }, {
63
+ default: x(() => [
64
+ k(e.$slots, "default")
64
65
  ]),
65
66
  _: 3
66
67
  }));
67
68
  }
69
+ }), C = {
70
+ key: 0,
71
+ class: "mr-0.5"
72
+ }, Z = /* @__PURE__ */ c({
73
+ __name: "Money",
74
+ props: {
75
+ amount: {},
76
+ symbol: { type: Boolean, default: !0 },
77
+ decimals: { default: 2 },
78
+ whole: { type: Boolean, default: !1 },
79
+ emptyZero: { type: Boolean, default: !1 },
80
+ signed: { type: Boolean, default: !1 }
81
+ },
82
+ setup(l) {
83
+ const e = l, a = M(), s = r(() => typeof e.amount == "number" && Number.isFinite(e.amount) ? e.amount : 0), f = r(() => e.emptyZero && !s.value), o = r(() => !e.signed || !s.value || !Math.round(Math.abs(s.value) * 10 ** e.decimals) ? "" : s.value > 0 ? "+" : "−"), h = r(() => {
84
+ const m = e.whole && Number.isInteger(s.value) ? 0 : e.decimals;
85
+ return a.number(e.signed ? Math.abs(s.value) : s.value, { minimumFractionDigits: m, maximumFractionDigits: m });
86
+ }), y = r(() => o.value === "+" ? "font-medium text-status-success-content" : o.value === "−" ? "font-medium text-status-danger-content" : ""), v = r(() => e.symbol ? a.currencySymbol : "");
87
+ return (m, L) => (t(), n("span", {
88
+ class: p(["whitespace-nowrap tabular-nums", y.value])
89
+ }, [
90
+ f.value ? (t(), n(d, { key: 0 }, [
91
+ g("—")
92
+ ], 64)) : (t(), n(d, { key: 1 }, [
93
+ o.value ? (t(), n("span", C, u(o.value), 1)) : i("", !0),
94
+ g(u(h.value), 1),
95
+ v.value ? (t(), n("span", {
96
+ key: 1,
97
+ class: p(["ml-1 font-normal", y.value ? "opacity-75" : "text-content-muted"])
98
+ }, u(v.value), 3)) : i("", !0)
99
+ ], 64))
100
+ ], 2));
101
+ }
68
102
  });
69
103
  export {
70
- K as Avatar,
71
- D as Divider,
72
- b as KeyValue,
73
- L as KeyValueList,
74
- V as MicroLabel,
75
- F as Panel,
76
- N as Timestamp,
77
- S as initialsFor
104
+ G as Avatar,
105
+ K as Divider,
106
+ D as KeyValue,
107
+ I as KeyValueList,
108
+ T as MicroLabel,
109
+ Z as Money,
110
+ j as Panel,
111
+ H as Timestamp,
112
+ P as initialsFor
78
113
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as i, h as l } from "vue";
2
2
  import { d as u } from "./context-Ch1r4fdN.js";
3
- import { h as a } from "./platform-Dr4iY3b8.js";
3
+ import { h as a } from "./platform-BZUWAXQV.js";
4
4
  function h(o, n) {
5
5
  const t = o.map(({ contribution: e }) => e).sort((e, r) => (e.order ?? 0) - (r.order ?? 0));
6
6
  return {
@@ -1,6 +1,6 @@
1
1
  import { useI18n as m } from "vue-i18n";
2
2
  import { i as c } from "./error-Bb_dr_Ay.js";
3
- import { u as a } from "./format-D8X4zsx6.js";
3
+ import { u as a } from "./format-Dn-BOb-o.js";
4
4
  import { u as l } from "./describeError-BqGAUZgX.js";
5
5
  function E() {
6
6
  const { t: i, te: u } = m(), d = a(), f = l(), s = (e) => [`errors.${e}`, `core.errors.${e}`].find((t) => u(t));
@@ -34,12 +34,12 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
34
34
  error: string;
35
35
  required: boolean;
36
36
  presentation: "control" | "value";
37
+ accept: readonly string[];
37
38
  variant: "button" | "dropzone";
38
39
  labelHidden: boolean;
39
40
  hint: string;
40
41
  editable: boolean;
41
42
  lockedReason: string;
42
- accept: readonly string[];
43
43
  maxSize: number;
44
44
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
45
45
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;