@wssto2/vue-core 0.4.18 → 0.4.20
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-DOjn7fqy.js → ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js} +1 -1
- package/dist/{Activity-DB9ABAMb.js → Activity-C0NvjIi5.js} +4 -4
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-Bm0sxqNz.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-CxU9aNRQ.js} +1 -1
- package/dist/{Changes-IIczcs6O.js → Changes-hoMHeAZt.js} +3 -3
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CUoyYpaW.js → CollectionPage.vue_vue_type_script_setup_true_lang-BNM_cbXa.js} +6 -6
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-Wuvo-l_z.js → DataTable.vue_vue_type_script_setup_true_lang-DPuH84I7.js} +1 -1
- package/dist/{DateButton.vue_vue_type_script_setup_true_lang-EcqrfWKz.js → DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js} +5 -5
- package/dist/DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js +281 -0
- package/dist/{DeadLetters-Bq5YpnvT.js → DeadLetters-O6QReswO.js} +2 -2
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-BokxZ7LU.js → FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js} +3 -2
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-Dz5TZt92.js → FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js} +1 -1
- package/dist/{General-DQruOZs2.js → General-9Sgxb74n.js} +6 -6
- package/dist/{Menu.vue_vue_type_script_setup_true_lang-uPmxWvds.js → Menu.vue_vue_type_script_setup_true_lang-DsFOeCVe.js} +1 -1
- package/dist/{NewRolePage-BcA8jBBQ.js → NewRolePage-D-LunWMH.js} +3 -3
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js +161 -0
- package/dist/{Popover.vue_vue_type_script_setup_true_lang-BTOzgIQF.js → Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js} +8 -8
- package/dist/{ProfilePage-BqdCzyax.js → ProfilePage-DJUDCyEr.js} +6 -6
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DijFQnU6.js → RecordHeader.vue_vue_type_script_setup_true_lang-szzWzdDu.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-BpLnmA6n.js → ResourcePage.vue_vue_type_script_setup_true_lang-BFaaFQSm.js} +2 -2
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-DPpCuJWk.js → RoleEditor.vue_vue_type_script_setup_true_lang-D-b-O6SG.js} +7 -7
- package/dist/{RolePage-IES_ADt5.js → RolePage-Ha-EgoEJ.js} +7 -7
- package/dist/{RolesPage-D0K7tEL-.js → RolesPage-8uWWCClN.js} +5 -5
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-D5QWy-c1.js → SectionList.vue_vue_type_script_setup_true_lang-BJnz2ROc.js} +2 -2
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-CW81A_bn.js → SectionNavigator.vue_vue_type_script_setup_true_lang-BltrQnrQ.js} +2 -2
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-BMBkEmxr.js → SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js} +1 -1
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js +515 -0
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-C0XvavBw.js → SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js} +2 -2
- package/dist/{Sessions-BfpiOhGs.js → Sessions-Dz4KYMu9.js} +2 -2
- package/dist/{SettingsPage-BnEpURcU.js → SettingsPage-D47NSOYW.js} +7 -7
- package/dist/{SignIn-DrLE0gNr.js → SignIn-CNv68Tba.js} +4 -4
- package/dist/{SignInPage-CRynZCU2.js → SignInPage-CsjC4aiV.js} +3 -3
- package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-7Z9EmLs-.js → SignInTable.vue_vue_type_script_setup_true_lang-ByEAVfjv.js} +1 -1
- package/dist/{SignIns-BQ8tISWn.js → SignIns-CgsNf8uf.js} +2 -2
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-0weBvsJf.js → SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js} +1 -1
- package/dist/TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js +317 -0
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js +93 -0
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js +190 -0
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js → Tooltip.vue_vue_type_script_setup_true_lang-mErNPt8e.js} +1 -1
- package/dist/{UserRecord-CqmPm4Fv.js → UserRecord-B9r_9U1z.js} +7 -7
- package/dist/{UsersList-CHAray61.js → UsersList-BBLa3OCv.js} +6 -6
- package/dist/access/index.js +1 -1
- package/dist/{anchored-Cj4--8dT.js → anchored-DpuUwf-9.js} +17 -15
- package/dist/collection/index.js +4 -4
- package/dist/{control-B_Nwtmag.js → control-B4SdblL6.js} +134 -118
- package/dist/controls/index.js +1 -1
- package/dist/form/ComboField.vue.d.ts +9 -3
- package/dist/form/DateField.vue.d.ts +4 -0
- package/dist/form/DateTimeField.vue.d.ts +4 -0
- package/dist/form/Field.vue.d.ts +2 -0
- package/dist/form/MoneyField.vue.d.ts +10 -5
- package/dist/form/NumberField.vue.d.ts +13 -5
- package/dist/form/SelectField.vue.d.ts +5 -1
- package/dist/form/TextField.vue.d.ts +10 -2
- package/dist/form/TextareaField.vue.d.ts +4 -0
- package/dist/form/TimeField.vue.d.ts +4 -0
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1173 -1142
- package/dist/form/options.d.ts +4 -0
- package/dist/identity/index.js +1 -1
- package/dist/{index-91Lo0hJy.js → index-D-0JNiFF.js} +3 -3
- package/dist/{index-wlRejl73.js → index-D6BjUQJT.js} +7 -7
- package/dist/{index-sYamgVg7.js → index-Dxu7ZfCC.js} +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/overlay/anchored.d.ts +2 -0
- package/dist/overlay/index.js +3 -3
- package/dist/page/index.js +5 -5
- package/dist/phone/index.js +2 -2
- package/dist/resource/index.js +1 -1
- package/dist/{rowLayout-BFz4Kdoy.js → rowLayout-D1vrdy0s.js} +2 -2
- package/dist/shell/index.js +2 -2
- package/dist/{status-B_IMA25a.js → status-BLTC7wi1.js} +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/DateField.vue_vue_type_script_setup_true_lang-8mvjzRA-.js +0 -278
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-CC8bKyR_.js +0 -150
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-DkbBJpYX.js +0 -489
- package/dist/TextField.vue_vue_type_script_setup_true_lang-CWgn-vGl.js +0 -299
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-4wC3c0BM.js +0 -91
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-BebAIPeL.js +0 -187
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
import { ref as d, watch as E, nextTick as V, onScopeDispose as L } from "vue";
|
|
2
|
-
import { autoUpdate as
|
|
2
|
+
import { autoUpdate as P, offset as $, flip as z, shift as R, size as S, arrow as b, computePosition as A } from "@floating-ui/dom";
|
|
3
|
+
const O = 640;
|
|
3
4
|
function T(r, e) {
|
|
4
5
|
const s = d({ position: "fixed", left: "0px", top: "0px" }), c = d({}), f = d(e.placement());
|
|
5
6
|
let l = null;
|
|
6
7
|
async function o() {
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
8
|
+
const n = e.reference(), t = r.value;
|
|
9
|
+
if (!n || !t) return;
|
|
9
10
|
const u = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
$(e.offset),
|
|
12
|
+
z({ padding: e.padding }),
|
|
13
|
+
R({ padding: e.padding }),
|
|
14
|
+
S({
|
|
14
15
|
padding: e.padding,
|
|
15
16
|
apply({ availableWidth: g, availableHeight: h, elements: y }) {
|
|
16
17
|
e.fit?.(y.floating, { width: g, height: h });
|
|
17
18
|
}
|
|
18
19
|
})
|
|
19
20
|
];
|
|
20
|
-
e.arrow?.value && u.push(
|
|
21
|
-
const { x: w, y: v, placement: m, middlewareData: x } = await
|
|
21
|
+
e.arrow?.value && u.push(b({ element: e.arrow.value, padding: 12 }));
|
|
22
|
+
const { x: w, y: v, placement: m, middlewareData: x } = await A(n, t, {
|
|
22
23
|
placement: e.placement(),
|
|
23
24
|
strategy: "fixed",
|
|
24
25
|
middleware: u
|
|
25
26
|
});
|
|
26
27
|
s.value = { position: "fixed", left: `${w}px`, top: `${v}px` }, f.value = m;
|
|
27
|
-
const
|
|
28
|
-
|
|
28
|
+
const i = x.arrow;
|
|
29
|
+
i && (c.value = { left: i.x != null ? `${i.x}px` : "", top: i.y != null ? `${i.y}px` : "" });
|
|
29
30
|
}
|
|
30
31
|
function p() {
|
|
31
32
|
l?.(), l = null, window.visualViewport?.removeEventListener("resize", a), window.visualViewport?.removeEventListener("scroll", a);
|
|
32
33
|
}
|
|
33
34
|
const a = () => void o();
|
|
34
|
-
return E(r, (
|
|
35
|
+
return E(r, (n) => {
|
|
35
36
|
p();
|
|
36
37
|
const t = e.reference();
|
|
37
|
-
!
|
|
38
|
+
!n || !t || (t instanceof Element ? l = P(t, n, () => void o()) : V(o), window.visualViewport?.addEventListener("resize", a), window.visualViewport?.addEventListener("scroll", a));
|
|
38
39
|
}), L(p), { style: s, arrowStyle: c, resolvedPlacement: f, update: o };
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function W(r) {
|
|
41
42
|
const e = r.split("-")[0];
|
|
42
43
|
return { top: "bottom", bottom: "top", left: "right", right: "left" }[e];
|
|
43
44
|
}
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
O as N,
|
|
47
|
+
W as a,
|
|
46
48
|
T as u
|
|
47
49
|
};
|
package/dist/collection/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { D as O, L as j, a as U, h as G, l as X, r as Z } from "../http-D_D9YbLH.js";
|
|
2
|
-
import { _ as H, a as J, u as K } from "../CollectionPage.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as H, a as J, u as K } from "../CollectionPage.vue_vue_type_script_setup_true_lang-BNM_cbXa.js";
|
|
3
3
|
import { u as W, a as Y } from "../neighbors-DVN_cADL.js";
|
|
4
|
-
import { a as te, b as se } from "../rowLayout-
|
|
5
|
-
import { _ as ae } from "../DataTable.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { a as te, b as se } from "../rowLayout-D1vrdy0s.js";
|
|
5
|
+
import { _ as ae } from "../DataTable.vue_vue_type_script_setup_true_lang-DPuH84I7.js";
|
|
6
6
|
import { defineComponent as y, openBlock as c, createElementBlock as d, Fragment as h, renderList as v, createBlock as k, unref as f, withCtx as C, normalizeClass as m, createVNode as p, createCommentVNode as g, computed as w, toValue as E } from "vue";
|
|
7
7
|
import { _ } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
8
|
-
import { _ as S } from "../Tooltip.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import { _ as S } from "../Tooltip.vue_vue_type_script_setup_true_lang-mErNPt8e.js";
|
|
9
9
|
import { useI18n as T } from "vue-i18n";
|
|
10
10
|
function $(r = {}) {
|
|
11
11
|
const s = new Map(Object.entries(r).map(([t, e]) => [t, [...e]]));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject as B, ref as z, computed as
|
|
1
|
+
import { inject as B, ref as z, computed as s, onBeforeUnmount as A, defineComponent as C, useSlots as F, openBlock as l, createBlock as L, resolveDynamicComponent as T, unref as t, normalizeClass as b, withCtx as w, createElementBlock as r, renderSlot as d, createCommentVNode as i, createElementVNode as x, createTextVNode as h, toDisplayString as v, createVNode as V, useAttrs as G, useId as K, mergeProps as j, createSlots as P, mergeDefaults as M } from "vue";
|
|
2
2
|
import { useI18n as O } from "vue-i18n";
|
|
3
3
|
import { _ as I } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
4
4
|
import { RouterLink as U } from "vue-router";
|
|
@@ -16,17 +16,17 @@ const W = {
|
|
|
16
16
|
presentation: "control",
|
|
17
17
|
name: void 0
|
|
18
18
|
}, X = Symbol("vue-core.formGroup"), Z = Symbol("vue-core.formRowIndent"), ee = Symbol("vue-core.formEditable"), R = () => B(X, null), te = () => B(Z, 0);
|
|
19
|
-
function oe(
|
|
20
|
-
const e = R(),
|
|
19
|
+
function oe(u) {
|
|
20
|
+
const e = R(), c = B(ee, z(!0)), n = Q(), k = s(() => !!e && !!u.disabled && (n.value || u.presentation === "value")), m = s(() => (u.editable ?? !0) && c.value && !k.value), a = s(() => !!e && !!u.disabled && m.value);
|
|
21
21
|
if (e) {
|
|
22
|
-
const
|
|
23
|
-
A(
|
|
22
|
+
const f = e.registerLocked(s(() => !!u.disabled && c.value && u.presentation !== "value"));
|
|
23
|
+
A(f);
|
|
24
24
|
}
|
|
25
|
-
return { editable: m, locked:
|
|
25
|
+
return { editable: m, locked: a };
|
|
26
26
|
}
|
|
27
27
|
const le = ["label", "labelHidden", "hint", "error", "required", "editable", "disabled", "lockedReason", "presentation", "name"];
|
|
28
|
-
function
|
|
29
|
-
return Object.fromEntries(le.map((e) => [e,
|
|
28
|
+
function He(u) {
|
|
29
|
+
return Object.fromEntries(le.map((e) => [e, u[e]]));
|
|
30
30
|
}
|
|
31
31
|
const ae = {
|
|
32
32
|
key: 0,
|
|
@@ -35,7 +35,7 @@ const ae = {
|
|
|
35
35
|
key: 0,
|
|
36
36
|
class: "text-content-destructive",
|
|
37
37
|
"aria-hidden": "true"
|
|
38
|
-
},
|
|
38
|
+
}, ie = ["id"], ne = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "break-words text-body text-content-strong"
|
|
41
41
|
}, de = ["id"], ue = /* @__PURE__ */ C({
|
|
@@ -56,9 +56,9 @@ const ae = {
|
|
|
56
56
|
labelLines: { default: void 0 },
|
|
57
57
|
labelAlign: { default: "center" }
|
|
58
58
|
},
|
|
59
|
-
setup(
|
|
60
|
-
const e =
|
|
61
|
-
switch (
|
|
59
|
+
setup(u) {
|
|
60
|
+
const e = u, c = F(), n = te(), k = s(() => n + e.indent), m = ["pl-row-inset", "pl-[calc(var(--app-row-inset)+1.25rem)]", "pl-[calc(var(--app-row-inset)+2.5rem)]"], a = { 1: "line-clamp-1", 2: "line-clamp-2", 3: "line-clamp-3" }, f = s(() => e.labelHidden && (e.layout === "entry" || e.layout === "value") ? "stacked" : e.layout), S = s(() => {
|
|
61
|
+
switch (f.value) {
|
|
62
62
|
case "entry":
|
|
63
63
|
return "grid grid-cols-[var(--form-label-width,11rem)_minmax(0,1fr)] items-center gap-x-4 compact:grid-cols-[minmax(0,auto)_minmax(40%,1fr)]";
|
|
64
64
|
case "value":
|
|
@@ -68,67 +68,67 @@ const ae = {
|
|
|
68
68
|
default:
|
|
69
69
|
return "flex flex-col gap-1";
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
72
|
-
return (
|
|
71
|
+
}), p = s(() => e.labelHidden ? "sr-only" : f.value === "stacked" ? "text-footnote text-content-muted" : e.layout === "value" ? "text-body text-content-muted" : "text-body text-content-strong"), _ = s(() => e.value !== void 0 && e.value !== null && e.value !== "");
|
|
72
|
+
return (y, g) => (l(), L(T(e.to ? t(U) : "div"), {
|
|
73
73
|
to: e.to,
|
|
74
74
|
"data-test": "form-row",
|
|
75
|
-
"data-layout":
|
|
75
|
+
"data-layout": f.value,
|
|
76
76
|
"data-field-error": e.error ? "true" : void 0,
|
|
77
77
|
class: b(["form-row flex min-w-0 items-stretch gap-3 transition-colors duration-motion-fast first:rounded-t-group last:rounded-b-group focus-within:bg-tint-soft/50 [&:first-child>.row-body]:border-t-0", [m[Math.min(k.value, 2)], e.to ? "hover:bg-fill focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus" : ""]])
|
|
78
78
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
])) :
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
default: w(() => [
|
|
80
|
+
c.leading ? (l(), r("div", ae, [
|
|
81
|
+
d(y.$slots, "leading")
|
|
82
|
+
])) : i("", !0),
|
|
83
|
+
x("div", re, [
|
|
84
|
+
x("div", {
|
|
85
85
|
class: b(["min-w-0", S.value])
|
|
86
86
|
}, [
|
|
87
|
-
e.label || e.sub ||
|
|
87
|
+
e.label || e.sub || c.sub ? (l(), r("div", {
|
|
88
88
|
key: 0,
|
|
89
|
-
class: b([e.labelHidden && !e.sub && !
|
|
89
|
+
class: b([e.labelHidden && !e.sub && !c.sub ? "contents" : f.value === "setting" ? "min-w-min flex-1" : "min-w-0", e.labelAlign === "top" ? "self-start pt-1" : ""])
|
|
90
90
|
}, [
|
|
91
|
-
|
|
92
|
-
class: b(
|
|
91
|
+
x("div", {
|
|
92
|
+
class: b(c["label-trailing"] ? "flex items-center justify-between gap-3" : "")
|
|
93
93
|
}, [
|
|
94
|
-
(
|
|
94
|
+
(l(), L(T(e.for ? "label" : "span"), {
|
|
95
95
|
for: e.for,
|
|
96
|
-
class: b(["break-words", [
|
|
96
|
+
class: b(["break-words", [p.value, e.labelHidden ? "" : e.labelLines ? a[e.labelLines] : "block"]])
|
|
97
97
|
}, {
|
|
98
|
-
default:
|
|
98
|
+
default: w(() => [
|
|
99
99
|
h(v(e.label), 1),
|
|
100
|
-
e.required ? (
|
|
100
|
+
e.required ? (l(), r("span", se, " *")) : i("", !0)
|
|
101
101
|
]),
|
|
102
102
|
_: 1
|
|
103
103
|
}, 8, ["for", "class"])),
|
|
104
|
-
|
|
104
|
+
d(y.$slots, "label-trailing")
|
|
105
105
|
], 2),
|
|
106
|
-
e.sub ||
|
|
106
|
+
e.sub || c.sub ? (l(), r("small", {
|
|
107
107
|
key: 0,
|
|
108
108
|
id: e.subId,
|
|
109
109
|
class: "mt-0.5 block text-footnote text-content-muted"
|
|
110
110
|
}, [
|
|
111
|
-
|
|
111
|
+
d(y.$slots, "sub", {}, () => [
|
|
112
112
|
h(v(e.sub), 1)
|
|
113
113
|
])
|
|
114
|
-
], 8,
|
|
115
|
-
], 2)) :
|
|
116
|
-
|
|
117
|
-
class: b(["flex min-w-0 items-center gap-2",
|
|
114
|
+
], 8, ie)) : i("", !0)
|
|
115
|
+
], 2)) : i("", !0),
|
|
116
|
+
x("div", {
|
|
117
|
+
class: b(["flex min-w-0 items-center gap-2", f.value === "value" ? "justify-end text-right" : f.value === "setting" ? "flex-wrap justify-end text-right" : f.value === "entry" ? "compact:justify-end" : ""])
|
|
118
118
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
d(y.$slots, "default", {}, () => [
|
|
120
|
+
_.value ? (l(), r("span", ne, v(e.value), 1)) : i("", !0)
|
|
121
121
|
]),
|
|
122
|
-
|
|
123
|
-
e.to ? (
|
|
122
|
+
d(y.$slots, "trailing"),
|
|
123
|
+
e.to ? (l(), L(t(I), {
|
|
124
124
|
key: 0,
|
|
125
125
|
name: "arrowRightSLine",
|
|
126
126
|
size: 18,
|
|
127
127
|
class: "shrink-0 text-content-disabled"
|
|
128
|
-
})) :
|
|
128
|
+
})) : i("", !0)
|
|
129
129
|
], 2)
|
|
130
130
|
], 2),
|
|
131
|
-
e.error ? (
|
|
131
|
+
e.error ? (l(), r("p", {
|
|
132
132
|
key: 0,
|
|
133
133
|
id: e.errorId,
|
|
134
134
|
class: "mt-1 flex items-start gap-1.5 text-footnote text-content-destructive",
|
|
@@ -140,7 +140,7 @@ const ae = {
|
|
|
140
140
|
class: "mt-px shrink-0"
|
|
141
141
|
}),
|
|
142
142
|
h(" " + v(e.error), 1)
|
|
143
|
-
], 8, de)) :
|
|
143
|
+
], 8, de)) : i("", !0)
|
|
144
144
|
])
|
|
145
145
|
]),
|
|
146
146
|
_: 3
|
|
@@ -148,24 +148,32 @@ const ae = {
|
|
|
148
148
|
}
|
|
149
149
|
}), ce = ["title"], fe = {
|
|
150
150
|
key: 0,
|
|
151
|
-
class: "mr-1"
|
|
151
|
+
class: "mr-1.5 inline-flex shrink-0 items-center align-middle",
|
|
152
|
+
"data-test": "field-prefix"
|
|
152
153
|
}, ve = {
|
|
153
154
|
key: 1,
|
|
154
|
-
class: "
|
|
155
|
+
class: "mr-1"
|
|
155
156
|
}, me = {
|
|
157
|
+
key: 2,
|
|
158
|
+
class: "ml-1 text-content-muted"
|
|
159
|
+
}, be = {
|
|
156
160
|
key: 3,
|
|
157
161
|
class: "block text-body text-content-disabled"
|
|
158
|
-
},
|
|
162
|
+
}, pe = {
|
|
159
163
|
key: 0,
|
|
160
164
|
class: "sr-only"
|
|
161
|
-
}, ye = ["data-field-error"],
|
|
165
|
+
}, ye = ["data-field-error"], ge = ["for"], xe = {
|
|
162
166
|
key: 0,
|
|
163
167
|
class: "text-content-destructive",
|
|
164
168
|
"aria-hidden": "true"
|
|
165
|
-
},
|
|
169
|
+
}, he = {
|
|
166
170
|
key: 1,
|
|
167
171
|
class: "flex min-w-0 items-center gap-2"
|
|
168
|
-
},
|
|
172
|
+
}, ke = { class: "min-w-0 flex-1" }, _e = {
|
|
173
|
+
key: 0,
|
|
174
|
+
class: "mr-1.5 inline-flex shrink-0 items-center align-middle",
|
|
175
|
+
"data-test": "field-prefix"
|
|
176
|
+
}, we = ["id"], $e = ["id"], Ne = /* @__PURE__ */ C({
|
|
169
177
|
__name: "Field",
|
|
170
178
|
props: /* @__PURE__ */ M({
|
|
171
179
|
label: {},
|
|
@@ -185,123 +193,131 @@ const ae = {
|
|
|
185
193
|
rowLayout: {},
|
|
186
194
|
rowLabelAlign: {}
|
|
187
195
|
}, { ...W, value: void 0, prefix: void 0, suffix: void 0, valueStyle: void 0, rowLayout: "entry", rowLabelAlign: "center" }),
|
|
188
|
-
setup(
|
|
189
|
-
const e =
|
|
196
|
+
setup(u) {
|
|
197
|
+
const e = u, { t: c } = O(), n = F(), k = G(), m = R(), { editable: a, locked: f } = oe(e), S = K(), p = s(() => e.name ?? S), _ = s(() => `${p.value}-hint`), y = s(() => `${p.value}-error`);
|
|
190
198
|
if (m?.registerField) {
|
|
191
|
-
const
|
|
199
|
+
const o = k["data-field-key"], N = m.registerField(typeof o == "string" ? o : void 0, s(() => e.disabled));
|
|
192
200
|
A(N);
|
|
193
201
|
}
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
return
|
|
197
|
-
}), E =
|
|
198
|
-
const
|
|
199
|
-
return e.labelHidden && (
|
|
200
|
-
}), H =
|
|
201
|
-
() =>
|
|
202
|
+
const g = s(() => {
|
|
203
|
+
const o = e.value;
|
|
204
|
+
return o == null ? !1 : typeof o == "string" ? o.length > 0 : typeof o == "number" ? !Number.isNaN(o) : !0;
|
|
205
|
+
}), E = s(() => typeof e.value == "boolean" ? e.value ? c("core.form.yes") : c("core.form.no") : e.value), D = s(() => !!m && !a.value && m.hideEmpty.value && !g.value && !n.readonly), q = s(() => [e.hint && a.value ? _.value : null, e.error ? y.value : null].filter(Boolean).join(" ") || void 0), $ = s(() => {
|
|
206
|
+
const o = a.value ? e.rowLayout : e.rowLayout === "stacked" ? "stacked" : "value";
|
|
207
|
+
return e.labelHidden && (o === "entry" || o === "value") ? "stacked" : o;
|
|
208
|
+
}), H = s(
|
|
209
|
+
() => a.value && !f.value && e.required ? { "data-field-required": "true", "data-field-filled": g.value ? "true" : void 0 } : {}
|
|
202
210
|
);
|
|
203
|
-
return (
|
|
211
|
+
return (o, N) => t(m) && !D.value ? (l(), L(ue, j({ key: 0 }, H.value, {
|
|
204
212
|
label: e.label,
|
|
205
213
|
"label-hidden": e.labelHidden,
|
|
206
|
-
for: t(
|
|
207
|
-
sub: t(
|
|
208
|
-
"sub-id":
|
|
209
|
-
required: t(
|
|
214
|
+
for: t(a) ? p.value : void 0,
|
|
215
|
+
sub: t(a) ? e.hint : void 0,
|
|
216
|
+
"sub-id": _.value,
|
|
217
|
+
required: t(a) && !t(f) && e.required,
|
|
210
218
|
layout: $.value,
|
|
211
219
|
"label-align": $.value === "entry" ? e.rowLabelAlign : void 0,
|
|
212
|
-
error: t(
|
|
213
|
-
"error-id":
|
|
214
|
-
"data-field-locked": t(
|
|
220
|
+
error: t(a) ? e.error : void 0,
|
|
221
|
+
"error-id": y.value,
|
|
222
|
+
"data-field-locked": t(f) ? "true" : void 0
|
|
215
223
|
}), P({
|
|
216
|
-
default:
|
|
217
|
-
|
|
224
|
+
default: w(() => [
|
|
225
|
+
x("div", {
|
|
218
226
|
class: "relative w-full min-w-0",
|
|
219
|
-
title: t(
|
|
227
|
+
title: t(f) ? e.lockedReason : void 0
|
|
220
228
|
}, [
|
|
221
|
-
|
|
222
|
-
class: b(t(
|
|
229
|
+
x("div", {
|
|
230
|
+
class: b(t(a) ? $.value === "setting" ? "flex min-w-0 flex-col items-end" : $.value === "stacked" ? "flex min-w-0 flex-col items-stretch" : "flex min-w-0 flex-col items-start compact:items-end" : "")
|
|
223
231
|
}, [
|
|
224
|
-
t(
|
|
225
|
-
id:
|
|
232
|
+
t(a) ? d(o.$slots, "default", {
|
|
233
|
+
id: p.value,
|
|
226
234
|
describedby: q.value,
|
|
227
235
|
invalid: !!e.error,
|
|
228
236
|
required: e.required,
|
|
229
237
|
disabled: e.disabled
|
|
230
|
-
}, void 0, void 0, 0) : t(
|
|
238
|
+
}, void 0, void 0, 0) : t(n).readonly ? d(o.$slots, "readonly", {}, void 0, void 0, 1) : g.value ? (l(), r("span", {
|
|
231
239
|
key: 2,
|
|
232
240
|
class: b(["block break-words text-body text-content-strong", e.valueStyle === "mono" ? "font-mono" : e.valueStyle === "numeric" ? "tabular-nums" : ""])
|
|
233
241
|
}, [
|
|
234
|
-
|
|
242
|
+
t(n).prefix ? (l(), r("span", fe, [
|
|
243
|
+
d(o.$slots, "prefix")
|
|
244
|
+
])) : i("", !0),
|
|
245
|
+
e.prefix ? (l(), r("span", ve, v(e.prefix), 1)) : i("", !0),
|
|
235
246
|
h(v(E.value), 1),
|
|
236
|
-
e.suffix ? (
|
|
237
|
-
], 2)) : (
|
|
247
|
+
e.suffix ? (l(), r("span", me, v(e.suffix), 1)) : i("", !0)
|
|
248
|
+
], 2)) : (l(), r("span", be, v(t(c)("core.state.no_value")), 1))
|
|
238
249
|
], 2)
|
|
239
250
|
], 8, ce),
|
|
240
|
-
t(
|
|
251
|
+
t(f) && e.lockedReason ? (l(), r("span", pe, v(e.lockedReason), 1)) : i("", !0)
|
|
241
252
|
]),
|
|
242
253
|
_: 2
|
|
243
254
|
}, [
|
|
244
|
-
t(
|
|
255
|
+
t(a) && t(n).trailing ? {
|
|
245
256
|
name: "trailing",
|
|
246
|
-
fn:
|
|
247
|
-
|
|
257
|
+
fn: w(() => [
|
|
258
|
+
d(o.$slots, "trailing")
|
|
248
259
|
]),
|
|
249
260
|
key: "0"
|
|
250
261
|
} : void 0,
|
|
251
|
-
t(
|
|
262
|
+
t(a) && t(n).labelTrailing ? {
|
|
252
263
|
name: "label-trailing",
|
|
253
|
-
fn:
|
|
254
|
-
|
|
264
|
+
fn: w(() => [
|
|
265
|
+
d(o.$slots, "labelTrailing")
|
|
255
266
|
]),
|
|
256
267
|
key: "1"
|
|
257
268
|
} : void 0
|
|
258
|
-
]), 1040, ["label", "label-hidden", "for", "sub", "sub-id", "required", "layout", "label-align", "error", "error-id", "data-field-locked"])) : t(m) ?
|
|
269
|
+
]), 1040, ["label", "label-hidden", "for", "sub", "sub-id", "required", "layout", "label-align", "error", "error-id", "data-field-locked"])) : t(m) ? i("", !0) : (l(), r("div", j({ key: 1 }, H.value, {
|
|
259
270
|
"data-field-error": e.error ? "true" : void 0,
|
|
260
271
|
class: "flex min-w-0 flex-col gap-1"
|
|
261
272
|
}), [
|
|
262
|
-
e.label || t(
|
|
273
|
+
e.label || t(a) && t(n).labelTrailing ? (l(), r("div", {
|
|
263
274
|
key: 0,
|
|
264
|
-
class: b(e.labelHidden && !(t(
|
|
275
|
+
class: b(e.labelHidden && !(t(a) && t(n).labelTrailing) ? "contents" : "flex items-center justify-between gap-3")
|
|
265
276
|
}, [
|
|
266
|
-
e.label ? (
|
|
277
|
+
e.label ? (l(), r("label", {
|
|
267
278
|
key: 0,
|
|
268
|
-
for: t(
|
|
279
|
+
for: t(a) ? p.value : void 0,
|
|
269
280
|
class: b(e.labelHidden ? "sr-only" : "text-footnote font-medium text-content-muted")
|
|
270
281
|
}, [
|
|
271
282
|
h(v(e.label), 1),
|
|
272
|
-
t(
|
|
273
|
-
], 10,
|
|
274
|
-
t(
|
|
275
|
-
], 2)) :
|
|
276
|
-
t(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
id:
|
|
283
|
+
t(a) && e.required ? (l(), r("span", xe, " *")) : i("", !0)
|
|
284
|
+
], 10, ge)) : i("", !0),
|
|
285
|
+
t(a) ? d(o.$slots, "labelTrailing", {}, void 0, void 0, 1) : i("", !0)
|
|
286
|
+
], 2)) : i("", !0),
|
|
287
|
+
t(a) && t(n).trailing ? (l(), r("div", he, [
|
|
288
|
+
x("div", ke, [
|
|
289
|
+
d(o.$slots, "default", {
|
|
290
|
+
id: p.value,
|
|
280
291
|
describedby: q.value,
|
|
281
292
|
invalid: !!e.error,
|
|
282
293
|
required: e.required,
|
|
283
294
|
disabled: e.disabled
|
|
284
295
|
})
|
|
285
296
|
]),
|
|
286
|
-
|
|
287
|
-
])) : t(
|
|
288
|
-
id:
|
|
297
|
+
d(o.$slots, "trailing")
|
|
298
|
+
])) : t(a) ? d(o.$slots, "default", {
|
|
299
|
+
id: p.value,
|
|
289
300
|
describedby: q.value,
|
|
290
301
|
invalid: !!e.error,
|
|
291
302
|
required: e.required,
|
|
292
303
|
disabled: e.disabled
|
|
293
|
-
}, void 0, void 0, 2) : t(
|
|
304
|
+
}, void 0, void 0, 2) : t(n).readonly ? d(o.$slots, "readonly", {}, void 0, void 0, 3) : (l(), r("span", {
|
|
294
305
|
key: 4,
|
|
295
|
-
class: b(["text-body",
|
|
296
|
-
},
|
|
297
|
-
|
|
306
|
+
class: b(["text-body", g.value ? "text-content-strong" : "text-content-disabled"])
|
|
307
|
+
}, [
|
|
308
|
+
g.value && t(n).prefix ? (l(), r("span", _e, [
|
|
309
|
+
d(o.$slots, "prefix")
|
|
310
|
+
])) : i("", !0),
|
|
311
|
+
h(v(g.value ? `${e.prefix ?? ""}${E.value}${e.suffix ?? ""}` : t(c)("core.state.no_value")), 1)
|
|
312
|
+
], 2)),
|
|
313
|
+
e.hint && t(a) ? (l(), r("p", {
|
|
298
314
|
key: 5,
|
|
299
|
-
id:
|
|
315
|
+
id: _.value,
|
|
300
316
|
class: "text-footnote text-content-muted"
|
|
301
|
-
}, v(e.hint), 9,
|
|
302
|
-
e.error ? (
|
|
317
|
+
}, v(e.hint), 9, we)) : i("", !0),
|
|
318
|
+
e.error ? (l(), r("p", {
|
|
303
319
|
key: 6,
|
|
304
|
-
id:
|
|
320
|
+
id: y.value,
|
|
305
321
|
role: "alert",
|
|
306
322
|
class: "flex items-start gap-1.5 text-footnote text-content-destructive"
|
|
307
323
|
}, [
|
|
@@ -311,22 +327,22 @@ const ae = {
|
|
|
311
327
|
class: "mt-px shrink-0"
|
|
312
328
|
}),
|
|
313
329
|
h(" " + v(e.error), 1)
|
|
314
|
-
], 8,
|
|
330
|
+
], 8, $e)) : i("", !0)
|
|
315
331
|
], 16, ye));
|
|
316
332
|
}
|
|
317
|
-
}),
|
|
318
|
-
function
|
|
319
|
-
const
|
|
320
|
-
return
|
|
333
|
+
}), Le = "rounded-control transition-[background-color,box-shadow,opacity] duration-motion-fast ease-motion-standard";
|
|
334
|
+
function Te(u, e) {
|
|
335
|
+
const c = !!R();
|
|
336
|
+
return s(() => c ? Y({ kind: u, state: e() }) : [Le, ...J(u, e()).map(([n]) => n)].join(" "));
|
|
321
337
|
}
|
|
322
338
|
export {
|
|
323
|
-
|
|
339
|
+
Ne as _,
|
|
324
340
|
R as a,
|
|
325
341
|
W as b,
|
|
326
|
-
|
|
342
|
+
Te as c,
|
|
327
343
|
ee as d,
|
|
328
344
|
ue as e,
|
|
329
|
-
|
|
345
|
+
He as f,
|
|
330
346
|
X as g,
|
|
331
347
|
Z as h,
|
|
332
348
|
te as i,
|
package/dist/controls/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as A } from "../IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
2
2
|
import { defineComponent as p, useSlots as c, openBlock as r, createElementBlock as d, normalizeClass as u, createElementVNode as f, renderSlot as m, toDisplayString as b, createVNode as x, unref as h, useModel as v, useTemplateRef as _, withDirectives as y, mergeProps as g, vModelText as k, mergeModels as w } from "vue";
|
|
3
3
|
import { _ as B } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
4
|
-
import { _ as N } from "../DateButton.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as N } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
|
|
5
5
|
import { _ as W } from "../Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js";
|
|
6
6
|
import { _ as L } from "../SwipeActions.vue_vue_type_script_setup_true_lang-BJIA2JfI.js";
|
|
7
7
|
import { c as j, a as F, b as G, d as H } from "../controlSurface-t7OEFESJ.js";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type ControlWidth } from "../controls";
|
|
2
2
|
import { type FieldProps, type FieldSlots } from "./field";
|
|
3
|
-
import type { OptionSlotScope, SelectOption } from "./options";
|
|
3
|
+
import type { OptionSlotScope, SelectOption, ValueSlotScope } from "./options";
|
|
4
4
|
declare const _default: <Value extends string | number, Meta = undefined>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
6
|
+
readonly onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
7
|
+
readonly onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
6
8
|
readonly "onUpdate:modelValue"?: ((value: Value | null) => any) | undefined;
|
|
7
9
|
readonly onPicked?: ((option: SelectOption<Value, Meta>) => any) | undefined;
|
|
8
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onPicked"> & (FieldProps & {
|
|
10
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onFocus" | "onUpdate:modelValue" | "onPicked"> & (FieldProps & {
|
|
9
11
|
/** A fixed list, filtered locally. */
|
|
10
12
|
options?: readonly SelectOption<Value, Meta>[];
|
|
11
13
|
/** Searches the server; the answer for the text typed. */
|
|
@@ -24,6 +26,8 @@ declare const _default: <Value extends string | number, Meta = undefined>(__VLS_
|
|
|
24
26
|
/** The id the last picks are kept under; setting it turns "Recent" on. */
|
|
25
27
|
recents?: string;
|
|
26
28
|
width?: Exclude<ControlWidth, "content">;
|
|
29
|
+
/** `setting` puts the control at the end of the row; `stacked` stretches it under the label (a picker in a narrow column). Without it the row is label column and control. */
|
|
30
|
+
rowLayout?: "setting" | "stacked";
|
|
27
31
|
} & {
|
|
28
32
|
modelValue?: Value | null;
|
|
29
33
|
}) & Partial<{}>> & import("vue").PublicProps;
|
|
@@ -34,8 +38,10 @@ declare const _default: <Value extends string | number, Meta = undefined>(__VLS_
|
|
|
34
38
|
slots: FieldSlots & {
|
|
35
39
|
/** Replaces what an option row says (an icon, a badge); the row, its keys and roles stay. */
|
|
36
40
|
option?: (scope: OptionSlotScope<Value, Meta>) => unknown;
|
|
41
|
+
/** The chosen value's content: in the control it stands before the text (a swatch before the name), in read mode it replaces the text. Only rendered while an option is chosen. */
|
|
42
|
+
value?: (scope: ValueSlotScope<Value, Meta>) => unknown;
|
|
37
43
|
};
|
|
38
|
-
emit: ((evt: "picked", option: SelectOption<Value, Meta>) => void) & ((evt: "update:modelValue", value: Value | null) => void);
|
|
44
|
+
emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "picked", option: SelectOption<Value, Meta>) => void)) & ((evt: "update:modelValue", value: Value | null) => void);
|
|
39
45
|
}>) => import("vue").VNode & {
|
|
40
46
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
41
47
|
};
|
|
@@ -29,8 +29,12 @@ type __VLS_PublicProps = __VLS_Props & {
|
|
|
29
29
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
30
30
|
focus: () => void | undefined;
|
|
31
31
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
blur: (event: FocusEvent) => any;
|
|
33
|
+
focus: (event: FocusEvent) => any;
|
|
32
34
|
"update:modelValue": (value: string | null) => any;
|
|
33
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
37
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
34
38
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
35
39
|
}>, {
|
|
36
40
|
disabled: boolean;
|
|
@@ -29,8 +29,12 @@ type __VLS_PublicProps = __VLS_Props & {
|
|
|
29
29
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
30
30
|
focus: () => void | undefined;
|
|
31
31
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
blur: (event: FocusEvent) => any;
|
|
33
|
+
focus: (event: FocusEvent) => any;
|
|
32
34
|
"update:modelValue": (value: string | null) => any;
|
|
33
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
37
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
34
38
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
35
39
|
}>, {
|
|
36
40
|
disabled: boolean;
|
package/dist/form/Field.vue.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ type __VLS_Slots = {
|
|
|
40
40
|
trailing?: () => unknown;
|
|
41
41
|
/** At the end of the label's line while editing (the language tabs of `I18nField`). */
|
|
42
42
|
labelTrailing?: () => unknown;
|
|
43
|
+
/** An icon or image before the read-mode value (a flag); a field that has the slot draws the same one before its control. Not shown while the value is empty. */
|
|
44
|
+
prefix?: () => unknown;
|
|
43
45
|
};
|
|
44
46
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
45
47
|
disabled: boolean;
|