@wssto2/vue-core 0.1.0 → 0.2.0
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/README.md +20 -9
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-CKghARkW.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-CeKK8_g5.js} +2 -2
- package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-BZb4qKXo.js → AlertDialog.vue_vue_type_script_setup_true_lang-e4hzkzg3.js} +1 -1
- package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-B82bl36A.js → AsyncSection.vue_vue_type_script_setup_true_lang-CWLB3xsR.js} +1 -1
- package/dist/Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js +51 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-B1eZgLae.js +182 -0
- package/dist/CountryFlag.vue_vue_type_script_setup_true_lang-Kry_vPPZ.js +299 -0
- package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-Bx5O1RZJ.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-DyhYHRyz.js} +1 -1
- package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-DH6EB8br.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CvwoT1JF.js} +1 -1
- package/dist/{Menu.vue_vue_type_script_setup_true_lang-D44EHXQZ.js → Menu.vue_vue_type_script_setup_true_lang-CrMj6KPD.js} +1 -1
- package/dist/{Modal.vue_vue_type_script_setup_true_lang-DYQgaUtj.js → Modal.vue_vue_type_script_setup_true_lang-BQZM49gC.js} +138 -128
- package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-DDVQXJRB.js → PhotoViewer.vue_vue_type_script_setup_true_lang-ElDizaW2.js} +1 -1
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-DGcKX_OJ.js → SectionList.vue_vue_type_script_setup_true_lang-L9ita_Kx.js} +2 -2
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-DZTrU8NJ.js +661 -0
- package/dist/{Sheet.vue_vue_type_script_setup_true_lang-BLBD5ps8.js → Sheet.vue_vue_type_script_setup_true_lang-CtkJ-4e3.js} +1 -1
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-BJWPVyfT.js → Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js} +1 -1
- package/dist/app/application.d.ts +5 -0
- package/dist/app/environment.d.ts +2 -0
- package/dist/app/index.js +75 -72
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +5 -3
- package/dist/button/shortcut.d.ts +28 -2
- package/dist/collection/CollectionPage.vue.d.ts +1 -0
- package/dist/collection/CollectionRows.vue.d.ts +59 -0
- package/dist/collection/CollectionTable.vue.d.ts +1 -1
- package/dist/collection/DataTable.vue.d.ts +47 -0
- package/dist/collection/RowActions.vue.d.ts +19 -0
- package/dist/collection/columns.d.ts +2 -0
- package/dist/collection/index.d.ts +4 -2
- package/dist/collection/index.js +1752 -1610
- package/dist/collection/rowLayout.d.ts +10 -0
- package/dist/collection/slots.d.ts +6 -3
- package/dist/describeError-l5T9b8Uv.js +41 -0
- package/dist/dialogStack-DZZg55w0.js +31 -0
- package/dist/form/CommandDialog.vue.d.ts +12 -1
- package/dist/form/FormGroup.vue.d.ts +1 -1
- package/dist/form/MultiSelectField.vue.d.ts +4 -1
- package/dist/form/NumberField.vue.d.ts +6 -0
- package/dist/form/OptionList.vue.d.ts +6 -2
- package/dist/form/SelectField.vue.d.ts +4 -1
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.js +1940 -2008
- package/dist/form/suggestions.d.ts +11 -0
- package/dist/form/useOptions.d.ts +60 -0
- package/dist/i18n/describeError.d.ts +31 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/i18n/index.js +22 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/CountryFlag.vue.d.ts +10 -0
- package/dist/modal/Modal.vue.d.ts +4 -0
- package/dist/modal/ShortcutHelp.vue.d.ts +2 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.js +64 -6
- package/dist/modal/placement.d.ts +22 -0
- package/dist/{options-CjSz2dQK.js → options-DAkBtYkI.js} +3 -3
- package/dist/overlay/Popover.vue.d.ts +3 -0
- package/dist/overlay/dialogStack.d.ts +9 -0
- package/dist/overlay/index.d.ts +1 -1
- package/dist/overlay/index.js +18 -17
- package/dist/page/index.js +4 -4
- package/dist/phone/index.js +247 -540
- package/dist/platform/AccessGate.vue.d.ts +50 -0
- package/dist/platform/index.d.ts +2 -0
- package/dist/platform/index.js +86 -66
- package/dist/resource/index.js +42 -42
- package/dist/shell/AccountMenuItem.vue.d.ts +3 -0
- package/dist/shell/NavigationList.vue.d.ts +1 -1
- package/dist/shell/index.js +406 -394
- package/dist/state/Badge.vue.d.ts +17 -10
- package/dist/state/hue.d.ts +8 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/index.js +92 -56
- package/dist/state/useLoad.d.ts +41 -0
- package/dist/styles.css +1 -1
- package/dist/testing/app.d.ts +61 -0
- package/dist/testing/async.d.ts +12 -0
- package/dist/testing/collection.d.ts +18 -0
- package/dist/testing/format.d.ts +9 -0
- package/dist/testing/i18n.d.ts +16 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +178 -0
- package/dist/testing/media.d.ts +23 -0
- package/dist/testing/platform.d.ts +40 -0
- package/dist/testing/transport.d.ts +40 -0
- package/dist/{toast-BTeX0r66.js → toast-DvrHQ6Ag.js} +45 -43
- package/dist/{useDialog-wmyNx2j_.js → useDialog-CXR3hN0G.js} +1 -1
- package/package.json +5 -1
- package/src/styles/theme.css +60 -0
- package/dist/Badge.vue_vue_type_script_setup_true_lang-DKc6ugmr.js +0 -31
- package/dist/Button.vue_vue_type_script_setup_true_lang-3f0emVNU.js +0 -141
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-SyFWE33A.js +0 -422
- package/dist/dialogStack-DiTG1rZc.js +0 -26
- package/dist/phone/CountryFlag.vue.d.ts +0 -10
- /package/dist/{phone → internal}/flagLoaders.d.ts +0 -0
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { watchEffect as E, toValue as z, defineComponent as L, useSlots as S, useTemplateRef as B, computed as m, openBlock as v, createBlock as I, unref as N, withCtx as R, createElementVNode as T, mergeProps as g, createVNode as y, createElementBlock as k, h as x } from "vue";
|
|
2
|
-
import { RouterLink as V } from "vue-router";
|
|
3
|
-
import { _ as h } from "./Icon.vue_vue_type_script_lang-DtC4_mkz.js";
|
|
4
|
-
import { u as D } from "./useWaitStatus-fsacMl4W.js";
|
|
5
|
-
function M(t, o) {
|
|
6
|
-
return t.key.toLowerCase() === o.key.toLowerCase() && t.ctrlKey === (o.ctrlKey ?? !1) && t.shiftKey === (o.shiftKey ?? !1) && t.altKey === (o.altKey ?? !1) && t.metaKey === (o.metaKey ?? !1);
|
|
7
|
-
}
|
|
8
|
-
function P(t) {
|
|
9
|
-
return t instanceof HTMLElement && (t.isContentEditable || /^(input|textarea|select)$/i.test(t.tagName));
|
|
10
|
-
}
|
|
11
|
-
function $(t, o) {
|
|
12
|
-
E((e) => {
|
|
13
|
-
const i = z(t);
|
|
14
|
-
if (!i) return;
|
|
15
|
-
const c = (n) => {
|
|
16
|
-
n.repeat || !M(n, i) || !(i.ctrlKey || i.altKey || i.metaKey) && P(n.target) || o(n) !== !1 && n.preventDefault();
|
|
17
|
-
};
|
|
18
|
-
window.addEventListener("keydown", c), e(() => window.removeEventListener("keydown", c));
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
const j = ["href", "tabindex", "onClick"], H = ["href", "tabindex"], O = ["type", "disabled"], F = /* @__PURE__ */ L({
|
|
22
|
-
__name: "Button",
|
|
23
|
-
props: {
|
|
24
|
-
prominence: { default: "standard" },
|
|
25
|
-
tone: { default: void 0 },
|
|
26
|
-
size: { default: "md" },
|
|
27
|
-
icon: { default: void 0 },
|
|
28
|
-
trailingIcon: { default: void 0 },
|
|
29
|
-
to: { default: void 0 },
|
|
30
|
-
href: { default: void 0 },
|
|
31
|
-
type: { default: "button" },
|
|
32
|
-
disabled: { type: Boolean, default: !1 },
|
|
33
|
-
processing: { type: Boolean, default: !1 },
|
|
34
|
-
keyboardShortcut: { default: void 0 }
|
|
35
|
-
},
|
|
36
|
-
emits: ["click"],
|
|
37
|
-
setup(t, { emit: o }) {
|
|
38
|
-
const e = t, i = o, c = S(), n = B("element"), _ = D(() => e.processing), a = m(() => e.disabled || e.processing);
|
|
39
|
-
function u(s, r) {
|
|
40
|
-
if (a.value) {
|
|
41
|
-
s.preventDefault();
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
i("click", s), r?.(s);
|
|
45
|
-
}
|
|
46
|
-
$(() => e.keyboardShortcut, (s) => {
|
|
47
|
-
if (a.value || n.value?.closest("[inert]")) return !1;
|
|
48
|
-
i("click", s);
|
|
49
|
-
});
|
|
50
|
-
const w = {
|
|
51
|
-
primary: {
|
|
52
|
-
default: "bg-tint text-content-on-tint hover:bg-tint/90 active:bg-tint/80",
|
|
53
|
-
critical: "bg-status-danger-solid text-white hover:brightness-110"
|
|
54
|
-
},
|
|
55
|
-
secondary: {
|
|
56
|
-
default: "bg-tint-soft text-content-link hover:brightness-95 dark:hover:brightness-125",
|
|
57
|
-
critical: "bg-status-danger-surface text-content-destructive hover:brightness-95 dark:hover:brightness-125"
|
|
58
|
-
},
|
|
59
|
-
standard: {
|
|
60
|
-
default: "bg-fill text-content-strong hover:bg-fill-strong",
|
|
61
|
-
critical: "bg-fill text-content-destructive hover:bg-fill-strong"
|
|
62
|
-
},
|
|
63
|
-
plain: {
|
|
64
|
-
default: "bg-transparent text-content-link hover:bg-tint-soft",
|
|
65
|
-
critical: "bg-transparent text-content-destructive hover:bg-status-danger-surface"
|
|
66
|
-
},
|
|
67
|
-
link: {
|
|
68
|
-
default: "bg-transparent text-content-link hover:underline",
|
|
69
|
-
critical: "bg-transparent text-content-destructive hover:underline"
|
|
70
|
-
}
|
|
71
|
-
}, d = {
|
|
72
|
-
xs: { box: "min-h-6 px-2.5 py-0.5 text-xs gap-1", icon: 12 },
|
|
73
|
-
sm: { box: "min-h-8 px-3 py-1 text-xs gap-1.5", icon: 14 },
|
|
74
|
-
md: { box: "min-h-9 px-4 py-1.5 text-sm gap-2", icon: 16 },
|
|
75
|
-
lg: { box: "min-h-11 px-5 py-2 text-base gap-2", icon: 20 },
|
|
76
|
-
xl: { box: "min-h-12 px-6 py-2.5 text-base gap-2.5", icon: 22 }
|
|
77
|
-
}, f = m(() => [
|
|
78
|
-
"hit-target flex cursor-pointer select-none items-center justify-center rounded-button text-center font-semibold",
|
|
79
|
-
"transition duration-motion-fast ease-motion-standard",
|
|
80
|
-
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
81
|
-
w[e.prominence][e.tone ?? "default"],
|
|
82
|
-
d[e.size].box,
|
|
83
|
-
// aria-disabled covers links, which have no `disabled` attribute.
|
|
84
|
-
e.processing && !e.disabled ? "cursor-progress" : "disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45"
|
|
85
|
-
]), p = m(() => ({
|
|
86
|
-
"aria-disabled": a.value || void 0,
|
|
87
|
-
"aria-busy": e.processing || void 0
|
|
88
|
-
})), b = () => [
|
|
89
|
-
e.processing && _.visible.value ? x(h, { name: "loader4Line", size: d[e.size].icon, class: "animate-spin", "data-test": "button-spinner" }) : e.icon ? x(h, { name: e.icon, size: d[e.size].icon }) : null,
|
|
90
|
-
c.default?.(),
|
|
91
|
-
e.trailingIcon ? x(h, { name: e.trailingIcon, size: d[e.size].icon }) : null
|
|
92
|
-
];
|
|
93
|
-
return (s, r) => e.to !== void 0 ? (v(), I(N(V), {
|
|
94
|
-
key: 0,
|
|
95
|
-
to: e.to,
|
|
96
|
-
custom: ""
|
|
97
|
-
}, {
|
|
98
|
-
default: R(({ href: l, navigate: C }) => [
|
|
99
|
-
T("a", g({
|
|
100
|
-
ref_key: "element",
|
|
101
|
-
ref: n,
|
|
102
|
-
href: a.value ? void 0 : l,
|
|
103
|
-
class: f.value
|
|
104
|
-
}, p.value, {
|
|
105
|
-
tabindex: a.value ? -1 : void 0,
|
|
106
|
-
onClick: (K) => u(K, C)
|
|
107
|
-
}), [
|
|
108
|
-
y(b)
|
|
109
|
-
], 16, j)
|
|
110
|
-
]),
|
|
111
|
-
_: 1
|
|
112
|
-
}, 8, ["to"])) : e.href !== void 0 ? (v(), k("a", g({
|
|
113
|
-
key: 1,
|
|
114
|
-
ref_key: "element",
|
|
115
|
-
ref: n,
|
|
116
|
-
href: a.value ? void 0 : e.href,
|
|
117
|
-
class: f.value
|
|
118
|
-
}, p.value, {
|
|
119
|
-
tabindex: a.value ? -1 : void 0,
|
|
120
|
-
onClick: r[0] || (r[0] = (l) => u(l))
|
|
121
|
-
}), [
|
|
122
|
-
y(b)
|
|
123
|
-
], 16, H)) : (v(), k("button", g({
|
|
124
|
-
key: 2,
|
|
125
|
-
ref_key: "element",
|
|
126
|
-
ref: n,
|
|
127
|
-
type: e.type,
|
|
128
|
-
class: f.value,
|
|
129
|
-
disabled: a.value
|
|
130
|
-
}, p.value, {
|
|
131
|
-
onClick: r[1] || (r[1] = (l) => u(l))
|
|
132
|
-
}), [
|
|
133
|
-
y(b)
|
|
134
|
-
], 16, O));
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
export {
|
|
138
|
-
F as _,
|
|
139
|
-
M as m,
|
|
140
|
-
$ as u
|
|
141
|
-
};
|
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, useModel as P, useTemplateRef as O, computed as D, ref as M, watch as E, openBlock as r, createBlock as B, mergeProps as N, unref as u, withCtx as V, createElementVNode as c, normalizeClass as b, createElementBlock as p, toDisplayString as F, createCommentVNode as _, mergeModels as T, mergeDefaults as W, useId as Y, createVNode as S, withDirectives as Z, vModelText as ee, Fragment as R, renderList as U, createSlots as te, createTextVNode as oe } from "vue";
|
|
2
|
-
import { b as le } from "./controlSurface-t7OEFESJ.js";
|
|
3
|
-
import { u as ae } from "./format-B8mJm946.js";
|
|
4
|
-
import { u as G, a as H, _ as j, f as K, b as J, g as ne, m as se } from "./options-CjSz2dQK.js";
|
|
5
|
-
import { useI18n as Q } from "vue-i18n";
|
|
6
|
-
import { _ as re } from "./Button.vue_vue_type_script_setup_true_lang-3f0emVNU.js";
|
|
7
|
-
import { _ as z } from "./Icon.vue_vue_type_script_lang-DtC4_mkz.js";
|
|
8
|
-
import { u as ie } from "./mediaQuery-CygcXmFW.js";
|
|
9
|
-
import { _ as ue } from "./Sheet.vue_vue_type_script_setup_true_lang-BLBD5ps8.js";
|
|
10
|
-
import { _ as ce } from "./toast-BTeX0r66.js";
|
|
11
|
-
function de(v) {
|
|
12
|
-
const o = v.number(1234.5, { minimumFractionDigits: 1, maximumFractionDigits: 1, useGrouping: !0 }), e = /^\d(\D)\d/.exec(o)?.[1] ?? "";
|
|
13
|
-
return { decimal: o.charAt(o.length - 2) || ".", group: e === "." || e === "," ? e : "" };
|
|
14
|
-
}
|
|
15
|
-
function pe(v, o) {
|
|
16
|
-
const e = v.trim().startsWith("-"), a = v.replace(/[^\d.,]/g, "");
|
|
17
|
-
if (a === "") return e ? void 0 : null;
|
|
18
|
-
const h = [...a].filter((n) => n === "." || n === ",");
|
|
19
|
-
let m = a, w = "";
|
|
20
|
-
if (o.decimals > 0 && h.length > 0) {
|
|
21
|
-
const n = Math.max(a.lastIndexOf("."), a.lastIndexOf(",")), y = a.charAt(n), $ = a.slice(n + 1), i = a.includes(".") && a.includes(","), l = h.filter((s) => s === y).length > 1, k = !i && y === o.group && $.length === 3;
|
|
22
|
-
(i || !l && !k) && (m = a.slice(0, n), w = $);
|
|
23
|
-
}
|
|
24
|
-
const g = (n) => n.replace(/\D/g, ""), x = +`${g(m) || "0"}.${g(w) || "0"}`;
|
|
25
|
-
if (!Number.isFinite(x)) return;
|
|
26
|
-
const d = Number(x.toFixed(o.decimals));
|
|
27
|
-
return e ? -d || 0 : d;
|
|
28
|
-
}
|
|
29
|
-
const me = {
|
|
30
|
-
key: 0,
|
|
31
|
-
class: "shrink-0 text-footnote text-content-muted"
|
|
32
|
-
}, fe = ["id", "value", "name", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], be = {
|
|
33
|
-
key: 1,
|
|
34
|
-
class: "shrink-0 text-footnote text-content-muted"
|
|
35
|
-
}, Te = /* @__PURE__ */ L({
|
|
36
|
-
__name: "NumberField",
|
|
37
|
-
props: /* @__PURE__ */ T(/* @__PURE__ */ W({
|
|
38
|
-
label: {},
|
|
39
|
-
hint: {},
|
|
40
|
-
error: {},
|
|
41
|
-
required: { type: Boolean },
|
|
42
|
-
editable: { type: Boolean },
|
|
43
|
-
disabled: { type: Boolean },
|
|
44
|
-
lockedReason: {},
|
|
45
|
-
presentation: {},
|
|
46
|
-
name: {},
|
|
47
|
-
decimals: {},
|
|
48
|
-
negative: { type: Boolean },
|
|
49
|
-
placeholder: {},
|
|
50
|
-
prefix: {},
|
|
51
|
-
suffix: {},
|
|
52
|
-
width: {}
|
|
53
|
-
}, { ...J, decimals: 0, negative: !1, placeholder: void 0, prefix: void 0, suffix: void 0, width: "sm" }), {
|
|
54
|
-
modelValue: { default: null },
|
|
55
|
-
modelModifiers: {}
|
|
56
|
-
}),
|
|
57
|
-
emits: ["update:modelValue"],
|
|
58
|
-
setup(v, { expose: o }) {
|
|
59
|
-
const e = v, a = P(v, "modelValue"), h = ae(), m = O("input"), w = !!G(), g = H("text", () => e.error ? "error" : e.disabled ? "locked" : "rest"), x = D(() => w ? le(e.width) : "w-full"), d = D(() => de(h)), n = (t) => t === null ? "" : h.number(t, { minimumFractionDigits: e.decimals, maximumFractionDigits: e.decimals }), y = (t) => t === null ? "" : String(t).replace(".", d.value.decimal), $ = (t) => pe(t, { decimals: e.decimals, group: d.value.group }), i = M(!1), l = M(n(a.value));
|
|
60
|
-
E(a, (t) => {
|
|
61
|
-
i.value ? $(l.value) !== t && (l.value = y(t)) : l.value = n(t);
|
|
62
|
-
}), E(() => [e.decimals, d.value.decimal], () => {
|
|
63
|
-
i.value || (l.value = n(a.value));
|
|
64
|
-
});
|
|
65
|
-
function k(t) {
|
|
66
|
-
const q = t.target;
|
|
67
|
-
let C = q.value.replace(/[^\d.,\-\s]/g, "");
|
|
68
|
-
e.negative ? C = C.replace(/(?!^)-/g, "") : C = C.replace(/-/g, ""), C !== q.value && (q.value = C), l.value = C;
|
|
69
|
-
const A = $(C);
|
|
70
|
-
A !== void 0 ? a.value = A : a.value = null;
|
|
71
|
-
}
|
|
72
|
-
function s() {
|
|
73
|
-
i.value = !0, l.value = y(a.value);
|
|
74
|
-
}
|
|
75
|
-
function f() {
|
|
76
|
-
i.value = !1, l.value = n(a.value);
|
|
77
|
-
}
|
|
78
|
-
return o({ focus: () => m.value?.focus() }), (t, q) => (r(), B(j, N(u(K)(e), {
|
|
79
|
-
value: a.value === null ? null : n(a.value),
|
|
80
|
-
prefix: e.prefix,
|
|
81
|
-
suffix: e.suffix,
|
|
82
|
-
"value-style": "numeric"
|
|
83
|
-
}), {
|
|
84
|
-
default: V(({ id: C, describedby: A, invalid: X }) => [
|
|
85
|
-
c("div", {
|
|
86
|
-
class: b(["flex items-center gap-1.5", [u(g), x.value]])
|
|
87
|
-
}, [
|
|
88
|
-
e.prefix ? (r(), p("span", me, F(e.prefix), 1)) : _("", !0),
|
|
89
|
-
c("input", {
|
|
90
|
-
id: C,
|
|
91
|
-
ref_key: "input",
|
|
92
|
-
ref: m,
|
|
93
|
-
value: l.value,
|
|
94
|
-
type: "text",
|
|
95
|
-
inputmode: "decimal",
|
|
96
|
-
autocomplete: "off",
|
|
97
|
-
name: e.name,
|
|
98
|
-
placeholder: e.placeholder,
|
|
99
|
-
disabled: e.disabled,
|
|
100
|
-
required: e.required,
|
|
101
|
-
"aria-required": e.required || void 0,
|
|
102
|
-
"aria-invalid": X || void 0,
|
|
103
|
-
"aria-describedby": A,
|
|
104
|
-
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",
|
|
105
|
-
onInput: k,
|
|
106
|
-
onFocus: s,
|
|
107
|
-
onBlur: f
|
|
108
|
-
}, null, 40, fe),
|
|
109
|
-
e.suffix ? (r(), p("span", be, F(e.suffix), 1)) : _("", !0)
|
|
110
|
-
], 2)
|
|
111
|
-
]),
|
|
112
|
-
_: 1
|
|
113
|
-
}, 16, ["value", "prefix", "suffix"]));
|
|
114
|
-
}
|
|
115
|
-
}), ve = { 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" }, he = ["aria-label", "placeholder"], ge = ["aria-multiselectable"], xe = {
|
|
116
|
-
key: 0,
|
|
117
|
-
role: "presentation"
|
|
118
|
-
}, ye = ["aria-selected"], ke = { class: "flex-1 py-2" }, _e = ["id"], we = ["aria-labelledby"], $e = ["aria-selected"], Ce = ["disabled", "onClick"], Fe = {
|
|
119
|
-
key: 0,
|
|
120
|
-
"aria-hidden": "true",
|
|
121
|
-
class: "flex shrink-0 items-center"
|
|
122
|
-
}, qe = { class: "min-w-0 flex-1 text-content-strong" }, De = {
|
|
123
|
-
key: 0,
|
|
124
|
-
class: "shrink-0 text-footnote text-content-muted"
|
|
125
|
-
}, Ve = {
|
|
126
|
-
key: 1,
|
|
127
|
-
class: "px-4 py-6 text-center text-subheadline text-content-muted"
|
|
128
|
-
}, I = /* @__PURE__ */ L({
|
|
129
|
-
__name: "OptionList",
|
|
130
|
-
props: {
|
|
131
|
-
options: {},
|
|
132
|
-
modelValue: { default: null },
|
|
133
|
-
multiple: { type: Boolean, default: !1 },
|
|
134
|
-
searchFrom: { default: 9 },
|
|
135
|
-
noneLabel: { default: void 0 },
|
|
136
|
-
presentation: { default: "grouped" }
|
|
137
|
-
},
|
|
138
|
-
emits: ["select"],
|
|
139
|
-
setup(v, { emit: o }) {
|
|
140
|
-
const e = v, a = o, { t: h } = Q(), m = M(""), w = Y(), g = O("root"), x = D(() => e.options.length >= e.searchFrom), d = D(() => ne(se(e.options, m.value))), n = (l) => e.multiple ? Array.isArray(e.modelValue) && e.modelValue.includes(l.value) : e.modelValue === l.value, y = D(() => e.multiple ? !1 : e.modelValue === null);
|
|
141
|
-
function $(l) {
|
|
142
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(l.key)) return;
|
|
143
|
-
const s = [...g.value?.querySelectorAll("[data-option]:not([disabled])") ?? []];
|
|
144
|
-
if (s.length === 0) return;
|
|
145
|
-
const f = s.indexOf(document.activeElement), t = l.key === "Home" ? 0 : l.key === "End" ? s.length - 1 : l.key === "ArrowDown" ? Math.min(f + 1, s.length - 1) : Math.max(f - 1, 0);
|
|
146
|
-
l.key === "ArrowUp" && f <= 0 ? g.value?.querySelector("[data-option-search]")?.focus() : s[f === -1 && l.key === "ArrowDown" ? 0 : t]?.focus(), l.preventDefault();
|
|
147
|
-
}
|
|
148
|
-
const i = D(() => e.presentation === "grouped");
|
|
149
|
-
return (l, k) => (r(), p("div", {
|
|
150
|
-
ref_key: "root",
|
|
151
|
-
ref: g,
|
|
152
|
-
"data-test": "option-list",
|
|
153
|
-
onKeydown: $
|
|
154
|
-
}, [
|
|
155
|
-
x.value ? (r(), p("div", {
|
|
156
|
-
key: 0,
|
|
157
|
-
class: b(["sticky top-0 z-10 pb-2", i.value ? "bg-surface-page pt-1" : "bg-surface-cell"])
|
|
158
|
-
}, [
|
|
159
|
-
c("label", ve, [
|
|
160
|
-
S(u(z), {
|
|
161
|
-
name: "search",
|
|
162
|
-
size: 16,
|
|
163
|
-
class: "shrink-0"
|
|
164
|
-
}),
|
|
165
|
-
Z(c("input", {
|
|
166
|
-
"onUpdate:modelValue": k[0] || (k[0] = (s) => m.value = s),
|
|
167
|
-
"data-option-search": "",
|
|
168
|
-
type: "search",
|
|
169
|
-
enterkeyhint: "search",
|
|
170
|
-
autocomplete: "off",
|
|
171
|
-
autocapitalize: "off",
|
|
172
|
-
spellcheck: "false",
|
|
173
|
-
"aria-label": u(h)("core.form.select.search"),
|
|
174
|
-
placeholder: u(h)("core.form.select.search"),
|
|
175
|
-
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"
|
|
176
|
-
}, null, 8, he), [
|
|
177
|
-
[ee, m.value]
|
|
178
|
-
])
|
|
179
|
-
])
|
|
180
|
-
], 2)) : _("", !0),
|
|
181
|
-
c("ul", {
|
|
182
|
-
class: b(["flex flex-col", i.value ? "gap-group-gap" : "gap-2"]),
|
|
183
|
-
role: "listbox",
|
|
184
|
-
"aria-multiselectable": e.multiple || void 0
|
|
185
|
-
}, [
|
|
186
|
-
e.noneLabel && m.value === "" ? (r(), p("li", xe, [
|
|
187
|
-
c("ul", {
|
|
188
|
-
role: "group",
|
|
189
|
-
class: b(i.value ? "rounded-group bg-surface-cell shadow-group" : "")
|
|
190
|
-
}, [
|
|
191
|
-
c("li", {
|
|
192
|
-
role: "option",
|
|
193
|
-
"aria-selected": y.value
|
|
194
|
-
}, [
|
|
195
|
-
c("button", {
|
|
196
|
-
type: "button",
|
|
197
|
-
"data-option": "",
|
|
198
|
-
class: b(["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", [y.value ? "text-content-strong" : "text-content-muted", i.value ? "rounded-group" : "rounded-control"]]),
|
|
199
|
-
onClick: k[1] || (k[1] = (s) => a("select", null))
|
|
200
|
-
}, [
|
|
201
|
-
c("span", ke, F(e.noneLabel), 1),
|
|
202
|
-
y.value ? (r(), B(u(z), {
|
|
203
|
-
key: 0,
|
|
204
|
-
name: "checkCustom",
|
|
205
|
-
size: 18,
|
|
206
|
-
class: "shrink-0 text-content-link"
|
|
207
|
-
})) : _("", !0)
|
|
208
|
-
], 2)
|
|
209
|
-
], 8, ye)
|
|
210
|
-
], 2)
|
|
211
|
-
])) : _("", !0),
|
|
212
|
-
(r(!0), p(R, null, U(d.value, (s, f) => (r(), p("li", {
|
|
213
|
-
key: s.title ?? f,
|
|
214
|
-
role: "presentation"
|
|
215
|
-
}, [
|
|
216
|
-
s.title ? (r(), p("p", {
|
|
217
|
-
key: 0,
|
|
218
|
-
id: `${u(w)}-${f}`,
|
|
219
|
-
class: "px-row-inset pb-1.5 text-footnote uppercase tracking-wide text-content-muted"
|
|
220
|
-
}, F(s.title), 9, _e)) : _("", !0),
|
|
221
|
-
c("ul", {
|
|
222
|
-
role: "group",
|
|
223
|
-
"aria-labelledby": s.title ? `${u(w)}-${f}` : void 0,
|
|
224
|
-
class: b(i.value ? "rounded-group bg-surface-cell shadow-group" : "")
|
|
225
|
-
}, [
|
|
226
|
-
(r(!0), p(R, null, U(s.options, (t) => (r(), p("li", {
|
|
227
|
-
key: String(t.value),
|
|
228
|
-
role: "option",
|
|
229
|
-
"aria-selected": n(t),
|
|
230
|
-
class: "group/option"
|
|
231
|
-
}, [
|
|
232
|
-
c("button", {
|
|
233
|
-
type: "button",
|
|
234
|
-
"data-option": "",
|
|
235
|
-
"data-test": "option",
|
|
236
|
-
disabled: t.disabled,
|
|
237
|
-
class: b(["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", i.value ? "group-first/option:rounded-t-group group-last/option:rounded-b-group" : "rounded-control"]),
|
|
238
|
-
onClick: (q) => a("select", t.value)
|
|
239
|
-
}, [
|
|
240
|
-
e.multiple ? (r(), p("span", Fe, [
|
|
241
|
-
c("span", {
|
|
242
|
-
class: b(["flex size-5.5 items-center justify-center rounded-full border", n(t) ? "border-control-on bg-control-on text-white" : "border-border-control"])
|
|
243
|
-
}, [
|
|
244
|
-
n(t) ? (r(), B(u(z), {
|
|
245
|
-
key: 0,
|
|
246
|
-
name: "checkCustom",
|
|
247
|
-
size: 12
|
|
248
|
-
})) : _("", !0)
|
|
249
|
-
], 2)
|
|
250
|
-
])) : _("", !0),
|
|
251
|
-
c("span", {
|
|
252
|
-
class: b(["flex min-h-row min-w-0 flex-1 items-center gap-3 py-2 pr-row-inset", i.value ? "border-t border-border-separator group-first/option:border-t-0" : ""])
|
|
253
|
-
}, [
|
|
254
|
-
c("span", qe, F(t.label), 1),
|
|
255
|
-
t.description ? (r(), p("span", De, F(t.description), 1)) : _("", !0),
|
|
256
|
-
!e.multiple && n(t) ? (r(), B(u(z), {
|
|
257
|
-
key: 1,
|
|
258
|
-
name: "checkCustom",
|
|
259
|
-
size: 18,
|
|
260
|
-
class: "shrink-0 text-content-link"
|
|
261
|
-
})) : _("", !0)
|
|
262
|
-
], 2)
|
|
263
|
-
], 10, Ce)
|
|
264
|
-
], 8, $e))), 128))
|
|
265
|
-
], 10, we)
|
|
266
|
-
]))), 128)),
|
|
267
|
-
d.value.length === 0 ? (r(), p("li", Ve, F(u(h)("core.form.select.no_matches")), 1)) : _("", !0)
|
|
268
|
-
], 10, ge)
|
|
269
|
-
], 544));
|
|
270
|
-
}
|
|
271
|
-
}), Be = ["id", "disabled", "aria-expanded", "aria-required", "aria-invalid", "aria-describedby"], Se = ["id", "disabled", "aria-required", "aria-invalid", "aria-describedby", "onClick"], ze = { class: "max-h-72 overflow-y-auto" }, We = /* @__PURE__ */ L({
|
|
272
|
-
__name: "SelectField",
|
|
273
|
-
props: /* @__PURE__ */ T(/* @__PURE__ */ W({
|
|
274
|
-
label: {},
|
|
275
|
-
hint: {},
|
|
276
|
-
error: {},
|
|
277
|
-
required: { type: Boolean },
|
|
278
|
-
editable: { type: Boolean },
|
|
279
|
-
disabled: { type: Boolean },
|
|
280
|
-
lockedReason: {},
|
|
281
|
-
presentation: {},
|
|
282
|
-
name: {},
|
|
283
|
-
options: {},
|
|
284
|
-
placeholder: {},
|
|
285
|
-
clearable: { type: Boolean },
|
|
286
|
-
searchFrom: {}
|
|
287
|
-
}, { ...J, placeholder: void 0, clearable: !1, searchFrom: 9 }), {
|
|
288
|
-
modelValue: { default: null },
|
|
289
|
-
modelModifiers: {}
|
|
290
|
-
}),
|
|
291
|
-
emits: ["update:modelValue"],
|
|
292
|
-
setup(v) {
|
|
293
|
-
const o = v, e = P(v, "modelValue"), { t: a } = Q(), h = ie(), m = !!G(), w = O("sheet"), g = M(!1), x = D(() => o.options.find((i) => i.value === e.value) ?? null), d = D(() => o.placeholder ?? a("core.form.select.choose")), n = H("popup", () => o.error ? "error" : o.disabled ? "locked" : "rest");
|
|
294
|
-
function y(i) {
|
|
295
|
-
e.value = i, w.value?.dismiss();
|
|
296
|
-
}
|
|
297
|
-
const $ = D(() => [
|
|
298
|
-
"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",
|
|
299
|
-
m ? "compact:pl-0 compact:pr-0" : "",
|
|
300
|
-
o.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
301
|
-
]);
|
|
302
|
-
return (i, l) => (r(), B(j, N(u(K)(o), {
|
|
303
|
-
value: x.value?.label ?? null
|
|
304
|
-
}), {
|
|
305
|
-
default: V(({ id: k, describedby: s, invalid: f }) => [
|
|
306
|
-
c("div", {
|
|
307
|
-
class: b(["inline-flex max-w-full min-w-0", u(n)])
|
|
308
|
-
}, [
|
|
309
|
-
u(h) ? (r(), p("button", {
|
|
310
|
-
key: 0,
|
|
311
|
-
id: k,
|
|
312
|
-
type: "button",
|
|
313
|
-
disabled: o.disabled,
|
|
314
|
-
"aria-haspopup": "dialog",
|
|
315
|
-
"aria-expanded": g.value,
|
|
316
|
-
"aria-required": o.required || void 0,
|
|
317
|
-
"aria-invalid": f || void 0,
|
|
318
|
-
"aria-describedby": s,
|
|
319
|
-
class: b($.value),
|
|
320
|
-
onClick: l[0] || (l[0] = (t) => w.value?.present())
|
|
321
|
-
}, [
|
|
322
|
-
c("span", {
|
|
323
|
-
class: b(["min-w-0 truncate", x.value ? m ? "text-content-strong compact:text-content-muted" : "text-content-strong" : "text-content-disabled"])
|
|
324
|
-
}, F(x.value?.label ?? d.value), 3),
|
|
325
|
-
S(u(z), {
|
|
326
|
-
name: "expandUpDownLine",
|
|
327
|
-
size: 14,
|
|
328
|
-
class: "shrink-0 text-content-muted"
|
|
329
|
-
})
|
|
330
|
-
], 10, Be)) : (r(), B(ce, {
|
|
331
|
-
key: 1,
|
|
332
|
-
label: o.label ?? d.value,
|
|
333
|
-
width: "md",
|
|
334
|
-
placement: "bottom-start",
|
|
335
|
-
arrow: !1
|
|
336
|
-
}, {
|
|
337
|
-
trigger: V(({ toggle: t, attrs: q }) => [
|
|
338
|
-
c("button", N({
|
|
339
|
-
id: k,
|
|
340
|
-
type: "button"
|
|
341
|
-
}, q, {
|
|
342
|
-
"aria-haspopup": "listbox",
|
|
343
|
-
disabled: o.disabled,
|
|
344
|
-
"aria-required": o.required || void 0,
|
|
345
|
-
"aria-invalid": f || void 0,
|
|
346
|
-
"aria-describedby": s,
|
|
347
|
-
class: $.value,
|
|
348
|
-
onClick: t
|
|
349
|
-
}), [
|
|
350
|
-
c("span", {
|
|
351
|
-
class: b(["min-w-0 truncate", x.value ? "text-content-strong" : "text-content-disabled"])
|
|
352
|
-
}, F(x.value?.label ?? d.value), 3),
|
|
353
|
-
S(u(z), {
|
|
354
|
-
name: "expandUpDownLine",
|
|
355
|
-
size: 14,
|
|
356
|
-
class: "shrink-0 text-content-muted"
|
|
357
|
-
})
|
|
358
|
-
], 16, Se)
|
|
359
|
-
]),
|
|
360
|
-
default: V(({ dismiss: t }) => [
|
|
361
|
-
c("div", ze, [
|
|
362
|
-
S(I, {
|
|
363
|
-
options: o.options,
|
|
364
|
-
"model-value": e.value,
|
|
365
|
-
"search-from": o.searchFrom,
|
|
366
|
-
"none-label": o.clearable ? u(a)("core.form.select.clear") : void 0,
|
|
367
|
-
presentation: "plain",
|
|
368
|
-
onSelect: (q) => {
|
|
369
|
-
e.value = q, t();
|
|
370
|
-
}
|
|
371
|
-
}, null, 8, ["options", "model-value", "search-from", "none-label", "onSelect"])
|
|
372
|
-
])
|
|
373
|
-
]),
|
|
374
|
-
_: 2
|
|
375
|
-
}, 1032, ["label"]))
|
|
376
|
-
], 2),
|
|
377
|
-
u(h) ? (r(), B(ue, {
|
|
378
|
-
key: 0,
|
|
379
|
-
ref_key: "sheet",
|
|
380
|
-
ref: w,
|
|
381
|
-
title: o.label ?? d.value,
|
|
382
|
-
grouped: "",
|
|
383
|
-
onPresented: l[2] || (l[2] = (t) => g.value = !0),
|
|
384
|
-
onDismissed: l[3] || (l[3] = (t) => g.value = !1)
|
|
385
|
-
}, te({
|
|
386
|
-
default: V(() => [
|
|
387
|
-
S(I, {
|
|
388
|
-
options: o.options,
|
|
389
|
-
"model-value": e.value,
|
|
390
|
-
"search-from": o.searchFrom,
|
|
391
|
-
"none-label": o.clearable ? u(a)("core.form.select.clear") : void 0,
|
|
392
|
-
onSelect: y
|
|
393
|
-
}, null, 8, ["options", "model-value", "search-from", "none-label"])
|
|
394
|
-
]),
|
|
395
|
-
_: 2
|
|
396
|
-
}, [
|
|
397
|
-
o.clearable && e.value !== null ? {
|
|
398
|
-
name: "footer",
|
|
399
|
-
fn: V(() => [
|
|
400
|
-
S(re, {
|
|
401
|
-
prominence: "plain",
|
|
402
|
-
onClick: l[1] || (l[1] = (t) => y(null))
|
|
403
|
-
}, {
|
|
404
|
-
default: V(() => [
|
|
405
|
-
oe(F(u(a)("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
|
-
Te as _,
|
|
420
|
-
We as a,
|
|
421
|
-
I as b
|
|
422
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { computed as a, onUnmounted as u, shallowRef as d } from "vue";
|
|
2
|
-
import { p as f } from "./perDocument-DUuFrdGU.js";
|
|
3
|
-
const v = "data-dialog-inert-skip", i = "overflow-hidden", y = Symbol("vue-core:dialog-stack"), m = () => f(y, () => ({ entries: d([]), inertedByUs: /* @__PURE__ */ new Set(), lockedByUs: !1 }));
|
|
4
|
-
function r(n) {
|
|
5
|
-
const e = n.entries.value[n.entries.value.length - 1]?.root() ?? null;
|
|
6
|
-
for (const t of Array.from(document.body.children)) {
|
|
7
|
-
if (!(t instanceof HTMLElement)) continue;
|
|
8
|
-
const s = e !== null && !t.hasAttribute(v) && !t.contains(e);
|
|
9
|
-
s && !t.inert ? (t.inert = !0, n.inertedByUs.add(t)) : !s && n.inertedByUs.has(t) && (t.inert = !1, n.inertedByUs.delete(t));
|
|
10
|
-
}
|
|
11
|
-
const o = n.entries.value.length > 0;
|
|
12
|
-
o && !document.body.classList.contains(i) ? (document.body.classList.add(i), n.lockedByUs = !0) : !o && n.lockedByUs && (document.body.classList.remove(i), n.lockedByUs = !1);
|
|
13
|
-
}
|
|
14
|
-
function B(n) {
|
|
15
|
-
const e = m(), o = { root: () => n.value }, t = a(() => e.entries.value[e.entries.value.length - 1] === o), s = () => {
|
|
16
|
-
e.entries.value.includes(o) || (e.entries.value = [...e.entries.value, o]), r(e);
|
|
17
|
-
}, l = () => {
|
|
18
|
-
e.entries.value.includes(o) && (e.entries.value = e.entries.value.filter((c) => c !== o), r(e));
|
|
19
|
-
};
|
|
20
|
-
return u(l), { isTop: t, activate: s, deactivate: l };
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
v as I,
|
|
24
|
-
i as S,
|
|
25
|
-
B as u
|
|
26
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PhoneCountry } from "./phone";
|
|
2
|
-
/**
|
|
3
|
-
* The flag of a country as an SVG (Windows draws the emoji flags as two letters). Each flag is its own lazy module, loaded
|
|
4
|
-
* when the flag first scrolls into view, so an app downloads the flags a screen shows and not the 250 of the package.
|
|
5
|
-
*/
|
|
6
|
-
type __VLS_Props = {
|
|
7
|
-
country: PhoneCountry;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
export default _default;
|
|
File without changes
|