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