@wssto2/vue-core 0.4.4 → 0.4.5
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/{Activity-BH0jQxZs.js → Activity-DukTfcmn.js} +2 -2
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-DxD6JvyK.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-B7qSUiee.js} +1 -1
- package/dist/{Changes-DS81sZj9.js → Changes-Dhi7EBe9.js} +2 -2
- package/dist/CollectionPage.vue_vue_type_script_setup_true_lang-BuAdhiy_.js +1514 -0
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DBtMgcW6.js → DataTable.vue_vue_type_script_setup_true_lang-KPm5NrDE.js} +1 -1
- package/dist/{DeadLetters-BqKtaowL.js → DeadLetters-CfKE1axC.js} +2 -2
- package/dist/{General-CK-9LrQ2.js → General-BwT5Y_TN.js} +2 -2
- package/dist/IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js +50 -0
- package/dist/{Menu.vue_vue_type_script_setup_true_lang-ClsOlOSr.js → Menu.vue_vue_type_script_setup_true_lang-uPmxWvds.js} +56 -50
- package/dist/{NewRolePage-CziDdoeG.js → NewRolePage-B8OGQE-A.js} +3 -3
- package/dist/{ProfilePage-x063Zij2.js → ProfilePage-DIJEhiW-.js} +4 -4
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-Bua3wbN6.js → RecordHeader.vue_vue_type_script_setup_true_lang-D87Hs75d.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-CzP4BNh7.js → ResourcePage.vue_vue_type_script_setup_true_lang-gJGEfLzX.js} +1 -1
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-BjhaIqqG.js → RoleEditor.vue_vue_type_script_setup_true_lang-4YJhNgbn.js} +1 -1
- package/dist/{RolePage-Cecu3BKn.js → RolePage-Bn0re7VE.js} +6 -6
- package/dist/{RolesPage-DIL35QcF.js → RolesPage-CjEAQvTq.js} +3 -3
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-CaF3LPbQ.js → SectionList.vue_vue_type_script_setup_true_lang-B0p_8xQG.js} +2 -2
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BJfEOvEf.js → SectionNavigator.vue_vue_type_script_setup_true_lang-ROl9_pdO.js} +3 -3
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-BJoAkBo2.js +437 -0
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-D5KRitar.js → SessionList.vue_vue_type_script_setup_true_lang-D4k5QeWS.js} +1 -1
- package/dist/{Sessions-DhHIVk7e.js → Sessions-BZnBtu7h.js} +2 -2
- package/dist/{SettingsPage-BuGtZcae.js → SettingsPage-BmRCB75J.js} +2 -2
- package/dist/{SignIn-DRls5eYK.js → SignIn-D-n9cfMH.js} +2 -2
- package/dist/{SignInPage-D9wR46KD.js → SignInPage-BzIP6sPa.js} +1 -1
- package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-CifEaH7c.js → SignInTable.vue_vue_type_script_setup_true_lang-ALAuc0sI.js} +1 -1
- package/dist/{SignIns-BMBFeBrK.js → SignIns-dFIzemgy.js} +2 -2
- package/dist/ToneDot.vue_vue_type_script_setup_true_lang-99rNn-L5.js +24 -0
- package/dist/{UserRecord-BOCP5XC6.js → UserRecord-DoOu1hWB.js} +5 -5
- package/dist/{UsersList-Df6HeAAO.js → UsersList-CYBGEOqE.js} +4 -4
- package/dist/access/index.js +1 -1
- package/dist/collection/CollectionCell.vue.d.ts +2 -0
- package/dist/collection/RecordIdentity.vue.d.ts +6 -0
- package/dist/collection/filters.d.ts +4 -0
- package/dist/collection/index.js +3 -3
- package/dist/collection/rowInteractions.d.ts +2 -0
- package/dist/controls/IconTile.vue.d.ts +10 -3
- package/dist/controls/index.js +1 -1
- package/dist/form/I18nField.vue.d.ts +1 -1
- package/dist/form/TextareaField.vue.d.ts +1 -1
- package/dist/form/index.js +4 -4
- package/dist/form/options.d.ts +3 -0
- package/dist/identity/index.js +1 -1
- package/dist/{index-EkQmsbBQ.js → index-BHt1dLX2.js} +2 -2
- package/dist/{index-BykMr7eH.js → index-BVX0nmMv.js} +10 -10
- package/dist/{index-BwMaMqSc.js → index-CixCeO47.js} +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/overlay/AlertDialog.vue.d.ts +2 -2
- package/dist/overlay/Menu.vue.d.ts +3 -0
- package/dist/overlay/index.js +1 -1
- package/dist/page/AdaptivePageShell.vue.d.ts +2 -2
- package/dist/page/ResourceHeader.vue.d.ts +2 -2
- package/dist/page/index.js +5 -5
- package/dist/resource/index.js +1 -1
- package/dist/{rowLayout-CZ7uZFnE.js → rowLayout-BkQWulan.js} +239 -221
- package/dist/shell/NavigationList.vue.d.ts +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/state/ToneDot.vue.d.ts +12 -0
- package/dist/{status-DyvlO552.js → status-D3cLPSCh.js} +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/collection.css +1 -1
- package/src/styles/theme.css +7 -0
- package/dist/CollectionPage.vue_vue_type_script_setup_true_lang-BZRdVhZo.js +0 -1485
- package/dist/IconTile.vue_vue_type_script_setup_true_lang-BpIjgu5E.js +0 -40
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-7O1BAx04.js +0 -423
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { defineComponent as s, openBlock as t, createElementBlock as o, normalizeClass as r, createBlock as l, unref as c, toDisplayString as d, createCommentVNode as x } from "vue";
|
|
2
|
-
import { _ as u } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
3
|
-
const m = ["data-tone"], g = /* @__PURE__ */ s({
|
|
4
|
-
__name: "IconTile",
|
|
5
|
-
props: {
|
|
6
|
-
tone: { default: "anchor" },
|
|
7
|
-
icon: { default: void 0 },
|
|
8
|
-
text: { default: void 0 },
|
|
9
|
-
size: { default: "row" }
|
|
10
|
-
},
|
|
11
|
-
setup(a) {
|
|
12
|
-
const e = a, i = {
|
|
13
|
-
brand: "bg-tile-brand text-tile-brand-foreground",
|
|
14
|
-
anchor: "bg-tile-anchor text-tile-anchor-foreground",
|
|
15
|
-
neutral: "bg-tile-neutral text-tile-neutral-foreground"
|
|
16
|
-
}, n = {
|
|
17
|
-
row: { box: "size-tile rounded-md", text: "text-caption" },
|
|
18
|
-
md: { box: "size-11 rounded-xl", text: "text-base" },
|
|
19
|
-
lg: { box: "size-14 rounded-2xl", text: "text-xl" }
|
|
20
|
-
};
|
|
21
|
-
return (f, p) => (t(), o("span", {
|
|
22
|
-
"aria-hidden": "true",
|
|
23
|
-
"data-tone": e.tone,
|
|
24
|
-
class: r(["inline-flex shrink-0 select-none items-center justify-center", [i[e.tone], n[e.size].box]])
|
|
25
|
-
}, [
|
|
26
|
-
e.icon ? (t(), l(c(u), {
|
|
27
|
-
key: 0,
|
|
28
|
-
name: e.icon,
|
|
29
|
-
size: 20,
|
|
30
|
-
class: "size-[62%]"
|
|
31
|
-
}, null, 8, ["name"])) : e.text ? (t(), o("span", {
|
|
32
|
-
key: 1,
|
|
33
|
-
class: r(["font-semibold leading-none", n[e.size].text])
|
|
34
|
-
}, d(e.text), 3)) : x("", !0)
|
|
35
|
-
], 10, m));
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export {
|
|
39
|
-
g as _
|
|
40
|
-
};
|
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import { defineComponent as U, ref as N, useId as H, useTemplateRef as P, computed as y, watch as F, nextTick as I, openBlock as n, createElementBlock as b, normalizeClass as g, createElementVNode as s, createVNode as L, unref as t, withDirectives as j, vModelText as G, createCommentVNode as _, toDisplayString as w, createBlock as z, Fragment as B, renderList as T, onScopeDispose as K, useModel as W, mergeProps as E, withCtx as D, createSlots as J, createTextVNode as Q, mergeModels as X, mergeDefaults as Y } from "vue";
|
|
2
|
-
import { useI18n as R } from "vue-i18n";
|
|
3
|
-
import { _ as Z } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
4
|
-
import { _ as V } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
5
|
-
import { u as ee } from "./mediaQuery-CygcXmFW.js";
|
|
6
|
-
import { _ as te } from "./Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
|
|
7
|
-
import { _ as oe } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
|
|
8
|
-
import { a as le, c as ae, _ as ne, f as se, b as re } from "./control-7EP4tjYy.js";
|
|
9
|
-
import { g as ie, m as ue } from "./options-Ba_0uLWN.js";
|
|
10
|
-
import { a as ce } from "./suggestions-BxMm6MQA.js";
|
|
11
|
-
const de = { 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" }, pe = ["aria-label", "placeholder"], me = ["aria-multiselectable", "aria-busy"], fe = {
|
|
12
|
-
key: 0,
|
|
13
|
-
role: "presentation"
|
|
14
|
-
}, ve = ["aria-selected"], be = { class: "flex-1 py-2" }, ge = {
|
|
15
|
-
key: 1,
|
|
16
|
-
role: "presentation",
|
|
17
|
-
class: "flex items-center gap-2.5 px-row-inset py-4 text-subheadline text-content-muted",
|
|
18
|
-
"data-test": "options-loading"
|
|
19
|
-
}, he = { role: "status" }, ye = {
|
|
20
|
-
key: 2,
|
|
21
|
-
role: "presentation",
|
|
22
|
-
class: "flex flex-col items-start gap-1 px-row-inset py-3",
|
|
23
|
-
"data-test": "options-failed"
|
|
24
|
-
}, xe = {
|
|
25
|
-
role: "alert",
|
|
26
|
-
class: "text-subheadline text-content-destructive"
|
|
27
|
-
}, ke = ["id"], _e = ["aria-labelledby"], we = ["aria-selected"], $e = ["disabled", "onClick"], Ce = {
|
|
28
|
-
key: 0,
|
|
29
|
-
"aria-hidden": "true",
|
|
30
|
-
class: "flex shrink-0 items-center"
|
|
31
|
-
}, Se = { class: "min-w-0 flex-1 text-content-strong" }, Le = {
|
|
32
|
-
key: 0,
|
|
33
|
-
class: "shrink-0 text-footnote text-content-muted"
|
|
34
|
-
}, Ve = {
|
|
35
|
-
key: 3,
|
|
36
|
-
class: "px-4 py-6 text-center text-subheadline text-content-muted"
|
|
37
|
-
}, M = /* @__PURE__ */ U({
|
|
38
|
-
__name: "OptionList",
|
|
39
|
-
props: {
|
|
40
|
-
options: {},
|
|
41
|
-
modelValue: { default: null },
|
|
42
|
-
multiple: { type: Boolean, default: !1 },
|
|
43
|
-
searchFrom: { default: 9 },
|
|
44
|
-
noneLabel: { default: void 0 },
|
|
45
|
-
presentation: { default: "grouped" },
|
|
46
|
-
status: { default: "loaded" }
|
|
47
|
-
},
|
|
48
|
-
emits: ["select", "retry"],
|
|
49
|
-
setup(r, { emit: l }) {
|
|
50
|
-
const e = r, d = l, { t: f } = R(), v = N(""), m = H(), h = P("root"), o = y(() => e.options.length >= e.searchFrom), x = y(() => ie(ue(e.options, v.value))), S = (p) => e.multiple ? Array.isArray(e.modelValue) && e.modelValue.includes(p.value) : e.modelValue === p.value, A = y(() => e.multiple ? !1 : e.modelValue === null);
|
|
51
|
-
function O(p) {
|
|
52
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(p.key)) return;
|
|
53
|
-
const a = [...h.value?.querySelectorAll("[data-option]:not([disabled])") ?? []];
|
|
54
|
-
if (a.length === 0) return;
|
|
55
|
-
const i = a.indexOf(document.activeElement), c = p.key === "Home" ? 0 : p.key === "End" ? a.length - 1 : p.key === "ArrowDown" ? Math.min(i + 1, a.length - 1) : Math.max(i - 1, 0);
|
|
56
|
-
p.key === "ArrowUp" && i <= 0 ? h.value?.querySelector("[data-option-search]")?.focus() : a[i === -1 && p.key === "ArrowDown" ? 0 : c]?.focus(), p.preventDefault();
|
|
57
|
-
}
|
|
58
|
-
const $ = y(() => e.presentation === "grouped"), C = y(() => e.status === "loading"), u = y(() => e.status === "failed");
|
|
59
|
-
return F(() => e.status, (p, k) => {
|
|
60
|
-
k !== "loading" || p === "loading" || I(() => {
|
|
61
|
-
const a = document.activeElement;
|
|
62
|
-
(!a || a === document.body || a.getAttribute("role") === "dialog" && !!h.value && a.contains(h.value)) && h.value?.querySelector("[data-option-search], [data-option]:not([disabled])")?.focus({ preventScroll: !0 });
|
|
63
|
-
});
|
|
64
|
-
}), (p, k) => (n(), b("div", {
|
|
65
|
-
ref_key: "root",
|
|
66
|
-
ref: h,
|
|
67
|
-
"data-test": "option-list",
|
|
68
|
-
onKeydown: O
|
|
69
|
-
}, [
|
|
70
|
-
o.value ? (n(), b("div", {
|
|
71
|
-
key: 0,
|
|
72
|
-
class: g(["sticky top-0 z-10 pb-2", $.value ? "bg-surface-page pt-1" : "bg-surface-cell"])
|
|
73
|
-
}, [
|
|
74
|
-
s("label", de, [
|
|
75
|
-
L(t(V), {
|
|
76
|
-
name: "search",
|
|
77
|
-
size: 16,
|
|
78
|
-
class: "shrink-0"
|
|
79
|
-
}),
|
|
80
|
-
j(s("input", {
|
|
81
|
-
"onUpdate:modelValue": k[0] || (k[0] = (a) => v.value = a),
|
|
82
|
-
"data-option-search": "",
|
|
83
|
-
type: "search",
|
|
84
|
-
enterkeyhint: "search",
|
|
85
|
-
autocomplete: "off",
|
|
86
|
-
autocapitalize: "off",
|
|
87
|
-
spellcheck: "false",
|
|
88
|
-
"aria-label": t(f)("core.form.select.search"),
|
|
89
|
-
placeholder: t(f)("core.form.select.search"),
|
|
90
|
-
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"
|
|
91
|
-
}, null, 8, pe), [
|
|
92
|
-
[G, v.value]
|
|
93
|
-
])
|
|
94
|
-
])
|
|
95
|
-
], 2)) : _("", !0),
|
|
96
|
-
s("ul", {
|
|
97
|
-
class: g(["flex flex-col", $.value ? "gap-group-gap" : "gap-2"]),
|
|
98
|
-
role: "listbox",
|
|
99
|
-
"aria-multiselectable": e.multiple || void 0,
|
|
100
|
-
"aria-busy": C.value || void 0
|
|
101
|
-
}, [
|
|
102
|
-
e.noneLabel && v.value === "" ? (n(), b("li", fe, [
|
|
103
|
-
s("ul", {
|
|
104
|
-
role: "group",
|
|
105
|
-
class: g($.value ? "rounded-group bg-surface-cell shadow-group" : "")
|
|
106
|
-
}, [
|
|
107
|
-
s("li", {
|
|
108
|
-
role: "option",
|
|
109
|
-
"aria-selected": A.value
|
|
110
|
-
}, [
|
|
111
|
-
s("button", {
|
|
112
|
-
type: "button",
|
|
113
|
-
"data-option": "",
|
|
114
|
-
class: g(["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"]]),
|
|
115
|
-
onClick: k[1] || (k[1] = (a) => d("select", null))
|
|
116
|
-
}, [
|
|
117
|
-
s("span", be, w(e.noneLabel), 1),
|
|
118
|
-
A.value ? (n(), z(t(V), {
|
|
119
|
-
key: 0,
|
|
120
|
-
name: "checkCustom",
|
|
121
|
-
size: 18,
|
|
122
|
-
class: "shrink-0 text-content-link"
|
|
123
|
-
})) : _("", !0)
|
|
124
|
-
], 2)
|
|
125
|
-
], 8, ve)
|
|
126
|
-
], 2)
|
|
127
|
-
])) : _("", !0),
|
|
128
|
-
C.value ? (n(), b("li", ge, [
|
|
129
|
-
L(t(V), {
|
|
130
|
-
name: "loader4Line",
|
|
131
|
-
size: 16,
|
|
132
|
-
class: "shrink-0 animate-spin text-content-link"
|
|
133
|
-
}),
|
|
134
|
-
s("span", he, w(t(f)("core.form.select.loading")), 1)
|
|
135
|
-
])) : u.value ? (n(), b("li", ye, [
|
|
136
|
-
s("span", xe, w(t(f)("core.form.select.load_failed")), 1),
|
|
137
|
-
s("button", {
|
|
138
|
-
type: "button",
|
|
139
|
-
"data-option": "",
|
|
140
|
-
"data-test": "options-retry",
|
|
141
|
-
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",
|
|
142
|
-
onClick: k[2] || (k[2] = (a) => d("retry"))
|
|
143
|
-
}, w(t(f)("core.actions.retry")), 1)
|
|
144
|
-
])) : _("", !0),
|
|
145
|
-
(n(!0), b(B, null, T(x.value, (a, i) => (n(), b("li", {
|
|
146
|
-
key: a.title ?? i,
|
|
147
|
-
role: "presentation"
|
|
148
|
-
}, [
|
|
149
|
-
a.title ? (n(), b("p", {
|
|
150
|
-
key: 0,
|
|
151
|
-
id: `${t(m)}-${i}`,
|
|
152
|
-
class: "px-row-inset pb-1.5 text-footnote uppercase tracking-wide text-content-muted"
|
|
153
|
-
}, w(a.title), 9, ke)) : _("", !0),
|
|
154
|
-
s("ul", {
|
|
155
|
-
role: "group",
|
|
156
|
-
"aria-labelledby": a.title ? `${t(m)}-${i}` : void 0,
|
|
157
|
-
class: g($.value ? "rounded-group bg-surface-cell shadow-group" : "")
|
|
158
|
-
}, [
|
|
159
|
-
(n(!0), b(B, null, T(a.options, (c) => (n(), b("li", {
|
|
160
|
-
key: String(c.value),
|
|
161
|
-
role: "option",
|
|
162
|
-
"aria-selected": S(c),
|
|
163
|
-
class: "group/option"
|
|
164
|
-
}, [
|
|
165
|
-
s("button", {
|
|
166
|
-
type: "button",
|
|
167
|
-
"data-option": "",
|
|
168
|
-
"data-test": "option",
|
|
169
|
-
disabled: c.disabled,
|
|
170
|
-
class: g(["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"]),
|
|
171
|
-
onClick: (Fe) => d("select", c.value)
|
|
172
|
-
}, [
|
|
173
|
-
e.multiple ? (n(), b("span", Ce, [
|
|
174
|
-
s("span", {
|
|
175
|
-
class: g(["flex size-5.5 items-center justify-center rounded-full border", S(c) ? "border-control-on bg-control-on text-white" : "border-border-control"])
|
|
176
|
-
}, [
|
|
177
|
-
S(c) ? (n(), z(t(V), {
|
|
178
|
-
key: 0,
|
|
179
|
-
name: "checkCustom",
|
|
180
|
-
size: 12
|
|
181
|
-
})) : _("", !0)
|
|
182
|
-
], 2)
|
|
183
|
-
])) : _("", !0),
|
|
184
|
-
s("span", {
|
|
185
|
-
class: g(["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" : ""])
|
|
186
|
-
}, [
|
|
187
|
-
s("span", Se, w(c.label), 1),
|
|
188
|
-
c.description ? (n(), b("span", Le, w(c.description), 1)) : _("", !0),
|
|
189
|
-
!e.multiple && S(c) ? (n(), z(t(V), {
|
|
190
|
-
key: 1,
|
|
191
|
-
name: "checkCustom",
|
|
192
|
-
size: 18,
|
|
193
|
-
class: "shrink-0 text-content-link"
|
|
194
|
-
})) : _("", !0)
|
|
195
|
-
], 2)
|
|
196
|
-
], 10, $e)
|
|
197
|
-
], 8, we))), 128))
|
|
198
|
-
], 10, _e)
|
|
199
|
-
]))), 128)),
|
|
200
|
-
x.value.length === 0 && !C.value && !u.value ? (n(), b("li", Ve, w(t(f)("core.form.select.no_matches")), 1)) : _("", !0)
|
|
201
|
-
], 10, me)
|
|
202
|
-
], 544));
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
function je(r) {
|
|
206
|
-
const l = ce(), e = r.for !== void 0;
|
|
207
|
-
let d = 0;
|
|
208
|
-
function f() {
|
|
209
|
-
const v = r.for?.();
|
|
210
|
-
if (e && v == null) {
|
|
211
|
-
l.cancel(), l.items.value = [], l.status.value = "idle";
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
l.run(
|
|
215
|
-
(m) => e ? r.load(v, { signal: m }) : r.load({ signal: m })
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
return F(
|
|
219
|
-
() => r.for?.(),
|
|
220
|
-
(v, m) => {
|
|
221
|
-
m != null && d++, f();
|
|
222
|
-
},
|
|
223
|
-
{ immediate: !0 }
|
|
224
|
-
), K(l.cancel), {
|
|
225
|
-
get status() {
|
|
226
|
-
return l.status.value;
|
|
227
|
-
},
|
|
228
|
-
get options() {
|
|
229
|
-
return l.items.value;
|
|
230
|
-
},
|
|
231
|
-
get generation() {
|
|
232
|
-
return d;
|
|
233
|
-
},
|
|
234
|
-
reload: f
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
const q = (r) => Array.isArray(r), De = [];
|
|
238
|
-
function qe(r, l) {
|
|
239
|
-
const e = y(() => {
|
|
240
|
-
const o = r();
|
|
241
|
-
return q(o) ? o : o.options;
|
|
242
|
-
}), d = y(() => {
|
|
243
|
-
const o = r();
|
|
244
|
-
return q(o) ? "loaded" : o.status;
|
|
245
|
-
}), f = y(() => d.value === "loading" || d.value === "failed" ? De : e.value), v = y(() => d.value === "loading"), m = r();
|
|
246
|
-
let h = q(m) ? 0 : m.generation;
|
|
247
|
-
return F(
|
|
248
|
-
() => {
|
|
249
|
-
const o = r();
|
|
250
|
-
return q(o) ? null : o.status === "loaded" || o.status === "idle" ? o.options : null;
|
|
251
|
-
},
|
|
252
|
-
(o) => {
|
|
253
|
-
const x = r();
|
|
254
|
-
o === null || q(x) || x.generation === h || (h = x.generation, l(o));
|
|
255
|
-
}
|
|
256
|
-
), { known: e, rows: f, status: d, loading: v, reload: () => {
|
|
257
|
-
const o = r();
|
|
258
|
-
q(o) || o.reload();
|
|
259
|
-
} };
|
|
260
|
-
}
|
|
261
|
-
const ze = ["id", "disabled", "aria-expanded", "aria-required", "aria-invalid", "aria-describedby", "aria-busy"], Ae = ["id", "disabled", "aria-required", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], Oe = { class: "max-h-72 overflow-y-auto" }, Ge = /* @__PURE__ */ U({
|
|
262
|
-
__name: "SelectField",
|
|
263
|
-
props: /* @__PURE__ */ X(/* @__PURE__ */ Y({
|
|
264
|
-
label: {},
|
|
265
|
-
hint: {},
|
|
266
|
-
error: {},
|
|
267
|
-
required: { type: Boolean },
|
|
268
|
-
editable: { type: Boolean },
|
|
269
|
-
disabled: { type: Boolean },
|
|
270
|
-
lockedReason: {},
|
|
271
|
-
presentation: {},
|
|
272
|
-
name: {},
|
|
273
|
-
options: {},
|
|
274
|
-
selected: {},
|
|
275
|
-
placeholder: {},
|
|
276
|
-
clearable: { type: Boolean },
|
|
277
|
-
searchFrom: {}
|
|
278
|
-
}, { ...re, selected: null, placeholder: void 0, clearable: !1, searchFrom: 9 }), {
|
|
279
|
-
modelValue: { default: null },
|
|
280
|
-
modelModifiers: {}
|
|
281
|
-
}),
|
|
282
|
-
emits: ["update:modelValue"],
|
|
283
|
-
setup(r) {
|
|
284
|
-
const l = r, e = W(r, "modelValue"), { t: d } = R(), f = ee(), v = !!le(), m = P("sheet"), h = N(!1), o = qe(() => l.options, (C) => {
|
|
285
|
-
e.value !== null && !C.some((u) => u.value === e.value) && (e.value = null);
|
|
286
|
-
}), x = y(() => o.known.value.find((C) => C.value === e.value) ?? (l.selected?.value === e.value ? l.selected : null)), S = y(() => l.placeholder ?? d("core.form.select.choose")), A = ae("popup", () => l.error ? "error" : l.disabled ? "locked" : "rest");
|
|
287
|
-
function O(C) {
|
|
288
|
-
e.value = C, m.value?.dismiss();
|
|
289
|
-
}
|
|
290
|
-
const $ = y(() => [
|
|
291
|
-
"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",
|
|
292
|
-
v ? "compact:pl-0 compact:pr-0" : "",
|
|
293
|
-
l.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
294
|
-
]);
|
|
295
|
-
return (C, u) => (n(), z(ne, E(t(se)(l), {
|
|
296
|
-
value: x.value?.label ?? null
|
|
297
|
-
}), {
|
|
298
|
-
default: D(({ id: p, describedby: k, invalid: a }) => [
|
|
299
|
-
s("div", {
|
|
300
|
-
class: g(["inline-flex max-w-full min-w-0", t(A)])
|
|
301
|
-
}, [
|
|
302
|
-
t(f) ? (n(), b("button", {
|
|
303
|
-
key: 0,
|
|
304
|
-
id: p,
|
|
305
|
-
type: "button",
|
|
306
|
-
disabled: l.disabled,
|
|
307
|
-
"aria-haspopup": "dialog",
|
|
308
|
-
"aria-expanded": h.value,
|
|
309
|
-
"aria-required": l.required || void 0,
|
|
310
|
-
"aria-invalid": a || void 0,
|
|
311
|
-
"aria-describedby": k,
|
|
312
|
-
"aria-busy": t(o).loading.value || void 0,
|
|
313
|
-
class: g($.value),
|
|
314
|
-
onClick: u[0] || (u[0] = (i) => m.value?.present())
|
|
315
|
-
}, [
|
|
316
|
-
s("span", {
|
|
317
|
-
class: g(["min-w-0 truncate", x.value ? v ? "text-content-strong compact:text-content-muted" : "text-content-strong" : "text-content-disabled"])
|
|
318
|
-
}, w(x.value?.label ?? S.value), 3),
|
|
319
|
-
L(t(V), {
|
|
320
|
-
name: t(o).loading.value ? "loader4Line" : "expandUpDownLine",
|
|
321
|
-
size: 14,
|
|
322
|
-
class: g(["shrink-0 text-content-muted", t(o).loading.value ? "animate-spin" : ""])
|
|
323
|
-
}, null, 8, ["name", "class"])
|
|
324
|
-
], 10, ze)) : (n(), z(oe, {
|
|
325
|
-
key: 1,
|
|
326
|
-
label: l.label ?? S.value,
|
|
327
|
-
width: "md",
|
|
328
|
-
"match-trigger-width": "",
|
|
329
|
-
placement: "bottom-start",
|
|
330
|
-
arrow: !1
|
|
331
|
-
}, {
|
|
332
|
-
trigger: D(({ toggle: i, attrs: c }) => [
|
|
333
|
-
s("button", E({
|
|
334
|
-
id: p,
|
|
335
|
-
type: "button"
|
|
336
|
-
}, c, {
|
|
337
|
-
"aria-haspopup": "listbox",
|
|
338
|
-
disabled: l.disabled,
|
|
339
|
-
"aria-required": l.required || void 0,
|
|
340
|
-
"aria-invalid": a || void 0,
|
|
341
|
-
"aria-describedby": k,
|
|
342
|
-
"aria-busy": t(o).loading.value || void 0,
|
|
343
|
-
class: $.value,
|
|
344
|
-
onClick: i
|
|
345
|
-
}), [
|
|
346
|
-
s("span", {
|
|
347
|
-
class: g(["min-w-0 truncate", x.value ? "text-content-strong" : "text-content-disabled"])
|
|
348
|
-
}, w(x.value?.label ?? S.value), 3),
|
|
349
|
-
L(t(V), {
|
|
350
|
-
name: t(o).loading.value ? "loader4Line" : "expandUpDownLine",
|
|
351
|
-
size: 14,
|
|
352
|
-
class: g(["shrink-0 text-content-muted", t(o).loading.value ? "animate-spin" : ""])
|
|
353
|
-
}, null, 8, ["name", "class"])
|
|
354
|
-
], 16, Ae)
|
|
355
|
-
]),
|
|
356
|
-
default: D(({ dismiss: i }) => [
|
|
357
|
-
s("div", Oe, [
|
|
358
|
-
L(M, {
|
|
359
|
-
options: t(o).rows.value,
|
|
360
|
-
status: t(o).status.value,
|
|
361
|
-
"model-value": e.value,
|
|
362
|
-
"search-from": l.searchFrom,
|
|
363
|
-
"none-label": l.clearable ? t(d)("core.form.select.clear") : void 0,
|
|
364
|
-
presentation: "plain",
|
|
365
|
-
onSelect: (c) => {
|
|
366
|
-
e.value = c, i();
|
|
367
|
-
},
|
|
368
|
-
onRetry: u[1] || (u[1] = (c) => t(o).reload())
|
|
369
|
-
}, null, 8, ["options", "status", "model-value", "search-from", "none-label", "onSelect"])
|
|
370
|
-
])
|
|
371
|
-
]),
|
|
372
|
-
_: 2
|
|
373
|
-
}, 1032, ["label"]))
|
|
374
|
-
], 2),
|
|
375
|
-
t(f) ? (n(), z(te, {
|
|
376
|
-
key: 0,
|
|
377
|
-
ref_key: "sheet",
|
|
378
|
-
ref: m,
|
|
379
|
-
title: l.label ?? S.value,
|
|
380
|
-
grouped: "",
|
|
381
|
-
onPresented: u[4] || (u[4] = (i) => h.value = !0),
|
|
382
|
-
onDismissed: u[5] || (u[5] = (i) => h.value = !1)
|
|
383
|
-
}, J({
|
|
384
|
-
default: D(() => [
|
|
385
|
-
L(M, {
|
|
386
|
-
options: t(o).rows.value,
|
|
387
|
-
status: t(o).status.value,
|
|
388
|
-
"model-value": e.value,
|
|
389
|
-
"search-from": l.searchFrom,
|
|
390
|
-
"none-label": l.clearable ? t(d)("core.form.select.clear") : void 0,
|
|
391
|
-
onSelect: O,
|
|
392
|
-
onRetry: u[2] || (u[2] = (i) => t(o).reload())
|
|
393
|
-
}, null, 8, ["options", "status", "model-value", "search-from", "none-label"])
|
|
394
|
-
]),
|
|
395
|
-
_: 2
|
|
396
|
-
}, [
|
|
397
|
-
l.clearable && e.value !== null ? {
|
|
398
|
-
name: "footer",
|
|
399
|
-
fn: D(() => [
|
|
400
|
-
L(Z, {
|
|
401
|
-
prominence: "plain",
|
|
402
|
-
onClick: u[3] || (u[3] = (i) => O(null))
|
|
403
|
-
}, {
|
|
404
|
-
default: D(() => [
|
|
405
|
-
Q(w(t(d)("core.form.select.clear")), 1)
|
|
406
|
-
]),
|
|
407
|
-
_: 1
|
|
408
|
-
})
|
|
409
|
-
]),
|
|
410
|
-
key: "0"
|
|
411
|
-
} : void 0
|
|
412
|
-
]), 1032, ["title"])) : _("", !0)
|
|
413
|
-
]),
|
|
414
|
-
_: 1
|
|
415
|
-
}, 16, ["value"]));
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
export {
|
|
419
|
-
Ge as _,
|
|
420
|
-
M as a,
|
|
421
|
-
je as b,
|
|
422
|
-
qe as u
|
|
423
|
-
};
|