@pgcorp/ui-kit 0.11.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 (72) hide show
  1. package/README.md +198 -11
  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/SButton.css_vue_type_style_index_0_src_a5d8f7e0_scoped_a5d8f7e0_lang.css +2 -0
  7. package/dist/assets/src/components/shared/controls/SChoiceCards.css_vue_type_style_index_0_src_af9fa9d1_scoped_af9fa9d1_lang.css +2 -0
  8. 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
  9. 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
  10. package/dist/assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_ddcc5fbb_scoped_ddcc5fbb_lang.css +2 -0
  11. package/dist/assets/src/components/shared/data-display/{SCodeEditor.css_vue_type_style_index_0_src_124ca461_scoped_124ca461_lang.css → SCodeEditor.css_vue_type_style_index_0_src_3ad533d9_scoped_3ad533d9_lang.css} +1 -1
  12. package/dist/assets/src/components/shared/data-display/SStatus.css_vue_type_style_index_0_src_3ce41a12_scoped_3ce41a12_lang.css +2 -0
  13. package/dist/assets/src/components/shared/data-display/SVirtualList.css_vue_type_style_index_0_src_cee8c247_scoped_cee8c247_lang.css +2 -0
  14. package/dist/src/components/layout/SSideMenuButton.vue.d.ts +1 -1
  15. package/dist/src/components/shared/_internal/SMenuItem.vue.js +2 -2
  16. package/dist/src/components/shared/_internal/SMenuItem.vue_vue_type_script_setup_true_lang.js +88 -76
  17. package/dist/src/components/shared/_internal/dialogSurface.d.ts +1 -1
  18. package/dist/src/components/shared/_internal/dialogSurface.js +1 -0
  19. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.d.ts +1 -1
  20. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.js +2 -2
  21. package/dist/src/components/shared/containers/SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js +60 -58
  22. package/dist/src/components/shared/containers/SModal.vue.js +2 -2
  23. package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +43 -37
  24. package/dist/src/components/shared/controls/SButton.vue.d.ts +3 -0
  25. package/dist/src/components/shared/controls/SButton.vue.js +2 -2
  26. package/dist/src/components/shared/controls/SButton.vue_vue_type_script_setup_true_lang.js +103 -99
  27. package/dist/src/components/shared/controls/SChoiceCards.vue.d.ts +1 -0
  28. package/dist/src/components/shared/controls/SChoiceCards.vue.js +2 -2
  29. package/dist/src/components/shared/controls/SChoiceCards.vue_vue_type_script_setup_true_lang.js +53 -49
  30. package/dist/src/components/shared/controls/SDropdownMenu.vue.d.ts +15 -4
  31. package/dist/src/components/shared/controls/SDropdownMenu.vue.js +2 -2
  32. package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js +98 -62
  33. package/dist/src/components/shared/controls/SInputText.vue.d.ts +2 -2
  34. package/dist/src/components/shared/controls/SInputText.vue.js +2 -2
  35. package/dist/src/components/shared/controls/SInputText.vue_vue_type_script_setup_true_lang.js +16 -25
  36. package/dist/src/components/shared/controls/SMenuSurface.vue.d.ts +2 -2
  37. package/dist/src/components/shared/controls/SMenuSurface.vue.js +2 -2
  38. package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js +132 -110
  39. package/dist/src/components/shared/controls/STextarea.vue.d.ts +8 -0
  40. package/dist/src/components/shared/controls/STextarea.vue_vue_type_script_setup_true_lang.js +156 -145
  41. package/dist/src/components/shared/controls/menu.d.ts +9 -1
  42. package/dist/src/components/shared/controls/menu.js +43 -28
  43. package/dist/src/components/shared/data-display/SCodeEditor.vue.d.ts +90 -7
  44. package/dist/src/components/shared/data-display/SCodeEditor.vue.js +2 -2
  45. package/dist/src/components/shared/data-display/SStatus.vue.d.ts +7 -0
  46. package/dist/src/components/shared/data-display/SStatus.vue.js +2 -2
  47. package/dist/src/components/shared/data-display/SStatus.vue_vue_type_script_setup_true_lang.js +28 -21
  48. package/dist/src/components/shared/data-display/SVirtualList.vue.d.ts +2 -0
  49. package/dist/src/components/shared/data-display/SVirtualList.vue.js +2 -2
  50. package/dist/src/components/shared/data-display/SVirtualList.vue_vue_type_script_setup_true_lang.js +317 -210
  51. package/dist/src/composables/useDialogOverlay.d.ts +1 -0
  52. package/dist/src/composables/useDialogOverlay.js +5 -2
  53. package/dist/src/internal/textLengthConstraints.d.ts +9 -0
  54. package/dist/src/internal/textLengthConstraints.js +18 -0
  55. package/dist/src/internal/useBinaryInput.js +3 -2
  56. package/dist/src/internal/useMenuLayer.d.ts +2 -1
  57. package/dist/src/internal/useMenuLayer.js +20 -14
  58. package/docs/public-api.md +14 -2
  59. package/package.json +1 -1
  60. package/src/components/shared/_internal/SDialogSurface.css +4 -0
  61. package/src/components/shared/_internal/SMenuItem.css +22 -1
  62. package/src/components/shared/controls/SButton.css +28 -0
  63. package/src/components/shared/controls/SChoiceCards.css +10 -3
  64. package/src/components/shared/controls/SMenuSurface.css +20 -0
  65. package/src/components/shared/data-display/SStatus.css +4 -0
  66. package/src/components/shared/data-display/SVirtualList.css +12 -0
  67. package/dist/assets/src/components/shared/_internal/SMenuItem.css_vue_type_style_index_0_src_e5bd192e_scoped_e5bd192e_lang.css +0 -2
  68. package/dist/assets/src/components/shared/controls/SButton.css_vue_type_style_index_0_src_52ad38b1_scoped_52ad38b1_lang.css +0 -2
  69. package/dist/assets/src/components/shared/controls/SChoiceCards.css_vue_type_style_index_0_src_627a8628_scoped_627a8628_lang.css +0 -2
  70. package/dist/assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_bc7c7be4_scoped_bc7c7be4_lang.css +0 -2
  71. package/dist/assets/src/components/shared/data-display/SStatus.css_vue_type_style_index_0_src_c76fa058_scoped_c76fa058_lang.css +0 -2
  72. package/dist/assets/src/components/shared/data-display/SVirtualList.css_vue_type_style_index_0_src_1717877d_scoped_1717877d_lang.css +0 -2
@@ -1,27 +1,29 @@
1
1
  import { useOwnedAttrs as e } from "../../../internal/ownedAttrs.js";
2
- import { useInteractiveLeafRegistration as t } from "../../../internal/passiveContentContract.js";
3
- import n from "./SFieldGroup.vue.js";
4
- import { useRadioGroup as r } from "../_internal/useRadioGroup.js";
5
- import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, defineComponent as d, mergeProps as f, openBlock as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
2
+ import { validateExactString as t } from "../../../internal/runtimeContract.js";
3
+ import { useInteractiveLeafRegistration as n } from "../../../internal/passiveContentContract.js";
4
+ import r from "./SFieldGroup.vue.js";
5
+ import { useRadioGroup as i } from "../_internal/useRadioGroup.js";
6
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, defineComponent as f, mergeProps as p, openBlock as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
6
7
  //#region src/components/shared/controls/SChoiceCards.vue?vue&type=script&setup=true&lang.ts
7
- var y = [
8
+ var b = [
9
+ "data-appearance",
8
10
  "data-columns",
9
11
  "data-density",
10
12
  "data-selection-indicator"
11
- ], b = {
13
+ ], x = {
12
14
  key: 0,
13
15
  class: "s-choice-card__kicker"
14
- }, x = { class: "s-choice-card__title" }, S = {
16
+ }, S = { class: "s-choice-card__title" }, C = {
15
17
  key: 1,
16
18
  class: "s-choice-card__description"
17
- }, C = {
19
+ }, w = {
18
20
  key: 2,
19
21
  class: "s-choice-card__meta"
20
- }, w = {
22
+ }, T = {
21
23
  key: 3,
22
24
  class: "s-choice-card__mark",
23
25
  "aria-hidden": "true"
24
- }, T = /*@__PURE__*/ d({
26
+ }, E = /*@__PURE__*/ f({
25
27
  inheritAttrs: !1,
26
28
  __name: "SChoiceCards",
27
29
  props: {
@@ -47,65 +49,67 @@ var y = [
47
49
  type: Boolean,
48
50
  default: !1
49
51
  },
52
+ appearance: { default: "cards" },
50
53
  columns: { default: "auto" },
51
54
  density: { default: "default" },
52
55
  selectionIndicator: { default: "mark" }
53
56
  },
54
57
  emits: ["update:modelValue"],
55
- setup(d, { emit: T }) {
56
- let E = d, D = T, O = e({
58
+ setup(f, { emit: E }) {
59
+ let D = f, O = E, k = e({
57
60
  component: "SChoiceCards",
58
61
  owner: "field group"
59
62
  });
60
- t({ owner: "SChoiceCards" });
61
- let k = r({
62
- options: a(() => E.options),
63
- selectedValue: a(() => E.modelValue),
64
- disabled: a(() => E.disabled),
65
- readonly: a(() => E.readonly),
66
- update: (e) => D("update:modelValue", e),
63
+ n({ owner: "SChoiceCards" });
64
+ let A = o(() => t("SChoiceCards", "appearance", D.appearance, ["cards", "rows"])), j = i({
65
+ options: o(() => D.options),
66
+ selectedValue: o(() => D.modelValue),
67
+ disabled: o(() => D.disabled),
68
+ readonly: o(() => D.readonly),
69
+ update: (e) => O("update:modelValue", e),
67
70
  component: "SChoiceCards"
68
71
  });
69
- return (e, t) => (p(), o(n, f(_(O).bindings(), {
70
- id: d.id,
71
- label: d.label,
72
- "help-text": d.helpText,
73
- "error-message": d.errorMessage,
74
- required: d.required,
75
- invalid: d.invalid,
76
- disabled: d.disabled,
77
- readonly: d.readonly
78
- }), u({
79
- default: v(({ describedBy: e, labelId: t }) => [l("div", f({
72
+ return (e, t) => (m(), s(r, p(v(k).bindings(), {
73
+ id: f.id,
74
+ label: f.label,
75
+ "help-text": f.helpText,
76
+ "error-message": f.errorMessage,
77
+ required: f.required,
78
+ invalid: f.invalid,
79
+ disabled: f.disabled,
80
+ readonly: f.readonly
81
+ }), d({
82
+ default: y(({ describedBy: e, labelId: t }) => [u("div", p({
80
83
  class: "s-choice-cards",
81
- "data-columns": d.columns,
82
- "data-density": d.density,
83
- "data-selection-indicator": d.selectionIndicator
84
- }, _(k).groupBindings({
84
+ "data-appearance": A.value,
85
+ "data-columns": f.columns,
86
+ "data-density": f.density,
87
+ "data-selection-indicator": f.selectionIndicator
88
+ }, v(j).groupBindings({
85
89
  labelledBy: t,
86
90
  describedBy: e,
87
- required: d.required,
88
- invalid: d.invalid
89
- })), [(p(!0), c(i, null, m(d.options, (e) => (p(), c("button", f({
90
- key: _(k).optionToken(e.value),
91
+ required: f.required,
92
+ invalid: f.invalid
93
+ })), [(m(!0), l(a, null, h(f.options, (e) => (m(), l("button", p({
94
+ key: v(j).optionToken(e.value),
91
95
  ref_for: !0,
92
- ref: _(k).optionRef(e.value),
96
+ ref: v(j).optionRef(e.value),
93
97
  class: "s-choice-card"
94
- }, { ref_for: !0 }, _(k).optionBindings(e)), [
95
- e.kicker ? (p(), c("span", b, g(e.kicker), 1)) : s("", !0),
96
- l("span", x, g(e.title), 1),
97
- e.description ? (p(), c("span", S, g(e.description), 1)) : s("", !0),
98
- e.meta ? (p(), c("span", C, g(e.meta), 1)) : s("", !0),
99
- d.selectionIndicator === "mark" && e.value === d.modelValue ? (p(), c("span", w, "✓")) : s("", !0)
100
- ], 16))), 128))], 16, y)]),
98
+ }, { ref_for: !0 }, v(j).optionBindings(e)), [
99
+ e.kicker ? (m(), l("span", x, _(e.kicker), 1)) : c("", !0),
100
+ u("span", S, _(e.title), 1),
101
+ e.description ? (m(), l("span", C, _(e.description), 1)) : c("", !0),
102
+ e.meta ? (m(), l("span", w, _(e.meta), 1)) : c("", !0),
103
+ f.selectionIndicator === "mark" && e.value === f.modelValue ? (m(), l("span", T, "✓")) : c("", !0)
104
+ ], 16))), 128))], 16, b)]),
101
105
  _: 2
102
106
  }, [e.$slots.help ? {
103
107
  name: "help",
104
- fn: v(() => [h(e.$slots, "help", {}, void 0, !0)]),
108
+ fn: y(() => [g(e.$slots, "help", {}, void 0, !0)]),
105
109
  key: "0"
106
110
  } : void 0, e.$slots.error ? {
107
111
  name: "error",
108
- fn: v(() => [h(e.$slots, "error", {}, void 0, !0)]),
112
+ fn: y(() => [g(e.$slots, "error", {}, void 0, !0)]),
109
113
  key: "1"
110
114
  } : void 0]), 1040, [
111
115
  "id",
@@ -120,4 +124,4 @@ var y = [
120
124
  }
121
125
  });
122
126
  //#endregion
123
- export { T as default };
127
+ export { E as default };
@@ -1,11 +1,16 @@
1
1
  import { VNodeChild, VNodeRef } from 'vue';
2
2
  import { OwnedAttributeBindings } from '../../../internal/ownedAttrs';
3
3
  import { SMenuActivationEvent, SMenuEntry, SMenuSelectableEntry } from './menu';
4
- type __VLS_Props = {
4
+ export type SDropdownMenuPlacement = 'auto' | 'bottom' | 'top';
5
+ export interface Props {
5
6
  items: readonly SMenuEntry[];
6
7
  align?: 'left' | 'right';
7
8
  menuLabel?: string;
8
- };
9
+ open?: boolean;
10
+ defaultOpen?: boolean;
11
+ placement?: SDropdownMenuPlacement;
12
+ closeOnSelect?: boolean;
13
+ }
9
14
  export type SDropdownMenuTriggerAttrs = OwnedAttributeBindings<'SDropdownMenu'> & {
10
15
  readonly ref: VNodeRef;
11
16
  readonly 'aria-haspopup': 'menu';
@@ -20,13 +25,19 @@ type __VLS_Slots = {
20
25
  triggerAttrs: SDropdownMenuTriggerAttrs;
21
26
  }) => VNodeChild;
22
27
  };
23
- declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
+ declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
24
29
  select: (entry: SMenuSelectableEntry, event: SMenuActivationEvent) => any;
25
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ "update:open": (value: boolean) => any;
31
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
26
32
  onSelect?: ((entry: SMenuSelectableEntry, event: SMenuActivationEvent) => any) | undefined;
33
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
27
34
  }>, {
35
+ open: boolean;
28
36
  align: "left" | "right";
37
+ placement: SDropdownMenuPlacement;
29
38
  menuLabel: string;
39
+ defaultOpen: boolean;
40
+ closeOnSelect: boolean;
30
41
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
31
42
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
43
  declare const _default: typeof __VLS_export;
@@ -1,8 +1,8 @@
1
- import "../../../../assets/src/components/shared/controls/SDropdownMenu.css_vue_type_style_index_0_src_b854a89e_scoped_b854a89e_lang.css";
1
+ import "../../../../assets/src/components/shared/controls/SDropdownMenu.css_vue_type_style_index_0_src_1ccb9efc_scoped_1ccb9efc_lang.css";
2
2
  import e from "../../../../_virtual/_plugin-vue_export-helper.js";
3
3
  import t from "./SDropdownMenu.vue_vue_type_script_setup_true_lang.js";
4
4
  /* empty css */
5
5
  //#region src/components/shared/controls/SDropdownMenu.vue
6
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-b854a89e"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-1ccb9efc"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -1,11 +1,12 @@
1
1
  import { useUiKitLocale as e } from "../../../composables/useUiKitLocale.js";
2
2
  import { useOwnedAttrs as t } from "../../../internal/ownedAttrs.js";
3
- import n from "./SButton.vue.js";
4
- import { useMenuLayer as r } from "../../../internal/useMenuLayer.js";
5
- import i from "../_internal/SMenuLayer.vue.js";
6
- import { validateSMenuEntries as a } from "./menu.js";
7
- import o from "./SMenuSurface.vue.js";
8
- import { Teleport as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createVNode as f, defineComponent as p, mergeProps as m, nextTick as h, onMounted as g, openBlock as _, ref as v, renderSlot as y, unref as b, useId as x, useSlots as S, watchEffect as C, withCtx as w } from "vue";
3
+ import { validateBoolean as n, validateExactString as r } from "../../../internal/runtimeContract.js";
4
+ import i from "./SButton.vue.js";
5
+ import { useMenuLayer as a } from "../../../internal/useMenuLayer.js";
6
+ import o from "../_internal/SMenuLayer.vue.js";
7
+ import { validateSMenuEntries as ee } from "./menu.js";
8
+ import s from "./SMenuSurface.vue.js";
9
+ import { Teleport as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createVNode as te, defineComponent as p, mergeProps as m, nextTick as h, onMounted as ne, openBlock as g, ref as _, renderSlot as v, unref as y, useId as b, useSlots as x, watch as S, watchEffect as C, withCtx as w } from "vue";
9
10
  //#region src/components/shared/controls/SDropdownMenu.vue?vue&type=script&setup=true&lang.ts
10
11
  var T = { class: "s-dropdown-menu" }, E = /*@__PURE__*/ p({
11
12
  inheritAttrs: !1,
@@ -13,14 +14,27 @@ var T = { class: "s-dropdown-menu" }, E = /*@__PURE__*/ p({
13
14
  props: {
14
15
  items: {},
15
16
  align: { default: "right" },
16
- menuLabel: { default: void 0 }
17
+ menuLabel: { default: void 0 },
18
+ open: {
19
+ type: Boolean,
20
+ default: void 0
21
+ },
22
+ defaultOpen: {
23
+ type: Boolean,
24
+ default: !1
25
+ },
26
+ placement: { default: "auto" },
27
+ closeOnSelect: {
28
+ type: Boolean,
29
+ default: !0
30
+ }
17
31
  },
18
- emits: ["select"],
32
+ emits: ["select", "update:open"],
19
33
  setup(p, { emit: E }) {
20
- let D = p, { t: O } = e(), k = c(() => D.menuLabel ?? O("dialog.moreActions")), A = E, j = S(), M = t({
34
+ let D = p, { t: re } = e(), O = l(() => D.menuLabel ?? re("dialog.moreActions")), k = E, A = x(), j = t({
21
35
  component: "SDropdownMenu",
22
36
  owner: "menu trigger"
23
- }), N = v(null), P = v(null), F = null, I = c(() => N.value?.getElement() ?? null), { isOpen: L, position: R, zIndex: z, close: B, closeForTab: V, open: H, toggle: U } = r(I), W = `s-dropdown-menu-${x()}`, G = v("first"), K = !!j.default;
37
+ }), M = _(null), N = _(null), P = null, F = l(() => M.value?.getElement() ?? null), { isOpen: I, position: L, zIndex: R, close: z, closeForTab: B, open: V } = a(F, { onRequestDismiss: $ }), H = `s-dropdown-menu-${b()}`, U = _("first"), W = !!A.default, G = l(() => D.open !== void 0), K = l(() => G.value ? D.open === !0 : I.value);
24
38
  function q(e) {
25
39
  if (e === null) return null;
26
40
  if (e instanceof HTMLElement) return e;
@@ -31,97 +45,119 @@ var T = { class: "s-dropdown-menu" }, E = /*@__PURE__*/ p({
31
45
  return n;
32
46
  }
33
47
  let J = (e) => {
34
- if (e !== null && F !== null && e !== F) throw Error("SDropdownMenu: trigger binding must belong to exactly one UI-kit leaf");
35
- F = e;
48
+ if (e !== null && P !== null && e !== P) throw Error("SDropdownMenu: trigger binding must belong to exactly one UI-kit leaf");
49
+ P = e;
36
50
  }, Y = () => {
37
- let e = M.bindings();
51
+ let e = j.bindings();
38
52
  if (Object.prototype.hasOwnProperty.call(e, "onClick")) throw Error("SDropdownMenu: @click belongs to the typed triggerAttrs activation contract");
39
53
  return {
40
54
  ...e,
41
55
  ref: J,
42
56
  "aria-haspopup": "menu",
43
- "aria-expanded": L.value,
44
- "aria-controls": W,
45
- onClick: Z,
46
- onKeydown: Q
57
+ "aria-expanded": K.value,
58
+ "aria-controls": H,
59
+ onClick: ae,
60
+ onKeydown: oe
47
61
  };
48
62
  };
49
63
  function X(e) {
50
- let t = q(F);
64
+ let t = q(P);
51
65
  if (!t) throw Error("SDropdownMenu: expected exactly one trigger, received 0");
52
66
  if (e?.currentTarget instanceof HTMLElement && e.currentTarget !== t) throw Error("SDropdownMenu: activation target does not match the registered trigger");
53
67
  return t;
54
68
  }
55
- g(() => {
69
+ ne(() => {
56
70
  let e = X();
57
- if (e.getAttribute("aria-haspopup") !== "menu" || e.getAttribute("aria-controls") !== W) throw Error("SDropdownMenu: expected exactly one trigger, received 0");
71
+ if (e.getAttribute("aria-haspopup") !== "menu" || e.getAttribute("aria-controls") !== H) throw Error("SDropdownMenu: expected exactly one trigger, received 0");
72
+ (G.value && D.open || !G.value && D.defaultOpen) && Z();
58
73
  });
59
- function Z(e) {
60
- let t = X(e);
61
- G.value = "first", U({
62
- type: "element",
63
- element: t,
64
- align: D.align
65
- }, t);
74
+ function ie(e) {
75
+ let t = X(e), n = D.placement === "auto" ? void 0 : D.placement;
76
+ return {
77
+ anchor: {
78
+ type: "element",
79
+ element: t,
80
+ align: D.align,
81
+ ...n === void 0 ? {} : { placement: n }
82
+ },
83
+ trigger: t
84
+ };
85
+ }
86
+ async function Z(e) {
87
+ if (I.value) return;
88
+ let { anchor: t, trigger: n } = ie(e);
89
+ await V(t, n);
90
+ }
91
+ function Q(e) {
92
+ K.value || (k("update:open", !0), G.value || Z(e));
93
+ }
94
+ function $(e) {
95
+ (K.value || I.value) && (k("update:open", !1), G.value || z(e));
96
+ }
97
+ function ae(e) {
98
+ K.value ? $("trigger") : (U.value = "first", Q(e));
99
+ }
100
+ async function oe(e) {
101
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), e.stopPropagation(), U.value = e.key === "ArrowUp" ? "last" : "first", K.value || Q(e), await h(), await h(), I.value && (U.value === "last" ? N.value?.focusLast() : N.value?.focusFirst()));
66
102
  }
67
- async function Q(e) {
68
- if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
69
- e.preventDefault(), e.stopPropagation();
70
- let t = X(e);
71
- G.value = e.key === "ArrowUp" ? "last" : "first", L.value || await H({
72
- type: "element",
73
- element: t,
74
- align: D.align
75
- }, t), await h(), G.value === "last" ? P.value?.focusLast() : P.value?.focusFirst();
103
+ function se(e, t) {
104
+ e.disabled || (k("select", e, t), D.closeOnSelect && $("selection"));
76
105
  }
77
- function $(e, t) {
78
- e.disabled || (B("selection"), A("select", e, t));
106
+ function ce(e) {
107
+ B(e);
79
108
  }
80
- return C(() => {
81
- if (a(D.items), !k.value.trim()) throw TypeError("SDropdownMenu: menuLabel must be a non-empty string");
82
- if (D.align !== "left" && D.align !== "right") throw TypeError("SDropdownMenu: align must be 'left' or 'right'");
83
- }), (e, t) => (_(), d("div", T, [b(K) ? y(e.$slots, "default", { triggerAttrs: Y() }, void 0, !0, 0) : (_(), l(n, m({ key: 1 }, Y(), {
109
+ return S(() => D.open, (e) => {
110
+ e !== void 0 && (e && !I.value ? Z() : !e && I.value && z("programmatic"));
111
+ }), S(() => [D.align, D.placement], () => {
112
+ I.value && (z("programmatic"), Z());
113
+ }), C(() => {
114
+ if (ee(D.items), !O.value.trim()) throw TypeError("SDropdownMenu: menuLabel must be a non-empty string");
115
+ r("SDropdownMenu", "align", D.align, ["left", "right"]), r("SDropdownMenu", "placement", D.placement, [
116
+ "auto",
117
+ "bottom",
118
+ "top"
119
+ ]), n("SDropdownMenu", "defaultOpen", D.defaultOpen), n("SDropdownMenu", "closeOnSelect", D.closeOnSelect), D.open !== void 0 && n("SDropdownMenu", "open", D.open);
120
+ }), (e, t) => (g(), f("div", T, [y(W) ? v(e.$slots, "default", { triggerAttrs: Y() }, void 0, !0, 0) : (g(), u(i, m({ key: 1 }, Y(), {
84
121
  label: "Опции",
85
122
  disclosure: {
86
- expanded: b(L),
87
- controls: W
123
+ expanded: K.value,
124
+ controls: H
88
125
  },
89
126
  severity: "secondary"
90
- }), null, 16, ["disclosure"])), (_(), l(s, { to: "body" }, [b(L) ? (_(), l(i, {
127
+ }), null, 16, ["disclosure"])), (g(), u(c, { to: "body" }, [y(I) ? (g(), u(o, {
91
128
  key: 0,
92
129
  ref_key: "layerRef",
93
- ref: N,
130
+ ref: M,
94
131
  kind: "dropdown",
95
- "landmark-label": k.value,
96
- position: b(R),
97
- "z-index": b(z)
132
+ "landmark-label": O.value,
133
+ position: y(L),
134
+ "z-index": y(R)
98
135
  }, {
99
- default: w(() => [f(o, {
136
+ default: w(() => [te(s, {
100
137
  ref_key: "menuSurfaceRef",
101
- ref: P,
102
- id: W,
103
- label: k.value,
138
+ ref: N,
139
+ id: H,
140
+ label: O.value,
104
141
  density: "compact",
105
142
  autofocus: "",
106
- "initial-focus": G.value,
143
+ "initial-focus": U.value,
107
144
  items: p.items,
108
- onDismissTree: t[0] ||= (e) => b(B)("outside"),
109
- onEscape: t[1] ||= (e) => b(B)("escape"),
110
- onFocusExit: t[2] ||= (e) => b(B)("outside"),
111
- onSelect: $,
112
- onTab: b(V)
145
+ onDismissTree: t[0] ||= (e) => $("outside"),
146
+ onEscape: t[1] ||= (e) => $("escape"),
147
+ onFocusExit: t[2] ||= (e) => $("outside"),
148
+ onSelect: se,
149
+ onTab: ce
113
150
  }, null, 8, [
114
151
  "label",
115
152
  "initial-focus",
116
- "items",
117
- "onTab"
153
+ "items"
118
154
  ])]),
119
155
  _: 1
120
156
  }, 8, [
121
157
  "landmark-label",
122
158
  "position",
123
159
  "z-index"
124
- ])) : u("", !0)]))]));
160
+ ])) : d("", !0)]))]));
125
161
  }
126
162
  });
127
163
  //#endregion
@@ -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",
@@ -17,15 +17,15 @@ export interface SMenuSurfaceApi {
17
17
  declare const __VLS_export: import('vue').DefineComponent<Props, SMenuSurfaceApi, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
18
  select: (item: SMenuSelectableEntry, event: SMenuActivationEvent) => any;
19
19
  escape: () => any;
20
- tab: (event: KeyboardEvent) => any;
21
20
  "focus-exit": (event: FocusEvent) => any;
21
+ tab: (event: KeyboardEvent) => any;
22
22
  "submenu-back": () => any;
23
23
  "dismiss-tree": () => any;
24
24
  }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
25
25
  onSelect?: ((item: SMenuSelectableEntry, event: SMenuActivationEvent) => any) | undefined;
26
26
  onEscape?: (() => any) | undefined;
27
- onTab?: ((event: KeyboardEvent) => any) | undefined;
28
27
  "onFocus-exit"?: ((event: FocusEvent) => any) | undefined;
28
+ onTab?: ((event: KeyboardEvent) => any) | undefined;
29
29
  "onSubmenu-back"?: (() => any) | undefined;
30
30
  "onDismiss-tree"?: (() => any) | undefined;
31
31
  }>, {
@@ -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 };