@burh/nuxt-core 1.0.461 → 1.0.462

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.
@@ -97,43 +97,65 @@
97
97
  v-for="(buttons, index) in buttons"
98
98
  :key="index"
99
99
  >
100
- <button
101
- v-if="buttons.id != 8"
102
- role="button"
103
- class="tag tag-outline-primary d-block w-100 buttons"
104
- :value="buttons.value"
105
- :class="
100
+ <div v-if="haveCustomTime">
101
+ <button
102
+ v-if="buttons.id != 8"
103
+ role="button"
104
+ class="tag tag-outline-primary d-block w-100 buttons"
105
+ :value="buttons.value"
106
+ :class="
107
+ buttons.id == currentSelectedButton
108
+ ? 'active'
109
+ : ''
110
+ "
111
+ @click="timeSelection(buttons.id)"
112
+ >
113
+ <i
114
+ v-if="buttons.id == currentSelectedButton"
115
+ class="fas fa-check mr-1"
116
+ ></i>
117
+ <small>{{ buttons.time }}</small>
118
+ </button>
119
+ <div :class="
106
120
  buttons.id == currentSelectedButton
107
- ? 'active'
108
- : ''
109
- "
110
- @click="timeSelection(buttons.id)"
111
- >
112
- <i
113
- v-if="buttons.id == currentSelectedButton"
114
- class="fas fa-check mr-1"
115
- ></i>
116
- <small>{{ buttons.time }}</small>
117
- </button>
118
- <div :class="
119
- buttons.id == currentSelectedButton
120
- ? 'active-time'
121
- : ''" class="custom-time-div">
122
- <i
123
- v-if="buttons.id == currentSelectedButton"
124
- class="fas fa-check mr-1 custom-time-icon"
125
- ></i>
126
- <input
127
- v-if="buttons.id == 8"
128
- :placeholder="buttons.time"
129
- v-model="buttons.value"
130
- @change="setValueChange()"
131
- @click="setInitValue(buttons.id)"
132
- :class="currentSelectedButton == buttons.id ? 'active-custom': '' "
133
- class="d-block w-100 buttons tag tag-outline-primary custom-time"
134
- type="text"
135
- v-mask="['##:##:##']"
136
- />
121
+ ? 'active-time'
122
+ : ''" class="custom-time-div">
123
+ <i
124
+ v-if="buttons.id == currentSelectedButton && buttons.value"
125
+ class="fas fa-check mr-1"
126
+ :class="[currentSelectedButton == 8 ? 'custom-icon': 'custom-time-icon']"
127
+ ></i>
128
+ <!-- <div v-if="buttons.id == 8" @click="setInitValue(buttons.id)">
129
+ <el-time-picker
130
+ format="HH:mm:ss"
131
+ value-format="HH:mm:ss"
132
+ v-model="buttons.value"
133
+ @change="setValueChange()"
134
+ :class="currentSelectedButton == buttons.id ? 'active-custom': 'not-active-custom' "
135
+ class="w-100"
136
+ placeholder="Outro">
137
+ </el-time-picker>
138
+ </div> -->
139
+ </div>
140
+ </div>
141
+ <div v-else-if="!haveCustomTime">
142
+ <button
143
+ role="button"
144
+ class="tag tag-outline-primary d-block w-100 buttons"
145
+ :value="buttons.value"
146
+ :class="
147
+ buttons.id == currentSelectedButton
148
+ ? 'active'
149
+ : ''
150
+ "
151
+ @click="timeSelection(buttons.id)"
152
+ >
153
+ <i
154
+ v-if="buttons.id == currentSelectedButton"
155
+ class="fas fa-check mr-1"
156
+ ></i>
157
+ <small>{{ buttons.time }}</small>
158
+ </button>
137
159
  </div>
138
160
  </div>
139
161
  </div>
@@ -163,11 +185,12 @@
163
185
  <script>
164
186
  import { mask } from 'vue-the-mask';
165
187
  import swal from 'sweetalert2';
166
- import { Select, Option } from 'element-ui';
188
+ import { Select, Option, TimePicker } from 'element-ui';
167
189
  export default {
168
190
  components: {
169
191
  [Select.name]: Select,
170
192
  [Option.name]: Option,
193
+ [TimePicker.name]: TimePicker,
171
194
  },
172
195
  directives: { mask },
173
196
  data() {
@@ -199,6 +222,14 @@ export default {
199
222
  thirdInput: 'Insira a carga horária do curso'
200
223
  })
201
224
  },
225
+ haveCustomTime:{
226
+ type:Boolean,
227
+ default:false
228
+ },
229
+ deadLineTime:{
230
+ type:Number,
231
+ default:0
232
+ },
202
233
  show: {
203
234
  type: Boolean,
204
235
  default: false
@@ -290,6 +321,9 @@ export default {
290
321
  workloadValue(newValue) {
291
322
  this.configInfo.workload = newValue;
292
323
  },
324
+ deadLineTime(){
325
+ this.loadTime();
326
+ },
293
327
  time(newValue) {
294
328
  this.configInfo.selectedTime = newValue;
295
329
  },
@@ -323,7 +357,7 @@ export default {
323
357
  this.currentSelectedButton = id;
324
358
  let getIndex = this.buttons.findIndex((e)=>e.custom == true);
325
359
  if(!this.buttons[getIndex].value){
326
- this.buttons[getIndex].value = '00:00:00';
360
+ this.buttons[getIndex].value = null;
327
361
  }
328
362
  },
329
363
  setValueChange(){
@@ -331,7 +365,19 @@ export default {
331
365
  },
332
366
  loadTime() {
333
367
  let time = null;
334
- if(this.time){
368
+ let deadLineTime = null;
369
+ if(this.deadLineTime == 0){
370
+ deadLineTime = this.buttons.find(e => e.value == 'null');
371
+ }
372
+ if(this.deadLineTime){
373
+ deadLineTime = this.buttons.find(e => e.value == this.deadLineTime);
374
+ }
375
+ if(deadLineTime != null){
376
+ this.currentSelectedButton = deadLineTime.id;
377
+ this.configInfo.selectedTime = this.deadLineTime;
378
+ return;
379
+ }
380
+ if(this.time && this.time != 'null'){
335
381
  time = this.buttons.find(e => e.value === this.time);
336
382
  if(!time){
337
383
  time = this.buttons.find(e => e.custom === true);
@@ -351,19 +397,25 @@ export default {
351
397
  },
352
398
  timeSelection(buttonId) {
353
399
  let btn = this.buttons.find((e)=>e.id == buttonId);
354
- this.buttons[7].value = null;
400
+ if(this.haveCustomTime && buttonId){
401
+ if(buttonId != 8 ){
402
+ this.buttons[7].value = null;
403
+ }
404
+ }
355
405
  this.configInfo.selectedTime = btn.value;
356
406
  this.currentSelectedButton = buttonId;
357
407
  },
358
408
  async sendConfig() {
359
- let customButton = this.buttons.find((e)=>e.custom == true);
409
+ let customButton = this.buttons.find((e) => e.custom == true);
360
410
  const pass = await this.$refs.appConfigModal.validate();
361
411
  if (!pass) {
362
412
  return;
363
413
  }
364
414
  let config;
365
- if(this.currentSelectedButton == customButton.id){
366
- let minuteReplace = customButton.value.search(60);
415
+ if(this.haveCustomTime && this.currentSelectedButton == customButton.id){
416
+ if(!customButton.value){
417
+ return this.showMessage('É necessário selecionar um tempo');
418
+ }
367
419
  let timeReplaced = customButton.value.replaceAll(':', '');
368
420
 
369
421
  if(timeReplaced == '000000' || timeReplaced.length < 6){
@@ -372,14 +424,6 @@ export default {
372
424
  if(timeReplaced > 240000){
373
425
  return this.showMessage('O tempo não pode ser maior que 24 horas');
374
426
  }
375
- if((minuteReplace && minuteReplace >= 0 && minuteReplace == 3)
376
- || customButton.value[3] + customButton.value[4] > 60 ){
377
- return this.showMessage('Insira um valor entre 00 e 59 para o minuto');
378
- }
379
- if(minuteReplace && minuteReplace >= 0 && minuteReplace == 6
380
- || customButton.value[6] + customButton.value[7] > 60){
381
- return this.showMessage('Insira um valor entre 00 e 59 para o segundo');
382
- }
383
427
  }
384
428
  if (!this.isCourse) {
385
429
  config = {
@@ -465,6 +509,7 @@ export default {
465
509
  font-size: 80%;
466
510
  color:#00b388;
467
511
  }
512
+ /deep/
468
513
  .custom-time:hover::placeholder{
469
514
  color: #fff;
470
515
  }
@@ -479,10 +524,67 @@ export default {
479
524
  left:1.5rem;
480
525
  color:#fff;
481
526
  }
482
- .active-custom{
483
- color: #fff !important;
527
+ .custom-icon{
528
+ position:absolute;
529
+ top:1rem;
530
+ z-index: 3;
531
+ left:2rem;
532
+ color:#fff;
533
+ }
534
+ }
535
+ /deep/ .active-custom{
536
+ .el-time-panel{
537
+ width: 15.5%;
538
+ }
539
+ .el-input__inner{
540
+ background-color: #00b388;
541
+ border: 2px solid #00b388;
542
+ display: block;
543
+ height: 51.39px;
544
+ color:#fff;
545
+ text-align: center;
484
546
  &::placeholder{
485
- color: #fff !important;
547
+ color:#fff;
548
+ }
549
+ }
550
+ .el-input__prefix{
551
+ .el-icon-time:before{
552
+ color:#fff;
553
+ }
554
+ }
555
+ .el-input__suffix{
556
+ .el-input__suffix-inner{
557
+ .el-icon-circle-close{
558
+ color:#fff;
559
+ }
560
+ }
561
+ }
562
+ }
563
+ /deep/ .not-active-custom{
564
+ .el-time-panel{
565
+ width: 15.5%;
566
+ }
567
+ .el-input__inner{
568
+ border: 2px solid #00b388;
569
+ display: block;
570
+ height: 51.39px;
571
+ color:#00b388;
572
+ text-align: center;
573
+ &::placeholder{
574
+ color:#00b388;
575
+ }
576
+ }
577
+ .el-input__prefix{
578
+ .el-icon-time:before{
579
+ position: relative;
580
+ color:#00b388;
581
+ }
582
+ }
583
+ .el-input__suffix{
584
+ .el-input__suffix-inner{
585
+ .el-icon-circle-close{
586
+ color:#00b388;
587
+ }
486
588
  }
487
589
  }
488
590
  }
@@ -46,14 +46,20 @@
46
46
  </validation-provider>
47
47
 
48
48
  <div class="select__container px-3">
49
- <div name="role">
49
+ <validation-provider
50
+ tag="div"
51
+ name="Setor"
52
+ rules="required"
53
+ v-slot="{ errors }"
54
+ >
50
55
  <label for="select" class="form-control-label">Setor</label>
51
56
 
52
57
  <el-select
53
- class="select-danger"
58
+ class="w-100"
54
59
  id="select"
55
60
  placeholder="Setor"
56
61
  v-model="slot.role"
62
+ :class="{'is-invalid': errors[0]}"
57
63
  clearable
58
64
  >
59
65
  <div class="text-center" slot="empty">
@@ -67,10 +73,14 @@
67
73
  :key="role.id"
68
74
  :label="role.level"
69
75
  :value="role.level"
70
- >
71
- </el-option>
76
+ />
72
77
  </el-select>
73
- </div>
78
+ <div
79
+ class="invalid-feedback"
80
+ style="display: block;">
81
+ {{ errors[0] }}
82
+ </div>
83
+ </validation-provider>
74
84
 
75
85
  <div name="role">
76
86
  <label for="buffer" class="form-control-label">Vincular ao buffer</label>
@@ -219,7 +229,7 @@ export default {
219
229
  };
220
230
  },
221
231
  resetSlots() {
222
- this.$refs.inviteUser.reset();
232
+ this.$refs && this.$refs.inviteUser && this.$refs.inviteUser.reset();
223
233
  this.slots = [];
224
234
  this.slots.push(this.getSlot());
225
235
  }
@@ -236,6 +246,11 @@ export default {
236
246
  };
237
247
  </script>
238
248
  <style lang="scss" scoped>
249
+ .is-invalid {
250
+ /deep/ input {
251
+ border-color: #de214b!important;
252
+ }
253
+ }
239
254
  .send-test-modal {
240
255
  position: fixed;
241
256
  overflow-y: scroll;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.461",
3
+ "version": "1.0.462",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {
@@ -16,7 +16,14 @@ import RouteBreadcrumb from '~/components/argon-core/Breadcrumb/RouteBreadcrumb'
16
16
  import StatsCard from '~/components/argon-core/Cards/StatsCard.vue';
17
17
  import ImageWithFallback from '@/components/burh-ds/Img/ImageWithFallback.vue';
18
18
  import { Input, Tooltip, Popover } from 'element-ui';
19
+
20
+ import lang from 'element-ui/lib/locale/lang/pt-br';
21
+ import locale from 'element-ui/lib/locale';
22
+
19
23
  import Vue from 'vue';
24
+
25
+ locale.use(lang);
26
+
20
27
  /**
21
28
  * You can register global components here and use them as a plugin in your main Vue instance
22
29
  */