@burh/nuxt-core 1.0.78 → 1.0.79

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,30 +1,31 @@
1
1
  <template>
2
2
  <div class="col-5 bg-light--darken py-5 px-5">
3
3
  <div class="d-flex justify-content-center">
4
- <a href="#!" class="avatar avatar-pdf">
5
- <img alt="Image placeholder" :src="avatar">
6
- </a>
4
+ <a href="#!" class="avatar avatar-pdf">
5
+ <img alt="Image placeholder" :src="avatar" v-show="avatar">
6
+ <p class="h5 font-weight-bold text-muted" v-show="!avatar">{{handleGetPrefixes(name)}}</p>
7
+ </a>
7
8
  </div>
8
- <p class="text-center text-muted font-weight-bold mb-4">{{yearsOld}} anos</p>
9
+ <p class="text-center text-muted font-weight-bold mb-4">{{yearsOld ? `${yearsOld} anos` : 'idade não informada'}}</p>
9
10
 
10
11
  <h2 class="display-4">Contato e Endereço</h2>
11
- <p>{{street}}, {{number}}<br> {{neighborhood}}<br> {{city}} - {{regionCode}}</p>
12
- <p><strong>Telefone:</strong> {{phone || 'não cadastrado'}}<br> <strong>Celular:</strong> {{cellphone || 'não cadastrado'}}<br></p>
12
+ <p>{{street}}, {{number}}<br v-show="number"> {{neighborhood}}<br v-show="neighborhood"> {{city}} - {{regionCode}}</p>
13
+ <p><strong>Telefone:</strong> {{treatPhone(phone)}}<br> <strong>Celular:</strong> {{treatCellphone(cellphone)}}<br></p>
13
14
 
14
- <h2 class="display-4 mt-4">Educação</h2>
15
+ <h2 class="display-4 mt-4" v-show="education.length">Educação</h2>
15
16
  <div class="mb-4" v-for="(edu,index) in education" :key="`education-${index}`">
16
17
  <h3 class="h6">{{edu.institution}}</h3>
17
18
  <h4 class="h6 text-muted">{{edu.formation}}</h4>
18
- <p>{{edu.start_month}}/{{edu.start_year}} - {{edu.end_month}}/{{edu.end_year}} {{getTime(edu)}}</p>
19
+ <p>{{edu.start_month}}/{{edu.start_year}} - {{treatEndDate(edu.end_month,edu.end_year)}} {{getTime(edu)}}</p>
19
20
  </div>
20
21
 
21
- <h2 class="display-4 mt-4">Cursos Profissionalizantes</h2>
22
+ <h2 class="display-4 mt-4" v-show="courses.length">Cursos Profissionalizantes</h2>
22
23
  <div class="mb-4" v-for="(course, index) in courses" :key="`course-${index}`">
23
24
  <h4 class="h6">{{course.name}}</h4>
24
25
  <p>{{course.institution}} {{getTime(course)}}</p>
25
26
  </div>
26
27
 
27
- <h2 class="display-4 mt-4">Idiomas</h2>
28
+ <h2 class="display-4 mt-4" v-show="languages.length">Idiomas</h2>
28
29
  <div class="mb-4" v-for="(lang, index) in languages" :key="`lang-${index}`">
29
30
  <h4 class="h6 d-inline-block mr-3">{{lang.language[0].name}}</h4>
30
31
  <el-tooltip placement="top" :content="languageLevel(lang.level)">
@@ -36,7 +37,7 @@
36
37
  </el-tooltip>
37
38
  </div>
38
39
 
39
- <h2 class="display-4 mt-4">Habilidades</h2>
40
+ <h2 class="display-4 mt-4" v-show="skills.length">Habilidades</h2>
40
41
  <badge rounded type="primary"
41
42
  v-for="(skill, index) in skills" :key="`skill-${index}`">{{skill.skill_word}}</badge>
42
43
 
@@ -44,9 +45,12 @@
44
45
  </template>
45
46
 
46
47
  <script>
48
+ import getPrefixes from '@/util/getPrefixes.js'
49
+
47
50
  export default {
48
51
  name: 'user-cv-left-side',
49
52
  props: {
53
+ name: String,
50
54
  avatar: String,
51
55
  yearsOld: String | Number,
52
56
  city: String,
@@ -86,7 +90,6 @@ export default {
86
90
  const diffDuration = this.$moment.duration(dateDone.diff(dateInitial));
87
91
  const years = diffDuration.years()
88
92
  const months = diffDuration.months()
89
-
90
93
 
91
94
  if(years) {
92
95
  return years > 1 ? `(${years} anos)` : `(${years} ano)`
@@ -97,24 +100,39 @@ export default {
97
100
  },
98
101
  languageLevel(level) {
99
102
  switch (parseInt(level)) {
100
- case 1:
101
- return 'Iniciante';
102
- case 2:
103
- return 'Elementar';
104
- case 3:
105
- return 'Pré-intermediário';
106
- case 4:
107
- return 'Intermediário';
108
- case 5:
109
- return 'Intermediário Superior';
110
- case 6:
111
- return 'Avançado';
112
- case 7:
113
- return 'Fluente';
114
- default:
115
- return '';
103
+ case 1: return 'Iniciante';
104
+ case 2: return 'Elementar';
105
+ case 3: return 'Pré-intermediário';
106
+ case 4: return 'Intermediário';
107
+ case 5: return 'Intermediário Superior';
108
+ case 6: return 'Avançado';
109
+ case 7: return 'Fluente';
110
+ default: return '';
116
111
  }
117
- }
112
+ },
113
+ treatPhone(phone) {
114
+ if(phone == '0' || phone.length < 9 || !phone) {
115
+ return 'não cadastrado'
116
+ }
117
+
118
+ return phone
119
+ },
120
+ treatCellphone(cellphone) {
121
+ if(cellphone == '0' || cellphone.length < 11 || !cellphone) {
122
+ return 'não cadastrado'
123
+ }
124
+
125
+ return cellphone
126
+ },
127
+ handleGetPrefixes(name = '') {
128
+ return getPrefixes(name)
129
+ },
130
+ treatEndDate(end_month, end_year) {
131
+ if ( end_month && end_year) {
132
+ return `${end_month}/${end_year}`
133
+ }
134
+ return ''
135
+ },
118
136
  }
119
137
  }
120
138
  </script>
@@ -2,26 +2,28 @@
2
2
  <div class="col-7 bg-lighter py-5 px-5">
3
3
  <h2 class="display-4 text-center mb-4">{{name}}</h2>
4
4
  <p class="text-muted mb-0" v-show="wagePretesion"> Pretensão Salarial de {{wagePretesion | convertToReal}} reais.</p>
5
- <p class="text-muted">Código de indicação do usuário: <b>{{codUser}}</b></p>
5
+ <p class="text-muted" v-show="codUser">Código de indicação do usuário: <b>{{codUser}}</b></p>
6
6
 
7
- <h2 class="display-4">Sobre</h2>
8
- <p id="USER_ABOUT" class="readmore mb-0">{{about}}</p>
9
- <a href="#" aria-label="expandir conteudo" @click.prevent.stop="toggleReadMore($event,'USER_ABOUT')">Ler mais</a>
7
+ <h2 class="display-4" v-show="about">Sobre</h2>
8
+ <p id="USER_ABOUT" class="mb-0" :class="!wordIsLesserThan(about) && 'readmore'">{{about}}</p>
9
+ <a href="#" aria-label="expandir conteudo"
10
+ v-show="about && !wordIsLesserThan(about)" @click.prevent.stop="toggleReadMore($event,'USER_ABOUT')">Ler mais</a>
10
11
 
11
- <h2 class="display-4 mt-4">Experiência</h2>
12
+ <h2 class="display-4 mt-4" v-show="experience.length">Experiência</h2>
12
13
 
13
14
  <div class="mb-4" v-for="(exp, index) in experience" :key="`exp-${index}`">
14
15
  <h4 class="d-inline-block h6 text-muted font-weight-bold">{{exp.job_title}} - </h4>
15
16
  <h5 class="d-inline-block h6 text-muted font-weight-bold">{{exp.company}}</h5>
16
- <h6>{{exp.start_month}}/{{exp.start_year}} - {{exp.end_month}}/{{exp.end_year}} {{getTime(exp, 'Trabalhando')}}</h6>
17
+ <h6>{{exp.start_month}}/{{exp.start_year}} - {{treatEndDate(exp.end_month, exp.end_year)}} {{getTime(exp, 'Trabalhando')}}</h6>
17
18
 
18
19
  <div>
19
- <p id="USER_EXPERIENCE-1" class="mb-0 readmore">{{exp.description}}</p>
20
- <a href="#" aria-label="expandir conteudo" @click.prevent.stop="toggleReadMore($event,'USER_EXPERIENCE-1')">Ler mais</a>
20
+ <p :id="`USER_EXPERIENCE-${index + 1}`" class="mb-0" :class="!wordIsLesserThan(exp.description) && 'readmore'">{{exp.description}}</p>
21
+ <a href="#" aria-label="expandir conteudo"
22
+ v-show="!wordIsLesserThan(exp.description)" @click.prevent.stop="toggleReadMore($event,`USER_EXPERIENCE-${index+1}`)">Ler mais</a>
21
23
  </div>
22
24
  </div>
23
25
 
24
- <h2 class="display-4 mt-4">Cargos Desejados</h2>
26
+ <h2 class="display-4 mt-4" v-show="roleDesireds.length">Cargos Desejados</h2>
25
27
 
26
28
  <badge rounded type="primary" class="mr-2 mb-2"
27
29
  v-for="(roleDesired, i) in roleDesireds" :key="`${roleDesired.occupation}-${i}`">
@@ -51,22 +53,6 @@ export default {
51
53
  default: () => []
52
54
  },
53
55
  },
54
- data() {
55
- return {
56
- // roleDesireds: [
57
- // "Supervisor de Produção",
58
- // "Supervisor de Produção e Processos",
59
- // "Supervisor de Produção e Qualidade",
60
- // "Engenheiro de Produção",
61
- // "Engenheiro de Processos",
62
- // "Engenheiro de Processos / Produção",
63
- // "Analista de Produção",
64
- // "Analista de Qualidade",
65
- // "Supervisor de Fábrica",
66
- // "Líder de Produção"
67
- // ]
68
- }
69
- },
70
56
  filters: {
71
57
  convertToReal(value) {
72
58
  return 'R$ ' + value.toFixed(2).replace('.', ',');
@@ -98,7 +84,16 @@ export default {
98
84
 
99
85
  return months > 1 ? `(${months} meses)` :
100
86
  months == 1 ? `(${months} mês)` : ''
101
- },
87
+ },
88
+ treatEndDate(end_month, end_year) {
89
+ if ( end_month && end_year) {
90
+ return `${end_month}/${end_year}`
91
+ }
92
+ return ''
93
+ },
94
+ wordIsLesserThan(word, value = 300) {
95
+ return word && word.length < value
96
+ }
102
97
  }
103
98
  }
104
99
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.78",
3
+ "version": "1.0.79",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {