@burh/nuxt-core 1.0.196 → 1.0.197

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,274 +1,309 @@
1
1
  <template>
2
- <div class="bg-white content-middle">
3
- <!-- FERRAMENTAS -->
4
- <div class="tools mt-3">
5
- <button
6
- @click="$emit(tool.event)"
7
- class="ml-3 burh-color"
8
- v-for="(tool, index) in tools"
9
- :key="index"
10
- >
11
- {{ tool.name }}
12
- </button>
13
- </div>
14
-
15
- <!-- SOBRE -->
16
- <div
17
- v-show="userData.user_complementary_information.about"
18
- class="about content-block mt-5 ml-3 mr-3"
19
- >
20
- <h5 class="font-weight-bold">Sobre</h5>
21
- <p
22
- id="USER_ABOUT"
23
- class="mb-0"
24
- :class="
25
- !wordIsLesserThan(
26
- userData.user_complementary_information.about
27
- ) && 'readmore'
28
- "
29
- >
30
- {{ userData.user_complementary_information.about }}
31
- </p>
32
- <a
33
- href="#"
34
- aria-label="expandir conteudo"
35
- v-show="
36
- userData.user_complementary_information.about &&
37
- !wordIsLesserThan(
38
- userData.user_complementary_information.about
39
- )
40
- "
41
- @click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
42
- >Ler mais</a
43
- >
44
- </div>
45
-
46
- <!-- EDUCAÇÃO -->
47
- <h5 class="font-weight-bold mt-4 ml-3">Educação</h5>
48
- <div
49
- v-show="userData.user_education.length > 0"
50
- class="education ml-3"
51
- v-for="(edu, index) in userData.user_education"
52
- :key="index"
53
- >
54
- <p class="sub-title">{{ edu.formation }}</p>
55
- <p class="info-text">{{ edu.institution }}</p>
56
- <span class="info-text">
57
- {{ edu.start_month }}/{{ edu.start_year }} -
58
- {{ treatEndDate(edu.end_month, edu.end_year) }}
59
- {{ getTime(false, edu) }}
60
- {{
61
- edu.user_education_period
62
- ? '-' + edu.user_education_period.name
63
- : ''
64
- }}
65
- </span>
66
- </div>
67
-
68
- <!-- EXPERIÊNCIAS -->
69
- <h5 class="font-weight-bold mt-4 ml-3">Experiência</h5>
70
- <div
71
- v-show="userData.user_experience.length > 0"
72
- class="experience ml-3 mr-3"
73
- v-for="(exp, index) in userData.user_experience"
74
- :key="`experience-${index}`"
75
- >
76
- <p class="sub-title">{{ exp.job_title }}</p>
77
- <p class="info-text">{{ exp.company }}, {{ exp.location }}</p>
78
- <span class="info-text">
79
- {{ exp.start_month }}/{{ exp.start_year }} -
80
- {{ treatEndDate(exp.end_month, exp.end_year) }}
81
- {{ getTime(true, exp) }}
82
- </span>
83
-
84
- <p
85
- :id="`USER_EXPERIENCE-${index}`"
86
- class="description mt-4 mb-0"
87
- :class="!wordIsLesserThan(exp.description) && 'readmore'"
88
- >
89
- {{ exp.description }}
90
- </p>
91
-
92
- <a
93
- href="#"
94
- aria-label="expandir conteudo"
95
- v-show="!wordIsLesserThan(exp.description)"
96
- @click.prevent.stop="
97
- toggleReadMore($event, `USER_EXPERIENCE-${index}`)
98
- "
99
- >Ler mais</a
100
- ><br /><br />
101
- </div>
102
-
103
- <!-- CURSOS -->
104
- <h5 class="font-weight-bold mt-1 ml-3">Cursos</h5>
105
- <div
106
- v-show="userData.user_course.length > 0"
107
- class="courses ml-3"
108
- v-for="(cou, index) in userData.user_course"
109
- :key="`course-${index}`"
110
- >
111
- <p class="sub-title">{{ cou.institution }}</p>
112
- <p class="info-text mb-3">
113
- {{ cou.name }} - {{ cou.end_year }}
114
- {{ getTime(false, cou) }}
115
- </p>
116
- </div>
117
- </div>
2
+ <div class="bg-white content-middle">
3
+ <!-- FERRAMENTAS -->
4
+ <div class="tools mt-3">
5
+ <button
6
+ @click="$emit(tool.event)"
7
+ class="ml-3 burh-color"
8
+ v-for="(tool, index) in tools"
9
+ :key="index"
10
+ >
11
+ {{ tool.name }}
12
+ </button>
13
+ </div>
14
+
15
+ <!-- SOBRE -->
16
+ <div class="about content-block mt-5 ml-3 mr-3">
17
+ <h5 class="font-weight-bold">Sobre</h5>
18
+ <p
19
+ id="USER_ABOUT"
20
+ class="mb-0"
21
+ :class="
22
+ !wordIsLesserThan(
23
+ userData.user_complementary_information.about
24
+ ) && 'readmore'
25
+ "
26
+ >
27
+ {{ userData.user_complementary_information.about }}
28
+ </p>
29
+ <a
30
+ href="#"
31
+ aria-label="expandir conteudo"
32
+ v-show="
33
+ userData.user_complementary_information.about &&
34
+ !wordIsLesserThan(
35
+ userData.user_complementary_information.about
36
+ )
37
+ "
38
+ @click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
39
+ >Ler mais</a
40
+ >
41
+
42
+ <p v-show="!userData.user_complementary_information.about" class="">
43
+ Nenhuma informação adicionada
44
+ </p>
45
+ </div>
46
+
47
+ <!-- EDUCAÇÃO -->
48
+ <h5 class="font-weight-bold mt-4 ml-3">Educação</h5>
49
+ <div class="no-info ml-3" v-show="userData.user_education.length === 0">
50
+ <p>
51
+ Nenhuma informação adicionada
52
+ </p>
53
+ </div>
54
+ <div
55
+ class="education ml-3"
56
+ v-show="userData.user_education.length > 0"
57
+ v-for="(edu, index) in userData.user_education"
58
+ :key="index"
59
+ >
60
+ <p class="sub-title">{{ edu.formation }}</p>
61
+ <p class="info-text">{{ edu.institution }}</p>
62
+ <span class="info-text">
63
+ {{ edu.start_month }}/{{ edu.start_year }} -
64
+ {{ treatEndDate(edu.end_month, edu.end_year) }}
65
+ {{ getTime(false, edu) }}
66
+ {{
67
+ edu.user_education_period
68
+ ? '-' + edu.user_education_period.name
69
+ : ''
70
+ }}
71
+ </span>
72
+ </div>
73
+
74
+ <!-- EXPERIÊNCIAS -->
75
+ <h5 class="font-weight-bold mt-4 ml-3">Experiência</h5>
76
+ <div
77
+ class="no-info ml-3"
78
+ v-show="userData.user_experience.length === 0"
79
+ >
80
+ <p>
81
+ Nenhuma informação adicionada
82
+ </p>
83
+ </div>
84
+ <div
85
+ v-show="userData.user_experience.length > 0"
86
+ class="experience ml-3 mr-3"
87
+ v-for="(exp, index) in userData.user_experience"
88
+ :key="`experience-${index}`"
89
+ >
90
+ <p class="sub-title">{{ exp.job_title }}</p>
91
+ <p class="info-text">{{ exp.company }}, {{ exp.location }}</p>
92
+ <span class="info-text">
93
+ {{ exp.start_month }}/{{ exp.start_year }} -
94
+ {{ treatEndDate(exp.end_month, exp.end_year) }}
95
+ {{ getTime(true, exp) }}
96
+ </span>
97
+
98
+ <p
99
+ :id="`USER_EXPERIENCE-${index}`"
100
+ class="description mt-4 mb-0"
101
+ :class="!wordIsLesserThan(exp.description) && 'readmore'"
102
+ >
103
+ {{ exp.description }}
104
+ </p>
105
+
106
+ <a
107
+ href="#"
108
+ aria-label="expandir conteudo"
109
+ v-show="!wordIsLesserThan(exp.description)"
110
+ @click.prevent.stop="
111
+ toggleReadMore($event, `USER_EXPERIENCE-${index}`)
112
+ "
113
+ >Ler mais</a
114
+ ><br /><br />
115
+ </div>
116
+
117
+ <!-- CURSOS -->
118
+ <h5 class="font-weight-bold mt-1 ml-3">Cursos</h5>
119
+ <div class="no-info ml-3" v-show="userData.user_course.length === 0">
120
+ <p>
121
+ Nenhuma informação adicionada
122
+ </p>
123
+ </div>
124
+ <div
125
+ v-show="userData.user_course.length > 0"
126
+ class="courses ml-3"
127
+ v-for="(cou, index) in userData.user_course"
128
+ :key="`course-${index}`"
129
+ >
130
+ <p class="sub-title">{{ cou.institution }}</p>
131
+ <p class="info-text mb-3">
132
+ {{ cou.name }} - {{ cou.end_year }}
133
+ {{ getTime(false, cou) }}
134
+ </p>
135
+ </div>
136
+ </div>
118
137
  </template>
119
138
 
120
139
  <script>
121
140
  import getPrefixes from '~/util/getPrefixes.js';
122
141
 
123
142
  export default {
124
- name: 'user-cv-middle',
125
- props: {
126
- userData: Object,
127
- tools: {
128
- type: Array,
129
- default: () => []
130
- }
131
- },
132
- watch: {
133
- userData() {
134
- this.userData.user_experience = this.filterByDate(this.userData.user_experience);
135
- this.userData.user_course = this.filterByDate(this.userData.user_course, 'old');
136
- this.userData.user_education =this.filterByDate(this.userData.user_education, 'old');
137
- }
138
- },
139
- methods: {
140
- filterByDate(data, by = 'new') {
141
- let sortedArray = data.sort((a, b) => {
142
- a = [
143
- a.start_month,
144
- a.start_year,
145
- a.end_month | 12,
146
- a.end_year | 9999
147
- ];
148
-
149
- b = [
150
- b.start_month,
151
- b.start_year,
152
- b.end_month | 12,
153
- b.end_year | 9999
154
- ];
155
-
156
- // Primeiro filtro -> chaves: 0 e 1 -> Filtro por data de inicio
157
- // Segundo filtro -> chaves: 2 e 3 -> Filtro por data de termino (subir não concluídos para primeiros)
158
-
159
- let byStart;
160
- let byEnd;
161
-
162
- switch (by) {
163
- case 'old':
164
- byStart = (new Date(a[1], a[0], 1).getTime() - new Date(b[1], b[0], 1).getTime());
165
- byEnd = (new Date(b[3], b[2], 1).getTime() - new Date(a[3], a[2], 1).getTime());
166
- break;
167
-
168
- default:
169
- byStart = (new Date(b[1], b[0], 1).getTime() - new Date(a[1], a[0], 1).getTime());
170
- byEnd = (new Date(b[3], b[2], 1).getTime() - new Date(a[3], a[2], 1).getTime());
171
- break;
172
- }
173
-
174
- return (byStart - byEnd);
175
- });
176
-
177
- return sortedArray;
178
- },
179
- toggleReadMore(event, id) {
180
- const element = document.getElementById(id);
181
- element.classList.toggle('readmore');
182
- event.target.innerText == 'Ler mais'
183
- ? (event.target.innerText = 'Esconder')
184
- : (event.target.innerText = 'Ler mais');
185
- },
186
- getTime(
187
- isExperience,
188
- { start_year = null, end_year = null, start_month, end_month },
189
- textHappening = 'Cursando'
190
- ) {
191
- const isHappening = !end_month && !end_year;
192
-
193
- if (isHappening) {
194
- return isExperience === true ? 'Atualmente' : textHappening;
195
- }
196
-
197
- const dateInitial = this.$moment(
198
- ['1', start_month.toString(), start_year.toString()],
199
- 'DD/MM/YYYY'
200
- );
201
- const dateDone = this.$moment(
202
- ['1', end_month.toString(), end_year.toString()],
203
- 'DD/MM/YYYY'
204
- );
205
- const diffDuration = this.$moment.duration(
206
- dateDone.diff(dateInitial)
207
- );
208
- const years = diffDuration.years();
209
- const months = diffDuration.months();
210
-
211
- if (years) {
212
- return years > 1 ? `(${years} anos)` : `(${years} ano)`;
213
- }
214
-
215
- return months > 1
216
- ? `(${months} meses)`
217
- : months == 1
218
- ? `(${months} mês)`
219
- : '';
220
- },
221
- languageLevel(level) {
222
- switch (parseInt(level)) {
223
- case 1:
224
- return 'Iniciante';
225
- case 2:
226
- return 'Elementar';
227
- case 3:
228
- return 'Pré-intermediário';
229
- case 4:
230
- return 'Intermediário';
231
- case 5:
232
- return 'Intermediário Superior';
233
- case 6:
234
- return 'Avançado';
235
- case 7:
236
- return 'Fluente';
237
- default:
238
- return '';
239
- }
240
- },
241
- treatPhone(phone) {
242
- if (phone) {
243
- if (phone == '0' || phone.length < 9 || !phone) {
244
- return 'não cadastrado';
245
- }
246
- }
247
-
248
- return phone;
249
- },
250
- treatCellphone(cellphone) {
251
- if (cellphone) {
252
- if (cellphone == '0' || cellphone.length < 11 || !cellphone) {
253
- return 'não cadastrado';
254
- }
255
- }
256
-
257
- return cellphone;
258
- },
259
- handleGetPrefixes(name = '') {
260
- return getPrefixes(name);
261
- },
262
- treatEndDate(end_month, end_year) {
263
- if (end_month && end_year) {
264
- return `${end_month}/${end_year}`;
265
- }
266
- return '';
267
- },
268
- wordIsLesserThan(word, value = 300) {
269
- return word && word.length < value;
270
- }
271
- }
143
+ name: 'user-cv-middle',
144
+ props: {
145
+ userData: Object,
146
+ tools: {
147
+ type: Array,
148
+ default: () => []
149
+ }
150
+ },
151
+ watch: {
152
+ userData() {
153
+ this.userData.user_experience = this.filterByDate(
154
+ this.userData.user_experience
155
+ );
156
+ this.userData.user_course = this.filterByDate(
157
+ this.userData.user_course,
158
+ 'old'
159
+ );
160
+ this.userData.user_education = this.filterByDate(
161
+ this.userData.user_education,
162
+ 'old'
163
+ );
164
+ }
165
+ },
166
+ methods: {
167
+ filterByDate(data, by = 'new') {
168
+ let sortedArray = data.sort((a, b) => {
169
+ a = [
170
+ a.start_month,
171
+ a.start_year,
172
+ a.end_month | 12,
173
+ a.end_year | 9999
174
+ ];
175
+
176
+ b = [
177
+ b.start_month,
178
+ b.start_year,
179
+ b.end_month | 12,
180
+ b.end_year | 9999
181
+ ];
182
+
183
+ // Primeiro filtro -> chaves: 0 e 1 -> Filtro por data de inicio
184
+ // Segundo filtro -> chaves: 2 e 3 -> Filtro por data de termino (subir não concluídos para primeiros)
185
+
186
+ let byStart;
187
+ let byEnd;
188
+
189
+ switch (by) {
190
+ case 'old':
191
+ byStart =
192
+ new Date(a[1], a[0], 1).getTime() -
193
+ new Date(b[1], b[0], 1).getTime();
194
+ byEnd =
195
+ new Date(b[3], b[2], 1).getTime() -
196
+ new Date(a[3], a[2], 1).getTime();
197
+ break;
198
+
199
+ default:
200
+ byStart =
201
+ new Date(b[1], b[0], 1).getTime() -
202
+ new Date(a[1], a[0], 1).getTime();
203
+ byEnd =
204
+ new Date(b[3], b[2], 1).getTime() -
205
+ new Date(a[3], a[2], 1).getTime();
206
+ break;
207
+ }
208
+
209
+ return byStart - byEnd;
210
+ });
211
+
212
+ return sortedArray;
213
+ },
214
+ toggleReadMore(event, id) {
215
+ const element = document.getElementById(id);
216
+ element.classList.toggle('readmore');
217
+ event.target.innerText == 'Ler mais'
218
+ ? (event.target.innerText = 'Esconder')
219
+ : (event.target.innerText = 'Ler mais');
220
+ },
221
+ getTime(
222
+ isExperience,
223
+ { start_year = null, end_year = null, start_month, end_month },
224
+ textHappening = 'Cursando'
225
+ ) {
226
+ const isHappening = !end_month && !end_year;
227
+
228
+ if (isHappening) {
229
+ return isExperience === true ? 'Atualmente' : textHappening;
230
+ }
231
+
232
+ const dateInitial = this.$moment(
233
+ ['1', start_month.toString(), start_year.toString()],
234
+ 'DD/MM/YYYY'
235
+ );
236
+ const dateDone = this.$moment(
237
+ ['1', end_month.toString(), end_year.toString()],
238
+ 'DD/MM/YYYY'
239
+ );
240
+ const diffDuration = this.$moment.duration(
241
+ dateDone.diff(dateInitial)
242
+ );
243
+ const years = diffDuration.years();
244
+ const months = diffDuration.months();
245
+
246
+ if (years) {
247
+ return years > 1 ? `(${years} anos)` : `(${years} ano)`;
248
+ }
249
+
250
+ return months > 1
251
+ ? `(${months} meses)`
252
+ : months == 1
253
+ ? `(${months} mês)`
254
+ : '';
255
+ },
256
+ languageLevel(level) {
257
+ switch (parseInt(level)) {
258
+ case 1:
259
+ return 'Iniciante';
260
+ case 2:
261
+ return 'Elementar';
262
+ case 3:
263
+ return 'Pré-intermediário';
264
+ case 4:
265
+ return 'Intermediário';
266
+ case 5:
267
+ return 'Intermediário Superior';
268
+ case 6:
269
+ return 'Avançado';
270
+ case 7:
271
+ return 'Fluente';
272
+ default:
273
+ return '';
274
+ }
275
+ },
276
+ treatPhone(phone) {
277
+ if (phone) {
278
+ if (phone == '0' || phone.length < 9 || !phone) {
279
+ return 'não cadastrado';
280
+ }
281
+ }
282
+
283
+ return phone;
284
+ },
285
+ treatCellphone(cellphone) {
286
+ if (cellphone) {
287
+ if (cellphone == '0' || cellphone.length < 11 || !cellphone) {
288
+ return 'não cadastrado';
289
+ }
290
+ }
291
+
292
+ return cellphone;
293
+ },
294
+ handleGetPrefixes(name = '') {
295
+ return getPrefixes(name);
296
+ },
297
+ treatEndDate(end_month, end_year) {
298
+ if (end_month && end_year) {
299
+ return `${end_month}/${end_year}`;
300
+ }
301
+ return '';
302
+ },
303
+ wordIsLesserThan(word, value = 300) {
304
+ return word && word.length < value;
305
+ }
306
+ }
272
307
  };
273
308
  </script>
274
309
 
@@ -296,7 +331,7 @@ export default {
296
331
  border: none;
297
332
  margin-top: 15px;
298
333
 
299
- background: #1DA1F1;
334
+ background: #1da1f1;
300
335
  border-radius: 16px;
301
336
  color: #fff;
302
337
 
@@ -343,4 +378,11 @@ export default {
343
378
  color: #62778c;
344
379
  }
345
380
  }
381
+
382
+ .no-info {
383
+ p {
384
+ font-size: 0.875rem;
385
+ color: #62778c;
386
+ }
387
+ }
346
388
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.196",
3
+ "version": "1.0.197",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {