@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.
Files changed (42) hide show
  1. package/README.md +62 -0
  2. package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_d1b65adf_scoped_d1b65adf_lang.css +1 -1
  3. package/dist/assets/src/components/shared/_internal/SMenuItem.css_vue_type_style_index_0_src_af485607_scoped_af485607_lang.css +2 -0
  4. 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
  5. 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
  6. 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
  7. 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
  8. package/dist/assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_ddcc5fbb_scoped_ddcc5fbb_lang.css +2 -0
  9. package/dist/src/components/shared/_internal/SMenuItem.vue.js +2 -2
  10. package/dist/src/components/shared/_internal/SMenuItem.vue_vue_type_script_setup_true_lang.js +88 -76
  11. package/dist/src/components/shared/_internal/dialogSurface.d.ts +1 -1
  12. package/dist/src/components/shared/_internal/dialogSurface.js +1 -0
  13. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.d.ts +1 -1
  14. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.js +2 -2
  15. package/dist/src/components/shared/containers/SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js +60 -58
  16. package/dist/src/components/shared/containers/SModal.vue.js +2 -2
  17. package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +43 -37
  18. package/dist/src/components/shared/controls/SDropdownMenu.vue.d.ts +15 -4
  19. package/dist/src/components/shared/controls/SDropdownMenu.vue.js +2 -2
  20. package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js +98 -62
  21. package/dist/src/components/shared/controls/SInputText.vue.d.ts +2 -2
  22. package/dist/src/components/shared/controls/SInputText.vue.js +2 -2
  23. package/dist/src/components/shared/controls/SInputText.vue_vue_type_script_setup_true_lang.js +16 -25
  24. package/dist/src/components/shared/controls/SMenuSurface.vue.js +2 -2
  25. package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js +132 -110
  26. package/dist/src/components/shared/controls/STextarea.vue.d.ts +4 -0
  27. package/dist/src/components/shared/controls/STextarea.vue_vue_type_script_setup_true_lang.js +154 -147
  28. package/dist/src/components/shared/controls/menu.d.ts +9 -1
  29. package/dist/src/components/shared/controls/menu.js +43 -28
  30. package/dist/src/composables/useDialogOverlay.d.ts +1 -0
  31. package/dist/src/composables/useDialogOverlay.js +5 -2
  32. package/dist/src/internal/textLengthConstraints.d.ts +9 -0
  33. package/dist/src/internal/textLengthConstraints.js +18 -0
  34. package/dist/src/internal/useMenuLayer.d.ts +2 -1
  35. package/dist/src/internal/useMenuLayer.js +20 -14
  36. package/docs/public-api.md +14 -2
  37. package/package.json +1 -1
  38. package/src/components/shared/_internal/SDialogSurface.css +4 -0
  39. package/src/components/shared/_internal/SMenuItem.css +22 -1
  40. package/src/components/shared/controls/SMenuSurface.css +20 -0
  41. package/dist/assets/src/components/shared/_internal/SMenuItem.css_vue_type_style_index_0_src_e5bd192e_scoped_e5bd192e_lang.css +0 -2
  42. 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.css_vue_type_style_index_0_src_a9c5f1aa_scoped_a9c5f1aa_lang.css";
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-a9c5f1aa"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-023c25d0"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -1,9 +1,10 @@
1
1
  import { mergeIdReferences as e, useOwnedAttrs as t } from "../../../internal/ownedAttrs.js";
2
- import { resolveOptionalDomId as n, validateBoundedInteger as r, validateExactString as i } from "../../../internal/runtimeContract.js";
3
- import { useInteractiveLeafRegistration as a } from "../../../internal/passiveContentContract.js";
4
- import o from "./SButton.vue.js";
5
- import s from "./SField.vue.js";
6
- import { resolveFieldSurfaceBindings as c } from "../../../internal/fieldSurface.js";
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
- a({ owner: "SInputText" });
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 = i("SInputText", "type", F.type, N);
176
+ let e = r("SInputText", "type", F.type, N);
176
177
  return P[e];
177
178
  }), H = l(() => {
178
- let e = F.minLength === void 0 ? void 0 : r("SInputText", "minLength", F.minLength, {
179
- minimum: 0,
180
- maximum: 2 ** 53 - 1
181
- }), t = F.maxLength === void 0 ? void 0 : r("SInputText", "maxLength", F.maxLength, {
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(() => i("SInputText", "appearance", F.appearance, [
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 c("SInputText", {
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(s, {
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(o, {
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.css_vue_type_style_index_0_src_bc7c7be4_scoped_bc7c7be4_lang.css";
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-bc7c7be4"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-ddcc5fbb"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -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 ee from "../_internal/SMenuItem.vue.js";
7
- import o from "../_internal/SMenuSeparator.vue.js";
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 l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createVNode as m, defineComponent as h, inject as g, mergeProps as _, nextTick as v, onBeforeUnmount as y, onMounted as b, openBlock as x, provide as S, ref as C, renderList as te, resolveComponent as ne, toRef as re, unref as w, watch as ie, withCtx as T } from "vue";
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 E = [
11
+ var C = [
12
12
  "data-density",
13
13
  "data-orientation",
14
14
  "aria-label",
15
15
  "aria-orientation"
16
- ], D = /*@__PURE__*/ h({
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(h, { expose: D, emit: O }) {
39
- let k = h, A = O, j = e({
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 M = g(a, -1) + 1;
45
- S(a, M);
46
- let N = C(null), P = /* @__PURE__ */ new Map();
47
- S(i, {
48
- density: re(k, "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 (P.has(e.entryId)) throw Error(`SMenuSurface: duplicate mounted entry id '${e.entryId}'`);
51
- return P.set(e.entryId, e), () => P.delete(e.entryId);
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 F = C(null), I = C(!0), L = C(null), R = C(null), z = u(() => L.value?.getElement() ?? null), { position: B, zIndex: V, open: H, close: U } = n(z, { onDismiss: (e) => {
55
- F.value = null, e === "outside" && A("dismiss-tree");
56
- } }), W = u(() => {
57
- let e = k.items.find((e) => e.id === F.value);
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
- }), G = "", K = null, q = () => [...P.values()].filter((e) => e.element().isConnected).sort((e, t) => {
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
- }), J = (e, t) => {
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
- }, Y = () => {
67
- let e = q();
68
- e.length > 0 && J(e, 0);
69
- }, X = () => {
70
- let e = q();
71
- e.length > 0 && J(e, e.length - 1);
72
- }, ae = () => {
73
- if (typeof k.label != "string" || !k.label.trim()) throw TypeError("SMenuSurface: label must be a non-empty string");
74
- s(k.items);
75
- }, oe = (e) => {
76
- let t = q();
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
- J(t, ((n < 0 ? e === 1 ? -1 : 0 : n) + e + t.length) % t.length);
80
- }, se = (e) => {
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
- G += t, K && clearTimeout(K), K = setTimeout(() => {
83
- G = "", K = null;
85
+ U += t, W && clearTimeout(W), W = setTimeout(() => {
86
+ U = "", W = null;
84
87
  }, 500);
85
- let n = [...G].every((e) => e === t) ? t : G, r = q();
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 && J(r, r.indexOf(a));
91
+ a && K(r, r.indexOf(a));
89
92
  };
90
- async function Z(e, t) {
91
- let n = k.items.find((t) => t.id === e), r = P.get(e);
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 (F.value === e) {
94
- t && await v(() => R.value?.focusFirst());
96
+ if (j.value === e) {
97
+ t && await h(() => P.value?.focusFirst());
95
98
  return;
96
99
  }
97
- F.value && U("outside"), I.value = t, F.value = e, await H({
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 v(() => R.value?.focusFirst());
105
+ }, r.element()), t && await h(() => P.value?.focusFirst());
103
106
  }
104
107
  }
105
- function Q(e) {
106
- F.value &&= (U(e), null);
108
+ function X(e) {
109
+ j.value &&= (z(e), null);
107
110
  }
108
- function ce(e) {
109
- e.kind === "submenu" && !e.disabled ? Z(e.id, !1) : F.value && Q("outside");
111
+ function Z(e) {
112
+ e.kind === "submenu" && !e.disabled ? Y(e.id, !1) : j.value && X("outside");
110
113
  }
111
- function le(e, t) {
112
- e.kind === "submenu" || e.disabled || A("select", e, t);
114
+ function Q(e, t) {
115
+ e.kind === "submenu" || e.disabled || D("select", e, t);
113
116
  }
114
- function ue(e, t) {
115
- A("select", e, t);
117
+ function ge(e, t) {
118
+ D("select", e, t);
116
119
  }
117
120
  function $() {
118
- return q().find((e) => e.isFocused());
121
+ return G().find((e) => e.isFocused());
119
122
  }
120
- let de = (e) => {
123
+ let _e = (e) => {
121
124
  let t = e.target;
122
- if (e.currentTarget !== t && !q().some((e) => e.ownsEventTarget(t))) return;
125
+ if (e.currentTarget !== t && !G().some((e) => e.ownsEventTarget(t))) return;
123
126
  if (e.key === "Tab") {
124
- A("tab", e);
127
+ D("tab", e);
125
128
  return;
126
129
  }
127
130
  if (e.key === "Escape") {
128
- e.preventDefault(), A("escape");
131
+ e.preventDefault(), D("escape");
129
132
  return;
130
133
  }
131
- let n = k.orientation === "horizontal" ? "ArrowRight" : "ArrowDown", r = k.orientation === "horizontal" ? "ArrowLeft" : "ArrowUp";
132
- if (k.orientation === "vertical" && (e.key === "ArrowRight" || e.key === "ArrowLeft")) {
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() ? Z(t.entryId, !0) : e.key === "ArrowLeft" && M > 0 && A("submenu-back");
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(), oe(e.key === n ? 1 : -1);
141
+ e.preventDefault(), me(e.key === n ? 1 : -1);
139
142
  return;
140
143
  }
141
- if (k.orientation === "horizontal" && e.key === "ArrowDown") {
144
+ if (E.orientation === "horizontal" && e.key === "ArrowDown") {
142
145
  let t = $();
143
- t?.hasSubmenu() && (e.preventDefault(), Z(t.entryId, !0));
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" ? Y() : X();
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 && se(e.key);
156
- }, fe = (e) => {
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 && (N.value?.contains(t) || z.value?.contains(t)) || A("focus-exit", e);
161
+ t instanceof Node && (k.value?.contains(t) || F.value?.contains(t)) || D("focus-exit", e);
159
162
  };
160
- return b(() => {
161
- k.autofocus && v(k.initialFocus === "last" ? X : Y);
162
- }), ie(() => [k.label, k.items], () => {
163
- ae(), F.value && !W.value && Q("outside");
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
- }), y(() => {
168
- K && clearTimeout(K);
169
- }), D({
170
- focusFirst: Y,
171
- focusLast: X
170
+ }), ae(() => {
171
+ W && clearTimeout(W);
172
+ }), w({
173
+ focusFirst: q,
174
+ focusLast: J
172
175
  }), (e, t) => {
173
- let n = ne("SMenuSurface", !0);
174
- return x(), p("div", _({
176
+ let n = se("SMenuSurface", !0);
177
+ return g(), d("div", m({
175
178
  ref_key: "surfaceRef",
176
- ref: N
177
- }, w(j).bindings(), {
179
+ ref: k
180
+ }, b(fe).bindings(), {
178
181
  class: "s-menu-surface",
179
- "data-density": h.density,
180
- "data-orientation": h.orientation,
181
- "data-menu-depth": M,
182
+ "data-density": p.density,
183
+ "data-orientation": p.orientation,
184
+ "data-menu-depth": O,
182
185
  role: "menu",
183
- "aria-label": h.label,
184
- "aria-orientation": h.orientation,
185
- onKeydown: de,
186
- onFocusout: fe
187
- }), [(x(!0), p(c, null, te(h.items, (e) => (x(), p(c, { key: e.id }, [e.kind === "separator" ? (x(), d(o, {
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"])) : (x(), d(ee, {
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": W.value?.id === e.id,
194
- onSelect: (t) => le(e, t),
195
- onOpenSubmenu: (t) => Z(e.id, !0),
196
- onPointerIntent: (t) => ce(e)
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
- ]))], 64))), 128)), (x(), d(l, { to: "body" }, [W.value ? (x(), d(r, {
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: L,
228
+ ref: N,
207
229
  kind: "submenu",
208
- "landmark-label": `${h.label}: ${W.value.label}`,
209
- position: w(B),
210
- "z-index": w(V)
230
+ "landmark-label": `${p.label}: ${H.value.label}`,
231
+ position: b(I),
232
+ "z-index": b(L)
211
233
  }, {
212
- default: T(() => [m(n, {
234
+ default: S(() => [re(n, {
213
235
  ref_key: "submenuSurfaceRef",
214
- ref: R,
215
- label: `${h.label}: ${W.value.label}`,
216
- items: W.value.children,
217
- density: h.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: I.value,
220
- onEscape: t[0] ||= (e) => Q("escape"),
221
- onSubmenuBack: t[1] ||= (e) => Q("escape"),
222
- onDismissTree: t[2] ||= (e) => A("dismiss-tree"),
223
- onSelect: ue,
224
- onTab: t[3] ||= (e) => A("tab", 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
- ])) : f("", !0)]))], 16, E);
258
+ ])) : ne("", !0)]))], 16, C);
237
259
  };
238
260
  }
239
261
  });
240
262
  //#endregion
241
- export { D as default };
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;