@wssto2/vue-core 0.4.15 → 0.4.17
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-CkvS5W6K.js → ActionRow.vue_vue_type_script_setup_true_lang-DOjn7fqy.js} +1 -1
- package/dist/{Activity-4q26REYj.js → Activity-DnFB6WXf.js} +5 -5
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-B7qSUiee.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-Bm0sxqNz.js} +64 -63
- package/dist/{Changes-CKIuGF8O.js → Changes-DMrQYv2e.js} +4 -4
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-B17cUOzj.js → CollectionPage.vue_vue_type_script_setup_true_lang-CVnZzaBm.js} +5 -5
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-ChS9ULwk.js → DataTable.vue_vue_type_script_setup_true_lang-Wuvo-l_z.js} +1 -1
- package/dist/DateField.vue_vue_type_script_setup_true_lang-BIXzNzYo.js +278 -0
- package/dist/{DeadLetters-DPGcQOz1.js → DeadLetters-BF9PS4mA.js} +3 -3
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-noYI9QMk.js → FormGroup.vue_vue_type_script_setup_true_lang-BokxZ7LU.js} +1 -1
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-BcIbTMHN.js → FormView.vue_vue_type_script_setup_true_lang-Dz5TZt92.js} +1 -1
- package/dist/{General-CUA9b3ML.js → General-yInbmj6I.js} +8 -8
- package/dist/{NewRolePage-DBfCvDWA.js → NewRolePage-09C3P6fE.js} +3 -3
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-CC8bKyR_.js +150 -0
- package/dist/{ProfilePage-On-eAiJ-.js → ProfilePage-CvV44C0m.js} +8 -8
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-D87Hs75d.js → RecordHeader.vue_vue_type_script_setup_true_lang-DijFQnU6.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-Da0M-hen.js → ResourcePage.vue_vue_type_script_setup_true_lang-BpLnmA6n.js} +1 -1
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-fvAf3rQm.js → RoleEditor.vue_vue_type_script_setup_true_lang-BqWoby16.js} +7 -7
- package/dist/{RolePage-B8oul55j.js → RolePage-DuIFjSKH.js} +8 -8
- package/dist/{RolesPage-DsXVivdj.js → RolesPage-BzqBqils.js} +5 -5
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-B0p_8xQG.js → SectionList.vue_vue_type_script_setup_true_lang-D5QWy-c1.js} +1 -1
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-D5Cnb4_O.js → SectionNavigator.vue_vue_type_script_setup_true_lang-CW81A_bn.js} +2 -2
- package/dist/SegmentedField.vue_vue_type_script_setup_true_lang-BMBkEmxr.js +81 -0
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-DedKLLQK.js → SelectField.vue_vue_type_script_setup_true_lang-C1Flb1hA.js} +161 -139
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-CirlMdHb.js → SessionList.vue_vue_type_script_setup_true_lang-C0XvavBw.js} +3 -3
- package/dist/{Sessions-BTyXDEuY.js → Sessions-_qmODKw2.js} +2 -2
- package/dist/{SettingsPage-DHTmMgif.js → SettingsPage-Bz48sO08.js} +9 -9
- package/dist/{SignIn-DU4DE2wj.js → SignIn-DJsTGQ79.js} +5 -5
- package/dist/{SignInPage-BA22kyOp.js → SignInPage-Bb78MIDk.js} +3 -3
- package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-CIv34nRn.js → SignInTable.vue_vue_type_script_setup_true_lang-7Z9EmLs-.js} +1 -1
- package/dist/{SignIns-C8QAZBaL.js → SignIns-yRjJrf47.js} +2 -2
- package/dist/SwitchField.vue_vue_type_script_setup_true_lang-0weBvsJf.js +87 -0
- package/dist/TextField.vue_vue_type_script_setup_true_lang-D3-R5XXG.js +292 -0
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-4wC3c0BM.js +91 -0
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-DrLtIexs.js +187 -0
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-FVRUr-9y.js → Timestamp.vue_vue_type_script_setup_true_lang-CU2Y5oYl.js} +1 -1
- package/dist/{UserRecord-D1BNmYp9.js → UserRecord-4L0FrCty.js} +9 -9
- package/dist/{UsersList-ltx3G23-.js → UsersList-ww_-FoAq.js} +9 -9
- package/dist/access/index.js +1 -1
- package/dist/app/application.d.ts +1 -1
- package/dist/app/index.js +1 -1
- package/dist/collection/index.js +3 -3
- package/dist/content/index.js +1 -1
- package/dist/{control-CX9BG2UB.js → control-B_Nwtmag.js} +96 -82
- package/dist/{fieldMessages-DV6sESpn.js → fieldMessages-6HVzSDqG.js} +1 -1
- package/dist/form/CardSelectField.vue.d.ts +2 -2
- package/dist/form/ChoiceChips.vue.d.ts +2 -2
- package/dist/form/ComboField.vue.d.ts +2 -2
- package/dist/form/CommandDialog.vue.d.ts +3 -0
- package/dist/form/DateField.vue.d.ts +9 -2
- package/dist/form/DateTimeField.vue.d.ts +9 -2
- package/dist/form/Field.vue.d.ts +1 -1
- package/dist/form/FileField.vue.d.ts +9 -2
- package/dist/form/I18nField.vue.d.ts +9 -2
- package/dist/form/MoneyField.vue.d.ts +9 -2
- package/dist/form/MonthYearField.vue.d.ts +9 -2
- package/dist/form/MultiSelectField.vue.d.ts +2 -2
- package/dist/form/NumberField.vue.d.ts +20 -2
- package/dist/form/PhotoField.vue.d.ts +9 -2
- package/dist/form/SegmentedField.vue.d.ts +2 -2
- package/dist/form/SelectField.vue.d.ts +2 -2
- package/dist/form/SwitchField.vue.d.ts +2 -2
- package/dist/form/TextField.vue.d.ts +9 -2
- package/dist/form/TextareaField.vue.d.ts +9 -2
- package/dist/form/TimeField.vue.d.ts +9 -2
- package/dist/form/field.d.ts +9 -0
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1176 -977
- package/dist/format/index.js +1 -1
- package/dist/format-D8X4zsx6.js +78 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.js +31 -28
- package/dist/identity/index.js +1 -1
- package/dist/{index-BCw_Ki6z.js → index-C6vCe149.js} +3 -3
- package/dist/{index-Chh4z9xW.js → index-DW9gyWL1.js} +8 -8
- package/dist/{index-DwdVrW6q.js → index-JjALCpwi.js} +13 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/intlLocale.d.ts +2 -0
- package/dist/intlLocale-CeRU44qJ.js +4 -0
- package/dist/notifications/index.js +1 -1
- package/dist/page/index.js +5 -5
- package/dist/phone/index.js +112 -111
- package/dist/resource/index.js +1 -1
- package/dist/{rowLayout-D1cYQghV.js → rowLayout-BFz4Kdoy.js} +2 -2
- package/dist/{status-cWCAMAmW.js → status-Cz54-7z7.js} +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/{useCommand-B-N6HJOz.js → useCommand-YN9EMb7s.js} +41 -38
- package/dist/{useTypedEntry-aTfPBAhw.js → useTypedEntry-C7k7Dyl-.js} +237 -236
- package/package.json +1 -1
- package/dist/DateField.vue_vue_type_script_setup_true_lang-DehwWm78.js +0 -256
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-Dm6FfJ2T.js +0 -126
- package/dist/SegmentedField.vue_vue_type_script_setup_true_lang-B2d55hrh.js +0 -59
- package/dist/SwitchField.vue_vue_type_script_setup_true_lang-B2Z2hy_h.js +0 -65
- package/dist/TextField.vue_vue_type_script_setup_true_lang-nqnGG7Zc.js +0 -270
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-BgIQyYtf.js +0 -69
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-Dr0h-V_8.js +0 -165
- package/dist/format-B8mJm946.js +0 -77
package/package.json
CHANGED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { computed as f, defineComponent as X, useModel as Z, useTemplateRef as $, openBlock as y, createBlock as A, mergeProps as V, unref as l, withCtx as N, createElementBlock as C, Fragment as I, createVNode as w, createTextVNode as ee, toDisplayString as Q, createCommentVNode as B, createElementVNode as O, normalizeClass as te, mergeModels as re, mergeDefaults as oe, nextTick as Y } from "vue";
|
|
2
|
-
import { useI18n as j } from "vue-i18n";
|
|
3
|
-
import { _ as ae } from "./DateButton.vue_vue_type_script_setup_true_lang-EcqrfWKz.js";
|
|
4
|
-
import { u as H } from "./format-B8mJm946.js";
|
|
5
|
-
import { _ as ne } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
6
|
-
import { u as le } from "./mediaQuery-CygcXmFW.js";
|
|
7
|
-
import { _ as se } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
|
|
8
|
-
import { c as ie, _ as de, f as ue, b as ce } from "./control-CX9BG2UB.js";
|
|
9
|
-
import { e as T, f as E, m as K, g as G, h as me, j as fe, u as pe, k as be, _ as ve, l as ye, c as xe } from "./useTypedEntry-aTfPBAhw.js";
|
|
10
|
-
const ke = ["d", "m", "y"];
|
|
11
|
-
function he(o) {
|
|
12
|
-
const r = o("2033-11-22"), e = { y: r.indexOf("2033") >= 0 ? r.indexOf("2033") : r.indexOf("33"), m: r.indexOf("11"), d: r.indexOf("22") };
|
|
13
|
-
return e.y < 0 || e.m < 0 || e.d < 0 ? ke : ["d", "m", "y"].sort((t, a) => e[t] - e[a]);
|
|
14
|
-
}
|
|
15
|
-
const ge = (o) => o.trim().toLowerCase().replace(/\.+$/, "");
|
|
16
|
-
function _e(o, r) {
|
|
17
|
-
if (o.length === 4) return Number(o);
|
|
18
|
-
if (o.length > 2) return null;
|
|
19
|
-
const e = 2e3 + Number(o);
|
|
20
|
-
return e > Number(r.slice(0, 4)) + 30 ? e - 100 : e;
|
|
21
|
-
}
|
|
22
|
-
function x(o, r) {
|
|
23
|
-
const e = o.y === void 0 ? Number(r.slice(0, 4)) : _e(o.y, r), t = o.m === void 0 ? Number(r.slice(5, 7)) : Number(o.m);
|
|
24
|
-
return e === null || o.d === void 0 ? null : K(e, t, Number(o.d));
|
|
25
|
-
}
|
|
26
|
-
function we(o, r) {
|
|
27
|
-
const e = r.today ?? T(), t = ge(o);
|
|
28
|
-
if (t === "") return null;
|
|
29
|
-
const { words: a } = r;
|
|
30
|
-
if (a.today.includes(t)) return e;
|
|
31
|
-
if (a.tomorrow.includes(t)) return E(e, 1);
|
|
32
|
-
if (a.yesterday.includes(t)) return E(e, -1);
|
|
33
|
-
const d = /^([+-])\s*(\d{1,4})$/.exec(t);
|
|
34
|
-
if (d) return E(e, Number(d[2]) * (d[1] === "-" ? -1 : 1));
|
|
35
|
-
const i = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(t);
|
|
36
|
-
if (i) return K(Number(i[1]), Number(i[2]), Number(i[3]));
|
|
37
|
-
if (!/^[\d\s./-]+$/.test(t)) return null;
|
|
38
|
-
const n = r.order, p = n.filter((v) => v !== "y");
|
|
39
|
-
if (/^\d+$/.test(t)) {
|
|
40
|
-
if (t.length <= 2) return x({ d: t }, e);
|
|
41
|
-
if (t.length === 4) return x(M(p, [t.slice(0, 2), t.slice(2)]), e);
|
|
42
|
-
if (t.length === 6 || t.length === 8) {
|
|
43
|
-
const v = n.map((u) => u === "y" ? t.length - 4 : 2);
|
|
44
|
-
let k = 0;
|
|
45
|
-
const b = n.map((u, h) => [u, t.slice(k, k += v[h])]);
|
|
46
|
-
return x(Object.fromEntries(b), e);
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const m = t.split(/[^\d]+/).filter(Boolean);
|
|
51
|
-
return m.length === 3 ? x(M(n, m), e) : m.length === 2 ? x(M(p, m), e) : m.length === 1 ? x({ d: m[0] }, e) : null;
|
|
52
|
-
}
|
|
53
|
-
function M(o, r) {
|
|
54
|
-
return Object.fromEntries(o.map((e, t) => [e, r[t]]));
|
|
55
|
-
}
|
|
56
|
-
function Ue(o) {
|
|
57
|
-
const r = o.trim().replace(/^(\d{4}-\d{2}-\d{2})T/, "$1 ").split(/\s+/).filter(Boolean), e = r[r.length - 1];
|
|
58
|
-
if (e === void 0) return { date: null, time: null };
|
|
59
|
-
if (!(e.includes(":") || r.length > 1 && /^\d{1,2}\.\d{2}$/.test(e))) return { date: r.join(" "), time: null };
|
|
60
|
-
const a = r.slice(0, -1).join(" ");
|
|
61
|
-
return { date: a === "" ? null : a, time: e };
|
|
62
|
-
}
|
|
63
|
-
function De(o, r, e) {
|
|
64
|
-
const t = o(e), a = /\D+/.exec(t)?.[0].trim() ?? ".", d = /\D+$/.test(t) ? a : "", i = { d: String(Number(e.slice(8))), m: String(Number(e.slice(5, 7))), y: "" };
|
|
65
|
-
return r.filter((n) => n !== "y").map((n) => i[n]).join(a) + d;
|
|
66
|
-
}
|
|
67
|
-
function $e(o) {
|
|
68
|
-
const { t: r } = j(), e = H(), t = (n) => e.date(n), a = f(() => he(t)), d = f(() => ({
|
|
69
|
-
today: [r("core.form.date.words.today").toLowerCase(), "today"],
|
|
70
|
-
tomorrow: [r("core.form.date.words.tomorrow").toLowerCase(), "tomorrow"],
|
|
71
|
-
yesterday: [r("core.form.date.words.yesterday").toLowerCase(), "yesterday"]
|
|
72
|
-
}));
|
|
73
|
-
return {
|
|
74
|
-
placeholder: f(() => r("core.form.date.placeholder", { example: De(t, a.value, T()) })),
|
|
75
|
-
/** The day a text means, or null. */
|
|
76
|
-
parse: (n) => we(n, { order: a.value, words: d.value }),
|
|
77
|
-
available: (n) => !G(n, o()),
|
|
78
|
-
invalidMessage: () => r("core.form.date.invalid", { example: t(T()) }),
|
|
79
|
-
unavailableMessage: () => r("core.form.date.unavailable")
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function Ne(o, r, e) {
|
|
83
|
-
const { t } = j();
|
|
84
|
-
return f(() => {
|
|
85
|
-
const a = T();
|
|
86
|
-
return (o() ?? me(r())).map((d) => {
|
|
87
|
-
const i = fe(d, (n) => t(`core.form.date.${n.replace(/-/g, "_")}`), a);
|
|
88
|
-
return { ...i, disabled: G(i.value, e()) };
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
const Ce = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], Oe = ["aria-label", "onClick"], Te = { class: "flex flex-col gap-2.5" }, qe = {
|
|
93
|
-
key: 0,
|
|
94
|
-
class: "border-t border-border-separator pt-2.5"
|
|
95
|
-
}, Pe = { class: "text-footnote text-content-muted" }, Re = /* @__PURE__ */ X({
|
|
96
|
-
__name: "DateField",
|
|
97
|
-
props: /* @__PURE__ */ re(/* @__PURE__ */ oe({
|
|
98
|
-
label: {},
|
|
99
|
-
labelHidden: { type: Boolean },
|
|
100
|
-
hint: {},
|
|
101
|
-
error: {},
|
|
102
|
-
required: { type: Boolean },
|
|
103
|
-
editable: { type: Boolean },
|
|
104
|
-
disabled: { type: Boolean },
|
|
105
|
-
lockedReason: {},
|
|
106
|
-
presentation: {},
|
|
107
|
-
name: {},
|
|
108
|
-
min: {},
|
|
109
|
-
max: {},
|
|
110
|
-
disabledDates: { type: [Array, Function] },
|
|
111
|
-
openOn: {},
|
|
112
|
-
quickPicks: {}
|
|
113
|
-
}, { ...ce, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, quickPicks: void 0 }), {
|
|
114
|
-
modelValue: { default: null },
|
|
115
|
-
modelModifiers: {}
|
|
116
|
-
}),
|
|
117
|
-
emits: ["update:modelValue"],
|
|
118
|
-
setup(o, { expose: r }) {
|
|
119
|
-
const e = o, t = Z(o, "modelValue"), { t: a } = j(), d = H(), i = le(), n = $("input"), p = $("popover"), m = $("calendar"), v = $("sheet"), k = f(() => ({ min: e.min, max: e.max, disabled: e.disabledDates })), b = $e(() => k.value), u = pe({
|
|
120
|
-
model: t,
|
|
121
|
-
display: (c) => d.date(c),
|
|
122
|
-
parse: (c) => {
|
|
123
|
-
const s = b.parse(c);
|
|
124
|
-
return s ? b.available(s) ? { value: s } : { error: b.unavailableMessage() } : { error: b.invalidMessage() };
|
|
125
|
-
}
|
|
126
|
-
}), h = Ne(() => e.quickPicks, () => i.value, () => k.value), L = f(() => e.error || u.message.value), q = f(() => t.value ? d.date(t.value) : null), J = ie("date", () => L.value ? "error" : e.disabled ? "locked" : "rest"), z = f(() => u.typed.value ?? (be(t.value) ? t.value : null));
|
|
127
|
-
async function P(c) {
|
|
128
|
-
e.disabled || (p.value?.present(), c && (await Y(), await Y(), m.value?.focus()));
|
|
129
|
-
}
|
|
130
|
-
function W(c) {
|
|
131
|
-
c.key === "Enter" ? (u.commit(), p.value?.dismiss()) : c.key === "ArrowDown" && (c.preventDefault(), P(!0));
|
|
132
|
-
}
|
|
133
|
-
function F(c, s) {
|
|
134
|
-
u.set(c), s();
|
|
135
|
-
}
|
|
136
|
-
return r({ focus: () => n.value?.focus() }), (c, s) => (y(), A(de, V({ ...l(ue)(e), error: L.value }, {
|
|
137
|
-
value: q.value,
|
|
138
|
-
"value-style": "numeric"
|
|
139
|
-
}), {
|
|
140
|
-
default: N(({ id: S, describedby: U, invalid: R }) => [
|
|
141
|
-
l(i) ? (y(), C(I, { key: 0 }, [
|
|
142
|
-
w(ae, V({ id: S, "aria-describedby": U }, {
|
|
143
|
-
disabled: e.disabled,
|
|
144
|
-
invalid: R,
|
|
145
|
-
placeholder: l(a)("core.form.select.choose"),
|
|
146
|
-
onClick: s[0] || (s[0] = (g) => v.value?.present())
|
|
147
|
-
}), {
|
|
148
|
-
default: N(() => [
|
|
149
|
-
q.value ? (y(), C(I, { key: 0 }, [
|
|
150
|
-
ee(Q(q.value), 1)
|
|
151
|
-
], 64)) : B("", !0)
|
|
152
|
-
]),
|
|
153
|
-
_: 1
|
|
154
|
-
}, 16, ["disabled", "invalid", "placeholder"]),
|
|
155
|
-
w(ve, {
|
|
156
|
-
ref_key: "sheet",
|
|
157
|
-
ref: v,
|
|
158
|
-
title: e.label ?? l(a)("core.form.date.calendar"),
|
|
159
|
-
mode: "date",
|
|
160
|
-
"model-value": t.value,
|
|
161
|
-
min: e.min,
|
|
162
|
-
max: e.max,
|
|
163
|
-
"disabled-dates": e.disabledDates,
|
|
164
|
-
"open-on": e.openOn,
|
|
165
|
-
shortcuts: l(h),
|
|
166
|
-
clearable: !e.required,
|
|
167
|
-
"onUpdate:modelValue": l(u).set
|
|
168
|
-
}, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "clearable", "onUpdate:modelValue"])
|
|
169
|
-
], 64)) : (y(), A(se, {
|
|
170
|
-
key: 1,
|
|
171
|
-
ref_key: "popover",
|
|
172
|
-
ref: p,
|
|
173
|
-
label: e.label ?? l(a)("core.form.date.calendar"),
|
|
174
|
-
width: "lg",
|
|
175
|
-
placement: "bottom-start",
|
|
176
|
-
arrow: !1,
|
|
177
|
-
autofocus: !1
|
|
178
|
-
}, {
|
|
179
|
-
trigger: N(({ attrs: g, presented: _ }) => [
|
|
180
|
-
O("div", {
|
|
181
|
-
class: te(["inline-flex max-w-full items-center gap-2", l(J)])
|
|
182
|
-
}, [
|
|
183
|
-
O("input", V({
|
|
184
|
-
id: S,
|
|
185
|
-
ref_key: "input",
|
|
186
|
-
ref: n
|
|
187
|
-
}, g, {
|
|
188
|
-
type: "text",
|
|
189
|
-
role: "combobox",
|
|
190
|
-
autocomplete: "off",
|
|
191
|
-
size: "16",
|
|
192
|
-
name: e.name,
|
|
193
|
-
value: l(u).text.value,
|
|
194
|
-
placeholder: l(b).placeholder.value,
|
|
195
|
-
disabled: e.disabled,
|
|
196
|
-
required: e.required,
|
|
197
|
-
"aria-required": e.required || void 0,
|
|
198
|
-
"aria-invalid": R || void 0,
|
|
199
|
-
"aria-describedby": U,
|
|
200
|
-
class: "block min-h-7 min-w-0 border-0 bg-transparent py-1 pl-2.5 text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
|
|
201
|
-
onInput: s[1] || (s[1] = (D) => l(u).input(D.target.value)),
|
|
202
|
-
onBlur: s[2] || (s[2] = (D) => l(u).commit()),
|
|
203
|
-
onKeydown: W,
|
|
204
|
-
onClick: s[3] || (s[3] = (D) => P(!1))
|
|
205
|
-
}), null, 16, Ce),
|
|
206
|
-
e.disabled ? B("", !0) : (y(), C("button", {
|
|
207
|
-
key: 0,
|
|
208
|
-
type: "button",
|
|
209
|
-
tabindex: "-1",
|
|
210
|
-
"aria-label": l(a)("core.form.date.open"),
|
|
211
|
-
class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
|
|
212
|
-
onClick: (D) => _ ? p.value?.dismiss() : P(!0)
|
|
213
|
-
}, [
|
|
214
|
-
w(l(ne), {
|
|
215
|
-
name: "calendarLine",
|
|
216
|
-
size: 18
|
|
217
|
-
})
|
|
218
|
-
], 8, Oe))
|
|
219
|
-
], 2)
|
|
220
|
-
]),
|
|
221
|
-
default: N(({ dismiss: g }) => [
|
|
222
|
-
O("div", Te, [
|
|
223
|
-
w(ye, {
|
|
224
|
-
ref_key: "calendar",
|
|
225
|
-
ref: m,
|
|
226
|
-
"model-value": z.value,
|
|
227
|
-
min: e.min,
|
|
228
|
-
max: e.max,
|
|
229
|
-
"disabled-dates": e.disabledDates,
|
|
230
|
-
"open-on": e.openOn,
|
|
231
|
-
"month-picker": "",
|
|
232
|
-
"onUpdate:modelValue": (_) => F(_, g)
|
|
233
|
-
}, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on", "onUpdate:modelValue"]),
|
|
234
|
-
l(h).length > 0 ? (y(), C("div", qe, [
|
|
235
|
-
w(xe, {
|
|
236
|
-
items: l(h),
|
|
237
|
-
selected: z.value,
|
|
238
|
-
onPick: (_) => F(_, g)
|
|
239
|
-
}, null, 8, ["items", "selected", "onPick"])
|
|
240
|
-
])) : B("", !0),
|
|
241
|
-
O("p", Pe, Q(l(a)("core.form.date.keys")), 1)
|
|
242
|
-
])
|
|
243
|
-
]),
|
|
244
|
-
_: 2
|
|
245
|
-
}, 1032, ["label"]))
|
|
246
|
-
]),
|
|
247
|
-
_: 1
|
|
248
|
-
}, 16, ["value"]));
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
export {
|
|
252
|
-
Re as _,
|
|
253
|
-
Ne as a,
|
|
254
|
-
Ue as s,
|
|
255
|
-
$e as u
|
|
256
|
-
};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { defineComponent as G, useModel as I, useTemplateRef as W, computed as w, ref as B, watch as F, openBlock as D, createBlock as $, mergeProps as A, unref as q, withCtx as E, createElementVNode as M, normalizeClass as O, createElementBlock as N, toDisplayString as C, createCommentVNode as S, mergeModels as P, mergeDefaults as j } from "vue";
|
|
2
|
-
import { b as z } from "./controlSurface-t7OEFESJ.js";
|
|
3
|
-
import { u as H } from "./format-B8mJm946.js";
|
|
4
|
-
import { a as T, c as J, _ as K, f as L, b as Q } from "./control-CX9BG2UB.js";
|
|
5
|
-
function U(r) {
|
|
6
|
-
const n = r.number(1234.5, { minimumFractionDigits: 1, maximumFractionDigits: 1, useGrouping: !0 }), e = /^\d(\D)\d/.exec(n)?.[1] ?? "";
|
|
7
|
-
return { decimal: n.charAt(n.length - 2) || ".", group: e === "." || e === "," ? e : "" };
|
|
8
|
-
}
|
|
9
|
-
function X(r, n) {
|
|
10
|
-
const e = r.trim().startsWith("-"), t = r.replace(/[^\d.,]/g, "");
|
|
11
|
-
if (t === "") return e ? void 0 : null;
|
|
12
|
-
const d = [...t].filter((a) => a === "." || a === ",");
|
|
13
|
-
let m = t, g = "";
|
|
14
|
-
if (n.decimals > 0 && d.length > 0) {
|
|
15
|
-
const a = Math.max(t.lastIndexOf("."), t.lastIndexOf(",")), f = t.charAt(a), p = t.slice(a + 1), s = t.includes(".") && t.includes(","), o = d.filter((y) => y === f).length > 1, k = !s && f === n.group && p.length === 3;
|
|
16
|
-
(s || !o && !k) && (m = t.slice(0, a), g = p);
|
|
17
|
-
}
|
|
18
|
-
const v = (a) => a.replace(/\D/g, ""), x = +`${v(m) || "0"}.${v(g) || "0"}`;
|
|
19
|
-
if (!Number.isFinite(x)) return;
|
|
20
|
-
const c = Number(x.toFixed(n.decimals));
|
|
21
|
-
return e ? -c || 0 : c;
|
|
22
|
-
}
|
|
23
|
-
const Y = {
|
|
24
|
-
key: 0,
|
|
25
|
-
class: "shrink-0 text-footnote text-content-muted"
|
|
26
|
-
}, Z = ["id", "value", "name", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], ee = {
|
|
27
|
-
key: 1,
|
|
28
|
-
class: "shrink-0 text-footnote text-content-muted"
|
|
29
|
-
}, oe = /* @__PURE__ */ G({
|
|
30
|
-
__name: "NumberField",
|
|
31
|
-
props: /* @__PURE__ */ P(/* @__PURE__ */ j({
|
|
32
|
-
label: {},
|
|
33
|
-
labelHidden: { type: Boolean },
|
|
34
|
-
hint: {},
|
|
35
|
-
error: {},
|
|
36
|
-
required: { type: Boolean },
|
|
37
|
-
editable: { type: Boolean },
|
|
38
|
-
disabled: { type: Boolean },
|
|
39
|
-
lockedReason: {},
|
|
40
|
-
presentation: {},
|
|
41
|
-
name: {},
|
|
42
|
-
decimals: {},
|
|
43
|
-
negative: { type: Boolean },
|
|
44
|
-
grouping: { type: Boolean },
|
|
45
|
-
maxDigits: {},
|
|
46
|
-
placeholder: {},
|
|
47
|
-
prefix: {},
|
|
48
|
-
suffix: {},
|
|
49
|
-
width: {}
|
|
50
|
-
}, { ...Q, decimals: 0, negative: !1, grouping: !0, maxDigits: void 0, placeholder: void 0, prefix: void 0, suffix: void 0, width: "sm" }), {
|
|
51
|
-
modelValue: { default: null },
|
|
52
|
-
modelModifiers: {}
|
|
53
|
-
}),
|
|
54
|
-
emits: ["update:modelValue"],
|
|
55
|
-
setup(r, { expose: n }) {
|
|
56
|
-
const e = r, t = I(r, "modelValue"), d = H(), m = W("input"), g = !!T(), v = J("text", () => e.error ? "error" : e.disabled ? "locked" : "rest"), x = w(() => g ? z(e.width) : "w-full"), c = w(() => U(d)), a = (l) => l === null ? "" : d.number(l, { minimumFractionDigits: e.decimals, maximumFractionDigits: e.decimals, useGrouping: e.grouping }), f = (l) => l === null ? "" : String(l).replace(".", c.value.decimal), p = (l) => X(l, { decimals: e.decimals, group: e.grouping ? c.value.group : "" }), s = B(!1), o = B(a(t.value));
|
|
57
|
-
F(t, (l) => {
|
|
58
|
-
s.value ? p(o.value) !== l && (o.value = f(l)) : o.value = a(l);
|
|
59
|
-
}), F(() => [e.decimals, e.grouping, c.value.decimal], () => {
|
|
60
|
-
s.value || (o.value = a(t.value));
|
|
61
|
-
});
|
|
62
|
-
function k(l) {
|
|
63
|
-
const u = l.target;
|
|
64
|
-
let i = u.value.replace(/[^\d.,\-\s]/g, "");
|
|
65
|
-
e.negative ? i = i.replace(/(?!^)-/g, "") : i = i.replace(/-/g, "");
|
|
66
|
-
const _ = i.replace(/\D/g, "").length;
|
|
67
|
-
if (e.maxDigits !== void 0 && _ > e.maxDigits) {
|
|
68
|
-
if (i.length === o.value.length + 1) {
|
|
69
|
-
const b = Math.max(0, (u.selectionStart ?? i.length) - 1);
|
|
70
|
-
u.value = o.value, u.setSelectionRange(b, b);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
let R = 0;
|
|
74
|
-
i = [...i].filter((b) => !/\d/.test(b) || ++R <= e.maxDigits).join("");
|
|
75
|
-
}
|
|
76
|
-
i !== u.value && (u.value = i), o.value = i;
|
|
77
|
-
const h = p(i);
|
|
78
|
-
h !== void 0 ? t.value = h : t.value = null;
|
|
79
|
-
}
|
|
80
|
-
function y() {
|
|
81
|
-
s.value = !0, o.value = f(t.value);
|
|
82
|
-
}
|
|
83
|
-
function V() {
|
|
84
|
-
s.value = !1, o.value = a(t.value);
|
|
85
|
-
}
|
|
86
|
-
return n({ focus: () => m.value?.focus() }), (l, u) => (D(), $(K, A(q(L)(e), {
|
|
87
|
-
value: t.value === null ? null : a(t.value),
|
|
88
|
-
prefix: e.prefix,
|
|
89
|
-
suffix: e.suffix,
|
|
90
|
-
"value-style": "numeric"
|
|
91
|
-
}), {
|
|
92
|
-
default: E(({ id: i, describedby: _, invalid: h }) => [
|
|
93
|
-
M("div", {
|
|
94
|
-
class: O(["flex items-center gap-1.5", [q(v), x.value]])
|
|
95
|
-
}, [
|
|
96
|
-
e.prefix ? (D(), N("span", Y, C(e.prefix), 1)) : S("", !0),
|
|
97
|
-
M("input", {
|
|
98
|
-
id: i,
|
|
99
|
-
ref_key: "input",
|
|
100
|
-
ref: m,
|
|
101
|
-
value: o.value,
|
|
102
|
-
type: "text",
|
|
103
|
-
inputmode: "decimal",
|
|
104
|
-
autocomplete: "off",
|
|
105
|
-
name: e.name,
|
|
106
|
-
placeholder: e.placeholder,
|
|
107
|
-
disabled: e.disabled,
|
|
108
|
-
required: e.required,
|
|
109
|
-
"aria-required": e.required || void 0,
|
|
110
|
-
"aria-invalid": h || void 0,
|
|
111
|
-
"aria-describedby": _,
|
|
112
|
-
class: "block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-right text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
|
|
113
|
-
onInput: k,
|
|
114
|
-
onFocus: y,
|
|
115
|
-
onBlur: V
|
|
116
|
-
}, null, 40, Z),
|
|
117
|
-
e.suffix ? (D(), N("span", ee, C(e.suffix), 1)) : S("", !0)
|
|
118
|
-
], 2)
|
|
119
|
-
]),
|
|
120
|
-
_: 1
|
|
121
|
-
}, 16, ["value", "prefix", "suffix"]));
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
export {
|
|
125
|
-
oe as _
|
|
126
|
-
};
|
|
@@ -1,59 +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 i, 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-CX9BG2UB.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
|
-
labelHidden: { type: Boolean },
|
|
8
|
-
hint: {},
|
|
9
|
-
error: {},
|
|
10
|
-
required: { type: Boolean },
|
|
11
|
-
editable: { type: Boolean },
|
|
12
|
-
disabled: { type: Boolean },
|
|
13
|
-
lockedReason: {},
|
|
14
|
-
presentation: {},
|
|
15
|
-
name: {},
|
|
16
|
-
modelValue: {},
|
|
17
|
-
options: {},
|
|
18
|
-
rowLayout: {}
|
|
19
|
-
}, { ...E, modelValue: null, rowLayout: "setting" }),
|
|
20
|
-
emits: ["update:modelValue"],
|
|
21
|
-
setup(r, { emit: d }) {
|
|
22
|
-
const e = r, u = d, { editable: c } = L(e), m = !!F(), f = () => e.options.find((n) => n.value === e.modelValue)?.label ?? null;
|
|
23
|
-
return (n, S) => (l(), y(D, g(s(N)(e), {
|
|
24
|
-
value: f(),
|
|
25
|
-
"row-layout": e.rowLayout
|
|
26
|
-
}), {
|
|
27
|
-
default: w(({ id: b, describedby: p, invalid: v }) => [
|
|
28
|
-
_("div", {
|
|
29
|
-
id: b,
|
|
30
|
-
role: "group",
|
|
31
|
-
"aria-label": e.label,
|
|
32
|
-
"aria-describedby": p,
|
|
33
|
-
"aria-invalid": v || void 0,
|
|
34
|
-
"data-test": "segmented",
|
|
35
|
-
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" : ""]])
|
|
36
|
-
}, [
|
|
37
|
-
(l(!0), a(V, null, k(e.options, (t) => (l(), a("button", {
|
|
38
|
-
key: t.value,
|
|
39
|
-
type: "button",
|
|
40
|
-
disabled: e.disabled || !s(c) || t.disabled,
|
|
41
|
-
"aria-pressed": t.value === e.modelValue,
|
|
42
|
-
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"]),
|
|
43
|
-
onClick: ($) => u("update:modelValue", t.value)
|
|
44
|
-
}, [
|
|
45
|
-
h(i(t.label) + " ", 1),
|
|
46
|
-
t.count !== void 0 ? (l(), a("span", {
|
|
47
|
-
key: 0,
|
|
48
|
-
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"])
|
|
49
|
-
}, i(t.count), 3)) : B("", !0)
|
|
50
|
-
], 10, R))), 128))
|
|
51
|
-
], 10, P)
|
|
52
|
-
]),
|
|
53
|
-
_: 1
|
|
54
|
-
}, 16, ["value", "row-layout"]));
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
export {
|
|
58
|
-
G as _
|
|
59
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, useModel as b, computed as w, openBlock as v, createBlock as y, mergeProps as g, unref as a, withCtx as _, createElementVNode as t, renderSlot as k, normalizeClass as i, normalizeStyle as B, toDisplayString as z, 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-CX9BG2UB.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" }, R = /* @__PURE__ */ p({
|
|
5
|
-
__name: "SwitchField",
|
|
6
|
-
props: /* @__PURE__ */ S(/* @__PURE__ */ x({
|
|
7
|
-
label: {},
|
|
8
|
-
labelHidden: { type: Boolean },
|
|
9
|
-
hint: {},
|
|
10
|
-
error: {},
|
|
11
|
-
required: { type: Boolean },
|
|
12
|
-
editable: { type: Boolean },
|
|
13
|
-
disabled: { type: Boolean },
|
|
14
|
-
lockedReason: {},
|
|
15
|
-
presentation: {},
|
|
16
|
-
name: {},
|
|
17
|
-
size: {}
|
|
18
|
-
}, { ...E, size: "md" }), {
|
|
19
|
-
modelValue: { type: Boolean, default: !1 },
|
|
20
|
-
modelModifiers: {}
|
|
21
|
-
}),
|
|
22
|
-
emits: ["update:modelValue"],
|
|
23
|
-
setup(s) {
|
|
24
|
-
const o = s, e = b(s, "modelValue"), { t: l } = C(), { editable: r } = M(o), n = {
|
|
25
|
-
sm: { "--switch-w": "1.75rem", "--switch-h": "1rem" },
|
|
26
|
-
md: { "--switch-w": "var(--app-switch-width)", "--switch-h": "var(--app-switch-height)" },
|
|
27
|
-
lg: { "--switch-w": "3.1875rem", "--switch-h": "1.9375rem" }
|
|
28
|
-
}, d = w(() => n[o.size]);
|
|
29
|
-
function c() {
|
|
30
|
-
!o.disabled && r.value && (e.value = !e.value);
|
|
31
|
-
}
|
|
32
|
-
return (u, $) => (v(), y(V, g(a(D)(o), {
|
|
33
|
-
value: e.value,
|
|
34
|
-
"row-layout": "setting"
|
|
35
|
-
}), {
|
|
36
|
-
default: _(({ id: m, describedby: h, invalid: f }) => [
|
|
37
|
-
t("div", F, [
|
|
38
|
-
k(u.$slots, "before"),
|
|
39
|
-
t("button", {
|
|
40
|
-
id: m,
|
|
41
|
-
type: "button",
|
|
42
|
-
role: "switch",
|
|
43
|
-
"aria-checked": e.value,
|
|
44
|
-
"aria-label": o.label,
|
|
45
|
-
"aria-describedby": h,
|
|
46
|
-
"aria-invalid": f || void 0,
|
|
47
|
-
disabled: o.disabled,
|
|
48
|
-
style: B(d.value),
|
|
49
|
-
class: i(["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"]),
|
|
50
|
-
onClick: c
|
|
51
|
-
}, [
|
|
52
|
-
t("span", {
|
|
53
|
-
class: i(["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))]" : ""])
|
|
54
|
-
}, null, 2),
|
|
55
|
-
t("span", P, z(e.value ? a(l)("core.form.yes") : a(l)("core.form.no")), 1)
|
|
56
|
-
], 14, I)
|
|
57
|
-
])
|
|
58
|
-
]),
|
|
59
|
-
_: 3
|
|
60
|
-
}, 16, ["value"]));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
export {
|
|
64
|
-
R as _
|
|
65
|
-
};
|