@burh/nuxt-core 1.0.349 → 1.0.351

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,515 +1,513 @@
1
- <template>
2
- <div class="bg-white content-middle">
3
- <!-- FERRAMENTAS -->
4
- <div class="tools mt-3">
5
- <button
6
- @click="
7
- isLocked && tool.event !== 'share'
8
- ? $emit('open-contact')
9
- : $emit(tool.event)
10
- "
11
- class="ml-3 burh-color"
12
- :class="{
13
- 'disabled-button': isLocked && tool.event !== 'share'
14
- }"
15
- v-for="(tool, index) in tools"
16
- :key="index"
17
- >
18
- <i
19
- v-show="isLocked && tool.event !== 'share'"
20
- class="fas fa-lock mr-1"
21
- ></i>
22
- {{ tool.name }}
23
- </button>
24
- </div>
25
- <!-- SOBRE -->
26
- <div class="about content-block mt-5 ml-3 mr-3">
27
- <h5 class="font-weight-bold">Sobre</h5>
28
- <p
29
- id="USER_ABOUT"
30
- class="mb-0"
31
- :class="
32
- !wordIsLesserThan(
33
- userData.user_complementary_information.about
34
- ) && 'readmore'
35
- "
36
- v-html="
37
- highlightText(
38
- search,
39
- userData.user_complementary_information.about
40
- )
41
- "
42
- ></p>
43
- <a
44
- href="#"
45
- aria-label="expandir conteudo"
46
- v-show="
47
- userData.user_complementary_information.about &&
48
- !wordIsLesserThan(
49
- userData.user_complementary_information.about
50
- )
51
- "
52
- @click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
53
- >Ler mais</a
54
- >
55
-
56
- <p v-show="!userData.user_complementary_information.about" class="">
57
- Nenhuma informação adicionada
58
- </p>
59
- </div>
60
- <!-- CONTATO -->
61
- <h5 class="font-weight-bold mt-4 ml-3">Contatos</h5>
62
- <div class="ml-3 info-text">
63
- <span v-if="userData.email != null">Email: {{userData.email}}</span><br>
64
- <span v-if="userData.user_contact && userData.user_contact.cellphone != null && userData.user_contact.cellphone.length > 1 ">Celular: {{phoneMask(userData.user_contact.cellphone)}}</span><br>
65
- <span v-if="userData.user_contact && userData.user_contact.phone != null && userData.user_contact.phone.length > 1">Telefone: {{phoneMask(userData.user_contact.phone)}}</span>
66
- </div>
67
-
68
- <!-- EDUCAÇÃO -->
69
- <h5 class="font-weight-bold mt-4 ml-3">Educação</h5>
70
- <div
71
- class=" ml-3"
72
- v-show="userData.user_education.length > 0"
73
- v-for="(edu, index) in userData.user_education"
74
- :key="index"
75
- >
76
- <p
77
- class="sub-title"
78
- v-html="highlightText(search, edu.formation)"
79
- ></p>
80
- <p class="info-text">{{ edu.institution }}</p>
81
- <span class="info-text">
82
- {{ edu.start_month }}/{{ edu.start_year }} -
83
- {{ treatEndDate(edu.end_month, edu.end_year) }}
84
- {{ getTime(false, edu) }}
85
- {{
86
- edu.user_education_period
87
- ? '-' + edu.user_education_period.name
88
- : ''
89
- }} </span
90
- ><br />
91
- <span
92
- class="info-text"
93
- v-html="
94
- highlightText(
95
- search,
96
- edu.formation_level_id | formationLevel
97
- )
98
- "
99
- ></span>
100
- </div>
101
-
102
- <!-- EXPERIÊNCIAS -->
103
- <h5 class="font-weight-bold mt-4 ml-3">Experiência</h5>
104
- <div
105
- class="no-info ml-3"
106
- v-show="userData.user_experience.length === 0"
107
- >
108
- <p>
109
- Nenhuma informação adicionada
110
- </p>
111
- </div>
112
- <div
113
- v-show="userData.user_experience.length > 0"
114
- class="experience ml-3 mr-3"
115
- v-for="(exp, index) in userData.user_experience"
116
- :key="`experience-${index}`"
117
- >
118
- <p
119
- class="sub-title"
120
- v-html="highlightText(search, exp.job_title)"
121
- ></p>
122
- <p
123
- class="info-text"
124
- v-html="
125
- highlightText(search, `${exp.company}, ${exp.location}`)
126
- "
127
- ></p>
128
- <span class="info-text">
129
- {{ exp.start_month }}/{{ exp.start_year }} -
130
- {{ treatEndDate(exp.end_month, exp.end_year) }}
131
- {{ getTime(true, exp) }}
132
- </span>
133
-
134
- <p
135
- :id="`USER_EXPERIENCE-${index}`"
136
- class="description mt-4 mb-0"
137
- :class="!wordIsLesserThan(exp.description) && 'readmore'"
138
- v-html="highlightText(search, exp.description)"
139
- ></p>
140
-
141
- <a
142
- href="#"
143
- aria-label="expandir conteudo"
144
- v-show="!wordIsLesserThan(exp.description)"
145
- @click.prevent.stop="
146
- toggleReadMore($event, `USER_EXPERIENCE-${index}`)
147
- "
148
- >Ler mais</a
149
- ><br /><br />
150
- </div>
151
-
152
- <!-- CURSOS -->
153
- <h5 class="font-weight-bold mt-1 ml-3">Cursos Complementares</h5>
154
- <div class="no-info ml-3" v-show="userData.user_course.length === 0">
155
- <p>
156
- Nenhuma informação adicionada
157
- </p>
158
- </div>
159
- <div
160
- v-show="userData.user_course.length > 0"
161
- class="courses ml-3"
162
- v-for="(cou, index) in userData.user_course"
163
- :key="`course-${index}`"
164
- >
165
- <p
166
- class="sub-title"
167
- v-html="highlightText(search, cou.institution)"
168
- ></p>
169
- <p
170
- class="info-text mb-3"
171
- v-html="
172
- highlightText(
173
- search,
174
- `${cou.name} - ${cou.end_year || ''} ${getTime(
175
- false,
176
- cou
177
- )}`
178
- )
179
- "
180
- >
181
- {{ cou.name }} - {{ cou.end_year }}
182
- {{ getTime(false, cou) }}
183
- </p>
184
- </div>
185
- </div>
186
- </template>
187
-
188
- <script>
189
- import getPrefixes from '~/util/getPrefixes.js';
190
- import { mask } from 'vue-the-mask';
191
-
192
- export default {
193
- name: 'user-cv-middle',
194
- directives: { mask },
195
- props: {
196
- userData: Object,
197
- tools: {
198
- type: Array,
199
- default: () => []
200
- },
201
- search: {
202
- type: String,
203
- default: ''
204
- }
205
- },
206
- filters: {
207
- formationLevel(id) {
208
- const typeFormation = {
209
- 1: 'Ensino Médio',
210
- 2: 'Ensino Técnico',
211
- 3: 'Graduação',
212
- 4: 'Pós-Graduação',
213
- 5: 'Mestrado',
214
- 6: 'Doutorado'
215
- };
216
-
217
- return typeFormation[id] || '-';
218
- }
219
- },
220
- data() {
221
- return {
222
- isLocked: !this.companyHasProduct(
223
- this.$store.state.loja.showableProducts['INTERACAO_USUARIO']
224
- )
225
- };
226
- },
227
- mounted() {
228
- this.userData.user_experience = this.filterByDate(
229
- this.userData.user_experience,
230
- 'old'
231
- );
232
- this.userData.user_education = this.filterByDate(
233
- this.userData.user_education,
234
- 'old'
235
- );
236
- this.userData.user_course = this.filterByDate(
237
- this.userData.user_course,
238
- 'old'
239
- );
240
- },
241
- watch: {
242
- userData() {
243
- this.userData.user_experience = this.filterByDate(
244
- this.userData.user_experience,
245
- 'old'
246
- );
247
- this.userData.user_education = this.filterByDate(
248
- this.userData.user_education,
249
- 'old'
250
- );
251
- this.userData.user_course = this.filterByDate(
252
- this.userData.user_course,
253
- 'old'
254
- );
255
- }
256
- },
257
- methods: {
258
- phoneMask(v) {
259
-
260
- let r = v.replace(/\D/g, '');
261
- r = r.replace(/^0/, '');
262
-
263
- if (r.length > 11) {
264
- r = r.replace(/^(\d\d)(\d{5})(\d{4}).*/, '($1) $2-$3');
265
- } else if (r.length > 7) {
266
- r = r.replace(/^(\d\d)(\d{5})(\d{0,4}).*/, '($1) $2-$3');
267
- } else if (r.length > 2) {
268
- r = r.replace(/^(\d\d)(\d{0,5})/, '($1) $2');
269
- } else if (v.trim() !== '') {
270
- r = r.replace(/^(\d*)/, '($1');
271
- }
272
- return r;
273
- },
274
- highlightText(search, text) {
275
- if (search.length < 2) return text;
276
-
277
- const regex = new RegExp(search.toLowerCase(), 'gmi');
278
- return String(text || '').replace(
279
- regex,
280
- `<span class="search-highlight">${search}</span>`
281
- );
282
- },
283
- filterByDate(data, by = 'new') {
284
- let sortedArray = data.sort((a, b) => {
285
- a = [
286
- a.start_month,
287
- a.start_year,
288
- a.end_month || 12,
289
- a.end_year || 9999
290
- ];
291
-
292
- b = [
293
- b.start_month,
294
- b.start_year,
295
- b.end_month || 12,
296
- b.end_year || 9999
297
- ];
298
-
299
- // Primeiro filtro -> chaves: 0 e 1 -> Filtro por data de inicio
300
- // Segundo filtro -> chaves: 2 e 3 -> Filtro por data de termino (subir não concluídos para primeiros)
301
-
302
- let byStart;
303
- let byEnd;
304
-
305
- switch (by) {
306
- case 'old':
307
- byStart =
308
- new Date(a[1], a[0], 1).getTime() -
309
- new Date(b[1], b[0], 1).getTime();
310
- byEnd =
311
- new Date(b[3], b[2], 1).getTime() -
312
- new Date(a[3], a[2], 1).getTime();
313
- break;
314
-
315
- default:
316
- byStart =
317
- new Date(b[1], b[0], 1).getTime() -
318
- new Date(a[1], a[0], 1).getTime();
319
- byEnd =
320
- new Date(b[3], b[2], 1).getTime() -
321
- new Date(a[3], a[2], 1).getTime();
322
- break;
323
- }
324
-
325
- return byEnd - byStart;
326
- });
327
-
328
- return sortedArray;
329
- },
330
- toggleReadMore(event, id) {
331
- const element = document.getElementById(id);
332
- element.classList.toggle('readmore');
333
- event.target.innerText == 'Ler mais'
334
- ? (event.target.innerText = 'Esconder')
335
- : (event.target.innerText = 'Ler mais');
336
- },
337
- getTime(
338
- isExperience,
339
- { start_year = null, end_year = null, start_month, end_month },
340
- textHappening = 'Cursando'
341
- ) {
342
- const isHappening = !end_month && !end_year;
343
-
344
- if (isHappening) {
345
- return isExperience === true ? 'Atualmente' : textHappening;
346
- }
347
-
348
- const dateInitial = this.$moment(
349
- ['1', start_month.toString(), start_year.toString()],
350
- 'DD/MM/YYYY'
351
- );
352
- const dateDone = this.$moment(
353
- ['1', end_month.toString(), end_year.toString()],
354
- 'DD/MM/YYYY'
355
- );
356
- const diffDuration = this.$moment.duration(
357
- dateDone.diff(dateInitial)
358
- );
359
- const years = diffDuration.years();
360
- const months = diffDuration.months();
361
-
362
- if (years) {
363
- return years > 1 ? `(${years} anos)` : `(${years} ano)`;
364
- }
365
-
366
- return months > 1
367
- ? `(${months} meses)`
368
- : months == 1
369
- ? `(${months} mês)`
370
- : '';
371
- },
372
- languageLevel(level) {
373
- switch (parseInt(level)) {
374
- case 1:
375
- return 'Iniciante';
376
- case 2:
377
- return 'Elementar';
378
- case 3:
379
- return 'Pré-intermediário';
380
- case 4:
381
- return 'Intermediário';
382
- case 5:
383
- return 'Intermediário Superior';
384
- case 6:
385
- return 'Avançado';
386
- case 7:
387
- return 'Fluente';
388
- default:
389
- return '';
390
- }
391
- },
392
- treatPhone(phone) {
393
- if (phone) {
394
- if (phone == '0' || phone.length < 9 || !phone) {
395
- return 'não cadastrado';
396
- }
397
- }
398
-
399
- return phone;
400
- },
401
- treatCellphone(cellphone) {
402
- if (cellphone) {
403
- if (cellphone == '0' || cellphone.length < 11 || !cellphone) {
404
- return 'não cadastrado';
405
- }
406
- }
407
-
408
- return cellphone;
409
- },
410
- handleGetPrefixes(name = '') {
411
- return getPrefixes(name);
412
- },
413
- treatEndDate(end_month, end_year) {
414
- if (end_month && end_year) {
415
- return `${end_month}/${end_year}`;
416
- }
417
- return '';
418
- },
419
- wordIsLesserThan(word, value = 300) {
420
- return word && word.length < value;
421
- }
422
- }
423
- };
424
- </script>
425
-
426
- <style lang="scss" scoped>
427
- @import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
428
-
429
- /deep/ .search-highlight {
430
- background: rgb(255, 252, 61);
431
- color: #000;
432
- }
433
-
434
- .content-middle {
435
- width: 50%;
436
- border-right: 1px solid #ececec5c;
437
- word-break: break-word !important;
438
- }
439
-
440
- .readmore {
441
- overflow: hidden;
442
- text-overflow: ellipsis;
443
- display: -webkit-box;
444
- -webkit-line-clamp: 3;
445
- -webkit-box-orient: vertical;
446
- }
447
-
448
- .tools {
449
- flex-wrap: wrap;
450
- button {
451
- width: 117px;
452
- height: 29px;
453
- border: none;
454
- margin-top: 15px;
455
-
456
- background: #5865F2;
457
- border-radius: 16px;
458
- color: #fff;
459
-
460
- font-size: 12px;
461
- font-weight: 600;
462
- outline: 0;
463
- }
464
- }
465
-
466
- .education {
467
- margin-top: 15px;
468
- }
469
-
470
- .experience {
471
- .description {
472
- font-size: 14px;
473
- color: #62778c;
474
- }
475
-
476
- a {
477
- margin-bottom: 1px;
478
- }
479
- }
480
-
481
- .sub-title {
482
- margin-bottom: 1px;
483
-
484
- font-weight: 600;
485
- font-size: 14px;
486
- line-height: 21px;
487
- color: #62778c;
488
- text-transform: uppercase;
489
- }
490
-
491
- .info-text {
492
- margin-bottom: 1px;
493
-
494
- font-size: 14px;
495
- color: #8da2b5;
496
- }
497
-
498
- .content-block {
499
- p {
500
- font-size: 14px;
501
- color: #62778c;
502
- }
503
- }
504
-
505
- .no-info {
506
- p {
507
- font-size: 0.875rem;
508
- color: #62778c;
509
- }
510
- }
511
-
512
- .disabled-button {
513
- opacity: 0.5;
514
- }
515
- </style>
1
+ <template>
2
+ <div class="bg-white content-middle">
3
+ <!-- FERRAMENTAS -->
4
+ <div class="tools mt-3">
5
+ <button
6
+ @click="
7
+ isLocked && tool.event !== 'share'
8
+ ? $emit('open-contact')
9
+ : $emit(tool.event)
10
+ "
11
+ class="ml-3 burh-color"
12
+ :class="{
13
+ 'disabled-button': isLocked && tool.event !== 'share'
14
+ }"
15
+ v-for="(tool, index) in tools"
16
+ :key="index"
17
+ >
18
+ <i
19
+ v-show="isLocked && tool.event !== 'share'"
20
+ class="fas fa-lock mr-1"
21
+ ></i>
22
+ {{ tool.name }}
23
+ </button>
24
+ </div>
25
+ <!-- SOBRE -->
26
+ <div class="about content-block mt-5 ml-3 mr-3">
27
+ <h5 class="font-weight-bold">Sobre</h5>
28
+ <p
29
+ id="USER_ABOUT"
30
+ class="mb-0"
31
+ :class="
32
+ !wordIsLesserThan(
33
+ userData.user_complementary_information.about
34
+ ) && 'readmore'
35
+ "
36
+ v-html="
37
+ highlightText(
38
+ search,
39
+ userData.user_complementary_information.about
40
+ )
41
+ "
42
+ ></p>
43
+ <a
44
+ href="#"
45
+ aria-label="expandir conteudo"
46
+ v-show="
47
+ userData.user_complementary_information.about &&
48
+ !wordIsLesserThan(
49
+ userData.user_complementary_information.about
50
+ )
51
+ "
52
+ @click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
53
+ >Ler mais</a
54
+ >
55
+
56
+ <p v-show="!userData.user_complementary_information.about" class="">
57
+ Nenhuma informação adicionada
58
+ </p>
59
+ </div>
60
+ <!-- CONTATO -->
61
+ <h5 class="font-weight-bold mt-4 ml-3">Contatos</h5>
62
+ <div class="ml-3 info-text">
63
+ <span v-if="userData.email != null">Email: {{userData.email}}</span><br>
64
+ <span v-if="userData.user_contact && userData.user_contact.cellphone != null && userData.user_contact.cellphone.length > 1 ">Celular: {{phoneMask(userData.user_contact.cellphone)}}</span><br>
65
+ <span v-if="userData.user_contact && userData.user_contact.phone != null && userData.user_contact.phone.length > 1">Telefone: {{phoneMask(userData.user_contact.phone)}}</span>
66
+ </div>
67
+
68
+ <!-- EDUCAÇÃO -->
69
+ <h5 class="font-weight-bold mt-4 ml-3">Educação</h5>
70
+ <div
71
+ class=" ml-3"
72
+ v-show="userData.user_education.length > 0"
73
+ v-for="(edu, index) in userData.user_education"
74
+ :key="index"
75
+ >
76
+ <p
77
+ class="sub-title"
78
+ v-html="highlightText(search, edu.formation)"
79
+ ></p>
80
+ <p class="info-text">{{ edu.institution }}</p>
81
+ <span class="info-text">
82
+ {{ edu.start_month }}/{{ edu.start_year }} -
83
+ {{ treatEndDate(edu.end_month, edu.end_year) }}
84
+ {{ getTime(false, edu) }}
85
+ {{
86
+ edu.user_education_period
87
+ ? '-' + edu.user_education_period.name
88
+ : ''
89
+ }} </span
90
+ ><br />
91
+ <span
92
+ class="info-text"
93
+ >
94
+ {{edu.formation_level_id | formationLevel}}
95
+ </span>
96
+ </div>
97
+
98
+ <!-- EXPERIÊNCIAS -->
99
+ <h5 class="font-weight-bold mt-4 ml-3">Experiência</h5>
100
+ <div
101
+ class="no-info ml-3"
102
+ v-show="userData.user_experience.length === 0"
103
+ >
104
+ <p>
105
+ Nenhuma informação adicionada
106
+ </p>
107
+ </div>
108
+ <div
109
+ v-show="userData.user_experience.length > 0"
110
+ class="experience ml-3 mr-3"
111
+ v-for="(exp, index) in userData.user_experience"
112
+ :key="`experience-${index}`"
113
+ >
114
+ <p
115
+ class="sub-title"
116
+ v-html="highlightText(search, exp.job_title)"
117
+ ></p>
118
+ <p
119
+ class="info-text"
120
+ v-html="
121
+ highlightText(search, `${exp.company}, ${exp.location}`)
122
+ "
123
+ ></p>
124
+ <span class="info-text">
125
+ {{ exp.start_month }}/{{ exp.start_year }} -
126
+ {{ treatEndDate(exp.end_month, exp.end_year) }}
127
+ {{ getTime(true, exp) }}
128
+ </span>
129
+
130
+ <p
131
+ :id="`USER_EXPERIENCE-${index}`"
132
+ class="description mt-4 mb-0"
133
+ :class="!wordIsLesserThan(exp.description) && 'readmore'"
134
+ v-html="highlightText(search, exp.description)"
135
+ ></p>
136
+
137
+ <a
138
+ href="#"
139
+ aria-label="expandir conteudo"
140
+ v-show="!wordIsLesserThan(exp.description)"
141
+ @click.prevent.stop="
142
+ toggleReadMore($event, `USER_EXPERIENCE-${index}`)
143
+ "
144
+ >Ler mais</a
145
+ ><br /><br />
146
+ </div>
147
+
148
+ <!-- CURSOS -->
149
+ <h5 class="font-weight-bold mt-1 ml-3">Cursos Complementares</h5>
150
+ <div class="no-info ml-3" v-show="userData.user_course.length === 0">
151
+ <p>
152
+ Nenhuma informação adicionada
153
+ </p>
154
+ </div>
155
+ <div
156
+ v-show="userData.user_course.length > 0"
157
+ class="courses ml-3"
158
+ v-for="(cou, index) in userData.user_course"
159
+ :key="`course-${index}`"
160
+ >
161
+ <p
162
+ class="sub-title"
163
+ v-html="highlightText(search, cou.institution)"
164
+ ></p>
165
+ <p
166
+ class="info-text mb-3"
167
+ v-html="
168
+ highlightText(
169
+ search,
170
+ `${cou.name} - ${cou.end_year || ''} ${getTime(
171
+ false,
172
+ cou
173
+ )}`
174
+ )
175
+ "
176
+ >
177
+ {{ cou.name }} - {{ cou.end_year }}
178
+ {{ getTime(false, cou) }}
179
+ </p>
180
+ </div>
181
+ </div>
182
+ </template>
183
+
184
+ <script>
185
+ import getPrefixes from '~/util/getPrefixes.js';
186
+ import { mask } from 'vue-the-mask';
187
+
188
+ export default {
189
+ name: 'user-cv-middle',
190
+ directives: { mask },
191
+ props: {
192
+ userData: Object,
193
+ tools: {
194
+ type: Array,
195
+ default: () => []
196
+ },
197
+ search: {
198
+ type: String,
199
+ default: ''
200
+ }
201
+ },
202
+ filters: {
203
+ formationLevel(id) {
204
+ const typeFormation = {
205
+ 1: 'Ensino Médio',
206
+ 2: 'Ensino Técnico',
207
+ 3: 'Graduação',
208
+ 4: 'Pós-Graduação',
209
+ 5: 'Mestrado',
210
+ 6: 'Doutorado'
211
+ };
212
+
213
+ console.log(typeFormation[id]);
214
+
215
+ return typeFormation[id] || '-';
216
+ }
217
+ },
218
+ data() {
219
+ return {
220
+ isLocked: !this.companyHasProduct(
221
+ this.$store.state.loja && this.$store.state.loja.showableProducts && this.$store.state.loja.showableProducts['INTERACAO_USUARIO'] || false
222
+ )
223
+ };
224
+ },
225
+ mounted() {
226
+ this.userData.user_experience = this.filterByDate(
227
+ this.userData.user_experience,
228
+ 'old'
229
+ );
230
+ this.userData.user_education = this.filterByDate(
231
+ this.userData.user_education,
232
+ 'old'
233
+ );
234
+ this.userData.user_course = this.filterByDate(
235
+ this.userData.user_course,
236
+ 'old'
237
+ );
238
+ },
239
+ watch: {
240
+ userData() {
241
+ this.userData.user_experience = this.filterByDate(
242
+ this.userData.user_experience,
243
+ 'old'
244
+ );
245
+ this.userData.user_education = this.filterByDate(
246
+ this.userData.user_education,
247
+ 'old'
248
+ );
249
+ this.userData.user_course = this.filterByDate(
250
+ this.userData.user_course,
251
+ 'old'
252
+ );
253
+ }
254
+ },
255
+ methods: {
256
+ phoneMask(v) {
257
+
258
+ let r = v.replace(/\D/g, '');
259
+ r = r.replace(/^0/, '');
260
+
261
+ if (r.length > 11) {
262
+ r = r.replace(/^(\d\d)(\d{5})(\d{4}).*/, '($1) $2-$3');
263
+ } else if (r.length > 7) {
264
+ r = r.replace(/^(\d\d)(\d{5})(\d{0,4}).*/, '($1) $2-$3');
265
+ } else if (r.length > 2) {
266
+ r = r.replace(/^(\d\d)(\d{0,5})/, '($1) $2');
267
+ } else if (v.trim() !== '') {
268
+ r = r.replace(/^(\d*)/, '($1');
269
+ }
270
+ return r;
271
+ },
272
+ highlightText(search, text) {
273
+ if (search.length < 2) return text;
274
+
275
+ const regex = new RegExp(search.toLowerCase(), 'gmi');
276
+ return String(text || '').replace(
277
+ regex,
278
+ `<span class="search-highlight">${search}</span>`
279
+ );
280
+ },
281
+ filterByDate(data, by = 'new') {
282
+ let sortedArray = data.sort((a, b) => {
283
+ a = [
284
+ a.start_month,
285
+ a.start_year,
286
+ a.end_month || 12,
287
+ a.end_year || 9999
288
+ ];
289
+
290
+ b = [
291
+ b.start_month,
292
+ b.start_year,
293
+ b.end_month || 12,
294
+ b.end_year || 9999
295
+ ];
296
+
297
+ // Primeiro filtro -> chaves: 0 e 1 -> Filtro por data de inicio
298
+ // Segundo filtro -> chaves: 2 e 3 -> Filtro por data de termino (subir não concluídos para primeiros)
299
+
300
+ let byStart;
301
+ let byEnd;
302
+
303
+ switch (by) {
304
+ case 'old':
305
+ byStart =
306
+ new Date(a[1], a[0], 1).getTime() -
307
+ new Date(b[1], b[0], 1).getTime();
308
+ byEnd =
309
+ new Date(b[3], b[2], 1).getTime() -
310
+ new Date(a[3], a[2], 1).getTime();
311
+ break;
312
+
313
+ default:
314
+ byStart =
315
+ new Date(b[1], b[0], 1).getTime() -
316
+ new Date(a[1], a[0], 1).getTime();
317
+ byEnd =
318
+ new Date(b[3], b[2], 1).getTime() -
319
+ new Date(a[3], a[2], 1).getTime();
320
+ break;
321
+ }
322
+
323
+ return byEnd - byStart;
324
+ });
325
+
326
+ return sortedArray;
327
+ },
328
+ toggleReadMore(event, id) {
329
+ const element = document.getElementById(id);
330
+ element.classList.toggle('readmore');
331
+ event.target.innerText == 'Ler mais'
332
+ ? (event.target.innerText = 'Esconder')
333
+ : (event.target.innerText = 'Ler mais');
334
+ },
335
+ getTime(
336
+ isExperience,
337
+ { start_year = null, end_year = null, start_month, end_month },
338
+ textHappening = 'Cursando'
339
+ ) {
340
+ const isHappening = !end_month && !end_year;
341
+
342
+ if (isHappening) {
343
+ return isExperience === true ? 'Atualmente' : textHappening;
344
+ }
345
+
346
+ const dateInitial = this.$moment(
347
+ ['1', start_month.toString(), start_year.toString()],
348
+ 'DD/MM/YYYY'
349
+ );
350
+ const dateDone = this.$moment(
351
+ ['1', end_month.toString(), end_year.toString()],
352
+ 'DD/MM/YYYY'
353
+ );
354
+ const diffDuration = this.$moment.duration(
355
+ dateDone.diff(dateInitial)
356
+ );
357
+ const years = diffDuration.years();
358
+ const months = diffDuration.months();
359
+
360
+ if (years) {
361
+ return years > 1 ? `(${years} anos)` : `(${years} ano)`;
362
+ }
363
+
364
+ return months > 1
365
+ ? `(${months} meses)`
366
+ : months == 1
367
+ ? `(${months} mês)`
368
+ : '';
369
+ },
370
+ languageLevel(level) {
371
+ switch (parseInt(level)) {
372
+ case 1:
373
+ return 'Iniciante';
374
+ case 2:
375
+ return 'Elementar';
376
+ case 3:
377
+ return 'Pré-intermediário';
378
+ case 4:
379
+ return 'Intermediário';
380
+ case 5:
381
+ return 'Intermediário Superior';
382
+ case 6:
383
+ return 'Avançado';
384
+ case 7:
385
+ return 'Fluente';
386
+ default:
387
+ return '';
388
+ }
389
+ },
390
+ treatPhone(phone) {
391
+ if (phone) {
392
+ if (phone == '0' || phone.length < 9 || !phone) {
393
+ return 'não cadastrado';
394
+ }
395
+ }
396
+
397
+ return phone;
398
+ },
399
+ treatCellphone(cellphone) {
400
+ if (cellphone) {
401
+ if (cellphone == '0' || cellphone.length < 11 || !cellphone) {
402
+ return 'não cadastrado';
403
+ }
404
+ }
405
+
406
+ return cellphone;
407
+ },
408
+ handleGetPrefixes(name = '') {
409
+ return getPrefixes(name);
410
+ },
411
+ treatEndDate(end_month, end_year) {
412
+ if (end_month && end_year) {
413
+ return `${end_month}/${end_year}`;
414
+ }
415
+ return '';
416
+ },
417
+ wordIsLesserThan(word, value = 300) {
418
+ return word && word.length < value;
419
+ }
420
+ }
421
+ };
422
+ </script>
423
+
424
+ <style lang="scss" scoped>
425
+ @import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
426
+
427
+ /deep/ .search-highlight {
428
+ background: rgb(255, 252, 61);
429
+ color: #000;
430
+ }
431
+
432
+ .content-middle {
433
+ width: 50%;
434
+ border-right: 1px solid #ececec5c;
435
+ word-break: break-word !important;
436
+ }
437
+
438
+ .readmore {
439
+ overflow: hidden;
440
+ text-overflow: ellipsis;
441
+ display: -webkit-box;
442
+ -webkit-line-clamp: 3;
443
+ -webkit-box-orient: vertical;
444
+ }
445
+
446
+ .tools {
447
+ flex-wrap: wrap;
448
+ button {
449
+ width: 117px;
450
+ height: 29px;
451
+ border: none;
452
+ margin-top: 15px;
453
+
454
+ background: #5865F2;
455
+ border-radius: 16px;
456
+ color: #fff;
457
+
458
+ font-size: 12px;
459
+ font-weight: 600;
460
+ outline: 0;
461
+ }
462
+ }
463
+
464
+ .education {
465
+ margin-top: 15px;
466
+ }
467
+
468
+ .experience {
469
+ .description {
470
+ font-size: 14px;
471
+ color: #62778c;
472
+ }
473
+
474
+ a {
475
+ margin-bottom: 1px;
476
+ }
477
+ }
478
+
479
+ .sub-title {
480
+ margin-bottom: 1px;
481
+
482
+ font-weight: 600;
483
+ font-size: 14px;
484
+ line-height: 21px;
485
+ color: #62778c;
486
+ text-transform: uppercase;
487
+ }
488
+
489
+ .info-text {
490
+ margin-bottom: 1px;
491
+
492
+ font-size: 14px;
493
+ color: #8da2b5;
494
+ }
495
+
496
+ .content-block {
497
+ p {
498
+ font-size: 14px;
499
+ color: #62778c;
500
+ }
501
+ }
502
+
503
+ .no-info {
504
+ p {
505
+ font-size: 0.875rem;
506
+ color: #62778c;
507
+ }
508
+ }
509
+
510
+ .disabled-button {
511
+ opacity: 0.5;
512
+ }
513
+ </style>