@skyservice-developers/vue-dev-kit 1.5.5 → 1.5.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyservice-developers/vue-dev-kit",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "Vue 2 and Vue 3 developer toolkit - components and helpers",
5
5
  "type": "module",
6
6
  "main": "./dist/vue3/vue-dev-kit.cjs",
@@ -39,7 +39,6 @@ export interface DialogProps {
39
39
  subtitle?: string
40
40
  zIndex?: number | string
41
41
  closeText?: string
42
- enableAnimation?: boolean
43
42
  closeOnEsc?: boolean
44
43
  mode?: 'next' | 'classic' | null
45
44
  }
@@ -56,3 +55,17 @@ export interface DialogEmits {
56
55
  }
57
56
 
58
57
  export declare const Dialog: DefineComponent<DialogProps>
58
+
59
+ // Button component
60
+ export interface ButtonProps {
61
+ variant?: 'primary' | 'danger' | 'secondary' | 'outline'
62
+ loading?: boolean
63
+ disabled?: boolean
64
+ block?: boolean
65
+ }
66
+
67
+ export interface ButtonSlots {
68
+ 'default'?: () => any
69
+ }
70
+
71
+ export declare const Button: DefineComponent<ButtonProps>
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <button
3
+ class="sky-btn"
4
+ :class="[`sky-btn-${variant}`, { 'sky-btn-block': block, 'sky-btn-loading': loading }]"
5
+ :disabled="disabled || loading"
6
+ v-bind="$attrs"
7
+ >
8
+ <span v-if="loading" class="sky-btn-spinner"></span>
9
+ <slot></slot>
10
+ </button>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'Button',
16
+ inheritAttrs: false,
17
+ props: {
18
+ variant: {
19
+ type: String,
20
+ default: 'primary',
21
+ validator: (v) => ['primary', 'danger', 'secondary', 'outline'].includes(v)
22
+ },
23
+ loading: {
24
+ type: Boolean,
25
+ default: false
26
+ },
27
+ disabled: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ block: {
32
+ type: Boolean,
33
+ default: false
34
+ }
35
+ }
36
+ }
37
+ </script>
38
+
39
+ <style scoped>
40
+ .sky-btn {
41
+ display: inline-flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ gap: 8px;
45
+ padding: var(--sky-btn-padding, 16px 20px);
46
+ border: var(--sky-btn-border, none);
47
+ border-radius: var(--sky-btn-radius, 6px);
48
+ font-size: var(--sky-btn-font-size, 14px);
49
+ font-weight: var(--sky-btn-font-weight, 500);
50
+ line-height: 1;
51
+ cursor: pointer;
52
+ white-space: nowrap;
53
+ user-select: none;
54
+ }
55
+
56
+ .sky-btn-block {
57
+ width: 100%;
58
+ }
59
+
60
+ .sky-btn:disabled {
61
+ opacity: 0.6;
62
+ cursor: not-allowed;
63
+ }
64
+
65
+ /* Primary */
66
+ .sky-btn-primary {
67
+ background: var(--sky-btn-primary-bg, #24973f);
68
+ color: var(--sky-btn-primary-color, #fff);
69
+ }
70
+ .sky-btn-primary:hover:not(:disabled) {
71
+ background: var(--sky-btn-primary-hover-bg, #1e7a33);
72
+ }
73
+ .sky-btn-primary:active:not(:disabled) {
74
+ background: var(--sky-btn-primary-active-bg, #196b2c);
75
+ }
76
+
77
+ /* Danger */
78
+ .sky-btn-danger {
79
+ background: var(--sky-btn-danger-bg, #dc2626);
80
+ color: var(--sky-btn-danger-color, #fff);
81
+ }
82
+ .sky-btn-danger:hover:not(:disabled) {
83
+ background: var(--sky-btn-danger-hover-bg, #b91c1c);
84
+ }
85
+ .sky-btn-danger:active:not(:disabled) {
86
+ background: var(--sky-btn-danger-active-bg, #991b1b);
87
+ }
88
+
89
+ /* Secondary */
90
+ .sky-btn-secondary {
91
+ background: var(--sky-btn-secondary-bg, #f3f4f6);
92
+ color: var(--sky-btn-secondary-color, #374151);
93
+ }
94
+ .sky-btn-secondary:hover:not(:disabled) {
95
+ background: var(--sky-btn-secondary-hover-bg, #e5e7eb);
96
+ }
97
+ .sky-btn-secondary:active:not(:disabled) {
98
+ background: var(--sky-btn-secondary-active-bg, #d1d5db);
99
+ }
100
+
101
+ /* Outline */
102
+ .sky-btn-outline {
103
+ background: var(--sky-btn-outline-bg, transparent);
104
+ color: var(--sky-btn-outline-color, #374151);
105
+ border: var(--sky-btn-border, 1px solid #d1d5db);
106
+ }
107
+ .sky-btn-outline:hover:not(:disabled) {
108
+ background: var(--sky-btn-outline-hover-bg, #f3f4f6);
109
+ }
110
+ .sky-btn-outline:active:not(:disabled) {
111
+ background: var(--sky-btn-outline-active-bg, #e5e7eb);
112
+ }
113
+
114
+ /* Loading spinner */
115
+ .sky-btn-spinner {
116
+ width: 14px;
117
+ height: 14px;
118
+ border: 2px solid currentColor;
119
+ border-top-color: transparent;
120
+ border-radius: 50%;
121
+ animation: sky-btn-spin 0.6s linear infinite;
122
+ flex-shrink: 0;
123
+ }
124
+
125
+ @keyframes sky-btn-spin {
126
+ to { transform: rotate(360deg); }
127
+ }
128
+ </style>
@@ -6,7 +6,6 @@
6
6
  :subtitle="subtitle"
7
7
  :z-index="zIndex"
8
8
  :close-text="closeText"
9
- :enable-animation="enableAnimation"
10
9
  :close-on-esc="closeOnEsc"
11
10
  :has-buttons="!!$slots.buttons"
12
11
  @close="$emit('close')"
@@ -50,10 +49,6 @@ export default {
50
49
  type: String,
51
50
  default: ''
52
51
  },
53
- enableAnimation: {
54
- type: Boolean,
55
- default: false
56
- },
57
52
  closeOnEsc: {
58
53
  type: Boolean,
59
54
  default: true
@@ -1,14 +1,12 @@
1
1
  <template>
2
- <transition :name="enableAnimation ? 'dialog-slide' : ''">
2
+ <div
3
+ v-if="modelValue"
4
+ class="sky-dialogbox sky-dialogbox-classic"
5
+ :style="[zIndex ? { 'z-index': zIndex } : null]"
6
+ >
3
7
  <div
4
- v-if="modelValue"
5
- class="sky-dialogbox sky-dialogbox-classic"
6
- :style="[zIndex ? { 'z-index': zIndex } : null]"
8
+ class="sky-dialog-overlay"
7
9
  >
8
- <div
9
- class="sky-dialog-overlay"
10
- :class="{ 'sky-dialog-animate': enableAnimation }"
11
- >
12
10
  <div ref="dialogContent" class="sky-dialog-content">
13
11
  <!-- Header -->
14
12
  <div
@@ -61,14 +59,13 @@
61
59
  <div
62
60
  v-if="showFooter"
63
61
  class="sky-dialog-footer"
64
- :class="{ 'sky-dialog-footer-animate': enableAnimation }"
65
62
  >
66
63
  <slot name="buttons"></slot>
67
64
  </div>
68
65
  </div>
69
66
  </div>
70
67
  </div>
71
- </transition>
68
+ </div>
72
69
  </template>
73
70
 
74
71
  <script>
@@ -100,10 +97,6 @@ export default {
100
97
  type: String,
101
98
  default: "Закрити",
102
99
  },
103
- enableAnimation: {
104
- type: Boolean,
105
- default: false,
106
- },
107
100
  closeOnEsc: {
108
101
  type: Boolean,
109
102
  default: true,
@@ -431,46 +424,6 @@ export default {
431
424
  }
432
425
  }
433
426
 
434
- /* Animations */
435
- .sky-dialog-animate {
436
- animation: sky-dialog-slide-in 0.4s ease-in-out;
437
- }
438
-
439
- .sky-dialog-footer-animate {
440
- animation: sky-dialog-footer-in 0.4s ease-in-out;
441
- }
442
-
443
- @keyframes sky-dialog-slide-in {
444
- 0% {
445
- opacity: 0;
446
- margin-top: -1600px;
447
- }
448
- 100% {
449
- opacity: 1;
450
- margin-top: 0;
451
- }
452
- }
453
-
454
- @keyframes sky-dialog-footer-in {
455
- 0% {
456
- opacity: 0;
457
- bottom: -100px;
458
- }
459
- 50% {
460
- opacity: 0.25;
461
- bottom: -50px;
462
- }
463
- 100% {
464
- opacity: 1;
465
- bottom: 15px;
466
- }
467
- }
468
-
469
- /* Transition */
470
- .dialog-slide-leave-active {
471
- animation: sky-dialog-slide-in 0.4s reverse;
472
- }
473
-
474
427
  /* iOS safe area */
475
428
  @supports (padding-top: env(safe-area-inset-top)) {
476
429
  .sky-dialog-title {
@@ -1,11 +1,10 @@
1
1
  <template>
2
- <transition :name="enableAnimation ? 'dialog-slide' : ''">
3
- <div
4
- v-if="modelValue"
5
- class="sky-dialogbox sky-dialogbox-next"
6
- :style="[zIndex ? { 'z-index': zIndex } : null]"
7
- >
8
- <div class="sky-dialog-overlay" :class="{ 'sky-dialog-animate': enableAnimation }">
2
+ <div
3
+ v-if="modelValue"
4
+ class="sky-dialogbox sky-dialogbox-next"
5
+ :style="[zIndex ? { 'z-index': zIndex } : null]"
6
+ >
7
+ <div class="sky-dialog-overlay">
9
8
  <div ref="dialogContent" class="sky-dialog-content">
10
9
  <!-- Header -->
11
10
  <div class="sky-dialog-header">
@@ -34,13 +33,13 @@
34
33
  </div>
35
34
 
36
35
  <!-- Footer -->
37
- <div v-if="showFooter" class="sky-dialog-footer" :class="{ 'sky-dialog-footer-animate': enableAnimation }">
36
+ <div v-if="showFooter" class="sky-dialog-footer">
38
37
  <slot name="buttons"></slot>
39
38
  </div>
40
39
  </div>
41
40
  </div>
42
41
  </div>
43
- </transition>
42
+ </div>
44
43
  </template>
45
44
 
46
45
  <script>
@@ -69,10 +68,6 @@ export default {
69
68
  type: String,
70
69
  default: 'Назад'
71
70
  },
72
- enableAnimation: {
73
- type: Boolean,
74
- default: false
75
- },
76
71
  closeOnEsc: {
77
72
  type: Boolean,
78
73
  default: true
@@ -372,46 +367,6 @@ export default {
372
367
  }
373
368
  }
374
369
 
375
- /* Animations */
376
- .sky-dialog-animate {
377
- animation: sky-dialog-slide-in 0.4s ease-in-out;
378
- }
379
-
380
- .sky-dialog-footer-animate {
381
- animation: sky-dialog-footer-in 0.4s ease-in-out;
382
- }
383
-
384
- @keyframes sky-dialog-slide-in {
385
- 0% {
386
- opacity: 0;
387
- margin-top: -1600px;
388
- }
389
- 100% {
390
- opacity: 1;
391
- margin-top: 0;
392
- }
393
- }
394
-
395
- @keyframes sky-dialog-footer-in {
396
- 0% {
397
- opacity: 0;
398
- bottom: -100px;
399
- }
400
- 50% {
401
- opacity: 0.25;
402
- bottom: -50px;
403
- }
404
- 100% {
405
- opacity: 1;
406
- bottom: 15px;
407
- }
408
- }
409
-
410
- /* Transition */
411
- .dialog-slide-leave-active {
412
- animation: sky-dialog-slide-in 0.4s reverse;
413
- }
414
-
415
370
  /* iOS safe area */
416
371
  @supports (padding-top: env(safe-area-inset-top)) {
417
372
  .sky-dialog-header {
@@ -1,7 +1,6 @@
1
1
  <template>
2
- <base-teleport to="body">
3
- <transition>
4
- <div v-if="isOpen" class="sky-modal-overlay" @click.self="handleOverlayClick">
2
+ <base-teleport to="body">
3
+ <div v-if="isOpen" class="sky-modal-overlay" @click.self="handleOverlayClick">
5
4
  <div class="sky-modal" :style="modalStyle">
6
5
  <div class="sky-modal-header">
7
6
  <button class="sky-modal-back" @click="close" :title="closeTitle">
@@ -24,7 +23,6 @@
24
23
  </div>
25
24
  </div>
26
25
  </div>
27
- </transition>
28
26
  </base-teleport>
29
27
  </template>
30
28
 
@@ -232,30 +230,6 @@ export default {
232
230
  margin-left: 10px;
233
231
  }
234
232
 
235
- /* Animations */
236
- .modal-fade-enter-active,
237
- .modal-fade-leave-active {
238
- transition: opacity 0.3s ease;
239
- }
240
-
241
- .modal-fade-enter-active .sky-modal,
242
- .modal-fade-leave-active .sky-modal {
243
- transition: transform 0.3s ease;
244
- }
245
-
246
- .modal-fade-enter,
247
- .modal-fade-leave-to {
248
- opacity: 0;
249
- }
250
-
251
- .modal-fade-enter .sky-modal {
252
- transform: translateY(-20px);
253
- }
254
-
255
- .modal-fade-leave-to .sky-modal {
256
- transform: translateY(20px);
257
- }
258
-
259
233
  /* Responsive */
260
234
  @media (min-width: 768px) {
261
235
  .sky-modal {
@@ -1,5 +1,5 @@
1
1
  export { default as Header } from './Header.vue'
2
2
  export { default as Modal } from './Modal.vue'
3
3
  export { default as Dialog } from './Dialog.vue'
4
-
5
- export {default as BaseTeleport} from './BaseTeleport.vue'
4
+ export { default as Button } from './Button.vue'
5
+ export { default as BaseTeleport } from './BaseTeleport.vue'
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <button
3
+ class="sky-btn"
4
+ :class="[`sky-btn-${variant}`, { 'sky-btn-block': block, 'sky-btn-loading': loading }]"
5
+ :disabled="disabled || loading"
6
+ v-bind="$attrs"
7
+ >
8
+ <span v-if="loading" class="sky-btn-spinner"></span>
9
+ <slot></slot>
10
+ </button>
11
+ </template>
12
+
13
+ <script setup>
14
+ defineProps({
15
+ variant: {
16
+ type: String,
17
+ default: 'primary',
18
+ validator: (v) => ['primary', 'danger', 'secondary', 'outline'].includes(v)
19
+ },
20
+ loading: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ block: {
29
+ type: Boolean,
30
+ default: false
31
+ }
32
+ })
33
+ </script>
34
+
35
+ <style scoped>
36
+ .sky-btn {
37
+ display: inline-flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ gap: 8px;
41
+ padding: var(--sky-btn-padding, 16px 20px);
42
+ border: var(--sky-btn-border, none);
43
+ border-radius: var(--sky-btn-radius, 6px);
44
+ font-size: var(--sky-btn-font-size, 14px);
45
+ font-weight: var(--sky-btn-font-weight, 500);
46
+ line-height: 1;
47
+ cursor: pointer;
48
+ white-space: nowrap;
49
+ user-select: none;
50
+ }
51
+
52
+ .sky-btn-block {
53
+ width: 100%;
54
+ }
55
+
56
+ .sky-btn:disabled {
57
+ opacity: 0.6;
58
+ cursor: not-allowed;
59
+ }
60
+
61
+ /* Primary */
62
+ .sky-btn-primary {
63
+ background: var(--sky-btn-primary-bg, #24973f);
64
+ color: var(--sky-btn-primary-color, #fff);
65
+ }
66
+ .sky-btn-primary:hover:not(:disabled) {
67
+ background: var(--sky-btn-primary-hover-bg, #1e7a33);
68
+ }
69
+ .sky-btn-primary:active:not(:disabled) {
70
+ background: var(--sky-btn-primary-active-bg, #196b2c);
71
+ }
72
+
73
+ /* Danger */
74
+ .sky-btn-danger {
75
+ background: var(--sky-btn-danger-bg, #dc2626);
76
+ color: var(--sky-btn-danger-color, #fff);
77
+ }
78
+ .sky-btn-danger:hover:not(:disabled) {
79
+ background: var(--sky-btn-danger-hover-bg, #b91c1c);
80
+ }
81
+ .sky-btn-danger:active:not(:disabled) {
82
+ background: var(--sky-btn-danger-active-bg, #991b1b);
83
+ }
84
+
85
+ /* Secondary */
86
+ .sky-btn-secondary {
87
+ background: var(--sky-btn-secondary-bg, #f3f4f6);
88
+ color: var(--sky-btn-secondary-color, #374151);
89
+ }
90
+ .sky-btn-secondary:hover:not(:disabled) {
91
+ background: var(--sky-btn-secondary-hover-bg, #e5e7eb);
92
+ }
93
+ .sky-btn-secondary:active:not(:disabled) {
94
+ background: var(--sky-btn-secondary-active-bg, #d1d5db);
95
+ }
96
+
97
+ /* Outline */
98
+ .sky-btn-outline {
99
+ background: var(--sky-btn-outline-bg, transparent);
100
+ color: var(--sky-btn-outline-color, #374151);
101
+ border: var(--sky-btn-border, 1px solid #d1d5db);
102
+ }
103
+ .sky-btn-outline:hover:not(:disabled) {
104
+ background: var(--sky-btn-outline-hover-bg, #f3f4f6);
105
+ }
106
+ .sky-btn-outline:active:not(:disabled) {
107
+ background: var(--sky-btn-outline-active-bg, #e5e7eb);
108
+ }
109
+
110
+ /* Loading spinner */
111
+ .sky-btn-spinner {
112
+ width: 14px;
113
+ height: 14px;
114
+ border: 2px solid currentColor;
115
+ border-top-color: transparent;
116
+ border-radius: 50%;
117
+ animation: sky-btn-spin 0.6s linear infinite;
118
+ flex-shrink: 0;
119
+ }
120
+
121
+ @keyframes sky-btn-spin {
122
+ to { transform: rotate(360deg); }
123
+ }
124
+ </style>
@@ -6,7 +6,6 @@
6
6
  :subtitle="subtitle"
7
7
  :z-index="zIndex"
8
8
  :close-text="closeText"
9
- :enable-animation="enableAnimation"
10
9
  :close-on-esc="closeOnEsc"
11
10
  :has-buttons="!!$slots.buttons"
12
11
  @close="$emit('close')"
@@ -45,10 +44,6 @@ const props = defineProps({
45
44
  type: String,
46
45
  default: ''
47
46
  },
48
- enableAnimation: {
49
- type: Boolean,
50
- default: false
51
- },
52
47
  closeOnEsc: {
53
48
  type: Boolean,
54
49
  default: true
@@ -1,15 +1,13 @@
1
1
  <template>
2
2
  <Teleport to="body">
3
- <transition :name="enableAnimation ? 'dialog-slide' : ''">
3
+ <div
4
+ v-if="modelValue"
5
+ class="sky-dialogbox sky-dialogbox-classic"
6
+ :style="[zIndex ? { 'z-index': zIndex } : null]"
7
+ >
4
8
  <div
5
- v-if="modelValue"
6
- class="sky-dialogbox sky-dialogbox-classic"
7
- :style="[zIndex ? { 'z-index': zIndex } : null]"
9
+ class="sky-dialog-overlay"
8
10
  >
9
- <div
10
- class="sky-dialog-overlay"
11
- :class="{ 'sky-dialog-animate': enableAnimation }"
12
- >
13
11
  <div ref="dialogContent" class="sky-dialog-content">
14
12
  <!-- Header -->
15
13
  <div
@@ -62,7 +60,6 @@
62
60
  <div
63
61
  v-if="showFooter"
64
62
  class="sky-dialog-footer"
65
- :class="{ 'sky-dialog-footer-animate': enableAnimation }"
66
63
  >
67
64
  <!-- Порожні блоки ремонтують відображення на windows в додатку, не видаляти! -->
68
65
  <slot name="buttons"></slot>
@@ -70,7 +67,6 @@
70
67
  </div>
71
68
  </div>
72
69
  </div>
73
- </transition>
74
70
  </Teleport>
75
71
  </template>
76
72
 
@@ -112,10 +108,6 @@ const props = defineProps({
112
108
  type: String,
113
109
  default: "Закрити",
114
110
  },
115
- enableAnimation: {
116
- type: Boolean,
117
- default: false,
118
- },
119
111
  closeOnEsc: {
120
112
  type: Boolean,
121
113
  default: true,
@@ -451,46 +443,6 @@ onUnmounted(() => {
451
443
  }
452
444
  }
453
445
 
454
- /* Animations */
455
- .sky-dialog-animate {
456
- animation: sky-dialog-slide-in 0.4s ease-in-out;
457
- }
458
-
459
- .sky-dialog-footer-animate {
460
- animation: sky-dialog-footer-in 0.4s ease-in-out;
461
- }
462
-
463
- @keyframes sky-dialog-slide-in {
464
- 0% {
465
- opacity: 0;
466
- margin-top: -1600px;
467
- }
468
- 100% {
469
- opacity: 1;
470
- margin-top: 0;
471
- }
472
- }
473
-
474
- @keyframes sky-dialog-footer-in {
475
- 0% {
476
- opacity: 0;
477
- bottom: -100px;
478
- }
479
- 50% {
480
- opacity: 0.25;
481
- bottom: -50px;
482
- }
483
- 100% {
484
- opacity: 1;
485
- bottom: 15px;
486
- }
487
- }
488
-
489
- /* Transition */
490
- .dialog-slide-leave-active {
491
- animation: sky-dialog-slide-in 0.4s reverse;
492
- }
493
-
494
446
  /* iOS safe area */
495
447
  @supports (padding-top: env(safe-area-inset-top)) {
496
448
  .sky-dialog-title {