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.
@@ -1,52 +1,54 @@
1
1
  <template>
2
- <div
3
- ref="dropdownRef"
4
- class="s-dropdown"
5
- :style="`--max-height: ${getMaxHeight}`"
6
- :class="[
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
- @mouseleave="mouseHandler(false)"
14
- @mouseover="mouseHandler(true)"
15
- >
16
- <div
17
- class="s-dropdown__trigger"
18
- @click="openDropdown"
14
+ @mouseleave="mouseHandler(false)"
15
+ @mouseover="mouseHandler(true)"
19
16
  >
20
- <slot name="trigger"></slot>
21
- </div>
22
- <transition name="s-dropdown" mode="out-in">
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
- <button
32
- class="s-dropdown__sheet-close _to-sm"
33
- type="button"
34
- @click="close"
35
- ></button>
36
- <button
37
- class="s-dropdown__crest _to-sm"
38
- type="button"
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
- <SIcon name="close" size="16"/>
42
- </button>
43
- <slot name="header"></slot>
44
- <div class="s-dropdown__menu-items" v-if="$slots.items">
45
- <slot name="items" v-bind="'s-dropdown__item'"></slot>
46
- </div>
47
- </dialog>
48
- </transition>
49
- </div>
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
- <dialog
3
- ref="notification"
4
- class="s-notification"
5
- :class="{'--popup': popup}"
6
- @click="closeByBackdropClick"
7
- @cancel="close"
8
- >
9
- <div class="s-notification__wrapper">
10
- <header class="s-notification__header">
11
- <p
12
- v-if="$slots.title"
13
- class="s-notification__title"
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="title"></slot>
16
- </p>
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
- </div>
37
- </dialog>
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
- () => props.modelValue,
63
- (newVal) => {
64
- if (newVal && props.popup) {
65
- // Открываем dialog и блокируем скролл
66
- notification.value?.showModal();
67
- isBodyScrollLocked.value = true;
68
- } else if (!newVal && props.popup) {
69
- // Закрываем и разблокируем
70
- notification.value?.close();
71
- isBodyScrollLocked.value = false;
72
- } else if (newVal && !props.popup) {
73
- notification.value?.show();
74
- } else if (!newVal && !props.popup) {
75
- notification.value?.close();
76
- }
77
- },
78
- { immediate: true }
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
- <dialog
3
- ref="popupRef"
4
- class="s-popup"
5
- :class="[
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
- @click="closeByBackdropClick"
11
- @cancel="close"
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
- <button
19
- class="s-popup__sheet-handler"
20
- type="button"
21
- @click="close"
22
- ></button>
23
- </div>
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
- <aside
26
- v-if="$slots.aside && !isMobile(breakpoints).value"
27
- class="s-popup__aside"
28
- >
29
- <slot name="aside"></slot>
30
- </aside>
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
- <header
33
- class="s-popup__header"
34
- >
35
- <button
36
- v-if="back"
37
- class="s-popup__back"
38
- type="button"
39
- @click="$emit('back')"
40
- >
41
- <SIcon name="angle-left" size="24" />
42
- </button>
43
- <div
44
- v-if="$slots.title"
45
- class="s-popup__title"
46
- >
47
- <slot name="title"></slot>
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
- <transition mode="out-in">
78
- <SSnackbar
79
- v-if="snackbarText && isSnackBarInPopup"
80
- />
81
- </transition>
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
- typeof document !== 'undefined' ? document.body : null
112
+ typeof document !== 'undefined' ? document.body : null
111
113
  );
112
114
 
113
115
  watch(
114
- () => props.modelValue,
115
- (newVal) => {
116
- if (newVal) {
117
- nextTick(() => {
118
- isLocked.value = true;
116
+ () => props.modelValue,
117
+ (newVal) => {
118
+ if (newVal) {
119
+ nextTick(() => {
120
+ isLocked.value = true;
119
121
 
120
- if (props.notModal) {
121
- popupRef.value?.show();
122
- } else {
123
- popupRef.value?.showModal();
124
- }
125
- popupRef.value?.focus({ preventScroll: true });
126
- });
127
- } else {
128
- isLocked.value = false;
129
- }
130
- },
131
- { immediate: true }
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(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.364",
4
+ "version": "0.0.366",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {