itube-specs 0.0.364 → 0.0.366
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/components/ui/s-dropdown.vue +40 -38
- package/components/ui/s-notification.vue +53 -51
- package/components/ui/s-popup.vue +93 -91
- package/package.json +1 -1
|
@@ -1,52 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<div
|
|
4
|
+
ref="dropdownRef"
|
|
5
|
+
class="s-dropdown"
|
|
6
|
+
:style="`--max-height: ${getMaxHeight}`"
|
|
7
|
+
:class="[
|
|
7
8
|
{'--top': top},
|
|
8
9
|
{'--right': right},
|
|
9
10
|
{'--center': center},
|
|
10
11
|
{'--open': open},
|
|
11
12
|
{'--separate': separateLastChild},
|
|
12
13
|
]"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
>
|
|
16
|
-
<div
|
|
17
|
-
class="s-dropdown__trigger"
|
|
18
|
-
@click="openDropdown"
|
|
14
|
+
@mouseleave="mouseHandler(false)"
|
|
15
|
+
@mouseover="mouseHandler(true)"
|
|
19
16
|
>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<dialog
|
|
24
|
-
v-if="useVIf ? open && $slots.items : true"
|
|
25
|
-
:style="!useVIf ? { display: (open && $slots.items) ? '' : 'none' } : {}"
|
|
26
|
-
ref="menuRef"
|
|
27
|
-
class="s-dropdown__menu"
|
|
28
|
-
:class="{'--open': open}"
|
|
29
|
-
@click="close"
|
|
17
|
+
<div
|
|
18
|
+
class="s-dropdown__trigger"
|
|
19
|
+
@click="openDropdown"
|
|
30
20
|
>
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
<slot name="trigger"></slot>
|
|
22
|
+
</div>
|
|
23
|
+
<transition name="s-dropdown" mode="out-in">
|
|
24
|
+
<dialog
|
|
25
|
+
v-if="useVIf ? open && $slots.items : true"
|
|
26
|
+
:style="!useVIf ? { display: (open && $slots.items) ? '' : 'none' } : {}"
|
|
27
|
+
ref="menuRef"
|
|
28
|
+
class="s-dropdown__menu"
|
|
29
|
+
:class="{'--open': open}"
|
|
39
30
|
@click="close"
|
|
40
31
|
>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
32
|
+
<button
|
|
33
|
+
class="s-dropdown__sheet-close _to-sm"
|
|
34
|
+
type="button"
|
|
35
|
+
@click="close"
|
|
36
|
+
></button>
|
|
37
|
+
<button
|
|
38
|
+
class="s-dropdown__crest _to-sm"
|
|
39
|
+
type="button"
|
|
40
|
+
@click="close"
|
|
41
|
+
>
|
|
42
|
+
<SIcon name="close" size="16"/>
|
|
43
|
+
</button>
|
|
44
|
+
<slot name="header"></slot>
|
|
45
|
+
<div class="s-dropdown__menu-items" v-if="$slots.items">
|
|
46
|
+
<slot name="items" v-bind="'s-dropdown__item'"></slot>
|
|
47
|
+
</div>
|
|
48
|
+
</dialog>
|
|
49
|
+
</transition>
|
|
50
|
+
</div>
|
|
51
|
+
</ClientOnly>
|
|
50
52
|
</template>
|
|
51
53
|
|
|
52
54
|
<script setup lang="ts">
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<dialog
|
|
4
|
+
ref="notification"
|
|
5
|
+
class="s-notification"
|
|
6
|
+
:class="{'--popup': popup}"
|
|
7
|
+
@click="closeByBackdropClick"
|
|
8
|
+
@cancel="close"
|
|
9
|
+
>
|
|
10
|
+
<div class="s-notification__wrapper">
|
|
11
|
+
<header class="s-notification__header">
|
|
12
|
+
<p
|
|
13
|
+
v-if="$slots.title"
|
|
14
|
+
class="s-notification__title"
|
|
15
|
+
>
|
|
16
|
+
<slot name="title"></slot>
|
|
17
|
+
</p>
|
|
18
|
+
<button
|
|
19
|
+
class="s-notification__close"
|
|
20
|
+
type="button"
|
|
21
|
+
title="close"
|
|
22
|
+
aria-label="close"
|
|
23
|
+
@click="close"
|
|
24
|
+
>
|
|
25
|
+
<SIcon class="s-notification__close-icon" name="close" size="16"/>
|
|
26
|
+
</button>
|
|
27
|
+
</header>
|
|
28
|
+
<div class="s-notification__content">
|
|
29
|
+
<slot></slot>
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
v-if="$slots.footer"
|
|
33
|
+
class="s-notification__footer"
|
|
14
34
|
>
|
|
15
|
-
<slot name="
|
|
16
|
-
</
|
|
17
|
-
<button
|
|
18
|
-
class="s-notification__close"
|
|
19
|
-
type="button"
|
|
20
|
-
title="close"
|
|
21
|
-
aria-label="close"
|
|
22
|
-
@click="close"
|
|
23
|
-
>
|
|
24
|
-
<SIcon class="s-notification__close-icon" name="close" size="16"/>
|
|
25
|
-
</button>
|
|
26
|
-
</header>
|
|
27
|
-
<div class="s-notification__content">
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</div>
|
|
30
|
-
<div
|
|
31
|
-
v-if="$slots.footer"
|
|
32
|
-
class="s-notification__footer"
|
|
33
|
-
>
|
|
34
|
-
<slot name="footer"></slot>
|
|
35
|
+
<slot name="footer"></slot>
|
|
36
|
+
</div>
|
|
35
37
|
</div>
|
|
36
|
-
</
|
|
37
|
-
</
|
|
38
|
+
</dialog>
|
|
39
|
+
</ClientOnly>
|
|
38
40
|
</template>
|
|
39
41
|
|
|
40
42
|
<script setup lang="ts">
|
|
@@ -59,23 +61,23 @@ const bodyElement = ref(document.body);
|
|
|
59
61
|
const isBodyScrollLocked = useScrollLock(bodyElement);
|
|
60
62
|
|
|
61
63
|
watch(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
() => props.modelValue,
|
|
65
|
+
(newVal) => {
|
|
66
|
+
if (newVal && props.popup) {
|
|
67
|
+
// Открываем dialog и блокируем скролл
|
|
68
|
+
notification.value?.showModal();
|
|
69
|
+
isBodyScrollLocked.value = true;
|
|
70
|
+
} else if (!newVal && props.popup) {
|
|
71
|
+
// Закрываем и разблокируем
|
|
72
|
+
notification.value?.close();
|
|
73
|
+
isBodyScrollLocked.value = false;
|
|
74
|
+
} else if (newVal && !props.popup) {
|
|
75
|
+
notification.value?.show();
|
|
76
|
+
} else if (!newVal && !props.popup) {
|
|
77
|
+
notification.value?.close();
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{ immediate: true }
|
|
79
81
|
);
|
|
80
82
|
|
|
81
83
|
// Дополнительная очистка при размонтировании (на всякий случай)
|
|
@@ -1,85 +1,87 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<dialog
|
|
4
|
+
ref="popupRef"
|
|
5
|
+
class="s-popup"
|
|
6
|
+
:class="[
|
|
6
7
|
{'--sheet': sheet},
|
|
7
8
|
{'--transparent-backdrop': transparentBackdrop},
|
|
8
9
|
{'--aside': $slots.aside}
|
|
9
10
|
]"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
>
|
|
13
|
-
<div class="s-popup__wrapper">
|
|
14
|
-
<div
|
|
15
|
-
v-if="sheet"
|
|
16
|
-
class="s-popup__sheet"
|
|
11
|
+
@click="closeByBackdropClick"
|
|
12
|
+
@cancel="close"
|
|
17
13
|
>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
<div class="s-popup__wrapper">
|
|
15
|
+
<div
|
|
16
|
+
v-if="sheet"
|
|
17
|
+
class="s-popup__sheet"
|
|
18
|
+
>
|
|
19
|
+
<button
|
|
20
|
+
class="s-popup__sheet-handler"
|
|
21
|
+
type="button"
|
|
22
|
+
@click="close"
|
|
23
|
+
></button>
|
|
24
|
+
</div>
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
<aside
|
|
27
|
+
v-if="$slots.aside && !isMobile(breakpoints).value"
|
|
28
|
+
class="s-popup__aside"
|
|
29
|
+
>
|
|
30
|
+
<slot name="aside"></slot>
|
|
31
|
+
</aside>
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
<header
|
|
34
|
+
class="s-popup__header"
|
|
35
|
+
>
|
|
36
|
+
<button
|
|
37
|
+
v-if="back"
|
|
38
|
+
class="s-popup__back"
|
|
39
|
+
type="button"
|
|
40
|
+
@click="$emit('back')"
|
|
41
|
+
>
|
|
42
|
+
<SIcon name="angle-left" size="24"/>
|
|
43
|
+
</button>
|
|
44
|
+
<div
|
|
45
|
+
v-if="$slots.title"
|
|
46
|
+
class="s-popup__title"
|
|
47
|
+
>
|
|
48
|
+
<slot name="title"></slot>
|
|
49
|
+
</div>
|
|
50
|
+
<button
|
|
51
|
+
class="s-popup__close"
|
|
52
|
+
type="button"
|
|
53
|
+
@click="close"
|
|
54
|
+
>
|
|
55
|
+
<SIcon name="close" size="24"/>
|
|
56
|
+
</button>
|
|
57
|
+
</header>
|
|
58
|
+
<div
|
|
59
|
+
v-if="$slots.fixedContent"
|
|
60
|
+
class="s-popup__subheader"
|
|
61
|
+
>
|
|
62
|
+
<slot name="fixedContent"></slot>
|
|
63
|
+
</div>
|
|
64
|
+
<div
|
|
65
|
+
v-if="$slots.default"
|
|
66
|
+
class="s-popup__content"
|
|
67
|
+
>
|
|
68
|
+
<slot></slot>
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
v-if="$slots.footer"
|
|
72
|
+
class="s-popup__footer"
|
|
73
|
+
>
|
|
74
|
+
<slot name="footer"></slot>
|
|
75
|
+
</div>
|
|
48
76
|
</div>
|
|
49
|
-
<button
|
|
50
|
-
class="s-popup__close"
|
|
51
|
-
type="button"
|
|
52
|
-
@click="close"
|
|
53
|
-
>
|
|
54
|
-
<SIcon name="close" size="24" />
|
|
55
|
-
</button>
|
|
56
|
-
</header>
|
|
57
|
-
<div
|
|
58
|
-
v-if="$slots.fixedContent"
|
|
59
|
-
class="s-popup__subheader"
|
|
60
|
-
>
|
|
61
|
-
<slot name="fixedContent"></slot>
|
|
62
|
-
</div>
|
|
63
|
-
<div
|
|
64
|
-
v-if="$slots.default"
|
|
65
|
-
class="s-popup__content"
|
|
66
|
-
>
|
|
67
|
-
<slot></slot>
|
|
68
|
-
</div>
|
|
69
|
-
<div
|
|
70
|
-
v-if="$slots.footer"
|
|
71
|
-
class="s-popup__footer"
|
|
72
|
-
>
|
|
73
|
-
<slot name="footer"></slot>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</dialog>
|
|
78
|
+
<transition mode="out-in">
|
|
79
|
+
<SSnackbar
|
|
80
|
+
v-if="snackbarText && isSnackBarInPopup"
|
|
81
|
+
/>
|
|
82
|
+
</transition>
|
|
83
|
+
</dialog>
|
|
84
|
+
</ClientOnly>
|
|
83
85
|
</template>
|
|
84
86
|
|
|
85
87
|
<script setup lang="ts">
|
|
@@ -87,7 +89,7 @@ import { onBackdropClick, isMobile } from '../../runtime';
|
|
|
87
89
|
import type { CssBreakpoints } from '../../types';
|
|
88
90
|
import { useScrollLock } from '@vueuse/core';
|
|
89
91
|
|
|
90
|
-
const {resetSnackbar} = useSnackbar();
|
|
92
|
+
const { resetSnackbar } = useSnackbar();
|
|
91
93
|
|
|
92
94
|
const breakpoints = useAppConfig().cssBreakpoints as Record<CssBreakpoints, number>;
|
|
93
95
|
const popupRef = ref()
|
|
@@ -107,28 +109,28 @@ const props = defineProps<{
|
|
|
107
109
|
}>()
|
|
108
110
|
|
|
109
111
|
const isLocked = useScrollLock(
|
|
110
|
-
|
|
112
|
+
typeof document !== 'undefined' ? document.body : null
|
|
111
113
|
);
|
|
112
114
|
|
|
113
115
|
watch(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
() => props.modelValue,
|
|
117
|
+
(newVal) => {
|
|
118
|
+
if (newVal) {
|
|
119
|
+
nextTick(() => {
|
|
120
|
+
isLocked.value = true;
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
if (props.notModal) {
|
|
123
|
+
popupRef.value?.show();
|
|
124
|
+
} else {
|
|
125
|
+
popupRef.value?.showModal();
|
|
126
|
+
}
|
|
127
|
+
popupRef.value?.focus({ preventScroll: true });
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
isLocked.value = false;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{ immediate: true }
|
|
132
134
|
);
|
|
133
135
|
|
|
134
136
|
onMounted(() => {
|