@bildvitta/quasar-ui-asteroid 3.5.0-beta.6 → 3.5.0-beta.8

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.5.0-beta.6",
4
+ "version": "3.5.0-beta.8",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-if="model" class="q-pa-lg qas-alert relative-position rounded-borders" :class="classes">
2
+ <div v-if="model" class="bg-white q-pa-lg qas-alert relative-position rounded-borders" :class="classes">
3
3
  <qas-btn class="absolute-top-right q-mr-md q-mt-sm" :color="color" dense flat icon="o_close" rounded @click="close" />
4
4
 
5
5
  <div class="q-gutter-md q-mr-lg">
@@ -58,10 +58,7 @@ export default {
58
58
 
59
59
  computed: {
60
60
  classes () {
61
- return {
62
- [`text-${this.color}`]: true,
63
- [`bg-${this.color}-contrast`]: ['primary', 'secondary'].includes(this.color)
64
- }
61
+ return `text-${this.color}`
65
62
  }
66
63
  },
67
64
 
@@ -7,13 +7,13 @@
7
7
  <router-link class="block q-toolbar__title relative-position text-no-decoration" :to="rootRoute">
8
8
  <img v-if="brand" :alt="title" class="full-width" :src="brand">
9
9
  <span v-else class="ellipsis text-bold text-primary">{{ title }}</span>
10
- <q-badge color="red" floating :label="developmentBadgeLabel" />
10
+ <q-badge v-if="hasDevelopmentBadge" color="red" floating :label="developmentBadgeLabel" />
11
11
  </router-link>
12
12
  </div>
13
13
 
14
14
  <!-- Module -->
15
15
  <div v-if="displayModuleSection" class="q-mt-xl q-px-lg qas-app-menu__module">
16
- <qas-select v-model="module" borderless class="q-py-xs rounded-borders shadow-2" dense input-class="q-px-md" :options="defaultModules" :outlined="false" :use-search="false" @update:model-value="redirectHandler(currentModelOption)" />
16
+ <qas-select v-model="module" borderless class="q-py-xs qas-app-menu__select shadow-2" dense input-class="q-px-md" :options="defaultModules" :outlined="false" :use-search="false" @update:model-value="redirectHandler(currentModelOption)" />
17
17
  </div>
18
18
 
19
19
  <!-- Menu -->
@@ -259,6 +259,10 @@ export default {
259
259
  padding-left: var(--qas-spacing-lg);
260
260
  }
261
261
 
262
+ &__select {
263
+ border-radius: 4px;
264
+ }
265
+
262
266
  // User
263
267
  .qas-app-user__data {
264
268
  line-height: 1.25;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="cursor-pointer items-center no-wrap q-gutter-sm qas-app-user row">
3
3
  <div class="relative-position">
4
- <qas-avatar color="white" dark :image="user.photo" rounded :size="avatarSize" text-color="primary" :title="userName" />
4
+ <qas-avatar :image="user.photo" :size="avatarSize" :title="userName" />
5
5
  <q-badge v-if="hasNotifications" color="red" floating>{{ notifications.count }}</q-badge>
6
6
  </div>
7
7
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <q-avatar class="text-bold" :class="avatarClass" v-bind="attributes">
2
+ <q-avatar class="text-bold" v-bind="attributes">
3
3
  <q-img v-if="hasImage" :alt="title" :ratio="1" spinner-color="primary" spinner-size="16px" :src="image" @error="onImageLoadedError" />
4
4
  <template v-else-if="hasTitle">{{ firstLetter }}</template>
5
5
  <q-icon v-else :name="icon" />
@@ -14,12 +14,14 @@ export default {
14
14
 
15
15
  props: {
16
16
  color: {
17
- default: '',
18
- type: String
17
+ type: String,
18
+ default: 'primary',
19
+ validator: value => ['primary', 'secondary-contrast'].includes(value)
19
20
  },
20
21
 
21
- dark: {
22
- type: Boolean
22
+ size: {
23
+ type: String,
24
+ default: ''
23
25
  },
24
26
 
25
27
  icon: {
@@ -32,11 +34,6 @@ export default {
32
34
  type: String
33
35
  },
34
36
 
35
- textColor: {
36
- default: 'primary',
37
- type: String
38
- },
39
-
40
37
  title: {
41
38
  default: '',
42
39
  type: String
@@ -50,24 +47,6 @@ export default {
50
47
  },
51
48
 
52
49
  computed: {
53
- avatarClass () {
54
- if (this.hasImage) {
55
- return null
56
- }
57
-
58
- const contrastColor = this.color ? this.color : this.contrastColor
59
-
60
- return [
61
- this.dark
62
- ? `bg-${this.textColor} text-${contrastColor}`
63
- : `bg-${contrastColor} text-${this.textColor}`
64
- ]
65
- },
66
-
67
- contrastColor () {
68
- return `${this.textColor}-contrast`
69
- },
70
-
71
50
  firstLetter () {
72
51
  return this.title[0].toUpperCase()
73
52
  },
@@ -81,9 +60,16 @@ export default {
81
60
  },
82
61
 
83
62
  attributes () {
84
- const { square, rounded, ...attributes } = this.$attrs
63
+ const colors = {
64
+ primary: 'white',
65
+ 'secondary-contrast': 'primary'
66
+ }
85
67
 
86
- return attributes
68
+ return {
69
+ size: this.size,
70
+ color: this.color,
71
+ textColor: colors[this.color]
72
+ }
87
73
  }
88
74
  },
89
75
 
@@ -10,11 +10,11 @@ props:
10
10
  color:
11
11
  desc: Cor de fundo (background-color).
12
12
  type: String
13
- examples: ['primary', 'positive']
13
+ examples: ['primary', 'secondary-contrast']
14
14
 
15
- dark:
16
- desc: Habilita o modo escuro.
17
- type: Boolean
15
+ size:
16
+ desc: Tamanho do avatar.
17
+ type: String
18
18
 
19
19
  icon:
20
20
  desc: Ícone de fundo do avatar que vai aparecer caso não tenha imagem nem título.
@@ -21,7 +21,7 @@ export default {
21
21
  computed: {
22
22
  boxClass () {
23
23
  return {
24
- 'border-primary-contrast': this.outlined,
24
+ 'border-grey': this.outlined,
25
25
  'shadow-2': !this.unelevated
26
26
  }
27
27
  }
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
  </q-card-section>
25
25
 
26
- <div v-if="hasActionsSlot" class="border-primary-contrast border-top overflow-hidden row">
26
+ <div v-if="hasActionsSlot" class="border-grey border-top overflow-hidden row">
27
27
  <slot name="actions" />
28
28
  </div>
29
29
  </q-card>
@@ -177,7 +177,7 @@ export default {
177
177
  return this[isFirst
178
178
  ? 'firstQueue'
179
179
  : 'secondQueue'
180
- ].some(item => item[this.valueKey] === object[this.valueKey]) && 'bg-secondary'
180
+ ].some(item => item[this.valueKey] === object[this.valueKey]) && 'bg-grey-4'
181
181
  },
182
182
 
183
183
  getItemLabel (item) {
@@ -17,6 +17,7 @@
17
17
  @include set-border-color(primary-contrast, $primary-contrast);
18
18
  @include set-border-color(secondary, $secondary);
19
19
  @include set-border-color(secondary-contrast, $secondary-contrast);
20
+ @include set-border-color('grey', $border-grey);
20
21
 
21
22
  // Direction
22
23
  .border-top {
package/src/index.scss CHANGED
@@ -10,12 +10,14 @@ $accent: var(--q-accent);
10
10
  // Asteroid variables
11
11
  :root {
12
12
  --qas-background-color: #fbfbfb;
13
+ --qas-border-grey: #{$grey-4};
13
14
  --qas-generic-border-radius: 8px;
14
15
  --qas-generic-transition: 300ms;
15
16
  }
16
17
 
17
18
  $background-color: var(--qas-background-color);
18
19
  $generic-border-radius: var(--qas-generic-border-radius);
20
+ $border-grey: var(--qas-border-grey);
19
21
 
20
22
  // variables
21
23
  @import './css/variables/index';