@bildvitta/quasar-ui-asteroid 3.0.0-beta.9 → 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 +26 -9
- 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 +80 -1
- package/dist/api/QasSelect.json +79 -6
- 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 +1463 -663
- package/dist/asteroid.cjs.min.js +2 -2
- package/dist/asteroid.esm.css +1 -1
- package/dist/asteroid.esm.js +1466 -666
- package/dist/asteroid.esm.min.js +2 -2
- package/dist/asteroid.umd.css +1 -1
- package/dist/asteroid.umd.js +1466 -667
- package/dist/asteroid.umd.min.js +2 -2
- package/dist/vetur/asteroid-attributes.json +162 -94
- package/dist/vetur/asteroid-tags.json +54 -37
- 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 +99 -39
- package/src/components/form-view/QasFormView.yml +22 -9
- 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 +137 -36
- package/src/components/search-box/QasSearchBox.yml +66 -1
- package/src/components/select/QasSelect.vue +62 -46
- package/src/components/select/QasSelect.yml +63 -6
- 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 +11 -1
- 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 +32 -12
- 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
package/dist/asteroid.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @bildvitta/quasar-ui-asteroid v3.0.0
|
|
2
|
+
* @bildvitta/quasar-ui-asteroid v3.0.0
|
|
3
3
|
* (c) 2022 Bild & Vitta <systemteam@bild.com.br>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -17,6 +17,7 @@ var AutoNumeric = require('autonumeric');
|
|
|
17
17
|
var Pica = require('pica');
|
|
18
18
|
var SignaturePad = require('signature_pad');
|
|
19
19
|
var vueRouter = require('vue-router');
|
|
20
|
+
var lodash = require('lodash');
|
|
20
21
|
var Fuse = require('fuse.js');
|
|
21
22
|
var Sortable = require('sortablejs');
|
|
22
23
|
var VueGoogleMaps = require('@fawmi/vue-google-maps');
|
|
@@ -58,14 +59,14 @@ var script$L = {
|
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
|
|
61
|
-
const _hoisted_1$
|
|
62
|
+
const _hoisted_1$t = { class: "col-12 col-sm-auto" };
|
|
62
63
|
const _hoisted_2$l = { class: "col-12 col-sm-auto" };
|
|
63
64
|
|
|
64
65
|
function render$L(_ctx, _cache, $props, $setup, $data, $options) {
|
|
65
66
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
66
67
|
class: vue.normalizeClass($options.classes)
|
|
67
68
|
}, [
|
|
68
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
69
|
+
vue.createElementVNode("div", _hoisted_1$t, [
|
|
69
70
|
vue.renderSlot(_ctx.$slots, "secondary")
|
|
70
71
|
]),
|
|
71
72
|
vue.createElementVNode("div", _hoisted_2$l, [
|
|
@@ -81,13 +82,14 @@ var script$K = {
|
|
|
81
82
|
name: 'QasBtn',
|
|
82
83
|
|
|
83
84
|
props: {
|
|
84
|
-
|
|
85
|
+
useLabelOnSmallScreen: {
|
|
86
|
+
default: true,
|
|
85
87
|
type: Boolean
|
|
86
88
|
},
|
|
87
89
|
|
|
88
90
|
label: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
default: '',
|
|
92
|
+
type: String
|
|
91
93
|
}
|
|
92
94
|
},
|
|
93
95
|
|
|
@@ -99,12 +101,8 @@ var script$K = {
|
|
|
99
101
|
}
|
|
100
102
|
},
|
|
101
103
|
|
|
102
|
-
hasLabel () {
|
|
103
|
-
return !!this.label
|
|
104
|
-
},
|
|
105
|
-
|
|
106
104
|
showLabel () {
|
|
107
|
-
return this.
|
|
105
|
+
return this.useLabelOnSmallScreen || !this.$qas.screen.isSmall
|
|
108
106
|
},
|
|
109
107
|
|
|
110
108
|
slots () {
|
|
@@ -180,8 +178,6 @@ var script$J = {
|
|
|
180
178
|
}
|
|
181
179
|
},
|
|
182
180
|
|
|
183
|
-
emits: ['delete-success'],
|
|
184
|
-
|
|
185
181
|
computed: {
|
|
186
182
|
hasDelete () {
|
|
187
183
|
return !!Object.keys(this.deleteProps).length
|
|
@@ -194,15 +190,11 @@ var script$J = {
|
|
|
194
190
|
const { handler, ...filtered } = item;
|
|
195
191
|
item.handler(filtered);
|
|
196
192
|
}
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
onDeleteSuccess () {
|
|
200
|
-
this.$emit('delete-success');
|
|
201
193
|
}
|
|
202
194
|
}
|
|
203
195
|
};
|
|
204
196
|
|
|
205
|
-
const _hoisted_1$
|
|
197
|
+
const _hoisted_1$s = { class: "flex items-center justify-center q-gutter-x-md" };
|
|
206
198
|
const _hoisted_2$k = { class: "flex items-center justify-center q-gutter-x-sm" };
|
|
207
199
|
|
|
208
200
|
function render$J(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -217,11 +209,11 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
217
209
|
return (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
218
210
|
class: "qas-actions-menu",
|
|
219
211
|
color: "primary",
|
|
220
|
-
"hide-label-on-small-screen": "",
|
|
221
212
|
icon: $props.icon,
|
|
222
213
|
label: $props.label,
|
|
223
214
|
outline: "",
|
|
224
|
-
padding: "md"
|
|
215
|
+
padding: "md",
|
|
216
|
+
"use-label-on-small-screen": ""
|
|
225
217
|
}, {
|
|
226
218
|
default: vue.withCtx(() => [
|
|
227
219
|
vue.createVNode(_component_q_menu, { class: "qas-actions-menu__menu" }, {
|
|
@@ -243,7 +235,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
243
235
|
default: vue.withCtx(() => [
|
|
244
236
|
vue.createVNode(_component_q_item_section, null, {
|
|
245
237
|
default: vue.withCtx(() => [
|
|
246
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
238
|
+
vue.createElementVNode("div", _hoisted_1$s, [
|
|
247
239
|
vue.createVNode(_component_q_icon, {
|
|
248
240
|
name: item.icon,
|
|
249
241
|
size: "sm"
|
|
@@ -262,8 +254,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
262
254
|
? (vue.openBlock(), vue.createBlock(_component_qas_delete, vue.mergeProps({ key: 0 }, $props.deleteProps, {
|
|
263
255
|
class: "text-negative",
|
|
264
256
|
clickable: "",
|
|
265
|
-
tag: "q-item"
|
|
266
|
-
onSuccess: $options.onDeleteSuccess
|
|
257
|
+
tag: "q-item"
|
|
267
258
|
}), {
|
|
268
259
|
default: vue.withCtx(() => [
|
|
269
260
|
vue.createVNode(_component_q_item_section, null, {
|
|
@@ -280,7 +271,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
280
271
|
})
|
|
281
272
|
]),
|
|
282
273
|
_: 1 /* STABLE */
|
|
283
|
-
}, 16 /* FULL_PROPS
|
|
274
|
+
}, 16 /* FULL_PROPS */))
|
|
284
275
|
: vue.createCommentVNode("v-if", true)
|
|
285
276
|
]),
|
|
286
277
|
_: 3 /* FORWARDED */
|
|
@@ -484,6 +475,41 @@ function getGreatestCommonDivisor (first, second) {
|
|
|
484
475
|
return first
|
|
485
476
|
}
|
|
486
477
|
|
|
478
|
+
function camelizeFieldsName (fields) {
|
|
479
|
+
for (const field in fields) {
|
|
480
|
+
const currentField = fields[field];
|
|
481
|
+
|
|
482
|
+
currentField.name = humps.camelize(currentField.name);
|
|
483
|
+
|
|
484
|
+
if (Object.keys(currentField.children || {}).length) {
|
|
485
|
+
camelizeFieldsName(currentField.children);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
return fields
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* param {options: object[], label: string, value: string} object
|
|
494
|
+
*
|
|
495
|
+
* @example getNormalizedOptions({
|
|
496
|
+
* options: [{ name: 'Test 1', uuid: '1' }, { name: 'Test 2', uuid: '2' }],
|
|
497
|
+
* label: 'name'
|
|
498
|
+
* value: 'uuid'
|
|
499
|
+
* }) // retorna [{ label: 'Test 1', value: '1' }, { label: 'Test 2', value: '2' }]
|
|
500
|
+
*/
|
|
501
|
+
var getNormalizedOptions = ({ options = [], label, value }) => {
|
|
502
|
+
return options.map(option => {
|
|
503
|
+
const { [label]: labelKey, [value]: valueKey, ...payload } = option;
|
|
504
|
+
|
|
505
|
+
return {
|
|
506
|
+
label: option[label],
|
|
507
|
+
value: option[value],
|
|
508
|
+
...payload
|
|
509
|
+
}
|
|
510
|
+
})
|
|
511
|
+
};
|
|
512
|
+
|
|
487
513
|
// Private
|
|
488
514
|
function __format (value, token, options = {}) {
|
|
489
515
|
if (!value) {
|
|
@@ -581,6 +607,8 @@ function humanize (field = {}, value) {
|
|
|
581
607
|
case 'time': return time(value)
|
|
582
608
|
case 'radio': return selectLabel(field.options, value)
|
|
583
609
|
case 'percent': return formatPercent(value)
|
|
610
|
+
case 'money': return money(value)
|
|
611
|
+
case 'decimal': return decimal(value)
|
|
584
612
|
default: return value
|
|
585
613
|
}
|
|
586
614
|
}
|
|
@@ -734,7 +762,7 @@ var script$H = {
|
|
|
734
762
|
}
|
|
735
763
|
};
|
|
736
764
|
|
|
737
|
-
const _hoisted_1$
|
|
765
|
+
const _hoisted_1$r = { class: "q-gutter-md q-mr-lg" };
|
|
738
766
|
const _hoisted_2$j = {
|
|
739
767
|
key: 0,
|
|
740
768
|
class: "text-bold text-h5"
|
|
@@ -758,7 +786,7 @@ function render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
758
786
|
rounded: "",
|
|
759
787
|
onClick: $options.close
|
|
760
788
|
}, null, 8 /* PROPS */, ["color", "onClick"]),
|
|
761
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
789
|
+
vue.createElementVNode("div", _hoisted_1$r, [
|
|
762
790
|
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
763
791
|
($props.title)
|
|
764
792
|
? (vue.openBlock(), vue.createElementBlock("h5", _hoisted_2$j, vue.toDisplayString($props.title), 1 /* TEXT */))
|
|
@@ -825,20 +853,16 @@ var script$G = {
|
|
|
825
853
|
}
|
|
826
854
|
|
|
827
855
|
const contrastColor = this.color ? this.color : this.contrastColor;
|
|
828
|
-
// const contrastColor = this.textColor ? this.textColor : this.contrastColor
|
|
829
856
|
|
|
830
857
|
return [
|
|
831
858
|
this.dark
|
|
832
859
|
? `bg-${this.textColor} text-${contrastColor}`
|
|
833
860
|
: `bg-${contrastColor} text-${this.textColor}`
|
|
834
|
-
// ? `bg-${this.color} text-${contrastColor}`
|
|
835
|
-
// : `bg-${contrastColor} text-${this.color}`
|
|
836
861
|
]
|
|
837
862
|
},
|
|
838
863
|
|
|
839
864
|
contrastColor () {
|
|
840
865
|
return `${this.textColor}-contrast`
|
|
841
|
-
// return `${this.color}-contrast`
|
|
842
866
|
},
|
|
843
867
|
|
|
844
868
|
firstLetter () {
|
|
@@ -917,10 +941,6 @@ var script$F = {
|
|
|
917
941
|
type: String
|
|
918
942
|
},
|
|
919
943
|
|
|
920
|
-
isAuth: {
|
|
921
|
-
type: Boolean
|
|
922
|
-
},
|
|
923
|
-
|
|
924
944
|
title: {
|
|
925
945
|
type: String,
|
|
926
946
|
default: ''
|
|
@@ -975,6 +995,14 @@ var script$F = {
|
|
|
975
995
|
|
|
976
996
|
showTitle () {
|
|
977
997
|
return this.title && !this.brand
|
|
998
|
+
},
|
|
999
|
+
|
|
1000
|
+
hasUser () {
|
|
1001
|
+
return !!Object.keys(this.user).length
|
|
1002
|
+
},
|
|
1003
|
+
|
|
1004
|
+
userName () {
|
|
1005
|
+
return this.user.name || this.user.givenName
|
|
978
1006
|
}
|
|
979
1007
|
},
|
|
980
1008
|
|
|
@@ -997,7 +1025,7 @@ var script$F = {
|
|
|
997
1025
|
}
|
|
998
1026
|
};
|
|
999
1027
|
|
|
1000
|
-
const _hoisted_1$
|
|
1028
|
+
const _hoisted_1$q = ["alt", "src"];
|
|
1001
1029
|
const _hoisted_2$i = {
|
|
1002
1030
|
key: 1,
|
|
1003
1031
|
class: "text-bold text-grey-9 text-subtitle1 text-uppercase"
|
|
@@ -1020,11 +1048,10 @@ const _hoisted_14$1 = { class: "q-mt-sm" };
|
|
|
1020
1048
|
|
|
1021
1049
|
function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1022
1050
|
const _component_q_ajax_bar = vue.resolveComponent("q-ajax-bar");
|
|
1023
|
-
const
|
|
1051
|
+
const _component_qas_btn = vue.resolveComponent("qas-btn");
|
|
1024
1052
|
const _component_q_badge = vue.resolveComponent("q-badge");
|
|
1025
1053
|
const _component_q_toolbar_title = vue.resolveComponent("q-toolbar-title");
|
|
1026
1054
|
const _component_qas_avatar = vue.resolveComponent("qas-avatar");
|
|
1027
|
-
const _component_qas_btn = vue.resolveComponent("qas-btn");
|
|
1028
1055
|
const _component_q_menu = vue.resolveComponent("q-menu");
|
|
1029
1056
|
const _component_q_toolbar = vue.resolveComponent("q-toolbar");
|
|
1030
1057
|
const _component_q_header = vue.resolveComponent("q-header");
|
|
@@ -1045,7 +1072,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1045
1072
|
position: "top",
|
|
1046
1073
|
size: "2px"
|
|
1047
1074
|
}),
|
|
1048
|
-
vue.createVNode(
|
|
1075
|
+
vue.createVNode(_component_qas_btn, {
|
|
1049
1076
|
color: "grey-7",
|
|
1050
1077
|
dense: "",
|
|
1051
1078
|
flat: "",
|
|
@@ -1065,7 +1092,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1065
1092
|
alt: $props.title,
|
|
1066
1093
|
class: "q-mr-sm qas-app-bar__brand",
|
|
1067
1094
|
src: $props.brand
|
|
1068
|
-
}, null, 8 /* PROPS */, _hoisted_1$
|
|
1095
|
+
}, null, 8 /* PROPS */, _hoisted_1$q))
|
|
1069
1096
|
: vue.createCommentVNode("v-if", true),
|
|
1070
1097
|
($options.showTitle)
|
|
1071
1098
|
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$i, vue.toDisplayString($props.title), 1 /* TEXT */))
|
|
@@ -1085,7 +1112,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1085
1112
|
}),
|
|
1086
1113
|
($options.hasNotifications)
|
|
1087
1114
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$e, [
|
|
1088
|
-
vue.createVNode(
|
|
1115
|
+
vue.createVNode(_component_qas_btn, {
|
|
1089
1116
|
class: "q-mr-md",
|
|
1090
1117
|
dense: "",
|
|
1091
1118
|
icon: "o_notifications",
|
|
@@ -1112,11 +1139,11 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1112
1139
|
: vue.createCommentVNode("v-if", true),
|
|
1113
1140
|
vue.createElementVNode("div", _hoisted_4$a, [
|
|
1114
1141
|
vue.renderSlot(_ctx.$slots, "tools"),
|
|
1115
|
-
($
|
|
1142
|
+
($options.hasUser)
|
|
1116
1143
|
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1117
1144
|
key: 0,
|
|
1118
1145
|
class: "cursor-pointer items-center q-mr-sm qas-app-bar__user rounded-borders row text-grey-9",
|
|
1119
|
-
title: $
|
|
1146
|
+
title: $options.userName
|
|
1120
1147
|
}, [
|
|
1121
1148
|
vue.createVNode(_component_qas_avatar, {
|
|
1122
1149
|
class: "rounded-borders-left",
|
|
@@ -1126,10 +1153,10 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1126
1153
|
rounded: "",
|
|
1127
1154
|
size: "42px",
|
|
1128
1155
|
"text-color": "primary",
|
|
1129
|
-
title: $
|
|
1156
|
+
title: $options.userName
|
|
1130
1157
|
}, null, 8 /* PROPS */, ["image", "title"]),
|
|
1131
1158
|
vue.createElementVNode("div", _hoisted_6$4, [
|
|
1132
|
-
vue.createElementVNode("div", _hoisted_7$4, vue.toDisplayString($
|
|
1159
|
+
vue.createElementVNode("div", _hoisted_7$4, vue.toDisplayString($options.userName), 1 /* TEXT */),
|
|
1133
1160
|
vue.createElementVNode("div", _hoisted_8$3, vue.toDisplayString($props.user.email), 1 /* TEXT */)
|
|
1134
1161
|
]),
|
|
1135
1162
|
vue.createVNode(_component_q_menu, {
|
|
@@ -1149,10 +1176,10 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1149
1176
|
vue.createVNode(_component_qas_avatar, {
|
|
1150
1177
|
image: $props.user.photo,
|
|
1151
1178
|
size: "145px",
|
|
1152
|
-
title: $
|
|
1179
|
+
title: $options.userName
|
|
1153
1180
|
}, null, 8 /* PROPS */, ["image", "title"])
|
|
1154
1181
|
]),
|
|
1155
|
-
vue.createElementVNode("div", _hoisted_11$1, vue.toDisplayString($
|
|
1182
|
+
vue.createElementVNode("div", _hoisted_11$1, vue.toDisplayString($options.userName), 1 /* TEXT */),
|
|
1156
1183
|
vue.createElementVNode("div", _hoisted_12$1, vue.toDisplayString($props.user.email), 1 /* TEXT */),
|
|
1157
1184
|
vue.createElementVNode("div", _hoisted_13$1, [
|
|
1158
1185
|
vue.createVNode(_component_qas_btn, {
|
|
@@ -1331,7 +1358,7 @@ var script$E = {
|
|
|
1331
1358
|
}
|
|
1332
1359
|
};
|
|
1333
1360
|
|
|
1334
|
-
const _hoisted_1$
|
|
1361
|
+
const _hoisted_1$p = { class: "column flex full-height justify-between no-wrap overflow-x-hidden" };
|
|
1335
1362
|
const _hoisted_2$h = {
|
|
1336
1363
|
key: 0,
|
|
1337
1364
|
class: "q-ma-md"
|
|
@@ -1364,7 +1391,7 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1364
1391
|
onMiniState: $options.setMiniState
|
|
1365
1392
|
}, {
|
|
1366
1393
|
default: vue.withCtx(() => [
|
|
1367
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
1394
|
+
vue.createElementVNode("div", _hoisted_1$p, [
|
|
1368
1395
|
vue.createElementVNode("div", null, [
|
|
1369
1396
|
($options.displayModuleSection)
|
|
1370
1397
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$h, [
|
|
@@ -1541,15 +1568,11 @@ var script$C = {
|
|
|
1541
1568
|
name: 'QasCard',
|
|
1542
1569
|
|
|
1543
1570
|
props: {
|
|
1544
|
-
|
|
1571
|
+
imagePosition: {
|
|
1545
1572
|
type: String,
|
|
1546
1573
|
default: 'center'
|
|
1547
1574
|
},
|
|
1548
1575
|
|
|
1549
|
-
formMode: {
|
|
1550
|
-
type: Boolean
|
|
1551
|
-
},
|
|
1552
|
-
|
|
1553
1576
|
gutter: {
|
|
1554
1577
|
type: String,
|
|
1555
1578
|
default: 'sm'
|
|
@@ -1560,6 +1583,14 @@ var script$C = {
|
|
|
1560
1583
|
type: Array
|
|
1561
1584
|
},
|
|
1562
1585
|
|
|
1586
|
+
outlined: {
|
|
1587
|
+
type: Boolean
|
|
1588
|
+
},
|
|
1589
|
+
|
|
1590
|
+
unelevated: {
|
|
1591
|
+
type: Boolean
|
|
1592
|
+
},
|
|
1593
|
+
|
|
1563
1594
|
useHeader: {
|
|
1564
1595
|
type: Boolean
|
|
1565
1596
|
}
|
|
@@ -1572,12 +1603,17 @@ var script$C = {
|
|
|
1572
1603
|
},
|
|
1573
1604
|
|
|
1574
1605
|
computed: {
|
|
1575
|
-
|
|
1576
|
-
return `bg-position-${this.
|
|
1606
|
+
imagePositionClass () {
|
|
1607
|
+
return `bg-position-${this.imagePosition}`
|
|
1577
1608
|
},
|
|
1578
1609
|
|
|
1579
1610
|
cardClasses () {
|
|
1580
|
-
return
|
|
1611
|
+
return {
|
|
1612
|
+
'shadow-14': !this.unelevated,
|
|
1613
|
+
'border-primary': this.outlined,
|
|
1614
|
+
'no-shadow': this.outlined,
|
|
1615
|
+
'bg-white': this.outlined
|
|
1616
|
+
}
|
|
1581
1617
|
},
|
|
1582
1618
|
|
|
1583
1619
|
gutterClass () {
|
|
@@ -1608,7 +1644,7 @@ var script$C = {
|
|
|
1608
1644
|
}
|
|
1609
1645
|
};
|
|
1610
1646
|
|
|
1611
|
-
const _hoisted_1$
|
|
1647
|
+
const _hoisted_1$o = { class: "col-12 col-lg-3 col-md-4 col-sm-6" };
|
|
1612
1648
|
const _hoisted_2$g = {
|
|
1613
1649
|
key: 0,
|
|
1614
1650
|
class: "overflow-hidden relative-position w-full"
|
|
@@ -1626,7 +1662,7 @@ function render$C(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1626
1662
|
const _component_q_card_section = vue.resolveComponent("q-card-section");
|
|
1627
1663
|
const _component_q_card = vue.resolveComponent("q-card");
|
|
1628
1664
|
|
|
1629
|
-
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1665
|
+
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
|
|
1630
1666
|
vue.createVNode(_component_q_card, {
|
|
1631
1667
|
class: vue.normalizeClass(["border-radius-lg column full-height overflow-hidden", $options.cardClasses])
|
|
1632
1668
|
}, {
|
|
@@ -1660,7 +1696,7 @@ function render$C(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1660
1696
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.imagesList, (item, index) => {
|
|
1661
1697
|
return (vue.openBlock(), vue.createBlock(_component_q_carousel_slide, {
|
|
1662
1698
|
key: index,
|
|
1663
|
-
class: vue.normalizeClass(["bg-no-repeat", $options.
|
|
1699
|
+
class: vue.normalizeClass(["bg-no-repeat", $options.imagePositionClass]),
|
|
1664
1700
|
"img-src": item,
|
|
1665
1701
|
name: index
|
|
1666
1702
|
}, null, 8 /* PROPS */, ["class", "img-src", "name"]))
|
|
@@ -1889,7 +1925,7 @@ var script$A = {
|
|
|
1889
1925
|
}
|
|
1890
1926
|
};
|
|
1891
1927
|
|
|
1892
|
-
const _hoisted_1$
|
|
1928
|
+
const _hoisted_1$n = /*#__PURE__*/vue.createTextVNode("Copiar");
|
|
1893
1929
|
|
|
1894
1930
|
function render$A(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1895
1931
|
const _component_q_tooltip = vue.resolveComponent("q-tooltip");
|
|
@@ -1912,7 +1948,7 @@ function render$A(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1912
1948
|
default: vue.withCtx(() => [
|
|
1913
1949
|
vue.createVNode(_component_q_tooltip, null, {
|
|
1914
1950
|
default: vue.withCtx(() => [
|
|
1915
|
-
_hoisted_1$
|
|
1951
|
+
_hoisted_1$n
|
|
1916
1952
|
]),
|
|
1917
1953
|
_: 1 /* STABLE */
|
|
1918
1954
|
})
|
|
@@ -1936,33 +1972,33 @@ var script$z = {
|
|
|
1936
1972
|
type: String
|
|
1937
1973
|
},
|
|
1938
1974
|
|
|
1939
|
-
dateOnly: {
|
|
1940
|
-
type: Boolean
|
|
1941
|
-
},
|
|
1942
|
-
|
|
1943
1975
|
dateProps: {
|
|
1944
1976
|
default: () => ({}),
|
|
1945
1977
|
type: Object
|
|
1946
1978
|
},
|
|
1947
1979
|
|
|
1948
|
-
gmt: {
|
|
1949
|
-
type: Boolean
|
|
1950
|
-
},
|
|
1951
|
-
|
|
1952
1980
|
timeMask: {
|
|
1953
1981
|
default: 'HH:mm',
|
|
1954
1982
|
type: String
|
|
1955
1983
|
},
|
|
1956
1984
|
|
|
1957
|
-
timeOnly: {
|
|
1958
|
-
type: Boolean
|
|
1959
|
-
},
|
|
1960
|
-
|
|
1961
1985
|
timeProps: {
|
|
1962
1986
|
default: () => ({}),
|
|
1963
1987
|
type: Object
|
|
1964
1988
|
},
|
|
1965
1989
|
|
|
1990
|
+
useIso: {
|
|
1991
|
+
type: Boolean
|
|
1992
|
+
},
|
|
1993
|
+
|
|
1994
|
+
useTimeOnly: {
|
|
1995
|
+
type: Boolean
|
|
1996
|
+
},
|
|
1997
|
+
|
|
1998
|
+
useDateOnly: {
|
|
1999
|
+
type: Boolean
|
|
2000
|
+
},
|
|
2001
|
+
|
|
1966
2002
|
modelValue: {
|
|
1967
2003
|
default: '',
|
|
1968
2004
|
type: String
|
|
@@ -1999,16 +2035,16 @@ var script$z = {
|
|
|
1999
2035
|
maskDate () {
|
|
2000
2036
|
const mask = [];
|
|
2001
2037
|
|
|
2002
|
-
if (!this.
|
|
2003
|
-
if (!this.
|
|
2038
|
+
if (!this.useTimeOnly) { mask.push(this.dateMask); }
|
|
2039
|
+
if (!this.useDateOnly) { mask.push(this.timeMask); }
|
|
2004
2040
|
|
|
2005
2041
|
return mask.join(' ')
|
|
2006
2042
|
}
|
|
2007
2043
|
},
|
|
2008
2044
|
|
|
2009
2045
|
watch: {
|
|
2010
|
-
|
|
2011
|
-
if (!current || this.
|
|
2046
|
+
modelValue (current, original) {
|
|
2047
|
+
if (!current || this.useTimeOnly) {
|
|
2012
2048
|
this.currentValue = current;
|
|
2013
2049
|
return
|
|
2014
2050
|
}
|
|
@@ -2034,18 +2070,18 @@ var script$z = {
|
|
|
2034
2070
|
|
|
2035
2071
|
updateModelValue (value) {
|
|
2036
2072
|
this.currentValue = value;
|
|
2037
|
-
const valueLength = value
|
|
2073
|
+
const valueLength = value?.replace?.(/_/g, '')?.length;
|
|
2038
2074
|
|
|
2039
2075
|
if (value === '' || valueLength === this.mask.length) {
|
|
2040
|
-
this.lastValue = this.
|
|
2076
|
+
this.lastValue = this.useTimeOnly ? value : this.toISOString(value);
|
|
2041
2077
|
this.$emit('update:modelValue', this.lastValue);
|
|
2042
2078
|
}
|
|
2043
2079
|
|
|
2044
|
-
if (this.
|
|
2080
|
+
if (this.useDateOnly) {
|
|
2045
2081
|
this.$refs.dateProxy.hide();
|
|
2046
2082
|
}
|
|
2047
2083
|
|
|
2048
|
-
if (this.
|
|
2084
|
+
if (this.useTimeOnly) {
|
|
2049
2085
|
this.$refs.timeProxy.hide();
|
|
2050
2086
|
}
|
|
2051
2087
|
},
|
|
@@ -2055,11 +2091,11 @@ var script$z = {
|
|
|
2055
2091
|
return ''
|
|
2056
2092
|
}
|
|
2057
2093
|
|
|
2058
|
-
if (this.
|
|
2094
|
+
if (this.useDateOnly && !this.useIso) {
|
|
2059
2095
|
return date(quasar.date.extractDate(value, this.maskDate), 'yyyy-MM-dd')
|
|
2060
2096
|
}
|
|
2061
2097
|
|
|
2062
|
-
if (this.
|
|
2098
|
+
if (this.useTimeOnly && !this.useIso) {
|
|
2063
2099
|
return quasar.date.extractDate(value, 'HH:MM')
|
|
2064
2100
|
}
|
|
2065
2101
|
|
|
@@ -2067,14 +2103,14 @@ var script$z = {
|
|
|
2067
2103
|
},
|
|
2068
2104
|
|
|
2069
2105
|
toMask (value) {
|
|
2070
|
-
if (!value || this.
|
|
2106
|
+
if (!value || this.useTimeOnly) {
|
|
2071
2107
|
return value || ''
|
|
2072
2108
|
}
|
|
2073
2109
|
|
|
2074
2110
|
const newDate = new Date(value).toISOString();
|
|
2075
2111
|
|
|
2076
2112
|
return quasar.date.formatDate(
|
|
2077
|
-
this.
|
|
2113
|
+
this.useDateOnly ? newDate.slice(0, 23) : newDate,
|
|
2078
2114
|
this.maskDate
|
|
2079
2115
|
)
|
|
2080
2116
|
}
|
|
@@ -2088,75 +2124,73 @@ function render$z(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2088
2124
|
const _component_q_time = vue.resolveComponent("q-time");
|
|
2089
2125
|
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
2090
2126
|
|
|
2091
|
-
return (vue.openBlock(), vue.
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
(
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
(
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
}, 16 /* FULL_PROPS */, ["modelValue", "onUpdate:modelValue"])
|
|
2159
|
-
]))
|
|
2127
|
+
return (vue.openBlock(), vue.createBlock(_component_qas_input, vue.mergeProps({ ref: "input" }, $options.attributes, {
|
|
2128
|
+
modelValue: $data.currentValue,
|
|
2129
|
+
"onUpdate:modelValue": [
|
|
2130
|
+
_cache[2] || (_cache[2] = $event => (($data.currentValue) = $event)),
|
|
2131
|
+
$options.updateModelValue
|
|
2132
|
+
],
|
|
2133
|
+
"unmasked-value": false
|
|
2134
|
+
}), {
|
|
2135
|
+
append: vue.withCtx(() => [
|
|
2136
|
+
(!$props.useTimeOnly)
|
|
2137
|
+
? (vue.openBlock(), vue.createBlock(_component_q_icon, {
|
|
2138
|
+
key: 0,
|
|
2139
|
+
class: "cursor-pointer",
|
|
2140
|
+
name: "o_event"
|
|
2141
|
+
}, {
|
|
2142
|
+
default: vue.withCtx(() => [
|
|
2143
|
+
vue.createVNode(_component_q_popup_proxy, {
|
|
2144
|
+
ref: "dateProxy",
|
|
2145
|
+
"transition-hide": "scale",
|
|
2146
|
+
"transition-show": "scale"
|
|
2147
|
+
}, {
|
|
2148
|
+
default: vue.withCtx(() => [
|
|
2149
|
+
vue.createVNode(_component_q_date, vue.mergeProps({
|
|
2150
|
+
modelValue: $data.currentValue,
|
|
2151
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.currentValue) = $event))
|
|
2152
|
+
}, $props.dateProps, {
|
|
2153
|
+
mask: $options.maskDate,
|
|
2154
|
+
"onUpdate:modelValue": $options.updateModelValue
|
|
2155
|
+
}), null, 16 /* FULL_PROPS */, ["modelValue", "mask", "onUpdate:modelValue"])
|
|
2156
|
+
]),
|
|
2157
|
+
_: 1 /* STABLE */
|
|
2158
|
+
}, 512 /* NEED_PATCH */)
|
|
2159
|
+
]),
|
|
2160
|
+
_: 1 /* STABLE */
|
|
2161
|
+
}))
|
|
2162
|
+
: vue.createCommentVNode("v-if", true),
|
|
2163
|
+
(!$props.useDateOnly)
|
|
2164
|
+
? (vue.openBlock(), vue.createBlock(_component_q_icon, {
|
|
2165
|
+
key: 1,
|
|
2166
|
+
class: "cursor-pointer q-ml-md",
|
|
2167
|
+
name: "o_access_time"
|
|
2168
|
+
}, {
|
|
2169
|
+
default: vue.withCtx(() => [
|
|
2170
|
+
vue.createVNode(_component_q_popup_proxy, {
|
|
2171
|
+
ref: "timeProxy",
|
|
2172
|
+
"transition-hide": "scale",
|
|
2173
|
+
"transition-show": "scale"
|
|
2174
|
+
}, {
|
|
2175
|
+
default: vue.withCtx(() => [
|
|
2176
|
+
vue.createVNode(_component_q_time, vue.mergeProps({
|
|
2177
|
+
modelValue: $data.currentValue,
|
|
2178
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.currentValue) = $event))
|
|
2179
|
+
}, $props.timeProps, {
|
|
2180
|
+
format24h: "",
|
|
2181
|
+
mask: $options.maskDate,
|
|
2182
|
+
"onUpdate:modelValue": $options.updateModelValue
|
|
2183
|
+
}), null, 16 /* FULL_PROPS */, ["modelValue", "mask", "onUpdate:modelValue"])
|
|
2184
|
+
]),
|
|
2185
|
+
_: 1 /* STABLE */
|
|
2186
|
+
}, 512 /* NEED_PATCH */)
|
|
2187
|
+
]),
|
|
2188
|
+
_: 1 /* STABLE */
|
|
2189
|
+
}))
|
|
2190
|
+
: vue.createCommentVNode("v-if", true)
|
|
2191
|
+
]),
|
|
2192
|
+
_: 1 /* STABLE */
|
|
2193
|
+
}, 16 /* FULL_PROPS */, ["modelValue", "onUpdate:modelValue"]))
|
|
2160
2194
|
}
|
|
2161
2195
|
|
|
2162
2196
|
script$z.render = render$z;
|
|
@@ -2174,12 +2208,12 @@ var script$y = {
|
|
|
2174
2208
|
}
|
|
2175
2209
|
};
|
|
2176
2210
|
|
|
2177
|
-
const _hoisted_1$
|
|
2211
|
+
const _hoisted_1$m = { class: "bg-grey-3 q-my-md q-pa-md rounded-borders" };
|
|
2178
2212
|
const _hoisted_2$f = /*#__PURE__*/vue.createElementVNode("summary", null, "Debugger", -1 /* HOISTED */);
|
|
2179
2213
|
const _hoisted_3$b = { class: "row" };
|
|
2180
2214
|
|
|
2181
2215
|
function render$y(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2182
|
-
return (vue.openBlock(), vue.createElementBlock("details", _hoisted_1$
|
|
2216
|
+
return (vue.openBlock(), vue.createElementBlock("details", _hoisted_1$m, [
|
|
2183
2217
|
_hoisted_2$f,
|
|
2184
2218
|
vue.createElementVNode("div", _hoisted_3$b, [
|
|
2185
2219
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.inspect, (item, index) => {
|
|
@@ -2257,7 +2291,11 @@ var script$x = {
|
|
|
2257
2291
|
type: Boolean
|
|
2258
2292
|
},
|
|
2259
2293
|
|
|
2260
|
-
|
|
2294
|
+
useCloseButton: {
|
|
2295
|
+
type: Boolean
|
|
2296
|
+
},
|
|
2297
|
+
|
|
2298
|
+
useValidationAllAtOnce: {
|
|
2261
2299
|
type: Boolean
|
|
2262
2300
|
}
|
|
2263
2301
|
},
|
|
@@ -2305,7 +2343,26 @@ var script$x = {
|
|
|
2305
2343
|
|
|
2306
2344
|
methods: {
|
|
2307
2345
|
async submitHandler () {
|
|
2308
|
-
|
|
2346
|
+
if (!this.useForm) return
|
|
2347
|
+
|
|
2348
|
+
if (this.useValidationAllAtOnce) {
|
|
2349
|
+
let isAllComponentValid = true;
|
|
2350
|
+
const components = this.$refs.form.getValidationComponents() || [];
|
|
2351
|
+
|
|
2352
|
+
for (const component of components) {
|
|
2353
|
+
const isValid = component?.validate?.();
|
|
2354
|
+
|
|
2355
|
+
if (!isValid) {
|
|
2356
|
+
isAllComponentValid = false;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
this.$emit('validate', isAllComponentValid);
|
|
2361
|
+
|
|
2362
|
+
return
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
this.$emit('validate', await this.$refs.form.validate());
|
|
2309
2366
|
},
|
|
2310
2367
|
|
|
2311
2368
|
// método para funcionar como plugin
|
|
@@ -2324,7 +2381,7 @@ var script$x = {
|
|
|
2324
2381
|
}
|
|
2325
2382
|
};
|
|
2326
2383
|
|
|
2327
|
-
const _hoisted_1$
|
|
2384
|
+
const _hoisted_1$l = { class: "justify-between row" };
|
|
2328
2385
|
const _hoisted_2$e = { class: "text-bold text-h6" };
|
|
2329
2386
|
const _hoisted_3$a = { key: 0 };
|
|
2330
2387
|
|
|
@@ -2349,9 +2406,9 @@ function render$x(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2349
2406
|
vue.createVNode(_component_q_card_section, null, {
|
|
2350
2407
|
default: vue.withCtx(() => [
|
|
2351
2408
|
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
2352
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
2409
|
+
vue.createElementVNode("div", _hoisted_1$l, [
|
|
2353
2410
|
vue.createElementVNode("div", _hoisted_2$e, vue.toDisplayString($props.card.title), 1 /* TEXT */),
|
|
2354
|
-
($props.
|
|
2411
|
+
($props.useCloseButton)
|
|
2355
2412
|
? vue.withDirectives((vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
2356
2413
|
key: 0,
|
|
2357
2414
|
dense: "",
|
|
@@ -2435,6 +2492,51 @@ var Dialog = (componentProps = {}) => {
|
|
|
2435
2492
|
});
|
|
2436
2493
|
};
|
|
2437
2494
|
|
|
2495
|
+
var Logger = () => {
|
|
2496
|
+
const isDebugEnabled = process.env.DEBUGGING;
|
|
2497
|
+
|
|
2498
|
+
const normalizeMessage = msg => `%c ${msg}`;
|
|
2499
|
+
const getStyle = isError => (
|
|
2500
|
+
`
|
|
2501
|
+
background: ${isError ? '#C10015 ' : '#1976d2'};
|
|
2502
|
+
font-weight: bold;
|
|
2503
|
+
color: white;
|
|
2504
|
+
padding: 6px 20px;
|
|
2505
|
+
border-radius: 4px;
|
|
2506
|
+
display: block;
|
|
2507
|
+
width: 100%;
|
|
2508
|
+
font-size: 12px;
|
|
2509
|
+
`
|
|
2510
|
+
);
|
|
2511
|
+
|
|
2512
|
+
return {
|
|
2513
|
+
group (message, payload = [], { error } = {}) {
|
|
2514
|
+
if (!isDebugEnabled) return
|
|
2515
|
+
|
|
2516
|
+
console.groupCollapsed(normalizeMessage(message), getStyle(error));
|
|
2517
|
+
|
|
2518
|
+
for (const item of payload) {
|
|
2519
|
+
if (typeof item === 'string') {
|
|
2520
|
+
console.info(normalizeMessage(item), getStyle(error));
|
|
2521
|
+
continue
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
console.table(item);
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
console.groupEnd();
|
|
2528
|
+
},
|
|
2529
|
+
|
|
2530
|
+
info (message) {
|
|
2531
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle());
|
|
2532
|
+
},
|
|
2533
|
+
|
|
2534
|
+
error (message) {
|
|
2535
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle(true));
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
};
|
|
2539
|
+
|
|
2438
2540
|
quasar.Notify.registerType('error', {
|
|
2439
2541
|
color: 'negative',
|
|
2440
2542
|
progress: true
|
|
@@ -2621,7 +2723,13 @@ var script$w = {
|
|
|
2621
2723
|
try {
|
|
2622
2724
|
const { destroyRoutes, history } = useHistory();
|
|
2623
2725
|
|
|
2624
|
-
|
|
2726
|
+
const payload = { id: this.id, url: this.url };
|
|
2727
|
+
|
|
2728
|
+
this.$qas.logger.group(
|
|
2729
|
+
`QasDelete - destroy -> Payload do parâmetro do ${this.entity}/destroy`, [payload]
|
|
2730
|
+
);
|
|
2731
|
+
|
|
2732
|
+
await this.$store.dispatch(`${this.entity}/destroy`, payload);
|
|
2625
2733
|
|
|
2626
2734
|
NotifySuccess('Item deletado com sucesso!');
|
|
2627
2735
|
|
|
@@ -2635,9 +2743,17 @@ var script$w = {
|
|
|
2635
2743
|
this.createDeleteSuccessEvent();
|
|
2636
2744
|
|
|
2637
2745
|
this.$emit('success');
|
|
2746
|
+
|
|
2747
|
+
this.$qas.logger.info('QasDelete - destroy -> item deletado com sucesso!');
|
|
2638
2748
|
} catch (error) {
|
|
2639
2749
|
NotifyError('Ops! Não foi possível deletar o item.');
|
|
2640
2750
|
this.$emit('error', error);
|
|
2751
|
+
|
|
2752
|
+
this.$qas.logger.group(
|
|
2753
|
+
`QasDelete - destroy -> exceção da action ${this.entity}/destroy`,
|
|
2754
|
+
[error],
|
|
2755
|
+
{ error: true }
|
|
2756
|
+
);
|
|
2641
2757
|
} finally {
|
|
2642
2758
|
quasar.Loading.hide();
|
|
2643
2759
|
this.$emit('update:deleting', false);
|
|
@@ -2779,8 +2895,8 @@ function render$v(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2779
2895
|
($data.component)
|
|
2780
2896
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($data.component), {
|
|
2781
2897
|
key: 0,
|
|
2782
|
-
dialog: "",
|
|
2783
2898
|
route: $data.route,
|
|
2899
|
+
"use-boundary": false,
|
|
2784
2900
|
onHide: $options.hide
|
|
2785
2901
|
}, null, 8 /* PROPS */, ["route", "onHide"]))
|
|
2786
2902
|
: vue.createCommentVNode("v-if", true)
|
|
@@ -2804,32 +2920,32 @@ var script$u = {
|
|
|
2804
2920
|
inheritAttrs: false,
|
|
2805
2921
|
|
|
2806
2922
|
props: {
|
|
2923
|
+
error: {
|
|
2924
|
+
type: Boolean
|
|
2925
|
+
},
|
|
2926
|
+
|
|
2927
|
+
errorMessage: {
|
|
2928
|
+
type: String,
|
|
2929
|
+
default: ''
|
|
2930
|
+
},
|
|
2931
|
+
|
|
2807
2932
|
modelValue: {
|
|
2808
2933
|
default: '',
|
|
2809
2934
|
type: [String, Number]
|
|
2810
2935
|
},
|
|
2811
2936
|
|
|
2812
|
-
unmaskedValue: {
|
|
2813
|
-
default: true,
|
|
2814
|
-
type: Boolean
|
|
2815
|
-
},
|
|
2816
|
-
|
|
2817
2937
|
outlined: {
|
|
2818
2938
|
default: true,
|
|
2819
2939
|
type: Boolean
|
|
2820
2940
|
},
|
|
2821
2941
|
|
|
2822
|
-
|
|
2942
|
+
unmaskedValue: {
|
|
2943
|
+
default: true,
|
|
2823
2944
|
type: Boolean
|
|
2824
2945
|
},
|
|
2825
2946
|
|
|
2826
|
-
|
|
2947
|
+
useRemoveErrorOnType: {
|
|
2827
2948
|
type: Boolean
|
|
2828
|
-
},
|
|
2829
|
-
|
|
2830
|
-
errorMessage: {
|
|
2831
|
-
type: String,
|
|
2832
|
-
default: ''
|
|
2833
2949
|
}
|
|
2834
2950
|
},
|
|
2835
2951
|
|
|
@@ -2874,7 +2990,7 @@ var script$u = {
|
|
|
2874
2990
|
},
|
|
2875
2991
|
|
|
2876
2992
|
set (value) {
|
|
2877
|
-
if (this.
|
|
2993
|
+
if (this.useRemoveErrorOnType && this.error) {
|
|
2878
2994
|
this.errorData = false;
|
|
2879
2995
|
this.errorMessageData = '';
|
|
2880
2996
|
}
|
|
@@ -2886,7 +3002,7 @@ var script$u = {
|
|
|
2886
3002
|
|
|
2887
3003
|
watch: {
|
|
2888
3004
|
mask () {
|
|
2889
|
-
const input = this.
|
|
3005
|
+
const input = this.getInput();
|
|
2890
3006
|
|
|
2891
3007
|
requestAnimationFrame(() => {
|
|
2892
3008
|
input.selectionStart = input.value ? input.value.length : '';
|
|
@@ -2920,12 +3036,30 @@ var script$u = {
|
|
|
2920
3036
|
},
|
|
2921
3037
|
|
|
2922
3038
|
toggleMask (first, second) {
|
|
3039
|
+
if (!this.modelValue?.length) return
|
|
3040
|
+
|
|
2923
3041
|
const length = first.split('#').length - 2;
|
|
2924
3042
|
return this.modelValue?.length > length ? second : first
|
|
2925
3043
|
},
|
|
2926
3044
|
|
|
2927
3045
|
validate (value) {
|
|
2928
3046
|
return this.inputReference.validate(value)
|
|
3047
|
+
},
|
|
3048
|
+
|
|
3049
|
+
onPaste (event) {
|
|
3050
|
+
if (!this.mask) return
|
|
3051
|
+
|
|
3052
|
+
const value = event.clipboardData.getData('text');
|
|
3053
|
+
const input = this.getInput();
|
|
3054
|
+
|
|
3055
|
+
requestAnimationFrame(() => {
|
|
3056
|
+
this.$emit('update:modelValue', value);
|
|
3057
|
+
input.selectionStart = input.value ? input.value.length : '';
|
|
3058
|
+
});
|
|
3059
|
+
},
|
|
3060
|
+
|
|
3061
|
+
getInput () {
|
|
3062
|
+
return this.inputReference.$el?.querySelector('input')
|
|
2929
3063
|
}
|
|
2930
3064
|
}
|
|
2931
3065
|
};
|
|
@@ -2933,29 +3067,28 @@ var script$u = {
|
|
|
2933
3067
|
function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2934
3068
|
const _component_q_input = vue.resolveComponent("q-input");
|
|
2935
3069
|
|
|
2936
|
-
return (vue.openBlock(), vue.
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
]))
|
|
3070
|
+
return (vue.openBlock(), vue.createBlock(_component_q_input, vue.mergeProps({
|
|
3071
|
+
ref: "input",
|
|
3072
|
+
modelValue: $options.model,
|
|
3073
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
|
|
3074
|
+
"bottom-slots": "",
|
|
3075
|
+
error: $data.errorData
|
|
3076
|
+
}, _ctx.$attrs, {
|
|
3077
|
+
"error-message": _ctx.errorMessageData,
|
|
3078
|
+
mask: $options.mask,
|
|
3079
|
+
outlined: $props.outlined,
|
|
3080
|
+
"unmasked-value": $props.unmaskedValue,
|
|
3081
|
+
onPaste: $options.onPaste
|
|
3082
|
+
}), vue.createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
3083
|
+
vue.renderList(_ctx.$slots, (_, name) => {
|
|
3084
|
+
return {
|
|
3085
|
+
name: name,
|
|
3086
|
+
fn: vue.withCtx((context) => [
|
|
3087
|
+
vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(context || {})))
|
|
3088
|
+
])
|
|
3089
|
+
}
|
|
3090
|
+
})
|
|
3091
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "error", "error-message", "mask", "outlined", "unmasked-value", "onPaste"]))
|
|
2959
3092
|
}
|
|
2960
3093
|
|
|
2961
3094
|
script$u.render = render$u;
|
|
@@ -2972,17 +3105,7 @@ var script$t = {
|
|
|
2972
3105
|
name: 'QasNumericInput',
|
|
2973
3106
|
|
|
2974
3107
|
props: {
|
|
2975
|
-
|
|
2976
|
-
default: true,
|
|
2977
|
-
type: Boolean
|
|
2978
|
-
},
|
|
2979
|
-
|
|
2980
|
-
allowPositive: {
|
|
2981
|
-
default: true,
|
|
2982
|
-
type: Boolean
|
|
2983
|
-
},
|
|
2984
|
-
|
|
2985
|
-
autonumericProps: {
|
|
3108
|
+
autonumericOptions: {
|
|
2986
3109
|
default: () => ({}),
|
|
2987
3110
|
type: Object
|
|
2988
3111
|
},
|
|
@@ -3014,6 +3137,16 @@ var script$t = {
|
|
|
3014
3137
|
preset: {
|
|
3015
3138
|
default: false,
|
|
3016
3139
|
type: [Boolean, String]
|
|
3140
|
+
},
|
|
3141
|
+
|
|
3142
|
+
useNegative: {
|
|
3143
|
+
default: true,
|
|
3144
|
+
type: Boolean
|
|
3145
|
+
},
|
|
3146
|
+
|
|
3147
|
+
usePositive: {
|
|
3148
|
+
default: true,
|
|
3149
|
+
type: Boolean
|
|
3017
3150
|
}
|
|
3018
3151
|
},
|
|
3019
3152
|
|
|
@@ -3057,11 +3190,11 @@ var script$t = {
|
|
|
3057
3190
|
Object.assign(options, autoNumericPredefinedOptions[value]);
|
|
3058
3191
|
}
|
|
3059
3192
|
|
|
3060
|
-
if (!this.
|
|
3193
|
+
if (!this.useNegative) {
|
|
3061
3194
|
options.minimumValue = 0;
|
|
3062
3195
|
}
|
|
3063
3196
|
|
|
3064
|
-
if (!this.
|
|
3197
|
+
if (!this.usePositive) {
|
|
3065
3198
|
options.maximumValue = 0;
|
|
3066
3199
|
}
|
|
3067
3200
|
|
|
@@ -3069,7 +3202,7 @@ var script$t = {
|
|
|
3069
3202
|
options.decimalPlaces = this.decimalPlaces;
|
|
3070
3203
|
}
|
|
3071
3204
|
|
|
3072
|
-
Object.assign(options, this.
|
|
3205
|
+
Object.assign(options, this.autonumericOptions);
|
|
3073
3206
|
|
|
3074
3207
|
this.$nextTick(() => {
|
|
3075
3208
|
this.autoNumeric = new AutoNumeric__default["default"](this.$refs.input, options);
|
|
@@ -3099,7 +3232,7 @@ var script$t = {
|
|
|
3099
3232
|
}
|
|
3100
3233
|
};
|
|
3101
3234
|
|
|
3102
|
-
const _hoisted_1$
|
|
3235
|
+
const _hoisted_1$k = ["id"];
|
|
3103
3236
|
|
|
3104
3237
|
function render$t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3105
3238
|
const _component_q_field = vue.resolveComponent("q-field");
|
|
@@ -3116,7 +3249,7 @@ function render$t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3116
3249
|
onBlur: _cache[0] || (_cache[0] = (...args) => ($options.emitValue && $options.emitValue(...args))),
|
|
3117
3250
|
onClick: _cache[1] || (_cache[1] = (...args) => ($options.setSelect && $options.setSelect(...args))),
|
|
3118
3251
|
onInput: _cache[2] || (_cache[2] = $event => ($options.emitUpdateModel($event.target.value)))
|
|
3119
|
-
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$
|
|
3252
|
+
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$k), [
|
|
3120
3253
|
[vue.vShow, floatingLabel]
|
|
3121
3254
|
])
|
|
3122
3255
|
]),
|
|
@@ -3279,13 +3412,13 @@ var script$s = {
|
|
|
3279
3412
|
}
|
|
3280
3413
|
};
|
|
3281
3414
|
|
|
3282
|
-
const _hoisted_1$
|
|
3415
|
+
const _hoisted_1$j = { key: 0 };
|
|
3283
3416
|
|
|
3284
3417
|
function render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3285
3418
|
const _component_q_linear_progress = vue.resolveComponent("q-linear-progress");
|
|
3286
3419
|
|
|
3287
3420
|
return ($options.length)
|
|
3288
|
-
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3421
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
|
|
3289
3422
|
vue.renderSlot(_ctx.$slots, "default", { level: $options.level }, () => [
|
|
3290
3423
|
vue.createVNode(_component_q_linear_progress, {
|
|
3291
3424
|
color: $options.level.color,
|
|
@@ -3312,8 +3445,11 @@ var script$r = {
|
|
|
3312
3445
|
|
|
3313
3446
|
mixins: [passwordMixin],
|
|
3314
3447
|
|
|
3448
|
+
inheritAttrs: false,
|
|
3449
|
+
|
|
3315
3450
|
props: {
|
|
3316
|
-
|
|
3451
|
+
useStrengthChecker: {
|
|
3452
|
+
default: true,
|
|
3317
3453
|
type: Boolean
|
|
3318
3454
|
},
|
|
3319
3455
|
|
|
@@ -3373,44 +3509,41 @@ function render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3373
3509
|
const _component_qas_password_strength_checker = vue.resolveComponent("qas-password-strength-checker");
|
|
3374
3510
|
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
3375
3511
|
|
|
3376
|
-
return (vue.openBlock(), vue.
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3512
|
+
return (vue.openBlock(), vue.createBlock(_component_qas_input, vue.mergeProps({
|
|
3513
|
+
modelValue: $options.model,
|
|
3514
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
|
|
3515
|
+
"bottom-slots": false
|
|
3516
|
+
}, _ctx.$attrs, {
|
|
3517
|
+
type: $options.type,
|
|
3518
|
+
"use-remove-error-on-type": ""
|
|
3519
|
+
}), vue.createSlots({
|
|
3520
|
+
append: vue.withCtx(() => [
|
|
3521
|
+
vue.createVNode(_component_q_icon, {
|
|
3522
|
+
class: "cursor-pointer",
|
|
3523
|
+
color: $props.iconColor,
|
|
3524
|
+
name: $options.icon,
|
|
3525
|
+
onClick: $options.toggle
|
|
3526
|
+
}, null, 8 /* PROPS */, ["color", "name", "onClick"])
|
|
3527
|
+
]),
|
|
3528
|
+
_: 2 /* DYNAMIC */
|
|
3529
|
+
}, [
|
|
3530
|
+
vue.renderList(_ctx.$slots, (_, name) => {
|
|
3531
|
+
return {
|
|
3532
|
+
name: name,
|
|
3533
|
+
fn: vue.withCtx((context) => [
|
|
3534
|
+
vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(context || {})))
|
|
3535
|
+
])
|
|
3536
|
+
}
|
|
3537
|
+
}),
|
|
3538
|
+
($props.useStrengthChecker)
|
|
3539
|
+
? {
|
|
3540
|
+
name: "hint",
|
|
3541
|
+
fn: vue.withCtx(() => [
|
|
3542
|
+
vue.createVNode(_component_qas_password_strength_checker, vue.mergeProps($options.strengthCheckerProps, { password: $options.model }), null, 16 /* FULL_PROPS */, ["password"])
|
|
3401
3543
|
])
|
|
3402
3544
|
}
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
? {
|
|
3406
|
-
name: "hint",
|
|
3407
|
-
fn: vue.withCtx(() => [
|
|
3408
|
-
vue.createVNode(_component_qas_password_strength_checker, vue.mergeProps($options.strengthCheckerProps, { password: $options.model }), null, 16 /* FULL_PROPS */, ["password"])
|
|
3409
|
-
])
|
|
3410
|
-
}
|
|
3411
|
-
: undefined
|
|
3412
|
-
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "type"])
|
|
3413
|
-
]))
|
|
3545
|
+
: undefined
|
|
3546
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "type"]))
|
|
3414
3547
|
}
|
|
3415
3548
|
|
|
3416
3549
|
script$r.render = render$r;
|
|
@@ -3484,7 +3617,11 @@ var script$q = {
|
|
|
3484
3617
|
|
|
3485
3618
|
uploading: {
|
|
3486
3619
|
type: Boolean
|
|
3487
|
-
}
|
|
3620
|
+
},
|
|
3621
|
+
|
|
3622
|
+
useObjectModel: {
|
|
3623
|
+
type: Boolean
|
|
3624
|
+
}
|
|
3488
3625
|
},
|
|
3489
3626
|
|
|
3490
3627
|
emits: ['update:modelValue', 'update:uploading'],
|
|
@@ -3597,12 +3734,19 @@ var script$q = {
|
|
|
3597
3734
|
uploaded (response) {
|
|
3598
3735
|
const fullPath = response.xhr.responseURL.split('?').shift();
|
|
3599
3736
|
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3737
|
+
const objectValue = {
|
|
3738
|
+
format: response.files[0].type,
|
|
3739
|
+
url: fullPath,
|
|
3740
|
+
name: response.files[0].name
|
|
3741
|
+
};
|
|
3742
|
+
|
|
3743
|
+
const model = this.useObjectModel ? objectValue : fullPath;
|
|
3744
|
+
|
|
3745
|
+
this.$emit('update:modelValue', this.isMultiple ? [...this.modelValue, model] : model || '');
|
|
3604
3746
|
|
|
3605
3747
|
this.updateUploading(false);
|
|
3748
|
+
|
|
3749
|
+
this.$qas.logger.group('QasUploader - uploaded', [this.modelValue]);
|
|
3606
3750
|
},
|
|
3607
3751
|
|
|
3608
3752
|
async fetchCredentials (filename) {
|
|
@@ -3613,6 +3757,12 @@ var script$q = {
|
|
|
3613
3757
|
entity: this.entity,
|
|
3614
3758
|
filename
|
|
3615
3759
|
});
|
|
3760
|
+
|
|
3761
|
+
this.$qas.logger.group(
|
|
3762
|
+
'QasUploader - fetchCredentials -> resposta de /upload-credentials/',
|
|
3763
|
+
[data]
|
|
3764
|
+
);
|
|
3765
|
+
|
|
3616
3766
|
return data
|
|
3617
3767
|
} finally {
|
|
3618
3768
|
this.isFetching = false;
|
|
@@ -3631,8 +3781,16 @@ var script$q = {
|
|
|
3631
3781
|
}
|
|
3632
3782
|
|
|
3633
3783
|
const clonedValue = quasar.extend(true, [], this.modelValue);
|
|
3634
|
-
const numberIndex = this.modelValue.findIndex(file =>
|
|
3784
|
+
const numberIndex = this.modelValue.findIndex(file => {
|
|
3785
|
+
if (this.useObjectModel) {
|
|
3786
|
+
return file.uuid === index || file.url.includes(index)
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3789
|
+
return this.getFileName(file) === index
|
|
3790
|
+
});
|
|
3791
|
+
|
|
3635
3792
|
clonedValue.splice(numberIndex, 1);
|
|
3793
|
+
|
|
3636
3794
|
this.$emit('update:modelValue', clonedValue);
|
|
3637
3795
|
},
|
|
3638
3796
|
|
|
@@ -3641,12 +3799,10 @@ var script$q = {
|
|
|
3641
3799
|
},
|
|
3642
3800
|
|
|
3643
3801
|
getFilesList (uploadedFiles) {
|
|
3644
|
-
const pathsList = Array.isArray(this.modelValue) ? this.modelValue : (this.modelValue ? [this.modelValue] : []);
|
|
3645
|
-
|
|
3646
3802
|
uploadedFiles = uploadedFiles.map((file, indexToDelete) => {
|
|
3647
3803
|
return {
|
|
3648
3804
|
isUploaded: true,
|
|
3649
|
-
|
|
3805
|
+
url: file.xhr ? file.xhr.responseURL.split('?').shift() : '',
|
|
3650
3806
|
name: file.name,
|
|
3651
3807
|
progressLabel: file.__progressLabel,
|
|
3652
3808
|
sizeLabel: file.__sizeLabel,
|
|
@@ -3655,11 +3811,20 @@ var script$q = {
|
|
|
3655
3811
|
}
|
|
3656
3812
|
});
|
|
3657
3813
|
|
|
3814
|
+
const pathsList = Array.isArray(this.modelValue)
|
|
3815
|
+
? this.modelValue
|
|
3816
|
+
: (this.modelValue ? [this.modelValue] : []);
|
|
3817
|
+
|
|
3658
3818
|
const mergedList = [...pathsList, ...uploadedFiles];
|
|
3659
3819
|
|
|
3660
3820
|
const files = {};
|
|
3661
3821
|
|
|
3662
3822
|
mergedList.forEach(file => {
|
|
3823
|
+
if (this.useObjectModel && file.uuid) {
|
|
3824
|
+
files[file.uuid] = file;
|
|
3825
|
+
return
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3663
3828
|
if (file.isFailed) {
|
|
3664
3829
|
files[file.name] = file;
|
|
3665
3830
|
return
|
|
@@ -3667,16 +3832,18 @@ var script$q = {
|
|
|
3667
3832
|
|
|
3668
3833
|
if (typeof file === 'string') {
|
|
3669
3834
|
const fileName = this.getFileName(file);
|
|
3670
|
-
files[fileName] = {
|
|
3835
|
+
files[fileName] = { url: file, isUploaded: false, name: fileName };
|
|
3671
3836
|
return
|
|
3672
3837
|
}
|
|
3673
3838
|
|
|
3674
|
-
if (file.
|
|
3675
|
-
const fileName = this.getFileName(file.
|
|
3839
|
+
if (file.url) {
|
|
3840
|
+
const fileName = this.getFileName(file.url);
|
|
3676
3841
|
files[fileName] = file;
|
|
3677
3842
|
}
|
|
3678
3843
|
});
|
|
3679
3844
|
|
|
3845
|
+
this.$qas.logger.group('QasUploader - getFilesList', [files]);
|
|
3846
|
+
|
|
3680
3847
|
return files
|
|
3681
3848
|
},
|
|
3682
3849
|
|
|
@@ -3696,6 +3863,8 @@ var script$q = {
|
|
|
3696
3863
|
const filesList = Array.from(this.hiddenInputElement.files);
|
|
3697
3864
|
const processedFiles = [];
|
|
3698
3865
|
|
|
3866
|
+
this.$refs.hiddenInput.value = '';
|
|
3867
|
+
|
|
3699
3868
|
filesList.forEach(file => processedFiles.push(this.resizeImage(file)));
|
|
3700
3869
|
this.uploader.addFiles(await Promise.all(processedFiles));
|
|
3701
3870
|
},
|
|
@@ -3715,7 +3884,14 @@ var script$q = {
|
|
|
3715
3884
|
// Retorna largura e altura da original da imagem
|
|
3716
3885
|
const { width, height } = await getImageSize(image);
|
|
3717
3886
|
|
|
3718
|
-
if (width <= this.sizeLimit)
|
|
3887
|
+
if (width <= this.sizeLimit) {
|
|
3888
|
+
this.$qas.logger.info(`
|
|
3889
|
+
QasUploader - resizeImage -> Tamanho da imagem menor que o tamanho limite,
|
|
3890
|
+
sendo assim, não faz o resize
|
|
3891
|
+
`);
|
|
3892
|
+
|
|
3893
|
+
return file
|
|
3894
|
+
}
|
|
3719
3895
|
|
|
3720
3896
|
// Retorna os novos tamanhos redimensionados
|
|
3721
3897
|
const resizedDimensions = getResizeDimensions(this.sizeLimit, width, height);
|
|
@@ -3733,7 +3909,11 @@ var script$q = {
|
|
|
3733
3909
|
const resizedImage = await pica.resize(image, canvas, this.defaultPicaResizeOptions);
|
|
3734
3910
|
const blob = await pica.toBlob(resizedImage, type, 0.90);
|
|
3735
3911
|
|
|
3736
|
-
|
|
3912
|
+
const newFile = new File([blob], file.name, { type });
|
|
3913
|
+
|
|
3914
|
+
this.$qas.logger.group('QasUploader - resizeImage -> nova imagem', [newFile]);
|
|
3915
|
+
|
|
3916
|
+
return newFile
|
|
3737
3917
|
} catch {
|
|
3738
3918
|
// Caso não consiga redimensionar retorna o arquivo original
|
|
3739
3919
|
return file
|
|
@@ -3746,7 +3926,7 @@ var script$q = {
|
|
|
3746
3926
|
}
|
|
3747
3927
|
};
|
|
3748
3928
|
|
|
3749
|
-
const _hoisted_1$
|
|
3929
|
+
const _hoisted_1$i = { class: "flex flex-center full-width justify-between no-border no-wrap q-gutter-xs q-pa-sm text-white transparent" };
|
|
3750
3930
|
const _hoisted_2$d = { class: "col column items-start justify-center" };
|
|
3751
3931
|
const _hoisted_3$9 = {
|
|
3752
3932
|
key: 0,
|
|
@@ -3756,7 +3936,7 @@ const _hoisted_4$7 = {
|
|
|
3756
3936
|
key: 1,
|
|
3757
3937
|
class: "q-uploader__subtitle"
|
|
3758
3938
|
};
|
|
3759
|
-
const _hoisted_5$5 = ["multiple"];
|
|
3939
|
+
const _hoisted_5$5 = ["accept", "multiple"];
|
|
3760
3940
|
const _hoisted_6$3 = { class: "col-12 q-col-gutter-md row" };
|
|
3761
3941
|
const _hoisted_7$3 = { class: "col items-center no-wrap row" };
|
|
3762
3942
|
const _hoisted_8$2 = {
|
|
@@ -3799,7 +3979,7 @@ function render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3799
3979
|
}), {
|
|
3800
3980
|
header: vue.withCtx((scope) => [
|
|
3801
3981
|
vue.renderSlot(_ctx.$slots, "header", { scope: scope }, () => [
|
|
3802
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
3982
|
+
vue.createElementVNode("div", _hoisted_1$i, [
|
|
3803
3983
|
(scope.isUploading)
|
|
3804
3984
|
? (vue.openBlock(), vue.createBlock(_component_q_spinner, {
|
|
3805
3985
|
key: 0,
|
|
@@ -3828,6 +4008,7 @@ function render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3828
4008
|
: vue.createCommentVNode("v-if", true),
|
|
3829
4009
|
vue.createElementVNode("input", {
|
|
3830
4010
|
ref: "hiddenInput",
|
|
4011
|
+
accept: $options.attributes.accept,
|
|
3831
4012
|
class: "qas-uploader__input",
|
|
3832
4013
|
multiple: $options.isMultiple,
|
|
3833
4014
|
type: "file"
|
|
@@ -3875,7 +4056,7 @@ function render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3875
4056
|
class: "q-mr-sm",
|
|
3876
4057
|
color: "contrast-primary",
|
|
3877
4058
|
icon: "o_attach_file",
|
|
3878
|
-
image: file.
|
|
4059
|
+
image: file.url,
|
|
3879
4060
|
rounded: "",
|
|
3880
4061
|
"text-color": $options.getColorFileIcon(file)
|
|
3881
4062
|
}, null, 8 /* PROPS */, ["image", "text-color"]),
|
|
@@ -4036,7 +4217,7 @@ var script$p = {
|
|
|
4036
4217
|
}
|
|
4037
4218
|
};
|
|
4038
4219
|
|
|
4039
|
-
const _hoisted_1$
|
|
4220
|
+
const _hoisted_1$h = {
|
|
4040
4221
|
ref: "signatureContainer",
|
|
4041
4222
|
class: "qas-signature-pad relative-position"
|
|
4042
4223
|
};
|
|
@@ -4046,7 +4227,7 @@ function render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4046
4227
|
const _component_qas_btn = vue.resolveComponent("qas-btn");
|
|
4047
4228
|
|
|
4048
4229
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
4049
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4230
|
+
vue.createElementVNode("div", _hoisted_1$h, [
|
|
4050
4231
|
vue.createElementVNode("canvas", {
|
|
4051
4232
|
id: $data.canvasId,
|
|
4052
4233
|
ref: _ctx.$attrs.ref,
|
|
@@ -4081,6 +4262,7 @@ var script$o = {
|
|
|
4081
4262
|
name: 'QasSignatureUploader',
|
|
4082
4263
|
|
|
4083
4264
|
components: {
|
|
4265
|
+
QasBtn: script$K,
|
|
4084
4266
|
QasDialog: script$x,
|
|
4085
4267
|
QasUploader: script$q,
|
|
4086
4268
|
QasSignaturePad: script$p
|
|
@@ -4209,7 +4391,7 @@ var script$o = {
|
|
|
4209
4391
|
}
|
|
4210
4392
|
};
|
|
4211
4393
|
|
|
4212
|
-
const _hoisted_1$
|
|
4394
|
+
const _hoisted_1$g = { class: "col column items-start justify-center" };
|
|
4213
4395
|
const _hoisted_2$b = {
|
|
4214
4396
|
key: 0,
|
|
4215
4397
|
class: "q-uploader__title"
|
|
@@ -4217,7 +4399,7 @@ const _hoisted_2$b = {
|
|
|
4217
4399
|
const _hoisted_3$8 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-bold text-center" }, "Insira sua assinatura digital no campo abaixo", -1 /* HOISTED */);
|
|
4218
4400
|
|
|
4219
4401
|
function render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4220
|
-
const
|
|
4402
|
+
const _component_qas_btn = vue.resolveComponent("qas-btn");
|
|
4221
4403
|
const _component_qas_uploader = vue.resolveComponent("qas-uploader");
|
|
4222
4404
|
const _component_qas_signature_pad = vue.resolveComponent("qas-signature-pad");
|
|
4223
4405
|
const _component_qas_dialog = vue.resolveComponent("qas-dialog");
|
|
@@ -4236,14 +4418,15 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4236
4418
|
class: vue.normalizeClass(["cursor-pointer flex flex-center full-width justify-between no-border no-wrap q-gutter-xs text-white transparent", $options.headerClass]),
|
|
4237
4419
|
onClick: _cache[0] || (_cache[0] = (...args) => ($options.openDialog && $options.openDialog(...args)))
|
|
4238
4420
|
}, [
|
|
4239
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4421
|
+
vue.createElementVNode("div", _hoisted_1$g, [
|
|
4240
4422
|
($props.uploadLabel)
|
|
4241
4423
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$b, vue.toDisplayString($props.uploadLabel), 1 /* TEXT */))
|
|
4242
4424
|
: vue.createCommentVNode("v-if", true)
|
|
4243
4425
|
]),
|
|
4244
4426
|
(!$props.readonly)
|
|
4245
|
-
? (vue.openBlock(), vue.createBlock(
|
|
4427
|
+
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4246
4428
|
key: 0,
|
|
4429
|
+
color: "white",
|
|
4247
4430
|
dense: "",
|
|
4248
4431
|
flat: "",
|
|
4249
4432
|
icon: "o_add",
|
|
@@ -4251,12 +4434,12 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4251
4434
|
onClick: $options.openDialog
|
|
4252
4435
|
}, null, 8 /* PROPS */, ["onClick"]))
|
|
4253
4436
|
: vue.createCommentVNode("v-if", true),
|
|
4254
|
-
vue.createVNode(
|
|
4437
|
+
vue.createVNode(_component_qas_btn, {
|
|
4255
4438
|
ref: "forceUpload",
|
|
4256
4439
|
class: "hidden",
|
|
4257
4440
|
onClick: $event => ($options.upload(scope))
|
|
4258
4441
|
}, null, 8 /* PROPS */, ["onClick"]),
|
|
4259
|
-
vue.createVNode(
|
|
4442
|
+
vue.createVNode(_component_qas_btn, {
|
|
4260
4443
|
ref: "buttonCleanFiles",
|
|
4261
4444
|
class: "hidden",
|
|
4262
4445
|
onClick: scope.removeUploadedFiles
|
|
@@ -4285,7 +4468,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4285
4468
|
], 4 /* STYLE */)
|
|
4286
4469
|
]),
|
|
4287
4470
|
actions: vue.withCtx(() => [
|
|
4288
|
-
vue.createVNode(
|
|
4471
|
+
vue.createVNode(_component_qas_btn, {
|
|
4289
4472
|
class: "full-width",
|
|
4290
4473
|
color: "primary",
|
|
4291
4474
|
disable: $data.isEmpty,
|
|
@@ -4293,7 +4476,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4293
4476
|
"no-caps": "",
|
|
4294
4477
|
onClick: $options.getSignatureData
|
|
4295
4478
|
}, null, 8 /* PROPS */, ["disable", "onClick"]),
|
|
4296
|
-
vue.createVNode(
|
|
4479
|
+
vue.createVNode(_component_qas_btn, {
|
|
4297
4480
|
class: "full-width q-mt-sm",
|
|
4298
4481
|
color: "primary",
|
|
4299
4482
|
flat: "",
|
|
@@ -4329,6 +4512,8 @@ var script$n = {
|
|
|
4329
4512
|
QasSignatureUploader: script$o
|
|
4330
4513
|
},
|
|
4331
4514
|
|
|
4515
|
+
inheritAttrs: false,
|
|
4516
|
+
|
|
4332
4517
|
props: {
|
|
4333
4518
|
error: {
|
|
4334
4519
|
default: '',
|
|
@@ -4368,8 +4553,9 @@ var script$n = {
|
|
|
4368
4553
|
type,
|
|
4369
4554
|
mask,
|
|
4370
4555
|
maxFiles,
|
|
4371
|
-
|
|
4372
|
-
|
|
4556
|
+
useIso,
|
|
4557
|
+
useSearch,
|
|
4558
|
+
useLazyLoading
|
|
4373
4559
|
} = this.formattedField;
|
|
4374
4560
|
|
|
4375
4561
|
// Default error attributes for Quasar.
|
|
@@ -4391,11 +4577,11 @@ var script$n = {
|
|
|
4391
4577
|
minlength,
|
|
4392
4578
|
suffix,
|
|
4393
4579
|
prefix,
|
|
4394
|
-
|
|
4580
|
+
useIso
|
|
4395
4581
|
};
|
|
4396
4582
|
|
|
4397
4583
|
const numericInput = { is: 'qas-numeric-input', ...input };
|
|
4398
|
-
const datetimeInput = { is: 'qas-date-time-input',
|
|
4584
|
+
const datetimeInput = { is: 'qas-date-time-input', useIso, ...input };
|
|
4399
4585
|
|
|
4400
4586
|
// It'll generate a list of acceptable files extensions.
|
|
4401
4587
|
const accept = extensions && extensions.length ? extensions.map(extension => `.${extension}`).join(',') : '';
|
|
@@ -4423,9 +4609,9 @@ var script$n = {
|
|
|
4423
4609
|
money: { ...numericInput, mode: 'money' },
|
|
4424
4610
|
percent: { ...numericInput, mode: 'percent' },
|
|
4425
4611
|
|
|
4426
|
-
date: { ...datetimeInput,
|
|
4612
|
+
date: { ...datetimeInput, useDateOnly: true },
|
|
4427
4613
|
datetime: { ...datetimeInput },
|
|
4428
|
-
time: { ...datetimeInput,
|
|
4614
|
+
time: { ...datetimeInput, useTimeOnly: true },
|
|
4429
4615
|
|
|
4430
4616
|
boolean: { is: 'q-toggle', label, ...error },
|
|
4431
4617
|
checkbox: { is: 'qas-checkbox-group', label, options, ...error },
|
|
@@ -4436,7 +4622,7 @@ var script$n = {
|
|
|
4436
4622
|
|
|
4437
4623
|
'signature-uploader': { is: 'qas-signature-uploader', entity, uploadLabel: label, ...error },
|
|
4438
4624
|
|
|
4439
|
-
select: { is: 'qas-select', multiple, options,
|
|
4625
|
+
select: { is: 'qas-select', entity, name, multiple, options, useSearch, useLazyLoading, ...input }
|
|
4440
4626
|
};
|
|
4441
4627
|
|
|
4442
4628
|
return { ...(profiles[type] || profiles.default), ...this.$attrs }
|
|
@@ -4498,22 +4684,20 @@ var script$n = {
|
|
|
4498
4684
|
};
|
|
4499
4685
|
|
|
4500
4686
|
function render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4501
|
-
return (vue.openBlock(), vue.
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["data-cy", "model-value", "onUpdate:modelValue"]))
|
|
4516
|
-
]))
|
|
4687
|
+
return (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($options.component.is), vue.mergeProps($options.component, {
|
|
4688
|
+
"data-cy": $props.field.name,
|
|
4689
|
+
"model-value": $options.formattedValue,
|
|
4690
|
+
"onUpdate:modelValue": $options.updateModel
|
|
4691
|
+
}), vue.createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
4692
|
+
vue.renderList(_ctx.$slots, (_, name) => {
|
|
4693
|
+
return {
|
|
4694
|
+
name: name,
|
|
4695
|
+
fn: vue.withCtx((context) => [
|
|
4696
|
+
vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(context || {})))
|
|
4697
|
+
])
|
|
4698
|
+
}
|
|
4699
|
+
})
|
|
4700
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["data-cy", "model-value", "onUpdate:modelValue"]))
|
|
4517
4701
|
}
|
|
4518
4702
|
|
|
4519
4703
|
script$n.render = render$n;
|
|
@@ -4532,6 +4716,7 @@ var script$m = {
|
|
|
4532
4716
|
name: 'QasFilters',
|
|
4533
4717
|
|
|
4534
4718
|
components: {
|
|
4719
|
+
QasBtn: script$K,
|
|
4535
4720
|
QasField: script$n
|
|
4536
4721
|
},
|
|
4537
4722
|
|
|
@@ -4573,7 +4758,7 @@ var script$m = {
|
|
|
4573
4758
|
type: String
|
|
4574
4759
|
},
|
|
4575
4760
|
|
|
4576
|
-
|
|
4761
|
+
useForceRefetch: {
|
|
4577
4762
|
type: Boolean
|
|
4578
4763
|
}
|
|
4579
4764
|
},
|
|
@@ -4704,7 +4889,7 @@ var script$m = {
|
|
|
4704
4889
|
},
|
|
4705
4890
|
|
|
4706
4891
|
async fetchFilters () {
|
|
4707
|
-
if (!this.
|
|
4892
|
+
if (!this.useForceRefetch && (this.hasFields || !this.useFilterButton)) {
|
|
4708
4893
|
return null
|
|
4709
4894
|
}
|
|
4710
4895
|
|
|
@@ -4712,11 +4897,26 @@ var script$m = {
|
|
|
4712
4897
|
this.isFetching = true;
|
|
4713
4898
|
|
|
4714
4899
|
try {
|
|
4900
|
+
this.$qas.logger.group(
|
|
4901
|
+
`QasFilters - fetchFilters -> Payload do parâmetro do ${this.entity}/fetchFilters`,
|
|
4902
|
+
[{ url: this.url }]
|
|
4903
|
+
);
|
|
4904
|
+
|
|
4715
4905
|
const response = await this.$store.dispatch(`${this.entity}/fetchFilters`, { url: this.url });
|
|
4716
4906
|
this.$emit('fetch-success', response);
|
|
4907
|
+
|
|
4908
|
+
this.$qas.logger.group(
|
|
4909
|
+
`QasFilters - fetchFilters -> resposta da action ${this.entity}/fetchFilters`, [response]
|
|
4910
|
+
);
|
|
4717
4911
|
} catch (error) {
|
|
4718
4912
|
this.hasFetchError = true;
|
|
4719
4913
|
this.$emit('fetch-error', error);
|
|
4914
|
+
|
|
4915
|
+
this.$qas.logger.group(
|
|
4916
|
+
`QasFilters - fetchFilters -> exceção da action ${this.entity}/fetchFilters`,
|
|
4917
|
+
[error],
|
|
4918
|
+
{ error: true }
|
|
4919
|
+
);
|
|
4720
4920
|
} finally {
|
|
4721
4921
|
this.isFetching = false;
|
|
4722
4922
|
}
|
|
@@ -4775,7 +4975,7 @@ var script$m = {
|
|
|
4775
4975
|
}
|
|
4776
4976
|
};
|
|
4777
4977
|
|
|
4778
|
-
const _hoisted_1$
|
|
4978
|
+
const _hoisted_1$f = { class: "q-mb-lg" };
|
|
4779
4979
|
const _hoisted_2$a = {
|
|
4780
4980
|
key: 0,
|
|
4781
4981
|
class: "q-gutter-x-md row"
|
|
@@ -4799,8 +4999,8 @@ const _hoisted_7$2 = {
|
|
|
4799
4999
|
};
|
|
4800
5000
|
|
|
4801
5001
|
function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4802
|
-
const
|
|
4803
|
-
const
|
|
5002
|
+
const _component_qas_btn = vue.resolveComponent("qas-btn");
|
|
5003
|
+
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
4804
5004
|
const _component_q_form = vue.resolveComponent("q-form");
|
|
4805
5005
|
const _component_q_spinner = vue.resolveComponent("q-spinner");
|
|
4806
5006
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
@@ -4808,7 +5008,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4808
5008
|
const _component_q_menu = vue.resolveComponent("q-menu");
|
|
4809
5009
|
const _component_q_chip = vue.resolveComponent("q-chip");
|
|
4810
5010
|
|
|
4811
|
-
return (vue.openBlock(), vue.createElementBlock("section", _hoisted_1$
|
|
5011
|
+
return (vue.openBlock(), vue.createElementBlock("section", _hoisted_1$f, [
|
|
4812
5012
|
($options.showFilters)
|
|
4813
5013
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
|
|
4814
5014
|
($options.showSearch)
|
|
@@ -4820,26 +5020,32 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4820
5020
|
onSubmit: _cache[2] || (_cache[2] = vue.withModifiers($event => ($options.filter()), ["prevent"]))
|
|
4821
5021
|
}, {
|
|
4822
5022
|
default: vue.withCtx(() => [
|
|
4823
|
-
vue.createVNode(
|
|
5023
|
+
vue.createVNode(_component_qas_input, {
|
|
4824
5024
|
modelValue: $data.search,
|
|
4825
5025
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.search) = $event)),
|
|
4826
5026
|
debounce: $options.debounce,
|
|
4827
5027
|
dense: "",
|
|
5028
|
+
"hide-bottom-space": "",
|
|
5029
|
+
outlined: false,
|
|
4828
5030
|
placeholder: $props.searchPlaceholder,
|
|
4829
5031
|
type: "search"
|
|
4830
5032
|
}, {
|
|
4831
5033
|
append: vue.withCtx(() => [
|
|
4832
5034
|
($options.hasSearch)
|
|
4833
|
-
? (vue.openBlock(), vue.createBlock(
|
|
5035
|
+
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4834
5036
|
key: 0,
|
|
5037
|
+
color: "grey-9",
|
|
5038
|
+
flat: "",
|
|
4835
5039
|
icon: "o_clear",
|
|
4836
5040
|
unelevated: "",
|
|
4837
5041
|
onClick: $options.clearSearch
|
|
4838
5042
|
}, null, 8 /* PROPS */, ["onClick"]))
|
|
4839
5043
|
: vue.createCommentVNode("v-if", true),
|
|
4840
5044
|
(!$options.debounce)
|
|
4841
|
-
? (vue.openBlock(), vue.createBlock(
|
|
5045
|
+
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4842
5046
|
key: 1,
|
|
5047
|
+
color: "grey-9",
|
|
5048
|
+
flat: "",
|
|
4843
5049
|
icon: "o_search",
|
|
4844
5050
|
type: "submit",
|
|
4845
5051
|
unelevated: "",
|
|
@@ -4862,7 +5068,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4862
5068
|
filter: $options.filter
|
|
4863
5069
|
}, () => [
|
|
4864
5070
|
($props.useFilterButton)
|
|
4865
|
-
? (vue.openBlock(), vue.createBlock(
|
|
5071
|
+
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4866
5072
|
key: 0,
|
|
4867
5073
|
color: $options.filterButtonColor,
|
|
4868
5074
|
flat: "",
|
|
@@ -4907,16 +5113,19 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4907
5113
|
]))
|
|
4908
5114
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
4909
5115
|
vue.createElementVNode("div", _hoisted_6$2, [
|
|
4910
|
-
vue.createVNode(
|
|
5116
|
+
vue.createVNode(_component_qas_btn, {
|
|
4911
5117
|
class: "q-mr-sm",
|
|
5118
|
+
flat: "",
|
|
4912
5119
|
label: "Limpar",
|
|
5120
|
+
"no-caps": false,
|
|
4913
5121
|
size: "12px",
|
|
4914
5122
|
unelevated: "",
|
|
4915
5123
|
onClick: $options.clearFilters
|
|
4916
5124
|
}, null, 8 /* PROPS */, ["onClick"]),
|
|
4917
|
-
vue.createVNode(
|
|
5125
|
+
vue.createVNode(_component_qas_btn, {
|
|
4918
5126
|
color: "primary",
|
|
4919
5127
|
label: "Filtrar",
|
|
5128
|
+
"no-caps": false,
|
|
4920
5129
|
size: "12px",
|
|
4921
5130
|
type: "submit",
|
|
4922
5131
|
unelevated: ""
|
|
@@ -4985,7 +5194,9 @@ var generatorMixin = {
|
|
|
4985
5194
|
gutter: {
|
|
4986
5195
|
default: 'md',
|
|
4987
5196
|
type: [String, Boolean],
|
|
4988
|
-
validator: value =>
|
|
5197
|
+
validator: value => {
|
|
5198
|
+
return typeof value === 'boolean' || ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
|
|
5199
|
+
}
|
|
4989
5200
|
}
|
|
4990
5201
|
},
|
|
4991
5202
|
|
|
@@ -5034,7 +5245,13 @@ var generatorMixin = {
|
|
|
5034
5245
|
},
|
|
5035
5246
|
|
|
5036
5247
|
mx_handleColumnsByIndex (index, isGridGenerator) {
|
|
5037
|
-
const fields = isGridGenerator ? this.fields :
|
|
5248
|
+
const fields = isGridGenerator ? this.fields : {};
|
|
5249
|
+
|
|
5250
|
+
if (!isGridGenerator) {
|
|
5251
|
+
for (const key in this.normalizedFields) {
|
|
5252
|
+
Object.assign(fields, this.normalizedFields[key].fields.visible);
|
|
5253
|
+
}
|
|
5254
|
+
}
|
|
5038
5255
|
|
|
5039
5256
|
if (!Array.isArray(fields)) {
|
|
5040
5257
|
index = Object.keys(fields).findIndex(field => field === index);
|
|
@@ -5084,6 +5301,19 @@ var script$l = {
|
|
|
5084
5301
|
default: () => ({}),
|
|
5085
5302
|
required: true,
|
|
5086
5303
|
type: Object
|
|
5304
|
+
},
|
|
5305
|
+
|
|
5306
|
+
fieldset: {
|
|
5307
|
+
default: () => ({}),
|
|
5308
|
+
type: Object
|
|
5309
|
+
},
|
|
5310
|
+
|
|
5311
|
+
fieldsetGutter: {
|
|
5312
|
+
default: 'lg',
|
|
5313
|
+
type: [String, Boolean],
|
|
5314
|
+
validator: value => {
|
|
5315
|
+
return typeof value === 'boolean' || ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
|
|
5316
|
+
}
|
|
5087
5317
|
}
|
|
5088
5318
|
},
|
|
5089
5319
|
|
|
@@ -5093,6 +5323,8 @@ var script$l = {
|
|
|
5093
5323
|
groupedFields () {
|
|
5094
5324
|
const fields = { hidden: {}, visible: {} };
|
|
5095
5325
|
|
|
5326
|
+
if (this.hasFieldset) return fields
|
|
5327
|
+
|
|
5096
5328
|
for (const key in this.fields) {
|
|
5097
5329
|
const field = this.fields[key];
|
|
5098
5330
|
fields[field.type === 'hidden' ? 'hidden' : 'visible'][key] = field;
|
|
@@ -5109,6 +5341,58 @@ var script$l = {
|
|
|
5109
5341
|
}
|
|
5110
5342
|
|
|
5111
5343
|
return fields
|
|
5344
|
+
},
|
|
5345
|
+
|
|
5346
|
+
normalizedFields () {
|
|
5347
|
+
if (!this.hasFieldset) {
|
|
5348
|
+
return {
|
|
5349
|
+
default: {
|
|
5350
|
+
fields: this.groupedFields
|
|
5351
|
+
}
|
|
5352
|
+
}
|
|
5353
|
+
}
|
|
5354
|
+
|
|
5355
|
+
const fields = {};
|
|
5356
|
+
|
|
5357
|
+
for (const fieldsetKey in this.fieldset) {
|
|
5358
|
+
const fieldsetItem = this.fieldset[fieldsetKey];
|
|
5359
|
+
|
|
5360
|
+
fields[fieldsetKey] = {
|
|
5361
|
+
label: fieldsetItem.label,
|
|
5362
|
+
fields: { hidden: {}, visible: {} }
|
|
5363
|
+
};
|
|
5364
|
+
|
|
5365
|
+
for (const fieldName of fieldsetItem.fields) {
|
|
5366
|
+
const field = this.fields[fieldName];
|
|
5367
|
+
|
|
5368
|
+
if (!field) continue
|
|
5369
|
+
|
|
5370
|
+
Object.assign(
|
|
5371
|
+
fields[fieldsetKey].fields[
|
|
5372
|
+
field.type === 'hidden' ? 'hidden' : 'visible'
|
|
5373
|
+
],
|
|
5374
|
+
{
|
|
5375
|
+
[fieldName]: field
|
|
5376
|
+
}
|
|
5377
|
+
);
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5380
|
+
|
|
5381
|
+
return fields
|
|
5382
|
+
},
|
|
5383
|
+
|
|
5384
|
+
hasFieldset () {
|
|
5385
|
+
return !!Object.keys(this.fieldset).length
|
|
5386
|
+
},
|
|
5387
|
+
|
|
5388
|
+
fieldsetClasses () {
|
|
5389
|
+
const classes = ['row'];
|
|
5390
|
+
|
|
5391
|
+
if (this.fieldsetGutter) {
|
|
5392
|
+
classes.push(`q-col-gutter-y-${this.fieldsetGutter}`);
|
|
5393
|
+
}
|
|
5394
|
+
|
|
5395
|
+
return classes
|
|
5112
5396
|
}
|
|
5113
5397
|
},
|
|
5114
5398
|
|
|
@@ -5123,51 +5407,290 @@ var script$l = {
|
|
|
5123
5407
|
};
|
|
5124
5408
|
|
|
5125
5409
|
function render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5410
|
+
const _component_qas_label = vue.resolveComponent("qas-label");
|
|
5126
5411
|
const _component_qas_field = vue.resolveComponent("qas-field");
|
|
5127
5412
|
|
|
5128
|
-
return (vue.openBlock(), vue.createElementBlock("div",
|
|
5129
|
-
vue.
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
(vue.openBlock(
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
vue.renderSlot(_ctx.$slots, `
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5413
|
+
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
5414
|
+
class: vue.normalizeClass($options.fieldsetClasses)
|
|
5415
|
+
}, [
|
|
5416
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.normalizedFields, (fieldsetItem, fieldsetItemKey) => {
|
|
5417
|
+
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
5418
|
+
key: fieldsetItemKey,
|
|
5419
|
+
class: "full-width"
|
|
5420
|
+
}, [
|
|
5421
|
+
(fieldsetItem.label)
|
|
5422
|
+
? vue.renderSlot(_ctx.$slots, `legend-${fieldsetItemKey}`, { key: 0 }, () => [
|
|
5423
|
+
vue.createVNode(_component_qas_label, {
|
|
5424
|
+
label: fieldsetItem.label
|
|
5425
|
+
}, null, 8 /* PROPS */, ["label"])
|
|
5426
|
+
])
|
|
5427
|
+
: vue.createCommentVNode("v-if", true),
|
|
5428
|
+
vue.createElementVNode("div", null, [
|
|
5429
|
+
vue.createElementVNode("div", {
|
|
5430
|
+
class: vue.normalizeClass(_ctx.mx_classes)
|
|
5431
|
+
}, [
|
|
5432
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fieldsetItem.fields.visible, (field, key) => {
|
|
5433
|
+
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
5434
|
+
key: key,
|
|
5435
|
+
class: vue.normalizeClass(_ctx.mx_getFieldClass(key))
|
|
5436
|
+
}, [
|
|
5437
|
+
vue.renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
|
|
5438
|
+
vue.createVNode(_component_qas_field, vue.mergeProps($props.fieldsProps[field.name], {
|
|
5439
|
+
error: $props.errors[key],
|
|
5440
|
+
field: field,
|
|
5441
|
+
"model-value": $props.modelValue[field.name],
|
|
5442
|
+
"onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
|
|
5443
|
+
}), null, 16 /* FULL_PROPS */, ["error", "field", "model-value", "onUpdate:modelValue"])
|
|
5444
|
+
])
|
|
5445
|
+
], 2 /* CLASS */))
|
|
5446
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
5447
|
+
], 2 /* CLASS */),
|
|
5448
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fieldsetItem.fields.hidden, (field, key) => {
|
|
5449
|
+
return (vue.openBlock(), vue.createElementBlock("div", { key: key }, [
|
|
5450
|
+
vue.renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
|
|
5451
|
+
vue.createVNode(_component_qas_field, vue.mergeProps($props.fieldsProps[field.name], {
|
|
5452
|
+
field: field,
|
|
5453
|
+
"model-value": $props.modelValue[field.name],
|
|
5454
|
+
"onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
|
|
5455
|
+
}), null, 16 /* FULL_PROPS */, ["field", "model-value", "onUpdate:modelValue"])
|
|
5456
|
+
])
|
|
5457
|
+
]))
|
|
5458
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
5156
5459
|
])
|
|
5157
5460
|
]))
|
|
5158
5461
|
}), 128 /* KEYED_FRAGMENT */))
|
|
5159
|
-
]))
|
|
5462
|
+
], 2 /* CLASS */))
|
|
5160
5463
|
}
|
|
5161
5464
|
|
|
5162
5465
|
script$l.render = render$l;
|
|
5163
5466
|
script$l.__file = "src/components/form-generator/QasFormGenerator.vue";
|
|
5164
5467
|
|
|
5165
|
-
var
|
|
5468
|
+
var searchFilterMixin = {
|
|
5166
5469
|
props: {
|
|
5167
|
-
|
|
5470
|
+
entity: {
|
|
5471
|
+
default: '',
|
|
5472
|
+
type: String
|
|
5473
|
+
},
|
|
5474
|
+
|
|
5475
|
+
lazyLoadingProps: {
|
|
5476
|
+
default: () => ({}),
|
|
5477
|
+
type: Object
|
|
5478
|
+
},
|
|
5479
|
+
|
|
5480
|
+
name: {
|
|
5481
|
+
default: '',
|
|
5482
|
+
type: String
|
|
5483
|
+
},
|
|
5484
|
+
|
|
5485
|
+
useLazyLoading: {
|
|
5168
5486
|
type: Boolean
|
|
5169
5487
|
},
|
|
5170
5488
|
|
|
5489
|
+
fetching: {
|
|
5490
|
+
type: Boolean
|
|
5491
|
+
}
|
|
5492
|
+
},
|
|
5493
|
+
|
|
5494
|
+
emits: [
|
|
5495
|
+
'update:modelValue',
|
|
5496
|
+
'update:fetching',
|
|
5497
|
+
'fetch-options-success',
|
|
5498
|
+
'fetch-options-error'
|
|
5499
|
+
],
|
|
5500
|
+
|
|
5501
|
+
data () {
|
|
5502
|
+
return {
|
|
5503
|
+
mx_filteredOptions: [],
|
|
5504
|
+
mx_hasFetchError: false,
|
|
5505
|
+
mx_isFetching: false,
|
|
5506
|
+
mx_isScrolling: false,
|
|
5507
|
+
mx_search: '',
|
|
5508
|
+
mx_fetchCount: 0,
|
|
5509
|
+
mx_pagination: {
|
|
5510
|
+
page: 1,
|
|
5511
|
+
lastPage: null,
|
|
5512
|
+
hasCount: true,
|
|
5513
|
+
hasNextPage: false
|
|
5514
|
+
}
|
|
5515
|
+
}
|
|
5516
|
+
},
|
|
5517
|
+
|
|
5518
|
+
computed: {
|
|
5519
|
+
mx_defaultLazyLoadingProps () {
|
|
5520
|
+
const {
|
|
5521
|
+
url,
|
|
5522
|
+
params,
|
|
5523
|
+
decamelizeFieldName
|
|
5524
|
+
} = this.lazyLoadingProps;
|
|
5525
|
+
|
|
5526
|
+
const defaultParams = { limit: 48 };
|
|
5527
|
+
|
|
5528
|
+
return {
|
|
5529
|
+
url: url || '',
|
|
5530
|
+
params: {
|
|
5531
|
+
...defaultParams,
|
|
5532
|
+
...params
|
|
5533
|
+
},
|
|
5534
|
+
decamelizeFieldName: decamelizeFieldName === undefined ? true : decamelizeFieldName
|
|
5535
|
+
}
|
|
5536
|
+
},
|
|
5537
|
+
|
|
5538
|
+
mx_hasFilteredOptions () {
|
|
5539
|
+
return !!this.mx_filteredOptions.length
|
|
5540
|
+
},
|
|
5541
|
+
|
|
5542
|
+
mx_isFilterByFuse () {
|
|
5543
|
+
return !this.useLazyLoading
|
|
5544
|
+
}
|
|
5545
|
+
},
|
|
5546
|
+
|
|
5547
|
+
watch: {
|
|
5548
|
+
lazyLoadingProps: {
|
|
5549
|
+
handler (value, oldValue) {
|
|
5550
|
+
if (lodash.isEqual(value, oldValue)) return
|
|
5551
|
+
|
|
5552
|
+
this.mx_filterOptionsByStore('');
|
|
5553
|
+
this.$emit('update:modelValue', '');
|
|
5554
|
+
}
|
|
5555
|
+
}
|
|
5556
|
+
},
|
|
5557
|
+
|
|
5558
|
+
methods: {
|
|
5559
|
+
async mx_filterOptionsByStore (search) {
|
|
5560
|
+
this.mx_resetFilter(search);
|
|
5561
|
+
await this.mx_setFetchOptions();
|
|
5562
|
+
},
|
|
5563
|
+
|
|
5564
|
+
mx_resetFilter (search) {
|
|
5565
|
+
this.mx_filteredOptions = [];
|
|
5566
|
+
this.mx_search = search;
|
|
5567
|
+
this.mx_pagination = {
|
|
5568
|
+
page: 1,
|
|
5569
|
+
lastPage: null,
|
|
5570
|
+
hasCount: true,
|
|
5571
|
+
hasNextPage: false
|
|
5572
|
+
};
|
|
5573
|
+
},
|
|
5574
|
+
|
|
5575
|
+
async mx_onVirtualScroll ({ index, ref }) {
|
|
5576
|
+
const lastIndex = this.mx_filteredOptions.length - 1;
|
|
5577
|
+
|
|
5578
|
+
if (index === lastIndex && this.mx_canFetchOptions()) {
|
|
5579
|
+
await this.mx_loadMoreOptions();
|
|
5580
|
+
|
|
5581
|
+
this.$nextTick(() => {
|
|
5582
|
+
ref.reset();
|
|
5583
|
+
ref.refresh(lastIndex);
|
|
5584
|
+
});
|
|
5585
|
+
}
|
|
5586
|
+
},
|
|
5587
|
+
|
|
5588
|
+
async mx_loadMoreOptions () {
|
|
5589
|
+
this.mx_isScrolling = true;
|
|
5590
|
+
|
|
5591
|
+
const options = await this.mx_fetchOptions();
|
|
5592
|
+
this.mx_filteredOptions.push(...options);
|
|
5593
|
+
|
|
5594
|
+
// this is to prevent the virtual-scroll event to be fired again
|
|
5595
|
+
this.$nextTick(() => {
|
|
5596
|
+
this.mx_isScrolling = false;
|
|
5597
|
+
});
|
|
5598
|
+
},
|
|
5599
|
+
|
|
5600
|
+
async mx_fetchOptions () {
|
|
5601
|
+
this.mx_fetchCount++;
|
|
5602
|
+
|
|
5603
|
+
try {
|
|
5604
|
+
if (!this.entity) this.mx_setMissingPropsMessage('entity');
|
|
5605
|
+
if (!this.name) this.mx_setMissingPropsMessage('name');
|
|
5606
|
+
|
|
5607
|
+
this.mx_hasFetchError = false;
|
|
5608
|
+
this.mx_isFetching = true;
|
|
5609
|
+
|
|
5610
|
+
this.$emit('update:fetching', true);
|
|
5611
|
+
|
|
5612
|
+
const { url, params, decamelizeFieldName } = this.mx_defaultLazyLoadingProps;
|
|
5613
|
+
|
|
5614
|
+
const { data } = await this.$store.dispatch(`${this.entity}/fetchFieldOptions`, {
|
|
5615
|
+
url,
|
|
5616
|
+
field: decamelizeFieldName ? humps.decamelize(this.name, { separator: '-' }) : this.name,
|
|
5617
|
+
params: {
|
|
5618
|
+
...params,
|
|
5619
|
+
search: this.mx_search,
|
|
5620
|
+
offset: (this.mx_pagination.page - 1) * params.limit
|
|
5621
|
+
}
|
|
5622
|
+
});
|
|
5623
|
+
|
|
5624
|
+
const { results, count, hasNextPage } = data;
|
|
5625
|
+
const hasCount = count !== undefined;
|
|
5626
|
+
|
|
5627
|
+
this.mx_pagination = {
|
|
5628
|
+
page: this.mx_pagination.page + 1,
|
|
5629
|
+
lastPage: hasCount ? Math.ceil(count / params.limit) : null,
|
|
5630
|
+
hasCount,
|
|
5631
|
+
hasNextPage
|
|
5632
|
+
};
|
|
5633
|
+
|
|
5634
|
+
this.$emit('fetch-options-success', data);
|
|
5635
|
+
|
|
5636
|
+
return this.mx_handleOptions(results)
|
|
5637
|
+
} catch (error) {
|
|
5638
|
+
this.$qas.logger.group(
|
|
5639
|
+
`Mixin: searchFilterMixin - mx_fetchOptions -> exceção da action ${this.entity}/fetchFieldOptions`,
|
|
5640
|
+
[error],
|
|
5641
|
+
{ error: true }
|
|
5642
|
+
);
|
|
5643
|
+
|
|
5644
|
+
this.mx_hasFetchError = true;
|
|
5645
|
+
this.$emit('fetch-options-error', error);
|
|
5646
|
+
|
|
5647
|
+
return []
|
|
5648
|
+
} finally {
|
|
5649
|
+
this.mx_isFetching = false;
|
|
5650
|
+
this.$emit('update:fetching', false);
|
|
5651
|
+
}
|
|
5652
|
+
},
|
|
5653
|
+
|
|
5654
|
+
async mx_setFetchOptions () {
|
|
5655
|
+
this.mx_filteredOptions = await this.mx_fetchOptions();
|
|
5656
|
+
},
|
|
5657
|
+
|
|
5658
|
+
mx_canFetchOptions () {
|
|
5659
|
+
const { lastPage, page, hasCount, hasNextPage } = this.mx_pagination;
|
|
5660
|
+
|
|
5661
|
+
const hasMorePages = hasCount ? lastPage && page <= lastPage : hasNextPage;
|
|
5662
|
+
|
|
5663
|
+
return hasMorePages && !this.mx_isFetching && !this.mx_isScrolling && this.useLazyLoading
|
|
5664
|
+
},
|
|
5665
|
+
|
|
5666
|
+
mx_handleOptions (options) {
|
|
5667
|
+
if (this.labelKey && this.valueKey) {
|
|
5668
|
+
return getNormalizedOptions({
|
|
5669
|
+
options,
|
|
5670
|
+
label: this.labelKey,
|
|
5671
|
+
value: this.valueKey
|
|
5672
|
+
})
|
|
5673
|
+
}
|
|
5674
|
+
|
|
5675
|
+
return options
|
|
5676
|
+
},
|
|
5677
|
+
|
|
5678
|
+
mx_getMissingPropsMessage (prop) {
|
|
5679
|
+
return `A propriedade "${prop}" é obrigatória quando a propriedade "useLazyLoading" está ativa.`
|
|
5680
|
+
},
|
|
5681
|
+
|
|
5682
|
+
mx_setMissingPropsMessage (prop) {
|
|
5683
|
+
throw new Error(this.mx_getMissingPropsMessage(prop))
|
|
5684
|
+
},
|
|
5685
|
+
|
|
5686
|
+
mx_getNormalizedFuseResults (results = []) {
|
|
5687
|
+
return results.map(({ item }) => item)
|
|
5688
|
+
}
|
|
5689
|
+
}
|
|
5690
|
+
};
|
|
5691
|
+
|
|
5692
|
+
var viewMixin = {
|
|
5693
|
+
props: {
|
|
5171
5694
|
entity: {
|
|
5172
5695
|
required: true,
|
|
5173
5696
|
type: String
|
|
@@ -5195,6 +5718,16 @@ var viewMixin = {
|
|
|
5195
5718
|
|
|
5196
5719
|
fetching: {
|
|
5197
5720
|
type: Boolean
|
|
5721
|
+
},
|
|
5722
|
+
|
|
5723
|
+
useBoundary: {
|
|
5724
|
+
default: true,
|
|
5725
|
+
type: Boolean
|
|
5726
|
+
},
|
|
5727
|
+
|
|
5728
|
+
beforeFetch: {
|
|
5729
|
+
default: null,
|
|
5730
|
+
type: Function
|
|
5198
5731
|
}
|
|
5199
5732
|
},
|
|
5200
5733
|
|
|
@@ -5210,7 +5743,7 @@ var viewMixin = {
|
|
|
5210
5743
|
mx_errors: {},
|
|
5211
5744
|
mx_fields: {},
|
|
5212
5745
|
mx_metadata: {},
|
|
5213
|
-
|
|
5746
|
+
mx_cancelBeforeFetch: false,
|
|
5214
5747
|
mx_isFetching: false
|
|
5215
5748
|
}
|
|
5216
5749
|
},
|
|
@@ -5223,11 +5756,11 @@ var viewMixin = {
|
|
|
5223
5756
|
|
|
5224
5757
|
computed: {
|
|
5225
5758
|
mx_componentTag () {
|
|
5226
|
-
return this.
|
|
5759
|
+
return this.useBoundary ? 'q-page' : 'div'
|
|
5227
5760
|
},
|
|
5228
5761
|
|
|
5229
5762
|
mx_componentClass () {
|
|
5230
|
-
return
|
|
5763
|
+
return this.useBoundary && 'container spaced'
|
|
5231
5764
|
},
|
|
5232
5765
|
|
|
5233
5766
|
mx_hasFooterSlot () {
|
|
@@ -5261,11 +5794,9 @@ var viewMixin = {
|
|
|
5261
5794
|
},
|
|
5262
5795
|
|
|
5263
5796
|
mx_setFields (fields = {}) {
|
|
5264
|
-
|
|
5265
|
-
fields[field].name = humps.camelize(fields[field].name);
|
|
5266
|
-
}
|
|
5797
|
+
const camelizedFields = camelizeFieldsName(fields);
|
|
5267
5798
|
|
|
5268
|
-
this.mx_fields = vue.markRaw(
|
|
5799
|
+
this.mx_fields = vue.markRaw(camelizedFields);
|
|
5269
5800
|
},
|
|
5270
5801
|
|
|
5271
5802
|
mx_setMetadata (metadata = {}) {
|
|
@@ -5278,6 +5809,22 @@ var viewMixin = {
|
|
|
5278
5809
|
|
|
5279
5810
|
this.$emit(`update:${key}`, models[key]);
|
|
5280
5811
|
}
|
|
5812
|
+
},
|
|
5813
|
+
|
|
5814
|
+
mx_fetchHandler (payload, resolve) {
|
|
5815
|
+
const hasBeforeFetch = typeof this.beforeFetch === 'function';
|
|
5816
|
+
|
|
5817
|
+
if (hasBeforeFetch && !this.mx_cancelBeforeFetch) {
|
|
5818
|
+
return this.beforeFetch({
|
|
5819
|
+
payload,
|
|
5820
|
+
resolve: payload => resolve(payload),
|
|
5821
|
+
done: () => {
|
|
5822
|
+
this.mx_cancelBeforeFetch = true;
|
|
5823
|
+
}
|
|
5824
|
+
})
|
|
5825
|
+
}
|
|
5826
|
+
|
|
5827
|
+
resolve();
|
|
5281
5828
|
}
|
|
5282
5829
|
}
|
|
5283
5830
|
};
|
|
@@ -5322,7 +5869,7 @@ var script$k = {
|
|
|
5322
5869
|
type: Object
|
|
5323
5870
|
},
|
|
5324
5871
|
|
|
5325
|
-
|
|
5872
|
+
useDialogOnUnsavedChanges: {
|
|
5326
5873
|
default: true,
|
|
5327
5874
|
type: Boolean
|
|
5328
5875
|
},
|
|
@@ -5359,6 +5906,11 @@ var script$k = {
|
|
|
5359
5906
|
useSubmitButton: {
|
|
5360
5907
|
default: true,
|
|
5361
5908
|
type: Boolean
|
|
5909
|
+
},
|
|
5910
|
+
|
|
5911
|
+
beforeSubmit: {
|
|
5912
|
+
default: null,
|
|
5913
|
+
type: Function
|
|
5362
5914
|
}
|
|
5363
5915
|
},
|
|
5364
5916
|
|
|
@@ -5375,7 +5927,6 @@ var script$k = {
|
|
|
5375
5927
|
data () {
|
|
5376
5928
|
return {
|
|
5377
5929
|
cachedResult: {},
|
|
5378
|
-
hasResult: false,
|
|
5379
5930
|
isSubmitting: false,
|
|
5380
5931
|
showDialog: false,
|
|
5381
5932
|
ignoreRouterGuard: false,
|
|
@@ -5432,25 +5983,17 @@ var script$k = {
|
|
|
5432
5983
|
},
|
|
5433
5984
|
|
|
5434
5985
|
watch: {
|
|
5435
|
-
mx_fields (fields) {
|
|
5436
|
-
const models = { ...this.getModelsByFields(fields), ...this.modelValue };
|
|
5437
|
-
|
|
5438
|
-
this.$emit('update:modelValue', models);
|
|
5439
|
-
|
|
5440
|
-
if (!this.hasResult && this.showDialogOnUnsavedChanges) {
|
|
5441
|
-
this.cachedResult = quasar.extend(true, {}, models);
|
|
5442
|
-
}
|
|
5443
|
-
},
|
|
5444
|
-
|
|
5445
5986
|
isSubmitting (value) {
|
|
5446
5987
|
this.$emit('update:submitting', value);
|
|
5447
5988
|
}
|
|
5448
5989
|
},
|
|
5449
5990
|
|
|
5450
5991
|
created () {
|
|
5451
|
-
vueRouter.onBeforeRouteLeave(this.beforeRouteLeave);
|
|
5992
|
+
this.useDialogOnUnsavedChanges && vueRouter.onBeforeRouteLeave(this.beforeRouteLeave);
|
|
5993
|
+
|
|
5452
5994
|
window.addEventListener('delete-success', this.setIgnoreRouterGuard);
|
|
5453
|
-
|
|
5995
|
+
|
|
5996
|
+
this.mx_fetchHandler({ form: true, id: this.id, url: this.fetchURL }, this.fetchSingle);
|
|
5454
5997
|
},
|
|
5455
5998
|
|
|
5456
5999
|
onUnmounted () {
|
|
@@ -5463,13 +6006,13 @@ var script$k = {
|
|
|
5463
6006
|
const clonedCachedResult = quasar.extend(true, {}, this.cachedResult);
|
|
5464
6007
|
|
|
5465
6008
|
/**
|
|
5466
|
-
* Se a propriedade "
|
|
6009
|
+
* Se a propriedade "useDialogOnUnsavedChanges" for false ou a variável
|
|
5467
6010
|
* "ignoreRouterGuard" for true, então **não** iremos checar se o usuário
|
|
5468
6011
|
* alterou algum campo antes de sair da pagina, senão iremos validar pela função isEqualWith
|
|
5469
6012
|
* e mostrar um dialog antes do usuário sair da página.
|
|
5470
6013
|
*/
|
|
5471
6014
|
if (
|
|
5472
|
-
!this.
|
|
6015
|
+
!this.useDialogOnUnsavedChanges ||
|
|
5473
6016
|
this.ignoreRouterGuard ||
|
|
5474
6017
|
lodashEs.isEqualWith(
|
|
5475
6018
|
clonedModelValue,
|
|
@@ -5480,6 +6023,11 @@ var script$k = {
|
|
|
5480
6023
|
return next()
|
|
5481
6024
|
}
|
|
5482
6025
|
|
|
6026
|
+
this.$qas.logger.group(
|
|
6027
|
+
'QasFormView - beforeRouteLeave -> dialog chamado, modelValue diferente do cachedResult',
|
|
6028
|
+
[{ modelValue: clonedModelValue, cachedResult: clonedCachedResult }]
|
|
6029
|
+
);
|
|
6030
|
+
|
|
5483
6031
|
this.handleDialog(() => {
|
|
5484
6032
|
this.ignoreRouterGuard = true;
|
|
5485
6033
|
next();
|
|
@@ -5487,45 +6035,64 @@ var script$k = {
|
|
|
5487
6035
|
},
|
|
5488
6036
|
|
|
5489
6037
|
cancel () {
|
|
5490
|
-
|
|
5491
|
-
this.handleCancelRoute();
|
|
5492
|
-
}
|
|
6038
|
+
this.handleCancelRoute();
|
|
5493
6039
|
},
|
|
5494
6040
|
|
|
5495
|
-
async
|
|
6041
|
+
async fetchSingle (externalPayload = {}) {
|
|
5496
6042
|
this.mx_isFetching = true;
|
|
5497
6043
|
|
|
5498
6044
|
try {
|
|
5499
|
-
const
|
|
5500
|
-
|
|
6045
|
+
const payload = {
|
|
6046
|
+
form: true,
|
|
6047
|
+
id: this.id,
|
|
6048
|
+
url: this.fetchURL,
|
|
6049
|
+
...externalPayload
|
|
6050
|
+
};
|
|
6051
|
+
|
|
6052
|
+
this.$qas.logger.group(
|
|
6053
|
+
`QasFormView - fetchSingle -> payload do parâmetro do ${this.entity}/fetchSingle`, [payload]
|
|
5501
6054
|
);
|
|
5502
6055
|
|
|
6056
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
|
|
6057
|
+
|
|
5503
6058
|
const { errors, fields, metadata, result } = response.data;
|
|
5504
6059
|
|
|
6060
|
+
const modelValue = { ...this.getModelsByFields(fields), ...this.modelValue };
|
|
6061
|
+
|
|
5505
6062
|
this.mx_setErrors(errors);
|
|
5506
6063
|
this.mx_setFields(fields);
|
|
5507
6064
|
this.mx_setMetadata(metadata);
|
|
5508
6065
|
|
|
5509
6066
|
this.mx_updateModels({
|
|
5510
|
-
errors
|
|
6067
|
+
errors,
|
|
5511
6068
|
fields: this.mx_fields,
|
|
5512
6069
|
metadata
|
|
5513
6070
|
});
|
|
5514
6071
|
|
|
5515
|
-
|
|
5516
|
-
this.hasResult = true;
|
|
6072
|
+
result && Object.assign(modelValue, result);
|
|
5517
6073
|
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
6074
|
+
this.$qas.logger.group(
|
|
6075
|
+
`QasFormView - fetchSingle -> resposta da action ${this.entity}/fetchSingle`, [response]
|
|
6076
|
+
);
|
|
5521
6077
|
|
|
5522
|
-
|
|
6078
|
+
if (this.useDialogOnUnsavedChanges) {
|
|
6079
|
+
this.cachedResult = quasar.extend(true, {}, result || modelValue);
|
|
6080
|
+
this.$qas.logger.group('QasFormView - fetchSingle -> cachedResult', [this.cachedResult]);
|
|
5523
6081
|
}
|
|
5524
6082
|
|
|
6083
|
+
this.$emit('update:modelValue', modelValue);
|
|
5525
6084
|
this.$emit('fetch-success', response, this.modelValue);
|
|
6085
|
+
|
|
6086
|
+
this.$qas.logger.group('QasFormView - fetchSingle -> modelValue', [modelValue]);
|
|
5526
6087
|
} catch (error) {
|
|
5527
6088
|
this.mx_fetchError(error);
|
|
5528
6089
|
this.$emit('fetch-error', error);
|
|
6090
|
+
|
|
6091
|
+
this.$qas.logger.group(
|
|
6092
|
+
`QasFormView - fetchSingle -> exceção da action ${this.entity}/fetchSingle`,
|
|
6093
|
+
[error],
|
|
6094
|
+
{ error: true }
|
|
6095
|
+
);
|
|
5529
6096
|
} finally {
|
|
5530
6097
|
this.mx_isFetching = false;
|
|
5531
6098
|
}
|
|
@@ -5562,6 +6129,7 @@ var script$k = {
|
|
|
5562
6129
|
const { addRoute } = useHistory();
|
|
5563
6130
|
|
|
5564
6131
|
this.defaultDialogProps.ok.onClick = () => addRoute(this.$route);
|
|
6132
|
+
|
|
5565
6133
|
this.defaultDialogProps.cancel.onClick = next;
|
|
5566
6134
|
},
|
|
5567
6135
|
|
|
@@ -5581,33 +6149,66 @@ var script$k = {
|
|
|
5581
6149
|
});
|
|
5582
6150
|
},
|
|
5583
6151
|
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
6152
|
+
/**
|
|
6153
|
+
* Se existe a propriedade com callback "beforeSubmit", então o controle de quando e como chamar o método "submit"
|
|
6154
|
+
* está sendo controlado fora do QasFormView, se não existir a propriedade "beforeSubmit", então o controle do método
|
|
6155
|
+
* submit é feito pelo próprio QasFormView, chamado pelo evento @submit.
|
|
6156
|
+
*/
|
|
6157
|
+
submitHandler (event) {
|
|
5587
6158
|
if (event) {
|
|
5588
6159
|
event.preventDefault();
|
|
5589
6160
|
}
|
|
5590
6161
|
|
|
6162
|
+
const hasBeforeSubmit = typeof this.beforeSubmit === 'function';
|
|
6163
|
+
|
|
6164
|
+
if (hasBeforeSubmit) {
|
|
6165
|
+
return this.beforeSubmit({
|
|
6166
|
+
payload: { id: this.id, payload: this.modelValue, url: this.url },
|
|
6167
|
+
resolve: payload => this.submit(payload)
|
|
6168
|
+
})
|
|
6169
|
+
}
|
|
6170
|
+
|
|
6171
|
+
this.submit();
|
|
6172
|
+
},
|
|
6173
|
+
|
|
6174
|
+
async submit (externalPayload = {}) {
|
|
6175
|
+
if (this.disable) return null
|
|
6176
|
+
|
|
5591
6177
|
this.isSubmitting = true;
|
|
5592
6178
|
|
|
5593
6179
|
try {
|
|
5594
|
-
const
|
|
5595
|
-
|
|
5596
|
-
|
|
6180
|
+
const payload = {
|
|
6181
|
+
id: this.id,
|
|
6182
|
+
payload: this.modelValue,
|
|
6183
|
+
url: this.url,
|
|
6184
|
+
...externalPayload
|
|
6185
|
+
};
|
|
6186
|
+
|
|
6187
|
+
this.$qas.logger.group(
|
|
6188
|
+
`QasFormView - submit -> payload do ${this.entity}/${this.mode}`, [payload]
|
|
5597
6189
|
);
|
|
5598
6190
|
|
|
5599
|
-
|
|
6191
|
+
const response = await this.$store.dispatch(`${this.entity}/${this.mode}`, payload);
|
|
6192
|
+
|
|
6193
|
+
if (this.useDialogOnUnsavedChanges) {
|
|
5600
6194
|
this.cachedResult = quasar.extend(true, {}, this.modelValue);
|
|
5601
6195
|
}
|
|
5602
6196
|
|
|
5603
6197
|
this.mx_setErrors();
|
|
5604
6198
|
NotifySuccess(response.data.status.text || 'Item salvo com sucesso!');
|
|
5605
6199
|
this.$emit('submit-success', response, this.modelValue);
|
|
6200
|
+
|
|
6201
|
+
this.$qas.logger.group(
|
|
6202
|
+
`QasFormView - submit -> resposta da action ${this.entity}/${this.mode}`, [response]
|
|
6203
|
+
);
|
|
5606
6204
|
} catch (error) {
|
|
5607
6205
|
const errors = error?.response?.data?.errors;
|
|
5608
6206
|
const message = error?.response?.data?.status?.text;
|
|
5609
6207
|
const exceptionResponse = error?.response?.data?.exception;
|
|
5610
|
-
|
|
6208
|
+
|
|
6209
|
+
const exception = errors
|
|
6210
|
+
? 'Existem erros de validação no formulário.'
|
|
6211
|
+
: exceptionResponse || error.message;
|
|
5611
6212
|
|
|
5612
6213
|
this.mx_setErrors(errors);
|
|
5613
6214
|
this.$emit('update:errors', this.mx_errors);
|
|
@@ -5615,6 +6216,12 @@ var script$k = {
|
|
|
5615
6216
|
NotifyError(message || 'Ops! Erro ao salvar item.', exception);
|
|
5616
6217
|
|
|
5617
6218
|
this.$emit('submit-error', error);
|
|
6219
|
+
|
|
6220
|
+
this.$qas.logger.group(
|
|
6221
|
+
`QasFormView - submit -> exceção da action ${this.entity}/${this.mode}`,
|
|
6222
|
+
[error],
|
|
6223
|
+
{ error: true }
|
|
6224
|
+
);
|
|
5618
6225
|
} finally {
|
|
5619
6226
|
this.isSubmitting = false;
|
|
5620
6227
|
}
|
|
@@ -5626,7 +6233,7 @@ var script$k = {
|
|
|
5626
6233
|
}
|
|
5627
6234
|
};
|
|
5628
6235
|
|
|
5629
|
-
const _hoisted_1$
|
|
6236
|
+
const _hoisted_1$e = { key: 0 };
|
|
5630
6237
|
const _hoisted_2$9 = { class: "justify-end q-col-gutter-md q-my-lg row" };
|
|
5631
6238
|
const _hoisted_3$6 = { key: 1 };
|
|
5632
6239
|
|
|
@@ -5643,13 +6250,13 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5643
6250
|
}, {
|
|
5644
6251
|
default: vue.withCtx(() => [
|
|
5645
6252
|
(_ctx.mx_hasHeaderSlot)
|
|
5646
|
-
? (vue.openBlock(), vue.createElementBlock("header", _hoisted_1$
|
|
6253
|
+
? (vue.openBlock(), vue.createElementBlock("header", _hoisted_1$e, [
|
|
5647
6254
|
vue.renderSlot(_ctx.$slots, "header")
|
|
5648
6255
|
]))
|
|
5649
6256
|
: vue.createCommentVNode("v-if", true),
|
|
5650
6257
|
vue.createVNode(_component_q_form, {
|
|
5651
6258
|
ref: "form",
|
|
5652
|
-
onSubmit: $options.
|
|
6259
|
+
onSubmit: $options.submitHandler
|
|
5653
6260
|
}, {
|
|
5654
6261
|
default: vue.withCtx(() => [
|
|
5655
6262
|
vue.renderSlot(_ctx.$slots, "default"),
|
|
@@ -5670,7 +6277,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5670
6277
|
type: "button",
|
|
5671
6278
|
onClick: $options.cancel
|
|
5672
6279
|
}, null, 8 /* PROPS */, ["data-cy", "disable", "label", "onClick"]), [
|
|
5673
|
-
[_directive_close_popup
|
|
6280
|
+
[_directive_close_popup]
|
|
5674
6281
|
])
|
|
5675
6282
|
], 2 /* CLASS */))
|
|
5676
6283
|
: vue.createCommentVNode("v-if", true),
|
|
@@ -5840,7 +6447,7 @@ var script$j = {
|
|
|
5840
6447
|
}
|
|
5841
6448
|
};
|
|
5842
6449
|
|
|
5843
|
-
const _hoisted_1$
|
|
6450
|
+
const _hoisted_1$d = { class: "q-col-gutter-md row" };
|
|
5844
6451
|
const _hoisted_2$8 = {
|
|
5845
6452
|
key: 0,
|
|
5846
6453
|
class: "full-width text-center"
|
|
@@ -5862,7 +6469,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5862
6469
|
|
|
5863
6470
|
return (vue.openBlock(), vue.createBlock(_component_qas_box, { class: "gallery" }, {
|
|
5864
6471
|
default: vue.withCtx(() => [
|
|
5865
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6472
|
+
vue.createElementVNode("div", _hoisted_1$d, [
|
|
5866
6473
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.initialImages(), (image, index) => {
|
|
5867
6474
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
5868
6475
|
key: index,
|
|
@@ -5984,10 +6591,6 @@ var script$i = {
|
|
|
5984
6591
|
type: [Array, Object, String]
|
|
5985
6592
|
},
|
|
5986
6593
|
|
|
5987
|
-
hideEmptyResult: {
|
|
5988
|
-
type: Boolean
|
|
5989
|
-
},
|
|
5990
|
-
|
|
5991
6594
|
emptyResultText: {
|
|
5992
6595
|
default: '-',
|
|
5993
6596
|
type: String
|
|
@@ -5996,6 +6599,11 @@ var script$i = {
|
|
|
5996
6599
|
result: {
|
|
5997
6600
|
default: () => ({}),
|
|
5998
6601
|
type: Object
|
|
6602
|
+
},
|
|
6603
|
+
|
|
6604
|
+
useEmptyResult: {
|
|
6605
|
+
default: true,
|
|
6606
|
+
type: Boolean
|
|
5999
6607
|
}
|
|
6000
6608
|
},
|
|
6001
6609
|
|
|
@@ -6007,7 +6615,12 @@ var script$i = {
|
|
|
6007
6615
|
|
|
6008
6616
|
computed: {
|
|
6009
6617
|
formattedFields () {
|
|
6010
|
-
if (
|
|
6618
|
+
if (this.useEmptyResult) {
|
|
6619
|
+
this.$qas.logger.group(
|
|
6620
|
+
'QasGridGenerator - formattedFields -> this.useEmptyResult tem valor "true"',
|
|
6621
|
+
[this.fields]
|
|
6622
|
+
);
|
|
6623
|
+
|
|
6011
6624
|
return this.fields
|
|
6012
6625
|
}
|
|
6013
6626
|
|
|
@@ -6025,6 +6638,8 @@ var script$i = {
|
|
|
6025
6638
|
}
|
|
6026
6639
|
}
|
|
6027
6640
|
|
|
6641
|
+
this.$qas.logger.group('QasGridGenerator - formattedFields', [fields]);
|
|
6642
|
+
|
|
6028
6643
|
return fields
|
|
6029
6644
|
},
|
|
6030
6645
|
|
|
@@ -6040,11 +6655,19 @@ var script$i = {
|
|
|
6040
6655
|
|
|
6041
6656
|
for (const key in result) {
|
|
6042
6657
|
if (this.formattedFields[key]?.type) {
|
|
6043
|
-
formattedResult[key] =
|
|
6044
|
-
|
|
6658
|
+
formattedResult[key] = (
|
|
6659
|
+
humanize(this.formattedFields[key], result[key]) || this.emptyResultText
|
|
6660
|
+
);
|
|
6661
|
+
|
|
6662
|
+
this.slotValue[key] = {
|
|
6663
|
+
...this.formattedFields[key],
|
|
6664
|
+
formattedResult: formattedResult[key]
|
|
6665
|
+
};
|
|
6045
6666
|
}
|
|
6046
6667
|
}
|
|
6047
6668
|
|
|
6669
|
+
this.$qas.logger.group('QasGridGenerator - getResultsByFields', [formattedResult]);
|
|
6670
|
+
|
|
6048
6671
|
return formattedResult
|
|
6049
6672
|
}
|
|
6050
6673
|
}
|
|
@@ -6180,6 +6803,10 @@ var script$g = {
|
|
|
6180
6803
|
}
|
|
6181
6804
|
},
|
|
6182
6805
|
|
|
6806
|
+
mounted () {
|
|
6807
|
+
this.menuDrawer = !this.$qas.screen.untilMedium;
|
|
6808
|
+
},
|
|
6809
|
+
|
|
6183
6810
|
methods: {
|
|
6184
6811
|
toggleMenuDrawer () {
|
|
6185
6812
|
this.menuDrawer = !this.menuDrawer;
|
|
@@ -6240,42 +6867,34 @@ var script$f = {
|
|
|
6240
6867
|
type: Array
|
|
6241
6868
|
},
|
|
6242
6869
|
|
|
6243
|
-
|
|
6244
|
-
default: 'uuid',
|
|
6245
|
-
type: String
|
|
6246
|
-
},
|
|
6247
|
-
|
|
6248
|
-
redirectOnIcon: {
|
|
6249
|
-
default: true,
|
|
6870
|
+
useClickableItem: {
|
|
6250
6871
|
type: Boolean
|
|
6251
6872
|
},
|
|
6252
6873
|
|
|
6253
|
-
to: {
|
|
6254
|
-
default: () => ({}),
|
|
6255
|
-
type: Object
|
|
6256
|
-
},
|
|
6257
|
-
|
|
6258
6874
|
useSectionActions: {
|
|
6259
6875
|
default: true,
|
|
6260
6876
|
type: Boolean
|
|
6261
6877
|
}
|
|
6262
6878
|
},
|
|
6263
6879
|
|
|
6880
|
+
emits: ['click-item'],
|
|
6881
|
+
|
|
6264
6882
|
methods: {
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6883
|
+
onClick ({ item, index }, fromItem) {
|
|
6884
|
+
/**
|
|
6885
|
+
* se o click veio do q-item e "useClickableItem" for "false", ou
|
|
6886
|
+
* se o click não veio do q-item e "useClickableItem" for "true", então retorna sem emitir.
|
|
6887
|
+
*/
|
|
6888
|
+
if (
|
|
6889
|
+
(fromItem && !this.useClickableItem) || (!fromItem && this.useClickableItem)
|
|
6890
|
+
) return
|
|
6271
6891
|
|
|
6272
|
-
|
|
6273
|
-
return this.redirectOnIcon ? undefined : this.getRedirectPayload(item)
|
|
6892
|
+
this.$emit('click-item', { item, index });
|
|
6274
6893
|
}
|
|
6275
6894
|
}
|
|
6276
6895
|
};
|
|
6277
6896
|
|
|
6278
|
-
const _hoisted_1$
|
|
6897
|
+
const _hoisted_1$c = { class: "qas-list-items shadow-14" };
|
|
6279
6898
|
|
|
6280
6899
|
function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6281
6900
|
const _component_q_item_section = vue.resolveComponent("q-item-section");
|
|
@@ -6285,7 +6904,7 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6285
6904
|
const _component_q_list = vue.resolveComponent("q-list");
|
|
6286
6905
|
const _directive_ripple = vue.resolveDirective("ripple");
|
|
6287
6906
|
|
|
6288
|
-
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
6907
|
+
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
6289
6908
|
vue.createVNode(_component_q_list, {
|
|
6290
6909
|
bordered: "",
|
|
6291
6910
|
class: "rounded-borders",
|
|
@@ -6295,8 +6914,8 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6295
6914
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.list, (item, index) => {
|
|
6296
6915
|
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_q_item, {
|
|
6297
6916
|
key: index,
|
|
6298
|
-
clickable:
|
|
6299
|
-
|
|
6917
|
+
clickable: $props.useClickableItem,
|
|
6918
|
+
onClick: $event => ($options.onClick({ item, index }, true))
|
|
6300
6919
|
}, {
|
|
6301
6920
|
default: vue.withCtx(() => [
|
|
6302
6921
|
vue.renderSlot(_ctx.$slots, "item", {
|
|
@@ -6305,7 +6924,7 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6305
6924
|
}, () => [
|
|
6306
6925
|
vue.createVNode(_component_q_item_section, null, {
|
|
6307
6926
|
default: vue.withCtx(() => [
|
|
6308
|
-
vue.renderSlot(_ctx.$slots, "item-section
|
|
6927
|
+
vue.renderSlot(_ctx.$slots, "item-section", {
|
|
6309
6928
|
index: index,
|
|
6310
6929
|
item: item
|
|
6311
6930
|
})
|
|
@@ -6325,13 +6944,13 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6325
6944
|
vue.createVNode(_component_qas_btn, {
|
|
6326
6945
|
flat: "",
|
|
6327
6946
|
round: "",
|
|
6328
|
-
|
|
6947
|
+
onClick: $event => ($options.onClick({ item, index }))
|
|
6329
6948
|
}, {
|
|
6330
6949
|
default: vue.withCtx(() => [
|
|
6331
6950
|
vue.createVNode(_component_q_icon, vue.normalizeProps(vue.guardReactiveProps($props.iconProps)), null, 16 /* FULL_PROPS */)
|
|
6332
6951
|
]),
|
|
6333
6952
|
_: 2 /* DYNAMIC */
|
|
6334
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["
|
|
6953
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])
|
|
6335
6954
|
])
|
|
6336
6955
|
]),
|
|
6337
6956
|
_: 2 /* DYNAMIC */
|
|
@@ -6340,7 +6959,7 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6340
6959
|
])
|
|
6341
6960
|
]),
|
|
6342
6961
|
_: 2 /* DYNAMIC */
|
|
6343
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["clickable", "
|
|
6962
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["clickable", "onClick"])), [
|
|
6344
6963
|
[_directive_ripple]
|
|
6345
6964
|
])
|
|
6346
6965
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -6361,15 +6980,6 @@ var script$e = {
|
|
|
6361
6980
|
mixins: [contextMixin, viewMixin],
|
|
6362
6981
|
|
|
6363
6982
|
props: {
|
|
6364
|
-
disableRefresh: {
|
|
6365
|
-
type: Boolean
|
|
6366
|
-
},
|
|
6367
|
-
|
|
6368
|
-
useFilter: {
|
|
6369
|
-
default: true,
|
|
6370
|
-
type: Boolean
|
|
6371
|
-
},
|
|
6372
|
-
|
|
6373
6983
|
filtersProps: {
|
|
6374
6984
|
default: () => ({}),
|
|
6375
6985
|
type: Object
|
|
@@ -6378,6 +6988,20 @@ var script$e = {
|
|
|
6378
6988
|
results: {
|
|
6379
6989
|
default: () => [],
|
|
6380
6990
|
type: Array
|
|
6991
|
+
},
|
|
6992
|
+
|
|
6993
|
+
useRefresh: {
|
|
6994
|
+
default: true,
|
|
6995
|
+
type: Boolean
|
|
6996
|
+
},
|
|
6997
|
+
|
|
6998
|
+
useFilter: {
|
|
6999
|
+
default: true,
|
|
7000
|
+
type: Boolean
|
|
7001
|
+
},
|
|
7002
|
+
|
|
7003
|
+
useResultsAreaOnly: {
|
|
7004
|
+
type: Boolean
|
|
6381
7005
|
}
|
|
6382
7006
|
},
|
|
6383
7007
|
|
|
@@ -6413,13 +7037,17 @@ var script$e = {
|
|
|
6413
7037
|
|
|
6414
7038
|
totalPages () {
|
|
6415
7039
|
return this.$store.getters[`${this.entity}/totalPages`]
|
|
7040
|
+
},
|
|
7041
|
+
|
|
7042
|
+
showResults () {
|
|
7043
|
+
return this.hasResults || this.useResultsAreaOnly
|
|
6416
7044
|
}
|
|
6417
7045
|
},
|
|
6418
7046
|
|
|
6419
7047
|
watch: {
|
|
6420
7048
|
$route (to, from) {
|
|
6421
7049
|
if (to.name === from.name) {
|
|
6422
|
-
this.fetchList
|
|
7050
|
+
this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
|
|
6423
7051
|
this.setCurrentPage();
|
|
6424
7052
|
}
|
|
6425
7053
|
},
|
|
@@ -6434,7 +7062,8 @@ var script$e = {
|
|
|
6434
7062
|
},
|
|
6435
7063
|
|
|
6436
7064
|
created () {
|
|
6437
|
-
this.fetchList
|
|
7065
|
+
this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
|
|
7066
|
+
|
|
6438
7067
|
this.setCurrentPage();
|
|
6439
7068
|
},
|
|
6440
7069
|
|
|
@@ -6444,21 +7073,22 @@ var script$e = {
|
|
|
6444
7073
|
this.$router.push({ query });
|
|
6445
7074
|
},
|
|
6446
7075
|
|
|
6447
|
-
async fetchList (
|
|
7076
|
+
async fetchList (externalPayload = {}) {
|
|
6448
7077
|
this.mx_isFetching = true;
|
|
6449
7078
|
|
|
6450
|
-
const hasFilters = !!Object.keys(filters).length;
|
|
6451
|
-
|
|
6452
7079
|
try {
|
|
6453
|
-
const
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
7080
|
+
const payload = {
|
|
7081
|
+
...this.mx_context,
|
|
7082
|
+
url: this.url,
|
|
7083
|
+
...externalPayload
|
|
7084
|
+
};
|
|
7085
|
+
|
|
7086
|
+
this.$qas.logger.group(
|
|
7087
|
+
`QasListView - fetchList -> Payload do parâmetro do ${this.entity}/fetchList`, [payload]
|
|
6460
7088
|
);
|
|
6461
7089
|
|
|
7090
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchList`, payload);
|
|
7091
|
+
|
|
6462
7092
|
const { errors, fields, metadata } = response.data;
|
|
6463
7093
|
|
|
6464
7094
|
this.mx_setErrors(errors);
|
|
@@ -6472,17 +7102,27 @@ var script$e = {
|
|
|
6472
7102
|
});
|
|
6473
7103
|
|
|
6474
7104
|
this.$emit('fetch-success', response);
|
|
7105
|
+
|
|
7106
|
+
this.$qas.logger.group(
|
|
7107
|
+
`QasListView - fetchList -> resposta da action ${this.entity}/fetchList`, [response]
|
|
7108
|
+
);
|
|
6475
7109
|
} catch (error) {
|
|
6476
7110
|
this.mx_fetchError(error);
|
|
6477
7111
|
this.$emit('update:errors', error);
|
|
6478
7112
|
this.$emit('fetch-error', error);
|
|
7113
|
+
|
|
7114
|
+
this.$qas.logger.group(
|
|
7115
|
+
`QasListView - fetchSingle -> exceção da action ${this.entity}/fetchList`,
|
|
7116
|
+
[error],
|
|
7117
|
+
{ error: true }
|
|
7118
|
+
);
|
|
6479
7119
|
} finally {
|
|
6480
7120
|
this.mx_isFetching = false;
|
|
6481
7121
|
}
|
|
6482
7122
|
},
|
|
6483
7123
|
|
|
6484
7124
|
async refresh (done) {
|
|
6485
|
-
await this.fetchList
|
|
7125
|
+
await this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
|
|
6486
7126
|
|
|
6487
7127
|
if (typeof done === 'function') {
|
|
6488
7128
|
done();
|
|
@@ -6495,7 +7135,7 @@ var script$e = {
|
|
|
6495
7135
|
}
|
|
6496
7136
|
};
|
|
6497
7137
|
|
|
6498
|
-
const _hoisted_1$
|
|
7138
|
+
const _hoisted_1$b = { key: 0 };
|
|
6499
7139
|
const _hoisted_2$7 = { class: "relative-position" };
|
|
6500
7140
|
const _hoisted_3$4 = { key: 0 };
|
|
6501
7141
|
const _hoisted_4$4 = { key: 1 };
|
|
@@ -6523,12 +7163,12 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6523
7163
|
}, {
|
|
6524
7164
|
default: vue.withCtx(() => [
|
|
6525
7165
|
vue.createVNode(_component_q_pull_to_refresh, {
|
|
6526
|
-
disable:
|
|
7166
|
+
disable: !$props.useRefresh,
|
|
6527
7167
|
onRefresh: $options.refresh
|
|
6528
7168
|
}, {
|
|
6529
7169
|
default: vue.withCtx(() => [
|
|
6530
7170
|
($options.hasHeaderSlot)
|
|
6531
|
-
? (vue.openBlock(), vue.createElementBlock("header", _hoisted_1$
|
|
7171
|
+
? (vue.openBlock(), vue.createElementBlock("header", _hoisted_1$b, [
|
|
6532
7172
|
vue.renderSlot(_ctx.$slots, "header")
|
|
6533
7173
|
]))
|
|
6534
7174
|
: vue.createCommentVNode("v-if", true),
|
|
@@ -6538,7 +7178,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6538
7178
|
])
|
|
6539
7179
|
: vue.createCommentVNode("v-if", true),
|
|
6540
7180
|
vue.createElementVNode("main", _hoisted_2$7, [
|
|
6541
|
-
($options.
|
|
7181
|
+
($options.showResults)
|
|
6542
7182
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, [
|
|
6543
7183
|
vue.renderSlot(_ctx.$slots, "default")
|
|
6544
7184
|
]))
|
|
@@ -6615,13 +7255,13 @@ var script$d = {
|
|
|
6615
7255
|
default: () => []
|
|
6616
7256
|
},
|
|
6617
7257
|
|
|
6618
|
-
usePopup: {
|
|
6619
|
-
type: Boolean
|
|
6620
|
-
},
|
|
6621
|
-
|
|
6622
7258
|
zoom: {
|
|
6623
7259
|
type: Number,
|
|
6624
7260
|
default: 17
|
|
7261
|
+
},
|
|
7262
|
+
|
|
7263
|
+
usePopup: {
|
|
7264
|
+
type: Boolean
|
|
6625
7265
|
}
|
|
6626
7266
|
},
|
|
6627
7267
|
|
|
@@ -6655,7 +7295,7 @@ var script$d = {
|
|
|
6655
7295
|
}
|
|
6656
7296
|
};
|
|
6657
7297
|
|
|
6658
|
-
const _hoisted_1$
|
|
7298
|
+
const _hoisted_1$a = { class: "qas-map" };
|
|
6659
7299
|
const _hoisted_2$6 = { class: "text-weight-bold" };
|
|
6660
7300
|
|
|
6661
7301
|
function render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -6663,7 +7303,7 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6663
7303
|
const _component_g_map_marker = vue.resolveComponent("g-map-marker");
|
|
6664
7304
|
const _component_g_map_map = vue.resolveComponent("g-map-map");
|
|
6665
7305
|
|
|
6666
|
-
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
7306
|
+
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
6667
7307
|
vue.createVNode(_component_g_map_map, {
|
|
6668
7308
|
center: $props.centerPosition,
|
|
6669
7309
|
class: "qas-map__draw",
|
|
@@ -6722,7 +7362,7 @@ var script$c = {
|
|
|
6722
7362
|
default: 'Inserir novo campo'
|
|
6723
7363
|
},
|
|
6724
7364
|
|
|
6725
|
-
|
|
7365
|
+
buttonDestroyProps: {
|
|
6726
7366
|
type: Object,
|
|
6727
7367
|
default: () => {
|
|
6728
7368
|
return {
|
|
@@ -6734,14 +7374,14 @@ var script$c = {
|
|
|
6734
7374
|
}
|
|
6735
7375
|
},
|
|
6736
7376
|
|
|
6737
|
-
|
|
7377
|
+
buttonDuplicateProps: {
|
|
6738
7378
|
type: Object,
|
|
6739
7379
|
default: () => {
|
|
6740
7380
|
return {
|
|
6741
7381
|
label: 'Duplicar',
|
|
6742
7382
|
icon: 'o_content_copy',
|
|
6743
7383
|
flat: true,
|
|
6744
|
-
|
|
7384
|
+
useLabelOnSmallScreen: false,
|
|
6745
7385
|
dense: true
|
|
6746
7386
|
}
|
|
6747
7387
|
}
|
|
@@ -6786,6 +7426,11 @@ var script$c = {
|
|
|
6786
7426
|
}
|
|
6787
7427
|
},
|
|
6788
7428
|
|
|
7429
|
+
identifierItemKey: {
|
|
7430
|
+
type: String,
|
|
7431
|
+
default: 'uuid'
|
|
7432
|
+
},
|
|
7433
|
+
|
|
6789
7434
|
rowLabel: {
|
|
6790
7435
|
type: String,
|
|
6791
7436
|
default: ''
|
|
@@ -6851,13 +7496,7 @@ var script$c = {
|
|
|
6851
7496
|
},
|
|
6852
7497
|
|
|
6853
7498
|
children () {
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
for (const key in field?.children) {
|
|
6857
|
-
field.children[key].name = humps.camelize(field?.children[key].name);
|
|
6858
|
-
}
|
|
6859
|
-
|
|
6860
|
-
return field?.children
|
|
7499
|
+
return this.field?.children
|
|
6861
7500
|
},
|
|
6862
7501
|
|
|
6863
7502
|
showDestroyBtn () {
|
|
@@ -6884,8 +7523,7 @@ var script$c = {
|
|
|
6884
7523
|
|
|
6885
7524
|
return {
|
|
6886
7525
|
tag: 'div',
|
|
6887
|
-
enterActiveClass: 'animated slideInDown'
|
|
6888
|
-
leaveActiveClass: 'animated slideOutUp'
|
|
7526
|
+
enterActiveClass: 'animated slideInDown'
|
|
6889
7527
|
}
|
|
6890
7528
|
}
|
|
6891
7529
|
},
|
|
@@ -6898,9 +7536,9 @@ var script$c = {
|
|
|
6898
7536
|
immediate: true
|
|
6899
7537
|
},
|
|
6900
7538
|
|
|
6901
|
-
|
|
7539
|
+
rowObject: {
|
|
6902
7540
|
handler () {
|
|
6903
|
-
!this.
|
|
7541
|
+
if (!this.nested.length) return this.setDefaultNestedValue()
|
|
6904
7542
|
},
|
|
6905
7543
|
immediate: true
|
|
6906
7544
|
}
|
|
@@ -6908,13 +7546,22 @@ var script$c = {
|
|
|
6908
7546
|
|
|
6909
7547
|
methods: {
|
|
6910
7548
|
add (row = {}) {
|
|
6911
|
-
|
|
7549
|
+
const payload = { ...this.rowObject, ...row };
|
|
7550
|
+
const hasIdentifierKey = payload[this.identifierItemKey];
|
|
7551
|
+
|
|
7552
|
+
if (hasIdentifierKey) {
|
|
7553
|
+
delete payload[this.identifierItemKey];
|
|
7554
|
+
}
|
|
7555
|
+
|
|
7556
|
+
this.nested.push(payload);
|
|
6912
7557
|
|
|
6913
7558
|
this.$nextTick(() => {
|
|
6914
7559
|
this.useAnimation && this.setScroll();
|
|
6915
7560
|
this.setFocus();
|
|
6916
7561
|
});
|
|
6917
7562
|
|
|
7563
|
+
this.$qas.logger.group('QasNestedFields - add', [payload]);
|
|
7564
|
+
|
|
6918
7565
|
return this.updateModelValue()
|
|
6919
7566
|
},
|
|
6920
7567
|
|
|
@@ -6930,10 +7577,12 @@ var script$c = {
|
|
|
6930
7577
|
},
|
|
6931
7578
|
|
|
6932
7579
|
destroy (index, row) {
|
|
6933
|
-
this.useRemoveOnDestroy
|
|
7580
|
+
!row[this.identifierItemKey] && this.useRemoveOnDestroy
|
|
6934
7581
|
? this.nested.splice(index, 1)
|
|
6935
7582
|
: this.nested.splice(index, 1, { [this.destroyKey]: true, ...row });
|
|
6936
7583
|
|
|
7584
|
+
this.$qas.logger.group('QasNestedFields - destroy', [{ index, row }]);
|
|
7585
|
+
|
|
6937
7586
|
return this.updateModelValue()
|
|
6938
7587
|
},
|
|
6939
7588
|
|
|
@@ -6959,7 +7608,7 @@ var script$c = {
|
|
|
6959
7608
|
});
|
|
6960
7609
|
},
|
|
6961
7610
|
|
|
6962
|
-
|
|
7611
|
+
getRowLabel (rowKey) {
|
|
6963
7612
|
if (this.rowLabel) {
|
|
6964
7613
|
return this.useIndexLabel ? `${this.rowLabel} ${rowKey + 1}` : this.rowLabel
|
|
6965
7614
|
}
|
|
@@ -6969,7 +7618,7 @@ var script$c = {
|
|
|
6969
7618
|
}
|
|
6970
7619
|
};
|
|
6971
7620
|
|
|
6972
|
-
const _hoisted_1$
|
|
7621
|
+
const _hoisted_1$9 = ["id"];
|
|
6973
7622
|
const _hoisted_2$5 = { class: "text-left" };
|
|
6974
7623
|
const _hoisted_3$3 = { ref: "inputContent" };
|
|
6975
7624
|
const _hoisted_4$3 = ["id"];
|
|
@@ -7030,18 +7679,18 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7030
7679
|
(!$props.useSingleLabel)
|
|
7031
7680
|
? (vue.openBlock(), vue.createBlock(_component_qas_label, {
|
|
7032
7681
|
key: 0,
|
|
7033
|
-
label: $options.
|
|
7682
|
+
label: $options.getRowLabel(index)
|
|
7034
7683
|
}, null, 8 /* PROPS */, ["label"]))
|
|
7035
7684
|
: vue.createCommentVNode("v-if", true),
|
|
7036
7685
|
(!$props.useInlineActions)
|
|
7037
7686
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
7038
7687
|
($props.useDuplicate)
|
|
7039
|
-
? (vue.openBlock(), vue.createBlock(_component_qas_btn, vue.mergeProps({ key: 0 }, $props.
|
|
7688
|
+
? (vue.openBlock(), vue.createBlock(_component_qas_btn, vue.mergeProps({ key: 0 }, $props.buttonDuplicateProps, {
|
|
7040
7689
|
onClick: $event => ($options.add(row))
|
|
7041
7690
|
}), null, 16 /* FULL_PROPS */, ["onClick"]))
|
|
7042
7691
|
: vue.createCommentVNode("v-if", true),
|
|
7043
7692
|
($options.showDestroyBtn)
|
|
7044
|
-
? (vue.openBlock(), vue.createBlock(_component_qas_btn, vue.mergeProps({ key: 1 }, $props.
|
|
7693
|
+
? (vue.openBlock(), vue.createBlock(_component_qas_btn, vue.mergeProps({ key: 1 }, $props.buttonDestroyProps, {
|
|
7045
7694
|
onClick: $event => ($options.destroy(index, row))
|
|
7046
7695
|
}), null, 16 /* FULL_PROPS */, ["onClick"]))
|
|
7047
7696
|
: vue.createCommentVNode("v-if", true)
|
|
@@ -7168,7 +7817,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7168
7817
|
])
|
|
7169
7818
|
])
|
|
7170
7819
|
], 512 /* NEED_PATCH */)
|
|
7171
|
-
], 8 /* PROPS */, _hoisted_1$
|
|
7820
|
+
], 8 /* PROPS */, _hoisted_1$9))
|
|
7172
7821
|
}
|
|
7173
7822
|
|
|
7174
7823
|
script$c.render = render$c;
|
|
@@ -7179,17 +7828,20 @@ const { hasPreviousRoute, history: history$1, getPreviousRoute } = useHistory();
|
|
|
7179
7828
|
var script$b = {
|
|
7180
7829
|
name: 'QasPageHeader',
|
|
7181
7830
|
|
|
7831
|
+
mixins: [
|
|
7832
|
+
quasar.createMetaMixin(function () {
|
|
7833
|
+
return {
|
|
7834
|
+
title: this.title
|
|
7835
|
+
}
|
|
7836
|
+
})
|
|
7837
|
+
],
|
|
7838
|
+
|
|
7182
7839
|
props: {
|
|
7183
7840
|
breadcrumbs: {
|
|
7184
7841
|
default: '',
|
|
7185
7842
|
type: [Array, String]
|
|
7186
7843
|
},
|
|
7187
7844
|
|
|
7188
|
-
useBreadcrumbs: {
|
|
7189
|
-
default: true,
|
|
7190
|
-
type: Boolean
|
|
7191
|
-
},
|
|
7192
|
-
|
|
7193
7845
|
root: {
|
|
7194
7846
|
default: '',
|
|
7195
7847
|
type: [Object, String]
|
|
@@ -7198,6 +7850,11 @@ var script$b = {
|
|
|
7198
7850
|
title: {
|
|
7199
7851
|
default: '',
|
|
7200
7852
|
type: String
|
|
7853
|
+
},
|
|
7854
|
+
|
|
7855
|
+
useBreadcrumbs: {
|
|
7856
|
+
default: true,
|
|
7857
|
+
type: Boolean
|
|
7201
7858
|
}
|
|
7202
7859
|
},
|
|
7203
7860
|
|
|
@@ -7241,16 +7898,10 @@ var script$b = {
|
|
|
7241
7898
|
|
|
7242
7899
|
return lastIndex === index ? 'text-grey-7' : 'text-primary'
|
|
7243
7900
|
}
|
|
7244
|
-
},
|
|
7245
|
-
|
|
7246
|
-
meta () {
|
|
7247
|
-
return {
|
|
7248
|
-
title: this.title
|
|
7249
|
-
}
|
|
7250
7901
|
}
|
|
7251
7902
|
};
|
|
7252
7903
|
|
|
7253
|
-
const _hoisted_1$
|
|
7904
|
+
const _hoisted_1$8 = { class: "ellipsis" };
|
|
7254
7905
|
|
|
7255
7906
|
function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7256
7907
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
@@ -7261,7 +7912,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7261
7912
|
|
|
7262
7913
|
return (vue.openBlock(), vue.createBlock(_component_q_toolbar, { class: "justify-between q-mb-lg q-px-none" }, {
|
|
7263
7914
|
default: vue.withCtx(() => [
|
|
7264
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
7915
|
+
vue.createElementVNode("div", _hoisted_1$8, [
|
|
7265
7916
|
($props.title)
|
|
7266
7917
|
? (vue.openBlock(), vue.createBlock(_component_q_toolbar_title, {
|
|
7267
7918
|
key: 0,
|
|
@@ -7377,7 +8028,7 @@ var script$a = {
|
|
|
7377
8028
|
}
|
|
7378
8029
|
};
|
|
7379
8030
|
|
|
7380
|
-
const _hoisted_1$
|
|
8031
|
+
const _hoisted_1$7 = { class: "q-col-gutter-md row" };
|
|
7381
8032
|
const _hoisted_2$4 = { class: "col-lg-5 col-xs-12" };
|
|
7382
8033
|
const _hoisted_3$2 = { class: "justify-center lg:q-mb-none md:q-mr-lg row xs:q-mb-md" };
|
|
7383
8034
|
const _hoisted_4$2 = { class: "text-bold text-h6" };
|
|
@@ -7389,7 +8040,7 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7389
8040
|
|
|
7390
8041
|
return (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.tag), null, {
|
|
7391
8042
|
default: vue.withCtx(() => [
|
|
7392
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
8043
|
+
vue.createElementVNode("div", _hoisted_1$7, [
|
|
7393
8044
|
vue.createElementVNode("div", _hoisted_2$4, [
|
|
7394
8045
|
vue.createElementVNode("div", {
|
|
7395
8046
|
class: vue.normalizeClass(["no-wrap q-col-gutter-md", $options.directionClasses])
|
|
@@ -7414,8 +8065,8 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7414
8065
|
class: "col-lg-7 col-xs-12 items-center",
|
|
7415
8066
|
columns: $props.columns,
|
|
7416
8067
|
fields: $options.filterObject($props.fields, $props.list),
|
|
7417
|
-
|
|
7418
|
-
result:
|
|
8068
|
+
result: $props.result,
|
|
8069
|
+
"use-empty-result": false
|
|
7419
8070
|
}, vue.createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
7420
8071
|
vue.renderList(_ctx.$slots, (_, name) => {
|
|
7421
8072
|
return {
|
|
@@ -7515,7 +8166,7 @@ var script$9 = {
|
|
|
7515
8166
|
}
|
|
7516
8167
|
};
|
|
7517
8168
|
|
|
7518
|
-
const _hoisted_1$
|
|
8169
|
+
const _hoisted_1$6 = /*#__PURE__*/vue.createElementVNode("div", { class: "absolute-full bg-grey-2 flex flex-center text-grey" }, "⚠︎", -1 /* HOISTED */);
|
|
7519
8170
|
|
|
7520
8171
|
function render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7521
8172
|
const _component_q_img = vue.resolveComponent("q-img");
|
|
@@ -7526,7 +8177,7 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7526
8177
|
src: $options.imageSource
|
|
7527
8178
|
}, {
|
|
7528
8179
|
error: vue.withCtx(() => [
|
|
7529
|
-
_hoisted_1$
|
|
8180
|
+
_hoisted_1$6
|
|
7530
8181
|
]),
|
|
7531
8182
|
_: 1 /* STABLE */
|
|
7532
8183
|
}, 8 /* PROPS */, ["ratio", "src"]))
|
|
@@ -7539,15 +8190,23 @@ var script$8 = {
|
|
|
7539
8190
|
name: 'QasSearchBox',
|
|
7540
8191
|
|
|
7541
8192
|
components: {
|
|
7542
|
-
QasBox: script$D
|
|
8193
|
+
QasBox: script$D,
|
|
8194
|
+
QInfiniteScroll: quasar.QInfiniteScroll
|
|
7543
8195
|
},
|
|
7544
8196
|
|
|
8197
|
+
mixins: [searchFilterMixin],
|
|
8198
|
+
|
|
7545
8199
|
props: {
|
|
7546
8200
|
emptyListHeight: {
|
|
7547
8201
|
default: '100px',
|
|
7548
8202
|
type: String
|
|
7549
8203
|
},
|
|
7550
8204
|
|
|
8205
|
+
emptyResultText: {
|
|
8206
|
+
default: 'Não há resultados disponíveis.',
|
|
8207
|
+
type: String
|
|
8208
|
+
},
|
|
8209
|
+
|
|
7551
8210
|
fuseOptions: {
|
|
7552
8211
|
default: () => ({}),
|
|
7553
8212
|
type: Object
|
|
@@ -7592,15 +8251,52 @@ var script$8 = {
|
|
|
7592
8251
|
|
|
7593
8252
|
data () {
|
|
7594
8253
|
return {
|
|
7595
|
-
fuse: null
|
|
7596
|
-
searchResults: this.list,
|
|
7597
|
-
search: ''
|
|
8254
|
+
fuse: null
|
|
7598
8255
|
}
|
|
7599
8256
|
},
|
|
7600
8257
|
|
|
7601
8258
|
computed: {
|
|
7602
|
-
|
|
7603
|
-
return {
|
|
8259
|
+
attributes () {
|
|
8260
|
+
return {
|
|
8261
|
+
clearable: true,
|
|
8262
|
+
disable: this.isDisabled,
|
|
8263
|
+
debounce: this.useLazyLoading ? 500 : 0,
|
|
8264
|
+
outlined: true,
|
|
8265
|
+
placeholder: this.placeholder,
|
|
8266
|
+
hideBottomSpace: true,
|
|
8267
|
+
error: this.mx_hasFetchError,
|
|
8268
|
+
loading: this.mx_isFetching
|
|
8269
|
+
}
|
|
8270
|
+
},
|
|
8271
|
+
|
|
8272
|
+
containerStyle () {
|
|
8273
|
+
return { height: this.containerHeight }
|
|
8274
|
+
},
|
|
8275
|
+
|
|
8276
|
+
hasNoOptionsOnFirstFetch () {
|
|
8277
|
+
return this.mx_fetchCount === 1 && !this.mx_hasFilteredOptions
|
|
8278
|
+
},
|
|
8279
|
+
|
|
8280
|
+
containerHeight () {
|
|
8281
|
+
const hasEmptyList = (!this.list.length && !this.useLazyLoading) || this.hasNoOptionsOnFirstFetch;
|
|
8282
|
+
|
|
8283
|
+
return hasEmptyList ? this.emptyListHeight : this.height
|
|
8284
|
+
},
|
|
8285
|
+
|
|
8286
|
+
component () {
|
|
8287
|
+
const infiniteScrollProps = {
|
|
8288
|
+
offset: 100,
|
|
8289
|
+
scrollTarget: this.$refs.scrollContainer,
|
|
8290
|
+
ref: 'infiniteScrollRef'
|
|
8291
|
+
};
|
|
8292
|
+
|
|
8293
|
+
return {
|
|
8294
|
+
is: this.useLazyLoading ? 'q-infinite-scroll' : 'div',
|
|
8295
|
+
props: {
|
|
8296
|
+
...(this.useLazyLoading && infiniteScrollProps),
|
|
8297
|
+
...(this.useLazyLoading && { onLoad: this.onInfiniteScroll })
|
|
8298
|
+
}
|
|
8299
|
+
}
|
|
7604
8300
|
},
|
|
7605
8301
|
|
|
7606
8302
|
defaultFuseOptions () {
|
|
@@ -7612,85 +8308,127 @@ var script$8 = {
|
|
|
7612
8308
|
}
|
|
7613
8309
|
},
|
|
7614
8310
|
|
|
7615
|
-
|
|
7616
|
-
return
|
|
8311
|
+
isDisabled () {
|
|
8312
|
+
return (!this.useLazyLoading && !this.list.length) || this.mx_isFetching || this.hasNoOptionsOnFirstFetch
|
|
8313
|
+
},
|
|
8314
|
+
|
|
8315
|
+
showEmptyResult () {
|
|
8316
|
+
return this.useEmptySlot && !this.mx_hasFilteredOptions && !this.mx_isFetching
|
|
8317
|
+
},
|
|
8318
|
+
|
|
8319
|
+
showSpinnerDots () {
|
|
8320
|
+
return this.mx_hasFilteredOptions && this.mx_isFetching
|
|
8321
|
+
},
|
|
8322
|
+
|
|
8323
|
+
showInnerLoading () {
|
|
8324
|
+
return !this.mx_hasFilteredOptions && this.mx_isFetching
|
|
7617
8325
|
}
|
|
7618
8326
|
},
|
|
7619
8327
|
|
|
7620
8328
|
watch: {
|
|
7621
8329
|
defaultFuseOptions (value) {
|
|
8330
|
+
if (this.useLazyLoading) return
|
|
8331
|
+
|
|
7622
8332
|
this.fuse.options = { ...this.fuse.options, ...value };
|
|
7623
8333
|
},
|
|
7624
8334
|
|
|
7625
|
-
|
|
8335
|
+
mx_hasFilteredOptions (value) {
|
|
7626
8336
|
!value && this.$emit('empty-result');
|
|
7627
8337
|
},
|
|
7628
8338
|
|
|
7629
|
-
|
|
7630
|
-
handler (value) {
|
|
7631
|
-
this
|
|
8339
|
+
mx_search: {
|
|
8340
|
+
async handler (value) {
|
|
8341
|
+
this.$emit('update:modelValue', value);
|
|
7632
8342
|
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
8343
|
+
if (this.useLazyLoading) {
|
|
8344
|
+
await this.mx_filterOptionsByStore(value);
|
|
8345
|
+
|
|
8346
|
+
this.$refs.infiniteScrollRef.resume();
|
|
8347
|
+
this.$refs.search.focus();
|
|
8348
|
+
|
|
8349
|
+
return
|
|
8350
|
+
}
|
|
7636
8351
|
|
|
7637
|
-
|
|
8352
|
+
this.filterOptionsByFuse(value);
|
|
8353
|
+
}
|
|
7638
8354
|
},
|
|
7639
8355
|
|
|
7640
|
-
|
|
8356
|
+
modelValue: {
|
|
7641
8357
|
handler (value) {
|
|
7642
|
-
this.
|
|
7643
|
-
this.$emit('update:modelValue', value);
|
|
8358
|
+
this.mx_search = value;
|
|
7644
8359
|
},
|
|
7645
8360
|
|
|
7646
8361
|
immediate: true
|
|
7647
8362
|
},
|
|
7648
8363
|
|
|
7649
|
-
|
|
7650
|
-
handler (
|
|
7651
|
-
this
|
|
8364
|
+
mx_filteredOptions: {
|
|
8365
|
+
handler (options) {
|
|
8366
|
+
this.$emit('update:results', options);
|
|
7652
8367
|
},
|
|
8368
|
+
|
|
7653
8369
|
immediate: true
|
|
7654
8370
|
}
|
|
7655
8371
|
},
|
|
7656
8372
|
|
|
7657
8373
|
created () {
|
|
7658
|
-
this.
|
|
8374
|
+
if (this.useLazyLoading) return
|
|
8375
|
+
|
|
8376
|
+
this.mx_filteredOptions = this.list;
|
|
7659
8377
|
this.fuse = new Fuse__default["default"](this.list, this.defaultFuseOptions);
|
|
7660
|
-
|
|
8378
|
+
|
|
8379
|
+
this.setListWatcher();
|
|
7661
8380
|
},
|
|
7662
8381
|
|
|
7663
8382
|
methods: {
|
|
7664
|
-
|
|
7665
|
-
this.
|
|
7666
|
-
|
|
7667
|
-
|
|
8383
|
+
filterOptionsByFuse (value) {
|
|
8384
|
+
this.mx_filteredOptions = value ? this.mx_getNormalizedFuseResults(this.fuse.search(value)) : this.list;
|
|
8385
|
+
},
|
|
8386
|
+
|
|
8387
|
+
async onInfiniteScroll (_, done) {
|
|
8388
|
+
// Se tiver erro no primeiro fetch, retorna o "done" na proxima.
|
|
8389
|
+
if (((this.mx_hasFetchError && !this.mx_hasFilteredOptions) || this.hasNoOptionsOnFirstFetch)) return done()
|
|
8390
|
+
|
|
8391
|
+
if (!this.mx_hasFilteredOptions && !this.mx_search) {
|
|
8392
|
+
await this.mx_setFetchOptions();
|
|
8393
|
+
return done()
|
|
8394
|
+
}
|
|
8395
|
+
|
|
8396
|
+
if (this.mx_canFetchOptions()) {
|
|
8397
|
+
await this.mx_loadMoreOptions();
|
|
8398
|
+
return done()
|
|
8399
|
+
}
|
|
8400
|
+
|
|
8401
|
+
done(true);
|
|
7668
8402
|
},
|
|
7669
8403
|
|
|
7670
|
-
|
|
7671
|
-
this.$
|
|
8404
|
+
setListWatcher () {
|
|
8405
|
+
this.$watch('list', value => {
|
|
8406
|
+
this.fuse = new Fuse__default["default"](value, this.defaultFuseOptions);
|
|
8407
|
+
|
|
8408
|
+
this.filterOptionsByFuse(this.mx_search);
|
|
8409
|
+
}, { deep: true });
|
|
7672
8410
|
}
|
|
7673
8411
|
}
|
|
7674
8412
|
};
|
|
7675
8413
|
|
|
7676
|
-
const _hoisted_1$
|
|
7677
|
-
const _hoisted_2$3 =
|
|
8414
|
+
const _hoisted_1$5 = { class: "flex justify-center q-pb-sm" };
|
|
8415
|
+
const _hoisted_2$3 = { class: "absolute-center text-center" };
|
|
7678
8416
|
|
|
7679
8417
|
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7680
8418
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
7681
|
-
const
|
|
8419
|
+
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
8420
|
+
const _component_q_spinner_dots = vue.resolveComponent("q-spinner-dots");
|
|
8421
|
+
const _component_q_spinner = vue.resolveComponent("q-spinner");
|
|
8422
|
+
const _component_q_inner_loading = vue.resolveComponent("q-inner-loading");
|
|
7682
8423
|
const _component_qas_box = vue.resolveComponent("qas-box");
|
|
7683
8424
|
|
|
7684
8425
|
return (vue.openBlock(), vue.createBlock(_component_qas_box, null, {
|
|
7685
8426
|
default: vue.withCtx(() => [
|
|
7686
|
-
vue.createVNode(
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
outlined: "",
|
|
7692
|
-
placeholder: $props.placeholder
|
|
7693
|
-
}, {
|
|
8427
|
+
vue.createVNode(_component_qas_input, vue.mergeProps($options.attributes, {
|
|
8428
|
+
ref: "search",
|
|
8429
|
+
modelValue: _ctx.mx_search,
|
|
8430
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.mx_search) = $event))
|
|
8431
|
+
}), {
|
|
7694
8432
|
append: vue.withCtx(() => [
|
|
7695
8433
|
vue.createVNode(_component_q_icon, {
|
|
7696
8434
|
color: "primary",
|
|
@@ -7698,26 +8436,52 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7698
8436
|
})
|
|
7699
8437
|
]),
|
|
7700
8438
|
_: 1 /* STABLE */
|
|
7701
|
-
},
|
|
8439
|
+
}, 16 /* FULL_PROPS */, ["modelValue"]),
|
|
7702
8440
|
vue.createElementVNode("div", {
|
|
8441
|
+
ref: "scrollContainer",
|
|
7703
8442
|
class: "overflow-auto q-mt-xs relative-position",
|
|
7704
|
-
style: vue.normalizeStyle($options.
|
|
8443
|
+
style: vue.normalizeStyle($options.containerStyle)
|
|
7705
8444
|
}, [
|
|
7706
|
-
($options.
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
8445
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($options.component.is), vue.normalizeProps(vue.guardReactiveProps($options.component.props)), {
|
|
8446
|
+
default: vue.withCtx(() => [
|
|
8447
|
+
(_ctx.mx_hasFilteredOptions)
|
|
8448
|
+
? vue.renderSlot(_ctx.$slots, "default", { key: 0 })
|
|
8449
|
+
: vue.createCommentVNode("v-if", true)
|
|
8450
|
+
]),
|
|
8451
|
+
_: 3 /* FORWARDED */
|
|
8452
|
+
}, 16 /* FULL_PROPS */)),
|
|
8453
|
+
($options.showSpinnerDots)
|
|
8454
|
+
? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
|
|
8455
|
+
vue.createElementVNode("div", _hoisted_1$5, [
|
|
8456
|
+
vue.createVNode(_component_q_spinner_dots, {
|
|
8457
|
+
color: "primary",
|
|
8458
|
+
size: "20px"
|
|
8459
|
+
})
|
|
7719
8460
|
])
|
|
7720
|
-
|
|
8461
|
+
])
|
|
8462
|
+
: vue.createCommentVNode("v-if", true),
|
|
8463
|
+
($options.showEmptyResult)
|
|
8464
|
+
? vue.renderSlot(_ctx.$slots, "empty-result", { key: 1 }, () => [
|
|
8465
|
+
vue.createElementVNode("div", _hoisted_2$3, [
|
|
8466
|
+
vue.createVNode(_component_q_icon, {
|
|
8467
|
+
class: "q-mb-sm text-center",
|
|
8468
|
+
color: "primary",
|
|
8469
|
+
name: "o_search",
|
|
8470
|
+
size: "38px"
|
|
8471
|
+
}),
|
|
8472
|
+
vue.createElementVNode("div", null, vue.toDisplayString($props.emptyResultText), 1 /* TEXT */)
|
|
8473
|
+
])
|
|
8474
|
+
])
|
|
8475
|
+
: vue.createCommentVNode("v-if", true),
|
|
8476
|
+
vue.createVNode(_component_q_inner_loading, { showing: $options.showInnerLoading }, {
|
|
8477
|
+
default: vue.withCtx(() => [
|
|
8478
|
+
vue.createVNode(_component_q_spinner, {
|
|
8479
|
+
color: "grey",
|
|
8480
|
+
size: "3em"
|
|
8481
|
+
})
|
|
8482
|
+
]),
|
|
8483
|
+
_: 1 /* STABLE */
|
|
8484
|
+
}, 8 /* PROPS */, ["showing"])
|
|
7721
8485
|
], 4 /* STYLE */)
|
|
7722
8486
|
]),
|
|
7723
8487
|
_: 3 /* FORWARDED */
|
|
@@ -7730,6 +8494,8 @@ script$8.__file = "src/components/search-box/QasSearchBox.vue";
|
|
|
7730
8494
|
var script$7 = {
|
|
7731
8495
|
name: 'QasSelect',
|
|
7732
8496
|
|
|
8497
|
+
mixins: [searchFilterMixin],
|
|
8498
|
+
|
|
7733
8499
|
props: {
|
|
7734
8500
|
fuseOptions: {
|
|
7735
8501
|
default: () => ({}),
|
|
@@ -7743,7 +8509,7 @@ var script$7 = {
|
|
|
7743
8509
|
|
|
7744
8510
|
modelValue: {
|
|
7745
8511
|
default: () => [],
|
|
7746
|
-
type: [Array, Object, String, Number]
|
|
8512
|
+
type: [Array, Object, String, Number, Boolean]
|
|
7747
8513
|
},
|
|
7748
8514
|
|
|
7749
8515
|
noOptionLabel: {
|
|
@@ -7756,13 +8522,13 @@ var script$7 = {
|
|
|
7756
8522
|
type: Array
|
|
7757
8523
|
},
|
|
7758
8524
|
|
|
7759
|
-
searchable: {
|
|
7760
|
-
type: Boolean
|
|
7761
|
-
},
|
|
7762
|
-
|
|
7763
8525
|
valueKey: {
|
|
7764
8526
|
default: '',
|
|
7765
8527
|
type: String
|
|
8528
|
+
},
|
|
8529
|
+
|
|
8530
|
+
useSearch: {
|
|
8531
|
+
type: Boolean
|
|
7766
8532
|
}
|
|
7767
8533
|
},
|
|
7768
8534
|
|
|
@@ -7770,7 +8536,6 @@ var script$7 = {
|
|
|
7770
8536
|
|
|
7771
8537
|
data () {
|
|
7772
8538
|
return {
|
|
7773
|
-
filteredOptions: [],
|
|
7774
8539
|
fuse: null
|
|
7775
8540
|
}
|
|
7776
8541
|
},
|
|
@@ -7778,15 +8543,18 @@ var script$7 = {
|
|
|
7778
8543
|
computed: {
|
|
7779
8544
|
attributes () {
|
|
7780
8545
|
return {
|
|
7781
|
-
clearable: this.
|
|
8546
|
+
clearable: this.isSearchable,
|
|
7782
8547
|
emitValue: true,
|
|
7783
8548
|
mapOptions: true,
|
|
7784
8549
|
outlined: true,
|
|
7785
|
-
|
|
7786
8550
|
...this.$attrs,
|
|
7787
8551
|
|
|
7788
|
-
options: this.
|
|
7789
|
-
useInput: this.
|
|
8552
|
+
options: this.mx_filteredOptions,
|
|
8553
|
+
useInput: this.isSearchable,
|
|
8554
|
+
error: this.hasError,
|
|
8555
|
+
loading: this.hasLoading,
|
|
8556
|
+
...(this.useLazyLoading && { onVirtualScroll: this.mx_onVirtualScroll }),
|
|
8557
|
+
...(this.isSearchable && { onFilter: this.onFilter })
|
|
7790
8558
|
}
|
|
7791
8559
|
},
|
|
7792
8560
|
|
|
@@ -7800,12 +8568,20 @@ var script$7 = {
|
|
|
7800
8568
|
}
|
|
7801
8569
|
},
|
|
7802
8570
|
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
8571
|
+
isSearchable () {
|
|
8572
|
+
return this.useSearch || this.useLazyLoading
|
|
8573
|
+
},
|
|
8574
|
+
|
|
8575
|
+
defaultOptions () {
|
|
8576
|
+
return this.mx_handleOptions(this.options)
|
|
8577
|
+
},
|
|
8578
|
+
|
|
8579
|
+
hasError () {
|
|
8580
|
+
return this.mx_hasFetchError || this.$attrs.error
|
|
8581
|
+
},
|
|
7807
8582
|
|
|
7808
|
-
|
|
8583
|
+
hasLoading () {
|
|
8584
|
+
return this.mx_isFetching || this.$attrs.loading
|
|
7809
8585
|
},
|
|
7810
8586
|
|
|
7811
8587
|
model: {
|
|
@@ -7826,11 +8602,11 @@ var script$7 = {
|
|
|
7826
8602
|
|
|
7827
8603
|
options: {
|
|
7828
8604
|
handler () {
|
|
7829
|
-
if (this.
|
|
7830
|
-
|
|
7831
|
-
|
|
8605
|
+
if (this.useLazyLoading && this.mx_hasFilteredOptions) return
|
|
8606
|
+
|
|
8607
|
+
if (this.fuse) this.setFuse();
|
|
7832
8608
|
|
|
7833
|
-
this.
|
|
8609
|
+
this.mx_filteredOptions = this.defaultOptions;
|
|
7834
8610
|
},
|
|
7835
8611
|
|
|
7836
8612
|
immediate: true
|
|
@@ -7839,59 +8615,57 @@ var script$7 = {
|
|
|
7839
8615
|
|
|
7840
8616
|
created () {
|
|
7841
8617
|
this.setFuse();
|
|
8618
|
+
this.useLazyLoading && this.mx_setFetchOptions('');
|
|
7842
8619
|
},
|
|
7843
8620
|
|
|
7844
8621
|
methods: {
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
if (value === '') {
|
|
7850
|
-
this.filteredOptions = this.formattedResult;
|
|
7851
|
-
} else {
|
|
7852
|
-
const results = this.fuse.search(value);
|
|
7853
|
-
this.filteredOptions = results.map(item => item.item);
|
|
7854
|
-
}
|
|
7855
|
-
});
|
|
8622
|
+
setFuse () {
|
|
8623
|
+
if (this.useSearch) {
|
|
8624
|
+
this.fuse = new Fuse__default["default"](this.defaultOptions, this.defaultFuseOptions);
|
|
8625
|
+
}
|
|
7856
8626
|
},
|
|
7857
8627
|
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
};
|
|
8628
|
+
async onFilter (value, update) {
|
|
8629
|
+
if (this.useLazyLoading && value !== this.mx_search) {
|
|
8630
|
+
await this.mx_filterOptionsByStore(value);
|
|
8631
|
+
}
|
|
7863
8632
|
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
item[newKey] = item[mapKeys[newKey]];
|
|
7867
|
-
delete item[mapKeys[newKey]];
|
|
7868
|
-
}
|
|
8633
|
+
if (!this.useLazyLoading && this.useSearch) {
|
|
8634
|
+
this.filterOptionsByFuse(value);
|
|
7869
8635
|
}
|
|
7870
8636
|
|
|
7871
|
-
|
|
8637
|
+
update();
|
|
7872
8638
|
},
|
|
7873
8639
|
|
|
7874
|
-
|
|
7875
|
-
if (
|
|
7876
|
-
this.
|
|
8640
|
+
filterOptionsByFuse (value) {
|
|
8641
|
+
if (value === '') {
|
|
8642
|
+
this.mx_filteredOptions = this.defaultOptions;
|
|
8643
|
+
return
|
|
7877
8644
|
}
|
|
8645
|
+
|
|
8646
|
+
const results = this.fuse.search(value);
|
|
8647
|
+
|
|
8648
|
+
this.mx_filteredOptions = this.mx_getNormalizedFuseResults(results);
|
|
7878
8649
|
}
|
|
7879
8650
|
}
|
|
7880
8651
|
};
|
|
7881
8652
|
|
|
8653
|
+
const _hoisted_1$4 = { class: "flex justify-center q-pb-sm" };
|
|
8654
|
+
|
|
7882
8655
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7883
8656
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
7884
8657
|
const _component_q_item_section = vue.resolveComponent("q-item-section");
|
|
7885
8658
|
const _component_q_item = vue.resolveComponent("q-item");
|
|
8659
|
+
const _component_q_spinner_dots = vue.resolveComponent("q-spinner-dots");
|
|
7886
8660
|
const _component_q_select = vue.resolveComponent("q-select");
|
|
7887
8661
|
|
|
7888
8662
|
return (vue.openBlock(), vue.createBlock(_component_q_select, vue.mergeProps({
|
|
7889
8663
|
modelValue: $options.model,
|
|
7890
8664
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event))
|
|
7891
|
-
}, $options.attributes
|
|
8665
|
+
}, $options.attributes), vue.createSlots({
|
|
7892
8666
|
append: vue.withCtx(() => [
|
|
7893
8667
|
vue.renderSlot(_ctx.$slots, "append", {}, () => [
|
|
7894
|
-
($
|
|
8668
|
+
($options.isSearchable)
|
|
7895
8669
|
? (vue.openBlock(), vue.createBlock(_component_q_icon, {
|
|
7896
8670
|
key: 0,
|
|
7897
8671
|
name: "o_search"
|
|
@@ -7900,19 +8674,33 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7900
8674
|
])
|
|
7901
8675
|
]),
|
|
7902
8676
|
"no-option": vue.withCtx(() => [
|
|
7903
|
-
|
|
7904
|
-
vue.
|
|
7905
|
-
|
|
7906
|
-
vue.createVNode(_component_q_item_section, { class: "text-grey" }, {
|
|
8677
|
+
(!_ctx.mx_isFetching)
|
|
8678
|
+
? vue.renderSlot(_ctx.$slots, "no-option", { key: 0 }, () => [
|
|
8679
|
+
vue.createVNode(_component_q_item, null, {
|
|
7907
8680
|
default: vue.withCtx(() => [
|
|
7908
|
-
vue.
|
|
8681
|
+
vue.createVNode(_component_q_item_section, { class: "text-grey" }, {
|
|
8682
|
+
default: vue.withCtx(() => [
|
|
8683
|
+
vue.createTextVNode(vue.toDisplayString($props.noOptionLabel), 1 /* TEXT */)
|
|
8684
|
+
]),
|
|
8685
|
+
_: 1 /* STABLE */
|
|
8686
|
+
})
|
|
7909
8687
|
]),
|
|
7910
8688
|
_: 1 /* STABLE */
|
|
7911
8689
|
})
|
|
7912
|
-
])
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
8690
|
+
])
|
|
8691
|
+
: vue.createCommentVNode("v-if", true)
|
|
8692
|
+
]),
|
|
8693
|
+
"after-options": vue.withCtx(() => [
|
|
8694
|
+
(_ctx.mx_isFetching)
|
|
8695
|
+
? vue.renderSlot(_ctx.$slots, "after-options", { key: 0 }, () => [
|
|
8696
|
+
vue.createElementVNode("div", _hoisted_1$4, [
|
|
8697
|
+
vue.createVNode(_component_q_spinner_dots, {
|
|
8698
|
+
color: "primary",
|
|
8699
|
+
size: "20px"
|
|
8700
|
+
})
|
|
8701
|
+
])
|
|
8702
|
+
])
|
|
8703
|
+
: vue.createCommentVNode("v-if", true)
|
|
7916
8704
|
]),
|
|
7917
8705
|
_: 2 /* DYNAMIC */
|
|
7918
8706
|
}, [
|
|
@@ -7924,7 +8712,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7924
8712
|
])
|
|
7925
8713
|
}
|
|
7926
8714
|
})
|
|
7927
|
-
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue"
|
|
8715
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue"]))
|
|
7928
8716
|
}
|
|
7929
8717
|
|
|
7930
8718
|
script$7.render = render$7;
|
|
@@ -7958,26 +8746,16 @@ var script$6 = {
|
|
|
7958
8746
|
default: () => []
|
|
7959
8747
|
},
|
|
7960
8748
|
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
type: Object
|
|
7964
|
-
},
|
|
7965
|
-
|
|
7966
|
-
redirectKey: {
|
|
7967
|
-
default: 'uuid',
|
|
7968
|
-
type: String
|
|
7969
|
-
},
|
|
7970
|
-
|
|
7971
|
-
paramKey: {
|
|
7972
|
-
default: 'id',
|
|
7973
|
-
type: String
|
|
8749
|
+
useClickableLabel: {
|
|
8750
|
+
type: Boolean
|
|
7974
8751
|
}
|
|
7975
8752
|
},
|
|
7976
8753
|
|
|
7977
8754
|
emits: [
|
|
7978
8755
|
'added',
|
|
7979
|
-
'
|
|
7980
|
-
'removed'
|
|
8756
|
+
'click-label',
|
|
8757
|
+
'removed',
|
|
8758
|
+
'update:modelValue'
|
|
7981
8759
|
],
|
|
7982
8760
|
|
|
7983
8761
|
data () {
|
|
@@ -7989,12 +8767,8 @@ var script$6 = {
|
|
|
7989
8767
|
},
|
|
7990
8768
|
|
|
7991
8769
|
computed: {
|
|
7992
|
-
isRedirectEnabled () {
|
|
7993
|
-
return Object.keys(this.to).length
|
|
7994
|
-
},
|
|
7995
|
-
|
|
7996
8770
|
labelClass () {
|
|
7997
|
-
return this.
|
|
8771
|
+
return this.useClickableLabel && 'cursor-pointer'
|
|
7998
8772
|
},
|
|
7999
8773
|
|
|
8000
8774
|
slotData () {
|
|
@@ -8023,6 +8797,7 @@ var script$6 = {
|
|
|
8023
8797
|
this.values = [...value];
|
|
8024
8798
|
},
|
|
8025
8799
|
|
|
8800
|
+
deep: true,
|
|
8026
8801
|
immediate: true
|
|
8027
8802
|
}
|
|
8028
8803
|
},
|
|
@@ -8044,7 +8819,7 @@ var script$6 = {
|
|
|
8044
8819
|
|
|
8045
8820
|
return {
|
|
8046
8821
|
dense: this.$qas.screen.isSmall,
|
|
8047
|
-
|
|
8822
|
+
useLabelOnSmallScreen: false,
|
|
8048
8823
|
icon: !this.$qas.screen.isSmall ? undefined : isSelected ? 'o_close' : 'o_add',
|
|
8049
8824
|
label: isSelected ? 'Remover' : 'Adicionar',
|
|
8050
8825
|
outline: isSelected,
|
|
@@ -8069,11 +8844,8 @@ var script$6 = {
|
|
|
8069
8844
|
});
|
|
8070
8845
|
},
|
|
8071
8846
|
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
params: { [this.paramKey]: item[this.redirectKey] },
|
|
8075
|
-
...this.to
|
|
8076
|
-
})
|
|
8847
|
+
onClickLabel ({ item, index }) {
|
|
8848
|
+
this.useClickableLabel && this.$emit('click-label', { item, index });
|
|
8077
8849
|
},
|
|
8078
8850
|
|
|
8079
8851
|
remove (item) {
|
|
@@ -8127,7 +8899,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8127
8899
|
default: vue.withCtx(() => [
|
|
8128
8900
|
vue.createElementVNode("div", {
|
|
8129
8901
|
class: vue.normalizeClass($options.labelClass),
|
|
8130
|
-
onClick: $event => ($options.
|
|
8902
|
+
onClick: $event => ($options.onClickLabel({ item: result, index: _ctx.index }))
|
|
8131
8903
|
}, vue.toDisplayString(result.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_1$3)
|
|
8132
8904
|
]),
|
|
8133
8905
|
_: 2 /* DYNAMIC */
|
|
@@ -8198,7 +8970,9 @@ var script$5 = {
|
|
|
8198
8970
|
|
|
8199
8971
|
watch: {
|
|
8200
8972
|
$route (to, from) {
|
|
8201
|
-
to.name === from.name
|
|
8973
|
+
if (to.name === from.name) {
|
|
8974
|
+
this.mx_fetchHandler({ id: this.id, url: this.url }, this.fetchSingle);
|
|
8975
|
+
}
|
|
8202
8976
|
},
|
|
8203
8977
|
|
|
8204
8978
|
resultModel (value) {
|
|
@@ -8207,19 +8981,23 @@ var script$5 = {
|
|
|
8207
8981
|
},
|
|
8208
8982
|
|
|
8209
8983
|
created () {
|
|
8210
|
-
this.fetchSingle
|
|
8984
|
+
this.mx_fetchHandler({ id: this.id, url: this.url }, this.fetchSingle);
|
|
8211
8985
|
},
|
|
8212
8986
|
|
|
8213
8987
|
methods: {
|
|
8214
|
-
async fetchSingle (
|
|
8988
|
+
async fetchSingle (externalPayload = {}) {
|
|
8215
8989
|
this.mx_isFetching = true;
|
|
8216
8990
|
|
|
8217
8991
|
try {
|
|
8218
|
-
const
|
|
8219
|
-
|
|
8220
|
-
|
|
8992
|
+
const payload = { id: this.id, url: this.url, ...externalPayload };
|
|
8993
|
+
|
|
8994
|
+
this.$qas.logger.group(
|
|
8995
|
+
`QasSingleView - fetchSingle -> payload do parâmetro do ${this.entity}/fetchSingle`,
|
|
8996
|
+
[payload]
|
|
8221
8997
|
);
|
|
8222
8998
|
|
|
8999
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
|
|
9000
|
+
|
|
8223
9001
|
const { errors, fields, metadata } = response.data;
|
|
8224
9002
|
|
|
8225
9003
|
this.mx_setErrors(errors);
|
|
@@ -8232,10 +9010,20 @@ var script$5 = {
|
|
|
8232
9010
|
metadata: this.mx_metadata
|
|
8233
9011
|
});
|
|
8234
9012
|
|
|
9013
|
+
this.$qas.logger.group(
|
|
9014
|
+
`QasSingleView - fetchSingle -> resposta da action ${this.entity}/fetchSingle`, [response]
|
|
9015
|
+
);
|
|
9016
|
+
|
|
8235
9017
|
this.$emit('fetch-success', response);
|
|
8236
9018
|
} catch (error) {
|
|
8237
9019
|
this.mx_fetchError(error);
|
|
8238
9020
|
this.$emit('fetch-error', error);
|
|
9021
|
+
|
|
9022
|
+
this.$qas.logger.group(
|
|
9023
|
+
`QasSingleView - fetchSingle -> exceção da action ${this.entity}/fetchSingle`,
|
|
9024
|
+
[error],
|
|
9025
|
+
{ error: true }
|
|
9026
|
+
);
|
|
8239
9027
|
} finally {
|
|
8240
9028
|
this.mx_isFetching = false;
|
|
8241
9029
|
}
|
|
@@ -8527,6 +9315,8 @@ var script$3 = {
|
|
|
8527
9315
|
columnByField(this.fields[index]);
|
|
8528
9316
|
}
|
|
8529
9317
|
|
|
9318
|
+
this.$qas.logger.group('QasTableGenerator - Automatic columns', [columns]);
|
|
9319
|
+
|
|
8530
9320
|
return columns
|
|
8531
9321
|
}
|
|
8532
9322
|
|
|
@@ -8539,6 +9329,8 @@ var script$3 = {
|
|
|
8539
9329
|
}
|
|
8540
9330
|
});
|
|
8541
9331
|
|
|
9332
|
+
this.$qas.logger.group('QasTableGenerator - columns', [columns]);
|
|
9333
|
+
|
|
8542
9334
|
return columns
|
|
8543
9335
|
},
|
|
8544
9336
|
|
|
@@ -8555,16 +9347,22 @@ var script$3 = {
|
|
|
8555
9347
|
},
|
|
8556
9348
|
|
|
8557
9349
|
resultsByFields () {
|
|
9350
|
+
if (!Object.keys(this.fields).length) return []
|
|
9351
|
+
|
|
8558
9352
|
const results = quasar.extend(true, [], this.results);
|
|
8559
9353
|
|
|
8560
|
-
|
|
9354
|
+
const mappedResults = results.map((result, index) => {
|
|
8561
9355
|
for (const key in result) {
|
|
8562
9356
|
result.default = this.results[index];
|
|
8563
9357
|
result[key] = humanize(this.fields[key], result[key]) || this.emptyResultText;
|
|
8564
9358
|
}
|
|
8565
9359
|
|
|
8566
9360
|
return result
|
|
8567
|
-
})
|
|
9361
|
+
});
|
|
9362
|
+
|
|
9363
|
+
this.$qas.logger.group('QasTableGenerator - resultsByFields', [mappedResults]);
|
|
9364
|
+
|
|
9365
|
+
return mappedResults
|
|
8568
9366
|
},
|
|
8569
9367
|
|
|
8570
9368
|
rowsPerPage () {
|
|
@@ -8726,7 +9524,7 @@ var script$2 = {
|
|
|
8726
9524
|
tabs: {
|
|
8727
9525
|
default: () => ({}),
|
|
8728
9526
|
required: true,
|
|
8729
|
-
type: Object
|
|
9527
|
+
type: [Object, Array]
|
|
8730
9528
|
}
|
|
8731
9529
|
},
|
|
8732
9530
|
|
|
@@ -8783,7 +9581,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8783
9581
|
(vue.openBlock(), vue.createBlock(_component_q_tab, vue.mergeProps({ key: key }, tab, {
|
|
8784
9582
|
class: $props.tabClass,
|
|
8785
9583
|
label: tab.label,
|
|
8786
|
-
name:
|
|
9584
|
+
name: tab.value
|
|
8787
9585
|
}), {
|
|
8788
9586
|
default: vue.withCtx(() => [
|
|
8789
9587
|
vue.renderSlot(_ctx.$slots, `tab-after-${tab.value}`, { item: tab }, () => [
|
|
@@ -8868,7 +9666,7 @@ var script$1 = {
|
|
|
8868
9666
|
return {
|
|
8869
9667
|
cancel: false,
|
|
8870
9668
|
ok: false,
|
|
8871
|
-
|
|
9669
|
+
useCloseButton: true,
|
|
8872
9670
|
...this.dialogProps,
|
|
8873
9671
|
card: {
|
|
8874
9672
|
title: this.dialogTitle,
|
|
@@ -9278,7 +10076,7 @@ script.__file = "src/components/transfer/QasTransfer.vue";
|
|
|
9278
10076
|
|
|
9279
10077
|
var name = "@bildvitta/quasar-ui-asteroid";
|
|
9280
10078
|
var description = "Asteroid";
|
|
9281
|
-
var version$1 = "3.0.0
|
|
10079
|
+
var version$1 = "3.0.0";
|
|
9282
10080
|
var author = "Bild & Vitta <systemteam@bild.com.br>";
|
|
9283
10081
|
var license = "MIT";
|
|
9284
10082
|
var main = "dist/asteroid.cjs.min.js";
|
|
@@ -9434,14 +10232,16 @@ function install (app) {
|
|
|
9434
10232
|
app.config.globalProperties.$qas = {
|
|
9435
10233
|
dialog: Dialog,
|
|
9436
10234
|
error: NotifyError,
|
|
9437
|
-
|
|
9438
|
-
screen: Screen()
|
|
10235
|
+
logger: Logger(),
|
|
10236
|
+
screen: Screen(),
|
|
10237
|
+
success: NotifySuccess
|
|
9439
10238
|
};
|
|
9440
10239
|
|
|
9441
10240
|
app.directive(Test.name, Test);
|
|
9442
10241
|
}
|
|
9443
10242
|
|
|
9444
10243
|
exports.Dialog = Dialog;
|
|
10244
|
+
exports.Logger = Logger;
|
|
9445
10245
|
exports.NotifyError = NotifyError;
|
|
9446
10246
|
exports.NotifySuccess = NotifySuccess;
|
|
9447
10247
|
exports.QasActions = script$L;
|