@profitliga/ui 2.0.3 → 2.0.5
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/dist/components/AlertDialog/AlertDialogAction.vue.js +2 -3
- package/dist/components/AlertDialog/AlertDialogCancel.vue.js +8 -9
- package/dist/components/AlertDialog/AlertDialogTrigger.vue.js +7 -8
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Button/Button.vue.js +5 -52
- package/dist/components/Button/Button.vue2.js +52 -3
- package/dist/components/Calendar/CalendarNext.vue.js +3 -4
- package/dist/components/Calendar/CalendarPrev.vue.js +7 -8
- package/dist/components/ConfirmDialog/ConfirmDialog.vue2.js +11 -12
- package/dist/components/DatePicker/DatePickerNext.vue.js +1 -2
- package/dist/components/DatePicker/DatePickerPrev.vue.js +7 -8
- package/dist/components/DateRangePicker/DateRangePickerNext.vue.js +6 -7
- package/dist/components/DateRangePicker/DateRangePickerPrev.vue.js +7 -8
- package/dist/components/RangeCalendar/RangeCalendarNext.vue.js +3 -4
- package/dist/components/RangeCalendar/RangeCalendarPrev.vue.js +3 -4
- package/dist/components/Schedule/Schedule.vue2.js +38 -39
- package/dist/components/index.js +391 -392
- package/dist/components/v2/AlertDialog/AlertDialog.css +1 -1
- package/dist/components/v2/AlertDialog/AlertDialog.types.d.ts +2 -2
- package/dist/components/v2/AlertDialog/AlertDialog.vue.d.ts +2 -2
- package/dist/components/v2/AlertDialog/AlertDialog.vue.js +2 -2
- package/dist/components/v2/AlertDialog/AlertDialog.vue2.js +29 -29
- package/dist/components/v2/Button/Button.css +1 -1
- package/dist/components/v2/Button/Button.vue.js +2 -2
- package/dist/components/v2/Checkbox/Checkbox.css +1 -1
- package/dist/components/v2/Checkbox/Checkbox.types.d.ts +11 -0
- package/dist/components/v2/Checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
- package/dist/components/v2/Checkbox/Checkbox.vue2.js +61 -49
- package/dist/components/v2/Combobox/Combobox.css +1 -1
- package/dist/components/v2/Combobox/Combobox.types.d.ts +24 -4
- package/dist/components/v2/Combobox/Combobox.vue.js +1 -1
- package/dist/components/v2/Combobox/Combobox.vue2.js +195 -188
- package/dist/components/v2/ConfirmDialog/ConfirmDialog.types.d.ts +2 -2
- package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.d.ts +2 -2
- package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.js +6 -6
- package/dist/components/v2/DatePicker/DatePicker.css +1 -1
- package/dist/components/v2/DatePicker/DatePicker.types.d.ts +2 -2
- package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/components/v2/DatePicker/DatePicker.vue.js +2 -2
- package/dist/components/v2/DatePicker/DatePicker.vue2.js +54 -54
- package/dist/components/v2/Divider/Divider.types.d.ts +8 -0
- package/dist/components/v2/DropdownMenu/DropdownMenu.types.d.ts +2 -2
- package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/v2/DropdownMenu/DropdownMenu.vue2.js +6 -6
- package/dist/components/v2/FileUpload/FileUpload.css +1 -1
- package/dist/components/v2/FileUpload/FileUpload.vue.js +2 -2
- package/dist/components/v2/FileUpload/FileUpload.vue2.js +16 -16
- package/dist/components/v2/FormField/FormField.css +1 -0
- package/dist/components/v2/FormField/FormField.types.d.ts +48 -0
- package/dist/components/v2/FormField/FormField.vue.d.ts +25 -0
- package/dist/components/v2/FormField/FormField.vue.js +8 -0
- package/dist/components/v2/FormField/FormField.vue2.js +54 -0
- package/dist/components/v2/FormField/index.d.ts +3 -0
- package/dist/components/v2/Image/Image.css +1 -0
- package/dist/components/v2/Image/Image.types.d.ts +26 -0
- package/dist/components/v2/Image/Image.vue.d.ts +16 -0
- package/dist/components/v2/Image/Image.vue.js +8 -0
- package/dist/components/v2/Image/Image.vue2.js +91 -0
- package/dist/components/v2/Image/ImageList.css +1 -0
- package/dist/components/v2/Image/ImageList.types.d.ts +28 -0
- package/dist/components/v2/Image/ImageList.vue.d.ts +15 -0
- package/dist/components/v2/Image/ImageList.vue.js +8 -0
- package/dist/components/v2/Image/ImageList.vue2.js +38 -0
- package/dist/components/v2/Image/index.d.ts +5 -0
- package/dist/components/v2/InputNumber/InputNumber.css +1 -1
- package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
- package/dist/components/v2/InputNumber/InputNumber.vue2.js +22 -21
- package/dist/components/v2/InputSelect/InputSelect.types.d.ts +2 -2
- package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +2 -2
- package/dist/components/v2/InputSelect/InputSelect.vue.js +14 -14
- package/dist/components/v2/InputSelect/InputSelectChip.css +1 -1
- package/dist/components/v2/InputSelect/InputSelectChip.vue.d.ts +3 -3
- package/dist/components/v2/InputSelect/InputSelectChip.vue.js +2 -2
- package/dist/components/v2/InputSelect/InputSelectChip.vue2.js +17 -17
- package/dist/components/v2/Popover/Popover.css +1 -1
- package/dist/components/v2/Popover/Popover.types.d.ts +15 -2
- package/dist/components/v2/Popover/Popover.vue.d.ts +3 -2
- package/dist/components/v2/Popover/Popover.vue.js +2 -2
- package/dist/components/v2/Popover/Popover.vue2.js +50 -49
- package/dist/components/v2/Radio/Radio.css +1 -1
- package/dist/components/v2/Radio/Radio.vue.d.ts +4 -0
- package/dist/components/v2/Radio/Radio.vue.js +1 -1
- package/dist/components/v2/Radio/Radio.vue2.js +57 -49
- package/dist/components/v2/Schedule/Schedule.css +1 -1
- package/dist/components/v2/Schedule/Schedule.types.d.ts +2 -2
- package/dist/components/v2/Schedule/Schedule.vue.d.ts +2 -2
- package/dist/components/v2/Schedule/Schedule.vue.js +3 -3
- package/dist/components/v2/Schedule/Schedule.vue2.js +58 -57
- package/dist/components/v2/Select/Select.css +1 -1
- package/dist/components/v2/Select/Select.types.d.ts +8 -2
- package/dist/components/v2/Select/Select.vue.js +3 -3
- package/dist/components/v2/Select/Select.vue2.js +102 -92
- package/dist/components/v2/Toast/Toast.types.d.ts +2 -2
- package/dist/components/v2/Toast/Toaster.css +1 -1
- package/dist/components/v2/Toast/Toaster.vue.d.ts +2 -2
- package/dist/components/v2/Toast/Toaster.vue.js +1 -1
- package/dist/components/v2/Toast/Toaster.vue2.js +17 -17
- package/dist/components/v2/Tooltip/Tooltip.css +1 -1
- package/dist/components/v2/Tooltip/Tooltip.types.d.ts +2 -2
- package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +2 -2
- package/dist/components/v2/Tooltip/Tooltip.vue.js +1 -1
- package/dist/components/v2/Tooltip/Tooltip.vue2.js +39 -38
- package/dist/components/v2/Tooltip/TooltipContent.css +1 -1
- package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +2 -2
- package/dist/components/v2/Tooltip/TooltipContent.vue.js +2 -2
- package/dist/components/v2/Tooltip/TooltipContent.vue2.js +20 -20
- package/dist/components/v2/Tooltip/vTooltip.directive.js +40 -41
- package/dist/components/v2/index.d.ts +2 -0
- package/dist/components/v2/index.js +82 -76
- package/dist/components/v2/shared/isHtmlElement.util.d.ts +15 -0
- package/dist/components/v2/shared/isHtmlElement.util.js +10 -0
- package/dist/components/v2/shared/useIsMobile.util.d.ts +13 -0
- package/dist/components/v2/shared/useIsMobile.util.js +8 -0
- package/dist/components/v2/shared/useTriggerAria.util.js +4 -3
- package/dist/types/global.types.d.ts +10 -0
- package/package.json +3 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as Re, useModel as
|
|
1
|
+
import { defineComponent as Re, useModel as Se, useId as we, useAttrs as Ce, computed as d, ref as V, useTemplateRef as S, onMounted as $e, nextTick as B, onBeforeUnmount as xe, watch as w, openBlock as n, createElementBlock as u, mergeProps as f, unref as o, createTextVNode as N, toDisplayString as v, createCommentVNode as y, createElementVNode as g, createVNode as q, withCtx as X, Fragment as ie, renderList as re, createBlock as U, renderSlot as D, resolveDynamicComponent as Ie, withModifiers as Ae, mergeModels as ne } from "vue";
|
|
2
2
|
import { CircleX as Me, ChevronDown as Ee } from "@lucide/vue";
|
|
3
3
|
import Te from "../Popover/Popover.vue.js";
|
|
4
4
|
import Ve from "../Radio/RadioMarker.vue.js";
|
|
5
|
-
import { useTestId as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
5
|
+
import { useTestId as Be } from "../shared/useTestId.util.js";
|
|
6
|
+
import Ne from "../shared/VisuallyHidden.vue.js";
|
|
7
|
+
import qe from "./SelectCheckMarker.vue.js";
|
|
8
|
+
const De = ["disabled", "aria-labelledby", "aria-label", "aria-describedby", "aria-required"], Fe = ["aria-label", "aria-multiselectable", "aria-activedescendant"], Oe = ["id", "aria-selected", "aria-disabled", "onClick", "onMouseenter"], Ge = { class: "select-list__label" }, We = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "select-list__empty"
|
|
11
|
-
},
|
|
11
|
+
}, ze = ["aria-hidden"], Le = ["src"], Xe = { class: "select__chip-label" }, Ue = ["disabled", "tabindex", "aria-label", "onClick"], je = ["aria-hidden"], He = {
|
|
12
12
|
key: 3,
|
|
13
13
|
class: "select__placeholder"
|
|
14
14
|
}, Ke = "Нет вариантов", lt = /* @__PURE__ */ Re({
|
|
15
15
|
inheritAttrs: !1,
|
|
16
16
|
__name: "Select",
|
|
17
|
-
props: /* @__PURE__ */
|
|
17
|
+
props: /* @__PURE__ */ ne({
|
|
18
18
|
options: {},
|
|
19
19
|
multiple: { type: Boolean, default: !1 },
|
|
20
20
|
label: { default: void 0 },
|
|
21
|
+
required: { type: Boolean, default: !1 },
|
|
21
22
|
placeholder: { default: "Выберите значение" },
|
|
22
23
|
supportText: { default: void 0 },
|
|
23
24
|
errorText: { default: void 0 },
|
|
@@ -30,7 +31,7 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
30
31
|
side: { default: "bottom" },
|
|
31
32
|
sideOffset: { default: 4 },
|
|
32
33
|
ariaLabel: { default: void 0 },
|
|
33
|
-
breakpointMobile: { default: "sm" },
|
|
34
|
+
breakpointMobile: { type: [String, Boolean], default: "sm" },
|
|
34
35
|
testId: { default: void 0 }
|
|
35
36
|
}, {
|
|
36
37
|
modelValue: {
|
|
@@ -38,28 +39,28 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
38
39
|
},
|
|
39
40
|
modelModifiers: {}
|
|
40
41
|
}),
|
|
41
|
-
emits: /* @__PURE__ */
|
|
42
|
-
setup(a, { emit:
|
|
43
|
-
const s = a,
|
|
42
|
+
emits: /* @__PURE__ */ ne(["change", "select"], ["update:modelValue"]),
|
|
43
|
+
setup(a, { emit: oe }) {
|
|
44
|
+
const s = a, C = oe, $ = Se(a, "modelValue"), x = we(), j = `select-trigger-${x}`, H = `select-label-${x}`, k = `select-list-${x}`, K = `select-message-${x}`, c = Be(() => s.testId), F = Ce(), ue = d(() => ({
|
|
44
45
|
class: F.class,
|
|
45
46
|
style: F.style
|
|
46
|
-
})),
|
|
47
|
+
})), ce = d(() => {
|
|
47
48
|
const { class: e, style: l, ...t } = F;
|
|
48
49
|
return t;
|
|
49
|
-
}), b = V(!1), P =
|
|
50
|
+
}), b = V(!1), P = S("fieldRef"), I = S("listRef"), A = S("contentRef"), J = S("chipsRef"), Q = S("counterRef"), m = V(Number.MAX_SAFE_INTEGER), O = V(0), r = V(-1), _ = d(() => {
|
|
50
51
|
const e = $.value;
|
|
51
52
|
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
52
|
-
}), h =
|
|
53
|
-
() => s.options.filter((e) =>
|
|
54
|
-
), M =
|
|
53
|
+
}), h = d(
|
|
54
|
+
() => s.options.filter((e) => _.value.includes(e.value))
|
|
55
|
+
), M = d(
|
|
55
56
|
() => h.value.map((e) => e.label).join(", ")
|
|
56
|
-
), E =
|
|
57
|
+
), E = d(
|
|
57
58
|
() => Math.max(0, h.value.length - m.value)
|
|
58
|
-
), de =
|
|
59
|
+
), de = d(() => M.value || s.placeholder), G = d(
|
|
59
60
|
() => s.invalid ? s.errorText ?? s.supportText : s.supportText
|
|
60
|
-
), fe =
|
|
61
|
-
() =>
|
|
62
|
-
), be =
|
|
61
|
+
), fe = d(() => s.width ?? O.value), ve = d(
|
|
62
|
+
() => r.value === -1 ? void 0 : `${k}-option-${r.value}`
|
|
63
|
+
), be = d(() => [
|
|
63
64
|
"select",
|
|
64
65
|
`select--${s.size}`,
|
|
65
66
|
{
|
|
@@ -69,8 +70,8 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
69
70
|
"select--multiple": s.multiple
|
|
70
71
|
}
|
|
71
72
|
]);
|
|
72
|
-
function
|
|
73
|
-
return
|
|
73
|
+
function R(e) {
|
|
74
|
+
return _.value.includes(e);
|
|
74
75
|
}
|
|
75
76
|
function W(e) {
|
|
76
77
|
const l = s.options[e];
|
|
@@ -93,32 +94,32 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
93
94
|
return -1;
|
|
94
95
|
}
|
|
95
96
|
function ee(e = 20) {
|
|
96
|
-
|
|
97
|
+
B(() => {
|
|
97
98
|
if (!b.value) return;
|
|
98
99
|
const l = I.value;
|
|
99
100
|
l && (l.focus(), document.activeElement === l) || e > 0 && requestAnimationFrame(() => ee(e - 1));
|
|
100
101
|
});
|
|
101
102
|
}
|
|
102
103
|
function he(e, l) {
|
|
103
|
-
l || (
|
|
104
|
+
l || (r.value = e);
|
|
104
105
|
}
|
|
105
106
|
function pe(e) {
|
|
106
107
|
switch (e.key) {
|
|
107
108
|
case "ArrowDown":
|
|
108
|
-
e.preventDefault(),
|
|
109
|
+
e.preventDefault(), r.value = Z(r.value, 1);
|
|
109
110
|
break;
|
|
110
111
|
case "ArrowUp":
|
|
111
|
-
e.preventDefault(),
|
|
112
|
+
e.preventDefault(), r.value = r.value === -1 ? Y() : Z(r.value, -1);
|
|
112
113
|
break;
|
|
113
114
|
case "Home":
|
|
114
|
-
e.preventDefault(),
|
|
115
|
+
e.preventDefault(), r.value = me();
|
|
115
116
|
break;
|
|
116
117
|
case "End":
|
|
117
|
-
e.preventDefault(),
|
|
118
|
+
e.preventDefault(), r.value = Y();
|
|
118
119
|
break;
|
|
119
120
|
case "Enter":
|
|
120
121
|
case " ": {
|
|
121
|
-
const l = s.options[
|
|
122
|
+
const l = s.options[r.value];
|
|
122
123
|
if (!l) break;
|
|
123
124
|
e.preventDefault(), te(l);
|
|
124
125
|
break;
|
|
@@ -128,17 +129,17 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
128
129
|
function te(e) {
|
|
129
130
|
if (!(e.disabled || s.disabled)) {
|
|
130
131
|
if (s.multiple) {
|
|
131
|
-
const l =
|
|
132
|
-
$.value = l,
|
|
132
|
+
const l = R(e.value) ? _.value.filter((t) => t !== e.value) : [..._.value, e.value];
|
|
133
|
+
$.value = l, C("change", l);
|
|
133
134
|
} else
|
|
134
|
-
$.value = e.value,
|
|
135
|
-
|
|
135
|
+
$.value = e.value, C("change", e.value), b.value = !1;
|
|
136
|
+
C("select", e);
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
function ge(e) {
|
|
139
140
|
if (s.disabled) return;
|
|
140
|
-
const l =
|
|
141
|
-
$.value = l,
|
|
141
|
+
const l = _.value.filter((t) => t !== e);
|
|
142
|
+
$.value = l, C("change", l);
|
|
142
143
|
}
|
|
143
144
|
function z() {
|
|
144
145
|
if (!s.multiple) return;
|
|
@@ -163,7 +164,7 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
163
164
|
let T;
|
|
164
165
|
$e(() => {
|
|
165
166
|
const e = P.value;
|
|
166
|
-
e && (O.value = e.getBoundingClientRect().width,
|
|
167
|
+
e && (O.value = e.getBoundingClientRect().width, B(z), T = new ResizeObserver((l) => {
|
|
167
168
|
for (const t of l)
|
|
168
169
|
t.target === e && (O.value = t.borderBoxSize?.[0]?.inlineSize ?? e.getBoundingClientRect().width);
|
|
169
170
|
z();
|
|
@@ -171,18 +172,18 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
171
172
|
}), xe(() => T?.disconnect()), w(
|
|
172
173
|
() => h.value.map((e) => e.value).join("|"),
|
|
173
174
|
() => {
|
|
174
|
-
m.value = Number.MAX_SAFE_INTEGER,
|
|
175
|
+
m.value = Number.MAX_SAFE_INTEGER, B(z);
|
|
175
176
|
}
|
|
176
177
|
);
|
|
177
178
|
let le = null;
|
|
178
179
|
return w(b, (e) => {
|
|
179
|
-
e ? (le = document.activeElement,
|
|
180
|
+
e ? (le = document.activeElement, r.value = -1) : (r.value = -1, le?.focus());
|
|
180
181
|
}), w(I, (e) => {
|
|
181
182
|
e && b.value && ee();
|
|
182
|
-
}), w(
|
|
183
|
-
e !== -1 &&
|
|
183
|
+
}), w(r, (e) => {
|
|
184
|
+
e !== -1 && B(() => {
|
|
184
185
|
I.value?.querySelector(
|
|
185
|
-
`#${CSS.escape(`${
|
|
186
|
+
`#${CSS.escape(`${k}-option-${e}`)}`
|
|
186
187
|
)?.scrollIntoView({ block: "nearest" });
|
|
187
188
|
});
|
|
188
189
|
}), w(
|
|
@@ -190,19 +191,26 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
190
191
|
(e) => {
|
|
191
192
|
e && (b.value = !1);
|
|
192
193
|
}
|
|
193
|
-
), (e, l) => (
|
|
194
|
-
a.label ? (
|
|
194
|
+
), (e, l) => (n(), u("div", f({ class: be.value }, { ...ue.value, ...o(c)("root") }), [
|
|
195
|
+
a.label ? (n(), u("label", f({
|
|
195
196
|
key: 0,
|
|
196
197
|
id: H,
|
|
197
198
|
class: "select__label",
|
|
198
199
|
for: j
|
|
199
|
-
},
|
|
200
|
+
}, o(c)("label")), [
|
|
201
|
+
N(v(a.label) + " ", 1),
|
|
202
|
+
a.required ? (n(), u("span", f({
|
|
203
|
+
key: 0,
|
|
204
|
+
class: "select__required",
|
|
205
|
+
"aria-hidden": "true"
|
|
206
|
+
}, o(c)("required")), "*", 16)) : y("", !0)
|
|
207
|
+
], 16)) : y("", !0),
|
|
200
208
|
g("div", f({
|
|
201
209
|
ref_key: "fieldRef",
|
|
202
210
|
ref: P,
|
|
203
211
|
class: "select__field"
|
|
204
|
-
},
|
|
205
|
-
|
|
212
|
+
}, o(c)("field")), [
|
|
213
|
+
q(o(Te), {
|
|
206
214
|
open: b.value,
|
|
207
215
|
"onUpdate:open": l[0] || (l[0] = (t) => b.value = t),
|
|
208
216
|
width: fe.value,
|
|
@@ -213,34 +221,36 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
213
221
|
arrow: !1,
|
|
214
222
|
"breakpoint-mobile": a.breakpointMobile,
|
|
215
223
|
"trigger-has-popup": "listbox",
|
|
216
|
-
"trigger-controls":
|
|
224
|
+
"trigger-controls": k,
|
|
217
225
|
"test-id": a.testId
|
|
218
226
|
}, {
|
|
219
227
|
trigger: X(({ props: t }) => [
|
|
220
228
|
g("button", f({
|
|
221
229
|
id: j,
|
|
222
230
|
type: "button",
|
|
231
|
+
role: "combobox",
|
|
223
232
|
class: "select__trigger",
|
|
224
233
|
disabled: a.disabled,
|
|
225
234
|
"aria-labelledby": a.label ? H : void 0,
|
|
226
235
|
"aria-label": a.label ? void 0 : a.ariaLabel,
|
|
227
|
-
"aria-describedby": G.value ? K : void 0
|
|
236
|
+
"aria-describedby": G.value ? K : void 0,
|
|
237
|
+
"aria-required": a.required || void 0
|
|
228
238
|
}, {
|
|
229
239
|
...t,
|
|
230
|
-
...
|
|
231
|
-
...
|
|
240
|
+
...ce.value,
|
|
241
|
+
...o(c)("trigger")
|
|
232
242
|
}), [
|
|
233
|
-
|
|
243
|
+
q(Ne, null, {
|
|
234
244
|
default: X(() => [
|
|
235
|
-
|
|
245
|
+
N(v(de.value), 1)
|
|
236
246
|
]),
|
|
237
247
|
_: 1
|
|
238
248
|
})
|
|
239
|
-
], 16,
|
|
249
|
+
], 16, De)
|
|
240
250
|
]),
|
|
241
251
|
default: X(() => [
|
|
242
252
|
g("div", {
|
|
243
|
-
id:
|
|
253
|
+
id: k,
|
|
244
254
|
ref_key: "listRef",
|
|
245
255
|
ref: I,
|
|
246
256
|
role: "listbox",
|
|
@@ -251,46 +261,46 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
251
261
|
class: "select-list",
|
|
252
262
|
onKeydown: pe
|
|
253
263
|
}, [
|
|
254
|
-
(
|
|
255
|
-
id: `${
|
|
264
|
+
(n(!0), u(ie, null, re(a.options, (t, i) => (n(), u("div", f({
|
|
265
|
+
id: `${k}-option-${i}`,
|
|
256
266
|
key: t.value,
|
|
257
267
|
role: "option",
|
|
258
268
|
class: ["select-list__option", {
|
|
259
|
-
"select-list__option--active":
|
|
269
|
+
"select-list__option--active": r.value === i,
|
|
260
270
|
"select-list__option--disabled": t.disabled
|
|
261
271
|
}],
|
|
262
|
-
"aria-selected":
|
|
272
|
+
"aria-selected": R(t.value),
|
|
263
273
|
"aria-disabled": t.disabled || void 0
|
|
264
|
-
}, { ref_for: !0 },
|
|
274
|
+
}, { ref_for: !0 }, o(c)("option", t.value), {
|
|
265
275
|
onClick: (p) => te(t),
|
|
266
276
|
onMouseenter: (p) => he(i, t.disabled)
|
|
267
277
|
}), [
|
|
268
|
-
a.multiple ? (
|
|
278
|
+
a.multiple ? (n(), U(qe, {
|
|
269
279
|
key: 0,
|
|
270
|
-
checked:
|
|
280
|
+
checked: R(t.value),
|
|
271
281
|
disabled: t.disabled,
|
|
272
|
-
state:
|
|
273
|
-
}, null, 8, ["checked", "disabled", "state"])) : (
|
|
282
|
+
state: r.value === i ? "hover" : "default"
|
|
283
|
+
}, null, 8, ["checked", "disabled", "state"])) : (n(), U(o(Ve), {
|
|
274
284
|
key: 1,
|
|
275
|
-
checked:
|
|
285
|
+
checked: R(t.value),
|
|
276
286
|
disabled: t.disabled,
|
|
277
|
-
state:
|
|
287
|
+
state: r.value === i ? "hover" : "default"
|
|
278
288
|
}, null, 8, ["checked", "disabled", "state"])),
|
|
279
289
|
D(e.$slots, "option", {
|
|
280
290
|
option: t,
|
|
281
|
-
selected:
|
|
282
|
-
active:
|
|
291
|
+
selected: R(t.value),
|
|
292
|
+
active: r.value === i,
|
|
283
293
|
index: i
|
|
284
294
|
}, () => [
|
|
285
|
-
g("span",
|
|
295
|
+
g("span", Ge, v(t.label), 1)
|
|
286
296
|
], !0)
|
|
287
|
-
], 16,
|
|
288
|
-
a.options.length ?
|
|
297
|
+
], 16, Oe))), 128)),
|
|
298
|
+
a.options.length ? y("", !0) : (n(), u("p", We, [
|
|
289
299
|
D(e.$slots, "empty", {}, () => [
|
|
290
|
-
|
|
300
|
+
N(v(Ke))
|
|
291
301
|
], !0)
|
|
292
302
|
]))
|
|
293
|
-
], 40,
|
|
303
|
+
], 40, Fe)
|
|
294
304
|
]),
|
|
295
305
|
_: 3
|
|
296
306
|
}, 8, ["open", "width", "side", "side-offset", "align", "align-offset", "breakpoint-mobile", "test-id"]),
|
|
@@ -299,35 +309,35 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
299
309
|
ref: A,
|
|
300
310
|
class: "select__content"
|
|
301
311
|
}, [
|
|
302
|
-
a.multiple && h.value.length ? (
|
|
312
|
+
a.multiple && h.value.length ? (n(), u("span", {
|
|
303
313
|
key: 0,
|
|
304
314
|
ref_key: "chipsRef",
|
|
305
315
|
ref: J,
|
|
306
316
|
class: "select__chips"
|
|
307
317
|
}, [
|
|
308
|
-
(
|
|
318
|
+
(n(!0), u(ie, null, re(h.value, (t, i) => (n(), u("span", f({
|
|
309
319
|
key: t.value,
|
|
310
320
|
"data-chip": "item",
|
|
311
321
|
class: ["select__chip", {
|
|
312
322
|
"select__chip--measured": i >= m.value
|
|
313
323
|
}],
|
|
314
324
|
"aria-hidden": i >= m.value || void 0
|
|
315
|
-
}, { ref_for: !0 },
|
|
325
|
+
}, { ref_for: !0 }, o(c)("chip", t.value)), [
|
|
316
326
|
D(e.$slots, "chip", {
|
|
317
327
|
option: t,
|
|
318
328
|
index: i
|
|
319
329
|
}, () => [
|
|
320
|
-
t.avatar ? (
|
|
330
|
+
t.avatar ? (n(), u("img", {
|
|
321
331
|
key: 0,
|
|
322
332
|
class: "select__chip-avatar",
|
|
323
333
|
src: t.avatar,
|
|
324
334
|
alt: ""
|
|
325
|
-
}, null, 8,
|
|
335
|
+
}, null, 8, Le)) : t.icon ? (n(), U(Ie(t.icon), {
|
|
326
336
|
key: 1,
|
|
327
337
|
class: "select__chip-icon",
|
|
328
338
|
"aria-hidden": "true"
|
|
329
|
-
})) :
|
|
330
|
-
g("span",
|
|
339
|
+
})) : y("", !0),
|
|
340
|
+
g("span", Xe, v(t.label), 1)
|
|
331
341
|
], !0),
|
|
332
342
|
g("button", f({
|
|
333
343
|
type: "button",
|
|
@@ -335,44 +345,44 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
|
|
|
335
345
|
disabled: a.disabled,
|
|
336
346
|
tabindex: i >= m.value ? -1 : void 0,
|
|
337
347
|
"aria-label": `Убрать ${t.label}`
|
|
338
|
-
}, { ref_for: !0 },
|
|
348
|
+
}, { ref_for: !0 }, o(c)("chip-remove", t.value), {
|
|
339
349
|
onClick: Ae((p) => ge(t.value), ["stop"])
|
|
340
350
|
}), [
|
|
341
|
-
|
|
351
|
+
q(o(Me), {
|
|
342
352
|
class: "select__chip-icon",
|
|
343
353
|
"aria-hidden": "true"
|
|
344
354
|
})
|
|
345
355
|
], 16, Ue)
|
|
346
|
-
], 16,
|
|
347
|
-
], 512)) :
|
|
348
|
-
a.multiple && h.value.length ? (
|
|
356
|
+
], 16, ze))), 128))
|
|
357
|
+
], 512)) : y("", !0),
|
|
358
|
+
a.multiple && h.value.length ? (n(), u("span", f({
|
|
349
359
|
key: 1,
|
|
350
360
|
ref_key: "counterRef",
|
|
351
361
|
ref: Q,
|
|
352
362
|
class: ["select__chip select__chip--counter", { "select__chip--measured": !E.value }],
|
|
353
363
|
"aria-hidden": !E.value || void 0
|
|
354
|
-
},
|
|
364
|
+
}, o(c)("chip-counter")), " +" + v(E.value || 1), 17, je)) : M.value ? (n(), u("span", f({
|
|
355
365
|
key: 2,
|
|
356
366
|
class: "select__value"
|
|
357
|
-
},
|
|
367
|
+
}, o(c)("value")), [
|
|
358
368
|
D(e.$slots, "value", {
|
|
359
369
|
option: h.value[0],
|
|
360
370
|
displayValue: M.value
|
|
361
371
|
}, () => [
|
|
362
|
-
|
|
372
|
+
N(v(M.value), 1)
|
|
363
373
|
], !0)
|
|
364
|
-
], 16)) : (
|
|
374
|
+
], 16)) : (n(), u("span", He, v(a.placeholder), 1))
|
|
365
375
|
], 512),
|
|
366
|
-
|
|
376
|
+
q(o(Ee), {
|
|
367
377
|
class: "select__arrow",
|
|
368
378
|
"aria-hidden": "true"
|
|
369
379
|
})
|
|
370
380
|
], 16),
|
|
371
|
-
G.value ? (
|
|
381
|
+
G.value ? (n(), u("p", f({
|
|
372
382
|
key: 1,
|
|
373
383
|
id: K,
|
|
374
384
|
class: "select__message"
|
|
375
|
-
},
|
|
385
|
+
}, o(c)("message")), v(G.value), 17)) : y("", !0)
|
|
376
386
|
], 16));
|
|
377
387
|
}
|
|
378
388
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
2
2
|
export type ToastVariant = 'info' | 'success' | 'warning' | 'error';
|
|
3
3
|
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
4
4
|
/** Направление свайпа, которым тост закрывается. `none` — свайп отключён. */
|
|
@@ -55,7 +55,7 @@ export interface ToasterProps {
|
|
|
55
55
|
limit?: number;
|
|
56
56
|
zIndex?: number;
|
|
57
57
|
/** Брейкпоинт, ниже которого стек занимает всю ширину экрана. */
|
|
58
|
-
breakpointMobile?:
|
|
58
|
+
breakpointMobile?: TBreakpointMobile;
|
|
59
59
|
/** Направление свайпа. По умолчанию выводится из `position`. */
|
|
60
60
|
swipeDirection?: ToastSwipeDirection;
|
|
61
61
|
/** Доступное имя области с уведомлениями (`aria-label`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.toaster[data-v-
|
|
1
|
+
.toaster[data-v-ad45c627]{width:23.75rem;max-width:calc(100vw - var(--toaster-offset) * 2);z-index:var(--toaster-z-index);pointer-events:none;flex-direction:column;gap:.5rem;display:flex;position:fixed}.toaster[data-v-ad45c627]>*{pointer-events:auto}.toaster--top[data-v-ad45c627]{top:var(--toaster-offset)}.toaster--bottom[data-v-ad45c627]{bottom:var(--toaster-offset);flex-direction:column-reverse}.toaster--left[data-v-ad45c627]{left:var(--toaster-offset)}.toaster--right[data-v-ad45c627]{right:var(--toaster-offset)}.toaster--center[data-v-ad45c627]{left:50%;transform:translate(-50%)}.toaster--mobile[data-v-ad45c627]{width:auto;max-width:none;left:var(--toaster-offset);right:var(--toaster-offset);transform:none}.toast-enter-from[data-v-ad45c627],.toast-leave-to[data-v-ad45c627]{opacity:0;transform:var(--toaster-slide)}.toast-enter-active[data-v-ad45c627],.toast-leave-active[data-v-ad45c627],.toast-move[data-v-ad45c627]{transition:transform var(--animation-duration) ease, opacity var(--animation-duration) ease}.toast-leave-active[data-v-ad45c627]{width:100%;position:absolute}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ToasterProps, ToastSwipeDirection, ToastPosition } from './Toast.types';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
4
4
|
declare const _default: DefineComponent<ToasterProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
5
5
|
label: string;
|
|
6
6
|
offset: number;
|
|
7
7
|
position: ToastPosition;
|
|
8
8
|
zIndex: number;
|
|
9
|
-
breakpointMobile:
|
|
9
|
+
breakpointMobile: TBreakpointMobile;
|
|
10
10
|
swipeDirection: ToastSwipeDirection;
|
|
11
11
|
testId: string;
|
|
12
12
|
limit: number;
|
|
@@ -2,7 +2,7 @@ import './Toaster.css';
|
|
|
2
2
|
import o from "./Toaster.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ad45c627"]]);
|
|
6
6
|
export {
|
|
7
7
|
p as default
|
|
8
8
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import W from "../shared/
|
|
1
|
+
import { defineComponent as F, ref as k, computed as o, onMounted as x, onBeforeUnmount as L, watch as B, openBlock as i, createBlock as b, withCtx as T, createElementBlock as w, mergeProps as C, unref as a, createVNode as D, TransitionGroup as z, Fragment as E, renderList as Y, createCommentVNode as O } from "vue";
|
|
2
|
+
import P from "../shared/Portal.vue.js";
|
|
3
|
+
import { useIsMobile as W } from "../shared/useIsMobile.util.js";
|
|
4
4
|
import { useTestId as X } from "../shared/useTestId.util.js";
|
|
5
5
|
import A from "./Toast.vue.js";
|
|
6
6
|
import { TOAST_DEFAULT_LIMIT as N, useToast as U } from "./useToast.js";
|
|
7
|
-
const V = ["aria-label"], G = 10, Z = /* @__PURE__ */
|
|
7
|
+
const V = ["aria-label"], G = 10, Z = /* @__PURE__ */ F({
|
|
8
8
|
__name: "Toaster",
|
|
9
9
|
props: {
|
|
10
10
|
position: { default: "top-right" },
|
|
11
11
|
offset: { default: 24 },
|
|
12
12
|
limit: { default: N },
|
|
13
13
|
zIndex: { default: 9999 },
|
|
14
|
-
breakpointMobile: { default: "sm" },
|
|
14
|
+
breakpointMobile: { type: [String, Boolean], default: "sm" },
|
|
15
15
|
swipeDirection: { default: void 0 },
|
|
16
16
|
label: { default: "Уведомления" },
|
|
17
17
|
closeLabel: { default: void 0 },
|
|
18
18
|
testId: { default: void 0 }
|
|
19
19
|
},
|
|
20
20
|
setup(r) {
|
|
21
|
-
const s =
|
|
21
|
+
const s = k([]), t = r, { toasts: h, dismiss: M, pause: f, resume: v, setLimit: g } = U(), I = X(() => t.testId), l = /* @__PURE__ */ Symbol("toaster"), _ = o(
|
|
22
22
|
() => s.value[0] === l
|
|
23
23
|
);
|
|
24
|
-
|
|
24
|
+
x(() => {
|
|
25
25
|
s.value = [...s.value, l], s.value.length > 1 && console.warn(
|
|
26
26
|
"[Toaster] Смонтировано несколько Toaster — очередь тостов общая, поэтому лишние экземпляры не отрисовываются. Оставьте один Toaster на приложение."
|
|
27
27
|
);
|
|
@@ -30,9 +30,9 @@ const V = ["aria-label"], G = 10, Z = /* @__PURE__ */ S({
|
|
|
30
30
|
(m) => m !== l
|
|
31
31
|
);
|
|
32
32
|
});
|
|
33
|
-
const u =
|
|
33
|
+
const u = W(t.breakpointMobile), c = o(
|
|
34
34
|
() => t.position.startsWith("bottom") ? "bottom" : "top"
|
|
35
|
-
), d = o(() => t.position.endsWith("left") ? "left" : t.position.endsWith("center") ? "center" : "right"), p = o(() => t.swipeDirection ? t.swipeDirection : u.value || d.value === "center" ? c.value === "top" ? "up" : "down" : d.value === "left" ? "left" : "right"),
|
|
35
|
+
), d = o(() => t.position.endsWith("left") ? "left" : t.position.endsWith("center") ? "center" : "right"), p = o(() => t.swipeDirection ? t.swipeDirection : u.value || d.value === "center" ? c.value === "top" ? "up" : "down" : d.value === "left" ? "left" : "right"), S = o(() => {
|
|
36
36
|
switch (p.value) {
|
|
37
37
|
case "right":
|
|
38
38
|
return "translateX(120%)";
|
|
@@ -45,25 +45,25 @@ const V = ["aria-label"], G = 10, Z = /* @__PURE__ */ S({
|
|
|
45
45
|
default:
|
|
46
46
|
return c.value === "top" ? "translateY(-120%)" : "translateY(120%)";
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
48
|
+
}), $ = o(() => [
|
|
49
49
|
"toaster",
|
|
50
50
|
`toaster--${c.value}`,
|
|
51
51
|
`toaster--${d.value}`,
|
|
52
52
|
{ "toaster--mobile": u.value }
|
|
53
|
-
]),
|
|
53
|
+
]), y = o(() => ({
|
|
54
54
|
"--toaster-offset": `${u.value ? G : t.offset}px`,
|
|
55
55
|
"--toaster-z-index": String(t.zIndex),
|
|
56
|
-
"--toaster-slide":
|
|
56
|
+
"--toaster-slide": S.value
|
|
57
57
|
}));
|
|
58
|
-
return
|
|
58
|
+
return B(() => t.limit, g, { immediate: !0 }), (m, K) => (i(), b(P, null, {
|
|
59
59
|
default: T(() => [
|
|
60
|
-
|
|
60
|
+
_.value ? (i(), w("div", C({
|
|
61
61
|
key: 0,
|
|
62
|
-
class:
|
|
63
|
-
style:
|
|
62
|
+
class: $.value,
|
|
63
|
+
style: y.value,
|
|
64
64
|
role: "region",
|
|
65
65
|
"aria-label": r.label
|
|
66
|
-
}, a(
|
|
66
|
+
}, a(I)("viewport")), [
|
|
67
67
|
D(z, { name: "toast" }, {
|
|
68
68
|
default: T(() => [
|
|
69
69
|
(i(!0), w(E, null, Y(a(h), (e) => (i(), b(A, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.tooltip-trigger[data-v-
|
|
1
|
+
.tooltip-trigger[data-v-06f091c9]{width:fit-content;display:inline-block}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
2
2
|
export type TooltipSide = 'top' | 'right' | 'bottom' | 'left';
|
|
3
3
|
export type TooltipAlign = 'start' | 'center' | 'end';
|
|
4
4
|
export interface TooltipProps {
|
|
@@ -29,7 +29,7 @@ export interface TooltipProps {
|
|
|
29
29
|
disabled?: boolean;
|
|
30
30
|
zIndex?: number | 'auto';
|
|
31
31
|
/** Ширина, ниже которой подсказка открывается шторкой снизу. */
|
|
32
|
-
breakpointMobile?:
|
|
32
|
+
breakpointMobile?: TBreakpointMobile;
|
|
33
33
|
/** Доступное имя шторки на мобильных (`aria-label`). */
|
|
34
34
|
mobileLabel?: string;
|
|
35
35
|
/** Базовый `data-testid`; внутренние части получают суффикс имени части. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TooltipProps, TooltipSide, TooltipAlign } from './Tooltip.types';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
4
4
|
type __VLS_Props = TooltipProps;
|
|
5
5
|
type __VLS_PublicProps = {
|
|
6
6
|
'open'?: boolean;
|
|
@@ -29,7 +29,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
|
|
|
29
29
|
sideOffset: number;
|
|
30
30
|
align: TooltipAlign;
|
|
31
31
|
alignOffset: number;
|
|
32
|
-
breakpointMobile:
|
|
32
|
+
breakpointMobile: TBreakpointMobile;
|
|
33
33
|
arrow: boolean;
|
|
34
34
|
testId: string;
|
|
35
35
|
maxWidth: number | string;
|
|
@@ -2,7 +2,7 @@ import './Tooltip.css';
|
|
|
2
2
|
import o from "./Tooltip.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-06f091c9"]]);
|
|
6
6
|
export {
|
|
7
7
|
m as default
|
|
8
8
|
};
|