@burh/nuxt-core 1.0.272 → 1.0.274

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,217 +1,217 @@
1
1
  <template>
2
- <modal :show="isModalOpen" v-on:close="closeModal" size="xl" class="modal">
3
- <template slot="header">
4
- <h2 class="display-4 px-4">
5
- Insira os e-mail que deseja enviar o treinamento
6
- </h2>
7
- </template>
8
- <div class="row px-4">
9
- <div class="col-4">
10
- <label for="name">Nome Completo</label>
11
- </div>
12
- <div class="col-4">
13
- <label for="email">E-mail</label>
14
- </div>
15
- <div class="col-4">
16
- <label for="email">Cargo</label>
17
- </div>
18
- </div>
19
- <validation-observer ref="sendCourse">
20
- <div class="row px-4" v-for="(slot, idx) in slots" :key="idx">
21
- <validation-provider
22
- tag="div"
23
- class="col-4"
24
- :vid="`send-name-${idx}`"
25
- name="Nome"
26
- rules="required|regex:\w+\s+\w+"
27
- v-slot="{ errors }"
28
- >
29
- <base-input
30
- v-model="slot.name"
31
- :error="errors[0]"
32
- :valid="errors.length ? true : false"
33
- />
34
- </validation-provider>
35
-
36
- <validation-provider
37
- tag="div"
38
- class="col-4"
39
- :vid="`send-email-${idx}`"
40
- name="Email"
41
- rules="required|email"
42
- v-slot="{ errors }"
43
- >
44
- <base-input
45
- v-model="slot.email"
46
- :error="errors[0]"
47
- :valid="errors.length ? true : false"
48
- />
49
- </validation-provider>
50
- <div tag="div" class="col-3" name="role">
51
- <el-select
52
- class="select-danger"
53
- v-model="slot.role"
54
- :placeholder="''"
55
- >
56
- <el-option
57
- v-for="role in corporativeRole"
58
- :key="role.id"
59
- :label="role.name"
60
- :value="role.id"
61
- >
62
- </el-option>
63
- </el-select>
64
- </div>
65
- <div class="col-1">
66
- <i
67
- v-if="idx !== slots.length - 1"
68
- class="fa fa-trash pointer"
69
- @click="removeSlot(idx)"
70
- ></i>
71
- <i v-else class="fa fa-plus pointer" @click="addSlot"></i>
72
- </div>
73
- </div>
74
- </validation-observer>
75
-
76
- <hr />
77
-
78
- <div class="row px-4">
79
- <div class="col-12">
80
- <label for="courses">Acesso aos Treinamentos</label>
81
- </div>
82
- </div>
83
- <div class="row px-4">
84
- <div class="col-12">
85
- <el-select
86
- v-model="coursesToSend"
87
- multiple
88
- style="width: 100%;"
89
- placeholder="Treinamentos"
90
- name="courses"
91
- >
92
- <el-option
93
- v-for="item in courses"
94
- :key="item.id"
95
- :label="item.name"
96
- :value="item.id"
97
- >
98
- </el-option>
99
- </el-select>
100
- </div>
101
- </div>
102
-
103
- <div class="row">
104
- <base-button class="mx-auto" type="primary" @click="sendTest"
105
- >Enviar</base-button
106
- >
107
- </div>
108
- </modal>
2
+ <modal :show="isModalOpen" v-on:close="closeModal" size="xl" class="modal">
3
+ <template slot="header">
4
+ <h2 class="display-4 px-4">
5
+ Insira os e-mail que deseja enviar o treinamento
6
+ </h2>
7
+ </template>
8
+ <div class="row px-4">
9
+ <div class="col-4">
10
+ <label for="name">Nome Completo</label>
11
+ </div>
12
+ <div class="col-4">
13
+ <label for="email">E-mail</label>
14
+ </div>
15
+ <div class="col-4">
16
+ <label for="email">Cargo</label>
17
+ </div>
18
+ </div>
19
+ <validation-observer ref="sendCourse">
20
+ <div class="row px-4" v-for="(slot, idx) in slots" :key="idx">
21
+ <validation-provider
22
+ tag="div"
23
+ class="col-4"
24
+ :vid="`send-name-${idx}`"
25
+ name="Nome"
26
+ rules="required|regex:\w+\s+\w+"
27
+ v-slot="{ errors }"
28
+ >
29
+ <base-input
30
+ v-model="slot.name"
31
+ :error="errors[0]"
32
+ :valid="errors.length ? true : false"
33
+ />
34
+ </validation-provider>
35
+
36
+ <validation-provider
37
+ tag="div"
38
+ class="col-4"
39
+ :vid="`send-email-${idx}`"
40
+ name="Email"
41
+ rules="required|email"
42
+ v-slot="{ errors }"
43
+ >
44
+ <base-input
45
+ v-model="slot.email"
46
+ :error="errors[0]"
47
+ :valid="errors.length ? true : false"
48
+ />
49
+ </validation-provider>
50
+ <div tag="div" class="col-3" name="role">
51
+ <el-select
52
+ class="select-danger"
53
+ v-model="slot.role"
54
+ :placeholder="''"
55
+ >
56
+ <el-option
57
+ v-for="role in corporativeRole"
58
+ :key="role.id"
59
+ :label="role.name"
60
+ :value="role.id"
61
+ >
62
+ </el-option>
63
+ </el-select>
64
+ </div>
65
+ <div class="col-1">
66
+ <i
67
+ v-if="idx !== slots.length - 1"
68
+ class="fa fa-trash pointer"
69
+ @click="removeSlot(idx)"
70
+ ></i>
71
+ <i v-else class="fa fa-plus pointer" @click="addSlot"></i>
72
+ </div>
73
+ </div>
74
+ </validation-observer>
75
+
76
+ <hr />
77
+
78
+ <div class="row px-4">
79
+ <div class="col-12">
80
+ <label for="courses">Acesso aos Treinamentos</label>
81
+ </div>
82
+ </div>
83
+ <div class="row px-4">
84
+ <div class="col-12">
85
+ <el-select
86
+ v-model="coursesToSend"
87
+ multiple
88
+ style="width: 100%;"
89
+ placeholder="Treinamentos"
90
+ name="courses"
91
+ >
92
+ <el-option
93
+ v-for="item in courses"
94
+ :key="item.id"
95
+ :label="item.name"
96
+ :value="item.id"
97
+ >
98
+ </el-option>
99
+ </el-select>
100
+ </div>
101
+ </div>
102
+
103
+ <div class="row">
104
+ <base-button class="mx-auto" type="primary" @click="sendTest"
105
+ >Enviar</base-button
106
+ >
107
+ </div>
108
+ </modal>
109
109
  </template>
110
110
 
111
111
  <script>
112
- import { Select, Option } from "element-ui";
112
+ import { Select, Option } from 'element-ui';
113
113
 
114
114
  export default {
115
- name: "send-course",
116
- components: {
117
- [Select.name]: Select,
118
- [Option.name]: Option
119
- },
120
- props: {
121
- isModalOpen: {
122
- type: Boolean,
123
- default: false
124
- },
125
- selectedCourse: Number,
126
- corporativeRole: null,
127
- courses: Array
128
- },
129
- methods: {
130
- closeModal(e) {
131
- this.$emit("closemodal", e);
132
- },
133
-
134
- removeSlot(idx) {
135
- this.slots.splice(idx, 1);
136
- },
137
-
138
- addSlot() {
139
- const newSlot = {
140
- idx: "",
141
- name: "",
142
- email: "",
143
- role: ""
144
- };
145
-
146
- this.slots = [...this.slots, newSlot];
147
- },
148
-
149
- async sendTest() {
150
- const pass = await this.$refs.sendCourse.validate();
151
-
152
- if (!pass) {
153
- return;
154
- }
155
-
156
- const filterSlots = slot => slot.email !== "";
157
-
158
- const formatRequest = () => {
159
- let formattedCourses = this.coursesToSend.map(course => ({
160
- course_id: course
161
- }));
162
-
163
- let formattedSlots = this.slots
164
- .filter(filterSlots)
165
- .map(slot => ({
166
- name: slot.name.substring(slot.name.indexOf(" "), 0),
167
- last_name: slot.name.substring(
168
- slot.name.indexOf(" ") + 1
169
- ),
170
- email: slot.email,
171
- courses: formattedCourses,
172
- role_id: slot.role
173
- }));
174
-
175
- return {
176
- ...formattedSlots
177
- };
178
- };
179
-
180
- let params = {
181
- users: formatRequest()
182
- };
183
- this.resetSlots();
184
- this.$emit("send-course", params);
185
- },
186
- resetSlots() {
187
- this.slots = [
188
- {
189
- idx: "",
190
- name: "",
191
- email: "",
192
- role: ""
193
- }
194
- ];
195
- }
196
- },
197
- watch: {
198
- selectedCourse(newValue) {
199
- this.coursesToSend = newValue ? [newValue] : [];
200
- }
201
- },
202
- data() {
203
- return {
204
- slots: [
205
- {
206
- idx: "",
207
- name: "",
208
- email: "",
209
- role: ""
210
- }
211
- ],
212
- coursesToSend: []
213
- };
214
- }
115
+ name: 'send-course',
116
+ components: {
117
+ [Select.name]: Select,
118
+ [Option.name]: Option
119
+ },
120
+ props: {
121
+ isModalOpen: {
122
+ type: Boolean,
123
+ default: false
124
+ },
125
+ selectedCourse: Number,
126
+ corporativeRole: null,
127
+ courses: Array
128
+ },
129
+ methods: {
130
+ closeModal(e) {
131
+ this.$emit('closemodal', e);
132
+ },
133
+
134
+ removeSlot(idx) {
135
+ this.slots.splice(idx, 1);
136
+ },
137
+
138
+ addSlot() {
139
+ const newSlot = {
140
+ idx: '',
141
+ name: '',
142
+ email: '',
143
+ role: ''
144
+ };
145
+
146
+ this.slots = [...this.slots, newSlot];
147
+ },
148
+
149
+ async sendTest() {
150
+ const pass = await this.$refs.sendCourse.validate();
151
+
152
+ if (!pass) {
153
+ return;
154
+ }
155
+
156
+ const filterSlots = slot => slot.email !== '';
157
+
158
+ const formatRequest = () => {
159
+ let formattedCourses = this.coursesToSend.map(course => ({
160
+ course_id: course
161
+ }));
162
+
163
+ let formattedSlots = this.slots
164
+ .filter(filterSlots)
165
+ .map(slot => ({
166
+ name: slot.name.substring(slot.name.indexOf(' '), 0),
167
+ last_name: slot.name.substring(
168
+ slot.name.indexOf(' ') + 1
169
+ ),
170
+ email: slot.email,
171
+ courses: formattedCourses,
172
+ role_id: slot.role
173
+ }));
174
+
175
+ return {
176
+ ...formattedSlots
177
+ };
178
+ };
179
+
180
+ let params = {
181
+ users: formatRequest()
182
+ };
183
+ this.resetSlots();
184
+ this.$emit('send-course', params);
185
+ },
186
+ resetSlots() {
187
+ this.slots = [
188
+ {
189
+ idx: '',
190
+ name: '',
191
+ email: '',
192
+ role: ''
193
+ }
194
+ ];
195
+ }
196
+ },
197
+ watch: {
198
+ selectedCourse(newValue) {
199
+ this.coursesToSend = newValue ? [newValue] : [];
200
+ }
201
+ },
202
+ data() {
203
+ return {
204
+ slots: [
205
+ {
206
+ idx: '',
207
+ name: '',
208
+ email: '',
209
+ role: ''
210
+ }
211
+ ],
212
+ coursesToSend: []
213
+ };
214
+ }
215
215
  };
216
216
  </script>
217
217
  <style lang="scss" scoped>
@@ -167,7 +167,6 @@ export default {
167
167
  </script>
168
168
  <style lang="scss" scoped>
169
169
  @import "@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss";
170
-
171
170
  .send-test-modal {
172
171
  position: fixed;
173
172
  overflow-y: scroll;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <modal :show.sync="isModalOpen" v-on:close="closeModal" class="modal">
2
+ <modal :show.sync="isModalOpen" v-on:close="closeModal" class="modal sms-modal">
3
3
  <template slot="header">
4
4
  <h2 class="display-4 px-4">
5
5
  Enviar SMS
@@ -185,14 +185,14 @@ export default {
185
185
  },
186
186
  isModalOpen(newValue) {
187
187
  if (!newValue) {
188
- this.templates = null
189
- this.models = this.templates
190
- this.messageTitle = null
191
- this.receiver = null
192
- this.message = ''
193
- this.saveModel = false
194
- this.modelName = null
195
- this.allNumbers = []
188
+ this.templates = null;
189
+ this.models = this.templates;
190
+ this.messageTitle = null;
191
+ this.receiver = null;
192
+ this.message = '';
193
+ this.saveModel = false;
194
+ this.modelName = null;
195
+ this.allNumbers = [];
196
196
  }
197
197
  }
198
198
 
@@ -215,22 +215,30 @@ export default {
215
215
  async sendSms() {
216
216
  const pass = await this.$refs.smsModal.validate();
217
217
  if (!pass) {
218
- swal.fire({
219
- title: 'Aviso',
220
- html: 'Preecha todos os campos corretamente',
221
- buttonsStyling: false,
222
- type: 'error',
223
- confirmButtonClass: 'btn btn-primary btn-fill'
218
+ const Toast = swal.mixin({
219
+ toast: true,
220
+ position: 'top-end',
221
+ showConfirmButton: false,
222
+ timer: 3000
223
+ });
224
+
225
+ Toast.fire({
226
+ type: 'warning',
227
+ text: 'Preecha todos os campos corretamente'
224
228
  });
225
229
  return;
226
230
  }
227
231
  if (this.allNumbers.length == 0) {
228
- swal.fire({
229
- title: 'Aviso',
230
- html: 'Adicione pelo menos um número de telefone para continuar',
231
- buttonsStyling: false,
232
- type: 'error',
233
- confirmButtonClass: 'btn btn-primary btn-fill'
232
+ const Toast = swal.mixin({
233
+ toast: true,
234
+ position: 'top-end',
235
+ showConfirmButton: false,
236
+ timer: 3000
237
+ });
238
+
239
+ Toast.fire({
240
+ type: 'warning',
241
+ title: 'Adicione pelo menos um número de telefone para continuar'
234
242
  });
235
243
  return;
236
244
  } else {
@@ -309,7 +317,7 @@ export default {
309
317
  .badge {
310
318
  margin-bottom: 1.5rem;
311
319
  }
312
- .modal-body {
320
+ .sms-modal {
313
321
  padding: 1.5rem !important;
314
322
  }
315
323
 
@@ -1,60 +1,60 @@
1
1
  <template>
2
- <div>
3
- <modal
4
- :show.sync="isModalOpen"
5
- @close="$emit('close-modal')"
6
- class="modal modal-video"
7
- bodyClasses="container-fluid px-4"
8
- headerClasses="container-fluid px-4"
9
- >
10
- <template slot="header">
11
- <h5 class="display-4">{{ title }}</h5>
12
- </template>
13
- <div class="text-center my-4">
14
- <iframe
15
- v-if="isModalOpen"
16
- width="100%"
17
- height="540"
18
- :src="link"
19
- frameborder="0"
20
- allowfullscreen
21
- class="rounded"
22
- >
23
- </iframe>
24
- <div class="bottom-button" v-if="button">
25
- <button
26
- @click="$emit('clickVideo')"
27
- class="btn btn-success"
28
- >
29
- {{ button.text }}
30
- </button>
31
- </div>
32
- </div>
33
- </modal>
34
- </div>
2
+ <div>
3
+ <modal
4
+ :show.sync="isModalOpen"
5
+ @close="$emit('close-modal')"
6
+ class="modal modal-video"
7
+ bodyClasses="container-fluid px-4"
8
+ headerClasses="container-fluid px-4"
9
+ >
10
+ <template slot="header">
11
+ <h5 class="display-4">{{ title }}</h5>
12
+ </template>
13
+ <div class="text-center my-4">
14
+ <iframe
15
+ v-if="isModalOpen"
16
+ width="100%"
17
+ height="540"
18
+ :src="link"
19
+ frameborder="0"
20
+ allowfullscreen
21
+ class="rounded"
22
+ >
23
+ </iframe>
24
+ <div class="bottom-button" v-if="button">
25
+ <button
26
+ @click="$emit('clickVideo')"
27
+ class="btn btn-success"
28
+ >
29
+ {{ button.text }}
30
+ </button>
31
+ </div>
32
+ </div>
33
+ </modal>
34
+ </div>
35
35
  </template>
36
36
 
37
37
  <script>
38
38
  export default {
39
- name: "video-modal",
40
- props: {
41
- show: {
42
- type: false,
43
- },
44
- link: String,
45
- title: String,
46
- button: Object
47
- },
48
- data() {
49
- return {
50
- isModalOpen: this.show
51
- };
52
- },
53
- watch: {
54
- show(value) {
55
- this.isModalOpen = value;
56
- }
57
- }
39
+ name: 'video-modal',
40
+ props: {
41
+ show: {
42
+ type: false,
43
+ },
44
+ link: String,
45
+ title: String,
46
+ button: Object
47
+ },
48
+ data() {
49
+ return {
50
+ isModalOpen: this.show
51
+ };
52
+ },
53
+ watch: {
54
+ show(value) {
55
+ this.isModalOpen = value;
56
+ }
57
+ }
58
58
  };
59
59
  </script>
60
60
  <style lang="scss">
@@ -69,7 +69,7 @@ export default {
69
69
  padding-bottom: 0;
70
70
  }
71
71
  .modal-body {
72
- padding: 0;
72
+ padding: 0 !important;
73
73
  }
74
74
 
75
75
  .modal-video {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.272",
3
+ "version": "1.0.274",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {