@burh/nuxt-core 1.0.72 → 1.0.73

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.
@@ -0,0 +1,184 @@
1
+ <template>
2
+ <div class="card card--store mb-4" :class="isSelected && 'selected'" tabindex="0" @click="$emit('card-selected')">
3
+ <div class="card-header bg-transparent text-center card-header--store">
4
+ <h3 class="text-header display-3">{{ name }}</h3>
5
+ <h3 class="display-3">{{ price | convertToReal }}</h3>
6
+
7
+ <div class="d-block d-sm-none text-center">
8
+ <collapse :animation-duration="200">
9
+ <collapse-item class="card--shadowless" name="1">
10
+ <button slot="title" class="btn btn-link" @click="$emit('card-benefits')">Beneficios</button>
11
+ <div>
12
+ <ul class="list-unstyled">
13
+ <li v-for="(item, index) in features" :key="index">
14
+ <div class="d-flex align-items-center">
15
+ <span>
16
+ <i class="fas fa-check"></i>
17
+ </span>
18
+ <div class="ml-4 small text-left">
19
+ <span> {{ item }} </span>
20
+ </div>
21
+ </div>
22
+ </li>
23
+ </ul>
24
+ </div>
25
+ </collapse-item>
26
+ </collapse>
27
+
28
+ </div>
29
+ </div>
30
+
31
+ <div class="card-body p-4 px-lg-4 d-none d-md-block">
32
+ <div>
33
+ <h6 class="card-text text-sm pl-mini">{{ description }}</h6>
34
+ <div class="h6 font-weight-bold text-sm pl-mini">{{ subtitle }}</div>
35
+ <div class="pl-mini">
36
+ <ul class="list-unstyled">
37
+ <li v-for="(item, index) in features" :key="index">
38
+ <div class="d-flex align-items-center">
39
+ <span>
40
+ <i class="fas fa-check"></i>
41
+ </span>
42
+ <div class="ml-4 small">
43
+ <span> {{ item }} </span>
44
+ </div>
45
+ </div>
46
+ </li>
47
+ </ul>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </template>
53
+ <script>
54
+ import Collapse from '@burh/nuxt-core/components/argon-core/Collapse/Collapse.vue';
55
+ import CollapseItem from '@burh/nuxt-core/components/argon-core/Collapse/CollapseItem.vue';
56
+ export default {
57
+ name: 'product-card',
58
+ components: {
59
+ Collapse,
60
+ CollapseItem
61
+ },
62
+ props:{
63
+ isSelected: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ name: {
68
+ type: String,
69
+ default: 'Premium'
70
+ },
71
+ price: {
72
+ type: Number,
73
+ default: 397
74
+ },
75
+ description: {
76
+ type: String,
77
+ default: 'Recursos inteligentes para não perder mais tempo no processo seletivo'
78
+ },
79
+ subtitle: {
80
+ type: String,
81
+ default: 'Tudo no gratuito e mais:'
82
+ },
83
+ features: {
84
+ type: Array,
85
+ default:()=>{
86
+ return [ { id: 1, name:'Vagas Confidenciais' }, { id: 2, name:'Vagas Urgentes' }, { id: 3, name:'Filtros Avançados' }, { id: 4, name:'Processos Customizados' }, { id: 5, name:'Anotações nas vagas e nos candidatos' }];
87
+ }
88
+ },
89
+ },
90
+ filters: {
91
+ convertToReal(value) {
92
+ return 'R$ ' + value.toFixed(2).replace('.', ',');
93
+ }
94
+ },
95
+ data(){
96
+ return{
97
+ };
98
+ },
99
+ };
100
+ </script>
101
+ <style lang="scss">
102
+ @import "@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss";
103
+ .pl-mini{
104
+ padding-left: 0.8rem;
105
+ }
106
+ .card--shadowless{
107
+ box-shadow: none !important;
108
+ margin-bottom: 0px !important;
109
+
110
+ .card-header {
111
+ padding: 0;
112
+ }
113
+ }
114
+
115
+ .card--store {
116
+ min-height: 100%;
117
+
118
+ .current-flag {
119
+ color: $color-light--darken
120
+ }
121
+
122
+ &:hover {
123
+ cursor: pointer;
124
+ background-color: $color-mono-dark-10;
125
+ border-style: solid !important;
126
+ border-width: 2px !important;
127
+ border-color: $color-mono-dark-10 !important;
128
+
129
+ .card-header {
130
+ border-bottom-color: $color-mono-dark-10;
131
+ }
132
+ .card--shadowless {
133
+ background-color: $color-mono-dark-10;
134
+
135
+ .card-header {
136
+ background-color: $color-mono-dark-10;
137
+ }
138
+ }
139
+
140
+ .fa-check::before {
141
+ color: $color-primary
142
+ }
143
+ }
144
+
145
+ &.selected {
146
+ outline: none;
147
+ background-color: $white;
148
+ border-style: solid !important;
149
+ border-width: 2px !important;
150
+ border-color: $color-primary !important;
151
+
152
+ .card-header {
153
+ border-bottom-color: $color-primary;
154
+ }
155
+ .card--shadowless {
156
+ background-color: $white;
157
+
158
+ .card-header {
159
+ background-color: $white;
160
+ }
161
+ }
162
+
163
+ .fa-check::before {
164
+ color: $color-primary;
165
+ }
166
+ }
167
+
168
+ .card-header--store {
169
+ border: 0;
170
+ @media screen and (min-width: 576px) {
171
+ border: 0;
172
+ &::after {
173
+ content: '';
174
+ width: 85%;
175
+ height: 1px;
176
+ background-color: $color-light;
177
+ position: absolute;
178
+ transform: translatex(-50%);
179
+ }
180
+ }
181
+ }
182
+
183
+ }
184
+ </style>
@@ -1,295 +1,351 @@
1
1
  <template>
2
- <modal :show.sync="openModal" modalContentClasses="container-fluid" headerClasses="row px-4 pt-5" bodyClasses="row px-4" v-on:close="$emit('close-modal')" size='lg' class="modal">
3
- <template slot="header">
4
- <div class="pl-3"><h2 class="display-4">{{title}}</h2></div>
5
- </template>
2
+ <modal
3
+ :show.sync="openModal"
4
+ modalContentClasses="container-fluid"
5
+ headerClasses="row px-4 pt-5"
6
+ bodyClasses="row px-4"
7
+ v-on:close="$emit('close-modal')"
8
+ size="lg"
9
+ class="modal"
10
+ >
11
+ <template slot="header">
12
+ <div class="pl-3">
13
+ <h2 class="display-4">{{ title }}</h2>
14
+ </div>
15
+ </template>
6
16
 
7
- <validation-observer ref="appConfigModal" tag="div">
8
- <validation-provider tag="div" class="col-12" :vid="`name`"
9
- name="name" rules="required" v-slot="{ errors }">
10
- <base-input
11
- :label="name"
12
- :placeholder="inputPlaceholders.firstInput"
13
- required
14
- v-model="configInfo.title"
15
- :error="errors[0]"
16
- :valid="errors.length ? true : false"
17
- >
18
- </base-input>
19
- </validation-provider>
17
+ <validation-observer ref="appConfigModal" tag="div">
18
+ <validation-provider
19
+ tag="div"
20
+ class="col-12"
21
+ :vid="`name`"
22
+ name="name"
23
+ rules="required"
24
+ v-slot="{ errors }"
25
+ >
26
+ <base-input
27
+ :label="name"
28
+ :placeholder="inputPlaceholders.firstInput"
29
+ required
30
+ v-model="configInfo.title"
31
+ :error="errors[0]"
32
+ :valid="errors.length ? true : false"
33
+ >
34
+ </base-input>
35
+ </validation-provider>
20
36
 
21
- <div class="col-12 mb-4">
22
- <label for="description" class="form-control-label">{{textAreaTitle}}</label>
23
- <textarea
24
- id="description"
25
- class="form-control"
26
- :placeholder="inputPlaceholders.secondInput"
27
- v-model="configInfo.textarea"
28
- ></textarea>
29
- </div>
37
+ <div class="col-12 mb-4">
38
+ <label for="description" class="form-control-label">{{
39
+ textAreaTitle
40
+ }}</label>
41
+ <textarea
42
+ id="description"
43
+ class="form-control"
44
+ :placeholder="inputPlaceholders.secondInput"
45
+ v-model="configInfo.textarea"
46
+ ></textarea>
47
+ </div>
30
48
 
31
- <div class="col-12 mb-4 d-flex flex-column" v-if="!isCourse && categories && categories.length">
32
- <label for="category" class="form-control-label">Categoria</label>
33
- <el-select
34
- filterable
35
- class="select-danger"
36
- id="category"
37
- :disabled="testId != null ? true : false"
38
- :empty="'Nenhuma categoria foi encontrada'"
39
- v-model="configInfo.category"
40
- :placeholder="''"
41
- >
42
- <el-option
43
- v-for="(category, index) in categories"
44
- :key="category.id"
45
- :label="category.name"
46
- :value="category.id"
47
- :selected="index == 0 && configInfo.category == null"
48
- >
49
- </el-option>
50
- </el-select>
51
- </div>
49
+ <div
50
+ class="col-12 mb-4 d-flex flex-column"
51
+ v-if="!isCourse && categories && categories.length"
52
+ >
53
+ <label for="category" class="form-control-label"
54
+ >Categoria</label
55
+ >
56
+ <el-select
57
+ filterable
58
+ class="select-danger"
59
+ id="category"
60
+ :disabled="testId != null ? true : false"
61
+ :empty="'Nenhuma categoria foi encontrada'"
62
+ v-model="configInfo.category"
63
+ :placeholder="''"
64
+ >
65
+ <el-option
66
+ v-for="(category, index) in categories"
67
+ :key="category.id"
68
+ :label="category.name"
69
+ :value="category.id"
70
+ :selected="index == 0 && configInfo.category == null"
71
+ >
72
+ </el-option>
73
+ </el-select>
74
+ </div>
75
+
76
+ <div class="col-12 mb-4" v-if="isCourse">
77
+ <base-input
78
+ v-mask="['##:##:##']"
79
+ :label="'Carga horária'"
80
+ :placeholder="inputPlaceholders.thirdInput"
81
+ v-model="configInfo.workload"
82
+ ></base-input>
83
+ </div>
52
84
 
53
- <div class="col-12 mb-4" v-if="isCourse">
54
- <base-input
55
- v-mask="['##:##:##']"
56
- :label="'Carga horária'"
57
- :placeholder="inputPlaceholders.thirdInput"
58
- v-model="configInfo.workload"
59
- ></base-input>
60
- </div>
61
-
62
85
  <slot name="testes"></slot>
63
86
 
64
- <slot name="nota"></slot>
87
+ <slot name="nota"></slot>
65
88
 
66
- <div class="col-12 mb-4">
67
- <label class="mb-0 form-control-label mb-3">{{buttonAreaTitle}}</label>
89
+ <div class="col-12 mb-4">
90
+ <label class="mb-0 form-control-label mb-3">{{
91
+ buttonAreaTitle
92
+ }}</label>
68
93
 
69
- <div class="row">
70
- <div class="col-6 col-lg-3" v-for="(buttons, index) in buttons" :key="index">
71
- <button role="button" class="tag tag-outline-primary d-block w-100"
72
- :id="'button-' + buttons.id" :value="buttons.value"
73
- :class="buttons.id == currentSelectedButton ? 'active' : ''"
74
- @click="timeSelection(buttons.id)"
75
- >
76
- <i v-if="buttons.id == currentSelectedButton" class="fas fa-check mr-1"></i>
77
- <small>{{buttons.time}}</small>
78
- </button>
79
- </div>
80
- </div>
81
- </div>
82
- <div class="col-12 d-flex pb-4">
83
- <base-button size="md" type="primary" role="button"
84
- @click="sendConfig()"
85
- class="ml-auto">{{configAppButton}}
86
- </base-button>
87
- </div>
88
- </validation-observer>
89
- </modal>
94
+ <div class="row">
95
+ <div
96
+ class="col-6 col-lg-3"
97
+ v-for="(buttons, index) in buttons"
98
+ :key="index"
99
+ >
100
+ <button
101
+ role="button"
102
+ class="tag tag-outline-primary d-block w-100"
103
+ :id="'button-' + buttons.id"
104
+ :value="buttons.value"
105
+ :class="
106
+ 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>
119
+ </div>
120
+ </div>
121
+ <div class="col-12 d-flex pb-4">
122
+ <base-button
123
+ size="md"
124
+ type="primary"
125
+ role="button"
126
+ @click="sendConfig()"
127
+ class="ml-auto"
128
+ >{{ configAppButton }}
129
+ </base-button>
130
+ </div>
131
+ </validation-observer>
132
+ </modal>
90
133
  </template>
91
134
  <script>
92
- import { mask } from 'vue-the-mask';
135
+ import { mask } from "vue-the-mask";
93
136
  import { Select, Option } from "element-ui";
94
137
  export default {
95
- components:{
96
- [Select.name]: Select,
97
- [Option.name]: Option,
98
- },
99
- directives: { mask },
100
- data(){
101
- return{
102
- configInfo:{
103
- title: this.titleValue,
104
- textarea: this.textAreaValue,
105
- selectedTime: '',
106
- workload: this.workloadValue,
107
- category: this.testCategories
108
- },
109
- currentSelectedButton: String,
110
- value: '',
111
- };
112
- },
113
- model:{
114
- prop: 'show'
115
- },
116
- props:{
117
- isCourse: {
118
- type: Boolean,
119
- default: false
120
- },
121
- inputPlaceholders:{
122
- type: Object,
123
- default:() => (
124
- {
125
- firstInput: 'Insira o nome do teste',
126
- secondInput: 'Insira a descrição do teste',
127
- thirdInput: 'Insira a carga horária do curso'
128
- }
129
- )
130
- },
131
- show: {
132
- type: Boolean,
133
- default: false
134
- },
135
- name:{
136
- type: String,
137
- default: 'Nome'
138
- },
139
- defaultButtonSelected: {
140
- type: Number,
141
- default: 6
142
- },
143
- testId:{
144
- type: Number,
145
- default: null
146
- },
147
- buttons:{
148
- type: Array,
149
- default: () => [{ id: '1', time: '5 minutos', value:'00:05:00' }, { id: '2', time: '10 minutos', value:'00:10:00' }, { id: '3', time: '15 minutos', value:'00:15:00' },
150
- { id: '4', time: '30 minutos', value:'00:30:00' }, { id: '5', time: '45 minutos', value:'00:45:00' }, { id: '6', time: '60 minutos', value:'01:00:00' },
151
- { id: '7', time: '2 horas', value: '02:00:00' }, { id: '8', time: '8 horas', value: '08:00:00' }],
152
- description: 'Botoes de tempo'
153
- },
154
- title:{
155
- type: String,
156
- default: 'Criar Teste',
157
- description: 'Titulo do Modal'
158
- },
159
- workloadTitle:{
160
- type: String,
161
- default: 'Carga horária',
162
- description: 'Carga horária do curso, apenas se o modal for usado para a pagina de cursos'
163
- },
164
- textAreaTitle:{
165
- type: String,
166
- default: 'Descrição',
167
- description: 'Titulo da text area'
168
- },
169
- buttonAreaTitle:{
170
- type: String,
171
- default: 'Tempo Limite',
172
- description: 'Titulo da area de botões'
173
- },
174
- configAppButton:{
175
- type: String,
176
- default: 'Salvar',
177
- description: 'Botão de envio'
178
- },
179
- titleValue: {
180
- type: String,
181
- default: ''
182
- },
183
- textAreaValue: {
184
- type: String,
185
- default: ''
186
- },
187
- workloadValue: {
188
- type: String,
189
- default: '00:00:00'
190
- },
191
- time: {
192
- type: String,
193
- default: ''
194
- },
195
- testCategories:{
196
- type: Number,
197
- default: null
198
- },
199
- categories: {
200
- type: Array,
201
- default: () => []
202
- }
203
- },
204
- watch:{
205
- titleValue(newValue){
206
- this.configInfo.title = newValue;
207
- },
208
- textAreaValue(newValue){
209
- this.configInfo.textarea = newValue;
210
- },
211
- workloadValue(newValue){
212
- this.configInfo.workload = newValue;
213
- },
214
- time(newValue){
215
- this.configInfo.selectedTime = newValue;
216
- },
217
- testCategories(newValue){
218
- this.configInfo.category = newValue;
219
- },
220
- show(value) {
221
- const isCategoryInitialized = this.configInfo.category ? true : false
222
- if(value && !this.isCourse && !isCategoryInitialized) {
223
- this.configInfo.category = this.categories[0].id;
224
- }
225
- }
226
- },
227
- mounted() {
228
- this.loadTime();
229
- console.log(this.time)
230
- },
231
- computed:{
232
- openModal:{
233
- get(){return this.show;},
234
- set(show){this.$emit('input', show);}
235
- }
236
- },
237
- methods:{
238
- loadTime() {
239
- let time = this.buttons.find(e => e.value === this.time);
240
- if(time != null){
241
- this.currentSelectedButton = time.id;
242
- this.configInfo.selectedTime = this.time;
243
- } else {
244
- time = this.buttons.find(e => e.id == this.defaultButtonSelected);
245
- this.currentSelectedButton = time.id;
246
- this.configInfo.selectedTime = time.value;
247
- }
248
- },
249
- timeSelection(buttonId){
250
- let btn = document.getElementById('button-' + buttonId);
251
- this.configInfo.selectedTime=btn.value;
252
- this.currentSelectedButton=buttonId;
253
- },
254
- async sendConfig() {
255
- const pass = await this.$refs.appConfigModal.validate();
256
- if(!pass) {
257
- return;
258
- }
259
- let config;
260
- if(!this.isCourse){
261
- config = {
262
- title: this.configInfo.title,
263
- textarea: this.configInfo.textarea,
264
- selectedTime: this.configInfo.selectedTime,
265
- category: this.configInfo.category
266
- };
267
- console.log(config)
268
- }else if(this.isCourse){
269
- config = {
270
- title: this.configInfo.title,
271
- textarea: this.configInfo.textarea,
272
- selectedTime: this.configInfo.selectedTime,
273
- workload: this.configInfo.workload
274
- };
275
- }
276
- this.$emit('send-config-info', config);
277
- this.openModal=false;
278
- },
279
- },
138
+ components: {
139
+ [Select.name]: Select,
140
+ [Option.name]: Option
141
+ },
142
+ directives: { mask },
143
+ data() {
144
+ return {
145
+ configInfo: {
146
+ title: this.titleValue,
147
+ textarea: this.textAreaValue,
148
+ selectedTime: "",
149
+ workload: this.workloadValue,
150
+ category: this.testCategories
151
+ },
152
+ currentSelectedButton: String,
153
+ value: ""
154
+ };
155
+ },
156
+ model: {
157
+ prop: "show"
158
+ },
159
+ props: {
160
+ isCourse: {
161
+ type: Boolean,
162
+ default: false
163
+ },
164
+ inputPlaceholders: {
165
+ type: Object,
166
+ default: () => ({
167
+ firstInput: "Insira o nome do teste",
168
+ secondInput: "Insira a descrição do teste",
169
+ thirdInput: "Insira a carga horária do curso"
170
+ })
171
+ },
172
+ show: {
173
+ type: Boolean,
174
+ default: false
175
+ },
176
+ name: {
177
+ type: String,
178
+ default: "Nome"
179
+ },
180
+ defaultButtonSelected: {
181
+ type: Number,
182
+ default: 6
183
+ },
184
+ testId: {
185
+ type: Number,
186
+ default: null
187
+ },
188
+ buttons: {
189
+ type: Array,
190
+ default: () => [
191
+ { id: "1", time: "5 minutos", value: "00:05:00" },
192
+ { id: "2", time: "10 minutos", value: "00:10:00" },
193
+ { id: "3", time: "15 minutos", value: "00:15:00" },
194
+ { id: "4", time: "30 minutos", value: "00:30:00" },
195
+ { id: "5", time: "45 minutos", value: "00:45:00" },
196
+ { id: "6", time: "60 minutos", value: "01:00:00" },
197
+ { id: "7", time: "2 horas", value: "02:00:00" },
198
+ { id: "8", time: "8 horas", value: "08:00:00" }
199
+ ],
200
+ description: "Botoes de tempo"
201
+ },
202
+ title: {
203
+ type: String,
204
+ default: "Criar Teste",
205
+ description: "Titulo do Modal"
206
+ },
207
+ workloadTitle: {
208
+ type: String,
209
+ default: "Carga horária",
210
+ description:
211
+ "Carga horária do curso, apenas se o modal for usado para a pagina de cursos"
212
+ },
213
+ textAreaTitle: {
214
+ type: String,
215
+ default: "Descrição",
216
+ description: "Titulo da text area"
217
+ },
218
+ buttonAreaTitle: {
219
+ type: String,
220
+ default: "Tempo Limite",
221
+ description: "Titulo da area de botões"
222
+ },
223
+ configAppButton: {
224
+ type: String,
225
+ default: "Salvar",
226
+ description: "Botão de envio"
227
+ },
228
+ titleValue: {
229
+ type: String,
230
+ default: ""
231
+ },
232
+ textAreaValue: {
233
+ type: String,
234
+ default: ""
235
+ },
236
+ workloadValue: {
237
+ type: String,
238
+ default: "00:00:00"
239
+ },
240
+ time: {
241
+ type: String,
242
+ default: ""
243
+ },
244
+ testCategories: {
245
+ type: Number,
246
+ default: null
247
+ },
248
+ categories: {
249
+ type: Array,
250
+ default: () => []
251
+ }
252
+ },
253
+ watch: {
254
+ titleValue(newValue) {
255
+ this.configInfo.title = newValue;
256
+ },
257
+ textAreaValue(newValue) {
258
+ this.configInfo.textarea = newValue;
259
+ },
260
+ workloadValue(newValue) {
261
+ this.configInfo.workload = newValue;
262
+ },
263
+ time(newValue) {
264
+ this.configInfo.selectedTime = newValue;
265
+ },
266
+ testCategories(newValue) {
267
+ this.configInfo.category = newValue;
268
+ },
269
+ show(value) {
270
+ const isCategoryInitialized = this.configInfo.category
271
+ ? true
272
+ : false;
273
+ if (value && !this.isCourse && !isCategoryInitialized) {
274
+ this.configInfo.category = this.categories[0].id;
275
+ }
276
+ }
277
+ },
278
+ mounted() {
279
+ this.loadTime();
280
+ },
281
+ computed: {
282
+ openModal: {
283
+ get() {
284
+ return this.show;
285
+ },
286
+ set(show) {
287
+ this.$emit("input", show);
288
+ }
289
+ }
290
+ },
291
+ methods: {
292
+ loadTime() {
293
+ let time = this.buttons.find(e => e.value === this.time);
294
+ if (time != null) {
295
+ this.currentSelectedButton = time.id;
296
+ this.configInfo.selectedTime = this.time;
297
+ } else {
298
+ time = this.buttons.find(
299
+ e => e.id == this.defaultButtonSelected
300
+ );
301
+ this.currentSelectedButton = time.id;
302
+ this.configInfo.selectedTime = time.value;
303
+ }
304
+ },
305
+ timeSelection(buttonId) {
306
+ let btn = document.getElementById("button-" + buttonId);
307
+ this.configInfo.selectedTime = btn.value;
308
+ this.currentSelectedButton = buttonId;
309
+ },
310
+ async sendConfig() {
311
+ const pass = await this.$refs.appConfigModal.validate();
312
+ if (!pass) {
313
+ return;
314
+ }
315
+ let config;
316
+ if (!this.isCourse) {
317
+ config = {
318
+ title: this.configInfo.title,
319
+ textarea: this.configInfo.textarea,
320
+ selectedTime: this.configInfo.selectedTime,
321
+ category: this.configInfo.category
322
+ };
323
+ console.log(config);
324
+ } else if (this.isCourse) {
325
+ config = {
326
+ title: this.configInfo.title,
327
+ textarea: this.configInfo.textarea,
328
+ selectedTime: this.configInfo.selectedTime,
329
+ workload: this.configInfo.workload
330
+ };
331
+ }
332
+ this.$emit("send-config-info", config);
333
+ this.openModal = false;
334
+ }
335
+ }
280
336
  };
281
337
  </script>
282
338
  <style lang="scss">
283
339
  @import "node_modules/@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss";
284
340
 
285
- .fixed-button{
286
- .btn{
287
- font-size: 0.775rem;
288
- @media screen and (max-width: 992px){
289
- &:last-child{
290
- margin-right: 1rem !important;
291
- }
292
- }
341
+ .fixed-button {
342
+ .btn {
343
+ font-size: 0.775rem;
344
+ @media screen and (max-width: 992px) {
345
+ &:last-child {
346
+ margin-right: 1rem !important;
347
+ }
348
+ }
293
349
  width: 10rem;
294
350
  }
295
351
  }
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  </template>
16
16
 
17
- <template slot="body">
17
+ <template>
18
18
  <div class="col-12">
19
19
  <slot name="body"></slot>
20
20
  </div>
@@ -0,0 +1,198 @@
1
+ <template>
2
+ <modal :show.sync="isModalOpen" v-on:close="closeModal" class="modal">
3
+ <template slot="header">
4
+ <h2 class="display-4 px-4">
5
+ Enviar SMS
6
+ </h2>
7
+ </template>
8
+ <validation-observer ref="smsModal" tag="div">
9
+ <div class="px-3">
10
+ <div>
11
+ <base-input
12
+ v-model="receiver"
13
+ label="Para"
14
+ v-mask="['(##) #####-####']"
15
+ placeholder="Adicionar um número de telefone"
16
+ :class="'w-100'"
17
+ @change="addNumber(receiver)"
18
+ />
19
+
20
+ <div class="d-flex flex-wrap">
21
+ <badge
22
+ v-for="(numbers, index) in allNumbers"
23
+ :key="index"
24
+ type="primary"
25
+ class="col-3 mx-3"
26
+ >{{ numbers
27
+ }}<i
28
+ class="fas fa-times px-2 cursor-pointer"
29
+ @click="deleteNumber(index)"
30
+ ></i
31
+ ></badge>
32
+ </div>
33
+ </div>
34
+
35
+ <div class="mb-4">
36
+ <div class="d-flex flex-column">
37
+ <label for="message" class="form-control-label"
38
+ >Mensagem</label
39
+ >
40
+ <el-select
41
+ filterable
42
+ no-match-text="Nenhum modelo encontrado"
43
+ no-data-text="Nenhum modelo encontrado"
44
+ placeholder="Escolha o modelo"
45
+ v-model="messageType"
46
+ >
47
+ <el-option
48
+ v-for="models in models"
49
+ class="select-danger"
50
+ :value="models.text"
51
+ :label="models.name"
52
+ :key="models.id"
53
+ :disabled="hasModel"
54
+ ></el-option>
55
+ </el-select>
56
+ </div>
57
+
58
+ <validation-provider
59
+ tag="div"
60
+ class="pb-3"
61
+ name="Texto da mensagem"
62
+ rules="required"
63
+ v-slot="{ errors }"
64
+ >
65
+ <textarea
66
+ class="form-control mt-4"
67
+ v-model="message"
68
+ :class="{ 'is-invalid': errors.length }"
69
+ placeholder="Mensagem que será enviada"
70
+ ></textarea>
71
+ <div
72
+ v-if="errors.length"
73
+ class="invalid-feedback"
74
+ style="display: block;"
75
+ >
76
+ {{ errors[0] }}
77
+ </div>
78
+ </validation-provider>
79
+
80
+ <el-checkbox class="mt-4" v-model="saveModel"
81
+ >Salvar modelo de mensagem</el-checkbox
82
+ >
83
+
84
+ <validation-provider
85
+ tag="div"
86
+ v-if="saveModel"
87
+ name="Titulo para o modelo"
88
+ rules="required"
89
+ v-slot="{ errors }"
90
+ >
91
+ <base-input
92
+ v-model="modelName"
93
+ placeholder="Titulo para o modelo"
94
+ :class="'mt-4'"
95
+ :error="errors[0]"
96
+ :valid="errors.length ? true : false"
97
+ />
98
+ </validation-provider>
99
+ </div>
100
+ <div class="d-flex">
101
+ <base-button
102
+ size="md"
103
+ type="primary"
104
+ role="button"
105
+ @click="sendSms()"
106
+ class="ml-auto"
107
+ >Enviar
108
+ </base-button>
109
+ </div>
110
+ </div>
111
+ </validation-observer>
112
+ </modal>
113
+ </template>
114
+
115
+ <script>
116
+ import { Select, Option, Checkbox } from "element-ui";
117
+ import { mask } from "vue-the-mask";
118
+ import swal from "sweetalert2";
119
+ export default {
120
+ directives: { mask },
121
+ name: "send-sms",
122
+ components: {
123
+ [Select.name]: Select,
124
+ [Option.name]: Option,
125
+ [Checkbox.name]: Checkbox
126
+ },
127
+ computed: {
128
+ isModalOpen: {
129
+ get() {
130
+ return this.show;
131
+ },
132
+ set(show) {
133
+ this.$emit("input", show);
134
+ }
135
+ }
136
+ },
137
+ props: {
138
+ show: {
139
+ type: Boolean,
140
+ default: false
141
+ }
142
+ },
143
+ model: {
144
+ prop: "show"
145
+ },
146
+ data() {
147
+ return {
148
+ messageType: null,
149
+ receiver: null,
150
+ message: "",
151
+ models: [
152
+ {
153
+ id: 1,
154
+ name: "Modelo Pronto",
155
+ text: "Olá, somos a BURH"
156
+ }
157
+ ],
158
+ hasModel: false,
159
+ saveModel: false,
160
+ modelName: null,
161
+ allNumbers: []
162
+ };
163
+ },
164
+ methods: {
165
+ closeModal() {
166
+ this.$emit("close-modal");
167
+ },
168
+ async sendSms() {
169
+ const pass = await this.$refs.smsModal.validate();
170
+ if (!pass) {
171
+ swal.fire({
172
+ title: `Aviso`,
173
+ html: `Preecha todos os campos corretamente`,
174
+ buttonsStyling: false,
175
+ confirmButtonClass: "btn btn-primary btn-fill"
176
+ });
177
+ return;
178
+ } else {
179
+ this.$emit("send-sms", this.allNumbers, this.message);
180
+ }
181
+ },
182
+ addNumber(number) {
183
+ this.allNumbers.push(number);
184
+ this.receiver = "";
185
+ console.log(this.allNumbers);
186
+ },
187
+ deleteNumber(index) {
188
+ console.log(index);
189
+ this.allNumbers.splice(index, 1);
190
+ }
191
+ }
192
+ };
193
+ </script>
194
+ <style lang="scss" scoped>
195
+ .badge {
196
+ margin-bottom: 1.5rem;
197
+ }
198
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {