@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.
- package/README.md +198 -11
- 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/SButton.css_vue_type_style_index_0_src_a5d8f7e0_scoped_a5d8f7e0_lang.css +2 -0
- package/dist/assets/src/components/shared/controls/SChoiceCards.css_vue_type_style_index_0_src_af9fa9d1_scoped_af9fa9d1_lang.css +2 -0
- 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/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
- package/dist/assets/src/components/shared/data-display/SStatus.css_vue_type_style_index_0_src_3ce41a12_scoped_3ce41a12_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/SVirtualList.css_vue_type_style_index_0_src_cee8c247_scoped_cee8c247_lang.css +2 -0
- package/dist/src/components/layout/SSideMenuButton.vue.d.ts +1 -1
- 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/SButton.vue.d.ts +3 -0
- package/dist/src/components/shared/controls/SButton.vue.js +2 -2
- package/dist/src/components/shared/controls/SButton.vue_vue_type_script_setup_true_lang.js +103 -99
- package/dist/src/components/shared/controls/SChoiceCards.vue.d.ts +1 -0
- package/dist/src/components/shared/controls/SChoiceCards.vue.js +2 -2
- package/dist/src/components/shared/controls/SChoiceCards.vue_vue_type_script_setup_true_lang.js +53 -49
- 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.d.ts +2 -2
- 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 +8 -0
- package/dist/src/components/shared/controls/STextarea.vue_vue_type_script_setup_true_lang.js +156 -145
- package/dist/src/components/shared/controls/menu.d.ts +9 -1
- package/dist/src/components/shared/controls/menu.js +43 -28
- package/dist/src/components/shared/data-display/SCodeEditor.vue.d.ts +90 -7
- package/dist/src/components/shared/data-display/SCodeEditor.vue.js +2 -2
- package/dist/src/components/shared/data-display/SStatus.vue.d.ts +7 -0
- package/dist/src/components/shared/data-display/SStatus.vue.js +2 -2
- package/dist/src/components/shared/data-display/SStatus.vue_vue_type_script_setup_true_lang.js +28 -21
- package/dist/src/components/shared/data-display/SVirtualList.vue.d.ts +2 -0
- package/dist/src/components/shared/data-display/SVirtualList.vue.js +2 -2
- package/dist/src/components/shared/data-display/SVirtualList.vue_vue_type_script_setup_true_lang.js +317 -210
- 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/useBinaryInput.js +3 -2
- 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/SButton.css +28 -0
- package/src/components/shared/controls/SChoiceCards.css +10 -3
- package/src/components/shared/controls/SMenuSurface.css +20 -0
- package/src/components/shared/data-display/SStatus.css +4 -0
- package/src/components/shared/data-display/SVirtualList.css +12 -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/SButton.css_vue_type_style_index_0_src_52ad38b1_scoped_52ad38b1_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SChoiceCards.css_vue_type_style_index_0_src_627a8628_scoped_627a8628_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
- package/dist/assets/src/components/shared/data-display/SStatus.css_vue_type_style_index_0_src_c76fa058_scoped_c76fa058_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/SVirtualList.css_vue_type_style_index_0_src_1717877d_scoped_1717877d_lang.css +0 -2
package/dist/src/components/shared/controls/SChoiceCards.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { useOwnedAttrs as e } from "../../../internal/ownedAttrs.js";
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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
|
|
8
|
+
var b = [
|
|
9
|
+
"data-appearance",
|
|
8
10
|
"data-columns",
|
|
9
11
|
"data-density",
|
|
10
12
|
"data-selection-indicator"
|
|
11
|
-
],
|
|
13
|
+
], x = {
|
|
12
14
|
key: 0,
|
|
13
15
|
class: "s-choice-card__kicker"
|
|
14
|
-
},
|
|
16
|
+
}, S = { class: "s-choice-card__title" }, C = {
|
|
15
17
|
key: 1,
|
|
16
18
|
class: "s-choice-card__description"
|
|
17
|
-
},
|
|
19
|
+
}, w = {
|
|
18
20
|
key: 2,
|
|
19
21
|
class: "s-choice-card__meta"
|
|
20
|
-
},
|
|
22
|
+
}, T = {
|
|
21
23
|
key: 3,
|
|
22
24
|
class: "s-choice-card__mark",
|
|
23
25
|
"aria-hidden": "true"
|
|
24
|
-
},
|
|
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(
|
|
56
|
-
let
|
|
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
|
-
|
|
61
|
-
let
|
|
62
|
-
options:
|
|
63
|
-
selectedValue:
|
|
64
|
-
disabled:
|
|
65
|
-
readonly:
|
|
66
|
-
update: (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) => (
|
|
70
|
-
id:
|
|
71
|
-
label:
|
|
72
|
-
"help-text":
|
|
73
|
-
"error-message":
|
|
74
|
-
required:
|
|
75
|
-
invalid:
|
|
76
|
-
disabled:
|
|
77
|
-
readonly:
|
|
78
|
-
}),
|
|
79
|
-
default:
|
|
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-
|
|
82
|
-
"data-
|
|
83
|
-
"data-
|
|
84
|
-
|
|
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:
|
|
88
|
-
invalid:
|
|
89
|
-
})), [(
|
|
90
|
-
key:
|
|
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:
|
|
96
|
+
ref: v(j).optionRef(e.value),
|
|
93
97
|
class: "s-choice-card"
|
|
94
|
-
}, { ref_for: !0 },
|
|
95
|
-
e.kicker ? (
|
|
96
|
-
|
|
97
|
-
e.description ? (
|
|
98
|
-
e.meta ? (
|
|
99
|
-
|
|
100
|
-
], 16))), 128))], 16,
|
|
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:
|
|
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:
|
|
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 {
|
|
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
|
|
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<
|
|
28
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
29
|
select: (entry: SMenuSelectableEntry, event: SMenuActivationEvent) => any;
|
|
25
|
-
|
|
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.
|
|
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-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-1ccb9efc"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -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 "
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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:
|
|
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
|
-
}),
|
|
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 &&
|
|
35
|
-
|
|
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 =
|
|
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":
|
|
44
|
-
"aria-controls":
|
|
45
|
-
onClick:
|
|
46
|
-
onKeydown:
|
|
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(
|
|
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
|
-
|
|
69
|
+
ne(() => {
|
|
56
70
|
let e = X();
|
|
57
|
-
if (e.getAttribute("aria-haspopup") !== "menu" || e.getAttribute("aria-controls") !==
|
|
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
|
|
60
|
-
let t = X(e);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
68
|
-
|
|
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
|
|
78
|
-
|
|
106
|
+
function ce(e) {
|
|
107
|
+
B(e);
|
|
79
108
|
}
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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:
|
|
87
|
-
controls:
|
|
123
|
+
expanded: K.value,
|
|
124
|
+
controls: H
|
|
88
125
|
},
|
|
89
126
|
severity: "secondary"
|
|
90
|
-
}), null, 16, ["disclosure"])), (
|
|
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:
|
|
130
|
+
ref: M,
|
|
94
131
|
kind: "dropdown",
|
|
95
|
-
"landmark-label":
|
|
96
|
-
position:
|
|
97
|
-
"z-index":
|
|
132
|
+
"landmark-label": O.value,
|
|
133
|
+
position: y(L),
|
|
134
|
+
"z-index": y(R)
|
|
98
135
|
}, {
|
|
99
|
-
default: w(() => [
|
|
136
|
+
default: w(() => [te(s, {
|
|
100
137
|
ref_key: "menuSurfaceRef",
|
|
101
|
-
ref:
|
|
102
|
-
id:
|
|
103
|
-
label:
|
|
138
|
+
ref: N,
|
|
139
|
+
id: H,
|
|
140
|
+
label: O.value,
|
|
104
141
|
density: "compact",
|
|
105
142
|
autofocus: "",
|
|
106
|
-
"initial-focus":
|
|
143
|
+
"initial-focus": U.value,
|
|
107
144
|
items: p.items,
|
|
108
|
-
onDismissTree: t[0] ||= (e) =>
|
|
109
|
-
onEscape: t[1] ||= (e) =>
|
|
110
|
-
onFocusExit: t[2] ||= (e) =>
|
|
111
|
-
onSelect:
|
|
112
|
-
onTab:
|
|
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
|
-
])) :
|
|
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.
|
|
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",
|
|
@@ -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.
|
|
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 };
|