@bildvitta/quasar-ui-asteroid 3.17.0-beta.20 → 3.17.0-beta.22
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/assets/sounds/nave-notification.mp3 +0 -0
- package/src/components/stepper/QasStepper.vue +50 -3
- package/src/components/stepper-form-view/QasStepperFormView.vue +6 -4
- package/src/components/uploader/QasUploader.vue +70 -24
- package/src/components/uploader/QasUploader.yml +15 -1
- package/src/composables/use-notifications.js +14 -0
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="qas-stepper" :class="classes">
|
|
3
|
-
<q-stepper ref="stepper" v-model="model"
|
|
3
|
+
<q-stepper ref="stepper" v-model="model" v-bind="stepperProps">
|
|
4
4
|
<template v-for="(_, name) in $slots" #[name]="context">
|
|
5
5
|
<slot :name="name" v-bind="getContext(context)" />
|
|
6
6
|
</template>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup>
|
|
12
|
-
import { computed, ref } from 'vue'
|
|
12
|
+
import { computed, ref, useAttrs } from 'vue'
|
|
13
13
|
import { Spacing } from '../../enums/Spacing'
|
|
14
14
|
import { gutterValidator } from '../../helpers/private/gutter-validator'
|
|
15
15
|
import useScreen from '../../composables/use-screen'
|
|
@@ -35,6 +35,8 @@ const props = defineProps({
|
|
|
35
35
|
|
|
36
36
|
const stepper = ref(null)
|
|
37
37
|
|
|
38
|
+
const attrs = useAttrs()
|
|
39
|
+
|
|
38
40
|
const screen = useScreen()
|
|
39
41
|
|
|
40
42
|
const emit = defineEmits(['update:modelValue'])
|
|
@@ -53,7 +55,27 @@ const model = computed({
|
|
|
53
55
|
|
|
54
56
|
const classes = computed(() => ({ 'qas-stepper--disable': props.disable }))
|
|
55
57
|
|
|
56
|
-
const
|
|
58
|
+
const stepperProps = computed(() => {
|
|
59
|
+
const defaultProps = {
|
|
60
|
+
contracted: screen.untilLarge,
|
|
61
|
+
doneColor: 'primary',
|
|
62
|
+
flat: true,
|
|
63
|
+
animated: true,
|
|
64
|
+
activeColor: 'primary',
|
|
65
|
+
errorIcon: 'sym_r_close',
|
|
66
|
+
errorColor: 'white',
|
|
67
|
+
headerClass: `text-subtitle1 q-pb-${props.spacing}`,
|
|
68
|
+
inactiveColor: attrs['header-nav'] || attrs.headerNav ? 'grey-10' : 'grey-6'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
activeIcon: 'none',
|
|
73
|
+
doneIcon: 'none',
|
|
74
|
+
keepAlive: true,
|
|
75
|
+
...attrs,
|
|
76
|
+
...defaultProps
|
|
77
|
+
}
|
|
78
|
+
})
|
|
57
79
|
|
|
58
80
|
function getContext (context) {
|
|
59
81
|
return {
|
|
@@ -87,6 +109,31 @@ function previous () {
|
|
|
87
109
|
|
|
88
110
|
&__tab {
|
|
89
111
|
padding: 0;
|
|
112
|
+
|
|
113
|
+
&--active {
|
|
114
|
+
.q-icon {
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
color: white;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.q-stepper__dot {
|
|
120
|
+
background-color: var(--q-primary) !important;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:not(.q-stepper__tab--active).q-stepper__tab--error-with-icon {
|
|
125
|
+
.q-stepper__title {
|
|
126
|
+
color: $grey-10;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.q-stepper__dot {
|
|
130
|
+
background-color: $negative !important;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.q-icon {
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
90
137
|
}
|
|
91
138
|
|
|
92
139
|
&__caption {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<qas-stepper ref="stepper" v-model="model" v-bind="stepperProps">
|
|
3
3
|
<template #default>
|
|
4
|
-
<q-step v-for="(step, stepIndex) in props.steps" :key="stepIndex" :done="isDone(stepIndex)" :name="getStepName(stepIndex)" v-bind="stepPropsList[stepIndex]">
|
|
4
|
+
<q-step v-for="(step, stepIndex) in props.steps" :key="stepIndex" :done="isDone(stepIndex)" :name="getStepName({ step, stepIndex })" v-bind="stepPropsList[stepIndex]">
|
|
5
5
|
<component :is="step.component" />
|
|
6
6
|
</q-step>
|
|
7
7
|
</template>
|
|
@@ -30,7 +30,9 @@ const props = defineProps({
|
|
|
30
30
|
}
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
defineExpose({ setStepProps })
|
|
34
|
+
|
|
35
|
+
const model = defineModel({ type: [Number, String], default: 1 })
|
|
34
36
|
|
|
35
37
|
const values = ref({})
|
|
36
38
|
const stepPropsList = ref([])
|
|
@@ -68,8 +70,8 @@ function isDone (stepIndex) {
|
|
|
68
70
|
return model.value > stepIndex + 1
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
function getStepName (stepIndex) {
|
|
72
|
-
return stepIndex + 1
|
|
73
|
+
function getStepName ({ step, stepIndex }) {
|
|
74
|
+
return step.name || stepIndex + 1
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
provide('stepper', {
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
<q-uploader ref="uploader" auto-upload class="bg-transparent" :class="uploaderClasses" v-bind="attributes" :factory="factory" flat :max-files="maxFiles" method="PUT" @factory-failed="factoryFailed" @uploaded="uploaded" @uploading="updateUploading(true)">
|
|
4
4
|
<template #header="scope">
|
|
5
5
|
<slot name="header" :scope="scope">
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
<div v-if="errorMessage" class="q-mt-xs text-caption text-negative">
|
|
11
|
-
{{ errorMessage }}
|
|
6
|
+
<qas-header class="q-mb-none" v-bind="getHeaderProps(scope)">
|
|
7
|
+
<template #description>
|
|
8
|
+
<div :class="headerDescriptionClasses">
|
|
9
|
+
{{ headerProps.description }}
|
|
12
10
|
</div>
|
|
13
|
-
</
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<template v-for="(_, name) in $slots" #[getHeaderSlotName(name)]="context">
|
|
14
|
+
<slot :name v-bind="context" />
|
|
15
|
+
</template>
|
|
16
|
+
</qas-header>
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</div>
|
|
18
|
+
<div v-if="errorMessage" class="q-mt-xs text-caption text-negative">
|
|
19
|
+
{{ errorMessage }}
|
|
18
20
|
</div>
|
|
19
21
|
|
|
20
22
|
<!-- ------------------------------------ tags hidden -------------------------------------- -->
|
|
@@ -24,15 +26,13 @@
|
|
|
24
26
|
</template>
|
|
25
27
|
|
|
26
28
|
<template #list="scope">
|
|
27
|
-
<div v-if="hasGalleryCardSection(getFilesList(scope.files, scope))" class="q-col-gutter-lg
|
|
29
|
+
<div v-if="hasGalleryCardSection(getFilesList(scope.files, scope))" class="q-col-gutter-lg row">
|
|
28
30
|
<div v-for="(file, key, index) in getFilesList(scope.files, scope)" :key="index" :class="columnClasses">
|
|
29
31
|
<pv-uploader-gallery-card v-bind="getUploaderGalleryCardProps({ key, scope, file, index })" />
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
34
|
|
|
33
|
-
<
|
|
34
|
-
<qas-empty-result-text />
|
|
35
|
-
</div>
|
|
35
|
+
<qas-empty-result-text v-else />
|
|
36
36
|
</template>
|
|
37
37
|
</q-uploader>
|
|
38
38
|
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
<script>
|
|
44
44
|
import PvUploaderGalleryCard from './private/PvUploaderGalleryCard.vue'
|
|
45
|
+
import QasHeader from '../header/QasHeader.vue'
|
|
45
46
|
|
|
46
47
|
import { uid, extend } from 'quasar'
|
|
47
48
|
import { NotifyError } from '../../plugins'
|
|
@@ -53,7 +54,8 @@ export default {
|
|
|
53
54
|
name: 'QasUploader',
|
|
54
55
|
|
|
55
56
|
components: {
|
|
56
|
-
PvUploaderGalleryCard
|
|
57
|
+
PvUploaderGalleryCard,
|
|
58
|
+
QasHeader
|
|
57
59
|
},
|
|
58
60
|
|
|
59
61
|
inheritAttrs: false,
|
|
@@ -125,6 +127,11 @@ export default {
|
|
|
125
127
|
type: Object
|
|
126
128
|
},
|
|
127
129
|
|
|
130
|
+
headerProps: {
|
|
131
|
+
type: Object,
|
|
132
|
+
default: () => ({})
|
|
133
|
+
},
|
|
134
|
+
|
|
128
135
|
label: {
|
|
129
136
|
type: String,
|
|
130
137
|
default: ''
|
|
@@ -199,6 +206,12 @@ export default {
|
|
|
199
206
|
return this.$attrs
|
|
200
207
|
},
|
|
201
208
|
|
|
209
|
+
headerDescriptionClasses () {
|
|
210
|
+
return {
|
|
211
|
+
'text-negative': this.error
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
|
|
202
215
|
columnClasses () {
|
|
203
216
|
const irregularClasses = ['col']
|
|
204
217
|
const columns = this.defaultColumns
|
|
@@ -290,15 +303,6 @@ export default {
|
|
|
290
303
|
return this.$attrs.multiple || this.$attrs.multiple === ''
|
|
291
304
|
},
|
|
292
305
|
|
|
293
|
-
labelProps () {
|
|
294
|
-
return {
|
|
295
|
-
label: this.label,
|
|
296
|
-
margin: 'none',
|
|
297
|
-
|
|
298
|
-
...(this.error && { color: 'negative' })
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
|
|
302
306
|
self () {
|
|
303
307
|
return this
|
|
304
308
|
},
|
|
@@ -613,6 +617,48 @@ export default {
|
|
|
613
617
|
const emptyModel = this.isMultiple ? [] : this.useObjectModel ? {} : ''
|
|
614
618
|
|
|
615
619
|
this.$emit('update:modelValue', emptyModel)
|
|
620
|
+
},
|
|
621
|
+
|
|
622
|
+
getHeaderSlotName (name) {
|
|
623
|
+
return name.replace('header-', '')
|
|
624
|
+
},
|
|
625
|
+
|
|
626
|
+
getHeaderProps (scope) {
|
|
627
|
+
const { labelProps, actionsMenuProps, ...othersHeaderProps } = this.headerProps
|
|
628
|
+
|
|
629
|
+
const { list, ...othersActionsMenuProps } = actionsMenuProps || {}
|
|
630
|
+
|
|
631
|
+
return {
|
|
632
|
+
spacing: 'lg',
|
|
633
|
+
|
|
634
|
+
labelProps: {
|
|
635
|
+
label: this.label,
|
|
636
|
+
|
|
637
|
+
margin: 'none',
|
|
638
|
+
|
|
639
|
+
...labelProps,
|
|
640
|
+
|
|
641
|
+
...(this.error && { color: 'negative' })
|
|
642
|
+
},
|
|
643
|
+
|
|
644
|
+
...(this.hasAddFile && {
|
|
645
|
+
actionsMenuProps: {
|
|
646
|
+
list: {
|
|
647
|
+
add: {
|
|
648
|
+
icon: 'sym_r_add',
|
|
649
|
+
label: this.addButtonLabel,
|
|
650
|
+
handler: () => this.onAddButtonClick(scope)
|
|
651
|
+
},
|
|
652
|
+
|
|
653
|
+
...list
|
|
654
|
+
},
|
|
655
|
+
|
|
656
|
+
...othersActionsMenuProps
|
|
657
|
+
}
|
|
658
|
+
}),
|
|
659
|
+
|
|
660
|
+
...othersHeaderProps
|
|
661
|
+
}
|
|
616
662
|
}
|
|
617
663
|
}
|
|
618
664
|
}
|
|
@@ -83,8 +83,13 @@ props:
|
|
|
83
83
|
default: {}
|
|
84
84
|
type: Object
|
|
85
85
|
|
|
86
|
+
header-props:
|
|
87
|
+
desc: Propriedades repassadas para o componente "QasHeader".
|
|
88
|
+
default: {}
|
|
89
|
+
type: Object
|
|
90
|
+
|
|
86
91
|
label:
|
|
87
|
-
desc: Label do componente
|
|
92
|
+
desc: Label do componente.
|
|
88
93
|
type: String
|
|
89
94
|
|
|
90
95
|
max-files:
|
|
@@ -158,6 +163,15 @@ slots:
|
|
|
158
163
|
default: {}
|
|
159
164
|
type: Object
|
|
160
165
|
|
|
166
|
+
header-actions:
|
|
167
|
+
desc: Acessa o slot actions do "QasHeader".
|
|
168
|
+
|
|
169
|
+
header-description:
|
|
170
|
+
desc: Acessa o slot description do "QasHeader".
|
|
171
|
+
|
|
172
|
+
header-label:
|
|
173
|
+
desc: Acessa o slot label do "QasHeader".
|
|
174
|
+
|
|
161
175
|
list:
|
|
162
176
|
desc: Acesso ao conteúdo onde fica a listagem de arquivos.
|
|
163
177
|
scope:
|
|
@@ -4,6 +4,8 @@ import hasParentByClassName from '../helpers/private/has-parent-by-class-name'
|
|
|
4
4
|
import { Notify } from 'quasar'
|
|
5
5
|
import { ref } from 'vue'
|
|
6
6
|
|
|
7
|
+
import naveNotificationSound from '../assets/sounds/nave-notification.mp3'
|
|
8
|
+
|
|
7
9
|
const callbackFunctions = {
|
|
8
10
|
onNotificationReceived: []
|
|
9
11
|
}
|
|
@@ -63,6 +65,8 @@ export default function () {
|
|
|
63
65
|
timeout: 30000
|
|
64
66
|
})
|
|
65
67
|
|
|
68
|
+
sendNotificationSound()
|
|
69
|
+
|
|
66
70
|
/**
|
|
67
71
|
* Função que é chamada quando o usuário clica na notificação, se a notificação
|
|
68
72
|
* tem link, então ele vai ser redirecionado para o link em uma nova aba, caso
|
|
@@ -96,6 +100,16 @@ export default function () {
|
|
|
96
100
|
</div>
|
|
97
101
|
`)
|
|
98
102
|
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Função que toca o som de notificação.
|
|
106
|
+
*/
|
|
107
|
+
function sendNotificationSound () {
|
|
108
|
+
const audio = new Audio(naveNotificationSound)
|
|
109
|
+
|
|
110
|
+
// o áudio agora é reproduzível; reproduza-o se as permissões permitirem
|
|
111
|
+
audio.addEventListener('canplaythrough', audio.play)
|
|
112
|
+
}
|
|
99
113
|
}
|
|
100
114
|
|
|
101
115
|
return {
|