@bildvitta/quasar-ui-asteroid 3.0.0-beta.7 → 3.0.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/dist/api/QasAppBar.json +0 -4
- package/dist/api/QasBtn.json +2 -1
- package/dist/api/QasCard.json +13 -9
- package/dist/api/QasDateTimeInput.json +12 -12
- package/dist/api/QasDialog.json +6 -2
- package/dist/api/QasFilters.json +4 -4
- package/dist/api/QasFormGenerator.json +33 -2
- package/dist/api/QasFormView.json +43 -15
- package/dist/api/QasGridGenerator.json +5 -4
- package/dist/api/QasInput.json +1 -1
- package/dist/api/QasListItems.json +18 -17
- package/dist/api/QasListView.json +21 -7
- package/dist/api/QasNestedFields.json +13 -3
- package/dist/api/QasNumericInput.json +10 -10
- package/dist/api/QasPasswordInput.json +1 -1
- package/dist/api/QasSearchBox.json +85 -3
- package/dist/api/QasSelect.json +81 -14
- package/dist/api/QasSelectList.json +16 -14
- package/dist/api/QasSignaturePad.json +1 -1
- package/dist/api/QasSingleView.json +13 -4
- package/dist/api/QasTabsGenerator.json +5 -2
- package/dist/api/QasUploader.json +5 -0
- package/dist/asteroid.cjs.css +1 -1
- package/dist/asteroid.cjs.js +1522 -706
- package/dist/asteroid.cjs.min.js +2 -2
- package/dist/asteroid.esm.css +1 -1
- package/dist/asteroid.esm.js +1525 -709
- package/dist/asteroid.esm.min.js +2 -2
- package/dist/asteroid.umd.css +1 -1
- package/dist/asteroid.umd.js +1525 -710
- package/dist/asteroid.umd.min.js +2 -2
- package/dist/vetur/asteroid-attributes.json +176 -100
- package/dist/vetur/asteroid-tags.json +60 -41
- package/package.json +1 -1
- package/src/components/actions-menu/QasActionsMenu.vue +2 -8
- package/src/components/app-bar/QasAppBar.vue +16 -12
- package/src/components/app-bar/QasAppBar.yml +0 -4
- package/src/components/avatar/QasAvatar.vue +0 -4
- package/src/components/btn/QasBtn.vue +5 -8
- package/src/components/btn/QasBtn.yml +2 -1
- package/src/components/card/QasCard.vue +18 -9
- package/src/components/card/QasCard.yml +13 -9
- package/src/components/date-time-input/QasDateTimeInput.vue +39 -41
- package/src/components/date-time-input/QasDateTimeInput.yml +11 -12
- package/src/components/delete/QasDelete.vue +15 -1
- package/src/components/dialog/QasDialog.vue +26 -3
- package/src/components/dialog/QasDialog.yml +6 -3
- package/src/components/dialog-router/QasDialogRouter.vue +1 -1
- package/src/components/field/QasField.vue +15 -14
- package/src/components/filters/QasFilters.vue +27 -10
- package/src/components/filters/QasFilters.yml +4 -4
- package/src/components/form-generator/QasFormGenerator.vue +87 -12
- package/src/components/form-generator/QasFormGenerator.yml +16 -2
- package/src/components/form-view/QasFormView.vue +138 -56
- package/src/components/form-view/QasFormView.yml +39 -15
- package/src/components/grid-generator/QasGridGenerator.vue +23 -7
- package/src/components/grid-generator/QasGridGenerator.yml +5 -4
- package/src/components/input/QasInput.vue +37 -21
- package/src/components/input/QasInput.yml +1 -1
- package/src/components/layout/QasLayout.vue +4 -0
- package/src/components/list-items/QasListItems.vue +15 -23
- package/src/components/list-items/QasListItems.yml +14 -15
- package/src/components/list-view/QasListView.vue +45 -24
- package/src/components/list-view/QasListView.yml +19 -7
- package/src/components/map/QasMap.vue +5 -5
- package/src/components/nested-fields/QasNestedFields.vue +29 -21
- package/src/components/nested-fields/QasNestedFields.yml +9 -3
- package/src/components/numeric-input/QasNumericInput.vue +14 -14
- package/src/components/numeric-input/QasNumericInput.yml +10 -10
- package/src/components/page-header/QasPageHeader.vue +14 -11
- package/src/components/password-input/QasPasswordInput.vue +17 -16
- package/src/components/password-input/QasPasswordInput.yml +1 -1
- package/src/components/profile/QasProfile.vue +1 -1
- package/src/components/search-box/QasSearchBox.vue +138 -42
- package/src/components/search-box/QasSearchBox.yml +69 -2
- package/src/components/select/QasSelect.vue +63 -53
- package/src/components/select/QasSelect.yml +64 -13
- package/src/components/select-list/QasSelectList.vue +11 -27
- package/src/components/select-list/QasSelectList.yml +13 -14
- package/src/components/signature-pad/QasSignaturePad.yml +1 -1
- package/src/components/signature-uploader/QasSignatureUploader.vue +7 -5
- package/src/components/single-view/QasSingleView.vue +22 -6
- package/src/components/single-view/QasSingleView.yml +11 -4
- package/src/components/table-generator/QasTableGenerator.vue +13 -2
- package/src/components/tabs-generator/QasTabsGenerator.vue +2 -2
- package/src/components/tabs-generator/QasTabsGenerator.yml +2 -2
- package/src/components/text-truncate/QasTextTruncate.vue +1 -1
- package/src/components/uploader/QasUploader.vue +62 -15
- package/src/components/uploader/QasUploader.yml +5 -0
- package/src/helpers/camelize-fields-name.js +15 -0
- package/src/helpers/filters.js +2 -0
- package/src/helpers/get-normalized-options.js +20 -0
- package/src/helpers/handle-process.js +13 -0
- package/src/helpers/index.js +3 -0
- package/src/mixins/generator.js +10 -2
- package/src/mixins/index.js +2 -0
- package/src/mixins/search-filter.js +227 -0
- package/src/mixins/view.js +35 -13
- package/src/pages/Forbidden.vue +3 -1
- package/src/pages/NotFound.vue +3 -1
- package/src/pages/ServerError.vue +3 -1
- package/src/pages/Unauthorized.vue +28 -0
- package/src/plugins/index.js +4 -2
- package/src/plugins/logger/Logger.js +44 -0
- package/src/plugins/logger/Logger.yml +9 -0
- package/src/vue-plugin.js +6 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="qas-list-items shadow-14">
|
|
3
3
|
<q-list bordered class="rounded-borders" separator>
|
|
4
|
-
<q-item v-for="(item, index) in list" :key="index" v-ripple :clickable="
|
|
4
|
+
<q-item v-for="(item, index) in list" :key="index" v-ripple :clickable="useClickableItem" @click="onClick({ item, index }, true)">
|
|
5
5
|
<slot :index="index" :item="item" name="item">
|
|
6
6
|
<q-item-section>
|
|
7
|
-
<slot :index="index" :item="item" name="item-section
|
|
7
|
+
<slot :index="index" :item="item" name="item-section" />
|
|
8
8
|
</q-item-section>
|
|
9
9
|
|
|
10
10
|
<q-item-section v-if="useSectionActions" side>
|
|
11
11
|
<slot :index="index" :item="item" name="item-section-side">
|
|
12
|
-
<qas-btn flat round
|
|
12
|
+
<qas-btn flat round @click="onClick({ item, index })">
|
|
13
13
|
<q-icon v-bind="iconProps" />
|
|
14
14
|
</qas-btn>
|
|
15
15
|
</slot>
|
|
@@ -41,37 +41,29 @@ export default {
|
|
|
41
41
|
type: Array
|
|
42
42
|
},
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
default: 'uuid',
|
|
46
|
-
type: String
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
redirectOnIcon: {
|
|
50
|
-
default: true,
|
|
44
|
+
useClickableItem: {
|
|
51
45
|
type: Boolean
|
|
52
46
|
},
|
|
53
47
|
|
|
54
|
-
to: {
|
|
55
|
-
default: () => ({}),
|
|
56
|
-
type: Object
|
|
57
|
-
},
|
|
58
|
-
|
|
59
48
|
useSectionActions: {
|
|
60
49
|
default: true,
|
|
61
50
|
type: Boolean
|
|
62
51
|
}
|
|
63
52
|
},
|
|
64
53
|
|
|
54
|
+
emits: ['click-item'],
|
|
55
|
+
|
|
65
56
|
methods: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
onClick ({ item, index }, fromItem) {
|
|
58
|
+
/**
|
|
59
|
+
* se o click veio do q-item e "useClickableItem" for "false", ou
|
|
60
|
+
* se o click não veio do q-item e "useClickableItem" for "true", então retorna sem emitir.
|
|
61
|
+
*/
|
|
62
|
+
if (
|
|
63
|
+
(fromItem && !this.useClickableItem) || (!fromItem && this.useClickableItem)
|
|
64
|
+
) return
|
|
72
65
|
|
|
73
|
-
|
|
74
|
-
return this.redirectOnIcon ? undefined : this.getRedirectPayload(item)
|
|
66
|
+
this.$emit('click-item', { item, index })
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
69
|
}
|
|
@@ -14,29 +14,17 @@ props:
|
|
|
14
14
|
default: []
|
|
15
15
|
type: Array
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
desc:
|
|
19
|
-
default: uuid
|
|
20
|
-
type: String
|
|
21
|
-
|
|
22
|
-
redirect-on-icon:
|
|
23
|
-
desc: Controla se o redirecionamento vai acontecer quando clicar no item inteiro ou somente no icon.
|
|
24
|
-
default: true
|
|
17
|
+
use-clickable-item:
|
|
18
|
+
desc: Controla se o item inteiro é clicável ou somente o button dentro do item.
|
|
25
19
|
type: Boolean
|
|
26
20
|
|
|
27
|
-
to:
|
|
28
|
-
desc: Configuração passada para o vue-router.
|
|
29
|
-
default: {}
|
|
30
|
-
type: Object
|
|
31
|
-
examples: ["{ name: 'Root' }"]
|
|
32
|
-
|
|
33
21
|
use-section-actions:
|
|
34
22
|
desc: Controla se exibe ou não seção de actions, onde fica o Ícone de redirecionamento.
|
|
35
23
|
default: true
|
|
36
24
|
type: Boolean
|
|
37
25
|
|
|
38
26
|
slots:
|
|
39
|
-
item-section
|
|
27
|
+
item-section:
|
|
40
28
|
desc: Slot para acessar seção da esquerda.
|
|
41
29
|
scope:
|
|
42
30
|
item:
|
|
@@ -55,3 +43,14 @@ slots:
|
|
|
55
43
|
index:
|
|
56
44
|
desc: Posição do item na lista.
|
|
57
45
|
type: Number
|
|
46
|
+
|
|
47
|
+
events:
|
|
48
|
+
'@click-item -> function ({ item, index })':
|
|
49
|
+
desc: Dispara toda vez que o item ou button (dependendo da prop "use-section-actions") é clicado.
|
|
50
|
+
params:
|
|
51
|
+
item:
|
|
52
|
+
desc: Item clicado
|
|
53
|
+
type: Object
|
|
54
|
+
index:
|
|
55
|
+
desc: Posição do item
|
|
56
|
+
type: Number
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component :is="mx_componentTag" :class="mx_componentClass">
|
|
3
|
-
<q-pull-to-refresh :disable="
|
|
3
|
+
<q-pull-to-refresh :disable="!useRefresh" @refresh="refresh">
|
|
4
4
|
<header v-if="hasHeaderSlot">
|
|
5
5
|
<slot name="header" />
|
|
6
6
|
</header>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</slot>
|
|
11
11
|
|
|
12
12
|
<main class="relative-position">
|
|
13
|
-
<div v-if="
|
|
13
|
+
<div v-if="showResults">
|
|
14
14
|
<slot />
|
|
15
15
|
</div>
|
|
16
16
|
|
|
@@ -54,15 +54,6 @@ export default {
|
|
|
54
54
|
mixins: [contextMixin, viewMixin],
|
|
55
55
|
|
|
56
56
|
props: {
|
|
57
|
-
disableRefresh: {
|
|
58
|
-
type: Boolean
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
useFilter: {
|
|
62
|
-
default: true,
|
|
63
|
-
type: Boolean
|
|
64
|
-
},
|
|
65
|
-
|
|
66
57
|
filtersProps: {
|
|
67
58
|
default: () => ({}),
|
|
68
59
|
type: Object
|
|
@@ -71,6 +62,20 @@ export default {
|
|
|
71
62
|
results: {
|
|
72
63
|
default: () => [],
|
|
73
64
|
type: Array
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
useRefresh: {
|
|
68
|
+
default: true,
|
|
69
|
+
type: Boolean
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
useFilter: {
|
|
73
|
+
default: true,
|
|
74
|
+
type: Boolean
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
useResultsAreaOnly: {
|
|
78
|
+
type: Boolean
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
81
|
|
|
@@ -106,13 +111,17 @@ export default {
|
|
|
106
111
|
|
|
107
112
|
totalPages () {
|
|
108
113
|
return this.$store.getters[`${this.entity}/totalPages`]
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
showResults () {
|
|
117
|
+
return this.hasResults || this.useResultsAreaOnly
|
|
109
118
|
}
|
|
110
119
|
},
|
|
111
120
|
|
|
112
121
|
watch: {
|
|
113
122
|
$route (to, from) {
|
|
114
123
|
if (to.name === from.name) {
|
|
115
|
-
this.fetchList
|
|
124
|
+
this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList)
|
|
116
125
|
this.setCurrentPage()
|
|
117
126
|
}
|
|
118
127
|
},
|
|
@@ -127,7 +136,8 @@ export default {
|
|
|
127
136
|
},
|
|
128
137
|
|
|
129
138
|
created () {
|
|
130
|
-
this.fetchList
|
|
139
|
+
this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList)
|
|
140
|
+
|
|
131
141
|
this.setCurrentPage()
|
|
132
142
|
},
|
|
133
143
|
|
|
@@ -137,21 +147,22 @@ export default {
|
|
|
137
147
|
this.$router.push({ query })
|
|
138
148
|
},
|
|
139
149
|
|
|
140
|
-
async fetchList (
|
|
150
|
+
async fetchList (externalPayload = {}) {
|
|
141
151
|
this.mx_isFetching = true
|
|
142
152
|
|
|
143
|
-
const hasFilters = !!Object.keys(filters).length
|
|
144
|
-
|
|
145
153
|
try {
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
const payload = {
|
|
155
|
+
...this.mx_context,
|
|
156
|
+
url: this.url,
|
|
157
|
+
...externalPayload
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
this.$qas.logger.group(
|
|
161
|
+
`QasListView - fetchList -> Payload do parâmetro do ${this.entity}/fetchList`, [payload]
|
|
153
162
|
)
|
|
154
163
|
|
|
164
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchList`, payload)
|
|
165
|
+
|
|
155
166
|
const { errors, fields, metadata } = response.data
|
|
156
167
|
|
|
157
168
|
this.mx_setErrors(errors)
|
|
@@ -165,17 +176,27 @@ export default {
|
|
|
165
176
|
})
|
|
166
177
|
|
|
167
178
|
this.$emit('fetch-success', response)
|
|
179
|
+
|
|
180
|
+
this.$qas.logger.group(
|
|
181
|
+
`QasListView - fetchList -> resposta da action ${this.entity}/fetchList`, [response]
|
|
182
|
+
)
|
|
168
183
|
} catch (error) {
|
|
169
184
|
this.mx_fetchError(error)
|
|
170
185
|
this.$emit('update:errors', error)
|
|
171
186
|
this.$emit('fetch-error', error)
|
|
187
|
+
|
|
188
|
+
this.$qas.logger.group(
|
|
189
|
+
`QasListView - fetchSingle -> exceção da action ${this.entity}/fetchList`,
|
|
190
|
+
[error],
|
|
191
|
+
{ error: true }
|
|
192
|
+
)
|
|
172
193
|
} finally {
|
|
173
194
|
this.mx_isFetching = false
|
|
174
195
|
}
|
|
175
196
|
},
|
|
176
197
|
|
|
177
198
|
async refresh (done) {
|
|
178
|
-
await this.fetchList
|
|
199
|
+
await this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList)
|
|
179
200
|
|
|
180
201
|
if (typeof done === 'function') {
|
|
181
202
|
done()
|
|
@@ -4,13 +4,11 @@ meta:
|
|
|
4
4
|
desc: Componente para C.R.U.D. responsável pela parte de listagem (Read).
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
-
|
|
8
|
-
desc:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
desc: Desabilita o [pull-to-refresh](https://quasar.dev/vue-components/pull-to-refresh#basic).
|
|
13
|
-
type: Boolean
|
|
7
|
+
before-fetch:
|
|
8
|
+
desc: Callback para controlar como funciona o comportamento do fetchList.
|
|
9
|
+
default: null
|
|
10
|
+
type: Function
|
|
11
|
+
examples: ['beforeFetch({ payload, resolve, done })']
|
|
14
12
|
|
|
15
13
|
entity:
|
|
16
14
|
desc: Entidade da store, por exemplo se tiver que trabalhar com modulo de usuários, teremos o model "users" na store, que vai ser nossa "entity".
|
|
@@ -60,11 +58,25 @@ props:
|
|
|
60
58
|
desc: Envia como parâmetro para a action "fetchList" do modulo correspondente a "entity".
|
|
61
59
|
type: String
|
|
62
60
|
|
|
61
|
+
use-boundary:
|
|
62
|
+
desc: Controla o limite que o FormView terá, quando é "false", a tag pai deixa de ser um "QPage" para ser uma "div" e é removido as classes "container" e "spaced", comumente utilizando quando precisa usar o QasFormView dentro de um dialog.
|
|
63
|
+
default: true
|
|
64
|
+
type: Boolean
|
|
65
|
+
|
|
63
66
|
use-filter:
|
|
64
67
|
desc: Controla se o componente vai usar ou não o componente "QasFilters".
|
|
65
68
|
default: true
|
|
66
69
|
type: Boolean
|
|
67
70
|
|
|
71
|
+
use-refresh:
|
|
72
|
+
desc: Controla o [pull-to-refresh](https://quasar.dev/vue-components/pull-to-refresh#basic).
|
|
73
|
+
default: true
|
|
74
|
+
type: Boolean
|
|
75
|
+
|
|
76
|
+
use-results-area-only:
|
|
77
|
+
desc: Controla se irá sempre ser exibido os resultados independente se não há nenhum resultado a ser exibido.
|
|
78
|
+
type: Boolean
|
|
79
|
+
|
|
68
80
|
slots:
|
|
69
81
|
default:
|
|
70
82
|
desc: 'Slot para ter o conteúdo principal (dentro do main).'
|
|
@@ -26,13 +26,13 @@ export default {
|
|
|
26
26
|
default: () => []
|
|
27
27
|
},
|
|
28
28
|
|
|
29
|
-
usePopup: {
|
|
30
|
-
type: Boolean
|
|
31
|
-
},
|
|
32
|
-
|
|
33
29
|
zoom: {
|
|
34
30
|
type: Number,
|
|
35
31
|
default: 17
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
usePopup: {
|
|
35
|
+
type: Boolean
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
<style lang="scss">
|
|
71
71
|
.qas-map {
|
|
72
72
|
&__draw {
|
|
73
|
-
height: 300px;
|
|
73
|
+
height: 300px !important;
|
|
74
74
|
width: 100%;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
<div v-if="!row[destroyKey]" :key="index" class="col-12 q-mt-md">
|
|
11
11
|
<div>
|
|
12
12
|
<div class="flex items-center justify-between q-py-xs">
|
|
13
|
-
<qas-label v-if="!useSingleLabel" :label="
|
|
13
|
+
<qas-label v-if="!useSingleLabel" :label="getRowLabel(index)" />
|
|
14
14
|
|
|
15
15
|
<div v-if="!useInlineActions" class="q-gutter-x-sm">
|
|
16
|
-
<qas-btn v-if="useDuplicate" v-bind="
|
|
17
|
-
<qas-btn v-if="showDestroyBtn" v-bind="
|
|
16
|
+
<qas-btn v-if="useDuplicate" v-bind="buttonDuplicateProps" @click="add(row)" />
|
|
17
|
+
<qas-btn v-if="showDestroyBtn" v-bind="buttonDestroyProps" @click="destroy(index, row)" />
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
|
|
@@ -75,7 +75,6 @@ import { TransitionGroup } from 'vue'
|
|
|
75
75
|
|
|
76
76
|
import { constructObject } from '../../helpers'
|
|
77
77
|
import { extend } from 'quasar'
|
|
78
|
-
import { camelize } from 'humps'
|
|
79
78
|
|
|
80
79
|
export default {
|
|
81
80
|
name: 'QasNestedFields',
|
|
@@ -96,7 +95,7 @@ export default {
|
|
|
96
95
|
default: 'Inserir novo campo'
|
|
97
96
|
},
|
|
98
97
|
|
|
99
|
-
|
|
98
|
+
buttonDestroyProps: {
|
|
100
99
|
type: Object,
|
|
101
100
|
default: () => {
|
|
102
101
|
return {
|
|
@@ -108,14 +107,14 @@ export default {
|
|
|
108
107
|
}
|
|
109
108
|
},
|
|
110
109
|
|
|
111
|
-
|
|
110
|
+
buttonDuplicateProps: {
|
|
112
111
|
type: Object,
|
|
113
112
|
default: () => {
|
|
114
113
|
return {
|
|
115
114
|
label: 'Duplicar',
|
|
116
115
|
icon: 'o_content_copy',
|
|
117
116
|
flat: true,
|
|
118
|
-
|
|
117
|
+
useLabelOnSmallScreen: false,
|
|
119
118
|
dense: true
|
|
120
119
|
}
|
|
121
120
|
}
|
|
@@ -160,6 +159,11 @@ export default {
|
|
|
160
159
|
}
|
|
161
160
|
},
|
|
162
161
|
|
|
162
|
+
identifierItemKey: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: 'uuid'
|
|
165
|
+
},
|
|
166
|
+
|
|
163
167
|
rowLabel: {
|
|
164
168
|
type: String,
|
|
165
169
|
default: ''
|
|
@@ -225,13 +229,7 @@ export default {
|
|
|
225
229
|
},
|
|
226
230
|
|
|
227
231
|
children () {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
for (const key in field?.children) {
|
|
231
|
-
field.children[key].name = camelize(field?.children[key].name)
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return field?.children
|
|
232
|
+
return this.field?.children
|
|
235
233
|
},
|
|
236
234
|
|
|
237
235
|
showDestroyBtn () {
|
|
@@ -258,8 +256,7 @@ export default {
|
|
|
258
256
|
|
|
259
257
|
return {
|
|
260
258
|
tag: 'div',
|
|
261
|
-
enterActiveClass: 'animated slideInDown'
|
|
262
|
-
leaveActiveClass: 'animated slideOutUp'
|
|
259
|
+
enterActiveClass: 'animated slideInDown'
|
|
263
260
|
}
|
|
264
261
|
}
|
|
265
262
|
},
|
|
@@ -272,9 +269,9 @@ export default {
|
|
|
272
269
|
immediate: true
|
|
273
270
|
},
|
|
274
271
|
|
|
275
|
-
|
|
272
|
+
rowObject: {
|
|
276
273
|
handler () {
|
|
277
|
-
!this.
|
|
274
|
+
if (!this.nested.length) return this.setDefaultNestedValue()
|
|
278
275
|
},
|
|
279
276
|
immediate: true
|
|
280
277
|
}
|
|
@@ -282,13 +279,22 @@ export default {
|
|
|
282
279
|
|
|
283
280
|
methods: {
|
|
284
281
|
add (row = {}) {
|
|
285
|
-
|
|
282
|
+
const payload = { ...this.rowObject, ...row }
|
|
283
|
+
const hasIdentifierKey = payload[this.identifierItemKey]
|
|
284
|
+
|
|
285
|
+
if (hasIdentifierKey) {
|
|
286
|
+
delete payload[this.identifierItemKey]
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
this.nested.push(payload)
|
|
286
290
|
|
|
287
291
|
this.$nextTick(() => {
|
|
288
292
|
this.useAnimation && this.setScroll()
|
|
289
293
|
this.setFocus()
|
|
290
294
|
})
|
|
291
295
|
|
|
296
|
+
this.$qas.logger.group('QasNestedFields - add', [payload])
|
|
297
|
+
|
|
292
298
|
return this.updateModelValue()
|
|
293
299
|
},
|
|
294
300
|
|
|
@@ -304,10 +310,12 @@ export default {
|
|
|
304
310
|
},
|
|
305
311
|
|
|
306
312
|
destroy (index, row) {
|
|
307
|
-
this.useRemoveOnDestroy
|
|
313
|
+
!row[this.identifierItemKey] && this.useRemoveOnDestroy
|
|
308
314
|
? this.nested.splice(index, 1)
|
|
309
315
|
: this.nested.splice(index, 1, { [this.destroyKey]: true, ...row })
|
|
310
316
|
|
|
317
|
+
this.$qas.logger.group('QasNestedFields - destroy', [{ index, row }])
|
|
318
|
+
|
|
311
319
|
return this.updateModelValue()
|
|
312
320
|
},
|
|
313
321
|
|
|
@@ -333,7 +341,7 @@ export default {
|
|
|
333
341
|
})
|
|
334
342
|
},
|
|
335
343
|
|
|
336
|
-
|
|
344
|
+
getRowLabel (rowKey) {
|
|
337
345
|
if (this.rowLabel) {
|
|
338
346
|
return this.useIndexLabel ? `${this.rowLabel} ${rowKey + 1}` : this.rowLabel
|
|
339
347
|
}
|
|
@@ -9,15 +9,15 @@ props:
|
|
|
9
9
|
default: Inserir novo campo
|
|
10
10
|
type: Boolean
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
button-destroy-props:
|
|
13
13
|
desc: Props do botão de excluir linha contendo os campos.
|
|
14
14
|
default: "{ label: 'Remover', o_cancel, flat: true, dense: true }"
|
|
15
15
|
debugger: true
|
|
16
16
|
type: Object
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
button-duplicate-props:
|
|
19
19
|
desc: Props do botão de duplicar linha contendo os campos.
|
|
20
|
-
default: "{ label: 'Duplicar', o_content_copy, flat: true, dense: true,
|
|
20
|
+
default: "{ label: 'Duplicar', o_content_copy, flat: true, dense: true, useLabelOnSmallScreen: false }"
|
|
21
21
|
debugger: true
|
|
22
22
|
type: Object
|
|
23
23
|
|
|
@@ -56,6 +56,12 @@ props:
|
|
|
56
56
|
type: String
|
|
57
57
|
examples: [xs, sm, md, lg, xl]
|
|
58
58
|
|
|
59
|
+
identifier-item-key:
|
|
60
|
+
desc: Define um identificador para o item. O identificador será utilizado para validar exclusão do item, por exemplo.
|
|
61
|
+
default: uuid
|
|
62
|
+
type: String
|
|
63
|
+
examples: [id, uuid, slug]
|
|
64
|
+
|
|
59
65
|
model-value:
|
|
60
66
|
desc: Model do componente
|
|
61
67
|
default: []
|
|
@@ -20,17 +20,7 @@ export default {
|
|
|
20
20
|
name: 'QasNumericInput',
|
|
21
21
|
|
|
22
22
|
props: {
|
|
23
|
-
|
|
24
|
-
default: true,
|
|
25
|
-
type: Boolean
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
allowPositive: {
|
|
29
|
-
default: true,
|
|
30
|
-
type: Boolean
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
autonumericProps: {
|
|
23
|
+
autonumericOptions: {
|
|
34
24
|
default: () => ({}),
|
|
35
25
|
type: Object
|
|
36
26
|
},
|
|
@@ -62,6 +52,16 @@ export default {
|
|
|
62
52
|
preset: {
|
|
63
53
|
default: false,
|
|
64
54
|
type: [Boolean, String]
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
useNegative: {
|
|
58
|
+
default: true,
|
|
59
|
+
type: Boolean
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
usePositive: {
|
|
63
|
+
default: true,
|
|
64
|
+
type: Boolean
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
|
|
@@ -105,11 +105,11 @@ export default {
|
|
|
105
105
|
Object.assign(options, autoNumericPredefinedOptions[value])
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
if (!this.
|
|
108
|
+
if (!this.useNegative) {
|
|
109
109
|
options.minimumValue = 0
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
if (!this.
|
|
112
|
+
if (!this.usePositive) {
|
|
113
113
|
options.maximumValue = 0
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -117,7 +117,7 @@ export default {
|
|
|
117
117
|
options.decimalPlaces = this.decimalPlaces
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
Object.assign(options, this.
|
|
120
|
+
Object.assign(options, this.autonumericOptions)
|
|
121
121
|
|
|
122
122
|
this.$nextTick(() => {
|
|
123
123
|
this.autoNumeric = new AutoNumeric(this.$refs.input, options)
|
|
@@ -7,16 +7,6 @@ meta:
|
|
|
7
7
|
desc: Componente de input para decimal, inteiro, dinheiro e porcentagem.
|
|
8
8
|
|
|
9
9
|
props:
|
|
10
|
-
allow-negative:
|
|
11
|
-
desc: Controla se pode ou não números negativos.
|
|
12
|
-
default: true
|
|
13
|
-
type: Boolean
|
|
14
|
-
|
|
15
|
-
allow-positive:
|
|
16
|
-
desc: Controla se pode ou não números positivos.
|
|
17
|
-
default: true
|
|
18
|
-
type: Boolean
|
|
19
|
-
|
|
20
10
|
autonumeric-props:
|
|
21
11
|
desc: Opções do autonumeric (http://autonumeric.org/guide).
|
|
22
12
|
default: {}
|
|
@@ -43,6 +33,16 @@ props:
|
|
|
43
33
|
desc: Propriedade preset serve para usar configuração de predefinição/nacionalidade da moeda pré setada pelo autonumeric (Brasil é o padrão).
|
|
44
34
|
type: [Boolean, String]
|
|
45
35
|
|
|
36
|
+
use-negative:
|
|
37
|
+
desc: Controla se pode ou não números negativos.
|
|
38
|
+
default: true
|
|
39
|
+
type: Boolean
|
|
40
|
+
|
|
41
|
+
use-positive:
|
|
42
|
+
desc: Controla se pode ou não números positivos.
|
|
43
|
+
default: true
|
|
44
|
+
type: Boolean
|
|
45
|
+
|
|
46
46
|
events:
|
|
47
47
|
'@update:model-value -> function (value)':
|
|
48
48
|
desc: Dispara toda vez que o model é atualizado (após o blur do input), também utilizado para v-model.
|
|
@@ -17,23 +17,27 @@
|
|
|
17
17
|
<script>
|
|
18
18
|
import { castArray } from 'lodash-es'
|
|
19
19
|
import { useHistory } from '../../composables'
|
|
20
|
+
import { createMetaMixin } from 'quasar'
|
|
20
21
|
|
|
21
22
|
const { hasPreviousRoute, history, getPreviousRoute } = useHistory()
|
|
22
23
|
|
|
23
24
|
export default {
|
|
24
25
|
name: 'QasPageHeader',
|
|
25
26
|
|
|
27
|
+
mixins: [
|
|
28
|
+
createMetaMixin(function () {
|
|
29
|
+
return {
|
|
30
|
+
title: this.title
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
],
|
|
34
|
+
|
|
26
35
|
props: {
|
|
27
36
|
breadcrumbs: {
|
|
28
37
|
default: '',
|
|
29
38
|
type: [Array, String]
|
|
30
39
|
},
|
|
31
40
|
|
|
32
|
-
useBreadcrumbs: {
|
|
33
|
-
default: true,
|
|
34
|
-
type: Boolean
|
|
35
|
-
},
|
|
36
|
-
|
|
37
41
|
root: {
|
|
38
42
|
default: '',
|
|
39
43
|
type: [Object, String]
|
|
@@ -42,6 +46,11 @@ export default {
|
|
|
42
46
|
title: {
|
|
43
47
|
default: '',
|
|
44
48
|
type: String
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
useBreadcrumbs: {
|
|
52
|
+
default: true,
|
|
53
|
+
type: Boolean
|
|
45
54
|
}
|
|
46
55
|
},
|
|
47
56
|
|
|
@@ -85,12 +94,6 @@ export default {
|
|
|
85
94
|
|
|
86
95
|
return lastIndex === index ? 'text-grey-7' : 'text-primary'
|
|
87
96
|
}
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
meta () {
|
|
91
|
-
return {
|
|
92
|
-
title: this.title
|
|
93
|
-
}
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
</script>
|