@pgcorp/ui-kit 0.12.0 → 0.13.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 +62 -0
- package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_d1b65adf_scoped_d1b65adf_lang.css +1 -1
- package/dist/assets/src/components/shared/_internal/SMenuItem.css_vue_type_style_index_0_src_af485607_scoped_af485607_lang.css +2 -0
- package/dist/assets/src/components/shared/containers/{SCollapsiblePanel.css_vue_type_style_index_0_src_4882f962_scoped_4882f962_lang.css → SCollapsiblePanel.css_vue_type_style_index_0_src_71824088_scoped_71824088_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/{SModal.css_vue_type_style_index_0_src_23373daf_scoped_23373daf_lang.css → SModal.css_vue_type_style_index_0_src_0dc51b74_scoped_0dc51b74_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/{SDropdownMenu.css_vue_type_style_index_0_src_b854a89e_scoped_b854a89e_lang.css → SDropdownMenu.css_vue_type_style_index_0_src_1ccb9efc_scoped_1ccb9efc_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/{SInputText.css_vue_type_style_index_0_src_a9c5f1aa_scoped_a9c5f1aa_lang.css → SInputText.css_vue_type_style_index_0_src_023c25d0_scoped_023c25d0_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_ddcc5fbb_scoped_ddcc5fbb_lang.css +2 -0
- package/dist/src/components/shared/_internal/SMenuItem.vue.js +2 -2
- package/dist/src/components/shared/_internal/SMenuItem.vue_vue_type_script_setup_true_lang.js +88 -76
- package/dist/src/components/shared/_internal/dialogSurface.d.ts +1 -1
- package/dist/src/components/shared/_internal/dialogSurface.js +1 -0
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue.d.ts +1 -1
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue.js +2 -2
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js +60 -58
- package/dist/src/components/shared/containers/SModal.vue.js +2 -2
- package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +43 -37
- package/dist/src/components/shared/controls/SDropdownMenu.vue.d.ts +15 -4
- package/dist/src/components/shared/controls/SDropdownMenu.vue.js +2 -2
- package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js +98 -62
- package/dist/src/components/shared/controls/SInputText.vue.d.ts +2 -2
- package/dist/src/components/shared/controls/SInputText.vue.js +2 -2
- package/dist/src/components/shared/controls/SInputText.vue_vue_type_script_setup_true_lang.js +16 -25
- package/dist/src/components/shared/controls/SMenuSurface.vue.js +2 -2
- package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js +132 -110
- package/dist/src/components/shared/controls/STextarea.vue.d.ts +4 -0
- package/dist/src/components/shared/controls/STextarea.vue_vue_type_script_setup_true_lang.js +154 -147
- package/dist/src/components/shared/controls/menu.d.ts +9 -1
- package/dist/src/components/shared/controls/menu.js +43 -28
- package/dist/src/composables/useDialogOverlay.d.ts +1 -0
- package/dist/src/composables/useDialogOverlay.js +5 -2
- package/dist/src/internal/textLengthConstraints.d.ts +9 -0
- package/dist/src/internal/textLengthConstraints.js +18 -0
- package/dist/src/internal/useMenuLayer.d.ts +2 -1
- package/dist/src/internal/useMenuLayer.js +20 -14
- package/docs/public-api.md +14 -2
- package/package.json +1 -1
- package/src/components/shared/_internal/SDialogSurface.css +4 -0
- package/src/components/shared/_internal/SMenuItem.css +22 -1
- package/src/components/shared/controls/SMenuSurface.css +20 -0
- package/dist/assets/src/components/shared/_internal/SMenuItem.css_vue_type_style_index_0_src_e5bd192e_scoped_e5bd192e_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_bc7c7be4_scoped_bc7c7be4_lang.css +0 -2
|
@@ -110,10 +110,10 @@ declare const __VLS_export: import('vue').DefineComponent<Props, {
|
|
|
110
110
|
trailingIcon: Component;
|
|
111
111
|
density: SInputTextDensity;
|
|
112
112
|
appearance: "field" | "grid-cell" | "workbench-title";
|
|
113
|
-
monospace: boolean;
|
|
114
|
-
modelModifiers: SInputTextModelModifiers;
|
|
115
113
|
minLength: number;
|
|
116
114
|
maxLength: number;
|
|
115
|
+
monospace: boolean;
|
|
116
|
+
modelModifiers: SInputTextModelModifiers;
|
|
117
117
|
trailingText: string;
|
|
118
118
|
trailingAction: SInputTextTrailingAction;
|
|
119
119
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/controls/SInputText.
|
|
1
|
+
import "../../../../assets/src/components/shared/controls/SInputText.css_vue_type_style_index_0_src_023c25d0_scoped_023c25d0_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SInputText.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/controls/SInputText.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-023c25d0"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
package/dist/src/components/shared/controls/SInputText.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { mergeIdReferences as e, useOwnedAttrs as t } from "../../../internal/ownedAttrs.js";
|
|
2
|
-
import { resolveOptionalDomId as n,
|
|
3
|
-
import { useInteractiveLeafRegistration as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { resolveFieldSurfaceBindings as
|
|
2
|
+
import { resolveOptionalDomId as n, validateExactString as r } from "../../../internal/runtimeContract.js";
|
|
3
|
+
import { useInteractiveLeafRegistration as i } from "../../../internal/passiveContentContract.js";
|
|
4
|
+
import a from "./SButton.vue.js";
|
|
5
|
+
import o from "./SField.vue.js";
|
|
6
|
+
import { resolveFieldSurfaceBindings as s } from "../../../internal/fieldSurface.js";
|
|
7
|
+
import { resolveTextLengthConstraints as c } from "../../../internal/textLengthConstraints.js";
|
|
7
8
|
import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, mergeProps as g, openBlock as _, ref as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useId as S, watchEffect as C, withCtx as w } from "vue";
|
|
8
9
|
//#region src/components/shared/controls/SInputText.vue?vue&type=script&setup=true&lang.ts
|
|
9
10
|
var T = [
|
|
@@ -161,7 +162,7 @@ var T = [
|
|
|
161
162
|
component: "SInputText",
|
|
162
163
|
owner: "native input"
|
|
163
164
|
});
|
|
164
|
-
|
|
165
|
+
i({ owner: "SInputText" });
|
|
165
166
|
let R = v(null);
|
|
166
167
|
j({
|
|
167
168
|
focus: () => R.value?.focus(),
|
|
@@ -172,27 +173,17 @@ var T = [
|
|
|
172
173
|
}
|
|
173
174
|
});
|
|
174
175
|
let z = S(), B = l(() => n("SInputText", "id", F.id, `s-input-text-${z}`)), V = l(() => {
|
|
175
|
-
let e =
|
|
176
|
+
let e = r("SInputText", "type", F.type, N);
|
|
176
177
|
return P[e];
|
|
177
178
|
}), H = l(() => {
|
|
178
|
-
let e =
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
minimum: 0,
|
|
183
|
-
maximum: 2 ** 53 - 1
|
|
184
|
-
});
|
|
185
|
-
if (e !== void 0 && t !== void 0 && e > t) throw RangeError(`SInputText: minLength (${e}) не может превышать maxLength (${t}). / SInputText: minLength (${e}) must not exceed maxLength (${t}).`);
|
|
186
|
-
if ((e !== void 0 || t !== void 0) && V.value.family !== "textual") throw TypeError("SInputText: minLength и maxLength применимы только к textual native input types. / SInputText: minLength and maxLength apply only to textual native input types.");
|
|
187
|
-
return {
|
|
188
|
-
minLength: e,
|
|
189
|
-
maxLength: t
|
|
190
|
-
};
|
|
191
|
-
}), U = l(() => i("SInputText", "size", F.size, [
|
|
179
|
+
let e = c("SInputText", F.minLength, F.maxLength);
|
|
180
|
+
if ((e.minLength !== void 0 || e.maxLength !== void 0) && V.value.family !== "textual") throw TypeError("SInputText: minLength и maxLength применимы только к textual native input types. / SInputText: minLength and maxLength apply only to textual native input types.");
|
|
181
|
+
return e;
|
|
182
|
+
}), U = l(() => r("SInputText", "size", F.size, [
|
|
192
183
|
"sm",
|
|
193
184
|
"md",
|
|
194
185
|
"lg"
|
|
195
|
-
])), W = l(() =>
|
|
186
|
+
])), W = l(() => r("SInputText", "appearance", F.appearance, [
|
|
196
187
|
"field",
|
|
197
188
|
"grid-cell",
|
|
198
189
|
"workbench-title"
|
|
@@ -213,7 +204,7 @@ var T = [
|
|
|
213
204
|
};
|
|
214
205
|
});
|
|
215
206
|
function K(e) {
|
|
216
|
-
return
|
|
207
|
+
return s("SInputText", {
|
|
217
208
|
kind: "text-input",
|
|
218
209
|
appearance: W.value === "field" ? "field" : "embedded",
|
|
219
210
|
invalid: e.invalid,
|
|
@@ -252,7 +243,7 @@ var T = [
|
|
|
252
243
|
"data-input-family": V.value.family,
|
|
253
244
|
"data-trailing": q.value,
|
|
254
245
|
"data-with-label": !!h.label || void 0
|
|
255
|
-
}, [m(
|
|
246
|
+
}, [m(o, {
|
|
256
247
|
"control-id": B.value,
|
|
257
248
|
label: h.label,
|
|
258
249
|
required: h.required,
|
|
@@ -297,7 +288,7 @@ var T = [
|
|
|
297
288
|
key: 0,
|
|
298
289
|
class: "s-input-trailing",
|
|
299
290
|
"data-kind": q.value
|
|
300
|
-
}, [h.trailingIcon ? (_(), f("span", k, [(_(), u(y(h.trailingIcon), { class: "s-input-trailing__icon" }))])) : h.trailingText === void 0 ? h.trailingAction ? (_(), u(
|
|
291
|
+
}, [h.trailingIcon ? (_(), f("span", k, [(_(), u(y(h.trailingIcon), { class: "s-input-trailing__icon" }))])) : h.trailingText === void 0 ? h.trailingAction ? (_(), u(a, {
|
|
301
292
|
key: 2,
|
|
302
293
|
label: "",
|
|
303
294
|
size: "sm",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/controls/SMenuSurface.
|
|
1
|
+
import "../../../../assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_ddcc5fbb_scoped_ddcc5fbb_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SMenuSurface.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/controls/SMenuSurface.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-ddcc5fbb"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -3,17 +3,20 @@ import { useInteractiveLeafRegistration as t } from "../../../internal/passiveCo
|
|
|
3
3
|
import { useMenuLayer as n } from "../../../internal/useMenuLayer.js";
|
|
4
4
|
import r from "../_internal/SMenuLayer.vue.js";
|
|
5
5
|
import { menuContextKey as i, menuDepthKey as a } from "../_internal/menuContext.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import o from "../_internal/SMenuItem.vue.js";
|
|
7
|
+
import ee from "../_internal/SMenuSeparator.vue.js";
|
|
8
8
|
import { validateSMenuEntries as s } from "./menu.js";
|
|
9
|
-
import { Fragment as c, Teleport as
|
|
9
|
+
import { Fragment as c, Teleport as te, computed as l, createBlock as u, createCommentVNode as ne, createElementBlock as d, createElementVNode as f, createVNode as re, defineComponent as p, inject as ie, mergeProps as m, nextTick as h, onBeforeUnmount as ae, onMounted as oe, openBlock as g, provide as _, ref as v, renderList as y, resolveComponent as se, toDisplayString as ce, toRef as le, unref as b, watch as x, withCtx as S } from "vue";
|
|
10
10
|
//#region src/components/shared/controls/SMenuSurface.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
11
|
+
var C = [
|
|
12
12
|
"data-density",
|
|
13
13
|
"data-orientation",
|
|
14
14
|
"aria-label",
|
|
15
15
|
"aria-orientation"
|
|
16
|
-
],
|
|
16
|
+
], ue = ["aria-label", "data-menu-group-id"], de = {
|
|
17
|
+
class: "s-menu-group__label",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, w = /*@__PURE__*/ p({
|
|
17
20
|
inheritAttrs: !1,
|
|
18
21
|
__name: "SMenuSurface",
|
|
19
22
|
props: {
|
|
@@ -35,116 +38,116 @@ var E = [
|
|
|
35
38
|
"submenu-back",
|
|
36
39
|
"dismiss-tree"
|
|
37
40
|
],
|
|
38
|
-
setup(
|
|
39
|
-
let
|
|
41
|
+
setup(p, { expose: w, emit: T }) {
|
|
42
|
+
let E = p, D = T, fe = e({
|
|
40
43
|
component: "SMenuSurface",
|
|
41
44
|
owner: "menu root"
|
|
42
45
|
});
|
|
43
46
|
t({ owner: "SMenuSurface" });
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
density:
|
|
47
|
+
let O = ie(a, -1) + 1;
|
|
48
|
+
_(a, O);
|
|
49
|
+
let k = v(null), A = /* @__PURE__ */ new Map();
|
|
50
|
+
_(i, {
|
|
51
|
+
density: le(E, "density"),
|
|
49
52
|
register: (e) => {
|
|
50
|
-
if (
|
|
51
|
-
return
|
|
53
|
+
if (A.has(e.entryId)) throw Error(`SMenuSurface: duplicate mounted entry id '${e.entryId}'`);
|
|
54
|
+
return A.set(e.entryId, e), () => A.delete(e.entryId);
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
} }),
|
|
57
|
-
let e =
|
|
57
|
+
let j = v(null), M = v(!0), N = v(null), P = v(null), F = l(() => N.value?.getElement() ?? null), { position: I, zIndex: L, open: R, close: z } = n(F, { onDismiss: (e) => {
|
|
58
|
+
j.value = null, e === "outside" && D("dismiss-tree");
|
|
59
|
+
} }), B = (e) => e.flatMap((e) => e.kind === "group" ? [...e.children] : e.kind === "separator" ? [] : [e]), V = (e) => B(E.items).find((t) => t.id === e), H = l(() => {
|
|
60
|
+
let e = j.value ? V(j.value) : void 0;
|
|
58
61
|
return e?.kind === "submenu" ? e : null;
|
|
59
|
-
}),
|
|
62
|
+
}), U = "", W = null, G = () => [...A.values()].filter((e) => e.element().isConnected).sort((e, t) => {
|
|
60
63
|
let n = e.element().compareDocumentPosition(t.element());
|
|
61
64
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
62
|
-
}),
|
|
65
|
+
}), K = (e, t) => {
|
|
63
66
|
for (let t of e) t.setTabStop(!1);
|
|
64
67
|
let n = e[t];
|
|
65
68
|
n && (n.setTabStop(!0), n.focus());
|
|
66
|
-
},
|
|
67
|
-
let e =
|
|
68
|
-
e.length > 0 &&
|
|
69
|
-
},
|
|
70
|
-
let e =
|
|
71
|
-
e.length > 0 &&
|
|
72
|
-
},
|
|
73
|
-
if (typeof
|
|
74
|
-
s(
|
|
75
|
-
},
|
|
76
|
-
let t =
|
|
69
|
+
}, q = () => {
|
|
70
|
+
let e = G();
|
|
71
|
+
e.length > 0 && K(e, 0);
|
|
72
|
+
}, J = () => {
|
|
73
|
+
let e = G();
|
|
74
|
+
e.length > 0 && K(e, e.length - 1);
|
|
75
|
+
}, pe = () => {
|
|
76
|
+
if (typeof E.label != "string" || !E.label.trim()) throw TypeError("SMenuSurface: label must be a non-empty string");
|
|
77
|
+
s(E.items);
|
|
78
|
+
}, me = (e) => {
|
|
79
|
+
let t = G();
|
|
77
80
|
if (t.length === 0) return;
|
|
78
81
|
let n = t.findIndex((e) => e.isFocused());
|
|
79
|
-
|
|
80
|
-
},
|
|
82
|
+
K(t, ((n < 0 ? e === 1 ? -1 : 0 : n) + e + t.length) % t.length);
|
|
83
|
+
}, he = (e) => {
|
|
81
84
|
let t = e.toLocaleLowerCase();
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
U += t, W && clearTimeout(W), W = setTimeout(() => {
|
|
86
|
+
U = "", W = null;
|
|
84
87
|
}, 500);
|
|
85
|
-
let n = [...
|
|
88
|
+
let n = [...U].every((e) => e === t) ? t : U, r = G();
|
|
86
89
|
if (r.length === 0) return;
|
|
87
90
|
let i = r.findIndex((e) => e.isFocused()), a = [...r.slice(i + 1), ...r.slice(0, i + 1)].find((e) => e.label().trim().toLocaleLowerCase().startsWith(n));
|
|
88
|
-
a &&
|
|
91
|
+
a && K(r, r.indexOf(a));
|
|
89
92
|
};
|
|
90
|
-
async function
|
|
91
|
-
let n =
|
|
93
|
+
async function Y(e, t) {
|
|
94
|
+
let n = V(e), r = A.get(e);
|
|
92
95
|
if (n?.kind === "submenu" && !n.disabled && r) {
|
|
93
|
-
if (
|
|
94
|
-
t && await
|
|
96
|
+
if (j.value === e) {
|
|
97
|
+
t && await h(() => P.value?.focusFirst());
|
|
95
98
|
return;
|
|
96
99
|
}
|
|
97
|
-
|
|
100
|
+
j.value && z("outside"), M.value = t, j.value = e, await R({
|
|
98
101
|
type: "element",
|
|
99
102
|
element: r.element(),
|
|
100
103
|
align: "left",
|
|
101
104
|
placement: "inline"
|
|
102
|
-
}, r.element()), t && await
|
|
105
|
+
}, r.element()), t && await h(() => P.value?.focusFirst());
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
108
|
+
function X(e) {
|
|
109
|
+
j.value &&= (z(e), null);
|
|
107
110
|
}
|
|
108
|
-
function
|
|
109
|
-
e.kind === "submenu" && !e.disabled ?
|
|
111
|
+
function Z(e) {
|
|
112
|
+
e.kind === "submenu" && !e.disabled ? Y(e.id, !1) : j.value && X("outside");
|
|
110
113
|
}
|
|
111
|
-
function
|
|
112
|
-
e.kind === "submenu" || e.disabled ||
|
|
114
|
+
function Q(e, t) {
|
|
115
|
+
e.kind === "submenu" || e.disabled || D("select", e, t);
|
|
113
116
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
117
|
+
function ge(e, t) {
|
|
118
|
+
D("select", e, t);
|
|
116
119
|
}
|
|
117
120
|
function $() {
|
|
118
|
-
return
|
|
121
|
+
return G().find((e) => e.isFocused());
|
|
119
122
|
}
|
|
120
|
-
let
|
|
123
|
+
let _e = (e) => {
|
|
121
124
|
let t = e.target;
|
|
122
|
-
if (e.currentTarget !== t && !
|
|
125
|
+
if (e.currentTarget !== t && !G().some((e) => e.ownsEventTarget(t))) return;
|
|
123
126
|
if (e.key === "Tab") {
|
|
124
|
-
|
|
127
|
+
D("tab", e);
|
|
125
128
|
return;
|
|
126
129
|
}
|
|
127
130
|
if (e.key === "Escape") {
|
|
128
|
-
e.preventDefault(),
|
|
131
|
+
e.preventDefault(), D("escape");
|
|
129
132
|
return;
|
|
130
133
|
}
|
|
131
|
-
let n =
|
|
132
|
-
if (
|
|
134
|
+
let n = E.orientation === "horizontal" ? "ArrowRight" : "ArrowDown", r = E.orientation === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
135
|
+
if (E.orientation === "vertical" && (e.key === "ArrowRight" || e.key === "ArrowLeft")) {
|
|
133
136
|
let t = $();
|
|
134
|
-
e.preventDefault(), e.key === "ArrowRight" && t?.hasSubmenu() ?
|
|
137
|
+
e.preventDefault(), e.key === "ArrowRight" && t?.hasSubmenu() ? Y(t.entryId, !0) : e.key === "ArrowLeft" && O > 0 && D("submenu-back");
|
|
135
138
|
return;
|
|
136
139
|
}
|
|
137
140
|
if (e.key === n || e.key === r) {
|
|
138
|
-
e.preventDefault(),
|
|
141
|
+
e.preventDefault(), me(e.key === n ? 1 : -1);
|
|
139
142
|
return;
|
|
140
143
|
}
|
|
141
|
-
if (
|
|
144
|
+
if (E.orientation === "horizontal" && e.key === "ArrowDown") {
|
|
142
145
|
let t = $();
|
|
143
|
-
t?.hasSubmenu() && (e.preventDefault(),
|
|
146
|
+
t?.hasSubmenu() && (e.preventDefault(), Y(t.entryId, !0));
|
|
144
147
|
return;
|
|
145
148
|
}
|
|
146
149
|
if (e.key === "Home" || e.key === "End") {
|
|
147
|
-
e.preventDefault(), e.key === "Home" ?
|
|
150
|
+
e.preventDefault(), e.key === "Home" ? q() : J();
|
|
148
151
|
return;
|
|
149
152
|
}
|
|
150
153
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -152,76 +155,95 @@ var E = [
|
|
|
152
155
|
t && t.activate(e);
|
|
153
156
|
return;
|
|
154
157
|
}
|
|
155
|
-
e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey &&
|
|
156
|
-
},
|
|
158
|
+
e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey && he(e.key);
|
|
159
|
+
}, ve = (e) => {
|
|
157
160
|
let t = e.relatedTarget;
|
|
158
|
-
t instanceof Node && (
|
|
161
|
+
t instanceof Node && (k.value?.contains(t) || F.value?.contains(t)) || D("focus-exit", e);
|
|
159
162
|
};
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
}),
|
|
163
|
-
|
|
163
|
+
return oe(() => {
|
|
164
|
+
E.autofocus && h(E.initialFocus === "last" ? J : q);
|
|
165
|
+
}), x(() => [E.label, E.items], () => {
|
|
166
|
+
pe(), j.value && !H.value && X("outside");
|
|
164
167
|
}, {
|
|
165
168
|
immediate: !0,
|
|
166
169
|
deep: !0
|
|
167
|
-
}),
|
|
168
|
-
|
|
169
|
-
}),
|
|
170
|
-
focusFirst:
|
|
171
|
-
focusLast:
|
|
170
|
+
}), ae(() => {
|
|
171
|
+
W && clearTimeout(W);
|
|
172
|
+
}), w({
|
|
173
|
+
focusFirst: q,
|
|
174
|
+
focusLast: J
|
|
172
175
|
}), (e, t) => {
|
|
173
|
-
let n =
|
|
174
|
-
return
|
|
176
|
+
let n = se("SMenuSurface", !0);
|
|
177
|
+
return g(), d("div", m({
|
|
175
178
|
ref_key: "surfaceRef",
|
|
176
|
-
ref:
|
|
177
|
-
},
|
|
179
|
+
ref: k
|
|
180
|
+
}, b(fe).bindings(), {
|
|
178
181
|
class: "s-menu-surface",
|
|
179
|
-
"data-density":
|
|
180
|
-
"data-orientation":
|
|
181
|
-
"data-menu-depth":
|
|
182
|
+
"data-density": p.density,
|
|
183
|
+
"data-orientation": p.orientation,
|
|
184
|
+
"data-menu-depth": O,
|
|
182
185
|
role: "menu",
|
|
183
|
-
"aria-label":
|
|
184
|
-
"aria-orientation":
|
|
185
|
-
onKeydown:
|
|
186
|
-
onFocusout:
|
|
187
|
-
}), [(
|
|
186
|
+
"aria-label": p.label,
|
|
187
|
+
"aria-orientation": p.orientation,
|
|
188
|
+
onKeydown: _e,
|
|
189
|
+
onFocusout: ve
|
|
190
|
+
}), [(g(!0), d(c, null, y(p.items, (e) => (g(), d(c, { key: e.id }, [e.kind === "separator" ? (g(), u(ee, {
|
|
188
191
|
key: 0,
|
|
189
192
|
"entry-id": e.id
|
|
190
|
-
}, null, 8, ["entry-id"])) : (
|
|
193
|
+
}, null, 8, ["entry-id"])) : e.kind === "group" ? (g(), d("div", {
|
|
191
194
|
key: 1,
|
|
195
|
+
class: "s-menu-group",
|
|
196
|
+
role: "group",
|
|
197
|
+
"aria-label": e.label,
|
|
198
|
+
"data-menu-group-id": e.id
|
|
199
|
+
}, [f("div", de, ce(e.label), 1), (g(!0), d(c, null, y(e.children, (e) => (g(), u(o, {
|
|
200
|
+
key: e.id,
|
|
192
201
|
entry: e,
|
|
193
|
-
"submenu-open":
|
|
194
|
-
onSelect: (t) =>
|
|
195
|
-
onOpenSubmenu: (t) =>
|
|
196
|
-
onPointerIntent: (t) =>
|
|
202
|
+
"submenu-open": H.value?.id === e.id,
|
|
203
|
+
onSelect: (t) => Q(e, t),
|
|
204
|
+
onOpenSubmenu: (t) => Y(e.id, !0),
|
|
205
|
+
onPointerIntent: (t) => Z(e)
|
|
197
206
|
}, null, 8, [
|
|
198
207
|
"entry",
|
|
199
208
|
"submenu-open",
|
|
200
209
|
"onSelect",
|
|
201
210
|
"onOpenSubmenu",
|
|
202
211
|
"onPointerIntent"
|
|
203
|
-
]))
|
|
212
|
+
]))), 128))], 8, ue)) : (g(), u(o, {
|
|
213
|
+
key: 2,
|
|
214
|
+
entry: e,
|
|
215
|
+
"submenu-open": H.value?.id === e.id,
|
|
216
|
+
onSelect: (t) => Q(e, t),
|
|
217
|
+
onOpenSubmenu: (t) => Y(e.id, !0),
|
|
218
|
+
onPointerIntent: (t) => Z(e)
|
|
219
|
+
}, null, 8, [
|
|
220
|
+
"entry",
|
|
221
|
+
"submenu-open",
|
|
222
|
+
"onSelect",
|
|
223
|
+
"onOpenSubmenu",
|
|
224
|
+
"onPointerIntent"
|
|
225
|
+
]))], 64))), 128)), (g(), u(te, { to: "body" }, [H.value ? (g(), u(r, {
|
|
204
226
|
key: 0,
|
|
205
227
|
ref_key: "submenuLayerRef",
|
|
206
|
-
ref:
|
|
228
|
+
ref: N,
|
|
207
229
|
kind: "submenu",
|
|
208
|
-
"landmark-label": `${
|
|
209
|
-
position:
|
|
210
|
-
"z-index":
|
|
230
|
+
"landmark-label": `${p.label}: ${H.value.label}`,
|
|
231
|
+
position: b(I),
|
|
232
|
+
"z-index": b(L)
|
|
211
233
|
}, {
|
|
212
|
-
default:
|
|
234
|
+
default: S(() => [re(n, {
|
|
213
235
|
ref_key: "submenuSurfaceRef",
|
|
214
|
-
ref:
|
|
215
|
-
label: `${
|
|
216
|
-
items:
|
|
217
|
-
density:
|
|
236
|
+
ref: P,
|
|
237
|
+
label: `${p.label}: ${H.value.label}`,
|
|
238
|
+
items: H.value.children,
|
|
239
|
+
density: p.density,
|
|
218
240
|
orientation: "vertical",
|
|
219
|
-
autofocus:
|
|
220
|
-
onEscape: t[0] ||= (e) =>
|
|
221
|
-
onSubmenuBack: t[1] ||= (e) =>
|
|
222
|
-
onDismissTree: t[2] ||= (e) =>
|
|
223
|
-
onSelect:
|
|
224
|
-
onTab: t[3] ||= (e) =>
|
|
241
|
+
autofocus: M.value,
|
|
242
|
+
onEscape: t[0] ||= (e) => X("escape"),
|
|
243
|
+
onSubmenuBack: t[1] ||= (e) => X("escape"),
|
|
244
|
+
onDismissTree: t[2] ||= (e) => D("dismiss-tree"),
|
|
245
|
+
onSelect: ge,
|
|
246
|
+
onTab: t[3] ||= (e) => D("tab", e)
|
|
225
247
|
}, null, 8, [
|
|
226
248
|
"label",
|
|
227
249
|
"items",
|
|
@@ -233,9 +255,9 @@ var E = [
|
|
|
233
255
|
"landmark-label",
|
|
234
256
|
"position",
|
|
235
257
|
"z-index"
|
|
236
|
-
])) :
|
|
258
|
+
])) : ne("", !0)]))], 16, C);
|
|
237
259
|
};
|
|
238
260
|
}
|
|
239
261
|
});
|
|
240
262
|
//#endregion
|
|
241
|
-
export {
|
|
263
|
+
export { w as default };
|
|
@@ -65,6 +65,8 @@ export interface Props {
|
|
|
65
65
|
helpText?: string;
|
|
66
66
|
id?: string;
|
|
67
67
|
rows?: number;
|
|
68
|
+
minLength?: number;
|
|
69
|
+
maxLength?: number;
|
|
68
70
|
size?: STextareaSize;
|
|
69
71
|
autoResize?: boolean;
|
|
70
72
|
maxRows?: number;
|
|
@@ -115,6 +117,8 @@ declare const __VLS_export: import('vue').DefineComponent<Props, STextareaApi, {
|
|
|
115
117
|
errorMessage: string;
|
|
116
118
|
modelValue: string | null;
|
|
117
119
|
appearance: STextareaAppearance;
|
|
120
|
+
minLength: number;
|
|
121
|
+
maxLength: number;
|
|
118
122
|
autoResize: boolean;
|
|
119
123
|
maxRows: number;
|
|
120
124
|
minHeight: number;
|