@wssto2/vue-core 0.4.13 → 0.4.15
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.
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-LlfIPWsJ.js → ActionRow.vue_vue_type_script_setup_true_lang-CkvS5W6K.js} +1 -1
- package/dist/{Activity-DhVVSf60.js → Activity-4q26REYj.js} +6 -6
- package/dist/{Changes-Czs32zlz.js → Changes-CKIuGF8O.js} +5 -5
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DkpFEHUw.js → CollectionPage.vue_vue_type_script_setup_true_lang-B17cUOzj.js} +2 -2
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-GVasv8ao.js → DateField.vue_vue_type_script_setup_true_lang-DehwWm78.js} +17 -16
- package/dist/{DeadLetters-DBUALYXL.js → DeadLetters-DPGcQOz1.js} +4 -4
- package/dist/FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js +285 -0
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DG2zdG_a.js → FormGroup.vue_vue_type_script_setup_true_lang-noYI9QMk.js} +1 -1
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-cr0xNDXP.js → FormView.vue_vue_type_script_setup_true_lang-BcIbTMHN.js} +2 -2
- package/dist/{General-UWbJQLc8.js → General-CUA9b3ML.js} +10 -10
- package/dist/{NewRolePage-Dm7urTx0.js → NewRolePage-DBfCvDWA.js} +3 -3
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-Dm6FfJ2T.js +126 -0
- package/dist/{ProfilePage-Ep75xf-u.js → ProfilePage-On-eAiJ-.js} +41 -41
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CDZjkiU5.js → RoleEditor.vue_vue_type_script_setup_true_lang-fvAf3rQm.js} +44 -44
- package/dist/{RolePage-CQc_wV3b.js → RolePage-B8oul55j.js} +8 -8
- package/dist/{RolesPage-CG7InZ_u.js → RolesPage-DsXVivdj.js} +5 -5
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-BMqWlpsL.js → SegmentedField.vue_vue_type_script_setup_true_lang-B2d55hrh.js} +7 -6
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-DedKLLQK.js +443 -0
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-D4k5QeWS.js → SessionList.vue_vue_type_script_setup_true_lang-CirlMdHb.js} +2 -2
- package/dist/{Sessions-_w3Tnevz.js → Sessions-BTyXDEuY.js} +4 -4
- package/dist/{SettingsPage-BNdeH-_0.js → SettingsPage-DHTmMgif.js} +9 -9
- package/dist/{SignIn-DIjshMpl.js → SignIn-DU4DE2wj.js} +6 -6
- package/dist/{SignInPage-C3-LHjo2.js → SignInPage-BA22kyOp.js} +3 -3
- package/dist/{SignIns-DNdLctGJ.js → SignIns-C8QAZBaL.js} +3 -3
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-CM8yp9JQ.js → SwitchField.vue_vue_type_script_setup_true_lang-B2Z2hy_h.js} +11 -10
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js → TextField.vue_vue_type_script_setup_true_lang-nqnGG7Zc.js} +27 -26
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-CqAWfABZ.js → TextareaField.vue_vue_type_script_setup_true_lang-BgIQyYtf.js} +9 -8
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DWfAUlnz.js → TimeField.vue_vue_type_script_setup_true_lang-Dr0h-V_8.js} +25 -24
- package/dist/{UserRecord-C0JZgK47.js → UserRecord-D1BNmYp9.js} +10 -10
- package/dist/{UsersList-Bc8dCuRB.js → UsersList-ltx3G23-.js} +8 -8
- package/dist/access/index.js +1 -1
- package/dist/app/application.d.ts +13 -0
- package/dist/app/index.js +160 -159
- package/dist/collection/index.js +1 -1
- package/dist/control-CX9BG2UB.js +320 -0
- package/dist/describeError-B-NMa--w.js +53 -0
- package/dist/fieldMessages-DV6sESpn.js +25 -0
- package/dist/form/DateField.vue.d.ts +1 -0
- package/dist/form/DateTimeField.vue.d.ts +1 -0
- package/dist/form/Field.vue.d.ts +1 -0
- package/dist/form/FileField.vue.d.ts +1 -0
- package/dist/form/FormErrors.vue.d.ts +1 -1
- package/dist/form/FormRow.vue.d.ts +3 -0
- package/dist/form/I18nField.vue.d.ts +1 -0
- package/dist/form/MoneyField.vue.d.ts +1 -0
- package/dist/form/MonthYearField.vue.d.ts +1 -0
- package/dist/form/NumberField.vue.d.ts +5 -0
- package/dist/form/PhotoField.vue.d.ts +1 -0
- package/dist/form/SelectField.vue.d.ts +5 -6
- package/dist/form/SwitchField.vue.d.ts +1 -0
- package/dist/form/TextField.vue.d.ts +1 -0
- package/dist/form/TextareaField.vue.d.ts +1 -0
- package/dist/form/TimeField.vue.d.ts +1 -0
- package/dist/form/field.d.ts +3 -0
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.js +469 -456
- package/dist/form/useForm.d.ts +2 -2
- package/dist/form/useHiddenFieldErrors.d.ts +23 -0
- package/dist/form/useSaveChrome.d.ts +8 -3
- package/dist/i18n/describeError.d.ts +19 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +8 -6
- package/dist/identity/fieldMessages.d.ts +1 -1
- package/dist/identity/index.js +1 -1
- package/dist/{index-Cz4LtYKa.js → index-BCw_Ki6z.js} +2 -2
- package/dist/{index-BesWsiIg.js → index-Chh4z9xW.js} +10 -10
- package/dist/{index-BEDhdJQE.js → index-DwdVrW6q.js} +15 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/phone/PhoneField.vue.d.ts +1 -0
- package/dist/phone/index.js +66 -65
- package/dist/resource/index.js +1 -1
- package/dist/resource/resource.d.ts +1 -1
- package/dist/{routeResource-DstM0hvf.js → routeResource-DlTsGTg_.js} +36 -32
- package/dist/state/index.js +1 -1
- package/dist/state/useLoad.d.ts +7 -0
- package/dist/{status-DfAac6vw.js → status-cWCAMAmW.js} +1 -1
- package/dist/{useCommand-BkONMn3X.js → useCommand-B-N6HJOz.js} +1 -1
- package/dist/useLoad-M7V-AVwR.js +43 -0
- package/dist/{useResourceForm-D1hIpwW5.js → useResourceForm-CP2lCwmD.js} +1 -1
- package/dist/useSaveChrome-7huA3FzR.js +26 -0
- package/package.json +1 -1
- package/dist/FormErrors.vue_vue_type_script_setup_true_lang-BQb7wLT0.js +0 -276
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-C7N5nq0P.js +0 -113
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-BJoAkBo2.js +0 -437
- package/dist/control-7EP4tjYy.js +0 -313
- package/dist/describeError-Ctga6GcS.js +0 -41
- package/dist/fieldMessages-C3Rpbktw.js +0 -25
- package/dist/useLoad-CYRVx6HW.js +0 -39
- package/dist/useSaveChrome-DuWm0Czf.js +0 -25
|
@@ -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
|
-
};
|