@burh/nuxt-core 1.0.243 → 1.0.245

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.
@@ -2,13 +2,13 @@
2
2
  <el-dialog
3
3
  :visible.sync="isActive"
4
4
  width="80%"
5
- custom-class="position-relative"
5
+ :custom-class="`position-relative user__preview__container ${isLoading ? 'loading' : ''}`"
6
6
  @close="$emit('close')"
7
7
  class="test-radius"
8
8
  >
9
9
  <template>
10
10
  <div class="row d-flex justify-content-between mx-0 user-pdf">
11
- <img v-show="coverPhoto" :src="coverPhoto" alt="" />
11
+ <img v-if="!isLoading" v-show="coverPhoto" :src="coverPhoto" alt="" />
12
12
  <div v-show="!coverPhoto" class="no-cover-photo"></div>
13
13
  <slot name="content"></slot>
14
14
  </div>
@@ -72,7 +72,8 @@ export default {
72
72
  showTools: false,
73
73
  coverPhoto: this.cover,
74
74
  hasPrevUser: false,
75
- hasNextUser: false
75
+ hasNextUser: false,
76
+ isLoading: false,
76
77
  };
77
78
  },
78
79
  watch: {
@@ -91,12 +92,12 @@ export default {
91
92
  },
92
93
  methods: {
93
94
  preUser() {
94
- if (this.currentUserIndex <= 0) return;
95
+ if (this.currentUserIndex <= 0 || this.isLoading) return;
95
96
 
96
97
  this.$emit('prev-user');
97
98
  },
98
99
  nextUser() {
99
- if (this.currentUserIndex >= (this.maxUsers - 1)) return;
100
+ if (this.currentUserIndex >= (this.maxUsers - 1) || this.isLoading) return;
100
101
 
101
102
  this.$emit('next-user');
102
103
  },
@@ -112,6 +113,8 @@ export default {
112
113
  }
113
114
  },
114
115
  handleArrowsActive() {
116
+ this.isLoading = true;
117
+
115
118
  if (this.currentUserIndex <= 0) {
116
119
  this.hasPrevUser = false;
117
120
  this.hasNextUser = true;
@@ -125,6 +128,8 @@ export default {
125
128
  if (this.currentUserIndex === (this.maxUsers - 1)) {
126
129
  this.hasNextUser = false;
127
130
  }
131
+
132
+ setTimeout(() => this.isLoading = false, 1000);
128
133
  }
129
134
  },
130
135
  beforeMount() {
@@ -170,6 +175,7 @@ export default {
170
175
  width: 100%;
171
176
  height: 100vh;
172
177
  z-index: -1;
178
+ pointer-events: none;
173
179
  > button {
174
180
  width: 42px;
175
181
  height: 42px;
@@ -180,6 +186,7 @@ export default {
180
186
  background: transparent;
181
187
  font-size: 2rem;
182
188
  color: $primary;
189
+ pointer-events: all;
183
190
  }
184
191
  }
185
192
 
@@ -228,4 +235,11 @@ export default {
228
235
  height: 150px;
229
236
  }
230
237
  }
238
+
239
+ /deep/ .user__preview__container {
240
+ transition: opacity 0.2s;
241
+ &.loading {
242
+ opacity: 0;
243
+ }
244
+ }
231
245
  </style>
@@ -1,111 +1,116 @@
1
1
  <template>
2
- <modal
3
- :show.sync="openModal"
4
- v-on:close="$emit('close-modal-video')"
5
- modalContentClasses="container-fluid"
6
- class="modal"
7
- >
8
- <template slot="header">
9
- <div class="">
10
- <h2 class="display-4">Editar capa do treinamento</h2>
11
- </div>
12
- </template>
2
+ <modal
3
+ :show.sync="openModal"
4
+ v-on:close="$emit('close-modal-video')"
5
+ modalContentClasses="container-fluid"
6
+ class="modal"
7
+ >
8
+ <template slot="header">
9
+ <div class="">
10
+ <h2 class="display-4">{{modalTitle}}</h2>
11
+ </div>
12
+ </template>
13
13
 
14
- <dropzone-file-upload
15
- v-if="image == null"
16
- v-on:error="showError"
17
- ref="Mydropzone"
18
- :options="dropzoneOptions"
19
- v-model="fileToUpload"
20
- class=""
21
- />
14
+ <dropzone-file-upload
15
+ v-if="image == null"
16
+ v-on:error="showError"
17
+ ref="Mydropzone"
18
+ :options="dropzoneOptions"
19
+ v-model="fileToUpload"
20
+ class=""
21
+ :multiple="multiple"
22
+ />
22
23
 
23
- <div class="row mb-4" v-if="image != null">
24
- <img class="col-12" :src="image" alt="Cover" />
25
- </div>
24
+ <div class="row mb-4" v-if="image != null">
25
+ <img class="col-12" :src="image" alt="Cover" />
26
+ </div>
26
27
 
27
- <template slot="footer">
28
- <base-button type="link" @click="removeImage"
29
- >Remover Imagem
30
- </base-button>
31
- <base-button
32
- type="primary"
33
- class="ml-auto"
34
- role="button"
35
- @click="saveImage"
36
- >Salvar Imagem
37
- </base-button>
38
- </template>
39
- </modal>
28
+ <template slot="footer">
29
+ <base-button type="link" @click="removeImage"
30
+ >Remover
31
+ </base-button>
32
+ <base-button
33
+ type="primary"
34
+ class="ml-auto"
35
+ role="button"
36
+ @click="saveImage"
37
+ >Salvar
38
+ </base-button>
39
+ </template>
40
+ </modal>
40
41
  </template>
41
42
  <script>
42
43
  import DropzoneFileUpload from '@burh/nuxt-core/components/argon-core/Inputs/DropzoneFileUpload.vue';
43
44
  import swal from 'sweetalert2';
44
45
 
45
46
  export default {
46
- components: {
47
- DropzoneFileUpload
48
- },
49
- props: {
50
- show: false,
51
- image: {
52
- type: String,
53
- default: null
54
- }
55
- },
56
- data() {
57
- return {
58
- fileToUpload: null,
59
- dropzoneOptions: {
60
- maxFiles: 1,
61
- maxFilesize: 0.2, // ESTÁ DEFINIDO TAMANHO MÁXIMO DE 20 KB NA FOTO
62
- dictFileTooBig:
47
+ name: 'dropzone-modal',
48
+ components: {
49
+ DropzoneFileUpload
50
+ },
51
+ props: {
52
+ show: false,
53
+ image: {
54
+ type: String,
55
+ default: null
56
+ },
57
+ modalTitle: String,
58
+ multiple: Boolean
59
+ },
60
+ data() {
61
+ return {
62
+ fileToUpload: null,
63
+ dropzoneOptions: {
64
+ maxFiles: 1,
65
+ maxFilesize: 0.2, // ESTÁ DEFINIDO TAMANHO MÁXIMO DE 20 KB NA FOTO
66
+ dictFileTooBig:
63
67
  'A imagem que você tentou inserir é maior que 200KB',
64
- dictDefaultMessage: 'Clique ou arraste seu arquivo aqui'
65
- }
66
- };
67
- },
68
- model: {
69
- prop: 'show'
70
- },
71
- computed: {
72
- openModal: {
73
- get() {
74
- return this.show;
75
- },
76
- set(show) {
77
- this.$emit('input', show);
78
- }
79
- }
80
- },
81
- methods: {
82
- showError(file, message) {
83
- return swal.fire({
84
- title: 'Erro',
85
- text: message,
86
- type: 'error',
87
- buttonsStyling: false,
88
- confirmButtonText: 'Ok, fechar!',
89
- confirmButtonClass: 'btn btn-primary btn-fill'
90
- });
91
- },
92
- removeImage() {
93
- if (!this.image) {
94
- this.$refs.Mydropzone.removeAllFiles();
95
- }
96
- this.$emit('remove-image');
97
- },
98
- async saveImage() {
99
- if (this.fileToUpload != null) {
100
- let image = this.fileToUpload;
101
- if (image[0].size <= 200000) {
102
- this.$emit('save-img', image);
103
- }
104
- }
68
+ dictDefaultMessage: 'Clique ou arraste seu arquivo aqui',
69
+ acceptedFiles: 'image/*',
70
+ }
71
+ };
72
+ },
73
+ model: {
74
+ prop: 'show'
75
+ },
76
+ computed: {
77
+ openModal: {
78
+ get() {
79
+ return this.show;
80
+ },
81
+ set(show) {
82
+ this.$emit('input', show);
83
+ }
84
+ }
85
+ },
86
+ methods: {
87
+ showError(file, message) {
88
+ return swal.fire({
89
+ title: 'Erro',
90
+ text: message,
91
+ type: 'error',
92
+ buttonsStyling: false,
93
+ confirmButtonText: 'Ok, fechar!',
94
+ confirmButtonClass: 'btn btn-primary btn-fill'
95
+ });
96
+ },
97
+ removeImage() {
98
+ if (!this.image) {
99
+ this.$refs.Mydropzone.removeAllFiles();
100
+ }
101
+ this.$emit('remove-image');
102
+ },
103
+ async saveImage() {
104
+ if (this.fileToUpload != null) {
105
+ let image = this.fileToUpload;
106
+ if (image[0].size <= 200000) {
107
+ this.$emit('save-img', image);
108
+ }
109
+ }
105
110
 
106
- this.$emit('close-modal-video');
107
- }
108
- }
111
+ this.$emit('close-modal-video');
112
+ }
113
+ }
109
114
  };
110
115
  </script>
111
116
  <style lang="scss" scoped>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.243",
3
+ "version": "1.0.245",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {