@profitliga/ui 2.0.2 → 2.0.4
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/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 +28 -2
- package/dist/components/v2/Combobox/Combobox.vue.d.ts +3 -2
- package/dist/components/v2/Combobox/Combobox.vue.js +1 -1
- package/dist/components/v2/Combobox/Combobox.vue2.js +305 -251
- 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.css +1 -1
- package/dist/components/v2/Divider/Divider.types.d.ts +8 -0
- package/dist/components/v2/Divider/Divider.vue.js +2 -2
- 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/Input/Input.css +1 -1
- package/dist/components/v2/Input/Input.vue.js +2 -2
- package/dist/components/v2/Input/Input.vue2.js +113 -107
- 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 +2 -2
- package/dist/components/v2/Popover/Popover.vue.d.ts +2 -2
- package/dist/components/v2/Popover/Popover.vue.js +2 -2
- package/dist/components/v2/Popover/Popover.vue2.js +24 -24
- 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 +55 -55
- 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 +143 -127
- 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,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
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as g, useModel as p, useId as v, useTemplateRef as h, shallowRef as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import R from "
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as g, useModel as p, useId as v, useTemplateRef as h, shallowRef as y, watchEffect as m, watch as M, onBeforeUnmount as w, openBlock as k, createElementBlock as x, Fragment as C, createElementVNode as I, mergeProps as D, unref as t, renderSlot as b, createVNode as E, withCtx as O, createTextVNode as P, toDisplayString as B, mergeModels as F } from "vue";
|
|
2
|
+
import { isHtmlElement as T } from "../shared/isHtmlElement.util.js";
|
|
3
|
+
import { useIsMobile as L } from "../shared/useIsMobile.util.js";
|
|
4
|
+
import { useTestId as R } from "../shared/useTestId.util.js";
|
|
5
|
+
import z from "./TooltipContent.vue.js";
|
|
6
|
+
import { createTooltipControl as $ } from "./tooltipControl.util.js";
|
|
7
|
+
const j = /* @__PURE__ */ g({
|
|
7
8
|
inheritAttrs: !1,
|
|
8
9
|
__name: "Tooltip",
|
|
9
10
|
props: /* @__PURE__ */ F({
|
|
@@ -18,7 +19,7 @@ const H = /* @__PURE__ */ g({
|
|
|
18
19
|
closeDelay: { default: 100 },
|
|
19
20
|
disabled: { type: Boolean, default: !1 },
|
|
20
21
|
zIndex: { default: "auto" },
|
|
21
|
-
breakpointMobile: { default: "sm" },
|
|
22
|
+
breakpointMobile: { type: [String, Boolean], default: "sm" },
|
|
22
23
|
mobileLabel: { default: "Подсказка" },
|
|
23
24
|
testId: { default: void 0 }
|
|
24
25
|
}, {
|
|
@@ -26,35 +27,35 @@ const H = /* @__PURE__ */ g({
|
|
|
26
27
|
openModifiers: {}
|
|
27
28
|
}),
|
|
28
29
|
emits: ["update:open"],
|
|
29
|
-
setup(
|
|
30
|
-
const a =
|
|
30
|
+
setup(n) {
|
|
31
|
+
const a = n, s = p(n, "open"), d = `tooltip-content-${v()}`, c = R(() => a.testId), u = h("triggerRef"), f = L(a.breakpointMobile), e = $({
|
|
31
32
|
isOpen: () => s.value,
|
|
32
|
-
setOpen: (
|
|
33
|
-
s.value =
|
|
33
|
+
setOpen: (l) => {
|
|
34
|
+
s.value = l;
|
|
34
35
|
},
|
|
35
36
|
openDelay: () => a.openDelay,
|
|
36
37
|
closeDelay: () => a.closeDelay,
|
|
37
38
|
disabled: () => a.disabled,
|
|
38
39
|
isMobile: () => f.value
|
|
39
|
-
}),
|
|
40
|
+
}), r = y(null);
|
|
40
41
|
return m(() => {
|
|
41
42
|
s.value;
|
|
42
|
-
const
|
|
43
|
-
|
|
43
|
+
const l = u.value, o = l?.firstElementChild;
|
|
44
|
+
r.value = T(o) ? o : l ?? null;
|
|
44
45
|
}), m(() => {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
}),
|
|
46
|
+
const l = r.value;
|
|
47
|
+
l && (s.value && !f.value ? l.setAttribute("aria-describedby", d) : l.removeAttribute("aria-describedby"));
|
|
48
|
+
}), M(
|
|
48
49
|
() => a.disabled,
|
|
49
|
-
(
|
|
50
|
-
|
|
50
|
+
(l) => {
|
|
51
|
+
l && e.close();
|
|
51
52
|
}
|
|
52
|
-
), w(e.destroy), (
|
|
53
|
+
), w(e.destroy), (l, o) => (k(), x(C, null, [
|
|
53
54
|
I("span", D({
|
|
54
55
|
ref_key: "triggerRef",
|
|
55
56
|
ref: u,
|
|
56
57
|
class: "tooltip-trigger"
|
|
57
|
-
}, { ...
|
|
58
|
+
}, { ...l.$attrs, ...t(c)("trigger") }, {
|
|
58
59
|
onMouseenter: o[0] || (o[0] = //@ts-ignore
|
|
59
60
|
(...i) => t(e).handleMouseEnter && t(e).handleMouseEnter(...i)),
|
|
60
61
|
onMouseleave: o[1] || (o[1] = //@ts-ignore
|
|
@@ -68,29 +69,29 @@ const H = /* @__PURE__ */ g({
|
|
|
68
69
|
onClick: o[5] || (o[5] = //@ts-ignore
|
|
69
70
|
(...i) => t(e).handleClick && t(e).handleClick(...i))
|
|
70
71
|
}), [
|
|
71
|
-
b(
|
|
72
|
+
b(l.$slots, "trigger", {}, void 0, !0)
|
|
72
73
|
], 16),
|
|
73
|
-
E(
|
|
74
|
-
anchor:
|
|
75
|
-
"content-id":
|
|
74
|
+
E(z, {
|
|
75
|
+
anchor: r.value,
|
|
76
|
+
"content-id": d,
|
|
76
77
|
open: s.value,
|
|
77
|
-
side:
|
|
78
|
-
"side-offset":
|
|
79
|
-
align:
|
|
80
|
-
"align-offset":
|
|
81
|
-
arrow:
|
|
82
|
-
"max-width":
|
|
83
|
-
"z-index":
|
|
84
|
-
"breakpoint-mobile":
|
|
85
|
-
"mobile-label":
|
|
86
|
-
"test-id":
|
|
78
|
+
side: n.side,
|
|
79
|
+
"side-offset": n.sideOffset,
|
|
80
|
+
align: n.align,
|
|
81
|
+
"align-offset": n.alignOffset,
|
|
82
|
+
arrow: n.arrow,
|
|
83
|
+
"max-width": n.maxWidth,
|
|
84
|
+
"z-index": n.zIndex,
|
|
85
|
+
"breakpoint-mobile": n.breakpointMobile,
|
|
86
|
+
"mobile-label": n.mobileLabel,
|
|
87
|
+
"test-id": n.testId,
|
|
87
88
|
onClose: t(e).close,
|
|
88
89
|
onPointerEnter: t(e).cancelTimers,
|
|
89
90
|
onPointerLeave: t(e).scheduleClose
|
|
90
91
|
}, {
|
|
91
92
|
default: O(() => [
|
|
92
|
-
b(
|
|
93
|
-
P(
|
|
93
|
+
b(l.$slots, "default", {}, () => [
|
|
94
|
+
P(B(n.text), 1)
|
|
94
95
|
], !0)
|
|
95
96
|
]),
|
|
96
97
|
_: 3
|
|
@@ -99,5 +100,5 @@ const H = /* @__PURE__ */ g({
|
|
|
99
100
|
}
|
|
100
101
|
});
|
|
101
102
|
export {
|
|
102
|
-
|
|
103
|
+
j as default
|
|
103
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.tooltip-sheet[data-v-
|
|
1
|
+
.tooltip-sheet[data-v-4699364e]{color:var(--theme-neutral-text-body);overflow-wrap:break-word;padding:8px 16px 24px;font-size:.875rem;line-height:22px}.tooltip-content[data-v-4699364e]{--tooltip-arrow-box:11.314px;--tooltip-arrow-depth:5.657px;z-index:1002;filter:drop-shadow(0 1px 1px #727272eb)drop-shadow(0 4px 8.8px #7272720d)drop-shadow(1px 5px 5px #7272726e);width:max-content;position:fixed}.tooltip-content[data-state=open][data-v-4699364e]{animation:fadeIn var(--animation-duration) ease-in-out}.tooltip-content[data-state=closed][data-v-4699364e]{animation:fadeOut var(--animation-duration) ease-in-out}.tooltip-content__body[data-v-4699364e]{word-break:break-word;color:var(--theme-neutral-0);background-color:var(--theme-neutral-700);border-radius:4px;padding:6px 8px;font-size:.875rem;font-weight:400;line-height:22px;display:block}.tooltip-content__arrow[data-v-4699364e]{display:flex;position:absolute;overflow:hidden}.tooltip-content__arrow-box[data-v-4699364e]{width:var(--tooltip-arrow-box);height:var(--tooltip-arrow-box);flex:none;justify-content:center;align-items:center;display:flex}.tooltip-content__arrow-beak[data-v-4699364e]{background-color:var(--theme-neutral-700);width:8px;height:8px;transform:rotate(45deg)}.tooltip-content--top .tooltip-content__arrow[data-v-4699364e]{width:var(--tooltip-arrow-box);height:var(--tooltip-arrow-depth);align-items:flex-end;top:100%}.tooltip-content--top .tooltip-content__arrow-beak[data-v-4699364e]{border-bottom-right-radius:2px}.tooltip-content--bottom .tooltip-content__arrow[data-v-4699364e]{width:var(--tooltip-arrow-box);height:var(--tooltip-arrow-depth);align-items:flex-start;bottom:100%}.tooltip-content--bottom .tooltip-content__arrow-beak[data-v-4699364e]{border-top-left-radius:2px}.tooltip-content--left .tooltip-content__arrow[data-v-4699364e]{width:var(--tooltip-arrow-depth);height:var(--tooltip-arrow-box);justify-content:flex-end;left:100%}.tooltip-content--left .tooltip-content__arrow-beak[data-v-4699364e]{border-top-right-radius:2px}.tooltip-content--right .tooltip-content__arrow[data-v-4699364e]{width:var(--tooltip-arrow-depth);height:var(--tooltip-arrow-box);justify-content:flex-start;right:100%}.tooltip-content--right .tooltip-content__arrow-beak[data-v-4699364e]{border-bottom-left-radius:2px}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TooltipContentProps, 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
|
declare function __VLS_template(): {
|
|
5
5
|
attrs: Partial<{}>;
|
|
6
6
|
slots: {
|
|
@@ -28,7 +28,7 @@ declare const __VLS_component: DefineComponent<TooltipContentProps, {}, {}, {},
|
|
|
28
28
|
sideOffset: number;
|
|
29
29
|
align: TooltipAlign;
|
|
30
30
|
alignOffset: number;
|
|
31
|
-
breakpointMobile:
|
|
31
|
+
breakpointMobile: TBreakpointMobile;
|
|
32
32
|
arrow: boolean;
|
|
33
33
|
testId: string;
|
|
34
34
|
maxWidth: number | string;
|
|
@@ -2,7 +2,7 @@ import './TooltipContent.css';
|
|
|
2
2
|
import o from "./TooltipContent.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4699364e"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as Z, computed as B, ref as A, reactive as S, watch as tt, onBeforeUnmount as et, unref as d, openBlock as $, createBlock as D, withCtx as _, createElementVNode as u, mergeProps as O, renderSlot as P, createTextVNode as U, toDisplayString as F, createElementBlock as ot, createCommentVNode as G, nextTick as nt } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import lt from "../
|
|
5
|
-
import
|
|
6
|
-
import rt from "../shared/
|
|
7
|
-
import {
|
|
2
|
+
import { onClickOutside as it } from "../../../utils/onClickOutside.util.js";
|
|
3
|
+
import st from "../BottomSheet/BottomSheet.vue.js";
|
|
4
|
+
import { ANIMATION_DURATION_MS as lt } from "../shared/animation.const.js";
|
|
5
|
+
import at from "../shared/Portal.vue.js";
|
|
6
|
+
import { useDelayedVisibility as rt } from "../shared/useDelayedVisibility.util.js";
|
|
7
|
+
import { useIsMobile as dt } from "../shared/useIsMobile.util.js";
|
|
8
8
|
import { useTestId as ft } from "../shared/useTestId.util.js";
|
|
9
9
|
const ct = ["id", "data-state"], C = 11.314, T = 16, p = 8, Ot = /* @__PURE__ */ Z({
|
|
10
10
|
__name: "TooltipContent",
|
|
@@ -20,13 +20,13 @@ const ct = ["id", "data-state"], C = 11.314, T = 16, p = 8, Ot = /* @__PURE__ */
|
|
|
20
20
|
arrow: { type: Boolean, default: !0 },
|
|
21
21
|
maxWidth: { default: 320 },
|
|
22
22
|
zIndex: { default: "auto" },
|
|
23
|
-
breakpointMobile: { default: "sm" },
|
|
23
|
+
breakpointMobile: { type: [String, Boolean], default: "sm" },
|
|
24
24
|
mobileLabel: { default: "Подсказка" },
|
|
25
25
|
testId: { default: void 0 }
|
|
26
26
|
},
|
|
27
27
|
emits: ["close", "pointerEnter", "pointerLeave"],
|
|
28
28
|
setup(a, { emit: H }) {
|
|
29
|
-
const t = a, m = H, w = ft(() => t.testId), W =
|
|
29
|
+
const t = a, m = H, w = ft(() => t.testId), W = dt(t.breakpointMobile), X = B(() => t.open && !W.value), y = A(null);
|
|
30
30
|
function j(o) {
|
|
31
31
|
o || m("close");
|
|
32
32
|
}
|
|
@@ -34,7 +34,7 @@ const ct = ["id", "data-state"], C = 11.314, T = 16, p = 8, Ot = /* @__PURE__ */
|
|
|
34
34
|
top: 0,
|
|
35
35
|
left: 0,
|
|
36
36
|
side: t.side
|
|
37
|
-
}), v = S({ width: 0, height: 0 }), g = S({ x: 0, y: 0 }),
|
|
37
|
+
}), v = S({ width: 0, height: 0 }), g = S({ x: 0, y: 0 }), E = A(!1);
|
|
38
38
|
function q() {
|
|
39
39
|
const o = t.anchor, i = y.value;
|
|
40
40
|
if (!o || !i) return;
|
|
@@ -55,13 +55,13 @@ const ct = ["id", "data-state"], C = 11.314, T = 16, p = 8, Ot = /* @__PURE__ */
|
|
|
55
55
|
p,
|
|
56
56
|
V - s.height - p
|
|
57
57
|
)
|
|
58
|
-
), l.top = f, l.left = c, l.side = n, v.width = s.width, v.height = s.height, g.x = e.left + e.width / 2, g.y = e.top + e.height / 2,
|
|
58
|
+
), l.top = f, l.left = c, l.side = n, v.width = s.width, v.height = s.height, g.x = e.left + e.width / 2, g.y = e.top + e.height / 2, E.value = !0;
|
|
59
59
|
}
|
|
60
60
|
const J = B(() => ({
|
|
61
61
|
top: `${l.top}px`,
|
|
62
62
|
left: `${l.left}px`,
|
|
63
63
|
maxWidth: typeof t.maxWidth == "number" ? `${t.maxWidth}px` : t.maxWidth,
|
|
64
|
-
visibility:
|
|
64
|
+
visibility: E.value ? void 0 : "hidden",
|
|
65
65
|
...t.zIndex !== "auto" ? { zIndex: t.zIndex } : {}
|
|
66
66
|
}));
|
|
67
67
|
function z(o, i) {
|
|
@@ -78,29 +78,29 @@ const ct = ["id", "data-state"], C = 11.314, T = 16, p = 8, Ot = /* @__PURE__ */
|
|
|
78
78
|
function r() {
|
|
79
79
|
nt(q);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function k(o) {
|
|
82
82
|
o.key === "Escape" && m("close");
|
|
83
83
|
}
|
|
84
|
-
const { visible: Q, dataState: Y } =
|
|
84
|
+
const { visible: Q, dataState: Y } = rt(
|
|
85
85
|
X,
|
|
86
|
-
|
|
86
|
+
lt,
|
|
87
87
|
{
|
|
88
88
|
onOpen: () => {
|
|
89
|
-
|
|
89
|
+
E.value = !1, document.addEventListener("keydown", k), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), r();
|
|
90
90
|
},
|
|
91
91
|
onCloseStart: () => {
|
|
92
|
-
document.removeEventListener("keydown",
|
|
92
|
+
document.removeEventListener("keydown", k), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
let b, h;
|
|
97
97
|
return tt(y, (o) => {
|
|
98
|
-
b?.(), h?.disconnect(), o ? (b =
|
|
98
|
+
b?.(), h?.disconnect(), o ? (b = it(o, () => m("close"), {
|
|
99
99
|
ignore: () => [t.anchor]
|
|
100
100
|
}), h = new ResizeObserver(r), h.observe(o)) : (b = void 0, h = void 0);
|
|
101
101
|
}), et(() => {
|
|
102
|
-
b?.(), h?.disconnect(), document.removeEventListener("keydown",
|
|
103
|
-
}), (o, i) => d(W) ? ($(), D(d(
|
|
102
|
+
b?.(), h?.disconnect(), document.removeEventListener("keydown", k), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
103
|
+
}), (o, i) => d(W) ? ($(), D(d(st), {
|
|
104
104
|
key: 0,
|
|
105
105
|
open: a.open,
|
|
106
106
|
label: a.mobileLabel,
|
|
@@ -115,7 +115,7 @@ const ct = ["id", "data-state"], C = 11.314, T = 16, p = 8, Ot = /* @__PURE__ */
|
|
|
115
115
|
], 16)
|
|
116
116
|
]),
|
|
117
117
|
_: 3
|
|
118
|
-
}, 8, ["open", "label", "test-id"])) : d(Q) ? ($(), D(
|
|
118
|
+
}, 8, ["open", "label", "test-id"])) : d(Q) ? ($(), D(at, { key: 1 }, {
|
|
119
119
|
default: _(() => [
|
|
120
120
|
u("div", O({
|
|
121
121
|
id: a.contentId,
|
|
@@ -4,29 +4,28 @@ import O from "./TooltipContent.vue.js";
|
|
|
4
4
|
import { createTooltipControl as v } from "./tooltipControl.util.js";
|
|
5
5
|
const L = ["top", "right", "bottom", "left"], h = ["start", "center", "end"], D = 200, M = 100, y = "sm", s = /* @__PURE__ */ new WeakMap();
|
|
6
6
|
let A = 0;
|
|
7
|
-
function
|
|
8
|
-
const
|
|
7
|
+
function d(o) {
|
|
8
|
+
const e = o.value, t = typeof e == "string" ? { text: e } : e ?? {}, n = L.find((i) => o.modifiers[i]), r = h.find((i) => o.modifiers[i]);
|
|
9
9
|
return {
|
|
10
10
|
...n ? { side: n } : {},
|
|
11
11
|
...r ? { align: r } : {},
|
|
12
12
|
...t
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function l(
|
|
16
|
-
return !
|
|
15
|
+
function l(o) {
|
|
16
|
+
return !o.disabled && !!o.text;
|
|
17
17
|
}
|
|
18
|
-
function m(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
);
|
|
18
|
+
function m(o) {
|
|
19
|
+
const e = o.breakpointMobile ?? y;
|
|
20
|
+
return e === !1 ? !1 : I.isSmaller(e);
|
|
22
21
|
}
|
|
23
|
-
function b(
|
|
24
|
-
const { options: t } =
|
|
22
|
+
function b(o, e) {
|
|
23
|
+
const { options: t } = e;
|
|
25
24
|
p(
|
|
26
25
|
E(O, {
|
|
27
|
-
anchor:
|
|
28
|
-
contentId:
|
|
29
|
-
open:
|
|
26
|
+
anchor: o,
|
|
27
|
+
contentId: e.contentId,
|
|
28
|
+
open: e.open,
|
|
30
29
|
text: t.text,
|
|
31
30
|
side: t.side,
|
|
32
31
|
sideOffset: t.sideOffset,
|
|
@@ -37,33 +36,33 @@ function b(e, o) {
|
|
|
37
36
|
zIndex: t.zIndex,
|
|
38
37
|
breakpointMobile: t.breakpointMobile,
|
|
39
38
|
mobileLabel: t.mobileLabel,
|
|
40
|
-
onClose: () =>
|
|
41
|
-
onPointerEnter: () =>
|
|
42
|
-
onPointerLeave: () =>
|
|
39
|
+
onClose: () => e.control.close(),
|
|
40
|
+
onPointerEnter: () => e.control.cancelTimers(),
|
|
41
|
+
onPointerLeave: () => e.control.scheduleClose()
|
|
43
42
|
}),
|
|
44
|
-
|
|
43
|
+
e.container
|
|
45
44
|
);
|
|
46
45
|
}
|
|
47
|
-
function x(
|
|
48
|
-
|
|
46
|
+
function x(o, e) {
|
|
47
|
+
e.open && !m(e.options) ? o.setAttribute("aria-describedby", e.contentId) : o.removeAttribute("aria-describedby");
|
|
49
48
|
}
|
|
50
|
-
function C(
|
|
51
|
-
|
|
49
|
+
function C(o, e, t) {
|
|
50
|
+
e.open !== t && (e.open = t, t && !e.container.isConnected && document.body.appendChild(e.container), x(o, e), b(o, e));
|
|
52
51
|
}
|
|
53
|
-
function f(
|
|
52
|
+
function f(o, e) {
|
|
54
53
|
const t = [];
|
|
55
|
-
function n(c,
|
|
56
|
-
|
|
54
|
+
function n(c, a) {
|
|
55
|
+
o.addEventListener(c, a), t.push(() => o.removeEventListener(c, a));
|
|
57
56
|
}
|
|
58
57
|
const r = v({
|
|
59
58
|
isOpen: () => i.open,
|
|
60
|
-
setOpen: (c) => C(
|
|
59
|
+
setOpen: (c) => C(o, i, c),
|
|
61
60
|
openDelay: () => i.options.openDelay ?? D,
|
|
62
61
|
closeDelay: () => i.options.closeDelay ?? M,
|
|
63
62
|
disabled: () => !l(i.options),
|
|
64
63
|
isMobile: () => m(i.options)
|
|
65
64
|
}), i = {
|
|
66
|
-
options:
|
|
65
|
+
options: e,
|
|
67
66
|
open: !1,
|
|
68
67
|
contentId: `tooltip-directive-${++A}`,
|
|
69
68
|
container: document.createElement("div"),
|
|
@@ -72,31 +71,31 @@ function f(e, o) {
|
|
|
72
71
|
};
|
|
73
72
|
return n("mouseenter", r.handleMouseEnter), n("mouseleave", r.handleMouseLeave), n("focusin", r.handleFocusIn), n("focusout", r.handleFocusOut), n("pointerdown", r.handlePointerDown), n("click", r.handleClick), i;
|
|
74
73
|
}
|
|
75
|
-
function u(
|
|
76
|
-
|
|
77
|
-
for (const t of
|
|
78
|
-
p(null,
|
|
74
|
+
function u(o, e) {
|
|
75
|
+
e.control.destroy();
|
|
76
|
+
for (const t of e.unlisten) t();
|
|
77
|
+
p(null, e.container), e.container.remove(), o.removeAttribute("aria-describedby"), s.delete(o);
|
|
79
78
|
}
|
|
80
79
|
const F = {
|
|
81
|
-
mounted(
|
|
82
|
-
const t =
|
|
83
|
-
l(t) && s.set(
|
|
80
|
+
mounted(o, e) {
|
|
81
|
+
const t = d(e);
|
|
82
|
+
l(t) && s.set(o, f(o, t));
|
|
84
83
|
},
|
|
85
|
-
updated(
|
|
86
|
-
const t =
|
|
84
|
+
updated(o, e) {
|
|
85
|
+
const t = d(e), n = s.get(o);
|
|
87
86
|
if (!n) {
|
|
88
|
-
l(t) && s.set(
|
|
87
|
+
l(t) && s.set(o, f(o, t));
|
|
89
88
|
return;
|
|
90
89
|
}
|
|
91
90
|
if (n.options = t, !l(t)) {
|
|
92
|
-
n.control.close(), u(
|
|
91
|
+
n.control.close(), u(o, n);
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
|
-
n.open && b(
|
|
94
|
+
n.open && b(o, n);
|
|
96
95
|
},
|
|
97
|
-
beforeUnmount(
|
|
98
|
-
const
|
|
99
|
-
|
|
96
|
+
beforeUnmount(o) {
|
|
97
|
+
const e = s.get(o);
|
|
98
|
+
e && u(o, e);
|
|
100
99
|
}
|
|
101
100
|
};
|
|
102
101
|
export {
|
|
@@ -16,6 +16,8 @@ export * from './Drawer';
|
|
|
16
16
|
export * from './DropdownMenu';
|
|
17
17
|
export * from './File';
|
|
18
18
|
export * from './FileUpload';
|
|
19
|
+
export * from './FormField';
|
|
20
|
+
export * from './Image';
|
|
19
21
|
export * from './Indicator';
|
|
20
22
|
export * from './Input';
|
|
21
23
|
export * from './InputNumber';
|