@skyservice-developers/vue-dev-kit 1.0.3 → 1.0.5
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/dist/style.css +1 -1
- package/dist/vue-dev-kit.cjs +1 -1
- package/dist/vue-dev-kit.js +443 -429
- package/package.json +3 -2
- package/src/components/Dialog.vue +2 -1
- package/src/components/DialogModal.vue +27 -10
- package/src/components/DialogNext.vue +27 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyservice-developers/vue-dev-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Vue 3 developer toolkit - components and helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/vue-dev-kit.cjs",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"dev": "vite",
|
|
23
23
|
"build": "vite build",
|
|
24
24
|
"preview": "vite preview",
|
|
25
|
-
"prepublishOnly": "npm run build"
|
|
25
|
+
"prepublishOnly": "npm run build",
|
|
26
|
+
"release": "npm publish --access public"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"vue": "^3.4.0"
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
:close-text="closeText"
|
|
9
9
|
:enable-animation="enableAnimation"
|
|
10
10
|
:close-on-esc="closeOnEsc"
|
|
11
|
+
:has-buttons="!!$slots.buttons"
|
|
11
12
|
@close="$emit('close')"
|
|
12
13
|
@save="$emit('save')"
|
|
13
14
|
>
|
|
14
15
|
<slot></slot>
|
|
15
|
-
<template #buttons>
|
|
16
|
+
<template v-if="$slots.buttons" #buttons>
|
|
16
17
|
<slot name="buttons"></slot>
|
|
17
18
|
</template>
|
|
18
19
|
</component>
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
<div
|
|
28
28
|
ref="dialogPaper"
|
|
29
29
|
class="sky-dialog-paper"
|
|
30
|
+
:class="{ 'sky-dialog-paper-no-footer': !showFooter }"
|
|
30
31
|
@touchstart="handleTouchStart"
|
|
31
32
|
@touchend="handleTouchEnd"
|
|
32
33
|
>
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
</div>
|
|
37
38
|
|
|
38
39
|
<!-- Footer -->
|
|
39
|
-
<div v-if="
|
|
40
|
+
<div v-if="showFooter" class="sky-dialog-footer" :class="{ 'sky-dialog-footer-animate': enableAnimation }">
|
|
40
41
|
<slot name="buttons"></slot>
|
|
41
42
|
</div>
|
|
42
43
|
</div>
|
|
@@ -47,9 +48,11 @@
|
|
|
47
48
|
</template>
|
|
48
49
|
|
|
49
50
|
<script setup>
|
|
50
|
-
import { ref, computed, watch, onMounted, onUnmounted, nextTick } from 'vue'
|
|
51
|
+
import { ref, computed, watch, onMounted, onUnmounted, nextTick, useSlots } from 'vue'
|
|
51
52
|
import { isIosWebview, isAndroidWebview } from '../utils/webviewCheck'
|
|
52
53
|
|
|
54
|
+
const slots = useSlots()
|
|
55
|
+
|
|
53
56
|
const props = defineProps({
|
|
54
57
|
modelValue: {
|
|
55
58
|
type: Boolean,
|
|
@@ -78,6 +81,10 @@ const props = defineProps({
|
|
|
78
81
|
closeOnEsc: {
|
|
79
82
|
type: Boolean,
|
|
80
83
|
default: true
|
|
84
|
+
},
|
|
85
|
+
hasButtons: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: null
|
|
81
88
|
}
|
|
82
89
|
})
|
|
83
90
|
|
|
@@ -103,6 +110,16 @@ const isAndroid = computed(() => {
|
|
|
103
110
|
}
|
|
104
111
|
})
|
|
105
112
|
|
|
113
|
+
// Determine if footer should be shown
|
|
114
|
+
const showFooter = computed(() => {
|
|
115
|
+
// If hasButtons prop is explicitly set, use it
|
|
116
|
+
if (props.hasButtons !== null) {
|
|
117
|
+
return props.hasButtons
|
|
118
|
+
}
|
|
119
|
+
// Fallback to slot check (for direct usage without Dialog wrapper)
|
|
120
|
+
return !!slots.buttons
|
|
121
|
+
})
|
|
122
|
+
|
|
106
123
|
const close = () => {
|
|
107
124
|
emit('update:modelValue', false)
|
|
108
125
|
emit('close')
|
|
@@ -318,9 +335,9 @@ onUnmounted(() => {
|
|
|
318
335
|
}
|
|
319
336
|
|
|
320
337
|
/* Full height when no footer */
|
|
321
|
-
.sky-dialog-
|
|
322
|
-
height: calc(100% -
|
|
323
|
-
max-height: calc(100% -
|
|
338
|
+
.sky-dialog-paper-no-footer {
|
|
339
|
+
height: calc(100% - 70px);
|
|
340
|
+
max-height: calc(100% - 70px);
|
|
324
341
|
margin-bottom: 10px;
|
|
325
342
|
}
|
|
326
343
|
|
|
@@ -342,9 +359,9 @@ onUnmounted(() => {
|
|
|
342
359
|
}
|
|
343
360
|
|
|
344
361
|
/* Full height when no footer */
|
|
345
|
-
.sky-dialog-
|
|
346
|
-
height: calc(100% -
|
|
347
|
-
max-height: calc(100% -
|
|
362
|
+
.sky-dialog-paper-no-footer {
|
|
363
|
+
height: calc(100% - 60px);
|
|
364
|
+
max-height: calc(100% - 60px);
|
|
348
365
|
}
|
|
349
366
|
|
|
350
367
|
.sky-dialog-footer {
|
|
@@ -378,8 +395,8 @@ onUnmounted(() => {
|
|
|
378
395
|
}
|
|
379
396
|
|
|
380
397
|
/* Full height when no footer */
|
|
381
|
-
.sky-dialog-
|
|
382
|
-
height: calc(100% -
|
|
398
|
+
.sky-dialog-paper-no-footer {
|
|
399
|
+
height: calc(100% - 60px - env(safe-area-inset-top));
|
|
383
400
|
}
|
|
384
401
|
|
|
385
402
|
.sky-dialog-footer {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
<div
|
|
27
27
|
ref="dialogPaper"
|
|
28
28
|
class="sky-dialog-paper"
|
|
29
|
+
:class="{ 'sky-dialog-paper-no-footer': !showFooter }"
|
|
29
30
|
@touchstart="handleTouchStart"
|
|
30
31
|
@touchend="handleTouchEnd"
|
|
31
32
|
>
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
</div>
|
|
36
37
|
|
|
37
38
|
<!-- Footer -->
|
|
38
|
-
<div v-if="
|
|
39
|
+
<div v-if="showFooter" class="sky-dialog-footer" :class="{ 'sky-dialog-footer-animate': enableAnimation }">
|
|
39
40
|
<slot name="buttons"></slot>
|
|
40
41
|
</div>
|
|
41
42
|
</div>
|
|
@@ -46,9 +47,11 @@
|
|
|
46
47
|
</template>
|
|
47
48
|
|
|
48
49
|
<script setup>
|
|
49
|
-
import { ref, computed, watch, onMounted, onUnmounted, nextTick } from 'vue'
|
|
50
|
+
import { ref, computed, watch, onMounted, onUnmounted, nextTick, useSlots } from 'vue'
|
|
50
51
|
import { isIosWebview, isAndroidWebview } from '../utils/webviewCheck'
|
|
51
52
|
|
|
53
|
+
const slots = useSlots()
|
|
54
|
+
|
|
52
55
|
const props = defineProps({
|
|
53
56
|
modelValue: {
|
|
54
57
|
type: Boolean,
|
|
@@ -77,6 +80,10 @@ const props = defineProps({
|
|
|
77
80
|
closeOnEsc: {
|
|
78
81
|
type: Boolean,
|
|
79
82
|
default: true
|
|
83
|
+
},
|
|
84
|
+
hasButtons: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: null
|
|
80
87
|
}
|
|
81
88
|
})
|
|
82
89
|
|
|
@@ -102,6 +109,16 @@ const isAndroid = computed(() => {
|
|
|
102
109
|
}
|
|
103
110
|
})
|
|
104
111
|
|
|
112
|
+
// Determine if footer should be shown
|
|
113
|
+
const showFooter = computed(() => {
|
|
114
|
+
// If hasButtons prop is explicitly set, use it
|
|
115
|
+
if (props.hasButtons !== null) {
|
|
116
|
+
return props.hasButtons
|
|
117
|
+
}
|
|
118
|
+
// Fallback to slot check (for direct usage without Dialog wrapper)
|
|
119
|
+
return !!slots.buttons
|
|
120
|
+
})
|
|
121
|
+
|
|
105
122
|
const close = () => {
|
|
106
123
|
emit('update:modelValue', false)
|
|
107
124
|
emit('close')
|
|
@@ -314,9 +331,9 @@ onUnmounted(() => {
|
|
|
314
331
|
}
|
|
315
332
|
|
|
316
333
|
/* Full height when no footer */
|
|
317
|
-
.sky-dialog-
|
|
318
|
-
height: calc(100% -
|
|
319
|
-
max-height: calc(100% -
|
|
334
|
+
.sky-dialog-paper-no-footer {
|
|
335
|
+
height: calc(100% - 70px);
|
|
336
|
+
max-height: calc(100% - 70px);
|
|
320
337
|
margin-bottom: 10px;
|
|
321
338
|
}
|
|
322
339
|
}
|
|
@@ -332,9 +349,9 @@ onUnmounted(() => {
|
|
|
332
349
|
}
|
|
333
350
|
|
|
334
351
|
/* Full height when no footer */
|
|
335
|
-
.sky-dialog-
|
|
336
|
-
height: calc(100% -
|
|
337
|
-
max-height: calc(100% -
|
|
352
|
+
.sky-dialog-paper-no-footer {
|
|
353
|
+
height: calc(100% - 60px);
|
|
354
|
+
max-height: calc(100% - 60px);
|
|
338
355
|
}
|
|
339
356
|
|
|
340
357
|
.sky-dialog-footer {
|
|
@@ -368,8 +385,8 @@ onUnmounted(() => {
|
|
|
368
385
|
}
|
|
369
386
|
|
|
370
387
|
/* Full height when no footer */
|
|
371
|
-
.sky-dialog-
|
|
372
|
-
height: calc(100% -
|
|
388
|
+
.sky-dialog-paper-no-footer {
|
|
389
|
+
height: calc(100% - 60px - env(safe-area-inset-top));
|
|
373
390
|
}
|
|
374
391
|
|
|
375
392
|
.sky-dialog-footer {
|