@bildvitta/quasar-ui-asteroid 3.14.0-beta.0 → 3.14.0-beta.10

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.
Files changed (69) hide show
  1. package/package.json +1 -1
  2. package/src/components/actions-menu/QasActionsMenu.vue +16 -14
  3. package/src/components/alert/QasAlert.vue +1 -1
  4. package/src/components/app-bar/QasAppBar.vue +10 -5
  5. package/src/components/app-bar/QasAppBar.yml +3 -0
  6. package/src/components/app-menu/QasAppMenu.vue +9 -8
  7. package/src/components/app-menu/QasAppMenu.yml +3 -0
  8. package/src/components/app-menu/composables/use-app-user.js +3 -0
  9. package/src/components/app-menu/private/PvAppMenuDropdown.vue +1 -1
  10. package/src/components/app-user/QasAppUser.vue +75 -20
  11. package/src/components/app-user/QasAppUser.yml +3 -0
  12. package/src/components/avatar/QasAvatar.vue +11 -5
  13. package/src/components/avatar/QasAvatar.yml +1 -1
  14. package/src/components/avatar/enums/AvatarColors.js +2 -1
  15. package/src/components/breakline/QasBreakline.vue +5 -6
  16. package/src/components/btn-dropdown/QasBtnDropdown.vue +74 -95
  17. package/src/components/card/QasCard.vue +57 -75
  18. package/src/components/chart-view/QasChartView.vue +37 -9
  19. package/src/components/chart-view/QasChartView.yml +6 -0
  20. package/src/components/checkbox-group/QasCheckboxGroup.vue +81 -92
  21. package/src/components/copy/QasCopy.vue +20 -27
  22. package/src/components/date/QasDate.vue +349 -392
  23. package/src/components/date/QasDate.yml +0 -5
  24. package/src/components/date/enums/DateMaskOptions.js +6 -0
  25. package/src/components/date-time-input/QasDateTimeInput.vue +198 -209
  26. package/src/components/debugger/QasDebugger.vue +20 -12
  27. package/src/components/delete/QasDelete.vue +70 -80
  28. package/src/components/dialog/QasDialog.vue +35 -7
  29. package/src/components/dialog/composables/use-cancel.js +3 -3
  30. package/src/components/dialog/composables/use-dynamic-components.js +4 -4
  31. package/src/components/dialog/composables/use-ok.js +3 -3
  32. package/src/components/dialog-router/QasDialogRouter.vue +68 -67
  33. package/src/components/drawer/QasDrawer.vue +118 -0
  34. package/src/components/drawer/QasDrawer.yml +58 -0
  35. package/src/components/empty-result-text/QasEmptyResultText.vue +8 -10
  36. package/src/components/form-generator/QasFormGenerator.vue +2 -2
  37. package/src/components/gallery/QasGallery.vue +175 -196
  38. package/src/components/gallery/composables/use-delete.js +54 -0
  39. package/src/components/gallery/private/PvGalleryCarouselDialog.vue +48 -55
  40. package/src/components/gallery/private/PvGalleryDeleteDialog.vue +41 -50
  41. package/src/components/gallery-card/QasGalleryCard.vue +90 -103
  42. package/src/components/grid-generator/QasGridGenerator.vue +2 -2
  43. package/src/components/header-actions/QasHeaderActions.vue +35 -50
  44. package/src/components/header-actions/QasHeaderActions.yml +1 -1
  45. package/src/components/infinite-scroll/QasInfiniteScroll.vue +7 -3
  46. package/src/components/infinite-scroll/QasInfiniteScroll.yml +22 -0
  47. package/src/components/label/QasLabel.vue +42 -54
  48. package/src/components/layout/QasLayout.vue +65 -52
  49. package/src/components/layout/QasLayout.yml +5 -0
  50. package/src/components/layout/private/PvLayoutNotificationCard.vue +86 -0
  51. package/src/components/layout/private/PvLayoutNotificationsDrawer.vue +140 -0
  52. package/src/components/list-items/QasListItems.vue +67 -44
  53. package/src/components/list-items/QasListItems.yml +5 -0
  54. package/src/components/map/QasMap.vue +44 -46
  55. package/src/components/numeric-input/QasNumericInput.vue +2 -2
  56. package/src/components/page-header/QasPageHeader.vue +74 -87
  57. package/src/components/pagination/QasPagination.vue +21 -21
  58. package/src/components/select-list-dialog/QasSelectListDialog.vue +4 -2
  59. package/src/components/tabs-generator/QasTabsGenerator.vue +55 -63
  60. package/src/components/timeline/QasTimeline.vue +1 -1
  61. package/src/components/uploader/private/PvUploaderGalleryCard.vue +1 -1
  62. package/src/components/whatsapp-link/QasWhatsappLink.vue +34 -0
  63. package/src/components/whatsapp-link/QasWhatsappLink.yml +18 -0
  64. package/src/composables/index.js +3 -0
  65. package/src/composables/private/use-generator.js +0 -8
  66. package/src/composables/use-notifications.js +114 -0
  67. package/src/css/plugins/notify.scss +40 -2
  68. package/src/helpers/private/has-parent-by-class-name.js +15 -0
  69. package/src/vue-plugin.js +10 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.14.0-beta.0",
4
+ "version": "3.14.0-beta.10",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -9,7 +9,9 @@
9
9
  </q-item-section>
10
10
 
11
11
  <q-item-section>
12
- <div>{{ item.label }}</div>
12
+ <div>
13
+ {{ item.label }}
14
+ </div>
13
15
  </q-item-section>
14
16
  </q-item>
15
17
  </slot>
@@ -86,7 +88,7 @@ const { deleteBtnProps, hasDelete } = useDelete()
86
88
  const fullList = computed(() => {
87
89
  return {
88
90
  ...props.list,
89
- ...deleteBtnProps
91
+ ...deleteBtnProps.value
90
92
  }
91
93
  })
92
94
 
@@ -189,20 +191,20 @@ function onClick (item = {}) {
189
191
 
190
192
  // ------------------------------- composables ---------------------------------
191
193
  function useDelete () {
192
- const deleteBtnProps = {}
193
-
194
194
  const hasDelete = computed(() => !!Object.keys(props.deleteProps).length)
195
195
 
196
- if (hasDelete.value) {
197
- Object.assign(deleteBtnProps, {
198
- delete: {
199
- color: 'grey-10',
200
- icon: props.deleteIcon,
201
- label: props.deleteLabel,
202
- handler: () => qas.delete(props.deleteProps)
203
- }
204
- })
205
- }
196
+ const deleteBtnProps = computed(() => {
197
+ return {
198
+ ...(hasDelete.value && {
199
+ delete: {
200
+ color: 'grey-10',
201
+ icon: props.deleteIcon,
202
+ label: props.deleteLabel,
203
+ handler: () => qas.delete(props.deleteProps)
204
+ }
205
+ })
206
+ }
207
+ })
206
208
 
207
209
  return {
208
210
  deleteBtnProps,
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div class="text-body1 text-white">
7
7
  <slot>
8
- {{ text }}
8
+ {{ props.text }}
9
9
  </slot>
10
10
  </div>
11
11
 
@@ -5,9 +5,9 @@
5
5
 
6
6
  <q-toolbar-title>
7
7
  <router-link class="flex items-center no-wrap text-no-decoration" :class="routerLinkClass" :to="rootRoute">
8
- <img v-if="brand" :alt="title" class="qas-app-bar__brand" :src="brand">
8
+ <img v-if="props.brand" :alt="props.title" class="qas-app-bar__brand" :src="props.brand">
9
9
 
10
- <span v-else class="ellipsis text-bold text-primary">{{ title }}</span>
10
+ <span v-else class="ellipsis text-bold text-primary">{{ props.title }}</span>
11
11
 
12
12
  <q-badge v-if="hasDevelopmentBadge" class="q-ml-sm" color="red" :label="developmentBadgeLabel" />
13
13
  </router-link>
@@ -54,7 +54,7 @@ const props = defineProps({
54
54
  }
55
55
  })
56
56
 
57
- const emits = defineEmits(['sign-out', 'toggle-menu'])
57
+ const emit = defineEmits(['sign-out', 'toggle-menu', 'toggle-notifications'])
58
58
 
59
59
  const router = useRouter()
60
60
  const screen = useScreen()
@@ -68,6 +68,7 @@ const defaultAppUserProps = computed(() => {
68
68
  },
69
69
 
70
70
  onSignOut: signOut,
71
+ onToggleNotifications: toggleNotifications,
71
72
  ...props.appUserProps
72
73
  }
73
74
  })
@@ -93,11 +94,15 @@ const hasUser = computed(() => !!Object.keys(defaultAppUserProps.value.user || {
93
94
  const routerLinkClass = computed(() => screen.isSmall && 'justify-center')
94
95
 
95
96
  function signOut () {
96
- emits('sign-out')
97
+ emit('sign-out')
98
+ }
99
+
100
+ function toggleNotifications () {
101
+ emit('toggle-notifications')
97
102
  }
98
103
 
99
104
  function toggleMenuDrawer () {
100
- emits('toggle-menu')
105
+ emit('toggle-menu')
101
106
  }
102
107
  </script>
103
108
 
@@ -39,3 +39,6 @@ events:
39
39
 
40
40
  '@toggle-menu -> function()':
41
41
  desc: Dispara quando o botão de "hambúrguer" é clicado para abrir o menu lateral.
42
+
43
+ '@toggle-notifications -> function()':
44
+ desc: Dispara quando o botão de "Notificações" é clicado.
@@ -6,9 +6,9 @@
6
6
  <!-- Brand -->
7
7
  <div v-if="!screen.untilLarge" class="q-mb-xl q-pt-xl qas-app-menu__label" :class="classes.spacedItem">
8
8
  <router-link class="column flex items-center justify-center relative-position text-no-decoration" :to="rootRoute">
9
- <q-img v-if="normalizedBrand" :alt="title" class="qas-app-menu__brand qas-app-menu__label" fit="contain" height="27px" img-class="qas-app-menu__brand-img" no-spinner :src="normalizedBrand" />
9
+ <q-img v-if="normalizedBrand" :alt="props.title" class="qas-app-menu__brand qas-app-menu__label" fit="contain" height="27px" img-class="qas-app-menu__brand-img" no-spinner :src="normalizedBrand" />
10
10
 
11
- <span v-else-if="!isMiniMode" class="ellipsis text-bold text-primary text-subtitle2">{{ title }}</span>
11
+ <span v-else-if="!isMiniMode" class="ellipsis text-bold text-primary text-subtitle2">{{ props.title }}</span>
12
12
 
13
13
  <q-badge v-if="hasDevelopmentBadge" class="q-mt-sm" color="red" :label="developmentBadgeLabel" />
14
14
  </router-link>
@@ -30,8 +30,8 @@
30
30
  </div>
31
31
 
32
32
  <!-- List -->
33
- <q-list v-if="items.length" class="q-mt-xl qas-app-menu__menu text-grey-10">
34
- <template v-for="(menuItem, index) in items">
33
+ <q-list v-if="props.items.length" class="q-mt-xl qas-app-menu__menu text-grey-10">
34
+ <template v-for="(menuItem, index) in props.items">
35
35
  <div v-if="hasChildren(menuItem)" :key="`children-${index}`" class="qas-app-menu__content" :class="classes.content">
36
36
  <q-item class="ellipsis items-center q-py-none qas-app-menu__item qas-app-menu__item--label-mini text-weight-bold">
37
37
  <div class="ellipsis qas-app-menu__label text-grey-10 text-subtitle2" :class="classes.spacedItem">
@@ -146,7 +146,7 @@ const props = defineProps({
146
146
  }
147
147
  })
148
148
 
149
- const emits = defineEmits(['sign-out', 'update:modelValue'])
149
+ const emit = defineEmits(['sign-out', 'update:modelValue', 'toggle-notifications'])
150
150
 
151
151
  const screen = useScreen()
152
152
  const router = useRouter()
@@ -159,7 +159,8 @@ const isMini = ref(screen.isLarge)
159
159
  const composableParams = {
160
160
  props,
161
161
  onMenuUpdate: setHasOpenedMenu,
162
- onSignOut: () => emits('sign-out')
162
+ onSignOut: () => emit('sign-out'),
163
+ onToggleNotifications: () => emit('toggle-notifications')
163
164
  }
164
165
 
165
166
  const { defaultAppUserProps, showAppUser } = useAppUser(composableParams)
@@ -172,7 +173,7 @@ const model = computed({
172
173
  },
173
174
 
174
175
  set (value) {
175
- emits('update:modelValue', value)
176
+ emit('update:modelValue', value)
176
177
  }
177
178
  })
178
179
 
@@ -195,7 +196,7 @@ const classes = computed(() => {
195
196
 
196
197
  // métodos
197
198
  function closeDrawer () {
198
- emits('update:modelValue', false)
199
+ emit('update:modelValue', false)
199
200
  }
200
201
 
201
202
  function getNormalizedPath (path) {
@@ -57,6 +57,9 @@ events:
57
57
  '@sign-out -> function()':
58
58
  desc: Dispara quando o botão de "sair" é clicado.
59
59
 
60
+ '@toggle-notifications -> function()':
61
+ desc: Dispara quando o botão de "Notificações" é clicado.
62
+
60
63
  '@update:model-value -> function(value)':
61
64
  desc: Dispara quando o model-value altera, também usado para v-model.
62
65
  params:
@@ -6,6 +6,7 @@ import { computed } from 'vue'
6
6
  * @param {{
7
7
  * props: { appUserProps: {} }
8
8
  * onSignOut: () => void
9
+ * onToggleNotifications: () => void
9
10
  * onMenuUpdate: () => void
10
11
  * }} config
11
12
  */
@@ -14,6 +15,7 @@ export default function useAppUser (config = {}) {
14
15
  props,
15
16
 
16
17
  onSignOut,
18
+ onToggleNotifications,
17
19
  onMenuUpdate
18
20
  } = config
19
21
 
@@ -29,6 +31,7 @@ export default function useAppUser (config = {}) {
29
31
 
30
32
  // eventos
31
33
  onSignOut,
34
+ onToggleNotifications,
32
35
  ...props.appUserProps
33
36
  }
34
37
  })
@@ -2,7 +2,7 @@
2
2
  <div class="pv-app-menu-dropdown">
3
3
  <qas-btn-dropdown v-bind="defaultButtonDropdownProps">
4
4
  <q-list>
5
- <q-item v-for="item in modules" :key="item" :active="isActive(item)" active-class="text-primary" :href="item.value">
5
+ <q-item v-for="item in props.modules" :key="item" :active="isActive(item)" active-class="text-primary" :href="item.value">
6
6
  <q-item-section v-if="item.icon" avatar>
7
7
  <q-icon :name="item.icon" />
8
8
  </q-item-section>
@@ -1,11 +1,9 @@
1
1
  <template>
2
2
  <div class="cursor-pointer items-center no-wrap q-gutter-sm qas-app-user row" data-cy="app-user">
3
3
  <div class="relative-position">
4
- <qas-avatar :image="user.photo" :size="avatarSize" :title="userName" />
4
+ <qas-avatar :image="props.user.photo" :size="props.avatarSize" :title="userName" />
5
5
 
6
- <q-badge v-if="hasNotifications" color="red" floating>
7
- {{ notifications.count }}
8
- </q-badge>
6
+ <qas-avatar v-if="hasNotificationInUserAvatar" v-bind="avatarNotificationCountProps" />
9
7
  </div>
10
8
 
11
9
  <div class="ellipsis qas-app-user__data">
@@ -14,26 +12,26 @@
14
12
  </div>
15
13
 
16
14
  <div class="ellipsis qas-app-user__email text-grey-8">
17
- {{ user.email }}
15
+ {{ props.user.email }}
18
16
  </div>
19
17
  </div>
20
18
 
21
- <q-menu class="shadow-2 text-grey-10" max-height="400px" v-bind="menuProps" @hide="onMenuHide">
19
+ <q-menu class="shadow-2 text-grey-10" max-height="400px" v-bind="props.menuProps" @hide="onMenuHide">
22
20
  <div class="q-pb-sm q-pt-md q-px-md qas-app-user__menu">
23
- <qas-avatar class="q-mb-md" :image="user.photo" size="64px" :title="userName" />
21
+ <qas-avatar class="q-mb-md" :image="props.user.photo" size="64px" :title="userName" />
24
22
 
25
23
  <div class="ellipsis qas-app-user__menu-name">
26
24
  {{ userName }}
27
25
  </div>
28
26
 
29
27
  <div class="ellipsis">
30
- {{ user.email }}
28
+ {{ props.user.email }}
31
29
  </div>
32
30
 
33
31
  <qas-select v-if="hasCompaniesSelect" v-bind="defaultCompanyProps" v-model="companiesModel" class="q-my-md" data-cy="app-user-companies-select" @update:model-value="setCompanies" />
34
32
 
35
33
  <q-list class="q-mt-md">
36
- <q-item v-close-popup :active="false" class="qas-app-user__menu-item" clickable :to="user.to">
34
+ <q-item v-close-popup :active="false" class="qas-app-user__menu-item" clickable :to="props.user.to">
37
35
  <q-item-section avatar>
38
36
  <q-icon name="sym_r_person" />
39
37
  </q-item-section>
@@ -43,20 +41,16 @@
43
41
  </q-item-section>
44
42
  </q-item>
45
43
 
46
- <q-item v-if="hasNotifications" v-close-popup class="qas-app-user__menu-item" clickable>
47
- <q-item-section avatar>
44
+ <q-item v-if="isNotificationsEnabled" v-close-popup class="qas-app-user__menu-item" clickable @click="toggleNotificationsDrawer">
45
+ <q-item-section avatar class="relative-position">
48
46
  <q-icon name="sym_r_notifications" />
47
+
48
+ <qas-avatar v-if="hasUnreadNotifications" class="qas-app-user__notification-avatar--icon" v-bind="avatarNotificationCountProps" />
49
49
  </q-item-section>
50
50
 
51
51
  <q-item-section>
52
52
  Notificações
53
53
  </q-item-section>
54
-
55
- <q-item-section side>
56
- <q-badge color="red">
57
- {{ notifications.count }}
58
- </q-badge>
59
- </q-item-section>
60
54
  </q-item>
61
55
 
62
56
  <q-item v-close-popup class="qas-app-user__menu-item" clickable @click="signOut">
@@ -77,6 +71,7 @@
77
71
  <script setup>
78
72
  import QasAvatar from '../avatar/QasAvatar.vue'
79
73
 
74
+ import useNotifications from '../../composables/use-notifications'
80
75
  import { NotifySuccess, NotifyError } from '../../plugins'
81
76
 
82
77
  import { ref, computed, watch, inject } from 'vue'
@@ -111,14 +106,19 @@ const props = defineProps({
111
106
  }
112
107
  })
113
108
 
114
- const emits = defineEmits(['sign-out'])
109
+ const emit = defineEmits(['sign-out', 'toggle-notifications'])
115
110
 
116
111
  // vindo direto do boot api.js
117
112
  const axios = inject('axios')
118
113
 
114
+ const { isNotificationsEnabled, unreadNotificationsCount } = useNotifications()
115
+
119
116
  const companiesModel = ref('')
120
117
  const loading = ref(false)
121
118
 
119
+ const { avatarNotificationCountProps } = useAvatarNotifications()
120
+
121
+ // computed
122
122
  const defaultCompanyProps = computed(() => {
123
123
  return {
124
124
  loading: loading.value,
@@ -131,8 +131,10 @@ const defaultCompanyProps = computed(() => {
131
131
  })
132
132
 
133
133
  const hasCompaniesSelect = computed(() => !!props.companyProps.options?.length)
134
- const hasNotifications = computed(() => !!Object.keys(props.notifications).length)
134
+ const hasUnreadNotifications = computed(() => unreadNotificationsCount.value > 0)
135
+ const hasNotificationInUserAvatar = computed(() => isNotificationsEnabled && hasUnreadNotifications.value)
135
136
 
137
+ const unreadNotificationsToString = computed(() => String(unreadNotificationsCount.value))
136
138
  const userName = computed(() => props.user.name || props.user.givenName)
137
139
 
138
140
  // watch
@@ -140,9 +142,44 @@ watch(() => props.companyProps.modelValue, value => {
140
142
  companiesModel.value = value
141
143
  }, { immediate: true })
142
144
 
145
+ // composable
146
+ function useAvatarNotifications () {
147
+ const hasAnimated = ref(false)
148
+
149
+ watch(() => unreadNotificationsCount.value, () => {
150
+ hasAnimated.value = true
151
+
152
+ setTimeout(() => {
153
+ hasAnimated.value = false
154
+ }, 1000)
155
+ })
156
+
157
+ const avatarNotificationCountProps = computed(() => {
158
+ const classes = [
159
+ 'qas-app-user__notification-avatar',
160
+ 'animated',
161
+ {
162
+ rubberBand: hasAnimated.value
163
+ }
164
+ ]
165
+
166
+ return {
167
+ class: classes,
168
+ color: 'red-14',
169
+ size: 'xs',
170
+ title: unreadNotificationsToString.value,
171
+ useCropTitle: false
172
+ }
173
+ })
174
+
175
+ return {
176
+ avatarNotificationCountProps
177
+ }
178
+ }
179
+
143
180
  // métodos
144
181
  function signOut () {
145
- emits('sign-out')
182
+ emit('sign-out')
146
183
  }
147
184
 
148
185
  async function setCompanies (value) {
@@ -169,10 +206,28 @@ function onMenuHide () {
169
206
  companiesModel.value = props.companyProps.modelValue
170
207
  }
171
208
  }
209
+
210
+ function toggleNotificationsDrawer () {
211
+ emit('toggle-notifications')
212
+ }
172
213
  </script>
173
214
 
174
215
  <style lang="scss">
175
216
  .qas-app-user {
217
+ &__notification-avatar {
218
+ animation-duration: 1s;
219
+ position: absolute;
220
+ top: 0;
221
+
222
+ &:not(&--icon) {
223
+ right: -4px;
224
+ }
225
+
226
+ &--icon {
227
+ right: 4px;
228
+ }
229
+ }
230
+
176
231
  &__data {
177
232
  line-height: 1.1;
178
233
  }
@@ -43,6 +43,9 @@ events:
43
43
  '@sign-out -> function()':
44
44
  desc: Dispara quando o botão de "sair" é clicado.
45
45
 
46
+ '@toggle-notifications -> function()':
47
+ desc: Dispara quando o botão de "Notificações" é clicado.
48
+
46
49
  selectors:
47
50
  app-user:
48
51
  desc: Seletor do componente.
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <q-avatar class="text-bold" v-bind="attributes">
3
- <q-img v-if="hasImage" :alt="title" :ratio="1" spinner-color="primary" spinner-size="16px" :src="image" @error="onImageLoadedError" />
4
- <template v-else-if="hasTitle">{{ firstLetter }}</template>
5
- <q-icon v-else :name="icon" />
3
+ <q-img v-if="hasImage" :alt="props.title" :ratio="1" spinner-color="primary" spinner-size="16px" :src="props.image" @error="onImageLoadedError" />
4
+ <template v-else-if="hasTitle">{{ label }}</template>
5
+ <q-icon v-else :name="props.icon" />
6
6
  </q-avatar>
7
7
  </template>
8
8
 
@@ -45,6 +45,11 @@ const props = defineProps({
45
45
  title: {
46
46
  default: '',
47
47
  type: String
48
+ },
49
+
50
+ useCropTitle: {
51
+ type: Boolean,
52
+ default: true
48
53
  }
49
54
  })
50
55
 
@@ -64,7 +69,8 @@ const attributes = computed(() => {
64
69
  const colors = {
65
70
  [AvatarColors.Primary]: 'white',
66
71
  [AvatarColors.SecondaryContrast]: 'primary',
67
- [AvatarColors.Grey4]: 'grey-8'
72
+ [AvatarColors.Grey4]: 'grey-8',
73
+ [AvatarColors.Red14]: 'white'
68
74
  }
69
75
 
70
76
  return {
@@ -75,7 +81,7 @@ const attributes = computed(() => {
75
81
  }
76
82
  })
77
83
 
78
- const firstLetter = computed(() => props.title[0].toUpperCase())
84
+ const label = computed(() => props.useCropTitle ? props.title[0]?.toUpperCase?.() : props.title)
79
85
 
80
86
  const hasImage = computed(() => !hasImageError.value && !!props.image)
81
87
  const hasTitle = computed(() => !!props.title)
@@ -10,7 +10,7 @@ props:
10
10
  color:
11
11
  desc: Cor de fundo (background-color).
12
12
  type: String
13
- examples: ['primary', 'secondary-contrast', 'grey-4']
13
+ examples: ['primary', 'secondary-contrast', 'grey-4', 'red-14']
14
14
 
15
15
  size:
16
16
  desc: Tamanho do avatar.
@@ -5,5 +5,6 @@
5
5
  export const AvatarColors = {
6
6
  Primary: 'primary',
7
7
  SecondaryContrast: 'secondary-contrast',
8
- Grey4: 'grey-4'
8
+ Grey4: 'grey-4',
9
+ Red14: 'red-14'
9
10
  }
@@ -1,16 +1,14 @@
1
1
  <template>
2
- <component :is="tag" v-for="(line, index) in lines" :key="index" v-bind="$attrs">
2
+ <component :is="props.tag" v-for="(line, index) in lines" :key="index" v-bind="attrs">
3
3
  {{ line }}
4
4
  </component>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
- import { computed } from 'vue'
8
+ import { computed, useAttrs, useSlots } from 'vue'
9
9
  import { getSlotChildrenText } from '../../helpers'
10
10
 
11
- defineOptions({
12
- name: 'QasBreakline'
13
- })
11
+ defineOptions({ name: 'QasBreakline' })
14
12
 
15
13
  const props = defineProps({
16
14
  split: {
@@ -29,7 +27,8 @@ const props = defineProps({
29
27
  }
30
28
  })
31
29
 
32
- const slots = defineSlots()
30
+ const attrs = useAttrs()
31
+ const slots = useSlots()
33
32
 
34
33
  const lines = computed(() => {
35
34
  const text = props.text || getSlotChildrenText(slots.default())