@burh/nuxt-core 1.0.302 → 1.0.304

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.
@@ -23,8 +23,8 @@
23
23
  collapse-tags
24
24
  allow-create
25
25
  placeholder="Escolher Cargo por"
26
- class="ml-2"
27
- v-model="selectRole"
26
+ class="member__select"
27
+ v-model="selectPosition"
28
28
  >
29
29
  <div class="text-center" slot="empty">
30
30
  <p class="small mb-2 mt-2">
@@ -32,22 +32,67 @@
32
32
  </p>
33
33
  </div>
34
34
  <el-option
35
- v-for="(role, index) in corporativeRole"
35
+ v-for="(posi, index) in positions"
36
36
  class="select-danger"
37
- :value="role.id"
38
- :label="role.name"
37
+ :value="posi.level"
38
+ :label="posi.level"
39
39
  :key="index"
40
40
  >
41
41
  </el-option>
42
42
  </el-select>
43
43
  </section>
44
44
 
45
- <section class="member__data" v-for="(algo, index) in 4" :key="index">
45
+ <section
46
+ class="member__data"
47
+ v-for="(member, index) in searchData"
48
+ :key="index"
49
+ v-show="!isLoading"
50
+ >
46
51
  <div>
47
- <img src="https://cdn.pixabay.com/photo/2017/08/30/12/45/girl-2696947_960_720.jpg" alt="">
48
- <p>Pessoa 1</p>
52
+ <img
53
+ v-show="member.urlImage"
54
+ :src="member.urlImage"
55
+ :alt="member.name"
56
+ >
57
+ <div v-show="!member.urlImage" class="member__no-image">
58
+ {{ handleGetPrefixes(member.name) }}
59
+ </div>
60
+ <p>{{ member.name }} {{ member.last_name }}</p>
49
61
  </div>
50
- <button type="button">Adicionar membro</button>
62
+ <button
63
+ type="button"
64
+ :disabled="selectPosition === ''"
65
+ :class="{'no-position': selectPosition === ''}"
66
+ @click="addMember(member)"
67
+ >
68
+ Adicionar membro
69
+ </button>
70
+ </section>
71
+
72
+ <!-- Skeleton for search data -->
73
+ <div v-if="isLoading">
74
+ <section
75
+ class="member__data"
76
+ v-for="index in 4"
77
+ :key="index"
78
+ >
79
+ <div>
80
+ <skeleton-animate rounded :width="52" :height="52" />
81
+ <skeleton-animate :width="100" :height="20" class="ml-2" />
82
+ </div>
83
+ <skeleton-animate rounded :width="184" :height="32" />
84
+ </section>
85
+ </div>
86
+
87
+ <section
88
+ class="member__no-results"
89
+ v-show="searchData.length === 0 && !isLoading"
90
+ >
91
+ <img
92
+ src="/img/icone_resultados.svg"
93
+ alt="Nenhum resultado"
94
+ />
95
+ <p>Nenhum usuário encontrado</p>
51
96
  </section>
52
97
  </div>
53
98
 
@@ -64,6 +109,8 @@
64
109
 
65
110
  <script>
66
111
  import { Dialog, Select, Option } from 'element-ui';
112
+ import getPrefixes from '~/util/getPrefixes.js';
113
+ import SkeletonAnimate from '../Skeleton/SkeletonAnimate.vue';
67
114
 
68
115
  export default {
69
116
  name: 'member-modal',
@@ -71,6 +118,7 @@ export default {
71
118
  [Dialog.name]: Dialog,
72
119
  [Select.name]: Select,
73
120
  [Option.name]: Option,
121
+ SkeletonAnimate
74
122
  },
75
123
  props: {
76
124
  isActive: {
@@ -78,23 +126,44 @@ export default {
78
126
  default: false,
79
127
  description: 'Open modal verification'
80
128
  },
81
- corporativeRole: {
129
+ positions: {
82
130
  type: Array,
83
131
  default: null,
84
132
  description: 'Company Positions'
133
+ },
134
+ searchData: {
135
+ type: Array,
136
+ default: null,
137
+ description: 'Search member results'
138
+ },
139
+ isLoading: {
140
+ type: Boolean,
141
+ default: false,
142
+ description: 'State loading'
85
143
  }
86
144
  },
87
145
  methods: {
88
146
  searchMember() {
89
147
  this.$emit('search-member', this.search);
90
- }
148
+ },
149
+ addMember(member) {
150
+ this.$emit('add-member', member.id, this.selectPosition);
151
+ },
152
+ handleGetPrefixes(name = '') {
153
+ return getPrefixes(name);
154
+ },
91
155
  },
92
156
  data() {
93
157
  return {
94
158
  search: '',
95
- selectRole: null
159
+ selectPosition: ''
96
160
  };
97
- }
161
+ },
162
+ watch: {
163
+ searchData(newValue){
164
+ this.searchData = newValue;
165
+ }
166
+ },
98
167
  };
99
168
  </script>
100
169
 
@@ -113,7 +182,7 @@ export default {
113
182
  overflow: hidden;
114
183
  border-radius: 10px;
115
184
  padding-bottom: 3.125rem;
116
- max-width: 55.43rem;
185
+ max-width: 60.43rem;
117
186
  }
118
187
 
119
188
  .member {
@@ -128,6 +197,10 @@ export default {
128
197
  .input__container__icon {
129
198
  height: 2.75rem;
130
199
  }
200
+
201
+ .member__select {
202
+ margin-left: auto;
203
+ }
131
204
  }
132
205
 
133
206
  &__data {
@@ -136,7 +209,7 @@ export default {
136
209
  align-items: center;
137
210
 
138
211
  padding-top: 0.5rem;
139
- margin-top: 1rem;
212
+ margin-top: 2rem;
140
213
  border-top: 2px solid #f8f8f8;
141
214
 
142
215
  div {
@@ -167,8 +240,51 @@ export default {
167
240
  color: #fff;
168
241
  background-color: #5865f2;
169
242
  border-color: #5865f2;
243
+
244
+ outline: 0;
170
245
  }
246
+
247
+ .no-position {
248
+ opacity: 0.3;
249
+ }
171
250
  }
251
+
252
+ &__no-image {
253
+ display: flex;
254
+ align-items: center;
255
+ justify-content: center;
256
+
257
+ width: 3.125rem;
258
+ height: 3.125rem;
259
+ border-radius: 50%;
260
+
261
+ background: #969595;
262
+ color: #fff;
263
+ }
264
+
265
+ &__no-results {
266
+ padding: 6.5rem;
267
+ display: flex;
268
+ justify-content: center;
269
+ align-items: center;
270
+ flex-direction: column;
271
+
272
+ img {
273
+ width: 7rem;
274
+
275
+ -webkit-filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
276
+ filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
277
+ }
278
+
279
+ p {
280
+ font-style: normal;
281
+ font-weight: normal;
282
+ font-size: 18px;
283
+ line-height: 27px;
284
+ color: #525f7f;
285
+ margin-top: 1.5rem;
286
+ }
287
+ }
172
288
  }
173
289
 
174
290
  .tool {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.302",
3
+ "version": "1.0.304",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {