@burh/nuxt-core 1.0.244 → 1.0.246

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.
@@ -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.244",
3
+ "version": "1.0.246",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {