@bildvitta/quasar-ui-asteroid 3.14.0-beta.4 → 3.14.0-beta.6

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.14.0-beta.4",
4
+ "version": "3.14.0-beta.6",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -50,7 +50,7 @@ const props = defineProps({
50
50
 
51
51
  maxWidth: {
52
52
  type: String,
53
- default: ''
53
+ default: '60%'
54
54
  },
55
55
 
56
56
  position: {
@@ -74,15 +74,16 @@ const emit = defineEmits(['update:modelValue'])
74
74
  const attrs = useAttrs()
75
75
  const screen = useScreen()
76
76
 
77
+ // computed
78
+ const normalizedMaxWidth = computed(() => screen.isSmall ? '100%' : props.maxWidth)
79
+
77
80
  const loadingStyle = computed(() => {
78
81
  return {
79
- right: `calc(100% - ${props.maxWidth})`
82
+ right: `calc(100% - ${normalizedMaxWidth.value})`
80
83
  }
81
84
  })
82
85
 
83
86
  const attributes = computed(() => {
84
- const maxWidth = screen.isSmall ? '100%' : props.maxWidth
85
-
86
87
  const { modelValue } = attrs
87
88
 
88
89
  return {
@@ -92,7 +93,7 @@ const attributes = computed(() => {
92
93
  ...props.dialogProps,
93
94
 
94
95
  cancel: false,
95
- maxWidth,
96
+ maxWidth: normalizedMaxWidth.value,
96
97
  maximized: true,
97
98
  ok: false,
98
99
  position: props.position,
@@ -11,6 +11,7 @@ props:
11
11
 
12
12
  max-width:
13
13
  desc: Tamanho máximo do dialog.
14
+ default: 60%
14
15
  type: String
15
16
 
16
17
  model-value:
@@ -68,12 +68,6 @@ const { isNotificationsEnabled, setUnreadNotificationsCount } = useNotifications
68
68
  const menuDrawer = ref(false)
69
69
  const notificationsDrawer = ref(false)
70
70
 
71
- /**
72
- * Como está sendo utilizado em um watcher com a propriedade 'immediate: true',
73
- * é necessário criar a variável antes de atribuí-la ao watcher, para assim conseguir pará-lo.
74
- */
75
- let unreadNotificationsCountWatcher = () => {}
76
-
77
71
  // computed
78
72
  const defaultAppMenuProps = computed(() => {
79
73
  return {
@@ -84,19 +78,7 @@ const defaultAppMenuProps = computed(() => {
84
78
 
85
79
  const showMenuDrawer = computed(() => !screen.untilLarge || menuDrawer.value)
86
80
 
87
- /**
88
- * A propriedade "initialUnreadNotificationsCount" é escutada apenas uma vez,
89
- * quando ela é iniciada, seta o "unreadNotificationsCount" do composable,
90
- * após isto quem controla é o QasLayout.
91
- */
92
- unreadNotificationsCountWatcher = watch(() => props.initialUnreadNotificationsCount, value => {
93
- if (value) {
94
- setUnreadNotificationsCount(value)
95
-
96
- // finaliza o watcher
97
- unreadNotificationsCountWatcher()
98
- }
99
- }, { immediate: true })
81
+ watch(() => props.initialUnreadNotificationsCount, setUnreadNotificationsCount, { immediate: true })
100
82
 
101
83
  // functions
102
84
  function signOut () {
@@ -89,7 +89,6 @@ const model = computed({
89
89
  const drawerProps = computed(() => {
90
90
  return {
91
91
  loading: isMarkingNotificationsAsRead.value,
92
- maxWidth: '60%',
93
92
  title: 'Notificações'
94
93
  }
95
94
  })