@wssto2/vue-core 0.4.19 → 0.4.21

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 (58) hide show
  1. package/dist/{Activity-CLyG5Y9o.js → Activity-DX-RK9xj.js} +3 -3
  2. package/dist/{Changes-xF1VMbqD.js → Changes-_nARQ9IC.js} +2 -2
  3. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-nojILoAf.js → CollectionPage.vue_vue_type_script_setup_true_lang-BNM_cbXa.js} +2 -2
  4. package/dist/DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js +281 -0
  5. package/dist/{DeadLetters-AbbNs69D.js → DeadLetters-O6QReswO.js} +2 -2
  6. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-C7nq7MJB.js → FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js} +2 -1
  7. package/dist/{General-De4Q6Wfn.js → General-CkZoXu29.js} +4 -4
  8. package/dist/{NewRolePage-QAv_XsT0.js → NewRolePage-OosTaMfZ.js} +2 -2
  9. package/dist/NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js +161 -0
  10. package/dist/{ProfilePage-CjjKhkHX.js → ProfilePage-Dn8fQ3ff.js} +3 -3
  11. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-FLJk6Kb2.js → RoleEditor.vue_vue_type_script_setup_true_lang-2IOio1Sa.js} +4 -4
  12. package/dist/{RolePage-De7s2sYr.js → RolePage-33RUvHYD.js} +5 -5
  13. package/dist/{RolesPage-TXQKtK_J.js → RolesPage-BGPoUCMP.js} +3 -3
  14. package/dist/SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js +515 -0
  15. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-CuxVe7rm.js → SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js} +1 -1
  16. package/dist/{Sessions-BDLI0o-z.js → Sessions-BbAdbjmG.js} +2 -2
  17. package/dist/{SettingsPage-Kzcqv91E.js → SettingsPage-D47NSOYW.js} +3 -3
  18. package/dist/{SignIn-DKo46hNK.js → SignIn-DDCRzlUq.js} +2 -2
  19. package/dist/{SignInPage-B2v3is80.js → SignInPage-D9jryXA7.js} +2 -2
  20. package/dist/{SignIns-D-_a_S6O.js → SignIns-C_5sRrB4.js} +1 -1
  21. package/dist/{TextField.vue_vue_type_script_setup_true_lang-BslHroDP.js → TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js} +114 -111
  22. package/dist/TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js +93 -0
  23. package/dist/TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js +190 -0
  24. package/dist/{UserRecord-BR70ai9q.js → UserRecord-CUhbz62x.js} +5 -5
  25. package/dist/{UsersList-BC9S6omH.js → UsersList-BE8fnICz.js} +7 -7
  26. package/dist/access/index.js +1 -1
  27. package/dist/collection/index.js +1 -1
  28. package/dist/form/ComboField.vue.d.ts +7 -3
  29. package/dist/form/CommandDialog.vue.d.ts +4 -1
  30. package/dist/form/DateField.vue.d.ts +4 -0
  31. package/dist/form/DateTimeField.vue.d.ts +4 -0
  32. package/dist/form/MoneyField.vue.d.ts +10 -5
  33. package/dist/form/NumberField.vue.d.ts +13 -5
  34. package/dist/form/SelectField.vue.d.ts +3 -1
  35. package/dist/form/TextField.vue.d.ts +4 -0
  36. package/dist/form/TextareaField.vue.d.ts +4 -0
  37. package/dist/form/TimeField.vue.d.ts +4 -0
  38. package/dist/form/index.d.ts +1 -1
  39. package/dist/form/index.js +1215 -1182
  40. package/dist/form/options.d.ts +4 -0
  41. package/dist/form/useCommand.d.ts +18 -0
  42. package/dist/identity/index.js +1 -1
  43. package/dist/{index-BrqxylSS.js → index-C3HWRCEe.js} +6 -6
  44. package/dist/{index-B9KqrN-F.js → index-D-0JNiFF.js} +2 -2
  45. package/dist/{index-D8akxuKo.js → index-DiEoRV9D.js} +11 -11
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/notifications/index.js +1 -1
  49. package/dist/{status-vMwum3Y9.js → status-UWWFHi9t.js} +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/useCommand-VIZE7xG-.js +168 -0
  52. package/package.json +1 -1
  53. package/dist/DateField.vue_vue_type_script_setup_true_lang-CfPwcEM2.js +0 -278
  54. package/dist/NumberField.vue_vue_type_script_setup_true_lang-djJvP6Og.js +0 -150
  55. package/dist/SelectField.vue_vue_type_script_setup_true_lang-ByDo_32P.js +0 -493
  56. package/dist/TextareaField.vue_vue_type_script_setup_true_lang-XZRHwx-n.js +0 -91
  57. package/dist/TimeField.vue_vue_type_script_setup_true_lang-BB7ZGpvP.js +0 -187
  58. package/dist/useCommand-YN9EMb7s.js +0 -138
@@ -1,187 +0,0 @@
1
- import { computed as m, defineComponent as K, useModel as W, useTemplateRef as b, openBlock as d, createBlock as N, mergeProps as _, unref as o, createSlots as j, withCtx as u, createElementBlock as g, Fragment as P, createVNode as c, createTextVNode as G, toDisplayString as J, createCommentVNode as U, createElementVNode as h, normalizeClass as O, renderSlot as T, mergeModels as X, mergeDefaults as Y, nextTick as z } from "vue";
2
- import { useI18n as M } from "vue-i18n";
3
- import { _ as Z } from "./DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
4
- import { u as ee } from "./format-D8X4zsx6.js";
5
- import { _ as te } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
- import { u as oe } from "./mediaQuery-CygcXmFW.js";
7
- import { _ as le } from "./Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
8
- import { c as ae, _ as re, f as se, b as ie } from "./control-B4SdblL6.js";
9
- import { d as ne, r as ue, t as F, p as me, u as de, a as ce, i as L, _ as pe, b as fe, c as ve } from "./useTypedEntry-C7k7Dyl-.js";
10
- function be(i) {
11
- const { t: n } = M(), e = m(() => [n("core.form.time.words.now").toLowerCase(), "now"]);
12
- return {
13
- placeholder: m(() => n("core.form.time.placeholder")),
14
- parse(l) {
15
- if (e.value.includes(l.trim().toLowerCase())) return { value: F(i()) };
16
- const a = me(l, i());
17
- return "time" in a ? { value: a.time } : { error: a.error === "step" ? n("core.form.time.step", { step: i() }) : n("core.form.time.invalid") };
18
- },
19
- shortcuts: (l) => (l ?? ne).map((a) => ue(a, n("core.form.time.now"), F(i())))
20
- };
21
- }
22
- const ye = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], ke = ["aria-label", "onClick"], Ve = /* @__PURE__ */ K({
23
- __name: "TimeField",
24
- props: /* @__PURE__ */ X(/* @__PURE__ */ Y({
25
- label: {},
26
- labelHidden: { type: Boolean },
27
- hint: {},
28
- error: {},
29
- required: { type: Boolean },
30
- editable: { type: Boolean },
31
- disabled: { type: Boolean },
32
- lockedReason: {},
33
- presentation: {},
34
- name: {},
35
- minuteStep: {},
36
- quickTimes: {}
37
- }, { ...ie, minuteStep: 1, quickTimes: void 0 }), {
38
- modelValue: { default: null },
39
- modelModifiers: {}
40
- }),
41
- emits: ["update:modelValue"],
42
- setup(i, { expose: n }) {
43
- const e = i, l = W(i, "modelValue"), { t: a } = M(), I = ee(), Q = oe(), $ = b("input"), p = b("popover"), x = b("panel"), q = b("sheet"), y = be(() => e.minuteStep), r = de({ model: l, display: (t) => t, parse: y.parse }), C = m(() => y.shortcuts(e.quickTimes)), V = m(() => e.error || r.message.value), R = ae("date", () => V.value ? "error" : e.disabled ? "locked" : "rest"), A = m(() => {
44
- const t = ce(l.value);
45
- return t ? I.time(new Date(2e3, 0, 1, t.hour, t.minute)) : null;
46
- }), S = m(() => L(r.typed.value) ? r.typed.value : L(l.value) ? l.value : null);
47
- async function k(t) {
48
- e.disabled || (p.value?.present(), t && (await z(), await z(), x.value?.querySelector("[role=listbox]")?.focus()));
49
- }
50
- function H(t) {
51
- t.key === "Enter" ? (r.commit(), p.value?.dismiss()) : t.key === "ArrowDown" && (t.preventDefault(), k(!0));
52
- }
53
- return n({ focus: () => $.value?.focus() }), (t, s) => (d(), N(re, _({ ...o(se)(e), error: V.value }, {
54
- value: A.value,
55
- "value-style": "numeric"
56
- }), j({
57
- default: u(({ id: B, describedby: D, invalid: E }) => [
58
- o(Q) ? (d(), g(P, { key: 0 }, [
59
- c(Z, _({ id: B, "aria-describedby": D }, {
60
- disabled: e.disabled,
61
- invalid: E,
62
- placeholder: o(a)("core.form.select.choose"),
63
- onClick: s[0] || (s[0] = (f) => q.value?.present())
64
- }), {
65
- default: u(() => [
66
- l.value ? (d(), g(P, { key: 0 }, [
67
- G(J(l.value), 1)
68
- ], 64)) : U("", !0)
69
- ]),
70
- _: 1
71
- }, 16, ["disabled", "invalid", "placeholder"]),
72
- c(pe, {
73
- ref_key: "sheet",
74
- ref: q,
75
- title: e.label ?? o(a)("core.form.time.label"),
76
- mode: "time",
77
- "model-value": l.value,
78
- shortcuts: C.value,
79
- step: e.minuteStep,
80
- clearable: !e.required,
81
- "onUpdate:modelValue": o(r).set
82
- }, null, 8, ["title", "model-value", "shortcuts", "step", "clearable", "onUpdate:modelValue"])
83
- ], 64)) : (d(), N(le, {
84
- key: 1,
85
- ref_key: "popover",
86
- ref: p,
87
- label: e.label ?? o(a)("core.form.time.label"),
88
- width: "sm",
89
- placement: "bottom-start",
90
- arrow: !1,
91
- autofocus: !1
92
- }, {
93
- trigger: u(({ attrs: f, presented: w }) => [
94
- h("div", {
95
- class: O(["inline-flex max-w-full items-center gap-2", o(R)])
96
- }, [
97
- h("input", _({
98
- id: B,
99
- ref_key: "input",
100
- ref: $
101
- }, f, {
102
- type: "text",
103
- role: "combobox",
104
- autocomplete: "off",
105
- size: "10",
106
- name: e.name,
107
- value: o(r).text.value,
108
- placeholder: o(y).placeholder.value,
109
- disabled: e.disabled,
110
- required: e.required,
111
- "aria-required": e.required || void 0,
112
- "aria-invalid": E || void 0,
113
- "aria-describedby": D,
114
- class: "block min-h-7 min-w-0 border-0 bg-transparent py-1 pl-2.5 text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
115
- onInput: s[1] || (s[1] = (v) => o(r).input(v.target.value)),
116
- onBlur: s[2] || (s[2] = (v) => o(r).commit()),
117
- onKeydown: H,
118
- onClick: s[3] || (s[3] = (v) => k(!1))
119
- }), null, 16, ye),
120
- e.disabled ? U("", !0) : (d(), g("button", {
121
- key: 0,
122
- type: "button",
123
- tabindex: "-1",
124
- "aria-label": o(a)("core.form.time.open"),
125
- class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
126
- onClick: (v) => w ? p.value?.dismiss() : k(!0)
127
- }, [
128
- c(o(te), {
129
- name: "timeLine",
130
- size: 18
131
- })
132
- ], 8, ke))
133
- ], 2)
134
- ]),
135
- default: u(({ dismiss: f }) => [
136
- h("div", {
137
- ref_key: "panel",
138
- ref: x,
139
- class: "flex flex-col gap-2.5"
140
- }, [
141
- c(fe, {
142
- "model-value": S.value,
143
- step: e.minuteStep,
144
- "onUpdate:modelValue": o(r).set
145
- }, null, 8, ["model-value", "step", "onUpdate:modelValue"]),
146
- c(ve, {
147
- items: C.value,
148
- selected: S.value,
149
- onPick: (w) => {
150
- o(r).set(w), f();
151
- }
152
- }, null, 8, ["items", "selected", "onPick"])
153
- ], 512)
154
- ]),
155
- _: 2
156
- }, 1032, ["label"]))
157
- ]),
158
- _: 2
159
- }, [
160
- t.$slots.trailing ? {
161
- name: "trailing",
162
- fn: u(() => [
163
- T(t.$slots, "trailing")
164
- ]),
165
- key: "0"
166
- } : void 0,
167
- t.$slots.labelTrailing ? {
168
- name: "labelTrailing",
169
- fn: u(() => [
170
- T(t.$slots, "labelTrailing")
171
- ]),
172
- key: "1"
173
- } : void 0,
174
- t.$slots.readonly ? {
175
- name: "readonly",
176
- fn: u(() => [
177
- T(t.$slots, "readonly")
178
- ]),
179
- key: "2"
180
- } : void 0
181
- ]), 1040, ["value"]));
182
- }
183
- });
184
- export {
185
- Ve as _,
186
- be as u
187
- };
@@ -1,138 +0,0 @@
1
- import { nextTick as f, defineComponent as L, useTemplateRef as p, ref as w, watch as D, onBeforeUnmount as S, computed as x, openBlock as v, createBlock as E, unref as c, createSlots as T, withCtx as y, createElementVNode as $, createElementBlock as B, toDisplayString as C, createCommentVNode as N, createVNode as z, renderSlot as g } from "vue";
2
- import { useI18n as V } from "vue-i18n";
3
- import { f as q } from "./useDialog-CXR3hN0G.js";
4
- import { _ as A } from "./Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js";
5
- import { D as F } from "./useWaitStatus-fsacMl4W.js";
6
- import { _ as O, u as I } from "./FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
7
- import { a as R } from "./leaveGuard-Cc8yeLxM.js";
8
- const d = "input:not([type=hidden]):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])";
9
- async function U(t = document, n) {
10
- const e = [...t.querySelectorAll("[data-field-error]")], o = e.find((s) => s.matches(d) || s.querySelector(d)) ?? e[0];
11
- if (!o) return !1;
12
- const r = n?.sections.value.find((s) => s.element.contains(o));
13
- r && (await n?.scrollTo(r.id, { updateUrl: !1 }), await f());
14
- const a = o.matches(d) ? o : o.querySelector(d);
15
- return (a ?? o).scrollIntoView?.({ block: "center" }), (a ?? o).focus({ preventScroll: !0 }), !0;
16
- }
17
- const Q = (t) => ({ "data-field-key": t }), G = {
18
- key: 0,
19
- class: "text-body text-content-muted"
20
- }, X = /* @__PURE__ */ L({
21
- __name: "CommandDialog",
22
- props: {
23
- command: {},
24
- title: {},
25
- subtitle: { default: void 0 },
26
- confirmLabel: {},
27
- confirmDisabled: { type: Boolean, default: !1 },
28
- doneLabel: { default: void 0 },
29
- busyLabel: { default: void 0 },
30
- message: { default: void 0 },
31
- size: { default: "sm" },
32
- fieldLabel: { type: Function, default: void 0 }
33
- },
34
- emits: ["done"],
35
- setup(t, { emit: n }) {
36
- const e = t, o = n, { t: r } = V(), a = p("modal"), s = p("body"), u = w(!1);
37
- let m = null;
38
- const { confirmDiscard: _ } = R(() => e.command.open.value && e.command.form.dirty.value);
39
- D(() => e.command.open.value, (l) => {
40
- l ? (u.value = !1, a.value?.present()) : a.value?.dismiss();
41
- });
42
- async function b(l = {}) {
43
- if (e.confirmDisabled) return;
44
- const i = await e.command.run();
45
- if (i.status === "failed") {
46
- i.failure.kind === "invalid" && await f().then(() => U(s.value ?? document));
47
- return;
48
- }
49
- if (i.status !== "aborted") {
50
- if (o("done"), l.addAnother) {
51
- e.command.present(), await f(), q(s.value)[0]?.focus();
52
- return;
53
- }
54
- u.value = !0, m = setTimeout(() => e.command.dismiss(), F);
55
- }
56
- }
57
- S(() => {
58
- m && clearTimeout(m);
59
- });
60
- const k = x(() => e.command.form.submitting.value ? "processing" : u.value ? "done" : "idle");
61
- return (l, i) => (v(), E(A, {
62
- ref_key: "modal",
63
- ref: a,
64
- size: e.size,
65
- grouped: "",
66
- title: e.title,
67
- subtitle: e.subtitle,
68
- "before-dismiss": c(_),
69
- "primary-label": e.confirmLabel,
70
- "primary-disabled": e.confirmDisabled,
71
- status: k.value,
72
- "processing-label": e.busyLabel ?? c(r)("core.actions.saving"),
73
- "done-label": e.doneLabel ?? c(r)("core.actions.saved"),
74
- onPrimary: i[0] || (i[0] = (h) => b()),
75
- onDismissed: i[1] || (i[1] = (h) => e.command.dismiss())
76
- }, T({
77
- default: y(() => [
78
- $("div", {
79
- ref_key: "body",
80
- ref: s,
81
- class: "flex min-w-0 flex-col gap-group-gap",
82
- "data-test": "command-dialog"
83
- }, [
84
- e.message ? (v(), B("p", G, C(e.message), 1)) : N("", !0),
85
- z(O, {
86
- form: e.command.form,
87
- label: e.fieldLabel,
88
- scope: s.value
89
- }, null, 8, ["form", "label", "scope"]),
90
- g(l.$slots, "default")
91
- ], 512)
92
- ]),
93
- _: 2
94
- }, [
95
- l.$slots.actions ? {
96
- name: "actions",
97
- fn: y(() => [
98
- g(l.$slots, "actions", {
99
- run: b,
100
- busy: e.command.form.submitting.value
101
- })
102
- ]),
103
- key: "0"
104
- } : void 0
105
- ]), 1032, ["size", "title", "subtitle", "before-dismiss", "primary-label", "primary-disabled", "status", "processing-label", "done-label"]));
106
- }
107
- });
108
- function Y(t) {
109
- const n = I(t), e = w(!1), o = () => typeof t.defaults == "function" ? t.defaults() : t.defaults;
110
- async function r() {
111
- return await n.submit(t.run, {
112
- // The page updating itself after the call is the refresh: its failure is "saved, but could not be read back".
113
- refresh: t.done ? (s) => t.done?.(s) : void 0
114
- });
115
- }
116
- return {
117
- form: n,
118
- open: e,
119
- present(a) {
120
- n.hydrate({ ...o(), ...a }), e.value = !0;
121
- },
122
- dismiss() {
123
- e.value = !1;
124
- },
125
- run: r,
126
- async confirm() {
127
- const a = await r();
128
- if (a.status === "failed") throw new Error(a.failure.message);
129
- if (a.status === "aborted") throw new Error("aborted");
130
- }
131
- };
132
- }
133
- export {
134
- X as _,
135
- Q as a,
136
- U as f,
137
- Y as u
138
- };