@wssto2/vue-core 0.4.13 → 0.4.15

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 (91) hide show
  1. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-LlfIPWsJ.js → ActionRow.vue_vue_type_script_setup_true_lang-CkvS5W6K.js} +1 -1
  2. package/dist/{Activity-DhVVSf60.js → Activity-4q26REYj.js} +6 -6
  3. package/dist/{Changes-Czs32zlz.js → Changes-CKIuGF8O.js} +5 -5
  4. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DkpFEHUw.js → CollectionPage.vue_vue_type_script_setup_true_lang-B17cUOzj.js} +2 -2
  5. package/dist/{DateField.vue_vue_type_script_setup_true_lang-GVasv8ao.js → DateField.vue_vue_type_script_setup_true_lang-DehwWm78.js} +17 -16
  6. package/dist/{DeadLetters-DBUALYXL.js → DeadLetters-DPGcQOz1.js} +4 -4
  7. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js +285 -0
  8. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DG2zdG_a.js → FormGroup.vue_vue_type_script_setup_true_lang-noYI9QMk.js} +1 -1
  9. package/dist/{FormView.vue_vue_type_script_setup_true_lang-cr0xNDXP.js → FormView.vue_vue_type_script_setup_true_lang-BcIbTMHN.js} +2 -2
  10. package/dist/{General-UWbJQLc8.js → General-CUA9b3ML.js} +10 -10
  11. package/dist/{NewRolePage-Dm7urTx0.js → NewRolePage-DBfCvDWA.js} +3 -3
  12. package/dist/NumberField.vue_vue_type_script_setup_true_lang-Dm6FfJ2T.js +126 -0
  13. package/dist/{ProfilePage-Ep75xf-u.js → ProfilePage-On-eAiJ-.js} +41 -41
  14. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CDZjkiU5.js → RoleEditor.vue_vue_type_script_setup_true_lang-fvAf3rQm.js} +44 -44
  15. package/dist/{RolePage-CQc_wV3b.js → RolePage-B8oul55j.js} +8 -8
  16. package/dist/{RolesPage-CG7InZ_u.js → RolesPage-DsXVivdj.js} +5 -5
  17. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-BMqWlpsL.js → SegmentedField.vue_vue_type_script_setup_true_lang-B2d55hrh.js} +7 -6
  18. package/dist/SelectField.vue_vue_type_script_setup_true_lang-DedKLLQK.js +443 -0
  19. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-D4k5QeWS.js → SessionList.vue_vue_type_script_setup_true_lang-CirlMdHb.js} +2 -2
  20. package/dist/{Sessions-_w3Tnevz.js → Sessions-BTyXDEuY.js} +4 -4
  21. package/dist/{SettingsPage-BNdeH-_0.js → SettingsPage-DHTmMgif.js} +9 -9
  22. package/dist/{SignIn-DIjshMpl.js → SignIn-DU4DE2wj.js} +6 -6
  23. package/dist/{SignInPage-C3-LHjo2.js → SignInPage-BA22kyOp.js} +3 -3
  24. package/dist/{SignIns-DNdLctGJ.js → SignIns-C8QAZBaL.js} +3 -3
  25. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-CM8yp9JQ.js → SwitchField.vue_vue_type_script_setup_true_lang-B2Z2hy_h.js} +11 -10
  26. package/dist/{TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js → TextField.vue_vue_type_script_setup_true_lang-nqnGG7Zc.js} +27 -26
  27. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-CqAWfABZ.js → TextareaField.vue_vue_type_script_setup_true_lang-BgIQyYtf.js} +9 -8
  28. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DWfAUlnz.js → TimeField.vue_vue_type_script_setup_true_lang-Dr0h-V_8.js} +25 -24
  29. package/dist/{UserRecord-C0JZgK47.js → UserRecord-D1BNmYp9.js} +10 -10
  30. package/dist/{UsersList-Bc8dCuRB.js → UsersList-ltx3G23-.js} +8 -8
  31. package/dist/access/index.js +1 -1
  32. package/dist/app/application.d.ts +13 -0
  33. package/dist/app/index.js +160 -159
  34. package/dist/collection/index.js +1 -1
  35. package/dist/control-CX9BG2UB.js +320 -0
  36. package/dist/describeError-B-NMa--w.js +53 -0
  37. package/dist/fieldMessages-DV6sESpn.js +25 -0
  38. package/dist/form/DateField.vue.d.ts +1 -0
  39. package/dist/form/DateTimeField.vue.d.ts +1 -0
  40. package/dist/form/Field.vue.d.ts +1 -0
  41. package/dist/form/FileField.vue.d.ts +1 -0
  42. package/dist/form/FormErrors.vue.d.ts +1 -1
  43. package/dist/form/FormRow.vue.d.ts +3 -0
  44. package/dist/form/I18nField.vue.d.ts +1 -0
  45. package/dist/form/MoneyField.vue.d.ts +1 -0
  46. package/dist/form/MonthYearField.vue.d.ts +1 -0
  47. package/dist/form/NumberField.vue.d.ts +5 -0
  48. package/dist/form/PhotoField.vue.d.ts +1 -0
  49. package/dist/form/SelectField.vue.d.ts +5 -6
  50. package/dist/form/SwitchField.vue.d.ts +1 -0
  51. package/dist/form/TextField.vue.d.ts +1 -0
  52. package/dist/form/TextareaField.vue.d.ts +1 -0
  53. package/dist/form/TimeField.vue.d.ts +1 -0
  54. package/dist/form/field.d.ts +3 -0
  55. package/dist/form/index.d.ts +2 -0
  56. package/dist/form/index.js +469 -456
  57. package/dist/form/useForm.d.ts +2 -2
  58. package/dist/form/useHiddenFieldErrors.d.ts +23 -0
  59. package/dist/form/useSaveChrome.d.ts +8 -3
  60. package/dist/i18n/describeError.d.ts +19 -1
  61. package/dist/i18n/index.d.ts +2 -2
  62. package/dist/i18n/index.js +8 -6
  63. package/dist/identity/fieldMessages.d.ts +1 -1
  64. package/dist/identity/index.js +1 -1
  65. package/dist/{index-Cz4LtYKa.js → index-BCw_Ki6z.js} +2 -2
  66. package/dist/{index-BesWsiIg.js → index-Chh4z9xW.js} +10 -10
  67. package/dist/{index-BEDhdJQE.js → index-DwdVrW6q.js} +15 -15
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/notifications/index.js +1 -1
  71. package/dist/phone/PhoneField.vue.d.ts +1 -0
  72. package/dist/phone/index.js +66 -65
  73. package/dist/resource/index.js +1 -1
  74. package/dist/resource/resource.d.ts +1 -1
  75. package/dist/{routeResource-DstM0hvf.js → routeResource-DlTsGTg_.js} +36 -32
  76. package/dist/state/index.js +1 -1
  77. package/dist/state/useLoad.d.ts +7 -0
  78. package/dist/{status-DfAac6vw.js → status-cWCAMAmW.js} +1 -1
  79. package/dist/{useCommand-BkONMn3X.js → useCommand-B-N6HJOz.js} +1 -1
  80. package/dist/useLoad-M7V-AVwR.js +43 -0
  81. package/dist/{useResourceForm-D1hIpwW5.js → useResourceForm-CP2lCwmD.js} +1 -1
  82. package/dist/useSaveChrome-7huA3FzR.js +26 -0
  83. package/package.json +1 -1
  84. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-BQb7wLT0.js +0 -276
  85. package/dist/NumberField.vue_vue_type_script_setup_true_lang-C7N5nq0P.js +0 -113
  86. package/dist/SelectField.vue_vue_type_script_setup_true_lang-BJoAkBo2.js +0 -437
  87. package/dist/control-7EP4tjYy.js +0 -313
  88. package/dist/describeError-Ctga6GcS.js +0 -41
  89. package/dist/fieldMessages-C3Rpbktw.js +0 -25
  90. package/dist/useLoad-CYRVx6HW.js +0 -39
  91. package/dist/useSaveChrome-DuWm0Czf.js +0 -25
@@ -1,313 +0,0 @@
1
- import { inject as q, ref as G, computed as r, onBeforeUnmount as C, defineComponent as F, useSlots as V, openBlock as l, createBlock as L, resolveDynamicComponent as T, unref as t, normalizeClass as y, withCtx as _, createElementBlock as a, renderSlot as f, createCommentVNode as n, createElementVNode as g, createTextVNode as x, toDisplayString as u, createVNode as D, useAttrs as K, useId as P, mergeProps as A, createSlots as M, mergeDefaults as O } from "vue";
2
- import { useI18n as U } from "vue-i18n";
3
- import { _ as I } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
4
- import { RouterLink as Y } from "vue-router";
5
- import { c as H, a as J } from "./controlSurface-t7OEFESJ.js";
6
- import { u as Q } from "./mediaQuery-CygcXmFW.js";
7
- const W = {
8
- label: void 0,
9
- hint: void 0,
10
- error: void 0,
11
- required: !1,
12
- editable: !0,
13
- disabled: !1,
14
- lockedReason: void 0,
15
- presentation: "control",
16
- name: void 0
17
- }, X = Symbol("vue-core.formGroup"), Z = Symbol("vue-core.formRowIndent"), ee = Symbol("vue-core.formEditable"), R = () => q(X, null), te = () => q(Z, 0);
18
- function oe(i) {
19
- const e = R(), d = q(ee, G(!0)), c = Q(), h = r(() => !!e && !!i.disabled && (c.value || i.presentation === "value")), v = r(() => (i.editable ?? !0) && d.value && !h.value), o = r(() => !!e && !!i.disabled && v.value);
20
- if (e) {
21
- const m = e.registerLocked(r(() => !!i.disabled && d.value && i.presentation !== "value"));
22
- C(m);
23
- }
24
- return { editable: v, locked: o };
25
- }
26
- const le = ["label", "hint", "error", "required", "editable", "disabled", "lockedReason", "presentation", "name"];
27
- function Re(i) {
28
- return Object.fromEntries(le.map((e) => [e, i[e]]));
29
- }
30
- const re = {
31
- key: 0,
32
- class: "flex shrink-0 items-center"
33
- }, ae = { class: "row-body min-h-row min-w-0 flex-1 border-t border-border-separator py-2 pr-row-inset" }, se = {
34
- key: 0,
35
- class: "text-content-destructive",
36
- "aria-hidden": "true"
37
- }, ne = ["id"], ie = {
38
- key: 0,
39
- class: "break-words text-body text-content-strong"
40
- }, de = ["id"], ue = /* @__PURE__ */ F({
41
- __name: "FormRow",
42
- props: {
43
- label: { default: void 0 },
44
- for: { default: void 0 },
45
- sub: { default: void 0 },
46
- subId: { default: void 0 },
47
- required: { type: Boolean, default: !1 },
48
- layout: { default: "entry" },
49
- value: { default: void 0 },
50
- to: { default: void 0 },
51
- error: { default: void 0 },
52
- errorId: { default: void 0 },
53
- indent: { default: 0 },
54
- labelLines: { default: void 0 },
55
- labelAlign: { default: "center" }
56
- },
57
- setup(i) {
58
- const e = i, d = V(), c = te(), h = r(() => c + e.indent), v = ["pl-row-inset", "pl-[calc(var(--app-row-inset)+1.25rem)]", "pl-[calc(var(--app-row-inset)+2.5rem)]"], o = { 1: "line-clamp-1", 2: "line-clamp-2", 3: "line-clamp-3" }, m = r(() => {
59
- switch (e.layout) {
60
- case "entry":
61
- return "grid grid-cols-[var(--form-label-width,11rem)_minmax(0,1fr)] items-center gap-x-4 compact:grid-cols-[minmax(0,auto)_minmax(40%,1fr)]";
62
- case "value":
63
- return "grid grid-cols-[minmax(min-content,1fr)_minmax(0,auto)] items-center gap-x-4";
64
- case "setting":
65
- return "flex items-center gap-4";
66
- default:
67
- return "flex flex-col gap-1";
68
- }
69
- }), S = r(() => e.layout === "stacked" ? "text-footnote text-content-muted" : e.layout === "value" ? "text-body text-content-muted" : "text-body text-content-strong"), p = r(() => e.value !== void 0 && e.value !== null && e.value !== "");
70
- return (b, w) => (l(), L(T(e.to ? t(Y) : "div"), {
71
- to: e.to,
72
- "data-test": "form-row",
73
- "data-layout": e.layout,
74
- "data-field-error": e.error ? "true" : void 0,
75
- class: y(["form-row flex min-w-0 items-stretch gap-3 transition-colors duration-motion-fast first:rounded-t-group last:rounded-b-group focus-within:bg-tint-soft/50 [&:first-child>.row-body]:border-t-0", [v[Math.min(h.value, 2)], e.to ? "hover:bg-fill focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus" : ""]])
76
- }, {
77
- default: _(() => [
78
- d.leading ? (l(), a("div", re, [
79
- f(b.$slots, "leading")
80
- ])) : n("", !0),
81
- g("div", ae, [
82
- g("div", {
83
- class: y(["min-w-0", m.value])
84
- }, [
85
- e.label || e.sub || d.sub ? (l(), a("div", {
86
- key: 0,
87
- class: y([e.layout === "setting" ? "min-w-min flex-1" : "min-w-0", e.labelAlign === "top" ? "self-start pt-1" : ""])
88
- }, [
89
- g("div", {
90
- class: y(d["label-trailing"] ? "flex items-center justify-between gap-3" : "")
91
- }, [
92
- (l(), L(T(e.for ? "label" : "span"), {
93
- for: e.for,
94
- class: y(["break-words", [S.value, e.labelLines ? o[e.labelLines] : "block"]])
95
- }, {
96
- default: _(() => [
97
- x(u(e.label), 1),
98
- e.required ? (l(), a("span", se, " *")) : n("", !0)
99
- ]),
100
- _: 1
101
- }, 8, ["for", "class"])),
102
- f(b.$slots, "label-trailing")
103
- ], 2),
104
- e.sub || d.sub ? (l(), a("small", {
105
- key: 0,
106
- id: e.subId,
107
- class: "mt-0.5 block text-footnote text-content-muted"
108
- }, [
109
- f(b.$slots, "sub", {}, () => [
110
- x(u(e.sub), 1)
111
- ])
112
- ], 8, ne)) : n("", !0)
113
- ], 2)) : n("", !0),
114
- g("div", {
115
- class: y(["flex min-w-0 items-center gap-2", e.layout === "value" ? "justify-end text-right" : e.layout === "setting" ? "flex-wrap justify-end text-right" : e.layout === "entry" ? "compact:justify-end" : ""])
116
- }, [
117
- f(b.$slots, "default", {}, () => [
118
- p.value ? (l(), a("span", ie, u(e.value), 1)) : n("", !0)
119
- ]),
120
- f(b.$slots, "trailing"),
121
- e.to ? (l(), L(t(I), {
122
- key: 0,
123
- name: "arrowRightSLine",
124
- size: 18,
125
- class: "shrink-0 text-content-disabled"
126
- })) : n("", !0)
127
- ], 2)
128
- ], 2),
129
- e.error ? (l(), a("p", {
130
- key: 0,
131
- id: e.errorId,
132
- class: "mt-1 flex items-start gap-1.5 text-footnote text-content-destructive",
133
- role: "alert"
134
- }, [
135
- D(t(I), {
136
- name: "alertTriangle",
137
- size: 14,
138
- class: "mt-px shrink-0"
139
- }),
140
- x(" " + u(e.error), 1)
141
- ], 8, de)) : n("", !0)
142
- ])
143
- ]),
144
- _: 3
145
- }, 8, ["to", "data-layout", "data-field-error", "class"]));
146
- }
147
- }), ce = ["title"], fe = {
148
- key: 0,
149
- class: "mr-1"
150
- }, ve = {
151
- key: 1,
152
- class: "ml-1 text-content-muted"
153
- }, me = {
154
- key: 3,
155
- class: "block text-body text-content-disabled"
156
- }, be = {
157
- key: 0,
158
- class: "sr-only"
159
- }, ye = ["data-field-error"], pe = {
160
- key: 0,
161
- class: "flex items-center justify-between gap-3"
162
- }, ge = ["for"], xe = {
163
- key: 0,
164
- class: "text-content-destructive",
165
- "aria-hidden": "true"
166
- }, he = ["id"], ke = ["id"], Ee = /* @__PURE__ */ F({
167
- __name: "Field",
168
- props: /* @__PURE__ */ O({
169
- label: {},
170
- hint: {},
171
- error: {},
172
- required: { type: Boolean },
173
- editable: { type: Boolean },
174
- disabled: { type: Boolean },
175
- lockedReason: {},
176
- presentation: {},
177
- name: {},
178
- value: { type: [String, Number, Boolean, null] },
179
- prefix: {},
180
- suffix: {},
181
- valueStyle: {},
182
- rowLayout: {},
183
- rowLabelAlign: {}
184
- }, { ...W, value: void 0, prefix: void 0, suffix: void 0, valueStyle: void 0, rowLayout: "entry", rowLabelAlign: "center" }),
185
- setup(i) {
186
- const e = i, { t: d } = U(), c = V(), h = K(), v = R(), { editable: o, locked: m } = oe(e), S = P(), p = r(() => e.name ?? S), b = r(() => `${p.value}-hint`), w = r(() => `${p.value}-error`);
187
- if (v?.registerField) {
188
- const s = h["data-field-key"], j = v.registerField(typeof s == "string" ? s : void 0, r(() => e.disabled));
189
- C(j);
190
- }
191
- const k = r(() => {
192
- const s = e.value;
193
- return s == null ? !1 : typeof s == "string" ? s.length > 0 : typeof s == "number" ? !Number.isNaN(s) : !0;
194
- }), E = r(() => typeof e.value == "boolean" ? e.value ? d("core.form.yes") : d("core.form.no") : e.value), z = r(() => !!v && !o.value && v.hideEmpty.value && !k.value && !c.readonly), N = r(() => [e.hint && o.value ? b.value : null, e.error ? w.value : null].filter(Boolean).join(" ") || void 0), $ = r(() => o.value ? e.rowLayout : e.rowLayout === "stacked" ? "stacked" : "value"), B = r(
195
- () => o.value && !m.value && e.required ? { "data-field-required": "true", "data-field-filled": k.value ? "true" : void 0 } : {}
196
- );
197
- return (s, j) => t(v) && !z.value ? (l(), L(ue, A({ key: 0 }, B.value, {
198
- label: e.label,
199
- for: t(o) ? p.value : void 0,
200
- sub: t(o) ? e.hint : void 0,
201
- "sub-id": b.value,
202
- required: t(o) && !t(m) && e.required,
203
- layout: $.value,
204
- "label-align": $.value === "entry" ? e.rowLabelAlign : void 0,
205
- error: t(o) ? e.error : void 0,
206
- "error-id": w.value,
207
- "data-field-locked": t(m) ? "true" : void 0
208
- }), M({
209
- default: _(() => [
210
- g("div", {
211
- class: "relative w-full min-w-0",
212
- title: t(m) ? e.lockedReason : void 0
213
- }, [
214
- g("div", {
215
- class: y(t(o) ? $.value === "setting" ? "flex min-w-0 flex-col items-end" : $.value === "stacked" ? "flex min-w-0 flex-col items-stretch" : "flex min-w-0 flex-col items-start compact:items-end" : "")
216
- }, [
217
- t(o) ? f(s.$slots, "default", {
218
- id: p.value,
219
- describedby: N.value,
220
- invalid: !!e.error,
221
- required: e.required,
222
- disabled: e.disabled
223
- }, void 0, void 0, 0) : t(c).readonly ? f(s.$slots, "readonly", {}, void 0, void 0, 1) : k.value ? (l(), a("span", {
224
- key: 2,
225
- class: y(["block break-words text-body text-content-strong", e.valueStyle === "mono" ? "font-mono" : e.valueStyle === "numeric" ? "tabular-nums" : ""])
226
- }, [
227
- e.prefix ? (l(), a("span", fe, u(e.prefix), 1)) : n("", !0),
228
- x(u(E.value), 1),
229
- e.suffix ? (l(), a("span", ve, u(e.suffix), 1)) : n("", !0)
230
- ], 2)) : (l(), a("span", me, u(t(d)("core.state.no_value")), 1))
231
- ], 2)
232
- ], 8, ce),
233
- t(m) && e.lockedReason ? (l(), a("span", be, u(e.lockedReason), 1)) : n("", !0)
234
- ]),
235
- _: 2
236
- }, [
237
- t(o) && t(c).trailing ? {
238
- name: "trailing",
239
- fn: _(() => [
240
- f(s.$slots, "trailing")
241
- ]),
242
- key: "0"
243
- } : void 0,
244
- t(o) && t(c).labelTrailing ? {
245
- name: "label-trailing",
246
- fn: _(() => [
247
- f(s.$slots, "labelTrailing")
248
- ]),
249
- key: "1"
250
- } : void 0
251
- ]), 1040, ["label", "for", "sub", "sub-id", "required", "layout", "label-align", "error", "error-id", "data-field-locked"])) : t(v) ? n("", !0) : (l(), a("div", A({ key: 1 }, B.value, {
252
- "data-field-error": e.error ? "true" : void 0,
253
- class: "flex min-w-0 flex-col gap-1"
254
- }), [
255
- e.label || t(o) && t(c).labelTrailing ? (l(), a("div", pe, [
256
- e.label ? (l(), a("label", {
257
- key: 0,
258
- for: t(o) ? p.value : void 0,
259
- class: "text-footnote font-medium text-content-muted"
260
- }, [
261
- x(u(e.label), 1),
262
- t(o) && e.required ? (l(), a("span", xe, " *")) : n("", !0)
263
- ], 8, ge)) : n("", !0),
264
- t(o) ? f(s.$slots, "labelTrailing", {}, void 0, void 0, 1) : n("", !0)
265
- ])) : n("", !0),
266
- t(o) ? f(s.$slots, "default", {
267
- id: p.value,
268
- describedby: N.value,
269
- invalid: !!e.error,
270
- required: e.required,
271
- disabled: e.disabled
272
- }, void 0, void 0, 1) : t(c).readonly ? f(s.$slots, "readonly", {}, void 0, void 0, 2) : (l(), a("span", {
273
- key: 3,
274
- class: y(["text-body", k.value ? "text-content-strong" : "text-content-disabled"])
275
- }, u(k.value ? `${e.prefix ?? ""}${E.value}${e.suffix ?? ""}` : t(d)("core.state.no_value")), 3)),
276
- e.hint && t(o) ? (l(), a("p", {
277
- key: 4,
278
- id: b.value,
279
- class: "text-footnote text-content-muted"
280
- }, u(e.hint), 9, he)) : n("", !0),
281
- e.error ? (l(), a("p", {
282
- key: 5,
283
- id: w.value,
284
- role: "alert",
285
- class: "flex items-start gap-1.5 text-footnote text-content-destructive"
286
- }, [
287
- D(t(I), {
288
- name: "alertTriangle",
289
- size: 14,
290
- class: "mt-px shrink-0"
291
- }),
292
- x(" " + u(e.error), 1)
293
- ], 8, ke)) : n("", !0)
294
- ], 16, ye));
295
- }
296
- }), _e = "rounded-control transition-[background-color,box-shadow,opacity] duration-motion-fast ease-motion-standard";
297
- function Ne(i, e) {
298
- const d = !!R();
299
- return r(() => d ? H({ kind: i, state: e() }) : [_e, ...J(i, e()).map(([c]) => c)].join(" "));
300
- }
301
- export {
302
- Ee as _,
303
- R as a,
304
- W as b,
305
- Ne as c,
306
- ee as d,
307
- ue as e,
308
- Re as f,
309
- X as g,
310
- Z as h,
311
- te as i,
312
- oe as u
313
- };
@@ -1,41 +0,0 @@
1
- import { useI18n as t } from "vue-i18n";
2
- import { a as i } from "./error-CD7x0Jrz.js";
3
- function u({ t: r, te: s }) {
4
- return (e, { fallback: o } = {}) => {
5
- const c = o ?? r("core.errors.unexpected");
6
- if (!i(e)) return c;
7
- if (e.code) {
8
- for (const n of [`errors.${e.code}`, `core.errors.${e.code}`])
9
- if (s(n)) return r(n, { ...e.params });
10
- if (e.message) return e.message;
11
- }
12
- switch (e.kind) {
13
- case "unauthorized":
14
- return r("core.errors.unauthenticated");
15
- case "forbidden":
16
- return r("core.errors.forbidden");
17
- case "notFound":
18
- return r("core.errors.not_found");
19
- case "conflict":
20
- return r("core.errors.conflict");
21
- case "network":
22
- return r("core.errors.offline");
23
- case "aborted":
24
- return r("core.errors.cancelled");
25
- case "server":
26
- case "malformed":
27
- return c;
28
- case "validation":
29
- if (Object.keys(e.fields).length > 0) return r("core.errors.check_fields");
30
- break;
31
- }
32
- return e.status === 429 ? r("core.errors.rate_limited") : o ?? (e.message || r("core.errors.unexpected"));
33
- };
34
- }
35
- function f() {
36
- const { t: r, te: s } = t();
37
- return u({ t: (e, o) => r(e, o ?? {}), te: (e) => s(e) });
38
- }
39
- export {
40
- f as u
41
- };
@@ -1,25 +0,0 @@
1
- import { useI18n as m } from "vue-i18n";
2
- import { a as c } from "./error-CD7x0Jrz.js";
3
- import { u as d } from "./format-B8mJm946.js";
4
- import { u as l } from "./describeError-Ctga6GcS.js";
5
- function g() {
6
- const { t: s, te: u } = m(), a = d(), f = l(), i = (e) => [`errors.${e}`, `core.errors.${e}`].find((t) => u(t));
7
- function n(e, t) {
8
- if (c(e) && e.code) {
9
- const r = i(e.code), o = typeof e.params?.locked_until == "string" ? new Date(e.params.locked_until) : null;
10
- if (r && o && !Number.isNaN(o.getTime())) return s(r, { ...e.params, locked_until: a.time(o) });
11
- }
12
- return f(e, t === void 0 ? void 0 : { fallback: t });
13
- }
14
- return {
15
- sentence: n,
16
- translate: (e) => {
17
- const t = i(e);
18
- return t === void 0 ? e : s(t);
19
- },
20
- failureMessage: (e, t) => c(t) && t.code && (e === "failed" || e === "forbidden" || e === "conflict") ? n(t) : void 0
21
- };
22
- }
23
- export {
24
- g as u
25
- };
@@ -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
- };
@@ -1,25 +0,0 @@
1
- import { computed as u, toValue as r } from "vue";
2
- import { useI18n as n } from "vue-i18n";
3
- import { u as s } from "./chrome-nUcmVu8G.js";
4
- import { a as m } from "./leaveGuard-Cc8yeLxM.js";
5
- function d(e) {
6
- const { t: a } = n(), l = u(() => (r(e.ready) ?? !0) && (r(e.allowed) ?? !0)), c = u(() => l.value && e.form.dirty.value);
7
- m(() => l.value && e.form.dirty.value), s({
8
- actions: () => l.value ? [
9
- {
10
- id: e.id ?? "save",
11
- label: r(e.label) ?? a("core.actions.save"),
12
- shortLabel: a("core.actions.save"),
13
- icon: "save",
14
- placement: "primary",
15
- processing: e.form.submitting.value,
16
- onClick: e.save
17
- }
18
- ] : [],
19
- leading: () => c.value ? { id: `${e.id ?? "save"}-cancel`, label: a("core.actions.cancel"), prominence: "plain", onClick: e.cancel } : null,
20
- status: () => c.value ? a("core.form.unsaved_changes") : null
21
- });
22
- }
23
- export {
24
- d as u
25
- };