@skyservice-developers/vue-dev-kit 1.5.12 → 2.1.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 +105 -15
- package/dist/api-CZ2GQABL.js +309 -0
- package/dist/api-JFgUnzEe.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 +78 -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 -2277
- 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 -266
- package/src/vue3/components/index.js +0 -8
- package/src/vue3/index.js +0 -2
|
@@ -1,458 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport to="body">
|
|
3
|
-
<div
|
|
4
|
-
v-if="modelValue"
|
|
5
|
-
class="sky-dialogbox sky-dialogbox-classic"
|
|
6
|
-
:style="[zIndex ? { 'z-index': zIndex } : null]"
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
class="sky-dialog-overlay"
|
|
10
|
-
>
|
|
11
|
-
<div ref="dialogContent" class="sky-dialog-content">
|
|
12
|
-
<!-- Header -->
|
|
13
|
-
<div
|
|
14
|
-
class="sky-dialog-title"
|
|
15
|
-
:class="{ 'sky-dialog-title-with-subtitle': subtitle }"
|
|
16
|
-
>
|
|
17
|
-
{{ title }}
|
|
18
|
-
<span v-if="subtitle" class="sky-dialog-subtitle">{{
|
|
19
|
-
subtitle
|
|
20
|
-
}}</span>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<button class="sky-dialog-close" :title="closeText" @click="close">
|
|
24
|
-
<svg viewBox="0 0 16 16" width="16" height="16">
|
|
25
|
-
<line
|
|
26
|
-
x1="1"
|
|
27
|
-
y1="15"
|
|
28
|
-
x2="15"
|
|
29
|
-
y2="1"
|
|
30
|
-
stroke="currentColor"
|
|
31
|
-
stroke-width="2"
|
|
32
|
-
/>
|
|
33
|
-
<line
|
|
34
|
-
x1="1"
|
|
35
|
-
y1="1"
|
|
36
|
-
x2="15"
|
|
37
|
-
y2="15"
|
|
38
|
-
stroke="currentColor"
|
|
39
|
-
stroke-width="2"
|
|
40
|
-
/>
|
|
41
|
-
</svg>
|
|
42
|
-
</button>
|
|
43
|
-
|
|
44
|
-
<div class="sky-dialog-clearfix" />
|
|
45
|
-
|
|
46
|
-
<!-- Body -->
|
|
47
|
-
<div
|
|
48
|
-
ref="dialogPaper"
|
|
49
|
-
class="sky-dialog-paper"
|
|
50
|
-
:class="{ 'sky-dialog-paper-no-footer': !showFooter }"
|
|
51
|
-
@touchstart="handleTouchStart"
|
|
52
|
-
@touchend="handleTouchEnd"
|
|
53
|
-
>
|
|
54
|
-
<!-- iOS swipe back area -->
|
|
55
|
-
<div v-if="isIos" class="sky-dialog-swipe-area" />
|
|
56
|
-
<slot></slot>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<!-- Footer -->
|
|
60
|
-
<div
|
|
61
|
-
v-if="showFooter"
|
|
62
|
-
class="sky-dialog-footer"
|
|
63
|
-
>
|
|
64
|
-
<!-- Порожні блоки ремонтують відображення на windows в додатку, не видаляти! -->
|
|
65
|
-
<slot name="buttons"></slot>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</Teleport>
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
<script setup>
|
|
74
|
-
import {
|
|
75
|
-
ref,
|
|
76
|
-
computed,
|
|
77
|
-
watch,
|
|
78
|
-
onMounted,
|
|
79
|
-
onUnmounted,
|
|
80
|
-
nextTick,
|
|
81
|
-
useSlots,
|
|
82
|
-
} from "vue";
|
|
83
|
-
import {
|
|
84
|
-
isIosWebview,
|
|
85
|
-
isAndroidWebview,
|
|
86
|
-
} from "../../shared/utils/webviewCheck";
|
|
87
|
-
|
|
88
|
-
const slots = useSlots();
|
|
89
|
-
|
|
90
|
-
const props = defineProps({
|
|
91
|
-
modelValue: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: false,
|
|
94
|
-
},
|
|
95
|
-
title: {
|
|
96
|
-
type: String,
|
|
97
|
-
default: "",
|
|
98
|
-
},
|
|
99
|
-
subtitle: {
|
|
100
|
-
type: String,
|
|
101
|
-
default: "",
|
|
102
|
-
},
|
|
103
|
-
zIndex: {
|
|
104
|
-
type: [Number, String],
|
|
105
|
-
default: null,
|
|
106
|
-
},
|
|
107
|
-
closeText: {
|
|
108
|
-
type: String,
|
|
109
|
-
default: "Закрити",
|
|
110
|
-
},
|
|
111
|
-
closeOnEsc: {
|
|
112
|
-
type: Boolean,
|
|
113
|
-
default: true,
|
|
114
|
-
},
|
|
115
|
-
hasButtons: {
|
|
116
|
-
type: Boolean,
|
|
117
|
-
default: null,
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const emit = defineEmits(["update:modelValue", "close", "save"]);
|
|
122
|
-
|
|
123
|
-
const dialogContent = ref(null);
|
|
124
|
-
const dialogPaper = ref(null);
|
|
125
|
-
const touchStartX = ref(0);
|
|
126
|
-
|
|
127
|
-
const isIos = computed(() => {
|
|
128
|
-
try {
|
|
129
|
-
return isIosWebview();
|
|
130
|
-
} catch {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
const isAndroid = computed(() => {
|
|
136
|
-
try {
|
|
137
|
-
return isAndroidWebview();
|
|
138
|
-
} catch {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
// Determine if footer should be shown
|
|
144
|
-
const showFooter = computed(() => {
|
|
145
|
-
// If hasButtons prop is explicitly set, use it
|
|
146
|
-
if (props.hasButtons !== null) {
|
|
147
|
-
return props.hasButtons;
|
|
148
|
-
}
|
|
149
|
-
// Fallback to slot check (for direct usage without Dialog wrapper)
|
|
150
|
-
return !!slots.buttons;
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
const close = () => {
|
|
154
|
-
emit("update:modelValue", false);
|
|
155
|
-
emit("close");
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
const handleKeydown = (e) => {
|
|
159
|
-
if (e.key === "Escape" && props.closeOnEsc && props.modelValue) {
|
|
160
|
-
close();
|
|
161
|
-
}
|
|
162
|
-
if (e.key === "Enter" && props.modelValue) {
|
|
163
|
-
emit("save");
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// Touch handling for iOS swipe back
|
|
168
|
-
const handleTouchStart = (e) => {
|
|
169
|
-
if (e.touches[0].clientX < 35) {
|
|
170
|
-
touchStartX.value = e.touches[0].clientX;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
const handleTouchEnd = (e) => {
|
|
175
|
-
if (touchStartX.value > 0 && touchStartX.value < 35) {
|
|
176
|
-
const touchEndX = e.changedTouches[0].clientX;
|
|
177
|
-
if (touchEndX - touchStartX.value > 50) {
|
|
178
|
-
close();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
touchStartX.value = 0;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
// Android notch fix
|
|
185
|
-
const androidFix = () => {
|
|
186
|
-
if (!isAndroid.value || !dialogContent.value) return;
|
|
187
|
-
|
|
188
|
-
try {
|
|
189
|
-
if (typeof Android !== "undefined" && Android.getDisplayCutoutTop) {
|
|
190
|
-
const cutoutTop = Android.getDisplayCutoutTop();
|
|
191
|
-
if (cutoutTop && window.devicePixelRatio > 1.0) {
|
|
192
|
-
const paddingTop = cutoutTop / window.devicePixelRatio;
|
|
193
|
-
dialogContent.value.style.paddingTop = paddingTop + "px";
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
} catch (err) {
|
|
197
|
-
// Android interface not available
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
// Body scroll lock
|
|
202
|
-
watch(
|
|
203
|
-
() => props.modelValue,
|
|
204
|
-
(value) => {
|
|
205
|
-
if (value) {
|
|
206
|
-
document.body.style.overflow = "hidden";
|
|
207
|
-
nextTick(() => {
|
|
208
|
-
androidFix();
|
|
209
|
-
});
|
|
210
|
-
} else {
|
|
211
|
-
document.body.style.overflow = "";
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
onMounted(() => {
|
|
217
|
-
document.addEventListener("keydown", handleKeydown);
|
|
218
|
-
window.addEventListener("resize", androidFix);
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
onUnmounted(() => {
|
|
222
|
-
document.removeEventListener("keydown", handleKeydown);
|
|
223
|
-
window.removeEventListener("resize", androidFix);
|
|
224
|
-
document.body.style.overflow = "";
|
|
225
|
-
});
|
|
226
|
-
</script>
|
|
227
|
-
|
|
228
|
-
<style>
|
|
229
|
-
/* Global styles (не scoped через баг з Teleport) */
|
|
230
|
-
.sky-dialogbox-classic {
|
|
231
|
-
display: block;
|
|
232
|
-
position: fixed;
|
|
233
|
-
padding: 0;
|
|
234
|
-
top: 0;
|
|
235
|
-
left: 0;
|
|
236
|
-
width: 100%;
|
|
237
|
-
height: 100%;
|
|
238
|
-
z-index: var(--sky-dialog-z-index, 9998);
|
|
239
|
-
background: rgba(0, 0, 0, 0.6);
|
|
240
|
-
backdrop-filter: blur(2px);
|
|
241
|
-
}
|
|
242
|
-
</style>
|
|
243
|
-
|
|
244
|
-
<style scoped>
|
|
245
|
-
.sky-dialog-overlay {
|
|
246
|
-
display: flex;
|
|
247
|
-
justify-content: center;
|
|
248
|
-
align-items: center;
|
|
249
|
-
position: fixed;
|
|
250
|
-
padding: 0;
|
|
251
|
-
top: 0;
|
|
252
|
-
left: 0;
|
|
253
|
-
width: 100%;
|
|
254
|
-
height: 100%;
|
|
255
|
-
z-index: 9999;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.sky-dialog-content {
|
|
259
|
-
background: var(--sky-dialog-bg, white);
|
|
260
|
-
width: 100%;
|
|
261
|
-
height: 100%;
|
|
262
|
-
border-radius: var(--sky-dialog-radius, 5px);
|
|
263
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.24);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.sky-dialog-title {
|
|
267
|
-
max-width: calc(100% - 80px);
|
|
268
|
-
font-size: var(--sky-dialog-title-size, 13pt);
|
|
269
|
-
padding: 24px;
|
|
270
|
-
padding-right: 0;
|
|
271
|
-
float: left;
|
|
272
|
-
white-space: nowrap;
|
|
273
|
-
overflow: hidden;
|
|
274
|
-
text-overflow: ellipsis;
|
|
275
|
-
color: var(--sky-dialog-title-color, #252525);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.sky-dialog-subtitle {
|
|
279
|
-
display: block;
|
|
280
|
-
font-size: var(--sky-dialog-subtitle-size, 12pt);
|
|
281
|
-
line-height: 24px;
|
|
282
|
-
color: var(--sky-dialog-subtitle-color, #6c757d);
|
|
283
|
-
white-space: nowrap;
|
|
284
|
-
overflow: hidden;
|
|
285
|
-
text-overflow: ellipsis;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.sky-dialog-close {
|
|
289
|
-
cursor: pointer;
|
|
290
|
-
font-size: 16pt;
|
|
291
|
-
margin: 15px;
|
|
292
|
-
padding: 17px;
|
|
293
|
-
float: right;
|
|
294
|
-
border-radius: 50%;
|
|
295
|
-
width: 50px;
|
|
296
|
-
height: 50px;
|
|
297
|
-
background: transparent;
|
|
298
|
-
border: none;
|
|
299
|
-
display: flex;
|
|
300
|
-
align-items: center;
|
|
301
|
-
justify-content: center;
|
|
302
|
-
color: var(--sky-dialog-close-color, #333);
|
|
303
|
-
transition: background-color 0.2s;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.sky-dialog-close:hover {
|
|
307
|
-
background-color: var(--sky-dialog-close-hover-bg, #f0f0f0);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.sky-dialog-clearfix {
|
|
311
|
-
clear: both;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.sky-dialog-paper {
|
|
315
|
-
height: 100%;
|
|
316
|
-
overflow-y: auto;
|
|
317
|
-
overflow-x: hidden;
|
|
318
|
-
-webkit-overflow-scrolling: touch;
|
|
319
|
-
position: relative;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.sky-dialog-swipe-area {
|
|
323
|
-
position: absolute;
|
|
324
|
-
width: 35px;
|
|
325
|
-
height: 100%;
|
|
326
|
-
left: 0;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.sky-dialog-footer {
|
|
330
|
-
padding: 5px 10px;
|
|
331
|
-
display: flex;
|
|
332
|
-
justify-content: center;
|
|
333
|
-
width: 100%;
|
|
334
|
-
transform: translateY(-52px);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.sky-dialog-footer > * + * {
|
|
338
|
-
margin-left: 10px;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/* Кнопки в футері: 1 = 100%, 2 = по 50% */
|
|
342
|
-
.sky-dialog-footer > :deep(*) {
|
|
343
|
-
flex: 1;
|
|
344
|
-
min-width: 0;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.sky-dialog-footer:has(> :deep(*:only-child)) > :deep(*) {
|
|
348
|
-
max-width: 100%;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.sky-dialog-footer:has(
|
|
352
|
-
> :deep(*:nth-child(2)):not(:has(> :deep(*:nth-child(3))))
|
|
353
|
-
)
|
|
354
|
-
> :deep(*) {
|
|
355
|
-
flex: 1 1 50%;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/* Desktop */
|
|
359
|
-
@media only screen and (min-width: 1400px) {
|
|
360
|
-
.sky-dialog-content {
|
|
361
|
-
width: 75%;
|
|
362
|
-
margin: 0 auto;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/* Tablet and Desktop */
|
|
367
|
-
@media screen and (min-width: 710px) {
|
|
368
|
-
.sky-dialog-paper {
|
|
369
|
-
height: calc(100% - 150px);
|
|
370
|
-
max-height: calc(100% - 150px);
|
|
371
|
-
background-color: #fff;
|
|
372
|
-
margin: 0 10px 60px 10px;
|
|
373
|
-
border-radius: 5px;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/* Full height when no footer */
|
|
377
|
-
.sky-dialog-paper-no-footer {
|
|
378
|
-
height: calc(100% - 70px);
|
|
379
|
-
max-height: calc(100% - 70px);
|
|
380
|
-
margin-bottom: 10px;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
.sky-dialogbox,
|
|
384
|
-
.sky-dialog-overlay {
|
|
385
|
-
padding: 10px;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
/* Mobile */
|
|
390
|
-
@media screen and (max-width: 709px) {
|
|
391
|
-
.sky-dialog-paper {
|
|
392
|
-
height: calc(100% - 142px);
|
|
393
|
-
max-height: calc(100% - 142px);
|
|
394
|
-
background-color: #fff;
|
|
395
|
-
margin: 0 10px 10px 10px;
|
|
396
|
-
border-radius: 5px;
|
|
397
|
-
max-width: 100vw !important;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/* Full height when no footer */
|
|
401
|
-
.sky-dialog-paper-no-footer {
|
|
402
|
-
height: calc(100% - 60px);
|
|
403
|
-
max-height: calc(100% - 60px);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.sky-dialog-footer {
|
|
407
|
-
transform: translateY(-6px);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
@media screen and (max-width: 500px) {
|
|
412
|
-
.sky-dialog-subtitle {
|
|
413
|
-
display: block;
|
|
414
|
-
white-space: nowrap;
|
|
415
|
-
overflow: hidden;
|
|
416
|
-
text-overflow: ellipsis;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.sky-dialog-title-with-subtitle {
|
|
420
|
-
padding: 12px 24px !important;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
@media screen and (max-width: 374px) {
|
|
425
|
-
.sky-dialog-subtitle {
|
|
426
|
-
font-size: 9pt;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/* iPhone safe area support */
|
|
431
|
-
@supports (padding-top: env(safe-area-inset-top)) {
|
|
432
|
-
.sky-dialog-paper {
|
|
433
|
-
height: calc(100% - 150px - env(safe-area-inset-top));
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/* Full height when no footer */
|
|
437
|
-
.sky-dialog-paper-no-footer {
|
|
438
|
-
height: calc(100% - 60px - env(safe-area-inset-top));
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.sky-dialog-footer {
|
|
442
|
-
padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
/* iOS safe area */
|
|
447
|
-
@supports (padding-top: env(safe-area-inset-top)) {
|
|
448
|
-
.sky-dialog-title {
|
|
449
|
-
padding-top: calc(24px + env(safe-area-inset-top));
|
|
450
|
-
}
|
|
451
|
-
.sky-dialog-close {
|
|
452
|
-
margin-top: calc(15px + env(safe-area-inset-top));
|
|
453
|
-
}
|
|
454
|
-
.sky-dialog-paper {
|
|
455
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
</style>
|