@bildvitta/quasar-ui-asteroid 3.12.0-beta.8 → 3.12.0
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/label/QasLabel.vue +13 -2
- package/src/components/label/QasLabel.yml +10 -4
- package/src/components/nested-fields/QasNestedFields.vue +33 -8
- package/src/components/nested-fields/QasNestedFields.yml +2 -2
- package/src/components/select-list-dialog/QasSelectListDialog.vue +1 -1
- package/src/components/select-list-dialog/QasSelectListDialog.yml +4 -4
- package/src/components/uploader/QasUploader.vue +24 -3
- package/src/components/uploader/QasUploader.yml +11 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div :class="classes">
|
|
3
3
|
<slot :label-with-suffix="formattedLabel">{{ formattedLabel }}</slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -39,6 +39,16 @@ export default {
|
|
|
39
39
|
|
|
40
40
|
required: {
|
|
41
41
|
type: Boolean
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
typography: {
|
|
45
|
+
default: 'h4',
|
|
46
|
+
type: String,
|
|
47
|
+
validator: value => {
|
|
48
|
+
const availableTypography = ['h4', 'h5']
|
|
49
|
+
|
|
50
|
+
return availableTypography.includes(value)
|
|
51
|
+
}
|
|
42
52
|
}
|
|
43
53
|
},
|
|
44
54
|
|
|
@@ -54,7 +64,8 @@ export default {
|
|
|
54
64
|
classes () {
|
|
55
65
|
return [
|
|
56
66
|
`q-mb-${this.margin}`,
|
|
57
|
-
`text-${this.color}
|
|
67
|
+
`text-${this.color}`,
|
|
68
|
+
`text-${this.typography}`
|
|
58
69
|
]
|
|
59
70
|
}
|
|
60
71
|
}
|
|
@@ -4,6 +4,11 @@ meta:
|
|
|
4
4
|
desc: Componente para controlar textos que separam conteúdos, formatando com um sufixo quando existe um contador.
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
+
color:
|
|
8
|
+
desc: Cor do texto.
|
|
9
|
+
default: grey-9
|
|
10
|
+
type: String
|
|
11
|
+
|
|
7
12
|
count:
|
|
8
13
|
desc: Contador que vai ficar ao lado do texto.
|
|
9
14
|
default: 0
|
|
@@ -20,14 +25,15 @@ props:
|
|
|
20
25
|
examples: [xs, sm, md, lg, xl]
|
|
21
26
|
|
|
22
27
|
required:
|
|
23
|
-
desc: Controla
|
|
28
|
+
desc: Controla se exibirá o sufixo "*" ao lado do texto.
|
|
24
29
|
default: false
|
|
25
30
|
type: Boolean
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
desc:
|
|
29
|
-
default:
|
|
32
|
+
typography:
|
|
33
|
+
desc: Controla qual a tipografia do texto.
|
|
34
|
+
default: h4
|
|
30
35
|
type: String
|
|
36
|
+
examples: [h4, h5]
|
|
31
37
|
|
|
32
38
|
slots:
|
|
33
39
|
default:
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :id="fieldName" class="qas-nested-fields">
|
|
3
3
|
<div v-if="useSingleLabel" class="text-left">
|
|
4
|
-
<qas-label :label="fieldLabel"
|
|
4
|
+
<qas-label :label="fieldLabel" typography="h5" />
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div ref="inputContent">
|
|
8
8
|
<component :is="componentTag" v-bind="componentProps">
|
|
9
9
|
<template v-for="(row, index) in nested" :key="`row-${index}`">
|
|
10
|
-
<div v-if="!row[destroyKey]" :id="`row-${index}`" class="full-width
|
|
10
|
+
<div v-if="!row[destroyKey]" :id="`row-${index}`" class="full-width qas-nested-fields__field-item">
|
|
11
11
|
<header v-if="hasHeader" class="flex items-center q-pb-md" :class="headerClasses">
|
|
12
|
-
<qas-label v-if="!useSingleLabel" :label="getRowLabel(index)" margin="none" />
|
|
13
|
-
<qas-actions-menu v-if="hasBlockActions(row)" v-bind="
|
|
12
|
+
<qas-label v-if="!useSingleLabel" :label="getRowLabel(index)" margin="none" typography="h5" />
|
|
13
|
+
<qas-actions-menu v-if="hasBlockActions(row)" v-bind="getActionsMenuProps(index, row)" />
|
|
14
14
|
</header>
|
|
15
15
|
|
|
16
16
|
<div ref="formGenerator" class="col-12 justify-between q-col-gutter-x-md row">
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</slot>
|
|
24
24
|
|
|
25
25
|
<div v-if="hasInlineActions(row)" class="flex items-center qas-nested-fields__actions">
|
|
26
|
-
<qas-actions-menu v-bind="
|
|
26
|
+
<qas-actions-menu v-bind="getActionsMenuProps(index, row)" />
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
</component>
|
|
36
36
|
|
|
37
|
-
<div v-if="useAdd"
|
|
37
|
+
<div v-if="useAdd">
|
|
38
38
|
<slot :add="add" name="add-input">
|
|
39
39
|
<div v-if="showAddFirstInputButton" class="text-left">
|
|
40
40
|
<qas-btn class="q-px-sm" color="primary" variant="tertiary" @click="add()">{{ addFirstInputLabel }}</qas-btn>
|
|
@@ -86,7 +86,7 @@ export default {
|
|
|
86
86
|
|
|
87
87
|
props: {
|
|
88
88
|
actionsMenuProps: {
|
|
89
|
-
type: Object,
|
|
89
|
+
type: [Object, Function],
|
|
90
90
|
default: () => ({})
|
|
91
91
|
},
|
|
92
92
|
|
|
@@ -327,7 +327,22 @@ export default {
|
|
|
327
327
|
},
|
|
328
328
|
|
|
329
329
|
methods: {
|
|
330
|
-
|
|
330
|
+
getActionsMenuProps (index, row) {
|
|
331
|
+
if (typeof this.actionsMenuProps === 'function') {
|
|
332
|
+
return this.actionsMenuProps({
|
|
333
|
+
index,
|
|
334
|
+
row,
|
|
335
|
+
list: this.getDefaultActionsMenuList(index, row)
|
|
336
|
+
})
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return {
|
|
340
|
+
...this.actionsMenuProps,
|
|
341
|
+
list: this.getActionsMenuList(index, row)
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
getDefaultActionsMenuList (index, row) {
|
|
331
346
|
const list = {}
|
|
332
347
|
|
|
333
348
|
if (this.useDuplicate) {
|
|
@@ -344,6 +359,12 @@ export default {
|
|
|
344
359
|
}
|
|
345
360
|
}
|
|
346
361
|
|
|
362
|
+
return list
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
getActionsMenuList (index, row) {
|
|
366
|
+
const list = this.getDefaultActionsMenuList(index, row)
|
|
367
|
+
|
|
347
368
|
for (const key in this.actionsMenuProps.list) {
|
|
348
369
|
const { handler, ...content } = this.actionsMenuProps.list[key] || {}
|
|
349
370
|
|
|
@@ -473,6 +494,10 @@ export default {
|
|
|
473
494
|
height: 56px;
|
|
474
495
|
}
|
|
475
496
|
|
|
497
|
+
&__field-item {
|
|
498
|
+
margin-bottom: var(--qas-spacing-md);
|
|
499
|
+
}
|
|
500
|
+
|
|
476
501
|
&__field-item + &__field-item {
|
|
477
502
|
margin-top: var(--qas-spacing-xl);
|
|
478
503
|
}
|
|
@@ -5,9 +5,9 @@ meta:
|
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
7
|
actions-menu-props:
|
|
8
|
-
desc: Repassa as propriedades para o componente QasActionsMenu.
|
|
8
|
+
desc: Repassa as propriedades para o componente QasActionsMenu. É possível passar um objeto com as propriedades ou uma função que recebe o 'index', 'row' e 'list' como parâmetro e retorna um objeto com as propriedades.
|
|
9
9
|
default: {}
|
|
10
|
-
type: Object
|
|
10
|
+
type: [Object, Function]
|
|
11
11
|
|
|
12
12
|
add-first-input-label:
|
|
13
13
|
desc: Rótulo do input para adicionar o primeiro campo.
|
|
@@ -76,21 +76,21 @@ slots:
|
|
|
76
76
|
desc: Slot para substituir cabeçalho do dialog.
|
|
77
77
|
|
|
78
78
|
events:
|
|
79
|
-
'add -> function(
|
|
79
|
+
'@add -> function(items)':
|
|
80
80
|
desc: Dispara toda vez que é adicionado novos itens.
|
|
81
81
|
params:
|
|
82
|
-
|
|
82
|
+
items:
|
|
83
83
|
desc: Lista de itens adicionados.
|
|
84
84
|
type: Array
|
|
85
85
|
|
|
86
|
-
'remove -> function(value)':
|
|
86
|
+
'@remove -> function(value)':
|
|
87
87
|
desc: Dispara toda vez que é removido um item.
|
|
88
88
|
params:
|
|
89
89
|
value:
|
|
90
90
|
desc: Valor do item (uuid/id/slug).
|
|
91
91
|
type: String
|
|
92
92
|
|
|
93
|
-
'update:model-value -> function(list)':
|
|
93
|
+
'@update:model-value -> function(list)':
|
|
94
94
|
desc: Dispara toda vez que o model é atualizado.
|
|
95
95
|
params:
|
|
96
96
|
list:
|
|
@@ -154,6 +154,11 @@ export default {
|
|
|
154
154
|
type: Number
|
|
155
155
|
},
|
|
156
156
|
|
|
157
|
+
uploadCredentialsParams: {
|
|
158
|
+
type: Object,
|
|
159
|
+
default: () => ({})
|
|
160
|
+
},
|
|
161
|
+
|
|
157
162
|
uploading: {
|
|
158
163
|
type: Boolean
|
|
159
164
|
},
|
|
@@ -170,6 +175,11 @@ export default {
|
|
|
170
175
|
useResize: {
|
|
171
176
|
default: true,
|
|
172
177
|
type: Boolean
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
useUrlPath: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: true
|
|
173
183
|
}
|
|
174
184
|
},
|
|
175
185
|
|
|
@@ -366,7 +376,8 @@ export default {
|
|
|
366
376
|
try {
|
|
367
377
|
const { data } = await this.$axios.post('/upload-credentials/', {
|
|
368
378
|
entity: this.entity,
|
|
369
|
-
filename
|
|
379
|
+
filename,
|
|
380
|
+
...this.uploadCredentialsParams
|
|
370
381
|
})
|
|
371
382
|
|
|
372
383
|
return data
|
|
@@ -377,7 +388,7 @@ export default {
|
|
|
377
388
|
uploadedFiles = uploadedFiles.map((file, indexToDelete) => {
|
|
378
389
|
return {
|
|
379
390
|
isUploaded: true,
|
|
380
|
-
url: file.xhr ? file.xhr
|
|
391
|
+
url: file.xhr ? this.getURLValue(file.xhr) : '',
|
|
381
392
|
name: file.name,
|
|
382
393
|
indexToDelete,
|
|
383
394
|
isFailed: this.isFailed(file)
|
|
@@ -421,6 +432,16 @@ export default {
|
|
|
421
432
|
return value.split('/').pop()
|
|
422
433
|
},
|
|
423
434
|
|
|
435
|
+
/**
|
|
436
|
+
* Caso useUrlPath seja true, retorna de responseURL, senão tenta retornar o response
|
|
437
|
+
* que pode ser um base64, caso não tenha o response, retorna a responseURL.
|
|
438
|
+
*/
|
|
439
|
+
getURLValue (xhr) {
|
|
440
|
+
const responseURL = xhr.responseURL.split('?').shift()
|
|
441
|
+
|
|
442
|
+
return this.useUrlPath ? responseURL : (xhr.response || responseURL)
|
|
443
|
+
},
|
|
444
|
+
|
|
424
445
|
getModelValue (index) {
|
|
425
446
|
if (!this.useObjectModel) return {}
|
|
426
447
|
|
|
@@ -571,7 +592,7 @@ export default {
|
|
|
571
592
|
uploaded (response) {
|
|
572
593
|
this.hasError = false
|
|
573
594
|
|
|
574
|
-
const fullPath = response.xhr
|
|
595
|
+
const fullPath = this.getURLValue(response.xhr)
|
|
575
596
|
|
|
576
597
|
const objectValue = {
|
|
577
598
|
format: response.files[0].type,
|
|
@@ -33,7 +33,7 @@ props:
|
|
|
33
33
|
'image/webp',
|
|
34
34
|
'image/jpg'
|
|
35
35
|
]
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
columns:
|
|
38
38
|
desc: Seta as colunas (grid cols), valor default depende se o componente é múltiplo ou não.
|
|
39
39
|
default:
|
|
@@ -118,6 +118,11 @@ props:
|
|
|
118
118
|
default: 1280
|
|
119
119
|
type: Number
|
|
120
120
|
|
|
121
|
+
upload-credentials-params:
|
|
122
|
+
desc: Parâmetros enviados para a API do `/upload-credentials/`.
|
|
123
|
+
default: {}
|
|
124
|
+
type: Object
|
|
125
|
+
|
|
121
126
|
uploading:
|
|
122
127
|
desc: Model que retorna se o componente está fazendo algum upload.
|
|
123
128
|
type: Boolean
|
|
@@ -139,6 +144,11 @@ props:
|
|
|
139
144
|
default: true
|
|
140
145
|
type: Boolean
|
|
141
146
|
|
|
147
|
+
use-url-path:
|
|
148
|
+
desc: Controla se o componente vai salvar o path url no model ou por exemplo um base64.
|
|
149
|
+
default: true
|
|
150
|
+
type: Boolean
|
|
151
|
+
|
|
142
152
|
slots:
|
|
143
153
|
header:
|
|
144
154
|
desc: Acesso ao header do <q-uploader />.
|