@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
@@ -1,269 +0,0 @@
1
- import { defineComponent as H, useTemplateRef as P, computed as x, watch as Y, nextTick as Z, openBlock as n, createElementBlock as i, withModifiers as ee, normalizeStyle as te, unref as s, createElementVNode as m, toDisplayString as r, createCommentVNode as d, Fragment as E, renderList as oe, normalizeClass as q, createBlock as z, createTextVNode as F, useModel as se, ref as ne, mergeProps as ae, withCtx as ie, withDirectives as le, vModelDynamic as re, mergeModels as I, mergeDefaults as ce } from "vue";
2
- import { useI18n as K } from "vue-i18n";
3
- import { b as ue } from "./controlSurface-t7OEFESJ.js";
4
- import { a as de, c as pe, _ as me, f as fe, b as he } from "./control-7EP4tjYy.js";
5
- import { _ as ve } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
- import { u as ge } from "./anchored-Cj4--8dT.js";
7
- import { l as O, m as xe, u as ye, c as be } from "./suggestions-BxMm6MQA.js";
8
- const _e = ["id", "aria-busy"], ke = { class: "min-h-0 flex-1 overflow-y-auto p-1.5" }, we = {
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
- }, $e = ["id", "aria-selected", "aria-disabled", "onMouseenter", "onClick"], Me = { class: "min-w-0 flex-1" }, qe = { class: "block truncate text-body text-content-strong" }, Le = {
13
- key: 0,
14
- class: "font-semibold"
15
- }, Be = {
16
- key: 0,
17
- class: "block truncate text-footnote text-content-muted"
18
- }, Ce = {
19
- key: 2,
20
- class: "px-3 py-2 text-footnote text-content-muted",
21
- role: "status"
22
- }, Se = {
23
- key: 3,
24
- class: "px-3 py-2 text-footnote text-content-destructive",
25
- role: "alert"
26
- }, De = {
27
- key: 4,
28
- class: "px-3 py-2 text-footnote text-content-muted"
29
- }, Ve = {
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
- }, Ee = /* @__PURE__ */ H({
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 } = K(), b = P("panel"), _ = x(() => O(o.open, o.items.length, o.status, o.emptyMessage)), k = x(() => o.status === "loading"), f = (h) => xe(h.label, o.query), { style: B } = ge(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 Y(() => o.highlighted, () => void Z(() => b.value?.querySelector("[aria-selected='true']")?.scrollIntoView?.({ block: "nearest" }))), (h, v) => _.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": k.value || void 0,
65
- style: te(s(B)),
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] = ee(() => {
69
- }, ["prevent"]))
70
- }, [
71
- m("div", ke, [
72
- o.recent ? (n(), i("p", we, r(s(c)("core.form.suggestions.recent")), 1)) : d("", !0),
73
- o.items.length > 0 ? (n(!0), i(E, { key: 1 }, oe(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: q(["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" : "", k.value ? "opacity-60" : ""]]),
81
- onMouseenter: (l) => t("hover", g),
82
- onClick: (l) => !a.disabled && t("pick", a)
83
- }, [
84
- o.recent ? (n(), z(s(ve), {
85
- key: 0,
86
- name: "history",
87
- size: 16,
88
- class: "shrink-0 text-content-disabled"
89
- })) : d("", !0),
90
- m("span", Me, [
91
- m("span", qe, [
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", Le, r(f(a).match), 1)) : d("", !0),
97
- F(r(f(a).after), 1)
98
- ], 64))
99
- ]),
100
- a.description ? (n(), i("span", Be, r(a.description), 1)) : d("", !0)
101
- ])
102
- ], 42, $e))), 128)) : o.status === "loading" ? (n(), i("p", Ce, r(s(c)("core.form.select.loading")), 1)) : o.status === "failed" ? (n(), i("p", Se, r(s(c)("core.form.select.failed")), 1)) : (n(), i("p", De, r(s(c)("core.form.select.no_matches")), 1))
103
- ]),
104
- o.hint && o.items.length > 0 ? (n(), i("p", Ve, r(o.hint), 1)) : d("", !0)
105
- ], 44, _e)) : d("", !0);
106
- }
107
- }), Fe = {
108
- key: 0,
109
- class: "shrink-0 text-footnote text-content-muted"
110
- }, Pe = { class: "relative min-w-0 flex-1" }, ze = ["id", "type", "name", "placeholder", "maxlength", "autocomplete", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby", "role", "aria-autocomplete", "aria-expanded", "aria-controls", "aria-activedescendant"], Ae = { class: "invisible" }, Ne = { class: "text-content-disabled" }, Re = {
111
- key: 1,
112
- class: "shrink-0 text-footnote text-content-muted"
113
- }, Ue = /* @__PURE__ */ H({
114
- __name: "TextField",
115
- props: /* @__PURE__ */ I(/* @__PURE__ */ ce({
116
- label: {},
117
- hint: {},
118
- error: {},
119
- required: { type: Boolean },
120
- editable: { type: Boolean },
121
- disabled: { type: Boolean },
122
- lockedReason: {},
123
- presentation: {},
124
- name: {},
125
- type: {},
126
- placeholder: {},
127
- maxLength: {},
128
- autocomplete: {},
129
- mono: { type: Boolean },
130
- prefix: {},
131
- suffix: {},
132
- width: {},
133
- suggestions: { type: [Array, Function] },
134
- suggestionsMinLength: {},
135
- suggestionsDebounce: {},
136
- suggestionsLimit: {},
137
- recents: {}
138
- }, {
139
- ...he,
140
- type: "text",
141
- placeholder: void 0,
142
- maxLength: void 0,
143
- autocomplete: void 0,
144
- mono: !1,
145
- prefix: void 0,
146
- suffix: void 0,
147
- width: "md",
148
- suggestions: void 0,
149
- suggestionsMinLength: 2,
150
- suggestionsDebounce: 300,
151
- suggestionsLimit: 8,
152
- recents: void 0
153
- }), {
154
- modelValue: { default: "" },
155
- modelModifiers: {}
156
- }),
157
- emits: /* @__PURE__ */ I(["picked"], ["update:modelValue"]),
158
- setup(w, { expose: L, emit: o }) {
159
- const t = w, c = se(w, "modelValue"), b = o, _ = P("input"), k = P("anchor"), f = !!de(), B = pe("text", () => t.error ? "error" : t.disabled ? "locked" : "rest"), h = x(() => f ? ue(t.width) : "w-full"), { t: v } = K(), a = (e) => typeof e == "string" ? { value: e, label: e } : { value: e.text, label: e.text, ...e.detail !== void 0 ? { description: e.detail } : {} }, g = x(() => {
160
- const e = t.suggestions;
161
- if (e)
162
- return typeof e == "function" ? async (p, y) => (await e(p, y)).map(a) : e.map(a);
163
- }), l = x(() => g.value !== void 0), u = ye({
164
- source: () => g.value,
165
- minLength: () => t.suggestionsMinLength,
166
- debounce: () => t.suggestionsDebounce,
167
- limit: () => t.suggestionsLimit,
168
- listAllWhenEmpty: !1,
169
- recents: () => t.recents
170
- }), { items: C, open: S, status: A, highlighted: N, showingRecent: R } = u, T = ne(!0), D = () => {
171
- const e = _.value;
172
- T.value = !e || e.selectionStart === e.value.length && e.selectionEnd === e.value.length;
173
- }, $ = x(() => l.value && S.value && !R.value && T.value && u.current.value ? be(c.value, u.current.value.label) : ""), W = x(() => O(S.value, C.value.length, A.value, !1));
174
- function G(e) {
175
- D(), l.value && u.ask(e.target.value);
176
- }
177
- function V(e) {
178
- c.value = e.value, u.remember(e), u.close(), b("picked", { text: e.value, ...e.description !== void 0 ? { detail: e.description } : {} });
179
- }
180
- function U() {
181
- l.value && c.value === "" && u.show("");
182
- }
183
- function j() {
184
- const e = u.current.value;
185
- return !$.value || !e ? !1 : (V(e), !0);
186
- }
187
- const J = (e) => {
188
- l.value && u.keydown(e, { pick: V, enterNeedsMove: !0, complete: j });
189
- };
190
- return L({ focus: () => _.value?.focus() }), (e, p) => (n(), z(me, ae(s(fe)(t), {
191
- value: c.value,
192
- prefix: t.prefix,
193
- suffix: t.suffix,
194
- "value-style": t.mono ? "mono" : void 0
195
- }), {
196
- default: ie(({ id: y, describedby: Q, invalid: X }) => [
197
- m("div", {
198
- ref_key: "anchor",
199
- ref: k,
200
- class: q(["flex items-center gap-1.5", [s(B), h.value]])
201
- }, [
202
- t.prefix ? (n(), i("span", Fe, r(t.prefix), 1)) : d("", !0),
203
- m("div", Pe, [
204
- le(m("input", {
205
- id: y,
206
- ref_key: "input",
207
- ref: _,
208
- "onUpdate:modelValue": p[0] || (p[0] = (M) => c.value = M),
209
- type: t.type,
210
- name: t.name,
211
- placeholder: t.placeholder,
212
- maxlength: t.maxLength,
213
- autocomplete: l.value ? "off" : t.autocomplete,
214
- disabled: t.disabled,
215
- required: t.required,
216
- "aria-required": t.required || void 0,
217
- "aria-invalid": X || void 0,
218
- "aria-describedby": Q,
219
- role: l.value ? "combobox" : void 0,
220
- "aria-autocomplete": l.value ? "both" : void 0,
221
- "aria-expanded": l.value ? W.value : void 0,
222
- "aria-controls": l.value ? `${y}-list` : void 0,
223
- "aria-activedescendant": l.value && W.value && s(C).length > 0 ? `${y}-option-${s(N)}` : void 0,
224
- class: q(["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" : ""]]),
225
- onInput: G,
226
- onKeyup: D,
227
- onClick: D,
228
- onKeydown: J,
229
- onFocus: U,
230
- onBlur: p[1] || (p[1] = (M) => s(u).close())
231
- }, null, 42, ze), [
232
- [re, c.value]
233
- ]),
234
- $.value ? (n(), i("span", {
235
- key: 0,
236
- "aria-hidden": "true",
237
- class: q(["pointer-events-none absolute inset-0 flex items-center overflow-hidden whitespace-pre py-1 text-body", t.mono ? "font-mono" : ""]),
238
- "data-test": "completion"
239
- }, [
240
- m("span", Ae, r(c.value), 1),
241
- m("span", Ne, r($.value), 1)
242
- ], 2)) : d("", !0)
243
- ]),
244
- t.suffix ? (n(), i("span", Re, r(t.suffix), 1)) : d("", !0)
245
- ], 2),
246
- l.value ? (n(), z(Ee, {
247
- key: 0,
248
- id: y,
249
- anchor: k.value,
250
- open: s(S),
251
- items: s(C),
252
- highlighted: s(N),
253
- query: c.value,
254
- status: s(A),
255
- recent: s(R),
256
- "empty-message": !1,
257
- hint: $.value ? s(v)("core.form.suggestions.keys_complete") : s(v)("core.form.suggestions.keys_pick"),
258
- onPick: V,
259
- onHover: p[2] || (p[2] = (M) => s(u).highlight(M))
260
- }, null, 8, ["id", "anchor", "open", "items", "highlighted", "query", "status", "recent", "hint"])) : d("", !0)
261
- ]),
262
- _: 1
263
- }, 16, ["value", "prefix", "suffix", "value-style"]));
264
- }
265
- });
266
- export {
267
- Ue as _,
268
- Ee as a
269
- };
@@ -1,68 +0,0 @@
1
- import { defineComponent as k, useModel as _, useTemplateRef as B, computed as l, openBlock as d, createBlock as q, mergeProps as C, unref as i, withCtx as V, createElementVNode as u, normalizeClass as c, withDirectives as L, vModelText as M, createElementBlock as D, toDisplayString as z, createCommentVNode as E, mergeModels as F, mergeDefaults as P } from "vue";
2
- import { u as R } from "./mediaQuery-CygcXmFW.js";
3
- import { a as T, u as $, c as N, _ as S, f as j, b as G } from "./control-7EP4tjYy.js";
4
- const U = ["id", "name", "rows", "placeholder", "maxlength", "autocomplete", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], A = {
5
- key: 0,
6
- class: "mt-1 self-end text-footnote tabular-nums text-content-muted"
7
- }, O = /* @__PURE__ */ k({
8
- __name: "TextareaField",
9
- props: /* @__PURE__ */ F(/* @__PURE__ */ P({
10
- label: {},
11
- hint: {},
12
- error: {},
13
- required: { type: Boolean },
14
- editable: { type: Boolean },
15
- disabled: { type: Boolean },
16
- lockedReason: {},
17
- presentation: {},
18
- name: {},
19
- placeholder: {},
20
- maxLength: {},
21
- rows: {},
22
- autocomplete: {},
23
- stacked: { type: Boolean }
24
- }, { ...G, placeholder: void 0, maxLength: void 0, rows: 3, autocomplete: void 0, stacked: !1 }), {
25
- modelValue: { default: "" },
26
- modelModifiers: {}
27
- }),
28
- emits: ["update:modelValue"],
29
- setup(r, { expose: m }) {
30
- const e = r, a = _(r, "modelValue"), s = B("area"), p = !!T(), f = R(), { editable: v } = $(e), t = l(() => p && !e.stacked && !f.value && v.value && !!e.label), o = l(() => e.maxLength ? `${a.value.length} / ${e.maxLength}` : void 0), b = l(() => t.value && o.value ? [e.hint, o.value].filter(Boolean).join(" · ") : e.hint), h = N("area", () => e.error ? "error" : e.disabled ? "locked" : "rest");
31
- return m({ focus: () => s.value?.focus() }), (H, n) => (d(), q(S, C({ ...i(j)(e), hint: b.value }, {
32
- value: a.value,
33
- "row-layout": t.value ? "entry" : "stacked",
34
- "row-label-align": "top"
35
- }), {
36
- default: V(({ id: x, describedby: g, invalid: y }) => [
37
- u("div", {
38
- class: c(["w-full", i(h)])
39
- }, [
40
- L(u("textarea", {
41
- id: x,
42
- ref_key: "area",
43
- ref: s,
44
- "onUpdate:modelValue": n[0] || (n[0] = (w) => a.value = w),
45
- name: e.name,
46
- rows: e.rows,
47
- placeholder: e.placeholder,
48
- maxlength: e.maxLength,
49
- autocomplete: e.autocomplete,
50
- disabled: e.disabled,
51
- required: e.required,
52
- "aria-required": e.required || void 0,
53
- "aria-invalid": y || void 0,
54
- "aria-describedby": g,
55
- class: c(["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"])
56
- }, null, 10, U), [
57
- [M, a.value]
58
- ])
59
- ], 2),
60
- !t.value && o.value ? (d(), D("p", A, z(o.value), 1)) : E("", !0)
61
- ]),
62
- _: 1
63
- }, 16, ["value", "row-layout"]));
64
- }
65
- });
66
- export {
67
- O as _
68
- };
@@ -1,164 +0,0 @@
1
- import { computed as u, defineComponent as K, useModel as W, useTemplateRef as v, openBlock as m, createBlock as E, mergeProps as w, unref as t, withCtx as b, createElementBlock as x, Fragment as N, createVNode as d, createTextVNode as j, toDisplayString as G, createCommentVNode as P, createElementVNode as h, normalizeClass as H, mergeModels as J, mergeDefaults as O, nextTick as U } from "vue";
2
- import { useI18n as L } from "vue-i18n";
3
- import { _ as X } from "./DateButton.vue_vue_type_script_setup_true_lang-EcqrfWKz.js";
4
- import { u as Y } from "./format-B8mJm946.js";
5
- import { _ as Z } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
- import { u as ee } from "./mediaQuery-CygcXmFW.js";
7
- import { _ as te } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
8
- import { c as oe, _ as re, f as ae, b as le } from "./control-7EP4tjYy.js";
9
- import { d as se, r as ie, t as z, p as ne, u as ue, a as me, i as F, _ as de, b as ce, c as pe } from "./useTypedEntry-aTfPBAhw.js";
10
- function fe(i) {
11
- const { t: n } = L(), e = u(() => [n("core.form.time.words.now").toLowerCase(), "now"]);
12
- return {
13
- placeholder: u(() => n("core.form.time.placeholder")),
14
- parse(o) {
15
- if (e.value.includes(o.trim().toLowerCase())) return { value: z(i()) };
16
- const a = ne(o, 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: (o) => (o ?? se).map((a) => ie(a, n("core.form.time.now"), z(i())))
20
- };
21
- }
22
- const ve = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], be = ["aria-label", "onClick"], Ce = /* @__PURE__ */ K({
23
- __name: "TimeField",
24
- props: /* @__PURE__ */ J(/* @__PURE__ */ O({
25
- label: {},
26
- hint: {},
27
- error: {},
28
- required: { type: Boolean },
29
- editable: { type: Boolean },
30
- disabled: { type: Boolean },
31
- lockedReason: {},
32
- presentation: {},
33
- name: {},
34
- minuteStep: {},
35
- quickTimes: {}
36
- }, { ...le, minuteStep: 1, quickTimes: void 0 }), {
37
- modelValue: { default: null },
38
- modelModifiers: {}
39
- }),
40
- emits: ["update:modelValue"],
41
- setup(i, { expose: n }) {
42
- const e = i, o = W(i, "modelValue"), { t: a } = L(), M = Y(), I = ee(), T = v("input"), c = v("popover"), g = v("panel"), q = v("sheet"), k = fe(() => e.minuteStep), l = ue({ model: o, display: (r) => r, parse: k.parse }), C = u(() => k.shortcuts(e.quickTimes)), V = u(() => e.error || l.message.value), Q = oe("date", () => V.value ? "error" : e.disabled ? "locked" : "rest"), R = u(() => {
43
- const r = me(o.value);
44
- return r ? M.time(new Date(2e3, 0, 1, r.hour, r.minute)) : null;
45
- }), $ = u(() => F(l.typed.value) ? l.typed.value : F(o.value) ? o.value : null);
46
- async function y(r) {
47
- e.disabled || (c.value?.present(), r && (await U(), await U(), g.value?.querySelector("[role=listbox]")?.focus()));
48
- }
49
- function A(r) {
50
- r.key === "Enter" ? (l.commit(), c.value?.dismiss()) : r.key === "ArrowDown" && (r.preventDefault(), y(!0));
51
- }
52
- return n({ focus: () => T.value?.focus() }), (r, s) => (m(), E(re, w({ ...t(ae)(e), error: V.value }, {
53
- value: R.value,
54
- "value-style": "numeric"
55
- }), {
56
- default: b(({ id: S, describedby: B, invalid: D }) => [
57
- t(I) ? (m(), x(N, { key: 0 }, [
58
- d(X, w({ id: S, "aria-describedby": B }, {
59
- disabled: e.disabled,
60
- invalid: D,
61
- placeholder: t(a)("core.form.select.choose"),
62
- onClick: s[0] || (s[0] = (p) => q.value?.present())
63
- }), {
64
- default: b(() => [
65
- o.value ? (m(), x(N, { key: 0 }, [
66
- j(G(o.value), 1)
67
- ], 64)) : P("", !0)
68
- ]),
69
- _: 1
70
- }, 16, ["disabled", "invalid", "placeholder"]),
71
- d(de, {
72
- ref_key: "sheet",
73
- ref: q,
74
- title: e.label ?? t(a)("core.form.time.label"),
75
- mode: "time",
76
- "model-value": o.value,
77
- shortcuts: C.value,
78
- step: e.minuteStep,
79
- clearable: !e.required,
80
- "onUpdate:modelValue": t(l).set
81
- }, null, 8, ["title", "model-value", "shortcuts", "step", "clearable", "onUpdate:modelValue"])
82
- ], 64)) : (m(), E(te, {
83
- key: 1,
84
- ref_key: "popover",
85
- ref: c,
86
- label: e.label ?? t(a)("core.form.time.label"),
87
- width: "sm",
88
- placement: "bottom-start",
89
- arrow: !1,
90
- autofocus: !1
91
- }, {
92
- trigger: b(({ attrs: p, presented: _ }) => [
93
- h("div", {
94
- class: H(["inline-flex max-w-full items-center gap-2", t(Q)])
95
- }, [
96
- h("input", w({
97
- id: S,
98
- ref_key: "input",
99
- ref: T
100
- }, p, {
101
- type: "text",
102
- role: "combobox",
103
- autocomplete: "off",
104
- size: "10",
105
- name: e.name,
106
- value: t(l).text.value,
107
- placeholder: t(k).placeholder.value,
108
- disabled: e.disabled,
109
- required: e.required,
110
- "aria-required": e.required || void 0,
111
- "aria-invalid": D || void 0,
112
- "aria-describedby": B,
113
- 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",
114
- onInput: s[1] || (s[1] = (f) => t(l).input(f.target.value)),
115
- onBlur: s[2] || (s[2] = (f) => t(l).commit()),
116
- onKeydown: A,
117
- onClick: s[3] || (s[3] = (f) => y(!1))
118
- }), null, 16, ve),
119
- e.disabled ? P("", !0) : (m(), x("button", {
120
- key: 0,
121
- type: "button",
122
- tabindex: "-1",
123
- "aria-label": t(a)("core.form.time.open"),
124
- class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
125
- onClick: (f) => _ ? c.value?.dismiss() : y(!0)
126
- }, [
127
- d(t(Z), {
128
- name: "timeLine",
129
- size: 18
130
- })
131
- ], 8, be))
132
- ], 2)
133
- ]),
134
- default: b(({ dismiss: p }) => [
135
- h("div", {
136
- ref_key: "panel",
137
- ref: g,
138
- class: "flex flex-col gap-2.5"
139
- }, [
140
- d(ce, {
141
- "model-value": $.value,
142
- step: e.minuteStep,
143
- "onUpdate:modelValue": t(l).set
144
- }, null, 8, ["model-value", "step", "onUpdate:modelValue"]),
145
- d(pe, {
146
- items: C.value,
147
- selected: $.value,
148
- onPick: (_) => {
149
- t(l).set(_), p();
150
- }
151
- }, null, 8, ["items", "selected", "onPick"])
152
- ], 512)
153
- ]),
154
- _: 2
155
- }, 1032, ["label"]))
156
- ]),
157
- _: 1
158
- }, 16, ["value"]));
159
- }
160
- });
161
- export {
162
- Ce as _,
163
- fe as u
164
- };