@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
@@ -17,6 +17,10 @@ export interface SelectOption<Value extends string | number = string | number, M
17
17
  export type OptionWithMeta<Value extends string | number, Meta> = SelectOption<Value, Meta> & {
18
18
  readonly meta: Meta;
19
19
  };
20
+ /** What a `#value` slot receives: the chosen option, with the `meta` the app gave it. Only rendered while an option is chosen. */
21
+ export interface ValueSlotScope<Value extends string | number, Meta = undefined> {
22
+ readonly option: OptionWithMeta<Value, Meta>;
23
+ }
20
24
  /** What an `#option` slot receives for one row: the option, whether it is the highlighted (or focused) row, and whether it is the chosen one. */
21
25
  export interface OptionSlotScope<Value extends string | number, Meta = undefined> {
22
26
  /** The row's option, with the `meta` the app gave it (give every option one when the slot reads it). */
@@ -1,10 +1,23 @@
1
1
  import { type Ref } from "vue";
2
2
  import { type Form, type FormOptions, type SubmitContext, type SubmitResult } from "./useForm";
3
+ /** The question a command asks before it runs: it names the consequence ("Archive the vehicle?"), and `confirmLabel` says exactly what yes does. */
4
+ export interface CommandQuestion {
5
+ readonly title: string;
6
+ readonly message?: string;
7
+ readonly confirmLabel?: string;
8
+ readonly tone?: "neutral" | "warning" | "critical";
9
+ }
3
10
  export interface CommandOptions<Values extends object, Output = Values, Done = unknown> extends FormOptions<Values, Output> {
4
11
  /** The call: one purpose-specific endpoint (advance a status, assign, approve, change a price). Its payload is the validator's output. */
5
12
  readonly run: (input: Output, context: SubmitContext) => Promise<Done>;
6
13
  /** After the call went through: the page updates itself (reloads the record, toasts). */
7
14
  readonly done?: (result: Done) => Promise<unknown> | unknown;
15
+ /**
16
+ * A question to put after the inputs check out and before anything is sent (an irreversible step): its answer, not the primary action,
17
+ * runs the command. It reads the validated input and whatever the caller holds (what is still unpaid); `null` asks nothing this time.
18
+ * `CommandDialog` presents it; No returns to the filled form, Yes calls with the usual idempotency key.
19
+ */
20
+ readonly ask?: (input: Output) => CommandQuestion | null;
8
21
  }
9
22
  export interface Command<Values extends object, Output = Values, Done = unknown> {
10
23
  /** The command's inputs: a small form (`command.form.bind('assignee')`). */
@@ -16,6 +29,10 @@ export interface Command<Values extends object, Output = Values, Done = unknown>
16
29
  dismiss(): void;
17
30
  /** Validates and calls. One call at a time; a failure keeps the inputs and says why (`form.failure`, field errors on the fields). */
18
31
  run(): Promise<SubmitResult<Done>>;
32
+ /** The question waiting for an answer (set by `run()` when `ask` returned one, instead of calling). */
33
+ readonly question: Readonly<Ref<CommandQuestion | null>>;
34
+ /** Answers it: Yes calls (the result is `run()`'s), No sends nothing and keeps the inputs (`aborted`). */
35
+ answer(yes: boolean): Promise<SubmitResult<Done>>;
19
36
  /** For `AlertDialog`'s `action`: resolves when the call went through, throws when it did not, so the dialog stays open and `@failed` fires. */
20
37
  confirm(): Promise<void>;
21
38
  }
@@ -32,6 +49,7 @@ export interface Command<Values extends object, Output = Values, Done = unknown>
32
49
  * <CommandDialog :command="assign" :title="t('assign')" :confirm-label="t('assign')"><SelectField v-bind="assign.form.bind('assignee')" … /></CommandDialog>
33
50
  * <Button @click="assign.present()">Assign</Button>
34
51
  *
52
+ * `ask: (input) => ({ title, message, confirmLabel, tone }) | null` puts a question before the call (a delivery that archives the vehicle).
35
53
  * A command with nothing to enter is an `AlertDialog` with `:action="command.confirm"`.
36
54
  */
37
55
  export declare function useCommand<Values extends object, Output = Values, Done = unknown>(options: CommandOptions<Values, Output, Done>): Command<Values, Output, Done>;
@@ -1,4 +1,4 @@
1
- import { _ as t, h as n, j as a, i, k as o, d as r, l as d, m as u, n as y, r as l, o as I, s as f, q as p, t as A, f as c } from "../index-D8akxuKo.js";
1
+ import { _ as t, h as n, j as a, i, k as o, d as r, l as d, m as u, n as y, r as l, o as I, s as f, q as p, t as A, f as c } from "../index-DiEoRV9D.js";
2
2
  export {
3
3
  t as SignInAsButton,
4
4
  n as identityFeature,
@@ -7,16 +7,16 @@ import { a as Ne } from "./error-CD7x0Jrz.js";
7
7
  import { u as ve } from "./describeError-B-NMa--w.js";
8
8
  import { defineComponent as Y, ref as D, computed as j, watch as le, openBlock as f, createBlock as S, unref as t, withCtx as h, createElementVNode as N, createElementBlock as g, toDisplayString as k, createCommentVNode as O, createVNode as $, Fragment as K, renderList as P, createSlots as be, renderSlot as Se, createTextVNode as M, useTemplateRef as ne } from "vue";
9
9
  import { _ as I } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
10
- import { _ as V } from "./FormGroup.vue_vue_type_script_setup_true_lang-C7nq7MJB.js";
10
+ import { _ as V } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
11
11
  import { e as U } from "./control-B4SdblL6.js";
12
12
  import { _ as Te } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
13
13
  import { t as ee } from "./toast-CqSDTWRX.js";
14
14
  import { _ as ce } from "./AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js";
15
15
  import { _ as Oe } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
16
16
  import { u as Ae } from "./useLoad-M7V-AVwR.js";
17
- import { _ as De, a as Ke } from "./SelectField.vue_vue_type_script_setup_true_lang-ByDo_32P.js";
17
+ import { _ as De, a as Ke } from "./SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
18
18
  import { _ as Be } from "./SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js";
19
- import { u as Pe, _ as Ue } from "./useCommand-YN9EMb7s.js";
19
+ import { u as Pe, _ as Ue } from "./useCommand-VIZE7xG-.js";
20
20
  import { u as Fe } from "./platform-q3cjODLx.js";
21
21
  import { _ as Ge } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
22
22
  import { u as Me } from "./mediaQuery-CygcXmFW.js";
@@ -43,12 +43,12 @@ const C = {
43
43
  viewAccess: "iam.user:view",
44
44
  manageBindings: "iam.user:manage"
45
45
  }, re = Ee({
46
- roles: { name: "access.roles", path: "/iam/roles", component: () => import("./RolesPage-TXQKtK_J.js"), meta: { access: F.viewRoles, titleKey: "core.access.title" } },
47
- newRole: { name: "access.roles.new", path: "/iam/roles/new", component: () => import("./NewRolePage-QAv_XsT0.js"), meta: { access: F.manageRoles, titleKey: "core.access.new_title" } },
46
+ roles: { name: "access.roles", path: "/iam/roles", component: () => import("./RolesPage-BGPoUCMP.js"), meta: { access: F.viewRoles, titleKey: "core.access.title" } },
47
+ newRole: { name: "access.roles.new", path: "/iam/roles/new", component: () => import("./NewRolePage-OosTaMfZ.js"), meta: { access: F.manageRoles, titleKey: "core.access.new_title" } },
48
48
  role: {
49
49
  name: "access.role",
50
50
  path: "/iam/roles/:ref",
51
- component: () => import("./RolePage-De7s2sYr.js"),
51
+ component: () => import("./RolePage-33RUvHYD.js"),
52
52
  // A role's ref (its key, or the id of a custom one) swaps in place when a link leads to another role.
53
53
  meta: { access: F.viewRoles, titleKey: "core.access.title", remountOnParam: "ref" }
54
54
  }
@@ -31,9 +31,9 @@ const M = {
31
31
  deadLettersRetryAll: y("POST", "/v1/events/dead-letters/retry", { permission: "events.deadletter:retry" }),
32
32
  consumers: y("GET", "/v1/events/consumers", { permission: "events.deadletter:view" })
33
33
  }, [ke, ee] = fe("vue-core.notifications"), we = "events.deadletter:view", bt = "events.deadletter:retry", J = Z({
34
- index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-AbbNs69D.js"), meta: { access: we, titleKey: "core.notifications.dead_letters.title" } }
34
+ index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-O6QReswO.js"), meta: { access: we, titleKey: "core.notifications.dead_letters.title" } }
35
35
  }), j = Z({
36
- index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-Kzcqv91E.js"), meta: { titleKey: "core.notifications.settings.title" } }
36
+ index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-D47NSOYW.js"), meta: { titleKey: "core.notifications.settings.title" } }
37
37
  }), Te = /* @__PURE__ */ z({
38
38
  __name: "SettingsMenuItem",
39
39
  setup(o) {
@@ -15,7 +15,7 @@ import { _ as Q } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
15
15
  import { _ as L } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
16
16
  import { u as fe } from "./leaveGuard-Cc8yeLxM.js";
17
17
  import { _ as he } from "./FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
18
- import { _ as ye } from "./TextField.vue_vue_type_script_setup_true_lang-BslHroDP.js";
18
+ import { _ as ye } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
19
19
  import { u as ge } from "./mediaQuery-CygcXmFW.js";
20
20
  import { u as ve } from "./useDialog-CXR3hN0G.js";
21
21
  import { c as _e } from "./closeOverlays-CjVsIrpL.js";
@@ -315,7 +315,7 @@ function Cs(e) {
315
315
  const Ye = async (e) => {
316
316
  await B(e.http);
317
317
  }, Je = z({
318
- login: { name: "login", path: "/login", component: () => import("./SignInPage-B2v3is80.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
318
+ login: { name: "login", path: "/login", component: () => import("./SignInPage-D9jryXA7.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
319
319
  });
320
320
  function Os(e = {}) {
321
321
  return H({
@@ -334,7 +334,7 @@ function Os(e = {}) {
334
334
  });
335
335
  }
336
336
  const Z = z({
337
- index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-CjjKhkHX.js"), meta: { titleKey: "core.profile.title" } }
337
+ index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-Dn8fQ3ff.js"), meta: { titleKey: "core.profile.title" } }
338
338
  }), Qe = /* @__PURE__ */ E({
339
339
  __name: "ProfileMenuItem",
340
340
  setup(e) {
@@ -358,19 +358,19 @@ function es(e) {
358
358
  return { name: `users.record.${e.path}`, path: e.path, component: s, meta: { ...e.meta } };
359
359
  }
360
360
  const W = "iam.user:view", qs = "iam.user:manage", ss = "iam.user.activity:view", ee = z({
361
- index: { name: "users.index", path: "/users", component: () => import("./UsersList-BC9S6omH.js"), meta: { access: W, titleKey: "core.users.title" } },
361
+ index: { name: "users.index", path: "/users", component: () => import("./UsersList-BE8fnICz.js"), meta: { access: W, titleKey: "core.users.title" } },
362
362
  record: {
363
363
  name: "users.record",
364
364
  path: "/users/:id",
365
- component: () => import("./UserRecord-BR70ai9q.js"),
365
+ component: () => import("./UserRecord-CUhbz62x.js"),
366
366
  meta: { access: W, titleKey: "core.users.title", remountOnParam: "id" },
367
367
  children: [
368
- { name: "users.record.general", path: "general", component: () => import("./General-De4Q6Wfn.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
369
- { name: "users.record.signin", path: "signin", component: () => import("./SignIn-DKo46hNK.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
370
- { name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-BDLI0o-z.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
371
- { name: "users.record.signins", path: "signins", component: () => import("./SignIns-D-_a_S6O.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
372
- { name: "users.record.changes", path: "changes", component: () => import("./Changes-xF1VMbqD.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
373
- { name: "users.record.activity", path: "activity", component: () => import("./Activity-CLyG5Y9o.js"), meta: { access: ss, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
368
+ { name: "users.record.general", path: "general", component: () => import("./General-CkZoXu29.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
369
+ { name: "users.record.signin", path: "signin", component: () => import("./SignIn-DDCRzlUq.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
370
+ { name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-BbAdbjmG.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
371
+ { name: "users.record.signins", path: "signins", component: () => import("./SignIns-C_5sRrB4.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
372
+ { name: "users.record.changes", path: "changes", component: () => import("./Changes-_nARQ9IC.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
373
+ { name: "users.record.activity", path: "activity", component: () => import("./Activity-DX-RK9xj.js"), meta: { access: ss, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
374
374
  ]
375
375
  }
376
376
  });
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
2
- export declare const version = "0.4.19";
2
+ export declare const version = "0.4.21";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.4.19";
1
+ const o = "0.4.21";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,4 +1,4 @@
1
- import { d as s, e as o, n as a, a as i, b as n } from "../index-B9KqrN-F.js";
1
+ import { d as s, e as o, n as a, a as i, b as n } from "../index-D-0JNiFF.js";
2
2
  export {
3
3
  s as deadLettersRoutes,
4
4
  o as eventsRoutes,
@@ -1,5 +1,5 @@
1
1
  import { a, r as o } from "./http-D_D9YbLH.js";
2
- import { i as r } from "./index-D8akxuKo.js";
2
+ import { i as r } from "./index-DiEoRV9D.js";
3
3
  const n = ["active", "locked", "inactive", "all"];
4
4
  function l(i) {
5
5
  return a({