@bildvitta/quasar-ui-asteroid 3.18.0-beta.0 → 3.18.0-beta.1
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 +1 -1
- package/src/components/actions-menu/QasActionsMenu.vue +3 -3
- package/src/components/alert/QasAlert.vue +187 -60
- package/src/components/alert/QasAlert.yml +27 -5
- package/src/components/app-bar/QasAppBar.vue +2 -0
- package/src/components/app-menu/QasAppMenu.vue +127 -68
- package/src/components/app-menu/QasAppMenu.yml +10 -0
- package/src/components/app-user/QasAppUser.vue +12 -8
- package/src/components/app-user/QasAppUser.yml +5 -0
- package/src/components/checkbox/QasCheckbox.vue +96 -14
- package/src/components/date-time-input/QasDateTimeInput.vue +2 -2
- package/src/components/filters/QasFilters.vue +51 -30
- package/src/components/filters/QasFilters.yml +9 -0
- package/src/components/gallery/QasGallery.vue +2 -3
- package/src/components/gallery-card/QasGalleryCard.vue +43 -12
- package/src/components/gallery-card/QasGalleryCard.yml +22 -6
- package/src/components/list-view/QasListView.vue +6 -1
- package/src/components/list-view/QasListView.yml +5 -0
- package/src/components/nested-fields/QasNestedFields.vue +10 -2
- package/src/components/nested-fields/QasNestedFields.yml +18 -3
- package/src/components/password-input/QasPasswordInput.vue +6 -2
- package/src/components/radio/QasRadio.vue +43 -10
- package/src/components/select/QasSelect.vue +23 -1
- package/src/components/select-filter/QasSelectFilter.vue +33 -6
- package/src/components/select-filter/QasSelectFilter.yml +5 -0
- package/src/components/select-list/QasSelectList.vue +6 -6
- package/src/components/select-list/private/PvSelectListCheckbox.vue +1 -1
- package/src/components/toggle/QasToggle.vue +26 -1
- package/src/components/toggle-visibility/QasToggleVisibility.vue +15 -6
- package/src/components/tree-generator/QasTreeGenerator.vue +10 -2
- package/src/components/uploader/private/PvUploaderGalleryCard.vue +2 -2
- package/src/composables/private/use-error-message.js +4 -1
- package/src/composables/use-default-filters.js +47 -15
- package/src/css/components/field.scss +6 -6
- package/src/css/components/index.scss +1 -3
- package/src/css/components/item.scss +3 -2
- package/src/css/components/menu.scss +21 -0
- package/src/css/plugins/notify.scss +37 -37
- package/src/css/variables/scrollbar.scss +1 -1
- package/src/enums/Status.js +3 -3
- package/src/helpers/colors.js +137 -0
- package/src/helpers/index.js +1 -0
- package/src/helpers/set-scroll-gradient.js +261 -0
- package/src/plugins/notify-error/NotifyError.js +2 -1
- package/src/plugins/notify-success/NotifySuccess.js +2 -1
- package/src/vue-plugin.js +0 -3
- package/src/components/info/QasInfo.vue +0 -155
- package/src/components/info/QasInfo.yml +0 -34
- package/src/css/components/checkbox.scss +0 -14
- package/src/css/components/radio.scss +0 -18
- package/src/css/components/toggle.scss +0 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="hasList" class="qas-actions-menu" data-cy="actions-menu">
|
|
3
3
|
<qas-btn-dropdown v-bind="btnDropdownProps">
|
|
4
|
-
<q-list data-cy="actions-menu-list">
|
|
4
|
+
<q-list data-cy="actions-menu-list" separator>
|
|
5
5
|
<slot v-for="(item, key) in formattedList.dropdownList" :item="item" :name="key">
|
|
6
6
|
<q-item v-bind="getItemProps(item)" :key="key" active-class="primary" clickable data-cy="actions-menu-list-item" @click="setClickHandler(item)">
|
|
7
7
|
<q-item-section avatar>
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
</q-item-section>
|
|
10
10
|
|
|
11
11
|
<q-item-section>
|
|
12
|
-
<
|
|
12
|
+
<q-item-label>
|
|
13
13
|
{{ item.label }}
|
|
14
|
-
</
|
|
14
|
+
</q-item-label>
|
|
15
15
|
</q-item-section>
|
|
16
16
|
</q-item>
|
|
17
17
|
</slot>
|
|
@@ -1,110 +1,237 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
<div class="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
<div class="inline-block qas-alert">
|
|
3
|
+
<qas-box v-if="displayAlert" v-bind="defaultBoxProps">
|
|
4
|
+
<div class="flex items-center no-wrap">
|
|
5
|
+
<div class="flex items-center no-wrap text-body1 text-grey-8">
|
|
6
|
+
<q-icon v-bind="iconProps" />
|
|
7
|
+
|
|
8
|
+
<component
|
|
9
|
+
:is="textComponent"
|
|
10
|
+
v-if="useRegex"
|
|
11
|
+
class="q-ml-sm"
|
|
12
|
+
/>
|
|
13
|
+
|
|
14
|
+
<span
|
|
15
|
+
v-else
|
|
16
|
+
class="q-ml-sm"
|
|
17
|
+
>
|
|
18
|
+
<slot>
|
|
19
|
+
{{ props.text }}
|
|
20
|
+
</slot>
|
|
21
|
+
</span>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<qas-btn v-if="useCloseButton" class="q-ml-sm" color="grey-10" icon="sym_r_close" variant="tertiary" @click="close" />
|
|
10
25
|
</div>
|
|
11
|
-
|
|
12
|
-
<qas-btn
|
|
13
|
-
class="q-ml-xs qas-alert__close"
|
|
14
|
-
color="white"
|
|
15
|
-
icon="sym_r_close"
|
|
16
|
-
:use-hover-on-white-color="false"
|
|
17
|
-
@click="close"
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
26
|
+
</qas-box>
|
|
20
27
|
</div>
|
|
21
28
|
</template>
|
|
22
29
|
|
|
23
30
|
<script setup>
|
|
24
|
-
import { LocalStorage } from 'quasar'
|
|
25
31
|
import { Status, StatusColor } from '../../enums/Status'
|
|
26
|
-
|
|
32
|
+
|
|
33
|
+
import { LocalStorage } from 'quasar'
|
|
34
|
+
import { QasBtn } from 'asteroid'
|
|
35
|
+
import { RouterLink } from 'vue-router'
|
|
36
|
+
import { h, computed, inject } from 'vue'
|
|
27
37
|
|
|
28
38
|
defineOptions({ name: 'QasAlert' })
|
|
29
39
|
|
|
30
40
|
const props = defineProps({
|
|
31
|
-
|
|
32
|
-
type:
|
|
33
|
-
default:
|
|
41
|
+
buttonProps: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: () => ({})
|
|
34
44
|
},
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
routerLinkProps: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => ({})
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
status: {
|
|
37
52
|
type: String,
|
|
38
|
-
default:
|
|
53
|
+
default: Status.Info,
|
|
54
|
+
validator: value => Object.values(Status).includes(value)
|
|
39
55
|
},
|
|
40
56
|
|
|
41
57
|
storageKey: {
|
|
42
58
|
type: String,
|
|
43
|
-
default: ''
|
|
59
|
+
default: 'default'
|
|
44
60
|
},
|
|
45
61
|
|
|
46
|
-
|
|
62
|
+
text: {
|
|
47
63
|
type: String,
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
useBox: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: undefined
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
useCloseButton: {
|
|
73
|
+
type: Boolean
|
|
50
74
|
},
|
|
51
75
|
|
|
52
76
|
usePersistentModelOnClose: {
|
|
53
77
|
type: Boolean
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
useRegex: {
|
|
81
|
+
type: Boolean
|
|
54
82
|
}
|
|
55
83
|
})
|
|
56
84
|
|
|
57
|
-
|
|
85
|
+
// models
|
|
86
|
+
const model = defineModel({ type: Boolean, default: true })
|
|
58
87
|
|
|
59
|
-
|
|
88
|
+
// globals
|
|
89
|
+
const isBox = inject('isBox', false)
|
|
60
90
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
91
|
+
// composables
|
|
92
|
+
const { displayAlert, close } = useStorageClosed()
|
|
64
93
|
|
|
65
|
-
|
|
94
|
+
// computeds
|
|
95
|
+
const iconProps = computed(() => {
|
|
66
96
|
const status = Object.keys(Status).find(key => Status[key] === props.status)
|
|
67
|
-
|
|
97
|
+
const isErrorStatus = props.status === Status.Error
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
color: StatusColor[status],
|
|
101
|
+
name: isErrorStatus ? 'sym_r_error' : 'sym_r_info',
|
|
102
|
+
size: 'sm'
|
|
103
|
+
}
|
|
68
104
|
})
|
|
69
105
|
|
|
70
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Por padrão, quando este componente estiver dentro de um QasBox, ele não terá
|
|
108
|
+
* shadow, terá padding e não terá margin.
|
|
109
|
+
*/
|
|
110
|
+
const defaultBoxProps = computed(() => {
|
|
111
|
+
const hasBoxProps = props.useBox !== undefined
|
|
71
112
|
|
|
72
|
-
const
|
|
113
|
+
const useBox = hasBoxProps ? props.useBox : !isBox
|
|
73
114
|
|
|
74
|
-
|
|
75
|
-
|
|
115
|
+
return {
|
|
116
|
+
unelevated: !useBox,
|
|
117
|
+
useSpacing: useBox
|
|
118
|
+
}
|
|
76
119
|
})
|
|
77
120
|
|
|
78
|
-
const
|
|
121
|
+
const textComponent = computed(() => {
|
|
122
|
+
/**
|
|
123
|
+
* regex para encontrar caracteres que estiverem dentro de [].
|
|
124
|
+
*/
|
|
125
|
+
const regex = /\[.*?\]/g
|
|
126
|
+
|
|
127
|
+
const [content] = props.text.match(regex)
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* dado o texto: Para saber mais, [Clique aqui].
|
|
131
|
+
*
|
|
132
|
+
* retorna: 'Clique aqui'
|
|
133
|
+
*/
|
|
134
|
+
const routerLabel = content.replaceAll(/[[\]]/g, '')
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* dado o texto: Para saber mais, [Clique aqui].
|
|
138
|
+
*
|
|
139
|
+
* retorna: 'Para saber mais, $.'
|
|
140
|
+
*/
|
|
141
|
+
const replacedText = props.text.replaceAll(regex, '$')
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* É necessário usar o regex ao invés de '$' para ele não remover o carácter
|
|
145
|
+
* ao fazer o split
|
|
146
|
+
*
|
|
147
|
+
* dado o texto: 'Para saber mais, [Clique aqui].'
|
|
148
|
+
*
|
|
149
|
+
* retorna: ['Para saber mais,', '$', '.']
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
const splitted = replacedText.split(/(\$)/)
|
|
153
|
+
|
|
154
|
+
const index = splitted.findIndex(item => item === '$')
|
|
155
|
+
|
|
156
|
+
const hasButtonProps = !!Object.keys(props.buttonProps).length
|
|
157
|
+
|
|
158
|
+
const getRouterLinkRender = () => {
|
|
159
|
+
return h(
|
|
160
|
+
RouterLink,
|
|
161
|
+
{
|
|
162
|
+
...props.routerLinkProps,
|
|
163
|
+
class: 'text-primary text-subtitle1 qas-alert__link'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
default: () => routerLabel
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
79
170
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
171
|
+
const getQasBtnRender = () => {
|
|
172
|
+
return h(
|
|
173
|
+
QasBtn,
|
|
174
|
+
{
|
|
175
|
+
variant: 'tertiary',
|
|
176
|
+
label: routerLabel,
|
|
177
|
+
...props.buttonProps
|
|
178
|
+
}
|
|
179
|
+
)
|
|
83
180
|
}
|
|
84
181
|
|
|
85
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Cria um render do router link ou QasBtn
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
*
|
|
187
|
+
* ```html
|
|
188
|
+
* <router-link
|
|
189
|
+
* class="text-primary text-subtitle1 qas-alert__link"
|
|
190
|
+
* :to="props.route"
|
|
191
|
+
* >
|
|
192
|
+
* Clique aqui
|
|
193
|
+
* </router-link>
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
const renderComponent = hasButtonProps ? getQasBtnRender() : getRouterLinkRender()
|
|
197
|
+
|
|
198
|
+
splitted.splice(index, 1, renderComponent)
|
|
199
|
+
|
|
200
|
+
return h(
|
|
201
|
+
'span',
|
|
202
|
+
splitted
|
|
203
|
+
)
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
// composable definitions
|
|
207
|
+
function useStorageClosed () {
|
|
208
|
+
// computeds
|
|
209
|
+
const storageClosedKey = computed(() => `alert-${props.storageKey}-closed`)
|
|
86
210
|
|
|
87
|
-
|
|
88
|
-
|
|
211
|
+
const displayAlert = computed(() => {
|
|
212
|
+
const isClosed = props.usePersistentModelOnClose && LocalStorage.getItem(storageClosedKey.value)
|
|
213
|
+
|
|
214
|
+
return !isClosed && model.value
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
// functions
|
|
218
|
+
function close () {
|
|
219
|
+
if (props.usePersistentModelOnClose) LocalStorage.set(storageClosedKey.value, true)
|
|
220
|
+
|
|
221
|
+
model.value = false
|
|
222
|
+
}
|
|
89
223
|
|
|
224
|
+
return {
|
|
225
|
+
displayAlert,
|
|
226
|
+
close
|
|
227
|
+
}
|
|
228
|
+
}
|
|
90
229
|
</script>
|
|
91
230
|
|
|
92
231
|
<style lang="scss">
|
|
93
232
|
.qas-alert {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
&__border-left {
|
|
97
|
-
border-radius: var(--qas-generic-border-radius) 0 0 var(--qas-generic-border-radius);
|
|
98
|
-
bottom: 0;
|
|
99
|
-
content: '';
|
|
100
|
-
left: 0;
|
|
101
|
-
position: absolute;
|
|
102
|
-
top: 0;
|
|
103
|
-
width: 4px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&__close {
|
|
107
|
-
top: calc(var(--qas-spacing-sm) * -1);
|
|
233
|
+
&__link {
|
|
234
|
+
text-decoration: none;
|
|
108
235
|
}
|
|
109
236
|
}
|
|
110
237
|
</style>
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
type: component
|
|
2
2
|
|
|
3
3
|
meta:
|
|
4
|
-
desc:
|
|
4
|
+
desc: Componente para alerta de informações.
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
+
buttonProps:
|
|
8
|
+
desc: Props do componente QasBtn.
|
|
9
|
+
default:
|
|
10
|
+
variant: primary
|
|
11
|
+
type: Object
|
|
12
|
+
|
|
7
13
|
model-value:
|
|
8
14
|
desc: Model do componente, controla se o componente aparece ou não.
|
|
9
15
|
default: true
|
|
10
16
|
type: Boolean
|
|
11
17
|
|
|
12
|
-
text:
|
|
13
|
-
desc: Texto do componente.
|
|
14
|
-
type: String
|
|
15
|
-
|
|
16
18
|
status:
|
|
17
19
|
desc: Status do alerta.
|
|
18
20
|
type: String
|
|
@@ -22,10 +24,30 @@ props:
|
|
|
22
24
|
desc: Chave a ser salva no localStorage, necessário caso esteja usando mais de um QasAlert na aplicação e ambos estejam com a prop "use-persist-model-on-close" ativada.
|
|
23
25
|
type: String
|
|
24
26
|
|
|
27
|
+
router-link-props:
|
|
28
|
+
desc: Propriedades do componente RouterLink.
|
|
29
|
+
default: {}
|
|
30
|
+
type: Object
|
|
31
|
+
|
|
32
|
+
text:
|
|
33
|
+
desc: Texto a ser exibido.
|
|
34
|
+
type: String
|
|
35
|
+
default: ''
|
|
36
|
+
|
|
37
|
+
use-box:
|
|
38
|
+
desc: Controla se vai ter ou não box (componente tem um controle interno que lida automaticamente, serve para a maioria dos casos).
|
|
39
|
+
type: Boolean
|
|
40
|
+
default: undefined
|
|
41
|
+
|
|
25
42
|
use-persistent-model-on-close:
|
|
26
43
|
desc: Habilita salvar o model em localStorage ao fechar o alerta para não aparecer novamente.
|
|
27
44
|
type: Boolean
|
|
28
45
|
|
|
46
|
+
use-regex:
|
|
47
|
+
desc: Faz a busca pelos "[]" dentro da propriedade "text" para substituir pelo QasBtn ou RouterLink.
|
|
48
|
+
default: true
|
|
49
|
+
type: Boolean
|
|
50
|
+
|
|
29
51
|
slots:
|
|
30
52
|
default:
|
|
31
53
|
desc: 'Slot para acessar o conteúdo gerado pela prop "text"'
|