@wssto2/vue-core 0.4.14 → 0.4.16

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 (98) hide show
  1. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-LlfIPWsJ.js → ActionRow.vue_vue_type_script_setup_true_lang-DOjn7fqy.js} +1 -1
  2. package/dist/{Activity-BdSvn0GP.js → Activity-CVO3sJwy.js} +6 -6
  3. package/dist/{Changes-BQO--N9F.js → Changes-Bzvl3cEx.js} +5 -5
  4. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DkpFEHUw.js → CollectionPage.vue_vue_type_script_setup_true_lang-CD5zZ29o.js} +2 -2
  5. package/dist/DateField.vue_vue_type_script_setup_true_lang-BufoFwVQ.js +278 -0
  6. package/dist/{DeadLetters-OmeiADEi.js → DeadLetters-DmwUtgf9.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-BokxZ7LU.js} +1 -1
  9. package/dist/{FormView.vue_vue_type_script_setup_true_lang-cr0xNDXP.js → FormView.vue_vue_type_script_setup_true_lang-Dz5TZt92.js} +2 -2
  10. package/dist/{General-CBwFLiKQ.js → General-CUEjJBD4.js} +10 -10
  11. package/dist/{NewRolePage-CblUW2gA.js → NewRolePage-Cyn-oV6r.js} +3 -3
  12. package/dist/NumberField.vue_vue_type_script_setup_true_lang-a8kN3A7k.js +150 -0
  13. package/dist/{ProfilePage-BOoDDbmB.js → ProfilePage-I74SQBFO.js} +41 -41
  14. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-BCE5yrwy.js → RoleEditor.vue_vue_type_script_setup_true_lang-Ce6wjptT.js} +44 -44
  15. package/dist/{RolePage-xDsFL_eC.js → RolePage-DWQP3qQl.js} +8 -8
  16. package/dist/{RolesPage-C39wsF6X.js → RolesPage-BeEsHIQ2.js} +5 -5
  17. package/dist/SegmentedField.vue_vue_type_script_setup_true_lang-BMBkEmxr.js +81 -0
  18. package/dist/SelectField.vue_vue_type_script_setup_true_lang-C1Flb1hA.js +465 -0
  19. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-D4k5QeWS.js → SessionList.vue_vue_type_script_setup_true_lang-DoUo68xE.js} +2 -2
  20. package/dist/{Sessions-m_i4aTfw.js → Sessions-D8IXcb5M.js} +4 -4
  21. package/dist/{SettingsPage-ktKvQQnE.js → SettingsPage-DRQP2nrH.js} +9 -9
  22. package/dist/{SignIn-CkoEixY4.js → SignIn-CAZkovhb.js} +6 -6
  23. package/dist/{SignInPage-DVcpFz3G.js → SignInPage-D-49oLY3.js} +3 -3
  24. package/dist/{SignIns-BnVAtncZ.js → SignIns-BtNfgMLc.js} +3 -3
  25. package/dist/SwitchField.vue_vue_type_script_setup_true_lang-0weBvsJf.js +87 -0
  26. package/dist/TextField.vue_vue_type_script_setup_true_lang-D3-R5XXG.js +292 -0
  27. package/dist/TextareaField.vue_vue_type_script_setup_true_lang-4wC3c0BM.js +91 -0
  28. package/dist/TimeField.vue_vue_type_script_setup_true_lang-pAdLPYXA.js +187 -0
  29. package/dist/{UserRecord-Cg69_mbU.js → UserRecord-BSbNuRFi.js} +10 -10
  30. package/dist/{UsersList-BFmBDGs7.js → UsersList-DPHxcaDm.js} +8 -8
  31. package/dist/access/index.js +1 -1
  32. package/dist/app/application.d.ts +8 -2
  33. package/dist/app/index.js +93 -93
  34. package/dist/collection/index.js +1 -1
  35. package/dist/control-B_Nwtmag.js +334 -0
  36. package/dist/{describeError-CvGmajU0.js → describeError-B-NMa--w.js} +12 -7
  37. package/dist/fieldMessages-DV6sESpn.js +25 -0
  38. package/dist/form/CardSelectField.vue.d.ts +2 -2
  39. package/dist/form/ChoiceChips.vue.d.ts +2 -2
  40. package/dist/form/ComboField.vue.d.ts +2 -2
  41. package/dist/form/DateField.vue.d.ts +10 -2
  42. package/dist/form/DateTimeField.vue.d.ts +10 -2
  43. package/dist/form/Field.vue.d.ts +2 -1
  44. package/dist/form/FileField.vue.d.ts +10 -2
  45. package/dist/form/FormErrors.vue.d.ts +1 -1
  46. package/dist/form/FormRow.vue.d.ts +3 -0
  47. package/dist/form/I18nField.vue.d.ts +10 -2
  48. package/dist/form/MoneyField.vue.d.ts +10 -2
  49. package/dist/form/MonthYearField.vue.d.ts +10 -2
  50. package/dist/form/MultiSelectField.vue.d.ts +2 -2
  51. package/dist/form/NumberField.vue.d.ts +25 -2
  52. package/dist/form/PhotoField.vue.d.ts +10 -2
  53. package/dist/form/SegmentedField.vue.d.ts +2 -2
  54. package/dist/form/SelectField.vue.d.ts +7 -8
  55. package/dist/form/SwitchField.vue.d.ts +3 -2
  56. package/dist/form/TextField.vue.d.ts +10 -2
  57. package/dist/form/TextareaField.vue.d.ts +10 -2
  58. package/dist/form/TimeField.vue.d.ts +10 -2
  59. package/dist/form/field.d.ts +12 -0
  60. package/dist/form/index.d.ts +3 -1
  61. package/dist/form/index.js +1167 -956
  62. package/dist/form/useForm.d.ts +2 -2
  63. package/dist/form/useHiddenFieldErrors.d.ts +23 -0
  64. package/dist/form/useSaveChrome.d.ts +8 -3
  65. package/dist/i18n/describeError.d.ts +8 -0
  66. package/dist/i18n/index.d.ts +3 -2
  67. package/dist/i18n/index.js +32 -28
  68. package/dist/identity/fieldMessages.d.ts +1 -1
  69. package/dist/identity/index.js +1 -1
  70. package/dist/{index-RNF5-9uf.js → index-Bq96L43f.js} +15 -15
  71. package/dist/{index-B416VXmR.js → index-CWeNiBX6.js} +2 -2
  72. package/dist/{index-KcCoCfr-.js → index-yKIOaisE.js} +10 -10
  73. package/dist/index.d.ts +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/notifications/index.js +1 -1
  76. package/dist/phone/PhoneField.vue.d.ts +1 -0
  77. package/dist/phone/index.js +66 -65
  78. package/dist/resource/index.js +1 -1
  79. package/dist/{routeResource-BwEFXzIX.js → routeResource-DlTsGTg_.js} +1 -1
  80. package/dist/state/index.js +1 -1
  81. package/dist/{status-OZUHZpWl.js → status-DzmySsWw.js} +1 -1
  82. package/dist/{useCommand-BkONMn3X.js → useCommand-B-N6HJOz.js} +1 -1
  83. package/dist/{useLoad-DuEsLECT.js → useLoad-M7V-AVwR.js} +1 -1
  84. package/dist/{useResourceForm-D1hIpwW5.js → useResourceForm-CP2lCwmD.js} +1 -1
  85. package/dist/useSaveChrome-7huA3FzR.js +26 -0
  86. package/package.json +1 -1
  87. package/dist/DateField.vue_vue_type_script_setup_true_lang-GVasv8ao.js +0 -255
  88. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-BQb7wLT0.js +0 -276
  89. package/dist/NumberField.vue_vue_type_script_setup_true_lang-C7N5nq0P.js +0 -113
  90. package/dist/SegmentedField.vue_vue_type_script_setup_true_lang-BMqWlpsL.js +0 -58
  91. package/dist/SelectField.vue_vue_type_script_setup_true_lang-BJoAkBo2.js +0 -437
  92. package/dist/SwitchField.vue_vue_type_script_setup_true_lang-CM8yp9JQ.js +0 -64
  93. package/dist/TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js +0 -269
  94. package/dist/TextareaField.vue_vue_type_script_setup_true_lang-CqAWfABZ.js +0 -68
  95. package/dist/TimeField.vue_vue_type_script_setup_true_lang-DWfAUlnz.js +0 -164
  96. package/dist/control-7EP4tjYy.js +0 -313
  97. package/dist/fieldMessages-D_dpSe19.js +0 -25
  98. package/dist/useSaveChrome-DuWm0Czf.js +0 -25
@@ -0,0 +1,87 @@
1
+ import { defineComponent as v, useModel as w, computed as y, openBlock as g, createBlock as k, mergeProps as _, unref as t, createSlots as $, withCtx as l, createElementVNode as s, renderSlot as i, normalizeClass as d, normalizeStyle as B, toDisplayString as S, mergeModels as z, mergeDefaults as C } from "vue";
2
+ import { useI18n as M } from "vue-i18n";
3
+ import { u as V, _ as D, f as T, b as E } from "./control-B_Nwtmag.js";
4
+ const F = { class: "flex items-center gap-2" }, I = ["id", "aria-checked", "aria-label", "aria-describedby", "aria-invalid", "disabled"], P = { class: "sr-only" }, Z = /* @__PURE__ */ v({
5
+ __name: "SwitchField",
6
+ props: /* @__PURE__ */ z(/* @__PURE__ */ C({
7
+ label: {},
8
+ labelHidden: { type: Boolean },
9
+ hint: {},
10
+ error: {},
11
+ required: { type: Boolean },
12
+ editable: { type: Boolean },
13
+ disabled: { type: Boolean },
14
+ lockedReason: {},
15
+ presentation: {},
16
+ name: {},
17
+ size: {}
18
+ }, { ...E, size: "md" }), {
19
+ modelValue: { type: Boolean, default: !1 },
20
+ modelModifiers: {}
21
+ }),
22
+ emits: ["update:modelValue"],
23
+ setup(n) {
24
+ const a = n, e = w(n, "modelValue"), { t: r } = M(), { editable: c } = V(a), u = {
25
+ sm: { "--switch-w": "1.75rem", "--switch-h": "1rem" },
26
+ md: { "--switch-w": "var(--app-switch-width)", "--switch-h": "var(--app-switch-height)" },
27
+ lg: { "--switch-w": "3.1875rem", "--switch-h": "1.9375rem" }
28
+ }, m = y(() => u[a.size]);
29
+ function f() {
30
+ !a.disabled && c.value && (e.value = !e.value);
31
+ }
32
+ return (o, q) => (g(), k(D, _(t(T)(a), {
33
+ value: e.value,
34
+ "row-layout": "setting"
35
+ }), $({
36
+ default: l(({ id: h, describedby: b, invalid: p }) => [
37
+ s("div", F, [
38
+ i(o.$slots, "before"),
39
+ s("button", {
40
+ id: h,
41
+ type: "button",
42
+ role: "switch",
43
+ "aria-checked": e.value,
44
+ "aria-label": a.label,
45
+ "aria-describedby": b,
46
+ "aria-invalid": p || void 0,
47
+ disabled: a.disabled,
48
+ style: B(m.value),
49
+ class: d(["hit-target relative inline-flex h-(--switch-h) w-(--switch-w) shrink-0 cursor-pointer rounded-full transition-colors duration-motion-fast ease-motion-standard focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-45", e.value ? "bg-control-on" : "bg-fill-strong"]),
50
+ onClick: f
51
+ }, [
52
+ s("span", {
53
+ class: d(["pointer-events-none absolute left-0.5 top-0.5 size-[calc(var(--switch-h)-0.25rem)] rounded-full bg-white shadow-knob transition-transform duration-motion-normal ease-motion-standard", e.value ? "translate-x-[calc(var(--switch-w)-var(--switch-h))]" : ""])
54
+ }, null, 2),
55
+ s("span", P, S(e.value ? t(r)("core.form.yes") : t(r)("core.form.no")), 1)
56
+ ], 14, I)
57
+ ])
58
+ ]),
59
+ _: 2
60
+ }, [
61
+ o.$slots.trailing ? {
62
+ name: "trailing",
63
+ fn: l(() => [
64
+ i(o.$slots, "trailing")
65
+ ]),
66
+ key: "0"
67
+ } : void 0,
68
+ o.$slots.labelTrailing ? {
69
+ name: "labelTrailing",
70
+ fn: l(() => [
71
+ i(o.$slots, "labelTrailing")
72
+ ]),
73
+ key: "1"
74
+ } : void 0,
75
+ o.$slots.readonly ? {
76
+ name: "readonly",
77
+ fn: l(() => [
78
+ i(o.$slots, "readonly")
79
+ ]),
80
+ key: "2"
81
+ } : void 0
82
+ ]), 1040, ["value"]));
83
+ }
84
+ });
85
+ export {
86
+ Z as _
87
+ };
@@ -0,0 +1,292 @@
1
+ import { defineComponent as O, useTemplateRef as z, computed as y, watch as ee, nextTick as te, openBlock as n, createElementBlock as i, withModifiers as oe, normalizeStyle as se, unref as s, createElementVNode as m, toDisplayString as r, createCommentVNode as u, Fragment as E, renderList as ne, normalizeClass as B, createBlock as A, createTextVNode as F, useModel as ae, ref as ie, mergeProps as le, createSlots as re, withCtx as q, withDirectives as ce, vModelDynamic as de, renderSlot as P, mergeModels as K, mergeDefaults as ue } from "vue";
2
+ import { useI18n as G } from "vue-i18n";
3
+ import { b as pe } from "./controlSurface-t7OEFESJ.js";
4
+ import { a as me, c as fe, _ as he, f as ve, b as ge } from "./control-B_Nwtmag.js";
5
+ import { _ as ye } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
+ import { u as xe } from "./anchored-Cj4--8dT.js";
7
+ import { l as U, m as be, u as ke, c as _e } from "./suggestions-BxMm6MQA.js";
8
+ const we = ["id", "aria-busy"], $e = { class: "min-h-0 flex-1 overflow-y-auto p-1.5" }, Me = {
9
+ key: 0,
10
+ class: "px-2.5 pb-1 pt-1.5 text-caption font-semibold uppercase text-content-disabled",
11
+ role: "presentation"
12
+ }, qe = ["id", "aria-selected", "aria-disabled", "onMouseenter", "onClick"], Be = { class: "min-w-0 flex-1" }, Le = { class: "block truncate text-body text-content-strong" }, Se = {
13
+ key: 0,
14
+ class: "font-semibold"
15
+ }, Ce = {
16
+ key: 0,
17
+ class: "block truncate text-footnote text-content-muted"
18
+ }, De = {
19
+ key: 2,
20
+ class: "px-3 py-2 text-footnote text-content-muted",
21
+ role: "status"
22
+ }, Ve = {
23
+ key: 3,
24
+ class: "px-3 py-2 text-footnote text-content-destructive",
25
+ role: "alert"
26
+ }, Te = {
27
+ key: 4,
28
+ class: "px-3 py-2 text-footnote text-content-muted"
29
+ }, Ee = {
30
+ key: 0,
31
+ class: "mx-1.5 mb-1.5 mt-0.5 border-t border-border-separator px-2.5 pb-0.5 pt-2 text-caption text-content-muted compact:hidden",
32
+ "aria-hidden": "true"
33
+ }, Fe = /* @__PURE__ */ O({
34
+ __name: "SuggestionList",
35
+ props: {
36
+ id: {},
37
+ anchor: {},
38
+ open: { type: Boolean },
39
+ items: {},
40
+ highlighted: {},
41
+ query: {},
42
+ status: {},
43
+ recent: { type: Boolean },
44
+ emptyMessage: { type: Boolean },
45
+ hint: {}
46
+ },
47
+ emits: ["pick", "hover"],
48
+ setup(w, { emit: L }) {
49
+ const o = w, t = L, { t: c } = G(), b = z("panel"), k = y(() => U(o.open, o.items.length, o.status, o.emptyMessage)), _ = y(() => o.status === "loading"), f = (h) => be(h.label, o.query), { style: S } = xe(b, {
50
+ reference: () => o.anchor,
51
+ placement: () => "bottom-start",
52
+ offset: 4,
53
+ padding: 8,
54
+ fit: (h, v) => {
55
+ h.style.width = `${o.anchor?.offsetWidth ?? 0}px`, h.style.maxHeight = `${Math.max(120, Math.min(320, v.height))}px`;
56
+ }
57
+ });
58
+ return ee(() => o.highlighted, () => void te(() => b.value?.querySelector("[aria-selected='true']")?.scrollIntoView?.({ block: "nearest" }))), (h, v) => k.value ? (n(), i("div", {
59
+ key: 0,
60
+ id: `${o.id}-list`,
61
+ ref_key: "panel",
62
+ ref: b,
63
+ role: "listbox",
64
+ "aria-busy": _.value || void 0,
65
+ style: se(s(S)),
66
+ "data-test": "suggestion-list",
67
+ class: "z-1000 flex flex-col overflow-hidden rounded-menu bg-surface-overlay shadow-float",
68
+ onMousedown: v[0] || (v[0] = oe(() => {
69
+ }, ["prevent"]))
70
+ }, [
71
+ m("div", $e, [
72
+ o.recent ? (n(), i("p", Me, r(s(c)("core.form.suggestions.recent")), 1)) : u("", !0),
73
+ o.items.length > 0 ? (n(!0), i(E, { key: 1 }, ne(o.items, (a, g) => (n(), i("div", {
74
+ id: `${o.id}-option-${g}`,
75
+ key: String(a.value),
76
+ role: "option",
77
+ "aria-selected": g === o.highlighted,
78
+ "aria-disabled": a.disabled || void 0,
79
+ "data-test": "suggestion-option",
80
+ class: B(["flex cursor-pointer items-center gap-2.5 rounded-control px-2.5 py-2", [g === o.highlighted ? "bg-tint-soft" : "hover:bg-fill", a.disabled ? "cursor-not-allowed opacity-45" : "", _.value ? "opacity-60" : ""]]),
81
+ onMouseenter: (l) => t("hover", g),
82
+ onClick: (l) => !a.disabled && t("pick", a)
83
+ }, [
84
+ o.recent ? (n(), A(s(ye), {
85
+ key: 0,
86
+ name: "history",
87
+ size: 16,
88
+ class: "shrink-0 text-content-disabled"
89
+ })) : u("", !0),
90
+ m("span", Be, [
91
+ m("span", Le, [
92
+ o.recent ? (n(), i(E, { key: 0 }, [
93
+ F(r(a.label), 1)
94
+ ], 64)) : (n(), i(E, { key: 1 }, [
95
+ F(r(f(a).before), 1),
96
+ f(a).match ? (n(), i("strong", Se, r(f(a).match), 1)) : u("", !0),
97
+ F(r(f(a).after), 1)
98
+ ], 64))
99
+ ]),
100
+ a.description ? (n(), i("span", Ce, r(a.description), 1)) : u("", !0)
101
+ ])
102
+ ], 42, qe))), 128)) : o.status === "loading" ? (n(), i("p", De, r(s(c)("core.form.select.loading")), 1)) : o.status === "failed" ? (n(), i("p", Ve, r(s(c)("core.form.select.failed")), 1)) : (n(), i("p", Te, r(s(c)("core.form.select.no_matches")), 1))
103
+ ]),
104
+ o.hint && o.items.length > 0 ? (n(), i("p", Ee, r(o.hint), 1)) : u("", !0)
105
+ ], 44, we)) : u("", !0);
106
+ }
107
+ }), Pe = {
108
+ key: 0,
109
+ class: "shrink-0 text-footnote text-content-muted"
110
+ }, ze = { class: "relative min-w-0 flex-1" }, Ae = ["id", "type", "name", "placeholder", "maxlength", "autocomplete", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby", "role", "aria-autocomplete", "aria-expanded", "aria-controls", "aria-activedescendant"], Ne = { class: "invisible" }, Re = { class: "text-content-disabled" }, We = {
111
+ key: 1,
112
+ class: "shrink-0 text-footnote text-content-muted"
113
+ }, Je = /* @__PURE__ */ O({
114
+ __name: "TextField",
115
+ props: /* @__PURE__ */ K(/* @__PURE__ */ ue({
116
+ label: {},
117
+ labelHidden: { type: Boolean },
118
+ hint: {},
119
+ error: {},
120
+ required: { type: Boolean },
121
+ editable: { type: Boolean },
122
+ disabled: { type: Boolean },
123
+ lockedReason: {},
124
+ presentation: {},
125
+ name: {},
126
+ type: {},
127
+ placeholder: {},
128
+ maxLength: {},
129
+ autocomplete: {},
130
+ mono: { type: Boolean },
131
+ prefix: {},
132
+ suffix: {},
133
+ width: {},
134
+ suggestions: { type: [Array, Function] },
135
+ suggestionsMinLength: {},
136
+ suggestionsDebounce: {},
137
+ suggestionsLimit: {},
138
+ recents: {}
139
+ }, {
140
+ ...ge,
141
+ type: "text",
142
+ placeholder: void 0,
143
+ maxLength: void 0,
144
+ autocomplete: void 0,
145
+ mono: !1,
146
+ prefix: void 0,
147
+ suffix: void 0,
148
+ width: "md",
149
+ suggestions: void 0,
150
+ suggestionsMinLength: 2,
151
+ suggestionsDebounce: 300,
152
+ suggestionsLimit: 8,
153
+ recents: void 0
154
+ }), {
155
+ modelValue: { default: "" },
156
+ modelModifiers: {}
157
+ }),
158
+ emits: /* @__PURE__ */ K(["picked"], ["update:modelValue"]),
159
+ setup(w, { expose: L, emit: o }) {
160
+ const t = w, c = ae(w, "modelValue"), b = o, k = z("input"), _ = z("anchor"), f = !!me(), S = fe("text", () => t.error ? "error" : t.disabled ? "locked" : "rest"), h = y(() => f ? pe(t.width) : "w-full"), { t: v } = G(), a = (e) => typeof e == "string" ? { value: e, label: e } : { value: e.text, label: e.text, ...e.detail !== void 0 ? { description: e.detail } : {} }, g = y(() => {
161
+ const e = t.suggestions;
162
+ if (e)
163
+ return typeof e == "function" ? async (p, x) => (await e(p, x)).map(a) : e.map(a);
164
+ }), l = y(() => g.value !== void 0), d = ke({
165
+ source: () => g.value,
166
+ minLength: () => t.suggestionsMinLength,
167
+ debounce: () => t.suggestionsDebounce,
168
+ limit: () => t.suggestionsLimit,
169
+ listAllWhenEmpty: !1,
170
+ recents: () => t.recents
171
+ }), { items: C, open: D, status: N, highlighted: R, showingRecent: W } = d, H = ie(!0), V = () => {
172
+ const e = k.value;
173
+ H.value = !e || e.selectionStart === e.value.length && e.selectionEnd === e.value.length;
174
+ }, $ = y(() => l.value && D.value && !W.value && H.value && d.current.value ? _e(c.value, d.current.value.label) : ""), I = y(() => U(D.value, C.value.length, N.value, !1));
175
+ function j(e) {
176
+ V(), l.value && d.ask(e.target.value);
177
+ }
178
+ function T(e) {
179
+ c.value = e.value, d.remember(e), d.close(), b("picked", { text: e.value, ...e.description !== void 0 ? { detail: e.description } : {} });
180
+ }
181
+ function J() {
182
+ l.value && c.value === "" && d.show("");
183
+ }
184
+ function Q() {
185
+ const e = d.current.value;
186
+ return !$.value || !e ? !1 : (T(e), !0);
187
+ }
188
+ const X = (e) => {
189
+ l.value && d.keydown(e, { pick: T, enterNeedsMove: !0, complete: Q });
190
+ };
191
+ return L({ focus: () => k.value?.focus() }), (e, p) => (n(), A(he, le(s(ve)(t), {
192
+ value: c.value,
193
+ prefix: t.prefix,
194
+ suffix: t.suffix,
195
+ "value-style": t.mono ? "mono" : void 0
196
+ }), re({
197
+ default: q(({ id: x, describedby: Y, invalid: Z }) => [
198
+ m("div", {
199
+ ref_key: "anchor",
200
+ ref: _,
201
+ class: B(["flex items-center gap-1.5", [s(S), h.value]])
202
+ }, [
203
+ t.prefix ? (n(), i("span", Pe, r(t.prefix), 1)) : u("", !0),
204
+ m("div", ze, [
205
+ ce(m("input", {
206
+ id: x,
207
+ ref_key: "input",
208
+ ref: k,
209
+ "onUpdate:modelValue": p[0] || (p[0] = (M) => c.value = M),
210
+ type: t.type,
211
+ name: t.name,
212
+ placeholder: t.placeholder,
213
+ maxlength: t.maxLength,
214
+ autocomplete: l.value ? "off" : t.autocomplete,
215
+ disabled: t.disabled,
216
+ required: t.required,
217
+ "aria-required": t.required || void 0,
218
+ "aria-invalid": Z || void 0,
219
+ "aria-describedby": Y,
220
+ role: l.value ? "combobox" : void 0,
221
+ "aria-autocomplete": l.value ? "both" : void 0,
222
+ "aria-expanded": l.value ? I.value : void 0,
223
+ "aria-controls": l.value ? `${x}-list` : void 0,
224
+ "aria-activedescendant": l.value && I.value && s(C).length > 0 ? `${x}-option-${s(R)}` : void 0,
225
+ class: B(["block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed", [t.mono ? "font-mono" : "", f && !l.value ? "compact:text-right" : ""]]),
226
+ onInput: j,
227
+ onKeyup: V,
228
+ onClick: V,
229
+ onKeydown: X,
230
+ onFocus: J,
231
+ onBlur: p[1] || (p[1] = (M) => s(d).close())
232
+ }, null, 42, Ae), [
233
+ [de, c.value]
234
+ ]),
235
+ $.value ? (n(), i("span", {
236
+ key: 0,
237
+ "aria-hidden": "true",
238
+ class: B(["pointer-events-none absolute inset-0 flex items-center overflow-hidden whitespace-pre py-1 text-body", t.mono ? "font-mono" : ""]),
239
+ "data-test": "completion"
240
+ }, [
241
+ m("span", Ne, r(c.value), 1),
242
+ m("span", Re, r($.value), 1)
243
+ ], 2)) : u("", !0)
244
+ ]),
245
+ t.suffix ? (n(), i("span", We, r(t.suffix), 1)) : u("", !0)
246
+ ], 2),
247
+ l.value ? (n(), A(Fe, {
248
+ key: 0,
249
+ id: x,
250
+ anchor: _.value,
251
+ open: s(D),
252
+ items: s(C),
253
+ highlighted: s(R),
254
+ query: c.value,
255
+ status: s(N),
256
+ recent: s(W),
257
+ "empty-message": !1,
258
+ hint: $.value ? s(v)("core.form.suggestions.keys_complete") : s(v)("core.form.suggestions.keys_pick"),
259
+ onPick: T,
260
+ onHover: p[2] || (p[2] = (M) => s(d).highlight(M))
261
+ }, null, 8, ["id", "anchor", "open", "items", "highlighted", "query", "status", "recent", "hint"])) : u("", !0)
262
+ ]),
263
+ _: 2
264
+ }, [
265
+ e.$slots.trailing ? {
266
+ name: "trailing",
267
+ fn: q(() => [
268
+ P(e.$slots, "trailing")
269
+ ]),
270
+ key: "0"
271
+ } : void 0,
272
+ e.$slots.labelTrailing ? {
273
+ name: "labelTrailing",
274
+ fn: q(() => [
275
+ P(e.$slots, "labelTrailing")
276
+ ]),
277
+ key: "1"
278
+ } : void 0,
279
+ e.$slots.readonly ? {
280
+ name: "readonly",
281
+ fn: q(() => [
282
+ P(e.$slots, "readonly")
283
+ ]),
284
+ key: "2"
285
+ } : void 0
286
+ ]), 1040, ["value", "prefix", "suffix", "value-style"]));
287
+ }
288
+ });
289
+ export {
290
+ Je as _,
291
+ Fe as a
292
+ };
@@ -0,0 +1,91 @@
1
+ import { defineComponent as q, useModel as C, useTemplateRef as T, computed as n, openBlock as c, createBlock as V, mergeProps as _, unref as m, createSlots as L, withCtx as t, createElementVNode as p, normalizeClass as f, withDirectives as M, vModelText as D, createElementBlock as S, toDisplayString as z, createCommentVNode as E, renderSlot as s, mergeModels as F, mergeDefaults as P } from "vue";
2
+ import { u as R } from "./mediaQuery-CygcXmFW.js";
3
+ import { a as N, u as j, c as G, _ as H, f as U, b as A } from "./control-B_Nwtmag.js";
4
+ const I = ["id", "name", "rows", "placeholder", "maxlength", "autocomplete", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], J = {
5
+ key: 0,
6
+ class: "mt-1 self-end text-footnote tabular-nums text-content-muted"
7
+ }, W = /* @__PURE__ */ q({
8
+ __name: "TextareaField",
9
+ props: /* @__PURE__ */ F(/* @__PURE__ */ P({
10
+ label: {},
11
+ labelHidden: { type: Boolean },
12
+ hint: {},
13
+ error: {},
14
+ required: { type: Boolean },
15
+ editable: { type: Boolean },
16
+ disabled: { type: Boolean },
17
+ lockedReason: {},
18
+ presentation: {},
19
+ name: {},
20
+ placeholder: {},
21
+ maxLength: {},
22
+ rows: {},
23
+ autocomplete: {},
24
+ stacked: { type: Boolean }
25
+ }, { ...A, placeholder: void 0, maxLength: void 0, rows: 3, autocomplete: void 0, stacked: !1 }), {
26
+ modelValue: { default: "" },
27
+ modelModifiers: {}
28
+ }),
29
+ emits: ["update:modelValue"],
30
+ setup(d, { expose: v }) {
31
+ const e = d, o = C(d, "modelValue"), i = T("area"), b = !!N(), y = R(), { editable: g } = j(e), r = n(() => b && !e.stacked && !y.value && g.value && !!e.label), l = n(() => e.maxLength ? `${o.value.length} / ${e.maxLength}` : void 0), h = n(() => r.value && l.value ? [e.hint, l.value].filter(Boolean).join(" · ") : e.hint), k = G("area", () => e.error ? "error" : e.disabled ? "locked" : "rest");
32
+ return v({ focus: () => i.value?.focus() }), (a, u) => (c(), V(H, _({ ...m(U)(e), hint: h.value }, {
33
+ value: o.value,
34
+ "row-layout": r.value ? "entry" : "stacked",
35
+ "row-label-align": "top"
36
+ }), L({
37
+ default: t(({ id: w, describedby: x, invalid: B }) => [
38
+ p("div", {
39
+ class: f(["w-full", m(k)])
40
+ }, [
41
+ M(p("textarea", {
42
+ id: w,
43
+ ref_key: "area",
44
+ ref: i,
45
+ "onUpdate:modelValue": u[0] || (u[0] = ($) => o.value = $),
46
+ name: e.name,
47
+ rows: e.rows,
48
+ placeholder: e.placeholder,
49
+ maxlength: e.maxLength,
50
+ autocomplete: e.autocomplete,
51
+ disabled: e.disabled,
52
+ required: e.required,
53
+ "aria-required": e.required || void 0,
54
+ "aria-invalid": B || void 0,
55
+ "aria-describedby": x,
56
+ class: f(["block w-full border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed", e.disabled ? "resize-none" : "resize-y"])
57
+ }, null, 10, I), [
58
+ [D, o.value]
59
+ ])
60
+ ], 2),
61
+ !r.value && l.value ? (c(), S("p", J, z(l.value), 1)) : E("", !0)
62
+ ]),
63
+ _: 2
64
+ }, [
65
+ a.$slots.trailing ? {
66
+ name: "trailing",
67
+ fn: t(() => [
68
+ s(a.$slots, "trailing")
69
+ ]),
70
+ key: "0"
71
+ } : void 0,
72
+ a.$slots.labelTrailing ? {
73
+ name: "labelTrailing",
74
+ fn: t(() => [
75
+ s(a.$slots, "labelTrailing")
76
+ ]),
77
+ key: "1"
78
+ } : void 0,
79
+ a.$slots.readonly ? {
80
+ name: "readonly",
81
+ fn: t(() => [
82
+ s(a.$slots, "readonly")
83
+ ]),
84
+ key: "2"
85
+ } : void 0
86
+ ]), 1040, ["value", "row-layout"]));
87
+ }
88
+ });
89
+ export {
90
+ W as _
91
+ };
@@ -0,0 +1,187 @@
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-EcqrfWKz.js";
4
+ import { u as ee } from "./format-B8mJm946.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-Dx-tDhNE.js";
8
+ import { c as ae, _ as re, f as se, b as ie } from "./control-B_Nwtmag.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-aTfPBAhw.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
+ };