@bildvitta/quasar-ui-asteroid 3.17.0-beta.21 → 3.17.0-beta.23
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/board-generator/QasBoardGenerator.vue +41 -6
- package/src/components/board-generator/QasBoardGenerator.yml +54 -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/package.json
CHANGED
|
@@ -37,6 +37,11 @@ import Sortable from 'sortablejs'
|
|
|
37
37
|
defineOptions({ name: 'QasBoardGenerator' })
|
|
38
38
|
|
|
39
39
|
const props = defineProps({
|
|
40
|
+
beforeUpdatePosition: {
|
|
41
|
+
type: Function,
|
|
42
|
+
default: undefined
|
|
43
|
+
},
|
|
44
|
+
|
|
40
45
|
headers: {
|
|
41
46
|
type: Array,
|
|
42
47
|
default: () => []
|
|
@@ -132,10 +137,11 @@ const emit = defineEmits([
|
|
|
132
137
|
'fetch-column-error',
|
|
133
138
|
'fetch-columns-success',
|
|
134
139
|
'fetch-columns-error',
|
|
135
|
-
'update-success'
|
|
140
|
+
'update-success',
|
|
141
|
+
'update-error'
|
|
136
142
|
])
|
|
137
143
|
|
|
138
|
-
defineExpose({ fetchColumns, fetchColumn, reset })
|
|
144
|
+
defineExpose({ fetchColumns, fetchColumn, reset, cancelDrop })
|
|
139
145
|
|
|
140
146
|
// Inject
|
|
141
147
|
const axios = inject('axios')
|
|
@@ -392,6 +398,20 @@ function getItemsByHeader (header) {
|
|
|
392
398
|
return hasColumnsLength.value ? columnsResultsModel.value[getKeyByHeader(header)] : []
|
|
393
399
|
}
|
|
394
400
|
|
|
401
|
+
function getColumnItemById (id) {
|
|
402
|
+
return Object.values(columnsResultsModel.value).flat().find(item => item[props.itemIdKey] === id)
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Recupera o payload do header por id:
|
|
407
|
+
*
|
|
408
|
+
* @example getHeaderById('2024-02-15')
|
|
409
|
+
* @returns {Object} // { date: '2024-02-15'... }
|
|
410
|
+
*/
|
|
411
|
+
function getHeaderById (id) {
|
|
412
|
+
return props.headers.find(header => String(getKeyByHeader(header)) === String(id))
|
|
413
|
+
}
|
|
414
|
+
|
|
395
415
|
/**
|
|
396
416
|
* Pegar key com base na chave identificador, exemplo:
|
|
397
417
|
* header -> { date: '2024-02-12', ... }
|
|
@@ -479,7 +499,7 @@ function handleElementsList () {
|
|
|
479
499
|
}
|
|
480
500
|
|
|
481
501
|
/**
|
|
482
|
-
*
|
|
502
|
+
* Descrição:
|
|
483
503
|
* Seta a instancia do sortable, no qual varia de acordo com as props passadas.
|
|
484
504
|
*
|
|
485
505
|
* @param {HTMLElement} element
|
|
@@ -531,6 +551,20 @@ function onDropCard (event) {
|
|
|
531
551
|
|
|
532
552
|
onConfirmDrop.value = () => confirmDrop(event)
|
|
533
553
|
|
|
554
|
+
if (typeof props.beforeUpdatePosition === 'function') {
|
|
555
|
+
props.beforeUpdatePosition({
|
|
556
|
+
event,
|
|
557
|
+
cancel: onCancelDrop.value,
|
|
558
|
+
getItem: () => getColumnItemById(event.item.id),
|
|
559
|
+
getColumnTo: () => getHeaderById(event.to.dataset.headerKey),
|
|
560
|
+
getColumnFrom: () => getHeaderById(event.from.dataset.headerKey),
|
|
561
|
+
openConfirmDialog,
|
|
562
|
+
update: () => confirmDrop(event)
|
|
563
|
+
})
|
|
564
|
+
|
|
565
|
+
return
|
|
566
|
+
}
|
|
567
|
+
|
|
534
568
|
hasConfirmDialogProps.value
|
|
535
569
|
? openConfirmDialog()
|
|
536
570
|
: confirmDrop(event)
|
|
@@ -617,8 +651,7 @@ function removeItemFromList ({ headerKey, itemId }) {
|
|
|
617
651
|
}
|
|
618
652
|
|
|
619
653
|
/**
|
|
620
|
-
*
|
|
621
|
-
* Metodo que realiza a request de update
|
|
654
|
+
* Método que realiza a request de update
|
|
622
655
|
*
|
|
623
656
|
* @param {{
|
|
624
657
|
* newHeaderKey: string - ID da coluna de destino,
|
|
@@ -650,6 +683,8 @@ async function updatePosition ({ newHeaderKey, oldHeaderKey, itemId, event }) {
|
|
|
650
683
|
if (error) {
|
|
651
684
|
onCancelDrop.value()
|
|
652
685
|
|
|
686
|
+
emit('update-error', error)
|
|
687
|
+
|
|
653
688
|
return
|
|
654
689
|
}
|
|
655
690
|
|
|
@@ -663,7 +698,7 @@ async function updatePosition ({ newHeaderKey, oldHeaderKey, itemId, event }) {
|
|
|
663
698
|
|
|
664
699
|
closeConfirmDialog()
|
|
665
700
|
|
|
666
|
-
emit('update-success')
|
|
701
|
+
emit('update-success', data.data)
|
|
667
702
|
}
|
|
668
703
|
|
|
669
704
|
function setItemList ({ headerKey, data, index }) {
|
|
@@ -4,6 +4,46 @@ meta:
|
|
|
4
4
|
desc: Componente usado para board de colunas.
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
+
before-update-position:
|
|
8
|
+
desc: função onde será executada antes do dialog de confirmação ou atualização da posição.
|
|
9
|
+
type: function
|
|
10
|
+
default: undefined
|
|
11
|
+
params:
|
|
12
|
+
event:
|
|
13
|
+
desc: Evento do "onAdd" do sortablejs.
|
|
14
|
+
type: Object
|
|
15
|
+
default: {}
|
|
16
|
+
|
|
17
|
+
cancel:
|
|
18
|
+
desc: Cancela o drag and drop.
|
|
19
|
+
type: Function
|
|
20
|
+
default: undefined
|
|
21
|
+
|
|
22
|
+
getItem:
|
|
23
|
+
desc: Recupera o item atual a ser dropado.
|
|
24
|
+
type: Function
|
|
25
|
+
default: {}
|
|
26
|
+
|
|
27
|
+
openConfirmDialog:
|
|
28
|
+
desc: Chama o dialog de confirmação para salvar nova posição.
|
|
29
|
+
type: Function
|
|
30
|
+
default: undefined
|
|
31
|
+
|
|
32
|
+
update:
|
|
33
|
+
desc: Salva nova posição.
|
|
34
|
+
type: Function
|
|
35
|
+
default: undefined
|
|
36
|
+
|
|
37
|
+
getColumnTo:
|
|
38
|
+
desc: Recupera o payload da coluna que o item será adicionado.
|
|
39
|
+
type: Function
|
|
40
|
+
default: {}
|
|
41
|
+
|
|
42
|
+
getColumnFrom:
|
|
43
|
+
desc: Recupera o payload da coluna que o item saiu.
|
|
44
|
+
type: Function
|
|
45
|
+
default: {}
|
|
46
|
+
|
|
7
47
|
column-id-key:
|
|
8
48
|
desc: chave que será o id usado para ser o identificador da coluna.
|
|
9
49
|
type: String
|
|
@@ -158,8 +198,22 @@ events:
|
|
|
158
198
|
|
|
159
199
|
'@update-success -> function()':
|
|
160
200
|
desc: Dispara quando o PATCH do drag and drop é com sucesso.
|
|
201
|
+
params:
|
|
202
|
+
data:
|
|
203
|
+
desc: Retorno da API.
|
|
204
|
+
type: Object
|
|
205
|
+
|
|
206
|
+
'@update-error -> function()':
|
|
207
|
+
desc: Dispara quando o PATCH do drag and drop cai em uma exceção.
|
|
208
|
+
params:
|
|
209
|
+
error:
|
|
210
|
+
desc: Retorno da API.
|
|
211
|
+
type: Object
|
|
161
212
|
|
|
162
213
|
methods:
|
|
214
|
+
'cancelDrop: () => void':
|
|
215
|
+
desc: Cancela o drop e volta o item para coluna original.
|
|
216
|
+
|
|
163
217
|
'fetchColumns: () => void':
|
|
164
218
|
desc: Busca todas colunas com base nos headers fornecidos.
|
|
165
219
|
|
|
@@ -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:
|