@skyservice-developers/vue-dev-kit 1.5.11 → 2.0.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 +96 -15
- package/dist/api-BOvdjB3h.js +266 -0
- package/dist/api-D5C6FvTr.cjs +1 -0
- package/dist/components/BaseTeleport.vue.d.ts +14 -0
- package/dist/components/Dialog.vue.d.ts +28 -0
- package/dist/components/DialogModal.vue.d.ts +28 -0
- package/dist/components/DialogNext.vue.d.ts +28 -0
- package/dist/components/Header.vue.d.ts +37 -0
- package/dist/components/Modal.vue.d.ts +30 -0
- package/dist/components/SkyButton.vue.d.ts +22 -0
- package/dist/components/SkySelect.vue.d.ts +16 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/sdk/api.d.ts +54 -0
- package/dist/sdk/bridge.d.ts +43 -0
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/types.d.ts +73 -0
- package/dist/sdk/webview.d.ts +16 -0
- package/dist/sdk.cjs +1 -0
- package/dist/sdk.js +33 -0
- package/dist/style.css +1 -0
- package/dist/vue-dev-kit.cjs +1 -0
- package/dist/vue-dev-kit.js +903 -0
- package/package.json +32 -43
- package/dist/vue2/style.css +0 -1
- package/dist/vue2/vue-dev-kit.cjs +0 -1
- package/dist/vue2/vue-dev-kit.js +0 -2622
- package/dist/vue3/style.css +0 -1
- package/dist/vue3/vue-dev-kit.cjs +0 -1
- package/dist/vue3/vue-dev-kit.js +0 -2338
- package/src/index.js +0 -9
- package/src/shared/index.js +0 -1
- package/src/shared/types/index.d.ts +0 -72
- package/src/shared/utils/index.js +0 -2
- package/src/shared/utils/parentBridge.js +0 -84
- package/src/shared/utils/webviewCheck.js +0 -54
- package/src/styles/scrollbar.css +0 -17
- package/src/vue2/components/BaseTeleport.vue +0 -16
- package/src/vue2/components/Dialog.vue +0 -106
- package/src/vue2/components/DialogModal.vue +0 -439
- package/src/vue2/components/DialogNext.vue +0 -379
- package/src/vue2/components/Header.vue +0 -466
- package/src/vue2/components/Modal.vue +0 -252
- package/src/vue2/components/SkyButton.vue +0 -144
- package/src/vue2/components/SkySelect.vue +0 -327
- package/src/vue2/components/index.js +0 -6
- package/src/vue2/index.js +0 -2
- package/src/vue3/components/BaseTeleport.vue +0 -16
- package/src/vue3/components/Dialog.vue +0 -97
- package/src/vue3/components/DialogModal.vue +0 -458
- package/src/vue3/components/DialogNext.vue +0 -427
- package/src/vue3/components/Header.vue +0 -505
- package/src/vue3/components/Modal.vue +0 -253
- package/src/vue3/components/SkyButton.vue +0 -140
- package/src/vue3/components/SkySelect.vue +0 -379
- package/src/vue3/components/index.js +0 -8
- package/src/vue3/index.js +0 -2
|
@@ -1,466 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<header class="sky-header-container">
|
|
3
|
-
<div class="topmenubox">
|
|
4
|
-
<div class="header-left">
|
|
5
|
-
<button
|
|
6
|
-
v-if="shouldShowBackButton"
|
|
7
|
-
class="btn-back"
|
|
8
|
-
@click="handleBack"
|
|
9
|
-
:title="backButtonTitle"
|
|
10
|
-
>
|
|
11
|
-
<svg width="15" height="15" viewBox="0 0 451.847 451.847" style="transform: rotate(90deg)">
|
|
12
|
-
<path fill="currentColor" d="M225.923,354.706c-8.098,0-16.195-3.092-22.369-9.263L9.27,151.157c-12.359-12.359-12.359-32.397,0-44.751c12.354-12.354,32.388-12.354,44.748,0l171.905,171.915l171.906-171.909c12.359-12.354,32.391-12.354,44.744,0c12.365,12.354,12.365,32.392,0,44.751L248.292,345.449C242.115,351.621,234.018,354.706,225.923,354.706z"/>
|
|
13
|
-
</svg>
|
|
14
|
-
</button>
|
|
15
|
-
<div ref="dropdownRef" class="titleAndDesc">
|
|
16
|
-
<button
|
|
17
|
-
class="title-dropdown-toggle"
|
|
18
|
-
:class="{ 'title-dropdown-toggle-active': sortedItems.length }"
|
|
19
|
-
@click="toggleDropdown"
|
|
20
|
-
>
|
|
21
|
-
<slot name="title">
|
|
22
|
-
<h4 class="notPadding">
|
|
23
|
-
<span class="topmenu-title">{{ title }}</span>
|
|
24
|
-
<svg
|
|
25
|
-
v-if="sortedItems.length"
|
|
26
|
-
class="arrow"
|
|
27
|
-
:class="{ open: isDropdownOpen }"
|
|
28
|
-
width="12"
|
|
29
|
-
height="12"
|
|
30
|
-
viewBox="0 0 451.847 451.847"
|
|
31
|
-
style="flex-shrink: 0"
|
|
32
|
-
>
|
|
33
|
-
<path
|
|
34
|
-
fill="currentColor"
|
|
35
|
-
d="M225.923,354.706c-8.098,0-16.195-3.092-22.369-9.263L9.27,151.157c-12.359-12.359-12.359-32.397,0-44.751c12.354-12.354,32.388-12.354,44.748,0l171.905,171.915l171.906-171.909c12.359-12.354,32.391-12.354,44.744,0c12.365,12.354,12.365,32.392,0,44.751L248.292,345.449C242.115,351.621,234.018,354.706,225.923,354.706z"
|
|
36
|
-
/>
|
|
37
|
-
</svg>
|
|
38
|
-
</h4>
|
|
39
|
-
</slot>
|
|
40
|
-
</button>
|
|
41
|
-
<div v-if="isDropdownOpen && sortedItems.length" class="title-dropdown">
|
|
42
|
-
<div class="title-dropdown-header">{{ dropdownTitle }}</div>
|
|
43
|
-
<div class="title-dropdown-divider"></div>
|
|
44
|
-
<div
|
|
45
|
-
v-for="(item, index) in sortedItems"
|
|
46
|
-
:key="index"
|
|
47
|
-
class="title-dropdown-item"
|
|
48
|
-
@click="selectItem(item)"
|
|
49
|
-
>
|
|
50
|
-
<p class="pageName">{{ capitalize(item.name) }}</p>
|
|
51
|
-
<small class="pageVisit">
|
|
52
|
-
({{ visitLabel }} {{ getTimeAgo(item.lastVisit) }})
|
|
53
|
-
</small>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<slot name="subtitle">
|
|
57
|
-
<p v-if="subtitle" class="topmenu-description">{{ subtitle }}</p>
|
|
58
|
-
</slot>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<div class="topmenubox-button">
|
|
63
|
-
<!-- Порожні блоки ремонтують відображення на windows в додатку, не видаляти! -->
|
|
64
|
-
<div></div>
|
|
65
|
-
<slot></slot>
|
|
66
|
-
<div></div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</header>
|
|
70
|
-
</template>
|
|
71
|
-
|
|
72
|
-
<script>
|
|
73
|
-
import { isInIframe } from '../../shared/utils/webviewCheck'
|
|
74
|
-
import { getParentLocalStorage, setParentLocalStorage, sendToParent, setSenderId, getSenderId } from '../../shared/utils/parentBridge'
|
|
75
|
-
|
|
76
|
-
export default {
|
|
77
|
-
name: 'Header',
|
|
78
|
-
props: {
|
|
79
|
-
title: {
|
|
80
|
-
type: String,
|
|
81
|
-
default: ''
|
|
82
|
-
},
|
|
83
|
-
subtitle: {
|
|
84
|
-
type: String,
|
|
85
|
-
default: ''
|
|
86
|
-
},
|
|
87
|
-
showBackButton: {
|
|
88
|
-
type: Boolean,
|
|
89
|
-
default: true
|
|
90
|
-
},
|
|
91
|
-
backButtonTitle: {
|
|
92
|
-
type: String,
|
|
93
|
-
default: 'Назад'
|
|
94
|
-
},
|
|
95
|
-
backEvent: {
|
|
96
|
-
type: Function,
|
|
97
|
-
default: null
|
|
98
|
-
},
|
|
99
|
-
dropdownItems: {
|
|
100
|
-
type: Array,
|
|
101
|
-
default: () => []
|
|
102
|
-
},
|
|
103
|
-
dropdownTitle: {
|
|
104
|
-
type: String,
|
|
105
|
-
default: 'Останні відвідані розділи'
|
|
106
|
-
},
|
|
107
|
-
visitLabel: {
|
|
108
|
-
type: String,
|
|
109
|
-
default: 'Останнє відвідування'
|
|
110
|
-
},
|
|
111
|
-
trackPageName: {
|
|
112
|
-
type: String,
|
|
113
|
-
default: ''
|
|
114
|
-
},
|
|
115
|
-
trackPagePath: {
|
|
116
|
-
type: String,
|
|
117
|
-
default: ''
|
|
118
|
-
},
|
|
119
|
-
appId: {
|
|
120
|
-
type: String,
|
|
121
|
-
default: ''
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
data() {
|
|
125
|
-
return {
|
|
126
|
-
isDropdownOpen: false,
|
|
127
|
-
previousRocketMode: null,
|
|
128
|
-
localStorageItems: []
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
computed: {
|
|
132
|
-
sortedItems() {
|
|
133
|
-
const items = this.dropdownItems.length ? this.dropdownItems : this.localStorageItems
|
|
134
|
-
return [...items].sort((a, b) => b.lastVisit - a.lastVisit)
|
|
135
|
-
},
|
|
136
|
-
shouldShowBackButton() {
|
|
137
|
-
return this.backEvent || (this.showBackButton && isInIframe())
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
created() {
|
|
141
|
-
setSenderId(this.appId || getSenderId())
|
|
142
|
-
if (isInIframe()) {
|
|
143
|
-
// Track page visit
|
|
144
|
-
if (this.trackPageName) {
|
|
145
|
-
sendToParent({
|
|
146
|
-
type: 'trackVisit',
|
|
147
|
-
name: this.trackPageName,
|
|
148
|
-
path: this.trackPagePath || `/${this.trackPageName}`,
|
|
149
|
-
})
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Set rocketMode
|
|
153
|
-
getParentLocalStorage('rocketMode').then(async (value) => {
|
|
154
|
-
this.previousRocketMode = value
|
|
155
|
-
const existingFallback = await getParentLocalStorage('fallbackRocketMode')
|
|
156
|
-
if (existingFallback === null) {
|
|
157
|
-
setParentLocalStorage('fallbackRocketMode', value === true || value === 'true' ? 'true' : 'false')
|
|
158
|
-
}
|
|
159
|
-
sendToParent({ type: 'setRocketMode', value: true })
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
// Load componentStats from parent
|
|
163
|
-
getParentLocalStorage('componentStats').then((data) => {
|
|
164
|
-
if (data != null) {
|
|
165
|
-
this.loadParentComponentStats(data)
|
|
166
|
-
}
|
|
167
|
-
})
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
mounted() {
|
|
171
|
-
document.addEventListener('click', this.handleClickOutside, true)
|
|
172
|
-
},
|
|
173
|
-
beforeDestroy() {
|
|
174
|
-
document.removeEventListener('click', this.handleClickOutside, true)
|
|
175
|
-
this.restoreRocketMode()
|
|
176
|
-
},
|
|
177
|
-
methods: {
|
|
178
|
-
restoreRocketMode() {
|
|
179
|
-
if (isInIframe() && this.previousRocketMode !== null) {
|
|
180
|
-
const restore = this.previousRocketMode === true || this.previousRocketMode === 'true'
|
|
181
|
-
sendToParent({ type: 'setRocketMode', value: restore })
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
findPreviousPage() {
|
|
185
|
-
return this.sortedItems.find(item => item.name !== this.trackPageName && item.path)
|
|
186
|
-
},
|
|
187
|
-
loadParentComponentStats(data) {
|
|
188
|
-
try {
|
|
189
|
-
const parsed = typeof data === 'string' ? JSON.parse(data) : data
|
|
190
|
-
if (parsed?.pages) {
|
|
191
|
-
this.localStorageItems = Object.values(parsed.pages)
|
|
192
|
-
}
|
|
193
|
-
} catch {}
|
|
194
|
-
},
|
|
195
|
-
async handleBack() {
|
|
196
|
-
if (this.backEvent) {
|
|
197
|
-
this.restoreRocketMode()
|
|
198
|
-
return this.backEvent()
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Navigate to the last visited page that isn't the current one
|
|
202
|
-
let previousPage = this.findPreviousPage()
|
|
203
|
-
|
|
204
|
-
// If history not loaded yet, try fetching from parent
|
|
205
|
-
if (!previousPage && isInIframe()) {
|
|
206
|
-
const data = await getParentLocalStorage('componentStats')
|
|
207
|
-
if (data) {
|
|
208
|
-
this.loadParentComponentStats(data)
|
|
209
|
-
previousPage = this.findPreviousPage()
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
this.restoreRocketMode()
|
|
214
|
-
|
|
215
|
-
if (previousPage) {
|
|
216
|
-
sendToParent({ type: 'navigate', path: previousPage.path })
|
|
217
|
-
} else {
|
|
218
|
-
sendToParent({ type: 'exit' })
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
toggleDropdown() {
|
|
222
|
-
if (this.sortedItems.length) {
|
|
223
|
-
this.isDropdownOpen = !this.isDropdownOpen
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
closeDropdown() {
|
|
227
|
-
this.isDropdownOpen = false
|
|
228
|
-
},
|
|
229
|
-
selectItem(item) {
|
|
230
|
-
this.$emit('navigate', item.path)
|
|
231
|
-
if (isInIframe()) {
|
|
232
|
-
sendToParent({ type: 'navigate', path: item.path })
|
|
233
|
-
}
|
|
234
|
-
this.closeDropdown()
|
|
235
|
-
},
|
|
236
|
-
capitalize(str) {
|
|
237
|
-
if (!str) return ''
|
|
238
|
-
return str.charAt(0).toUpperCase() + str.slice(1)
|
|
239
|
-
},
|
|
240
|
-
getTimeAgo(lastVisit) {
|
|
241
|
-
const now = Date.now()
|
|
242
|
-
const diff = now - lastVisit
|
|
243
|
-
|
|
244
|
-
const seconds = Math.floor(diff / 1000)
|
|
245
|
-
const minutes = Math.floor(seconds / 60)
|
|
246
|
-
const hours = Math.floor(minutes / 60)
|
|
247
|
-
const days = Math.floor(hours / 24)
|
|
248
|
-
|
|
249
|
-
if (days > 0) return `${days}д тому`
|
|
250
|
-
if (hours > 0) return `${hours}год тому`
|
|
251
|
-
if (minutes > 0) return `${minutes}хв тому`
|
|
252
|
-
return `${seconds}с тому`
|
|
253
|
-
},
|
|
254
|
-
handleClickOutside(e) {
|
|
255
|
-
if (this.$refs.dropdownRef && !this.$refs.dropdownRef.contains(e.target)) {
|
|
256
|
-
this.closeDropdown()
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
</script>
|
|
262
|
-
|
|
263
|
-
<style scoped>
|
|
264
|
-
.sky-header-container {
|
|
265
|
-
width: 100%;
|
|
266
|
-
min-height: var(--sky-header-min-height, 82px);
|
|
267
|
-
background-color: var(--sky-header-bg, transparent);
|
|
268
|
-
display: flex;
|
|
269
|
-
flex-direction: row;
|
|
270
|
-
padding: var(--sky-header-padding, 10px);
|
|
271
|
-
border-bottom: 1px solid var(--sky-header-border-color, #dee2e6);
|
|
272
|
-
z-index: var(--sky-header-z-index, 4);
|
|
273
|
-
position: relative;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.topmenubox {
|
|
277
|
-
width: 100%;
|
|
278
|
-
display: flex;
|
|
279
|
-
padding: 4px;
|
|
280
|
-
justify-content: space-between;
|
|
281
|
-
align-items: center;
|
|
282
|
-
background-color: transparent;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.header-left {
|
|
286
|
-
display: flex;
|
|
287
|
-
align-items: center;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.header-left > * + * {
|
|
291
|
-
margin-left: 12px;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.titleAndDesc {
|
|
295
|
-
display: flex;
|
|
296
|
-
flex-direction: column;
|
|
297
|
-
position: relative;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.notPadding {
|
|
301
|
-
margin: 0;
|
|
302
|
-
padding: 0;
|
|
303
|
-
font-size: var(--sky-header-title-size, 18px);
|
|
304
|
-
font-weight: var(--sky-header-title-weight, 500);
|
|
305
|
-
color: var(--sky-header-title-color, #252525);
|
|
306
|
-
line-height: 1.5;
|
|
307
|
-
user-select: none;
|
|
308
|
-
display: flex;
|
|
309
|
-
align-items: center;
|
|
310
|
-
flex-wrap: nowrap;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.topmenu-title {
|
|
314
|
-
white-space: pre-line;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.title-dropdown-toggle {
|
|
318
|
-
display: flex;
|
|
319
|
-
flex-direction: row;
|
|
320
|
-
padding: 0;
|
|
321
|
-
margin: 0;
|
|
322
|
-
background: transparent;
|
|
323
|
-
border: none;
|
|
324
|
-
text-align: left;
|
|
325
|
-
font: inherit;
|
|
326
|
-
color: inherit;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.title-dropdown-toggle-active {
|
|
330
|
-
cursor: pointer;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.arrow {
|
|
334
|
-
width: 12px;
|
|
335
|
-
position: relative;
|
|
336
|
-
margin-left: 5px;
|
|
337
|
-
flex-shrink: 0;
|
|
338
|
-
transition: transform 0.25s ease;
|
|
339
|
-
color: var(--sky-header-title-color, #252525);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.arrow.open {
|
|
343
|
-
transform: rotate(180deg);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.title-dropdown {
|
|
347
|
-
position: absolute;
|
|
348
|
-
top: 100%;
|
|
349
|
-
left: 0;
|
|
350
|
-
min-width: 240px;
|
|
351
|
-
background: white;
|
|
352
|
-
border-radius: 5px;
|
|
353
|
-
box-shadow: 0 1px 12px rgba(0, 0, 0, 0.1);
|
|
354
|
-
border: none;
|
|
355
|
-
z-index: 10;
|
|
356
|
-
padding: 4px 0;
|
|
357
|
-
margin-top: 4px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.title-dropdown-header {
|
|
361
|
-
padding: 4px 24px;
|
|
362
|
-
font-size: 13px;
|
|
363
|
-
color: #6c757d;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.title-dropdown-divider {
|
|
367
|
-
height: 0;
|
|
368
|
-
margin: 4px 0;
|
|
369
|
-
border-top: 1px solid #e9ecef;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.title-dropdown-item {
|
|
373
|
-
padding: 4px 24px;
|
|
374
|
-
cursor: pointer;
|
|
375
|
-
transition: background-color 0.1s;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
.title-dropdown-item:hover {
|
|
379
|
-
background-color: #f8f9fa;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.title-dropdown-item:active {
|
|
383
|
-
background-color: #e9ecef;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.pageName {
|
|
387
|
-
padding-bottom: 0;
|
|
388
|
-
margin: 0;
|
|
389
|
-
font-weight: 500;
|
|
390
|
-
font-size: 14px;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.pageVisit {
|
|
394
|
-
color: gray;
|
|
395
|
-
font-weight: 400;
|
|
396
|
-
font-size: 11px;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.topmenu-description {
|
|
400
|
-
margin: 0;
|
|
401
|
-
margin-bottom: 5px;
|
|
402
|
-
color: var(--sky-header-subtitle-color, #5d5d5d);
|
|
403
|
-
font-size: 13px;
|
|
404
|
-
font-weight: 400;
|
|
405
|
-
line-height: 1.5;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.topmenubox-button {
|
|
409
|
-
display: flex;
|
|
410
|
-
flex-direction: row;
|
|
411
|
-
align-items: center;
|
|
412
|
-
justify-content: space-between;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
.btn-back {
|
|
416
|
-
display: flex;
|
|
417
|
-
align-items: center;
|
|
418
|
-
justify-content: center;
|
|
419
|
-
width: 32px;
|
|
420
|
-
height: 32px;
|
|
421
|
-
padding: 0;
|
|
422
|
-
background: transparent;
|
|
423
|
-
border: none;
|
|
424
|
-
cursor: pointer;
|
|
425
|
-
border-radius: 6px;
|
|
426
|
-
transition: background-color 0.2s;
|
|
427
|
-
color: var(--sky-header-back-btn-color, #374151);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
.btn-back img,
|
|
431
|
-
.btn-back svg {
|
|
432
|
-
display: block;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.btn-back:hover {
|
|
436
|
-
background-color: var(--sky-header-back-btn-hover-bg, #f8f9fa);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.btn-back:active {
|
|
440
|
-
background-color: var(--sky-header-back-btn-active-bg, #e9ecef);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/* Responsive: <500px — hide description, smaller title */
|
|
444
|
-
@media (max-width: 499px) {
|
|
445
|
-
.topmenu-description {
|
|
446
|
-
display: none;
|
|
447
|
-
}
|
|
448
|
-
.notPadding {
|
|
449
|
-
font-size: 13px;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
/* Responsive: 500-1099px — smaller description */
|
|
454
|
-
@media (min-width: 500px) and (max-width: 1099px) {
|
|
455
|
-
.topmenu-description {
|
|
456
|
-
font-size: 11px;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/* iOS safe area */
|
|
461
|
-
@supports (padding-top: env(safe-area-inset-top)) {
|
|
462
|
-
.sky-header-container {
|
|
463
|
-
padding-top: calc(10px + env(safe-area-inset-top));
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
</style>
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<base-teleport to="body">
|
|
3
|
-
<div v-if="isOpen" class="sky-modal-overlay" @click.self="handleOverlayClick">
|
|
4
|
-
<div class="sky-modal" :style="modalStyle">
|
|
5
|
-
<div class="sky-modal-header">
|
|
6
|
-
<button class="sky-modal-back" @click="close" :title="closeTitle">
|
|
7
|
-
<svg width="15" height="15" viewBox="0 0 451.847 451.847" style="transform: rotate(90deg)">
|
|
8
|
-
<path fill="currentColor" d="M225.923,354.706c-8.098,0-16.195-3.092-22.369-9.263L9.27,151.157c-12.359-12.359-12.359-32.397,0-44.751c12.354-12.354,32.388-12.354,44.748,0l171.905,171.915l171.906-171.909c12.359-12.354,32.391-12.354,44.744,0c12.365,12.354,12.365,32.392,0,44.751L248.292,345.449C242.115,351.621,234.018,354.706,225.923,354.706z"/>
|
|
9
|
-
</svg>
|
|
10
|
-
</button>
|
|
11
|
-
<div class="sky-modal-title-wrapper">
|
|
12
|
-
<h4 class="sky-modal-title">{{ title }}</h4>
|
|
13
|
-
<div v-if="subtitle" class="sky-modal-subtitle">{{ subtitle }}</div>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<div class="sky-modal-body">
|
|
18
|
-
<slot></slot>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div v-if="$slots.footer" class="sky-modal-footer">
|
|
22
|
-
<slot name="footer"></slot>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</base-teleport>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
import BaseTeleport from './BaseTeleport.vue';
|
|
31
|
-
|
|
32
|
-
export default {
|
|
33
|
-
components: {
|
|
34
|
-
BaseTeleport
|
|
35
|
-
},
|
|
36
|
-
name: 'Modal',
|
|
37
|
-
props: {
|
|
38
|
-
modelValue: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
title: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: ''
|
|
45
|
-
},
|
|
46
|
-
subtitle: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: ''
|
|
49
|
-
},
|
|
50
|
-
closeTitle: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: 'Закрити'
|
|
53
|
-
},
|
|
54
|
-
closeOnOverlay: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: true
|
|
57
|
-
},
|
|
58
|
-
closeOnEsc: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: true
|
|
61
|
-
},
|
|
62
|
-
width: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: '100%'
|
|
65
|
-
},
|
|
66
|
-
height: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: '100%'
|
|
69
|
-
},
|
|
70
|
-
value: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: false
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
computed: {
|
|
76
|
-
modalStyle() {
|
|
77
|
-
return {
|
|
78
|
-
width: this.width,
|
|
79
|
-
height: this.height
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
watch: {
|
|
84
|
-
modelValue(value) {
|
|
85
|
-
if (value) {
|
|
86
|
-
document.body.style.overflow = 'hidden'
|
|
87
|
-
} else {
|
|
88
|
-
document.body.style.overflow = ''
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
mounted() {
|
|
93
|
-
document.addEventListener('keydown', this.handleKeydown)
|
|
94
|
-
},
|
|
95
|
-
computed: {
|
|
96
|
-
isOpen: {
|
|
97
|
-
get() {
|
|
98
|
-
return this.value
|
|
99
|
-
},
|
|
100
|
-
set(val) {
|
|
101
|
-
this.$emit('input', val)
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
beforeDestroy() {
|
|
106
|
-
document.removeEventListener('keydown', this.handleKeydown)
|
|
107
|
-
document.body.style.overflow = ''
|
|
108
|
-
},
|
|
109
|
-
methods: {
|
|
110
|
-
close() {
|
|
111
|
-
this.$emit('update:modelValue', false)
|
|
112
|
-
this.isOpen = false;
|
|
113
|
-
this.$emit('close')
|
|
114
|
-
},
|
|
115
|
-
handleOverlayClick() {
|
|
116
|
-
if (this.closeOnOverlay) {
|
|
117
|
-
this.close()
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
handleKeydown(e) {
|
|
121
|
-
if (e.key === 'Escape' && this.closeOnEsc && this.modelValue) {
|
|
122
|
-
this.close()
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
</script>
|
|
128
|
-
|
|
129
|
-
<style scoped>
|
|
130
|
-
.sky-modal-overlay {
|
|
131
|
-
position: fixed;
|
|
132
|
-
top: 0;
|
|
133
|
-
left: 0;
|
|
134
|
-
width: 100%;
|
|
135
|
-
height: 100%;
|
|
136
|
-
background: rgba(0, 0, 0, 0.6);
|
|
137
|
-
backdrop-filter: blur(2px);
|
|
138
|
-
z-index: var(--sky-modal-z-index, 9998);
|
|
139
|
-
display: flex;
|
|
140
|
-
justify-content: center;
|
|
141
|
-
align-items: center;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.sky-modal {
|
|
145
|
-
background: var(--sky-modal-bg, white);
|
|
146
|
-
border-radius: var(--sky-modal-radius, 0);
|
|
147
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.24);
|
|
148
|
-
display: flex;
|
|
149
|
-
flex-direction: column;
|
|
150
|
-
max-width: 100%;
|
|
151
|
-
max-height: 100%;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.sky-modal-header {
|
|
155
|
-
display: flex;
|
|
156
|
-
align-items: center;
|
|
157
|
-
padding: var(--sky-modal-header-padding, 10px 14px);
|
|
158
|
-
border-bottom: 1px solid var(--sky-modal-border-color, #dee2e6);
|
|
159
|
-
flex-shrink: 0;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.sky-modal-back {
|
|
163
|
-
display: flex;
|
|
164
|
-
align-items: center;
|
|
165
|
-
justify-content: center;
|
|
166
|
-
width: 32px;
|
|
167
|
-
height: 32px;
|
|
168
|
-
padding: 0;
|
|
169
|
-
background: transparent;
|
|
170
|
-
border: none;
|
|
171
|
-
cursor: pointer;
|
|
172
|
-
border-radius: 6px;
|
|
173
|
-
transition: background-color 0.2s;
|
|
174
|
-
color: var(--sky-modal-back-color, #374151);
|
|
175
|
-
margin-right: 12px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.sky-modal-back svg {
|
|
179
|
-
display: block;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.sky-modal-back:hover {
|
|
183
|
-
background-color: var(--sky-modal-back-hover-bg, #f8f9fa);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.sky-modal-back:active {
|
|
187
|
-
background-color: var(--sky-modal-back-active-bg, #e9ecef);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.sky-modal-title-wrapper {
|
|
191
|
-
flex: 1;
|
|
192
|
-
min-width: 0;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.sky-modal-title {
|
|
196
|
-
margin: 0;
|
|
197
|
-
font-size: var(--sky-modal-title-size, 18px);
|
|
198
|
-
font-weight: var(--sky-modal-title-weight, 500);
|
|
199
|
-
color: var(--sky-modal-title-color, #252525);
|
|
200
|
-
line-height: 1.4;
|
|
201
|
-
white-space: nowrap;
|
|
202
|
-
overflow: hidden;
|
|
203
|
-
text-overflow: ellipsis;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.sky-modal-subtitle {
|
|
207
|
-
font-size: var(--sky-modal-subtitle-size, 14px);
|
|
208
|
-
color: var(--sky-modal-subtitle-color, #6c757d);
|
|
209
|
-
white-space: nowrap;
|
|
210
|
-
overflow: hidden;
|
|
211
|
-
text-overflow: ellipsis;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.sky-modal-body {
|
|
215
|
-
flex: 1;
|
|
216
|
-
overflow-y: auto;
|
|
217
|
-
overflow-x: hidden;
|
|
218
|
-
padding: var(--sky-modal-body-padding, 14px);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.sky-modal-footer {
|
|
222
|
-
padding: var(--sky-modal-footer-padding, 10px 14px);
|
|
223
|
-
border-top: 1px solid var(--sky-modal-border-color, #dee2e6);
|
|
224
|
-
display: flex;
|
|
225
|
-
justify-content: flex-end;
|
|
226
|
-
flex-shrink: 0;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.sky-modal-footer > * + * {
|
|
230
|
-
margin-left: 10px;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/* Responsive */
|
|
234
|
-
@media (min-width: 768px) {
|
|
235
|
-
.sky-modal {
|
|
236
|
-
border-radius: var(--sky-modal-radius, 8px);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/* iOS safe area */
|
|
241
|
-
@supports (padding-top: env(safe-area-inset-top)) {
|
|
242
|
-
.sky-modal-header {
|
|
243
|
-
padding-top: calc(10px + env(safe-area-inset-top));
|
|
244
|
-
}
|
|
245
|
-
.sky-modal-footer {
|
|
246
|
-
padding-bottom: calc(10px + env(safe-area-inset-bottom));
|
|
247
|
-
}
|
|
248
|
-
.sky-modal-body:last-child {
|
|
249
|
-
padding-bottom: calc(14px + env(safe-area-inset-bottom));
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
</style>
|