@burh/nuxt-core 1.0.481 → 1.0.484

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.
@@ -21,6 +21,9 @@ body {
21
21
  }
22
22
  }
23
23
 
24
+ .user-select-none {
25
+ user-select: none;
26
+ }
24
27
 
25
28
  @media only print {
26
29
  .navbar-main,
@@ -177,9 +177,10 @@
177
177
 
178
178
  <hr />
179
179
 
180
- <div class="row px-4">
181
- <div class="col-12">
182
- <label for="courses">Acesso aos Treinamentos</label>
180
+ <div class="row px-4 mb-2">
181
+ <div class="col-12 d-flex align-items-center justify-content-between">
182
+ <label for="courses" class="mb-0">Acesso aos Treinamentos</label>
183
+ <span class="text-primary pointer user-select-none" @click="handleSelectAllCourses">{{ !isAllCoursesSelected ? 'Selecionar todos' : 'Limpar' }}</span>
183
184
  </div>
184
185
  </div>
185
186
  <div class="row px-4">
@@ -295,7 +296,21 @@ export default {
295
296
  coursesToSend: [],
296
297
  };
297
298
  },
299
+ computed: {
300
+ isAllCoursesSelected() {
301
+ return ((this.coursesToSend && this.coursesToSend.length) && (this.courses && this.courses.length)) && this.coursesToSend.length === this.courses.length;
302
+ }
303
+ },
298
304
  methods: {
305
+ handleSelectAllCourses() {
306
+ if (!this.isAllCoursesSelected) {
307
+ if (this.courses && this.courses.length) {
308
+ this.coursesToSend = this.courses.map(course => course.id);
309
+ }
310
+ } else {
311
+ this.coursesToSend = [];
312
+ }
313
+ },
299
314
  closeModal(e) {
300
315
  this.$emit('closemodal', e);
301
316
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.481",
3
+ "version": "1.0.484",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {