@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,58 +0,0 @@
1
- import { defineComponent as x, openBlock as l, createBlock as y, mergeProps as g, unref as s, withCtx as w, createElementVNode as _, normalizeClass as o, createElementBlock as a, Fragment as V, renderList as k, createTextVNode as h, toDisplayString as r, createCommentVNode as B, mergeDefaults as C } from "vue";
2
- import { u as L, a as F, _ as D, f as N, b as E } from "./control-7EP4tjYy.js";
3
- const P = ["id", "aria-label", "aria-describedby", "aria-invalid"], R = ["disabled", "aria-pressed", "onClick"], G = /* @__PURE__ */ x({
4
- __name: "SegmentedField",
5
- props: /* @__PURE__ */ C({
6
- label: {},
7
- hint: {},
8
- error: {},
9
- required: { type: Boolean },
10
- editable: { type: Boolean },
11
- disabled: { type: Boolean },
12
- lockedReason: {},
13
- presentation: {},
14
- name: {},
15
- modelValue: {},
16
- options: {},
17
- rowLayout: {}
18
- }, { ...E, modelValue: null, rowLayout: "setting" }),
19
- emits: ["update:modelValue"],
20
- setup(i, { emit: d }) {
21
- const e = i, u = d, { editable: c } = L(e), m = !!F(), f = () => e.options.find((n) => n.value === e.modelValue)?.label ?? null;
22
- return (n, S) => (l(), y(D, g(s(N)(e), {
23
- value: f(),
24
- "row-layout": e.rowLayout
25
- }), {
26
- default: w(({ id: b, describedby: p, invalid: v }) => [
27
- _("div", {
28
- id: b,
29
- role: "group",
30
- "aria-label": e.label,
31
- "aria-describedby": p,
32
- "aria-invalid": v || void 0,
33
- "data-test": "segmented",
34
- class: o(["max-w-full flex-wrap rounded-control bg-fill p-0.5", [m && e.rowLayout === "stacked" ? "flex w-full" : "inline-flex", e.disabled ? "opacity-45" : ""]])
35
- }, [
36
- (l(!0), a(V, null, k(e.options, (t) => (l(), a("button", {
37
- key: t.value,
38
- type: "button",
39
- disabled: e.disabled || !s(c) || t.disabled,
40
- "aria-pressed": t.value === e.modelValue,
41
- class: o(["relative min-h-7 min-w-fit flex-1 whitespace-nowrap rounded-control px-3.5 py-1 text-sm transition-colors duration-motion-fast ease-motion-standard focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", t.value === e.modelValue ? "bg-segment-selected font-semibold text-content-strong shadow-sm" : "cursor-pointer font-medium text-content hover:text-content-strong"]),
42
- onClick: ($) => u("update:modelValue", t.value)
43
- }, [
44
- h(r(t.label) + " ", 1),
45
- t.count !== void 0 ? (l(), a("span", {
46
- key: 0,
47
- class: o(["ml-1.5 rounded-full px-1.5 text-caption font-semibold tabular-nums", t.value === e.modelValue ? "bg-tint-soft text-content-link" : "bg-fill-strong text-content-muted"])
48
- }, r(t.count), 3)) : B("", !0)
49
- ], 10, R))), 128))
50
- ], 10, P)
51
- ]),
52
- _: 1
53
- }, 16, ["value", "row-layout"]));
54
- }
55
- });
56
- export {
57
- G as _
58
- };
@@ -1,437 +0,0 @@
1
- import { defineComponent as N, ref as P, useId as I, useTemplateRef as R, computed as k, watch as B, nextTick as j, openBlock as n, createElementBlock as g, normalizeClass as y, createElementVNode as s, createVNode as V, unref as t, withDirectives as G, vModelText as K, createCommentVNode as h, toDisplayString as w, createBlock as L, Fragment as T, renderList as E, onScopeDispose as W, useModel as J, mergeProps as M, withCtx as q, createSlots as Q, createTextVNode as X, mergeModels as Y, mergeDefaults as Z } from "vue";
2
- import { useI18n as H } from "vue-i18n";
3
- import { _ as ee } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
4
- import { _ as D } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
5
- import { u as te } from "./mediaQuery-CygcXmFW.js";
6
- import { _ as F } from "./ToneDot.vue_vue_type_script_setup_true_lang-99rNn-L5.js";
7
- import { _ as oe } from "./Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
8
- import { _ as le } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
9
- import { a as ae, c as ne, _ as se, f as re, b as ie } from "./control-7EP4tjYy.js";
10
- import { g as ue, m as de } from "./options-Ba_0uLWN.js";
11
- import { a as ce } from "./suggestions-BxMm6MQA.js";
12
- const pe = { class: "flex min-h-9 items-center gap-1.5 rounded-control bg-fill px-2.5 text-content-muted focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-border-focus" }, me = ["aria-label", "placeholder"], fe = ["aria-multiselectable", "aria-busy"], ve = {
13
- key: 0,
14
- role: "presentation"
15
- }, be = ["aria-selected"], ge = { class: "flex-1 py-2" }, he = {
16
- key: 1,
17
- role: "presentation",
18
- class: "flex items-center gap-2.5 px-row-inset py-4 text-subheadline text-content-muted",
19
- "data-test": "options-loading"
20
- }, ye = { role: "status" }, xe = {
21
- key: 2,
22
- role: "presentation",
23
- class: "flex flex-col items-start gap-1 px-row-inset py-3",
24
- "data-test": "options-failed"
25
- }, ke = {
26
- role: "alert",
27
- class: "text-subheadline text-content-destructive"
28
- }, _e = ["id"], we = ["aria-labelledby"], $e = ["aria-selected"], Ce = ["disabled", "onClick"], Se = {
29
- key: 0,
30
- "aria-hidden": "true",
31
- class: "flex shrink-0 items-center"
32
- }, Le = { class: "min-w-0 flex-1 text-content-strong" }, Ve = {
33
- key: 1,
34
- class: "shrink-0 text-footnote text-content-muted"
35
- }, De = {
36
- key: 3,
37
- class: "px-4 py-6 text-center text-subheadline text-content-muted"
38
- }, U = /* @__PURE__ */ N({
39
- __name: "OptionList",
40
- props: {
41
- options: {},
42
- modelValue: { default: null },
43
- multiple: { type: Boolean, default: !1 },
44
- searchFrom: { default: 9 },
45
- noneLabel: { default: void 0 },
46
- presentation: { default: "grouped" },
47
- status: { default: "loaded" }
48
- },
49
- emits: ["select", "retry"],
50
- setup(r, { emit: l }) {
51
- const e = r, c = l, { t: v } = H(), b = P(""), f = I(), x = R("root"), o = k(() => e.options.length >= e.searchFrom), p = k(() => ue(de(e.options, b.value))), S = (m) => e.multiple ? Array.isArray(e.modelValue) && e.modelValue.includes(m.value) : e.modelValue === m.value, A = k(() => e.multiple ? !1 : e.modelValue === null);
52
- function O(m) {
53
- if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(m.key)) return;
54
- const a = [...x.value?.querySelectorAll("[data-option]:not([disabled])") ?? []];
55
- if (a.length === 0) return;
56
- const u = a.indexOf(document.activeElement), i = m.key === "Home" ? 0 : m.key === "End" ? a.length - 1 : m.key === "ArrowDown" ? Math.min(u + 1, a.length - 1) : Math.max(u - 1, 0);
57
- m.key === "ArrowUp" && u <= 0 ? x.value?.querySelector("[data-option-search]")?.focus() : a[u === -1 && m.key === "ArrowDown" ? 0 : i]?.focus(), m.preventDefault();
58
- }
59
- const $ = k(() => e.presentation === "grouped"), C = k(() => e.status === "loading"), d = k(() => e.status === "failed");
60
- return B(() => e.status, (m, _) => {
61
- _ !== "loading" || m === "loading" || j(() => {
62
- const a = document.activeElement;
63
- (!a || a === document.body || a.getAttribute("role") === "dialog" && !!x.value && a.contains(x.value)) && x.value?.querySelector("[data-option-search], [data-option]:not([disabled])")?.focus({ preventScroll: !0 });
64
- });
65
- }), (m, _) => (n(), g("div", {
66
- ref_key: "root",
67
- ref: x,
68
- "data-test": "option-list",
69
- onKeydown: O
70
- }, [
71
- o.value ? (n(), g("div", {
72
- key: 0,
73
- class: y(["sticky top-0 z-10 pb-2", $.value ? "bg-surface-page pt-1" : "bg-surface-cell"])
74
- }, [
75
- s("label", pe, [
76
- V(t(D), {
77
- name: "search",
78
- size: 16,
79
- class: "shrink-0"
80
- }),
81
- G(s("input", {
82
- "onUpdate:modelValue": _[0] || (_[0] = (a) => b.value = a),
83
- "data-option-search": "",
84
- type: "search",
85
- enterkeyhint: "search",
86
- autocomplete: "off",
87
- autocapitalize: "off",
88
- spellcheck: "false",
89
- "aria-label": t(v)("core.form.select.search"),
90
- placeholder: t(v)("core.form.select.search"),
91
- class: "min-w-0 flex-1 border-0 bg-transparent p-0 text-body text-content-strong outline-none placeholder:text-content-disabled focus:ring-0"
92
- }, null, 8, me), [
93
- [K, b.value]
94
- ])
95
- ])
96
- ], 2)) : h("", !0),
97
- s("ul", {
98
- class: y(["flex flex-col", $.value ? "gap-group-gap" : "gap-2"]),
99
- role: "listbox",
100
- "aria-multiselectable": e.multiple || void 0,
101
- "aria-busy": C.value || void 0
102
- }, [
103
- e.noneLabel && b.value === "" ? (n(), g("li", ve, [
104
- s("ul", {
105
- role: "group",
106
- class: y($.value ? "rounded-group bg-surface-cell shadow-group" : "")
107
- }, [
108
- s("li", {
109
- role: "option",
110
- "aria-selected": A.value
111
- }, [
112
- s("button", {
113
- type: "button",
114
- "data-option": "",
115
- class: y(["flex min-h-row w-full cursor-pointer items-center gap-3 px-row-inset text-left text-body hover:bg-fill focus-visible:bg-fill focus-visible:outline-none active:bg-fill", [A.value ? "text-content-strong" : "text-content-muted", $.value ? "rounded-group" : "rounded-control"]]),
116
- onClick: _[1] || (_[1] = (a) => c("select", null))
117
- }, [
118
- s("span", ge, w(e.noneLabel), 1),
119
- A.value ? (n(), L(t(D), {
120
- key: 0,
121
- name: "checkCustom",
122
- size: 18,
123
- class: "shrink-0 text-content-link"
124
- })) : h("", !0)
125
- ], 2)
126
- ], 8, be)
127
- ], 2)
128
- ])) : h("", !0),
129
- C.value ? (n(), g("li", he, [
130
- V(t(D), {
131
- name: "loader4Line",
132
- size: 16,
133
- class: "shrink-0 animate-spin text-content-link"
134
- }),
135
- s("span", ye, w(t(v)("core.form.select.loading")), 1)
136
- ])) : d.value ? (n(), g("li", xe, [
137
- s("span", ke, w(t(v)("core.form.select.load_failed")), 1),
138
- s("button", {
139
- type: "button",
140
- "data-option": "",
141
- "data-test": "options-retry",
142
- class: "-ml-2 cursor-pointer rounded-control px-2 py-1 text-subheadline font-medium text-content-link hover:bg-fill focus-visible:bg-fill focus-visible:outline-none",
143
- onClick: _[2] || (_[2] = (a) => c("retry"))
144
- }, w(t(v)("core.actions.retry")), 1)
145
- ])) : h("", !0),
146
- (n(!0), g(T, null, E(p.value, (a, u) => (n(), g("li", {
147
- key: a.title ?? u,
148
- role: "presentation"
149
- }, [
150
- a.title ? (n(), g("p", {
151
- key: 0,
152
- id: `${t(f)}-${u}`,
153
- class: "px-row-inset pb-1.5 text-footnote uppercase tracking-wide text-content-muted"
154
- }, w(a.title), 9, _e)) : h("", !0),
155
- s("ul", {
156
- role: "group",
157
- "aria-labelledby": a.title ? `${t(f)}-${u}` : void 0,
158
- class: y($.value ? "rounded-group bg-surface-cell shadow-group" : "")
159
- }, [
160
- (n(!0), g(T, null, E(a.options, (i) => (n(), g("li", {
161
- key: String(i.value),
162
- role: "option",
163
- "aria-selected": S(i),
164
- class: "group/option"
165
- }, [
166
- s("button", {
167
- type: "button",
168
- "data-option": "",
169
- "data-test": "option",
170
- disabled: i.disabled,
171
- class: y(["flex w-full cursor-pointer items-stretch gap-3 pl-row-inset text-left text-body hover:bg-fill focus-visible:bg-fill focus-visible:outline-none active:bg-fill disabled:cursor-not-allowed disabled:opacity-45", $.value ? "group-first/option:rounded-t-group group-last/option:rounded-b-group" : "rounded-control"]),
172
- onClick: (Be) => c("select", i.value)
173
- }, [
174
- e.multiple ? (n(), g("span", Se, [
175
- s("span", {
176
- class: y(["flex size-5.5 items-center justify-center rounded-full border", S(i) ? "border-control-on bg-control-on text-white" : "border-border-control"])
177
- }, [
178
- S(i) ? (n(), L(t(D), {
179
- key: 0,
180
- name: "checkCustom",
181
- size: 12
182
- })) : h("", !0)
183
- ], 2)
184
- ])) : h("", !0),
185
- s("span", {
186
- class: y(["flex min-h-row min-w-0 flex-1 items-center gap-3 py-2 pr-row-inset", $.value ? "border-t border-border-separator group-first/option:border-t-0" : ""])
187
- }, [
188
- i.dot ? (n(), L(F, {
189
- key: 0,
190
- tone: i.dot,
191
- class: "-mr-1.5"
192
- }, null, 8, ["tone"])) : h("", !0),
193
- s("span", Le, w(i.label), 1),
194
- i.description ? (n(), g("span", Ve, w(i.description), 1)) : h("", !0),
195
- !e.multiple && S(i) ? (n(), L(t(D), {
196
- key: 2,
197
- name: "checkCustom",
198
- size: 18,
199
- class: "shrink-0 text-content-link"
200
- })) : h("", !0)
201
- ], 2)
202
- ], 10, Ce)
203
- ], 8, $e))), 128))
204
- ], 10, we)
205
- ]))), 128)),
206
- p.value.length === 0 && !C.value && !d.value ? (n(), g("li", De, w(t(v)("core.form.select.no_matches")), 1)) : h("", !0)
207
- ], 10, fe)
208
- ], 544));
209
- }
210
- });
211
- function Ke(r) {
212
- const l = ce(), e = r.for !== void 0;
213
- let c = 0;
214
- function v() {
215
- const b = r.for?.();
216
- if (e && b == null) {
217
- l.cancel(), l.items.value = [], l.status.value = "idle";
218
- return;
219
- }
220
- l.run(
221
- (f) => e ? r.load(b, { signal: f }) : r.load({ signal: f })
222
- );
223
- }
224
- return B(
225
- () => r.for?.(),
226
- (b, f) => {
227
- f != null && c++, v();
228
- },
229
- { immediate: !0 }
230
- ), W(l.cancel), {
231
- get status() {
232
- return l.status.value;
233
- },
234
- get options() {
235
- return l.items.value;
236
- },
237
- get generation() {
238
- return c;
239
- },
240
- reload: v
241
- };
242
- }
243
- const z = (r) => Array.isArray(r), qe = [];
244
- function ze(r, l) {
245
- const e = k(() => {
246
- const o = r();
247
- return z(o) ? o : o.options;
248
- }), c = k(() => {
249
- const o = r();
250
- return z(o) ? "loaded" : o.status;
251
- }), v = k(() => c.value === "loading" || c.value === "failed" ? qe : e.value), b = k(() => c.value === "loading"), f = r();
252
- let x = z(f) ? 0 : f.generation;
253
- return B(
254
- () => {
255
- const o = r();
256
- return z(o) ? null : o.status === "loaded" || o.status === "idle" ? o.options : null;
257
- },
258
- (o) => {
259
- const p = r();
260
- o === null || z(p) || p.generation === x || (x = p.generation, l(o));
261
- }
262
- ), { known: e, rows: v, status: c, loading: b, reload: () => {
263
- const o = r();
264
- z(o) || o.reload();
265
- } };
266
- }
267
- const Ae = ["id", "disabled", "aria-expanded", "aria-required", "aria-invalid", "aria-describedby", "aria-busy"], Oe = ["id", "disabled", "aria-required", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], Fe = { class: "max-h-72 overflow-y-auto" }, We = /* @__PURE__ */ N({
268
- __name: "SelectField",
269
- props: /* @__PURE__ */ Y(/* @__PURE__ */ Z({
270
- label: {},
271
- hint: {},
272
- error: {},
273
- required: { type: Boolean },
274
- editable: { type: Boolean },
275
- disabled: { type: Boolean },
276
- lockedReason: {},
277
- presentation: {},
278
- name: {},
279
- options: {},
280
- selected: {},
281
- placeholder: {},
282
- clearable: { type: Boolean },
283
- searchFrom: {}
284
- }, { ...ie, selected: null, placeholder: void 0, clearable: !1, searchFrom: 9 }), {
285
- modelValue: { default: null },
286
- modelModifiers: {}
287
- }),
288
- emits: ["update:modelValue"],
289
- setup(r) {
290
- const l = r, e = J(r, "modelValue"), { t: c } = H(), v = te(), b = !!ae(), f = R("sheet"), x = P(!1), o = ze(() => l.options, (C) => {
291
- e.value !== null && !C.some((d) => d.value === e.value) && (e.value = null);
292
- }), p = k(() => o.known.value.find((C) => C.value === e.value) ?? (l.selected?.value === e.value ? l.selected : null)), S = k(() => l.placeholder ?? c("core.form.select.choose")), A = ne("popup", () => l.error ? "error" : l.disabled ? "locked" : "rest");
293
- function O(C) {
294
- e.value = C, f.value?.dismiss();
295
- }
296
- const $ = k(() => [
297
- "flex max-w-full min-w-0 items-center gap-1.5 py-1 pl-2.5 pr-2 text-body focus-visible:outline-none",
298
- b ? "compact:pl-0 compact:pr-0" : "",
299
- l.disabled ? "cursor-not-allowed" : "cursor-pointer"
300
- ]);
301
- return (C, d) => (n(), L(se, M(t(re)(l), {
302
- value: p.value?.label ?? null
303
- }), {
304
- default: q(({ id: m, describedby: _, invalid: a }) => [
305
- s("div", {
306
- class: y(["inline-flex max-w-full min-w-0", t(A)])
307
- }, [
308
- t(v) ? (n(), g("button", {
309
- key: 0,
310
- id: m,
311
- type: "button",
312
- disabled: l.disabled,
313
- "aria-haspopup": "dialog",
314
- "aria-expanded": x.value,
315
- "aria-required": l.required || void 0,
316
- "aria-invalid": a || void 0,
317
- "aria-describedby": _,
318
- "aria-busy": t(o).loading.value || void 0,
319
- class: y($.value),
320
- onClick: d[0] || (d[0] = (u) => f.value?.present())
321
- }, [
322
- p.value?.dot ? (n(), L(F, {
323
- key: 0,
324
- tone: p.value.dot
325
- }, null, 8, ["tone"])) : h("", !0),
326
- s("span", {
327
- class: y(["min-w-0 truncate", p.value ? b ? "text-content-strong compact:text-content-muted" : "text-content-strong" : "text-content-disabled"])
328
- }, w(p.value?.label ?? S.value), 3),
329
- V(t(D), {
330
- name: t(o).loading.value ? "loader4Line" : "expandUpDownLine",
331
- size: 14,
332
- class: y(["shrink-0 text-content-muted", t(o).loading.value ? "animate-spin" : ""])
333
- }, null, 8, ["name", "class"])
334
- ], 10, Ae)) : (n(), L(le, {
335
- key: 1,
336
- label: l.label ?? S.value,
337
- width: "md",
338
- "match-trigger-width": "",
339
- placement: "bottom-start",
340
- arrow: !1
341
- }, {
342
- trigger: q(({ toggle: u, attrs: i }) => [
343
- s("button", M({
344
- id: m,
345
- type: "button"
346
- }, i, {
347
- "aria-haspopup": "listbox",
348
- disabled: l.disabled,
349
- "aria-required": l.required || void 0,
350
- "aria-invalid": a || void 0,
351
- "aria-describedby": _,
352
- "aria-busy": t(o).loading.value || void 0,
353
- class: $.value,
354
- onClick: u
355
- }), [
356
- p.value?.dot ? (n(), L(F, {
357
- key: 0,
358
- tone: p.value.dot
359
- }, null, 8, ["tone"])) : h("", !0),
360
- s("span", {
361
- class: y(["min-w-0 truncate", p.value ? "text-content-strong" : "text-content-disabled"])
362
- }, w(p.value?.label ?? S.value), 3),
363
- V(t(D), {
364
- name: t(o).loading.value ? "loader4Line" : "expandUpDownLine",
365
- size: 14,
366
- class: y(["shrink-0 text-content-muted", t(o).loading.value ? "animate-spin" : ""])
367
- }, null, 8, ["name", "class"])
368
- ], 16, Oe)
369
- ]),
370
- default: q(({ dismiss: u }) => [
371
- s("div", Fe, [
372
- V(U, {
373
- options: t(o).rows.value,
374
- status: t(o).status.value,
375
- "model-value": e.value,
376
- "search-from": l.searchFrom,
377
- "none-label": l.clearable ? t(c)("core.form.select.clear") : void 0,
378
- presentation: "plain",
379
- onSelect: (i) => {
380
- e.value = i, u();
381
- },
382
- onRetry: d[1] || (d[1] = (i) => t(o).reload())
383
- }, null, 8, ["options", "status", "model-value", "search-from", "none-label", "onSelect"])
384
- ])
385
- ]),
386
- _: 2
387
- }, 1032, ["label"]))
388
- ], 2),
389
- t(v) ? (n(), L(oe, {
390
- key: 0,
391
- ref_key: "sheet",
392
- ref: f,
393
- title: l.label ?? S.value,
394
- grouped: "",
395
- onPresented: d[4] || (d[4] = (u) => x.value = !0),
396
- onDismissed: d[5] || (d[5] = (u) => x.value = !1)
397
- }, Q({
398
- default: q(() => [
399
- V(U, {
400
- options: t(o).rows.value,
401
- status: t(o).status.value,
402
- "model-value": e.value,
403
- "search-from": l.searchFrom,
404
- "none-label": l.clearable ? t(c)("core.form.select.clear") : void 0,
405
- onSelect: O,
406
- onRetry: d[2] || (d[2] = (u) => t(o).reload())
407
- }, null, 8, ["options", "status", "model-value", "search-from", "none-label"])
408
- ]),
409
- _: 2
410
- }, [
411
- l.clearable && e.value !== null ? {
412
- name: "footer",
413
- fn: q(() => [
414
- V(ee, {
415
- prominence: "plain",
416
- onClick: d[3] || (d[3] = (u) => O(null))
417
- }, {
418
- default: q(() => [
419
- X(w(t(c)("core.form.select.clear")), 1)
420
- ]),
421
- _: 1
422
- })
423
- ]),
424
- key: "0"
425
- } : void 0
426
- ]), 1032, ["title"])) : h("", !0)
427
- ]),
428
- _: 1
429
- }, 16, ["value"]));
430
- }
431
- });
432
- export {
433
- We as _,
434
- U as a,
435
- Ke as b,
436
- ze as u
437
- };
@@ -1,64 +0,0 @@
1
- import { defineComponent as p, useModel as b, computed as w, openBlock as v, createBlock as g, mergeProps as y, unref as a, withCtx as _, createElementVNode as t, renderSlot as k, normalizeClass as l, normalizeStyle as z, toDisplayString as B, mergeModels as S, mergeDefaults as x } from "vue";
2
- import { useI18n as C } from "vue-i18n";
3
- import { u as M, _ as V, f as D, b as E } from "./control-7EP4tjYy.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__ */ p({
5
- __name: "SwitchField",
6
- props: /* @__PURE__ */ S(/* @__PURE__ */ x({
7
- label: {},
8
- hint: {},
9
- error: {},
10
- required: { type: Boolean },
11
- editable: { type: Boolean },
12
- disabled: { type: Boolean },
13
- lockedReason: {},
14
- presentation: {},
15
- name: {},
16
- size: {}
17
- }, { ...E, size: "md" }), {
18
- modelValue: { type: Boolean, default: !1 },
19
- modelModifiers: {}
20
- }),
21
- emits: ["update:modelValue"],
22
- setup(s) {
23
- const o = s, e = b(s, "modelValue"), { t: i } = C(), { editable: r } = M(o), n = {
24
- sm: { "--switch-w": "1.75rem", "--switch-h": "1rem" },
25
- md: { "--switch-w": "var(--app-switch-width)", "--switch-h": "var(--app-switch-height)" },
26
- lg: { "--switch-w": "3.1875rem", "--switch-h": "1.9375rem" }
27
- }, d = w(() => n[o.size]);
28
- function c() {
29
- !o.disabled && r.value && (e.value = !e.value);
30
- }
31
- return (u, $) => (v(), g(V, y(a(D)(o), {
32
- value: e.value,
33
- "row-layout": "setting"
34
- }), {
35
- default: _(({ id: m, describedby: h, invalid: f }) => [
36
- t("div", F, [
37
- k(u.$slots, "before"),
38
- t("button", {
39
- id: m,
40
- type: "button",
41
- role: "switch",
42
- "aria-checked": e.value,
43
- "aria-label": o.label,
44
- "aria-describedby": h,
45
- "aria-invalid": f || void 0,
46
- disabled: o.disabled,
47
- style: z(d.value),
48
- class: l(["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"]),
49
- onClick: c
50
- }, [
51
- t("span", {
52
- class: l(["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))]" : ""])
53
- }, null, 2),
54
- t("span", P, B(e.value ? a(i)("core.form.yes") : a(i)("core.form.no")), 1)
55
- ], 14, I)
56
- ])
57
- ]),
58
- _: 3
59
- }, 16, ["value"]));
60
- }
61
- });
62
- export {
63
- Z as _
64
- };