@wssto2/vue-core 0.9.4 → 0.11.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 (169) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js +64 -0
  3. package/dist/Activity-CdkJW68R.js +169 -0
  4. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-DdJOodn8.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js} +147 -159
  5. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-BdeOKqz_.js → AsyncSection.vue_vue_type_script_setup_true_lang-DGzQ-Snp.js} +1 -1
  6. package/dist/BottomDockPortal.vue_vue_type_script_setup_true_lang-DmwR-2SP.js +17 -0
  7. package/dist/Button.vue_vue_type_script_setup_true_lang-C74hcb0N.js +123 -0
  8. package/dist/Changes-DxK_QfiB.js +69 -0
  9. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DHcekGNn.js → CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js} +19 -18
  10. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-8kBsNRuq.js → DataTable.vue_vue_type_script_setup_true_lang-C_ZytnW-.js} +1 -1
  11. package/dist/{DateField.vue_vue_type_script_setup_true_lang-BhKdCVFn.js → DateField.vue_vue_type_script_setup_true_lang-CeNwBbJT.js} +1 -1
  12. package/dist/{DeadLetters-Bb5pPlOY.js → DeadLetters-DnA7LP1w.js} +5 -6
  13. package/dist/DrawnCheck.vue_vue_type_script_setup_true_lang-9DzDJlIA.js +38 -0
  14. package/dist/FormGroup.vue_vue_type_script_setup_true_lang-D6jYfNjW.js +427 -0
  15. package/dist/{FormView.vue_vue_type_script_setup_true_lang-aaNnMIOi.js → FormView.vue_vue_type_script_setup_true_lang-DvbPEiNQ.js} +2 -2
  16. package/dist/{General-BAG7S6wV.js → General-2matxl2Y.js} +23 -24
  17. package/dist/Highlight.vue_vue_type_script_setup_true_lang-DZGBmwcX.js +29 -0
  18. package/dist/{IncidentRecord-D8aOpNHo.js → IncidentRecord-Bt3G4HlX.js} +14 -15
  19. package/dist/{IncidentsList-C0cFl0Db.js → IncidentsList-2iwgqp9J.js} +3 -3
  20. package/dist/{Modal.vue_vue_type_script_setup_true_lang-BlHhdmMy.js → Modal.vue_vue_type_script_setup_true_lang-DDS0iEnn.js} +9 -8
  21. package/dist/{NewRolePage-C6Iu-EQJ.js → NewRolePage-DhGFwvk3.js} +4 -4
  22. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-TGGAq8J-.js → NumberField.vue_vue_type_script_setup_true_lang-B3UrXNqH.js} +1 -1
  23. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-qz1tmYpF.js → PersonAccess.vue_vue_type_script_setup_true_lang-DbGZSNQc.js} +56 -56
  24. package/dist/ProfilePage-CpuyDBAv.js +685 -0
  25. package/dist/ProgressTrack.vue_vue_type_script_setup_true_lang-DrOm8k--.js +30 -0
  26. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-B9mN7UxZ.js → RecordHeader.vue_vue_type_script_setup_true_lang-DqGc3Jyo.js} +1 -1
  27. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-Cw8mGf_B.js → ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js} +3 -3
  28. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CJPvOVDV.js → RoleEditor.vue_vue_type_script_setup_true_lang-C0FIotFA.js} +11 -12
  29. package/dist/{RolePage-Dj_ocMnM.js → RolePage-DaNv049g.js} +10 -10
  30. package/dist/{RolesPage-PXrs4O-1.js → RolesPage-6hlzJes_.js} +6 -6
  31. package/dist/SearchInput.vue_vue_type_script_setup_true_lang-w4eAqyZ9.js +32 -0
  32. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-CtdF1zuv.js → SectionList.vue_vue_type_script_setup_true_lang-DR0_NsqC.js} +1 -1
  33. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-B5ove3rM.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js} +2 -2
  34. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-ChfDFAA2.js → SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js} +1 -1
  35. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BP8nAQwo.js → SelectField.vue_vue_type_script_setup_true_lang-BZwdANL3.js} +3 -3
  36. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-aWkKwxNe.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-FJbWxME_.js} +20 -20
  37. package/dist/{ServiceAccountRecord-bxX9yQkC.js → ServiceAccountRecord-0-JF5lRx.js} +24 -24
  38. package/dist/{ServiceAccountsList-BXE6htxk.js → ServiceAccountsList-DcsnOcf-.js} +32 -32
  39. package/dist/{Sessions--Gvc0kxw.js → Sessions-DgWhpk-i.js} +23 -24
  40. package/dist/{SettingsPage-DzDC7gD-.js → SettingsPage-BXPWATYU.js} +28 -30
  41. package/dist/{SignIn-CTI_699e.js → SignIn-DPoUwHZd.js} +9 -10
  42. package/dist/{SignInPage-HKC1bm2E.js → SignInPage-OyrVemro.js} +4 -4
  43. package/dist/SignIns-BMDrZVVp.js +64 -0
  44. package/dist/StatusLine.vue_vue_type_script_setup_true_lang-DsdQmLq6.js +56 -0
  45. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-BMA2YXTZ.js → SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js} +1 -1
  46. package/dist/{TextField.vue_vue_type_script_setup_true_lang-BFVsqcBX.js → TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js} +2 -2
  47. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-Dyh4Hhyl.js → TextareaField.vue_vue_type_script_setup_true_lang-D2j4s96s.js} +1 -1
  48. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-gGFfQLuK.js → TimeField.vue_vue_type_script_setup_true_lang-D-Em4glH.js} +1 -1
  49. package/dist/UserRecord-BW-gdCqi.js +202 -0
  50. package/dist/UsersList-B3ZF_1Dj.js +74 -0
  51. package/dist/access/index.js +4 -4
  52. package/dist/app/index.d.ts +1 -0
  53. package/dist/app/index.js +11 -10
  54. package/dist/app/languages.d.ts +8 -0
  55. package/dist/{application-BmXW6iW_.js → application-CuzT-0vW.js} +1 -1
  56. package/dist/button/index.js +6 -5
  57. package/dist/collection/Highlight.vue.d.ts +12 -0
  58. package/dist/collection/PickerModal.vue.d.ts +26 -0
  59. package/dist/collection/definition.d.ts +6 -6
  60. package/dist/collection/http.d.ts +6 -6
  61. package/dist/collection/index.d.ts +6 -1
  62. package/dist/collection/index.js +145 -85
  63. package/dist/collection/picker.d.ts +39 -0
  64. package/dist/collection/types.d.ts +9 -4
  65. package/dist/collection/useCollection.d.ts +5 -5
  66. package/dist/content/ActivityStream.vue.d.ts +62 -0
  67. package/dist/content/CommentThread.vue.d.ts +52 -0
  68. package/dist/content/Composer.vue.d.ts +36 -0
  69. package/dist/content/index.d.ts +3 -0
  70. package/dist/content/index.js +321 -56
  71. package/dist/controls/index.js +28 -54
  72. package/dist/form/index.js +132 -134
  73. package/dist/format/index.d.ts +1 -0
  74. package/dist/format/index.js +10 -6
  75. package/dist/format/slug.d.ts +8 -0
  76. package/dist/http-Dm0uXY9O.js +95 -0
  77. package/dist/i18n/index.d.ts +15 -0
  78. package/dist/i18n/index.js +89 -63
  79. package/dist/i18n/plural.d.ts +23 -0
  80. package/dist/i18n/serverMessages.d.ts +16 -0
  81. package/dist/identity/embed.d.ts +39 -0
  82. package/dist/identity/index.d.ts +22 -1
  83. package/dist/identity/index.js +40 -21
  84. package/dist/identity/session.d.ts +9 -1
  85. package/dist/identity/shared/ChangeFeed.vue.d.ts +6 -3
  86. package/dist/identity/users/context.d.ts +11 -0
  87. package/dist/identity/users/dialogs.d.ts +10 -0
  88. package/dist/identity/users/ext.d.ts +8 -0
  89. package/dist/identity/users/feature.d.ts +22 -1
  90. package/dist/identity/users/list.d.ts +12 -1
  91. package/dist/identity/users/personSections.d.ts +15 -6
  92. package/dist/identity/users/replace.d.ts +45 -0
  93. package/dist/identity/users/words.d.ts +28 -0
  94. package/dist/incidents/api.d.ts +1 -1
  95. package/dist/incidents/index.js +1 -1
  96. package/dist/{index-Dz0LkLM8.js → index-ClJeyW3F.js} +4 -4
  97. package/dist/index-Cq9TuOqH.js +1264 -0
  98. package/dist/{index-Dm-sdJJr.js → index-kEHY7hcG.js} +31 -32
  99. package/dist/index.d.ts +1 -1
  100. package/dist/index.js +1 -1
  101. package/dist/keepAlive-ClGnsIzT.js +55 -0
  102. package/dist/modal/index.js +3 -3
  103. package/dist/modules/identity/entities.d.ts +7 -0
  104. package/dist/modules/identity/routes.d.ts +8 -4
  105. package/dist/modules/identity/schemas.d.ts +16 -0
  106. package/dist/{neighbors-DVfU9T0o.js → neighbors-OyvGi233.js} +2 -2
  107. package/dist/notifications/deadletters/list.d.ts +1 -1
  108. package/dist/notifications/index.js +1 -1
  109. package/dist/{options-QuOkMKVZ.js → options-B48UiYsG.js} +2 -2
  110. package/dist/page/index.js +11 -11
  111. package/dist/phone/index.js +1 -1
  112. package/dist/pwa/AndroidInstallBanner.vue.d.ts +18 -0
  113. package/dist/pwa/InstallQrSheet.vue.d.ts +21 -0
  114. package/dist/pwa/IosInstallGuide.vue.d.ts +19 -0
  115. package/dist/pwa/QrCode.vue.d.ts +16 -0
  116. package/dist/pwa/index.d.ts +4 -0
  117. package/dist/pwa/index.js +244 -24
  118. package/dist/resource/index.js +1 -1
  119. package/dist/rowLayout-BsKEzEME.js +650 -0
  120. package/dist/shell/DarkModeRow.vue.d.ts +15 -0
  121. package/dist/shell/OfflineNotice.vue.d.ts +2 -0
  122. package/dist/shell/QuickSearchButton.vue.d.ts +2 -0
  123. package/dist/shell/QuickSearchPalette.vue.d.ts +12 -0
  124. package/dist/shell/darkMode.d.ts +26 -0
  125. package/dist/shell/index.d.ts +10 -0
  126. package/dist/shell/index.js +954 -579
  127. package/dist/shell/offlineNotice.d.ts +3 -0
  128. package/dist/shell/quickSearch.d.ts +14 -0
  129. package/dist/shell/quickSearchControl.d.ts +69 -0
  130. package/dist/shortcut-DUR6yPWA.js +93 -0
  131. package/dist/state/BackgroundTaskCapsule.vue.d.ts +18 -0
  132. package/dist/state/backgroundTasks.d.ts +58 -0
  133. package/dist/state/index.d.ts +4 -0
  134. package/dist/state/index.js +194 -80
  135. package/dist/state/useCountUp.d.ts +9 -0
  136. package/dist/styles.css +1 -1
  137. package/dist/{suggestions-BVQhoXzS.js → suggestions-q_v3M7G6.js} +1 -1
  138. package/dist/testing/collection.d.ts +1 -1
  139. package/dist/{useCommand-Dc8Lgs9h.js → useCommand-Ch_nx1AQ.js} +4 -4
  140. package/dist/{useGroupSheet-DQ6cVG-z.js → useGroupSheet-CPjHydQV.js} +14 -15
  141. package/dist/{useRecordDialog-BTsbHY38.js → useRecordDialog-DdkauXnU.js} +1 -1
  142. package/dist/{useResourceForm-DJ4Q75pq.js → useResourceForm-Dl6YFYyz.js} +1 -1
  143. package/package.json +3 -2
  144. package/dist/ActionRow.vue_vue_type_script_setup_true_lang-Cg1lhpcA.js +0 -45
  145. package/dist/Activity-29hsZ28j.js +0 -156
  146. package/dist/Button.vue_vue_type_script_setup_true_lang-Dp7OB-eF.js +0 -192
  147. package/dist/Changes-Dxjdkd_5.js +0 -129
  148. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-CIggKPtq.js +0 -295
  149. package/dist/FormGroup.vue_vue_type_script_setup_true_lang-B37dixvJ.js +0 -137
  150. package/dist/PageBar.vue_vue_type_script_setup_true_lang-qI94fjJv.js +0 -47
  151. package/dist/ProfilePage-BnohZIEg.js +0 -764
  152. package/dist/ProgressTrack.vue_vue_type_script_setup_true_lang-B6Prw9hi.js +0 -64
  153. package/dist/SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js +0 -23
  154. package/dist/SessionList.vue_vue_type_script_setup_true_lang-Cnyt5V8T.js +0 -133
  155. package/dist/SignIns-BcqBgWgN.js +0 -121
  156. package/dist/UserRecord-CtUPpbCt.js +0 -267
  157. package/dist/UsersList-BMkIgIg8.js +0 -155
  158. package/dist/definition-C7QuyV3i.js +0 -54
  159. package/dist/http-nz92KjdS.js +0 -42
  160. package/dist/identity/fieldMessages.d.ts +0 -15
  161. package/dist/identity/users/languages.d.ts +0 -4
  162. package/dist/index-CdtofdcJ.js +0 -501
  163. package/dist/keepAlive-z3IRFkQq.js +0 -46
  164. package/dist/languages-BShG9LpE.js +0 -10
  165. package/dist/rowLayout-CT8vWYgI.js +0 -663
  166. package/dist/signInEvents-DWShrJox.js +0 -30
  167. package/dist/status-BRA14qwX.js +0 -34
  168. package/dist/useWaitStatus-fsacMl4W.js +0 -24
  169. /package/dist/{fieldMessages-B6GHgi40.js → serverMessages-B6GHgi40.js} +0 -0
@@ -1,155 +0,0 @@
1
- import { defineComponent as U, openBlock as p, createBlock as C, unref as e, withCtx as c, createVNode as r, mergeProps as i, useTemplateRef as V, computed as q, createTextVNode as z, toDisplayString as $, createCommentVNode as A, createElementBlock as S, normalizeClass as N } from "vue";
2
- import { useI18n as B } from "vue-i18n";
3
- import { useRouter as P } from "vue-router";
4
- import { u as D, _ as I } from "./CollectionPage.vue_vue_type_script_setup_true_lang-DHcekGNn.js";
5
- import { _ as M } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
6
- import { u as F } from "./format-D8KUBmbS.js";
7
- import { u as L } from "./platform-BQOX_Ntw.js";
8
- import { _ as G } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
9
- import { i as K, g as E, h as W } from "./index-CdtofdcJ.js";
10
- import { U as j, u as H, s as J } from "./status-BRA14qwX.js";
11
- import { u as O } from "./environment-Dva-SG8D.js";
12
- import { u as Q } from "./languages-BShG9LpE.js";
13
- import { _ as X } from "./FormGroup.vue_vue_type_script_setup_true_lang-B37dixvJ.js";
14
- import { _ as Y } from "./SelectField.vue_vue_type_script_setup_true_lang-BP8nAQwo.js";
15
- import { _ as d } from "./TextField.vue_vue_type_script_setup_true_lang-BFVsqcBX.js";
16
- import { u as Z, _ as ee } from "./useCommand-Dc8Lgs9h.js";
17
- import { t as se } from "./toast-CqSDTWRX.js";
18
- import { u as te } from "./fieldMessages-B6GHgi40.js";
19
- const oe = /* @__PURE__ */ U({
20
- __name: "NewUserDialog",
21
- emits: ["created"],
22
- setup(T, { expose: o, emit: b }) {
23
- const { t } = B(), { http: g } = L(), h = O(), f = te(), w = Q(), y = () => ({ login: "", name: "", email: "", phone: "", locale: h.locale.value, password: "", repeat: "" }), m = (s) => s.trim() === "", k = {
24
- safeParse(s) {
25
- const { repeat: n, locale: R, ...u } = s, v = t("core.account.validation.required"), _ = ["login", "name", "email", "password"].filter((x) => m(u[x])).map((x) => ({ path: [x], message: v }));
26
- return R === null && _.push({ path: ["locale"], message: v }), !m(u.password) && n !== u.password && _.push({ path: ["repeat"], message: m(n) ? v : t("core.account.validation.mismatch") }), _.length > 0 ? { success: !1, error: { issues: _ } } : { success: !0, data: { ...u, locale: R ?? "", phone: m(u.phone) ? void 0 : u.phone } };
27
- }
28
- }, l = b, a = Z({
29
- ...f,
30
- defaults: y,
31
- validator: k,
32
- run: async (s) => (await g.request(K.usersCreate, s)).data,
33
- done: (s) => {
34
- se.success(t("core.users.create.done", { name: s.name })), l("created", s);
35
- }
36
- });
37
- return o({ create: () => a.present() }), (s, n) => (p(), C(e(ee), {
38
- command: e(a),
39
- title: e(t)("core.users.create.title"),
40
- subtitle: e(t)("core.users.create.subtitle"),
41
- "confirm-label": e(t)("core.users.create.action"),
42
- size: "md"
43
- }, {
44
- default: c(() => [
45
- r(e(X), { "label-width": "11rem" }, {
46
- default: c(() => [
47
- r(e(d), i(e(a).form.bind("name"), {
48
- label: e(t)("core.users.fields.name"),
49
- required: "",
50
- autocomplete: "off"
51
- }), null, 16, ["label"]),
52
- r(e(d), i(e(a).form.bind("login"), {
53
- label: e(t)("core.users.fields.login"),
54
- required: "",
55
- mono: "",
56
- autocomplete: "off"
57
- }), null, 16, ["label"]),
58
- r(e(d), i(e(a).form.bind("password"), {
59
- label: e(t)("core.users.fields.password"),
60
- type: "password",
61
- required: "",
62
- autocomplete: "new-password"
63
- }), null, 16, ["label"]),
64
- r(e(d), i(e(a).form.bind("repeat"), {
65
- label: e(t)("core.users.fields.password_repeat"),
66
- type: "password",
67
- required: "",
68
- autocomplete: "new-password"
69
- }), null, 16, ["label"]),
70
- r(e(d), i(e(a).form.bind("email"), {
71
- label: e(t)("core.users.fields.email"),
72
- type: "email",
73
- required: "",
74
- autocomplete: "off"
75
- }), null, 16, ["label"]),
76
- r(e(d), i(e(a).form.bind("phone"), {
77
- label: e(t)("core.users.fields.phone"),
78
- type: "tel",
79
- autocomplete: "off"
80
- }), null, 16, ["label"]),
81
- r(e(Y), i(e(a).form.bind("locale"), {
82
- label: e(t)("core.users.fields.locale"),
83
- options: e(w),
84
- required: ""
85
- }), null, 16, ["label", "options"])
86
- ]),
87
- _: 1
88
- })
89
- ]),
90
- _: 1
91
- }, 8, ["command", "title", "subtitle", "confirm-label"]));
92
- }
93
- }), ae = ["datetime"], xe = /* @__PURE__ */ U({
94
- __name: "UsersList",
95
- setup(T) {
96
- const { t: o } = B(), { http: b, access: t } = L(), g = F(), h = P(), f = V("dialog"), w = q(() => [
97
- { key: "name", label: o("core.users.columns.person"), kind: "identity", subtitle: (l) => l.email, sort: "name", mobile: "primary" },
98
- { key: "login", label: o("core.users.columns.login"), sort: "login", hideBelow: "md", width: 180, mobile: "hidden" },
99
- { key: "last_sign_in", label: o("core.users.columns.last_sign_in"), width: 170, mobile: "meta" },
100
- { key: "status", label: o("core.users.columns.status"), width: 130, mobile: "accessory" }
101
- ]), y = q(() => j.map((l) => ({ key: l, label: o(`core.users.views.${l}`) }))), m = D(H(b), { columns: w, views: y, state: { kind: "url", key: "query" }, recordRoute: (l) => E.record({ id: l.id }) }), k = q(
102
- () => t.can(W) ? [{ id: "create", label: o("core.users.create.title"), icon: "addLine", placement: "primary", compact: "icon", keyboardShortcut: { key: "N", ctrlKey: !0 }, onClick: () => f.value?.create() }] : []
103
- );
104
- return (l, a) => (p(), C(e(I), {
105
- collection: e(m),
106
- title: e(o)("core.users.title"),
107
- description: e(o)("core.users.description"),
108
- actions: k.value,
109
- "row-height": 64,
110
- "row-label": (s) => s.name,
111
- "views-presentation": "scope"
112
- }, {
113
- leading: c(({ item: s }) => [
114
- r(e(M), {
115
- name: s.name,
116
- size: "md",
117
- tone: "anchor"
118
- }, null, 8, ["name"])
119
- ]),
120
- "cell-last_sign_in": c(({ item: s, compact: n }) => [
121
- s.last_sign_in ? (p(), S("time", {
122
- key: 0,
123
- datetime: s.last_sign_in,
124
- class: N(["text-content", n ? "text-footnote text-content-muted" : "text-body"])
125
- }, $(e(g).dateTime(s.last_sign_in)), 11, ae)) : (p(), S("span", {
126
- key: 1,
127
- class: N(n ? "text-footnote text-content-disabled" : "text-body text-content-disabled")
128
- }, $(e(o)("core.users.never")), 3))
129
- ]),
130
- "cell-status": c(({ item: s, compact: n }) => [
131
- !n || s.status !== "active" ? (p(), C(e(G), {
132
- key: 0,
133
- tone: e(J)(s.status),
134
- dot: ""
135
- }, {
136
- default: c(() => [
137
- z($(e(o)(`core.users.status.${s.status}`)), 1)
138
- ]),
139
- _: 2
140
- }, 1032, ["tone"])) : A("", !0)
141
- ]),
142
- default: c(() => [
143
- r(oe, {
144
- ref_key: "dialog",
145
- ref: f,
146
- onCreated: a[0] || (a[0] = (s) => e(h).push(e(E).record({ id: s.id })))
147
- }, null, 512)
148
- ]),
149
- _: 1
150
- }, 8, ["collection", "title", "description", "actions", "row-label"]));
151
- }
152
- });
153
- export {
154
- xe as default
155
- };
@@ -1,54 +0,0 @@
1
- const w = [5, 8, 10, 15, 25, 50, 100], d = 25;
2
- function u(e) {
3
- const s = `defineCollection("${e.id}")`;
4
- if (typeof e.id != "string" || e.id.trim() === "") throw new Error("defineCollection: `id` must be a non-empty string.");
5
- if (!Number.isInteger(e.stateVersion) || e.stateVersion < 1) throw new Error(`${s}: \`stateVersion\` must be a positive integer.`);
6
- if (typeof e.load != "function") throw new Error(`${s}: \`load\` must be a function.`);
7
- if (typeof e.key != "function") throw new Error(`${s}: \`key\` must be a function.`);
8
- const r = {
9
- sorts: e.query?.sorts ? [...e.query.sorts] : null,
10
- filters: e.query?.filters ? [...e.query.filters] : null,
11
- views: e.query?.views ? [...e.query.views] : null,
12
- sensitive: [...e.query?.sensitive ?? []],
13
- pageSizes: [...e.query?.pageSizes ?? w],
14
- search: e.query?.search ?? !0
15
- };
16
- if (r.pageSizes.length === 0 || r.pageSizes.some((t) => !Number.isInteger(t) || t < 1))
17
- throw new Error(`${s}: \`query.pageSizes\` must list positive integers.`);
18
- for (const t of r.sensitive)
19
- if (r.filters && !r.filters.includes(t)) throw new Error(`${s}: sensitive filter "${t}" is not in \`query.filters\`.`);
20
- const i = e.defaults ?? {}, f = i.pageSize ?? (r.pageSizes.includes(d) ? d : r.pageSizes[0]);
21
- if (!r.pageSizes.includes(f)) throw new Error(`${s}: default page size ${f} is not one of ${r.pageSizes.join(", ")}.`);
22
- const o = i.sort ?? null;
23
- if (o !== null && r.sorts && !r.sorts.includes(o)) throw new Error(`${s}: default sort "${o}" is not in \`query.sorts\`.`);
24
- const n = i.view ?? null;
25
- if (n !== null && r.views && !r.views.includes(n)) throw new Error(`${s}: default view "${n}" is not in \`query.views\`.`);
26
- const a = Object.fromEntries(Object.entries(i.filters ?? {}).filter(([, t]) => t !== void 0 && t !== ""));
27
- for (const t of Object.keys(a))
28
- if (r.filters && !r.filters.includes(t)) throw new Error(`${s}: default filter "${t}" is not in \`query.filters\`.`);
29
- const l = i.page ?? 1;
30
- if (!Number.isInteger(l) || l < 1) throw new Error(`${s}: default page must be a positive integer.`);
31
- const c = i.direction ?? "asc";
32
- if (c !== "asc" && c !== "desc") throw new Error(`${s}: default direction must be "asc" or "desc".`);
33
- return Object.freeze({
34
- id: e.id,
35
- stateVersion: e.stateVersion,
36
- load: e.load,
37
- key: e.key,
38
- defaults: Object.freeze({
39
- page: l,
40
- pageSize: f,
41
- sort: o,
42
- direction: c,
43
- search: i.search ?? "",
44
- view: n,
45
- filters: Object.freeze(a)
46
- }),
47
- contract: Object.freeze(r),
48
- migrate: e.migrate
49
- });
50
- }
51
- export {
52
- w as D,
53
- u as d
54
- };
@@ -1,42 +0,0 @@
1
- const c = (t) => typeof t == "object" && t !== null && !Array.isArray(t), n = (...t) => {
2
- for (const o of t) if (typeof o == "number" && Number.isFinite(o)) return o;
3
- return null;
4
- };
5
- function A(t) {
6
- return {
7
- // Filters first: the reserved names below always win, a filter called "page" cannot break paging.
8
- ...t.filters,
9
- page: t.page,
10
- per_page: t.pageSize,
11
- order_col: t.sort,
12
- order_dir: t.sort ? t.direction : null,
13
- search: t.search,
14
- view: t.view
15
- };
16
- }
17
- function _(t, o) {
18
- const r = t.data, i = c(r) && Array.isArray(r.data), s = Array.isArray(r) ? r : i ? r.data : [], a = i ? r : {}, e = c(t.meta) ? t.meta : c(a.meta) ? a.meta : {}, p = n(a.per_page, e.per_page) ?? o.pageSize, g = n(a.total, e.total) ?? s.length, d = n(a.current_page, e.page, e.current_page) ?? o.page, m = n(a.last_page, e.last_page) ?? (g === 0 ? 0 : Math.ceil(g / Math.max(1, p))), f = n(a.from, e.from) ?? (s.length === 0 ? 0 : (d - 1) * p + 1), h = n(a.to, e.to) ?? (s.length === 0 ? 0 : f + s.length - 1), y = Array.isArray(e.views) ? e.views : Array.isArray(a.views) ? a.views : void 0;
19
- return {
20
- rows: s,
21
- total: g,
22
- page: d,
23
- pageSize: p,
24
- lastPage: m,
25
- from: f,
26
- to: h,
27
- views: y?.filter(c).flatMap((l) => typeof l.key == "string" ? [{ key: l.key, count: n(l.count) ?? void 0 }] : []),
28
- meta: e,
29
- requestId: t.requestId
30
- };
31
- }
32
- function u(t, o, r = {}) {
33
- return async (i, { signal: s }) => {
34
- const a = await t.get(o, { query: r.params ? r.params(i) : A(i), signal: s });
35
- return _(a, i);
36
- };
37
- }
38
- export {
39
- u as h,
40
- A as l,
41
- _ as r
42
- };
@@ -1,15 +0,0 @@
1
- import type { FormFailureKind } from "../form";
2
- /**
3
- * What a form of these screens needs to speak go-core's refusals, in the app's language (an app's `errors.<reason>` first, then
4
- * `core.errors.<reason>`): the reason of a field (`identity.email.taken`) becomes a sentence; a refusal of the whole action (a
5
- * veto of the application's deactivation hook, a lock) says its reason instead of the generic line; a time a lock ends (`locked_until`)
6
- * reads as a time of day. Spread into `useForm` / `useCommand`; `sentence` is the same for a toast or a line of your own:
7
- *
8
- * const messages = useServerMessages();
9
- * useCommand({ ...messages, run, done });
10
- */
11
- export declare function useServerMessages(): {
12
- sentence: (error: unknown, fallback?: string) => string;
13
- describeFieldError: (message: string) => string;
14
- failureMessage: (kind: FormFailureKind, error: unknown) => string | undefined;
15
- };
@@ -1,4 +0,0 @@
1
- import { type ComputedRef } from "vue";
2
- import type { SelectOption } from "../../form";
3
- /** The languages the application offers, as the options of a select (each named in itself). */
4
- export declare function useLanguages(): ComputedRef<readonly SelectOption<string>[]>;