@bildvitta/quasar-ui-asteroid 3.0.0-beta.10 → 3.0.0-beta.13
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/QasCard.json +13 -9
- package/dist/asteroid.cjs.css +1 -1
- package/dist/asteroid.cjs.js +292 -57
- package/dist/asteroid.cjs.min.js +2 -2
- package/dist/asteroid.esm.css +1 -1
- package/dist/asteroid.esm.js +294 -59
- package/dist/asteroid.esm.min.js +2 -2
- package/dist/asteroid.umd.css +1 -1
- package/dist/asteroid.umd.js +292 -57
- package/dist/asteroid.umd.min.js +2 -2
- package/dist/vetur/asteroid-attributes.json +12 -12
- package/dist/vetur/asteroid-tags.json +3 -3
- package/package.json +1 -1
- package/src/components/app-bar/QasAppBar.yml +0 -4
- package/src/components/card/QasCard.yml +13 -9
- package/src/components/date-time-input/QasDateTimeInput.vue +1 -1
- package/src/components/delete/QasDelete.vue +15 -1
- package/src/components/filters/QasFilters.vue +19 -4
- package/src/components/form-view/QasFormView.vue +51 -8
- package/src/components/grid-generator/QasGridGenerator.vue +17 -2
- package/src/components/input/QasInput.vue +20 -2
- package/src/components/list-view/QasListView.vue +20 -7
- package/src/components/nested-fields/QasNestedFields.vue +8 -9
- package/src/components/page-header/QasPageHeader.vue +9 -6
- package/src/components/search-box/QasSearchBox.vue +2 -2
- package/src/components/single-view/QasSingleView.vue +17 -3
- package/src/components/table-generator/QasTableGenerator.vue +11 -1
- package/src/components/uploader/QasUploader.vue +28 -3
- package/src/helpers/camelize-fields-name.js +15 -0
- package/src/helpers/index.js +1 -0
- package/src/mixins/view.js +3 -5
- 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.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @bildvitta/quasar-ui-asteroid v3.0.0-beta.
|
|
2
|
+
* @bildvitta/quasar-ui-asteroid v3.0.0-beta.13
|
|
3
3
|
* (c) 2022 Bild & Vitta <systemteam@bild.com.br>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -462,6 +462,20 @@
|
|
|
462
462
|
return first
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
+
function camelizeFieldsName (fields) {
|
|
466
|
+
for (const field in fields) {
|
|
467
|
+
const currentField = fields[field];
|
|
468
|
+
|
|
469
|
+
currentField.name = humps.camelize(currentField.name);
|
|
470
|
+
|
|
471
|
+
if (Object.keys(currentField.children || {}).length) {
|
|
472
|
+
camelizeFieldsName(currentField.children);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return fields
|
|
477
|
+
}
|
|
478
|
+
|
|
465
479
|
// Private
|
|
466
480
|
function __format (value, token, options = {}) {
|
|
467
481
|
if (!value) {
|
|
@@ -1993,7 +2007,7 @@
|
|
|
1993
2007
|
},
|
|
1994
2008
|
|
|
1995
2009
|
watch: {
|
|
1996
|
-
|
|
2010
|
+
modelValue (current, original) {
|
|
1997
2011
|
if (!current || this.useTimeOnly) {
|
|
1998
2012
|
this.currentValue = current;
|
|
1999
2013
|
return
|
|
@@ -2421,6 +2435,51 @@
|
|
|
2421
2435
|
});
|
|
2422
2436
|
};
|
|
2423
2437
|
|
|
2438
|
+
var Logger = () => {
|
|
2439
|
+
const isDebugEnabled = process.env.DEBUGGING;
|
|
2440
|
+
|
|
2441
|
+
const normalizeMessage = msg => `%c ${msg}`;
|
|
2442
|
+
const getStyle = isError => (
|
|
2443
|
+
`
|
|
2444
|
+
background: ${isError ? '#C10015 ' : '#1976d2'};
|
|
2445
|
+
font-weight: bold;
|
|
2446
|
+
color: white;
|
|
2447
|
+
padding: 6px 20px;
|
|
2448
|
+
border-radius: 4px;
|
|
2449
|
+
display: block;
|
|
2450
|
+
width: 100%;
|
|
2451
|
+
font-size: 12px;
|
|
2452
|
+
`
|
|
2453
|
+
);
|
|
2454
|
+
|
|
2455
|
+
return {
|
|
2456
|
+
group (message, payload = [], { error } = {}) {
|
|
2457
|
+
if (!isDebugEnabled) return
|
|
2458
|
+
|
|
2459
|
+
console.groupCollapsed(normalizeMessage(message), getStyle(error));
|
|
2460
|
+
|
|
2461
|
+
for (const item of payload) {
|
|
2462
|
+
if (typeof item === 'string') {
|
|
2463
|
+
console.info(normalizeMessage(item), getStyle(error));
|
|
2464
|
+
continue
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
console.table(item);
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
console.groupEnd();
|
|
2471
|
+
},
|
|
2472
|
+
|
|
2473
|
+
info (message) {
|
|
2474
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle());
|
|
2475
|
+
},
|
|
2476
|
+
|
|
2477
|
+
error (message) {
|
|
2478
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle(true));
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
};
|
|
2482
|
+
|
|
2424
2483
|
quasar.Notify.registerType('error', {
|
|
2425
2484
|
color: 'negative',
|
|
2426
2485
|
progress: true
|
|
@@ -2607,7 +2666,13 @@
|
|
|
2607
2666
|
try {
|
|
2608
2667
|
const { destroyRoutes, history } = useHistory();
|
|
2609
2668
|
|
|
2610
|
-
|
|
2669
|
+
const payload = { id: this.id, url: this.url };
|
|
2670
|
+
|
|
2671
|
+
this.$qas.logger.group(
|
|
2672
|
+
`QasDelete - destroy -> Payload do parâmetro do ${this.entity}/destroy`, [payload]
|
|
2673
|
+
);
|
|
2674
|
+
|
|
2675
|
+
await this.$store.dispatch(`${this.entity}/destroy`, payload);
|
|
2611
2676
|
|
|
2612
2677
|
NotifySuccess('Item deletado com sucesso!');
|
|
2613
2678
|
|
|
@@ -2621,9 +2686,17 @@
|
|
|
2621
2686
|
this.createDeleteSuccessEvent();
|
|
2622
2687
|
|
|
2623
2688
|
this.$emit('success');
|
|
2689
|
+
|
|
2690
|
+
this.$qas.logger.info('QasDelete - destroy -> item deletado com sucesso!');
|
|
2624
2691
|
} catch (error) {
|
|
2625
2692
|
NotifyError('Ops! Não foi possível deletar o item.');
|
|
2626
2693
|
this.$emit('error', error);
|
|
2694
|
+
|
|
2695
|
+
this.$qas.logger.group(
|
|
2696
|
+
`QasDelete - destroy -> exceção da action ${this.entity}/destroy`,
|
|
2697
|
+
[error],
|
|
2698
|
+
{ error: true }
|
|
2699
|
+
);
|
|
2627
2700
|
} finally {
|
|
2628
2701
|
quasar.Loading.hide();
|
|
2629
2702
|
this.$emit('update:deleting', false);
|
|
@@ -2872,7 +2945,7 @@
|
|
|
2872
2945
|
|
|
2873
2946
|
watch: {
|
|
2874
2947
|
mask () {
|
|
2875
|
-
const input = this.
|
|
2948
|
+
const input = this.getInput();
|
|
2876
2949
|
|
|
2877
2950
|
requestAnimationFrame(() => {
|
|
2878
2951
|
input.selectionStart = input.value ? input.value.length : '';
|
|
@@ -2906,12 +2979,30 @@
|
|
|
2906
2979
|
},
|
|
2907
2980
|
|
|
2908
2981
|
toggleMask (first, second) {
|
|
2982
|
+
if (!this.modelValue.length) return
|
|
2983
|
+
|
|
2909
2984
|
const length = first.split('#').length - 2;
|
|
2910
2985
|
return this.modelValue?.length > length ? second : first
|
|
2911
2986
|
},
|
|
2912
2987
|
|
|
2913
2988
|
validate (value) {
|
|
2914
2989
|
return this.inputReference.validate(value)
|
|
2990
|
+
},
|
|
2991
|
+
|
|
2992
|
+
onPaste (event) {
|
|
2993
|
+
if (!this.mask) return
|
|
2994
|
+
|
|
2995
|
+
const value = event.clipboardData.getData('text');
|
|
2996
|
+
const input = this.getInput();
|
|
2997
|
+
|
|
2998
|
+
requestAnimationFrame(() => {
|
|
2999
|
+
this.$emit('update:modelValue', value);
|
|
3000
|
+
input.selectionStart = input.value ? input.value.length : '';
|
|
3001
|
+
});
|
|
3002
|
+
},
|
|
3003
|
+
|
|
3004
|
+
getInput () {
|
|
3005
|
+
return this.inputReference.$el?.querySelector('input')
|
|
2915
3006
|
}
|
|
2916
3007
|
}
|
|
2917
3008
|
};
|
|
@@ -2930,7 +3021,8 @@
|
|
|
2930
3021
|
"error-message": _ctx.errorMessageData,
|
|
2931
3022
|
mask: $options.mask,
|
|
2932
3023
|
outlined: $props.outlined,
|
|
2933
|
-
"unmasked-value": $props.unmaskedValue
|
|
3024
|
+
"unmasked-value": $props.unmaskedValue,
|
|
3025
|
+
onPaste: $options.onPaste
|
|
2934
3026
|
}), vue.createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
2935
3027
|
vue.renderList(_ctx.$slots, (_, name) => {
|
|
2936
3028
|
return {
|
|
@@ -2940,7 +3032,7 @@
|
|
|
2940
3032
|
])
|
|
2941
3033
|
}
|
|
2942
3034
|
})
|
|
2943
|
-
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "error", "error-message", "mask", "outlined", "unmasked-value"])
|
|
3035
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "error", "error-message", "mask", "outlined", "unmasked-value", "onPaste"])
|
|
2944
3036
|
]))
|
|
2945
3037
|
}
|
|
2946
3038
|
|
|
@@ -3590,6 +3682,8 @@
|
|
|
3590
3682
|
);
|
|
3591
3683
|
|
|
3592
3684
|
this.updateUploading(false);
|
|
3685
|
+
|
|
3686
|
+
this.$qas.logger.group('QasUploader - uploaded', [this.modelValue]);
|
|
3593
3687
|
},
|
|
3594
3688
|
|
|
3595
3689
|
async fetchCredentials (filename) {
|
|
@@ -3600,6 +3694,12 @@
|
|
|
3600
3694
|
entity: this.entity,
|
|
3601
3695
|
filename
|
|
3602
3696
|
});
|
|
3697
|
+
|
|
3698
|
+
this.$qas.logger.group(
|
|
3699
|
+
'QasUploader - fetchCredentials -> resposta de /upload-credentials/',
|
|
3700
|
+
[data]
|
|
3701
|
+
);
|
|
3702
|
+
|
|
3603
3703
|
return data
|
|
3604
3704
|
} finally {
|
|
3605
3705
|
this.isFetching = false;
|
|
@@ -3619,7 +3719,9 @@
|
|
|
3619
3719
|
|
|
3620
3720
|
const clonedValue = quasar.extend(true, [], this.modelValue);
|
|
3621
3721
|
const numberIndex = this.modelValue.findIndex(file => this.getFileName(file) === index);
|
|
3722
|
+
|
|
3622
3723
|
clonedValue.splice(numberIndex, 1);
|
|
3724
|
+
|
|
3623
3725
|
this.$emit('update:modelValue', clonedValue);
|
|
3624
3726
|
},
|
|
3625
3727
|
|
|
@@ -3628,7 +3730,9 @@
|
|
|
3628
3730
|
},
|
|
3629
3731
|
|
|
3630
3732
|
getFilesList (uploadedFiles) {
|
|
3631
|
-
const pathsList = Array.isArray(this.modelValue)
|
|
3733
|
+
const pathsList = Array.isArray(this.modelValue)
|
|
3734
|
+
? this.modelValue
|
|
3735
|
+
: (this.modelValue ? [this.modelValue] : []);
|
|
3632
3736
|
|
|
3633
3737
|
uploadedFiles = uploadedFiles.map((file, indexToDelete) => {
|
|
3634
3738
|
return {
|
|
@@ -3664,6 +3768,8 @@
|
|
|
3664
3768
|
}
|
|
3665
3769
|
});
|
|
3666
3770
|
|
|
3771
|
+
this.$qas.logger.group('QasUploader - getFilesList', [files]);
|
|
3772
|
+
|
|
3667
3773
|
return files
|
|
3668
3774
|
},
|
|
3669
3775
|
|
|
@@ -3702,7 +3808,14 @@
|
|
|
3702
3808
|
// Retorna largura e altura da original da imagem
|
|
3703
3809
|
const { width, height } = await getImageSize(image);
|
|
3704
3810
|
|
|
3705
|
-
if (width <= this.sizeLimit)
|
|
3811
|
+
if (width <= this.sizeLimit) {
|
|
3812
|
+
this.$qas.logger.info(`
|
|
3813
|
+
QasUploader - resizeImage -> Tamanho da imagem menor que o tamanho limite,
|
|
3814
|
+
sendo assim, não faz o resize
|
|
3815
|
+
`);
|
|
3816
|
+
|
|
3817
|
+
return file
|
|
3818
|
+
}
|
|
3706
3819
|
|
|
3707
3820
|
// Retorna os novos tamanhos redimensionados
|
|
3708
3821
|
const resizedDimensions = getResizeDimensions(this.sizeLimit, width, height);
|
|
@@ -3720,7 +3833,11 @@
|
|
|
3720
3833
|
const resizedImage = await pica.resize(image, canvas, this.defaultPicaResizeOptions);
|
|
3721
3834
|
const blob = await pica.toBlob(resizedImage, type, 0.90);
|
|
3722
3835
|
|
|
3723
|
-
|
|
3836
|
+
const newFile = new File([blob], file.name, { type });
|
|
3837
|
+
|
|
3838
|
+
this.$qas.logger.group('QasUploader - resizeImage -> nova imagem', [newFile]);
|
|
3839
|
+
|
|
3840
|
+
return newFile
|
|
3724
3841
|
} catch {
|
|
3725
3842
|
// Caso não consiga redimensionar retorna o arquivo original
|
|
3726
3843
|
return file
|
|
@@ -4702,11 +4819,26 @@
|
|
|
4702
4819
|
this.isFetching = true;
|
|
4703
4820
|
|
|
4704
4821
|
try {
|
|
4822
|
+
this.$qas.logger.group(
|
|
4823
|
+
`QasFilters - fetchFilters -> Payload do parâmetro do ${this.entity}/fetchFilters`,
|
|
4824
|
+
[{ url: this.url }]
|
|
4825
|
+
);
|
|
4826
|
+
|
|
4705
4827
|
const response = await this.$store.dispatch(`${this.entity}/fetchFilters`, { url: this.url });
|
|
4706
4828
|
this.$emit('fetch-success', response);
|
|
4829
|
+
|
|
4830
|
+
this.$qas.logger.group(
|
|
4831
|
+
`QasFilters - fetchFilters -> resposta da action ${this.entity}/fetchFilters`, [response]
|
|
4832
|
+
);
|
|
4707
4833
|
} catch (error) {
|
|
4708
4834
|
this.hasFetchError = true;
|
|
4709
4835
|
this.$emit('fetch-error', error);
|
|
4836
|
+
|
|
4837
|
+
this.$qas.logger.group(
|
|
4838
|
+
`QasFilters - fetchFilters -> exceção da action ${this.entity}/fetchFilters`,
|
|
4839
|
+
[error],
|
|
4840
|
+
{ error: true }
|
|
4841
|
+
);
|
|
4710
4842
|
} finally {
|
|
4711
4843
|
this.isFetching = false;
|
|
4712
4844
|
}
|
|
@@ -4790,7 +4922,7 @@
|
|
|
4790
4922
|
|
|
4791
4923
|
function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4792
4924
|
const _component_qas_btn = vue.resolveComponent("qas-btn");
|
|
4793
|
-
const
|
|
4925
|
+
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
4794
4926
|
const _component_q_form = vue.resolveComponent("q-form");
|
|
4795
4927
|
const _component_q_spinner = vue.resolveComponent("q-spinner");
|
|
4796
4928
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
@@ -4810,11 +4942,13 @@
|
|
|
4810
4942
|
onSubmit: _cache[2] || (_cache[2] = vue.withModifiers($event => ($options.filter()), ["prevent"]))
|
|
4811
4943
|
}, {
|
|
4812
4944
|
default: vue.withCtx(() => [
|
|
4813
|
-
vue.createVNode(
|
|
4945
|
+
vue.createVNode(_component_qas_input, {
|
|
4814
4946
|
modelValue: $data.search,
|
|
4815
4947
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.search) = $event)),
|
|
4816
4948
|
debounce: $options.debounce,
|
|
4817
4949
|
dense: "",
|
|
4950
|
+
"hide-bottom-space": "",
|
|
4951
|
+
outlined: false,
|
|
4818
4952
|
placeholder: $props.searchPlaceholder,
|
|
4819
4953
|
type: "search"
|
|
4820
4954
|
}, {
|
|
@@ -4822,6 +4956,8 @@
|
|
|
4822
4956
|
($options.hasSearch)
|
|
4823
4957
|
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4824
4958
|
key: 0,
|
|
4959
|
+
color: "grey-9",
|
|
4960
|
+
flat: "",
|
|
4825
4961
|
icon: "o_clear",
|
|
4826
4962
|
unelevated: "",
|
|
4827
4963
|
onClick: $options.clearSearch
|
|
@@ -4830,6 +4966,8 @@
|
|
|
4830
4966
|
(!$options.debounce)
|
|
4831
4967
|
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4832
4968
|
key: 1,
|
|
4969
|
+
color: "grey-9",
|
|
4970
|
+
flat: "",
|
|
4833
4971
|
icon: "o_search",
|
|
4834
4972
|
type: "submit",
|
|
4835
4973
|
unelevated: "",
|
|
@@ -5255,11 +5393,9 @@
|
|
|
5255
5393
|
},
|
|
5256
5394
|
|
|
5257
5395
|
mx_setFields (fields = {}) {
|
|
5258
|
-
|
|
5259
|
-
fields[field].name = humps.camelize(fields[field].name);
|
|
5260
|
-
}
|
|
5396
|
+
const camelizedFields = camelizeFieldsName(fields);
|
|
5261
5397
|
|
|
5262
|
-
this.mx_fields = vue.markRaw(
|
|
5398
|
+
this.mx_fields = vue.markRaw(camelizedFields);
|
|
5263
5399
|
},
|
|
5264
5400
|
|
|
5265
5401
|
mx_setMetadata (metadata = {}) {
|
|
@@ -5442,8 +5578,10 @@
|
|
|
5442
5578
|
},
|
|
5443
5579
|
|
|
5444
5580
|
created () {
|
|
5445
|
-
vueRouter.onBeforeRouteLeave(this.beforeRouteLeave);
|
|
5581
|
+
this.useDialogOnUnsavedChanges && vueRouter.onBeforeRouteLeave(this.beforeRouteLeave);
|
|
5582
|
+
|
|
5446
5583
|
window.addEventListener('delete-success', this.setIgnoreRouterGuard);
|
|
5584
|
+
|
|
5447
5585
|
this.fetch();
|
|
5448
5586
|
},
|
|
5449
5587
|
|
|
@@ -5474,6 +5612,11 @@
|
|
|
5474
5612
|
return next()
|
|
5475
5613
|
}
|
|
5476
5614
|
|
|
5615
|
+
this.$qas.logger.group(
|
|
5616
|
+
'QasFormView - beforeRouteLeave -> dialog chamado, modelValue diferente do cachedResult',
|
|
5617
|
+
[{ modelValue: clonedModelValue, cachedResult: clonedCachedResult }]
|
|
5618
|
+
);
|
|
5619
|
+
|
|
5477
5620
|
this.handleDialog(() => {
|
|
5478
5621
|
this.ignoreRouterGuard = true;
|
|
5479
5622
|
next();
|
|
@@ -5488,10 +5631,14 @@
|
|
|
5488
5631
|
this.mx_isFetching = true;
|
|
5489
5632
|
|
|
5490
5633
|
try {
|
|
5491
|
-
const
|
|
5492
|
-
|
|
5634
|
+
const payload = { form: true, id: this.id, params, url: this.fetchURL };
|
|
5635
|
+
|
|
5636
|
+
this.$qas.logger.group(
|
|
5637
|
+
`QasFormView - fetch -> payload do parâmetro do ${this.entity}/fetchSingle`, [payload]
|
|
5493
5638
|
);
|
|
5494
5639
|
|
|
5640
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
|
|
5641
|
+
|
|
5495
5642
|
const { errors, fields, metadata, result } = response.data;
|
|
5496
5643
|
|
|
5497
5644
|
this.mx_setErrors(errors);
|
|
@@ -5504,20 +5651,36 @@
|
|
|
5504
5651
|
metadata
|
|
5505
5652
|
});
|
|
5506
5653
|
|
|
5654
|
+
this.$qas.logger.group(
|
|
5655
|
+
`QasFormView - fetch -> resposta da action ${this.entity}/fetchSingle`, [response]
|
|
5656
|
+
);
|
|
5657
|
+
|
|
5507
5658
|
if (result) {
|
|
5508
5659
|
this.hasResult = true;
|
|
5509
5660
|
|
|
5510
5661
|
this.$nextTick(() => {
|
|
5511
|
-
|
|
5662
|
+
const modelValue = { ...this.modelValue, ...result };
|
|
5663
|
+
|
|
5664
|
+
this.$emit('update:modelValue', modelValue);
|
|
5665
|
+
|
|
5666
|
+
this.$qas.logger.group('QasFormView - fetch -> modelValue', [modelValue]);
|
|
5512
5667
|
});
|
|
5513
5668
|
|
|
5514
5669
|
this.cachedResult = this.useDialogOnUnsavedChanges && quasar.extend(true, {}, result);
|
|
5670
|
+
|
|
5671
|
+
this.$qas.logger.group('QasFormView - fetch -> cachedResult', [this.cachedResult]);
|
|
5515
5672
|
}
|
|
5516
5673
|
|
|
5517
5674
|
this.$emit('fetch-success', response, this.modelValue);
|
|
5518
5675
|
} catch (error) {
|
|
5519
5676
|
this.mx_fetchError(error);
|
|
5520
5677
|
this.$emit('fetch-error', error);
|
|
5678
|
+
|
|
5679
|
+
this.$qas.logger.group(
|
|
5680
|
+
`QasFormView - fetch -> exceção da action ${this.entity}/fetchSingle`,
|
|
5681
|
+
[error],
|
|
5682
|
+
{ error: true }
|
|
5683
|
+
);
|
|
5521
5684
|
} finally {
|
|
5522
5685
|
this.mx_isFetching = false;
|
|
5523
5686
|
}
|
|
@@ -5583,11 +5746,14 @@
|
|
|
5583
5746
|
this.isSubmitting = true;
|
|
5584
5747
|
|
|
5585
5748
|
try {
|
|
5586
|
-
const
|
|
5587
|
-
|
|
5588
|
-
|
|
5749
|
+
const payload = { id: this.id, payload: this.modelValue, url: this.url };
|
|
5750
|
+
|
|
5751
|
+
this.$qas.logger.group(
|
|
5752
|
+
`QasFormView - submit -> payload do ${this.entity}/${this.mode}`, [payload]
|
|
5589
5753
|
);
|
|
5590
5754
|
|
|
5755
|
+
const response = await this.$store.dispatch(`${this.entity}/${this.mode}`, payload);
|
|
5756
|
+
|
|
5591
5757
|
if (this.useDialogOnUnsavedChanges) {
|
|
5592
5758
|
this.cachedResult = quasar.extend(true, {}, this.modelValue);
|
|
5593
5759
|
}
|
|
@@ -5595,11 +5761,18 @@
|
|
|
5595
5761
|
this.mx_setErrors();
|
|
5596
5762
|
NotifySuccess(response.data.status.text || 'Item salvo com sucesso!');
|
|
5597
5763
|
this.$emit('submit-success', response, this.modelValue);
|
|
5764
|
+
|
|
5765
|
+
this.$qas.logger.group(
|
|
5766
|
+
`QasFormView - submit -> resposta da action ${this.entity}/${this.mode}`, [response]
|
|
5767
|
+
);
|
|
5598
5768
|
} catch (error) {
|
|
5599
5769
|
const errors = error?.response?.data?.errors;
|
|
5600
5770
|
const message = error?.response?.data?.status?.text;
|
|
5601
5771
|
const exceptionResponse = error?.response?.data?.exception;
|
|
5602
|
-
|
|
5772
|
+
|
|
5773
|
+
const exception = errors
|
|
5774
|
+
? 'Existem erros de validação no formulário.'
|
|
5775
|
+
: exceptionResponse || error.message;
|
|
5603
5776
|
|
|
5604
5777
|
this.mx_setErrors(errors);
|
|
5605
5778
|
this.$emit('update:errors', this.mx_errors);
|
|
@@ -5607,6 +5780,12 @@
|
|
|
5607
5780
|
NotifyError(message || 'Ops! Erro ao salvar item.', exception);
|
|
5608
5781
|
|
|
5609
5782
|
this.$emit('submit-error', error);
|
|
5783
|
+
|
|
5784
|
+
this.$qas.logger.group(
|
|
5785
|
+
`QasFormView - fetch -> exceção da action ${this.entity}/${this.mode}`,
|
|
5786
|
+
[error],
|
|
5787
|
+
{ error: true }
|
|
5788
|
+
);
|
|
5610
5789
|
} finally {
|
|
5611
5790
|
this.isSubmitting = false;
|
|
5612
5791
|
}
|
|
@@ -6001,6 +6180,11 @@
|
|
|
6001
6180
|
computed: {
|
|
6002
6181
|
formattedFields () {
|
|
6003
6182
|
if (this.useEmptyResult) {
|
|
6183
|
+
this.$qas.logger.group(
|
|
6184
|
+
'QasGridGenerator - formattedFields -> this.useEmptyResult tem valor "true"',
|
|
6185
|
+
[this.fields]
|
|
6186
|
+
);
|
|
6187
|
+
|
|
6004
6188
|
return this.fields
|
|
6005
6189
|
}
|
|
6006
6190
|
|
|
@@ -6018,6 +6202,8 @@
|
|
|
6018
6202
|
}
|
|
6019
6203
|
}
|
|
6020
6204
|
|
|
6205
|
+
this.$qas.logger.group('QasGridGenerator - formattedFields', [fields]);
|
|
6206
|
+
|
|
6021
6207
|
return fields
|
|
6022
6208
|
},
|
|
6023
6209
|
|
|
@@ -6033,11 +6219,19 @@
|
|
|
6033
6219
|
|
|
6034
6220
|
for (const key in result) {
|
|
6035
6221
|
if (this.formattedFields[key]?.type) {
|
|
6036
|
-
formattedResult[key] =
|
|
6037
|
-
|
|
6222
|
+
formattedResult[key] = (
|
|
6223
|
+
humanize(this.formattedFields[key], result[key]) || this.emptyResultText
|
|
6224
|
+
);
|
|
6225
|
+
|
|
6226
|
+
this.slotValue[key] = {
|
|
6227
|
+
...this.formattedFields[key],
|
|
6228
|
+
formattedResult: formattedResult[key]
|
|
6229
|
+
};
|
|
6038
6230
|
}
|
|
6039
6231
|
}
|
|
6040
6232
|
|
|
6233
|
+
this.$qas.logger.group('QasGridGenerator - getResultsByFields', [formattedResult]);
|
|
6234
|
+
|
|
6041
6235
|
return formattedResult
|
|
6042
6236
|
}
|
|
6043
6237
|
}
|
|
@@ -6436,15 +6630,18 @@
|
|
|
6436
6630
|
const hasFilters = !!Object.keys(filters).length;
|
|
6437
6631
|
|
|
6438
6632
|
try {
|
|
6439
|
-
const
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6633
|
+
const payload = {
|
|
6634
|
+
...this.mx_context,
|
|
6635
|
+
url: this.url,
|
|
6636
|
+
...(hasFilters && { filters })
|
|
6637
|
+
};
|
|
6638
|
+
|
|
6639
|
+
this.$qas.logger.group(
|
|
6640
|
+
`QasListView - fetchList -> Payload do parâmetro do ${this.entity}/fetchList`, [payload]
|
|
6446
6641
|
);
|
|
6447
6642
|
|
|
6643
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchList`, payload);
|
|
6644
|
+
|
|
6448
6645
|
const { errors, fields, metadata } = response.data;
|
|
6449
6646
|
|
|
6450
6647
|
this.mx_setErrors(errors);
|
|
@@ -6458,10 +6655,20 @@
|
|
|
6458
6655
|
});
|
|
6459
6656
|
|
|
6460
6657
|
this.$emit('fetch-success', response);
|
|
6658
|
+
|
|
6659
|
+
this.$qas.logger.group(
|
|
6660
|
+
`QasListView - fetchSingle -> resposta da action ${this.entity}/fetchList`, [response]
|
|
6661
|
+
);
|
|
6461
6662
|
} catch (error) {
|
|
6462
6663
|
this.mx_fetchError(error);
|
|
6463
6664
|
this.$emit('update:errors', error);
|
|
6464
6665
|
this.$emit('fetch-error', error);
|
|
6666
|
+
|
|
6667
|
+
this.$qas.logger.group(
|
|
6668
|
+
`QasListView - fetchSingle -> exceção da action ${this.entity}/fetchList`,
|
|
6669
|
+
[error],
|
|
6670
|
+
{ error: true }
|
|
6671
|
+
);
|
|
6465
6672
|
} finally {
|
|
6466
6673
|
this.mx_isFetching = false;
|
|
6467
6674
|
}
|
|
@@ -6837,13 +7044,7 @@
|
|
|
6837
7044
|
},
|
|
6838
7045
|
|
|
6839
7046
|
children () {
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
for (const key in field?.children) {
|
|
6843
|
-
field.children[key].name = humps.camelize(field?.children[key].name);
|
|
6844
|
-
}
|
|
6845
|
-
|
|
6846
|
-
return field?.children
|
|
7047
|
+
return this.field?.children
|
|
6847
7048
|
},
|
|
6848
7049
|
|
|
6849
7050
|
showDestroyBtn () {
|
|
@@ -6894,13 +7095,17 @@
|
|
|
6894
7095
|
|
|
6895
7096
|
methods: {
|
|
6896
7097
|
add (row = {}) {
|
|
6897
|
-
|
|
7098
|
+
const payload = { ...this.rowObject, ...row };
|
|
7099
|
+
|
|
7100
|
+
this.nested.push(payload);
|
|
6898
7101
|
|
|
6899
7102
|
this.$nextTick(() => {
|
|
6900
7103
|
this.useAnimation && this.setScroll();
|
|
6901
7104
|
this.setFocus();
|
|
6902
7105
|
});
|
|
6903
7106
|
|
|
7107
|
+
this.$qas.logger.group('QasNestedFields - add', [payload]);
|
|
7108
|
+
|
|
6904
7109
|
return this.updateModelValue()
|
|
6905
7110
|
},
|
|
6906
7111
|
|
|
@@ -6920,6 +7125,8 @@
|
|
|
6920
7125
|
? this.nested.splice(index, 1)
|
|
6921
7126
|
: this.nested.splice(index, 1, { [this.destroyKey]: true, ...row });
|
|
6922
7127
|
|
|
7128
|
+
this.$qas.logger.group('QasNestedFields - destroy', [{ index, row }]);
|
|
7129
|
+
|
|
6923
7130
|
return this.updateModelValue()
|
|
6924
7131
|
},
|
|
6925
7132
|
|
|
@@ -7165,6 +7372,14 @@
|
|
|
7165
7372
|
var script$b = {
|
|
7166
7373
|
name: 'QasPageHeader',
|
|
7167
7374
|
|
|
7375
|
+
mixins: [
|
|
7376
|
+
quasar.createMetaMixin(function () {
|
|
7377
|
+
return {
|
|
7378
|
+
title: this.title
|
|
7379
|
+
}
|
|
7380
|
+
})
|
|
7381
|
+
],
|
|
7382
|
+
|
|
7168
7383
|
props: {
|
|
7169
7384
|
breadcrumbs: {
|
|
7170
7385
|
default: '',
|
|
@@ -7227,12 +7442,6 @@
|
|
|
7227
7442
|
|
|
7228
7443
|
return lastIndex === index ? 'text-grey-7' : 'text-primary'
|
|
7229
7444
|
}
|
|
7230
|
-
},
|
|
7231
|
-
|
|
7232
|
-
meta () {
|
|
7233
|
-
return {
|
|
7234
|
-
title: this.title
|
|
7235
|
-
}
|
|
7236
7445
|
}
|
|
7237
7446
|
};
|
|
7238
7447
|
|
|
@@ -7664,17 +7873,17 @@
|
|
|
7664
7873
|
|
|
7665
7874
|
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7666
7875
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
7667
|
-
const
|
|
7876
|
+
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
7668
7877
|
const _component_qas_box = vue.resolveComponent("qas-box");
|
|
7669
7878
|
|
|
7670
7879
|
return (vue.openBlock(), vue.createBlock(_component_qas_box, null, {
|
|
7671
7880
|
default: vue.withCtx(() => [
|
|
7672
|
-
vue.createVNode(
|
|
7881
|
+
vue.createVNode(_component_qas_input, {
|
|
7673
7882
|
modelValue: $data.search,
|
|
7674
7883
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.search) = $event)),
|
|
7675
7884
|
clearable: "",
|
|
7676
7885
|
disable: !$props.list.length,
|
|
7677
|
-
|
|
7886
|
+
"hide-bottom-space": "",
|
|
7678
7887
|
placeholder: $props.placeholder
|
|
7679
7888
|
}, {
|
|
7680
7889
|
append: vue.withCtx(() => [
|
|
@@ -8184,11 +8393,15 @@
|
|
|
8184
8393
|
this.mx_isFetching = true;
|
|
8185
8394
|
|
|
8186
8395
|
try {
|
|
8187
|
-
const
|
|
8188
|
-
|
|
8189
|
-
|
|
8396
|
+
const payload = { id: this.id, url: this.url, params };
|
|
8397
|
+
|
|
8398
|
+
this.$qas.logger.group(
|
|
8399
|
+
`QasSingleView - fetchSingle -> payload do parâmetro do ${this.entity}/fetchSingle`,
|
|
8400
|
+
[payload]
|
|
8190
8401
|
);
|
|
8191
8402
|
|
|
8403
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
|
|
8404
|
+
|
|
8192
8405
|
const { errors, fields, metadata } = response.data;
|
|
8193
8406
|
|
|
8194
8407
|
this.mx_setErrors(errors);
|
|
@@ -8201,10 +8414,20 @@
|
|
|
8201
8414
|
metadata: this.mx_metadata
|
|
8202
8415
|
});
|
|
8203
8416
|
|
|
8417
|
+
this.$qas.logger.group(
|
|
8418
|
+
`QasSingleView - fetchSingle -> resposta da action ${this.entity}/fetchSingle`, [response]
|
|
8419
|
+
);
|
|
8420
|
+
|
|
8204
8421
|
this.$emit('fetch-success', response);
|
|
8205
8422
|
} catch (error) {
|
|
8206
8423
|
this.mx_fetchError(error);
|
|
8207
8424
|
this.$emit('fetch-error', error);
|
|
8425
|
+
|
|
8426
|
+
this.$qas.logger.group(
|
|
8427
|
+
`QasSingleView - fetchSingle -> exceção da action ${this.entity}/fetchSingle`,
|
|
8428
|
+
[error],
|
|
8429
|
+
{ error: true }
|
|
8430
|
+
);
|
|
8208
8431
|
} finally {
|
|
8209
8432
|
this.mx_isFetching = false;
|
|
8210
8433
|
}
|
|
@@ -8496,6 +8719,8 @@
|
|
|
8496
8719
|
columnByField(this.fields[index]);
|
|
8497
8720
|
}
|
|
8498
8721
|
|
|
8722
|
+
this.$qas.logger.group('QasTableGenerator - Automatic columns', [columns]);
|
|
8723
|
+
|
|
8499
8724
|
return columns
|
|
8500
8725
|
}
|
|
8501
8726
|
|
|
@@ -8508,6 +8733,8 @@
|
|
|
8508
8733
|
}
|
|
8509
8734
|
});
|
|
8510
8735
|
|
|
8736
|
+
this.$qas.logger.group('QasTableGenerator - columns', [columns]);
|
|
8737
|
+
|
|
8511
8738
|
return columns
|
|
8512
8739
|
},
|
|
8513
8740
|
|
|
@@ -8524,16 +8751,22 @@
|
|
|
8524
8751
|
},
|
|
8525
8752
|
|
|
8526
8753
|
resultsByFields () {
|
|
8754
|
+
if (!Object.keys(this.fields).length) return []
|
|
8755
|
+
|
|
8527
8756
|
const results = quasar.extend(true, [], this.results);
|
|
8528
8757
|
|
|
8529
|
-
|
|
8758
|
+
const mappedResults = results.map((result, index) => {
|
|
8530
8759
|
for (const key in result) {
|
|
8531
8760
|
result.default = this.results[index];
|
|
8532
8761
|
result[key] = humanize(this.fields[key], result[key]) || this.emptyResultText;
|
|
8533
8762
|
}
|
|
8534
8763
|
|
|
8535
8764
|
return result
|
|
8536
|
-
})
|
|
8765
|
+
});
|
|
8766
|
+
|
|
8767
|
+
this.$qas.logger.group('QasTableGenerator - resultsByFields', [mappedResults]);
|
|
8768
|
+
|
|
8769
|
+
return mappedResults
|
|
8537
8770
|
},
|
|
8538
8771
|
|
|
8539
8772
|
rowsPerPage () {
|
|
@@ -9247,7 +9480,7 @@
|
|
|
9247
9480
|
|
|
9248
9481
|
var name = "@bildvitta/quasar-ui-asteroid";
|
|
9249
9482
|
var description = "Asteroid";
|
|
9250
|
-
var version$1 = "3.0.0-beta.
|
|
9483
|
+
var version$1 = "3.0.0-beta.13";
|
|
9251
9484
|
var author = "Bild & Vitta <systemteam@bild.com.br>";
|
|
9252
9485
|
var license = "MIT";
|
|
9253
9486
|
var main = "dist/asteroid.cjs.min.js";
|
|
@@ -9403,8 +9636,9 @@
|
|
|
9403
9636
|
app.config.globalProperties.$qas = {
|
|
9404
9637
|
dialog: Dialog,
|
|
9405
9638
|
error: NotifyError,
|
|
9406
|
-
|
|
9407
|
-
screen: Screen()
|
|
9639
|
+
logger: Logger(),
|
|
9640
|
+
screen: Screen(),
|
|
9641
|
+
success: NotifySuccess
|
|
9408
9642
|
};
|
|
9409
9643
|
|
|
9410
9644
|
app.directive(Test.name, Test);
|
|
@@ -9462,6 +9696,7 @@
|
|
|
9462
9696
|
QasTransfer: script,
|
|
9463
9697
|
QasUploader: script$q,
|
|
9464
9698
|
Dialog: Dialog,
|
|
9699
|
+
Logger: Logger,
|
|
9465
9700
|
NotifyError: NotifyError,
|
|
9466
9701
|
NotifySuccess: NotifySuccess,
|
|
9467
9702
|
Screen: Screen,
|