@burh/nuxt-core 1.0.414 → 1.0.415

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,194 +1,209 @@
1
- <template>
2
- <div class="recruitment__user__card">
3
- <div
4
- class="recruitment__user__card__header"
5
- :class="[
6
- { 'header__cover--shadow': cover },
7
- { 'header__cover--glass': glass }
8
- ]"
9
- >
10
- <div class="recruitment__user__card__header__actions">
11
- <div class="left">
12
- <slot name="header-left" />
13
- </div>
14
- <div class="right">
15
- <slot name="header-right" />
16
- </div>
17
- </div>
18
- <img
19
- v-if="cover !== null"
20
- :src="cover"
21
- class="user__cover"
22
- @error="cover = null"
23
- >
24
- </div>
25
-
26
- <div class="recruitment__user__card__content">
27
- <img :src="(avatar) ? avatar : getNameInitials(name, last_name)" :alt="name">
28
-
29
- <slot name="card-content" />
30
- </div>
31
-
32
- <div class="recruitment__user__card__footer">
33
- <slot name="card-footer" />
34
- </div>
35
- </div>
36
- </template>
37
-
38
- <script>
39
- export default {
40
- name: 'recruitment-user-card',
41
- props: {
42
- cover: {
43
- type: String,
44
- default: null
45
- },
46
- avatar: {
47
- type: String,
48
- default: null
49
- },
50
- name: {
51
- type: String,
52
- default: null
53
- },
54
- last_name: {
55
- type: String,
56
- default: null
57
- },
58
- glass: {
59
- type: Boolean,
60
- default: false
61
- }
62
- },
63
- methods: {
64
- getNameInitials(name, last_name) {
65
- const avatarUrl = process.env.routes.avatar;
66
-
67
- let userAvatarName;
68
-
69
- if (name && last_name) {
70
- userAvatarName = `${name.toUpperCase().charAt(0)}${last_name.toUpperCase().charAt(0)}`;
71
- } else if (name && last_name === null) {
72
- userAvatarName = name;
73
- } else {
74
- userAvatarName = 'BURH';
75
- }
76
-
77
- return avatarUrl.replace(':size', '124x124').replace(':initials', userAvatarName);
78
- },
79
- }
80
- };
81
- </script>
82
-
83
- <style lang="scss" scoped>
84
-
85
- .recruitment__user__card {
86
- background: #fff;
87
- box-shadow: 0 3px 20px rgba(0, 0, 0, 0.08);
88
- border-radius: 4px;
89
- overflow: hidden;
90
- cursor: pointer;
91
- transition: transform 0.25s;
92
- &:focus {
93
- outline: none;
94
- transform: translateY(-5px);
95
- }
96
- &:hover {
97
- transform: translateY(-5px);
98
- }
99
-
100
- img {
101
- user-select: none;
102
- }
103
-
104
- &__header {
105
- width: 100%;
106
- height: 70px;
107
- overflow: hidden;
108
- position: relative;
109
- background: #1F8CEB;
110
- &.header__cover--shadow::before {
111
- content: '';
112
- position: absolute;
113
- top: 0;
114
- left: 0;
115
- width: 100%;
116
- height: 100%;
117
- background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), 80%, transparent);
118
- z-index: 1;
119
- }
120
- &.header__cover--glass {
121
- &::before {
122
- backdrop-filter: blur( 4px );
123
- -webkit-backdrop-filter: blur( 4px );
124
- background: rgba(0,0,0,0.2)!important;
125
- }
126
- }
127
- .user__cover {
128
- width: 100%;
129
- height: 100%;
130
- object-fit: cover;
131
- }
132
- &__actions {
133
- position: absolute;
134
- top: 0;
135
- left: 0;
136
- width: 100%;
137
- display: flex;
138
- align-items: center;
139
- justify-content: space-between;
140
- padding: 10px 15px;
141
- z-index: 2;
142
- .right {
143
- display: flex;
144
- align-items: center;
145
- flex-direction: row;
146
- button {
147
- color: #fff;
148
- border: 0;
149
- background: transparent;
150
- width: 32px;
151
- height: 32px;
152
- display: flex;
153
- align-items: center;
154
- justify-content: center;
155
- }
156
- }
157
- }
158
- }
159
- &__content {
160
- display: flex;
161
- flex-direction: column;
162
- align-items: center;
163
- justify-content: center;
164
- padding: 0 15px;
165
- img {
166
- width: 120px;
167
- height: 120px;
168
- border-radius: 100px;
169
- object-fit: contain;
170
- margin-top: -20px;
171
- z-index: 10;
172
- box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
173
- background: #fff;
174
- border: 4px solid #fff;
175
- }
176
- }
177
- &__footer {
178
- display: flex;
179
- align-items: center;
180
- justify-content: center;
181
- padding-bottom: 20px;
182
- span {
183
- font-size: 0.875rem;
184
- font-weight: 500;
185
- margin: 0 10px;
186
- color: #AEB6BE;
187
- &.new {
188
- color: #1F8CEB;
189
- }
190
- }
191
- }
192
- }
193
-
194
- </style>
1
+ <template>
2
+ <div class="recruitment__user__card">
3
+ <div
4
+ class="recruitment__user__card__header"
5
+ :class="[
6
+ { 'header__cover--shadow': hasCover },
7
+ { 'header__cover--glass': glass }
8
+ ]"
9
+ >
10
+ <div class="recruitment__user__card__header__actions">
11
+ <div class="left">
12
+ <slot name="header-left" />
13
+ </div>
14
+ <div class="right">
15
+ <slot name="header-right" />
16
+ </div>
17
+ </div>
18
+ <img
19
+ v-if="hasCover"
20
+ :src="cover"
21
+ class="user__cover"
22
+ @error="hasCover = false"
23
+ >
24
+ </div>
25
+
26
+ <div class="recruitment__user__card__content">
27
+ <img
28
+ :src="(avatar) ? avatar : getNameInitials(name, last_name)"
29
+ :alt="name"
30
+ @error="img => getImageFallback(img, name)"
31
+ >
32
+
33
+ <slot name="card-content" />
34
+ </div>
35
+
36
+ <div class="recruitment__user__card__footer">
37
+ <slot name="card-footer" />
38
+ </div>
39
+ </div>
40
+ </template>
41
+
42
+ <script>
43
+ export default {
44
+ name: 'recruitment-user-card',
45
+ props: {
46
+ cover: {
47
+ type: String,
48
+ default: null
49
+ },
50
+ avatar: {
51
+ type: String,
52
+ default: null
53
+ },
54
+ name: {
55
+ type: String,
56
+ default: null
57
+ },
58
+ last_name: {
59
+ type: String,
60
+ default: null
61
+ },
62
+ glass: {
63
+ type: Boolean,
64
+ default: false
65
+ }
66
+ },
67
+ data() {
68
+ return {
69
+ hasCover: true
70
+ };
71
+ },
72
+ methods: {
73
+ getImageFallback(img, name) {
74
+ img.target.src = this.getNameInitials(name);
75
+ },
76
+ getNameInitials(name, last_name) {
77
+ const avatarUrl = process.env.routes.avatar;
78
+
79
+ let userAvatarName;
80
+
81
+ if (name && last_name) {
82
+ userAvatarName = `${name.toUpperCase().charAt(0)}${last_name.toUpperCase().charAt(0)}`;
83
+ } else if (name && !last_name) {
84
+ userAvatarName = name.slice(0, 1).toUpperCase();
85
+ } else {
86
+ userAvatarName = 'BURH';
87
+ }
88
+
89
+ return avatarUrl.replace(':size', '64x64').replace(':initials', userAvatarName);
90
+ },
91
+ },
92
+ mounted() {
93
+ !this.cover && (this.hasCover = false);
94
+ }
95
+ };
96
+ </script>
97
+
98
+ <style lang="scss" scoped>
99
+
100
+ .recruitment__user__card {
101
+ background: #fff;
102
+ box-shadow: 0 3px 20px rgba(0, 0, 0, 0.08);
103
+ border-radius: 4px;
104
+ overflow: hidden;
105
+ cursor: pointer;
106
+ transition: transform 0.25s;
107
+ &:focus {
108
+ outline: none;
109
+ transform: translateY(-5px);
110
+ }
111
+ &:hover {
112
+ transform: translateY(-5px);
113
+ }
114
+
115
+ img {
116
+ user-select: none;
117
+ }
118
+
119
+ &__header {
120
+ width: 100%;
121
+ height: 70px;
122
+ overflow: hidden;
123
+ position: relative;
124
+ background: #1F8CEB;
125
+ &.header__cover--shadow::before {
126
+ content: '';
127
+ position: absolute;
128
+ top: 0;
129
+ left: 0;
130
+ width: 100%;
131
+ height: 100%;
132
+ background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), 80%, transparent);
133
+ z-index: 1;
134
+ }
135
+ &.header__cover--glass {
136
+ &::before {
137
+ backdrop-filter: blur( 4px );
138
+ -webkit-backdrop-filter: blur( 4px );
139
+ background: rgba(0,0,0,0.2)!important;
140
+ }
141
+ }
142
+ .user__cover {
143
+ width: 100%;
144
+ height: 100%;
145
+ object-fit: cover;
146
+ }
147
+ &__actions {
148
+ position: absolute;
149
+ top: 0;
150
+ left: 0;
151
+ width: 100%;
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: space-between;
155
+ padding: 10px 15px;
156
+ z-index: 2;
157
+ .right {
158
+ display: flex;
159
+ align-items: center;
160
+ flex-direction: row;
161
+ button {
162
+ color: #fff;
163
+ border: 0;
164
+ background: transparent;
165
+ width: 32px;
166
+ height: 32px;
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: center;
170
+ }
171
+ }
172
+ }
173
+ }
174
+ &__content {
175
+ display: flex;
176
+ flex-direction: column;
177
+ align-items: center;
178
+ justify-content: center;
179
+ padding: 0 15px;
180
+ img {
181
+ width: 120px;
182
+ height: 120px;
183
+ border-radius: 100px;
184
+ object-fit: contain;
185
+ margin-top: -20px;
186
+ z-index: 10;
187
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
188
+ background: #fff;
189
+ border: 4px solid #fff;
190
+ }
191
+ }
192
+ &__footer {
193
+ display: flex;
194
+ align-items: center;
195
+ justify-content: center;
196
+ padding-bottom: 20px;
197
+ span {
198
+ font-size: 0.875rem;
199
+ font-weight: 500;
200
+ margin: 0 10px;
201
+ color: #AEB6BE;
202
+ &.new {
203
+ color: #1F8CEB;
204
+ }
205
+ }
206
+ }
207
+ }
208
+
209
+ </style>
@@ -1,222 +1,226 @@
1
- <template>
2
- <base-header class="app-header" :type="'white'">
3
- <div class="row justify-content-between">
4
- <div
5
- :class="{ 'images__container': users.length }"
6
- class="col-8 my-auto header__container"
7
- >
8
- <slot name="header-top" />
9
-
10
- <div class="header__content">
11
- <div class="d-flex align-items-center flex-row">
12
- <button class="back__button" v-if="hasBackButton" @click="goBack()">
13
- <i class="fas fa-arrow-left"></i>
14
- </button>
15
- <h2 class="font-weight-bold display-3">{{name}}</h2>
16
- </div>
17
- <div class="images" v-if="users.length">
18
- <el-tooltip
19
- v-for="user in users"
20
- :key="user.id"
21
- placement="top"
22
- :content="user.name"
23
- class="user__avatar"
24
- :class="{ 'user__avatar--active': activeUserId === user.id }"
25
- >
26
- <img
27
- @click="setActiveUser(user.id)"
28
- :src="(user.avatar) ? user.avatar : getNameInitials(user.name, user.last_name)"
29
- :alt="user.name"
30
- >
31
- </el-tooltip>
32
- </div>
33
- </div>
34
-
35
- <span id="credits-amount" v-if="subheader !== null">
36
- {{ subheader }} Créditos
37
- </span>
38
-
39
- <slot name="header-bottom" />
40
- </div>
41
-
42
- <div class="col-4 d-flex justify-content-end align-items-start">
43
- <el-tooltip v-for="(item, index) in icons" :key="index"
44
- v-show="!item.disabled"
45
- class="item" effect="dark" :content="item.title" placement="top">
46
- <base-button size="md" type="link" class="text-primary px-2 w-auto"
47
- @click="$emit(item.event, item)">
48
- <font-awesome-icon :icon="item.icon" class="mr-2" />
49
- </base-button>
50
- </el-tooltip>
51
-
52
- <slot name="buttons" />
53
- </div>
54
-
55
- <slot/>
56
- </div>
57
- </base-header>
58
- </template>
59
- <script>
60
- export default {
61
- data(){
62
- return{
63
- default: '',
64
- activeUserId: null
65
- };
66
- },
67
- props:{
68
- icons:{
69
- type: Array,
70
- default: () =>[{ event: 'view', icon: ['fas', 'eye'], disabled: false, title: 'Visualizar' }, { event: 'config', icon: ['fas', 'cog'], disabled: false, title: 'Editar' } ]
71
- },
72
- name: {
73
- type: String,
74
- default: 'Teste de matematica'
75
- },
76
- subheader: {
77
- type: Number,
78
- default: null
79
- },
80
- users: {
81
- type: Array,
82
- default: () => []
83
- },
84
- hasBackButton: {
85
- type: Boolean,
86
- default: false
87
- },
88
- backClickAction: {
89
- type: Function || null,
90
- default: null
91
- }
92
- },
93
- methods: {
94
- goBack() {
95
- if (this.backClickAction === null) {
96
- this.$router.go(-1);
97
- } else {
98
- this.backClickAction();
99
- }
100
- },
101
- getNameInitials(name, last_name) {
102
- const avatarUrl = process.env.routes.avatar;
103
-
104
- let userAvatarName;
105
-
106
- if (name && last_name) {
107
- userAvatarName = `${name.toUpperCase().charAt(0)}${last_name.toUpperCase().charAt(0)}`;
108
- } else if (name && last_name === null) {
109
- userAvatarName = name;
110
- } else {
111
- userAvatarName = 'BURH';
112
- }
113
-
114
- return avatarUrl.replace(':size', '64x64').replace(':initials', userAvatarName);
115
- },
116
- setActiveUser(userId) {
117
- if (this.activeUserId !== userId) {
118
- this.activeUserId = userId;
119
- this.$emit('active-user', userId);
120
- } else {
121
- this.activeUserId = null;
122
- this.$emit('active-user', null);
123
- }
124
- }
125
- }
126
- };
127
- </script>
128
- <style lang="scss" scoped>
129
- #credits-amount {
130
- margin: 0!important;
131
- min-width: 8em;
132
- margin: 1rem 1rem 1rem 0;
133
- padding: 0.25em 1em;
134
- font-size: 0.85rem;
135
- line-height: 1.4em;
136
- border-radius: 23rem;
137
- font-weight: 400;
138
- text-align: center;
139
- background-color: rgba(29, 161, 241, 0.1);
140
- color: #5865F2;
141
- }
142
- </style>
143
- <style lang="scss">
144
-
145
- .app-header {
146
- width: 100%;
147
- padding-top: 1.25rem;
148
- box-shadow: 0 0 2rem 0 rgba(136, 152, 170, 0.15);
149
- }
150
-
151
- .back__button {
152
- cursor: pointer;
153
- width: 42px;
154
- height: 42px;
155
- display: flex;
156
- align-items: center;
157
- justify-content: center;
158
- margin-right: 10px;
159
- border-radius: 100px;
160
- transition: background 0.5s;
161
- margin-left: -15px;
162
- border: 0;
163
- background: transparent;
164
- color: #32325d;
165
- &:focus {
166
- outline: none;
167
- }
168
- &:not(:disabled):hover, &:focus:not(:disabled):hover {
169
- background: rgba(0, 0, 0, 0.08);
170
- }
171
- }
172
-
173
- .header__container {
174
- display: flex;
175
- flex-direction: column;
176
- justify-content: center;
177
- align-items: flex-start;
178
- }
179
-
180
- .images__container {
181
- display: flex;
182
- align-items: flex-start;
183
- justify-content: center;
184
- .header__content {
185
- display: flex;
186
- align-items: center;
187
- flex-direction: row;
188
- padding: 10px 0;
189
- h2 {
190
- margin-bottom: 0;
191
- }
192
- .images {
193
- margin-left: 10px;
194
- display: flex;
195
- align-items: center;
196
- user-select: none;
197
- .user__avatar {
198
- cursor: pointer;
199
- border: 2px solid transparent;
200
- transition: border-color 0.5s;
201
- border: 2px solid #fff;
202
- background: #fff;
203
- &--active {
204
- border-color: #5865F2;
205
- z-index: 10;
206
- }
207
- }
208
- img {
209
- $size: 42px;
210
- display: block;
211
- width: $size;
212
- height: $size;
213
- object-fit: cover;
214
- border-radius: 100px;
215
- &:not(:first-child) {
216
- margin-left: -10px;
217
- }
218
- }
219
- }
220
- }
221
- }
222
- </style>
1
+ <template>
2
+ <base-header class="app-header" :type="'white'">
3
+ <div class="row justify-content-between">
4
+ <div
5
+ :class="{ 'images__container': users.length }"
6
+ class="col-8 my-auto header__container"
7
+ >
8
+ <slot name="header-top" />
9
+
10
+ <div class="header__content">
11
+ <div class="d-flex align-items-center flex-row">
12
+ <button class="back__button" v-if="hasBackButton" @click="goBack()">
13
+ <i class="fas fa-arrow-left"></i>
14
+ </button>
15
+ <h2 class="font-weight-bold display-3">{{name}}</h2>
16
+ </div>
17
+ <div class="images" v-if="users.length">
18
+ <el-tooltip
19
+ v-for="user in users"
20
+ :key="user.id"
21
+ placement="top"
22
+ :content="user.name"
23
+ class="user__avatar"
24
+ :class="{ 'user__avatar--active': activeUserId === user.id }"
25
+ >
26
+ <img
27
+ @click="setActiveUser(user.id)"
28
+ :src="(user.avatar) ? user.avatar : getNameInitials(user.name, user.last_name)"
29
+ :alt="user.name"
30
+ @error="img => getImageFallback(img, user.name)"
31
+ >
32
+ </el-tooltip>
33
+ </div>
34
+ </div>
35
+
36
+ <span id="credits-amount" v-if="subheader !== null">
37
+ {{ subheader }} Créditos
38
+ </span>
39
+
40
+ <slot name="header-bottom" />
41
+ </div>
42
+
43
+ <div class="col-4 d-flex justify-content-end align-items-start">
44
+ <el-tooltip v-for="(item, index) in icons" :key="index"
45
+ v-show="!item.disabled"
46
+ class="item" effect="dark" :content="item.title" placement="top">
47
+ <base-button size="md" type="link" class="text-primary px-2 w-auto"
48
+ @click="$emit(item.event, item)">
49
+ <font-awesome-icon :icon="item.icon" class="mr-2" />
50
+ </base-button>
51
+ </el-tooltip>
52
+
53
+ <slot name="buttons" />
54
+ </div>
55
+
56
+ <slot/>
57
+ </div>
58
+ </base-header>
59
+ </template>
60
+ <script>
61
+ export default {
62
+ data(){
63
+ return{
64
+ default: '',
65
+ activeUserId: null
66
+ };
67
+ },
68
+ props:{
69
+ icons:{
70
+ type: Array,
71
+ default: () =>[{ event: 'view', icon: ['fas', 'eye'], disabled: false, title: 'Visualizar' }, { event: 'config', icon: ['fas', 'cog'], disabled: false, title: 'Editar' } ]
72
+ },
73
+ name: {
74
+ type: String,
75
+ default: 'Teste de matematica'
76
+ },
77
+ subheader: {
78
+ type: Number,
79
+ default: null
80
+ },
81
+ users: {
82
+ type: Array,
83
+ default: () => []
84
+ },
85
+ hasBackButton: {
86
+ type: Boolean,
87
+ default: false
88
+ },
89
+ backClickAction: {
90
+ type: Function || null,
91
+ default: null
92
+ }
93
+ },
94
+ methods: {
95
+ goBack() {
96
+ if (this.backClickAction === null) {
97
+ this.$router.go(-1);
98
+ } else {
99
+ this.backClickAction();
100
+ }
101
+ },
102
+ getImageFallback(img, name) {
103
+ img.target.src = this.getNameInitials(name);
104
+ },
105
+ getNameInitials(name, last_name) {
106
+ const avatarUrl = process.env.routes.avatar;
107
+
108
+ let userAvatarName;
109
+
110
+ if (name && last_name) {
111
+ userAvatarName = `${name.toUpperCase().charAt(0)}${last_name.toUpperCase().charAt(0)}`;
112
+ } else if (name && !last_name) {
113
+ userAvatarName = name.slice(0, 1).toUpperCase();
114
+ } else {
115
+ userAvatarName = 'BURH';
116
+ }
117
+
118
+ return avatarUrl.replace(':size', '64x64').replace(':initials', userAvatarName);
119
+ },
120
+ setActiveUser(userId) {
121
+ if (this.activeUserId !== userId) {
122
+ this.activeUserId = userId;
123
+ this.$emit('active-user', userId);
124
+ } else {
125
+ this.activeUserId = null;
126
+ this.$emit('active-user', null);
127
+ }
128
+ }
129
+ }
130
+ };
131
+ </script>
132
+ <style lang="scss" scoped>
133
+ #credits-amount {
134
+ margin: 0!important;
135
+ min-width: 8em;
136
+ margin: 1rem 1rem 1rem 0;
137
+ padding: 0.25em 1em;
138
+ font-size: 0.85rem;
139
+ line-height: 1.4em;
140
+ border-radius: 23rem;
141
+ font-weight: 400;
142
+ text-align: center;
143
+ background-color: rgba(29, 161, 241, 0.1);
144
+ color: #5865F2;
145
+ }
146
+ </style>
147
+ <style lang="scss">
148
+
149
+ .app-header {
150
+ width: 100%;
151
+ padding-top: 1.25rem;
152
+ box-shadow: 0 0 2rem 0 rgba(136, 152, 170, 0.15);
153
+ }
154
+
155
+ .back__button {
156
+ cursor: pointer;
157
+ width: 42px;
158
+ height: 42px;
159
+ display: flex;
160
+ align-items: center;
161
+ justify-content: center;
162
+ margin-right: 10px;
163
+ border-radius: 100px;
164
+ transition: background 0.5s;
165
+ margin-left: -15px;
166
+ border: 0;
167
+ background: transparent;
168
+ color: #32325d;
169
+ &:focus {
170
+ outline: none;
171
+ }
172
+ &:not(:disabled):hover, &:focus:not(:disabled):hover {
173
+ background: rgba(0, 0, 0, 0.08);
174
+ }
175
+ }
176
+
177
+ .header__container {
178
+ display: flex;
179
+ flex-direction: column;
180
+ justify-content: center;
181
+ align-items: flex-start;
182
+ }
183
+
184
+ .images__container {
185
+ display: flex;
186
+ align-items: flex-start;
187
+ justify-content: center;
188
+ .header__content {
189
+ display: flex;
190
+ align-items: center;
191
+ flex-direction: row;
192
+ padding: 10px 0;
193
+ h2 {
194
+ margin-bottom: 0;
195
+ }
196
+ .images {
197
+ margin-left: 10px;
198
+ display: flex;
199
+ align-items: center;
200
+ user-select: none;
201
+ .user__avatar {
202
+ cursor: pointer;
203
+ border: 2px solid transparent;
204
+ transition: border-color 0.5s;
205
+ border: 2px solid #fff;
206
+ background: #fff;
207
+ &--active {
208
+ border-color: #5865F2;
209
+ z-index: 10;
210
+ }
211
+ }
212
+ img {
213
+ $size: 42px;
214
+ display: block;
215
+ width: $size;
216
+ height: $size;
217
+ object-fit: cover;
218
+ border-radius: 100px;
219
+ &:not(:first-child) {
220
+ margin-left: -10px;
221
+ }
222
+ }
223
+ }
224
+ }
225
+ }
226
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.414",
3
+ "version": "1.0.415",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {