@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.cjs.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
|
*/
|
|
@@ -474,6 +474,20 @@ function getGreatestCommonDivisor (first, second) {
|
|
|
474
474
|
return first
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
+
function camelizeFieldsName (fields) {
|
|
478
|
+
for (const field in fields) {
|
|
479
|
+
const currentField = fields[field];
|
|
480
|
+
|
|
481
|
+
currentField.name = humps.camelize(currentField.name);
|
|
482
|
+
|
|
483
|
+
if (Object.keys(currentField.children || {}).length) {
|
|
484
|
+
camelizeFieldsName(currentField.children);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return fields
|
|
489
|
+
}
|
|
490
|
+
|
|
477
491
|
// Private
|
|
478
492
|
function __format (value, token, options = {}) {
|
|
479
493
|
if (!value) {
|
|
@@ -2005,7 +2019,7 @@ var script$z = {
|
|
|
2005
2019
|
},
|
|
2006
2020
|
|
|
2007
2021
|
watch: {
|
|
2008
|
-
|
|
2022
|
+
modelValue (current, original) {
|
|
2009
2023
|
if (!current || this.useTimeOnly) {
|
|
2010
2024
|
this.currentValue = current;
|
|
2011
2025
|
return
|
|
@@ -2433,6 +2447,51 @@ var Dialog = (componentProps = {}) => {
|
|
|
2433
2447
|
});
|
|
2434
2448
|
};
|
|
2435
2449
|
|
|
2450
|
+
var Logger = () => {
|
|
2451
|
+
const isDebugEnabled = process.env.DEBUGGING;
|
|
2452
|
+
|
|
2453
|
+
const normalizeMessage = msg => `%c ${msg}`;
|
|
2454
|
+
const getStyle = isError => (
|
|
2455
|
+
`
|
|
2456
|
+
background: ${isError ? '#C10015 ' : '#1976d2'};
|
|
2457
|
+
font-weight: bold;
|
|
2458
|
+
color: white;
|
|
2459
|
+
padding: 6px 20px;
|
|
2460
|
+
border-radius: 4px;
|
|
2461
|
+
display: block;
|
|
2462
|
+
width: 100%;
|
|
2463
|
+
font-size: 12px;
|
|
2464
|
+
`
|
|
2465
|
+
);
|
|
2466
|
+
|
|
2467
|
+
return {
|
|
2468
|
+
group (message, payload = [], { error } = {}) {
|
|
2469
|
+
if (!isDebugEnabled) return
|
|
2470
|
+
|
|
2471
|
+
console.groupCollapsed(normalizeMessage(message), getStyle(error));
|
|
2472
|
+
|
|
2473
|
+
for (const item of payload) {
|
|
2474
|
+
if (typeof item === 'string') {
|
|
2475
|
+
console.info(normalizeMessage(item), getStyle(error));
|
|
2476
|
+
continue
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
console.table(item);
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
console.groupEnd();
|
|
2483
|
+
},
|
|
2484
|
+
|
|
2485
|
+
info (message) {
|
|
2486
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle());
|
|
2487
|
+
},
|
|
2488
|
+
|
|
2489
|
+
error (message) {
|
|
2490
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle(true));
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
};
|
|
2494
|
+
|
|
2436
2495
|
quasar.Notify.registerType('error', {
|
|
2437
2496
|
color: 'negative',
|
|
2438
2497
|
progress: true
|
|
@@ -2619,7 +2678,13 @@ var script$w = {
|
|
|
2619
2678
|
try {
|
|
2620
2679
|
const { destroyRoutes, history } = useHistory();
|
|
2621
2680
|
|
|
2622
|
-
|
|
2681
|
+
const payload = { id: this.id, url: this.url };
|
|
2682
|
+
|
|
2683
|
+
this.$qas.logger.group(
|
|
2684
|
+
`QasDelete - destroy -> Payload do parâmetro do ${this.entity}/destroy`, [payload]
|
|
2685
|
+
);
|
|
2686
|
+
|
|
2687
|
+
await this.$store.dispatch(`${this.entity}/destroy`, payload);
|
|
2623
2688
|
|
|
2624
2689
|
NotifySuccess('Item deletado com sucesso!');
|
|
2625
2690
|
|
|
@@ -2633,9 +2698,17 @@ var script$w = {
|
|
|
2633
2698
|
this.createDeleteSuccessEvent();
|
|
2634
2699
|
|
|
2635
2700
|
this.$emit('success');
|
|
2701
|
+
|
|
2702
|
+
this.$qas.logger.info('QasDelete - destroy -> item deletado com sucesso!');
|
|
2636
2703
|
} catch (error) {
|
|
2637
2704
|
NotifyError('Ops! Não foi possível deletar o item.');
|
|
2638
2705
|
this.$emit('error', error);
|
|
2706
|
+
|
|
2707
|
+
this.$qas.logger.group(
|
|
2708
|
+
`QasDelete - destroy -> exceção da action ${this.entity}/destroy`,
|
|
2709
|
+
[error],
|
|
2710
|
+
{ error: true }
|
|
2711
|
+
);
|
|
2639
2712
|
} finally {
|
|
2640
2713
|
quasar.Loading.hide();
|
|
2641
2714
|
this.$emit('update:deleting', false);
|
|
@@ -2884,7 +2957,7 @@ var script$u = {
|
|
|
2884
2957
|
|
|
2885
2958
|
watch: {
|
|
2886
2959
|
mask () {
|
|
2887
|
-
const input = this.
|
|
2960
|
+
const input = this.getInput();
|
|
2888
2961
|
|
|
2889
2962
|
requestAnimationFrame(() => {
|
|
2890
2963
|
input.selectionStart = input.value ? input.value.length : '';
|
|
@@ -2918,12 +2991,30 @@ var script$u = {
|
|
|
2918
2991
|
},
|
|
2919
2992
|
|
|
2920
2993
|
toggleMask (first, second) {
|
|
2994
|
+
if (!this.modelValue.length) return
|
|
2995
|
+
|
|
2921
2996
|
const length = first.split('#').length - 2;
|
|
2922
2997
|
return this.modelValue?.length > length ? second : first
|
|
2923
2998
|
},
|
|
2924
2999
|
|
|
2925
3000
|
validate (value) {
|
|
2926
3001
|
return this.inputReference.validate(value)
|
|
3002
|
+
},
|
|
3003
|
+
|
|
3004
|
+
onPaste (event) {
|
|
3005
|
+
if (!this.mask) return
|
|
3006
|
+
|
|
3007
|
+
const value = event.clipboardData.getData('text');
|
|
3008
|
+
const input = this.getInput();
|
|
3009
|
+
|
|
3010
|
+
requestAnimationFrame(() => {
|
|
3011
|
+
this.$emit('update:modelValue', value);
|
|
3012
|
+
input.selectionStart = input.value ? input.value.length : '';
|
|
3013
|
+
});
|
|
3014
|
+
},
|
|
3015
|
+
|
|
3016
|
+
getInput () {
|
|
3017
|
+
return this.inputReference.$el?.querySelector('input')
|
|
2927
3018
|
}
|
|
2928
3019
|
}
|
|
2929
3020
|
};
|
|
@@ -2942,7 +3033,8 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2942
3033
|
"error-message": _ctx.errorMessageData,
|
|
2943
3034
|
mask: $options.mask,
|
|
2944
3035
|
outlined: $props.outlined,
|
|
2945
|
-
"unmasked-value": $props.unmaskedValue
|
|
3036
|
+
"unmasked-value": $props.unmaskedValue,
|
|
3037
|
+
onPaste: $options.onPaste
|
|
2946
3038
|
}), vue.createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
2947
3039
|
vue.renderList(_ctx.$slots, (_, name) => {
|
|
2948
3040
|
return {
|
|
@@ -2952,7 +3044,7 @@ function render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2952
3044
|
])
|
|
2953
3045
|
}
|
|
2954
3046
|
})
|
|
2955
|
-
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "error", "error-message", "mask", "outlined", "unmasked-value"])
|
|
3047
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "error", "error-message", "mask", "outlined", "unmasked-value", "onPaste"])
|
|
2956
3048
|
]))
|
|
2957
3049
|
}
|
|
2958
3050
|
|
|
@@ -3602,6 +3694,8 @@ var script$q = {
|
|
|
3602
3694
|
);
|
|
3603
3695
|
|
|
3604
3696
|
this.updateUploading(false);
|
|
3697
|
+
|
|
3698
|
+
this.$qas.logger.group('QasUploader - uploaded', [this.modelValue]);
|
|
3605
3699
|
},
|
|
3606
3700
|
|
|
3607
3701
|
async fetchCredentials (filename) {
|
|
@@ -3612,6 +3706,12 @@ var script$q = {
|
|
|
3612
3706
|
entity: this.entity,
|
|
3613
3707
|
filename
|
|
3614
3708
|
});
|
|
3709
|
+
|
|
3710
|
+
this.$qas.logger.group(
|
|
3711
|
+
'QasUploader - fetchCredentials -> resposta de /upload-credentials/',
|
|
3712
|
+
[data]
|
|
3713
|
+
);
|
|
3714
|
+
|
|
3615
3715
|
return data
|
|
3616
3716
|
} finally {
|
|
3617
3717
|
this.isFetching = false;
|
|
@@ -3631,7 +3731,9 @@ var script$q = {
|
|
|
3631
3731
|
|
|
3632
3732
|
const clonedValue = quasar.extend(true, [], this.modelValue);
|
|
3633
3733
|
const numberIndex = this.modelValue.findIndex(file => this.getFileName(file) === index);
|
|
3734
|
+
|
|
3634
3735
|
clonedValue.splice(numberIndex, 1);
|
|
3736
|
+
|
|
3635
3737
|
this.$emit('update:modelValue', clonedValue);
|
|
3636
3738
|
},
|
|
3637
3739
|
|
|
@@ -3640,7 +3742,9 @@ var script$q = {
|
|
|
3640
3742
|
},
|
|
3641
3743
|
|
|
3642
3744
|
getFilesList (uploadedFiles) {
|
|
3643
|
-
const pathsList = Array.isArray(this.modelValue)
|
|
3745
|
+
const pathsList = Array.isArray(this.modelValue)
|
|
3746
|
+
? this.modelValue
|
|
3747
|
+
: (this.modelValue ? [this.modelValue] : []);
|
|
3644
3748
|
|
|
3645
3749
|
uploadedFiles = uploadedFiles.map((file, indexToDelete) => {
|
|
3646
3750
|
return {
|
|
@@ -3676,6 +3780,8 @@ var script$q = {
|
|
|
3676
3780
|
}
|
|
3677
3781
|
});
|
|
3678
3782
|
|
|
3783
|
+
this.$qas.logger.group('QasUploader - getFilesList', [files]);
|
|
3784
|
+
|
|
3679
3785
|
return files
|
|
3680
3786
|
},
|
|
3681
3787
|
|
|
@@ -3714,7 +3820,14 @@ var script$q = {
|
|
|
3714
3820
|
// Retorna largura e altura da original da imagem
|
|
3715
3821
|
const { width, height } = await getImageSize(image);
|
|
3716
3822
|
|
|
3717
|
-
if (width <= this.sizeLimit)
|
|
3823
|
+
if (width <= this.sizeLimit) {
|
|
3824
|
+
this.$qas.logger.info(`
|
|
3825
|
+
QasUploader - resizeImage -> Tamanho da imagem menor que o tamanho limite,
|
|
3826
|
+
sendo assim, não faz o resize
|
|
3827
|
+
`);
|
|
3828
|
+
|
|
3829
|
+
return file
|
|
3830
|
+
}
|
|
3718
3831
|
|
|
3719
3832
|
// Retorna os novos tamanhos redimensionados
|
|
3720
3833
|
const resizedDimensions = getResizeDimensions(this.sizeLimit, width, height);
|
|
@@ -3732,7 +3845,11 @@ var script$q = {
|
|
|
3732
3845
|
const resizedImage = await pica.resize(image, canvas, this.defaultPicaResizeOptions);
|
|
3733
3846
|
const blob = await pica.toBlob(resizedImage, type, 0.90);
|
|
3734
3847
|
|
|
3735
|
-
|
|
3848
|
+
const newFile = new File([blob], file.name, { type });
|
|
3849
|
+
|
|
3850
|
+
this.$qas.logger.group('QasUploader - resizeImage -> nova imagem', [newFile]);
|
|
3851
|
+
|
|
3852
|
+
return newFile
|
|
3736
3853
|
} catch {
|
|
3737
3854
|
// Caso não consiga redimensionar retorna o arquivo original
|
|
3738
3855
|
return file
|
|
@@ -4714,11 +4831,26 @@ var script$m = {
|
|
|
4714
4831
|
this.isFetching = true;
|
|
4715
4832
|
|
|
4716
4833
|
try {
|
|
4834
|
+
this.$qas.logger.group(
|
|
4835
|
+
`QasFilters - fetchFilters -> Payload do parâmetro do ${this.entity}/fetchFilters`,
|
|
4836
|
+
[{ url: this.url }]
|
|
4837
|
+
);
|
|
4838
|
+
|
|
4717
4839
|
const response = await this.$store.dispatch(`${this.entity}/fetchFilters`, { url: this.url });
|
|
4718
4840
|
this.$emit('fetch-success', response);
|
|
4841
|
+
|
|
4842
|
+
this.$qas.logger.group(
|
|
4843
|
+
`QasFilters - fetchFilters -> resposta da action ${this.entity}/fetchFilters`, [response]
|
|
4844
|
+
);
|
|
4719
4845
|
} catch (error) {
|
|
4720
4846
|
this.hasFetchError = true;
|
|
4721
4847
|
this.$emit('fetch-error', error);
|
|
4848
|
+
|
|
4849
|
+
this.$qas.logger.group(
|
|
4850
|
+
`QasFilters - fetchFilters -> exceção da action ${this.entity}/fetchFilters`,
|
|
4851
|
+
[error],
|
|
4852
|
+
{ error: true }
|
|
4853
|
+
);
|
|
4722
4854
|
} finally {
|
|
4723
4855
|
this.isFetching = false;
|
|
4724
4856
|
}
|
|
@@ -4802,7 +4934,7 @@ const _hoisted_7$2 = {
|
|
|
4802
4934
|
|
|
4803
4935
|
function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4804
4936
|
const _component_qas_btn = vue.resolveComponent("qas-btn");
|
|
4805
|
-
const
|
|
4937
|
+
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
4806
4938
|
const _component_q_form = vue.resolveComponent("q-form");
|
|
4807
4939
|
const _component_q_spinner = vue.resolveComponent("q-spinner");
|
|
4808
4940
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
@@ -4822,11 +4954,13 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4822
4954
|
onSubmit: _cache[2] || (_cache[2] = vue.withModifiers($event => ($options.filter()), ["prevent"]))
|
|
4823
4955
|
}, {
|
|
4824
4956
|
default: vue.withCtx(() => [
|
|
4825
|
-
vue.createVNode(
|
|
4957
|
+
vue.createVNode(_component_qas_input, {
|
|
4826
4958
|
modelValue: $data.search,
|
|
4827
4959
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.search) = $event)),
|
|
4828
4960
|
debounce: $options.debounce,
|
|
4829
4961
|
dense: "",
|
|
4962
|
+
"hide-bottom-space": "",
|
|
4963
|
+
outlined: false,
|
|
4830
4964
|
placeholder: $props.searchPlaceholder,
|
|
4831
4965
|
type: "search"
|
|
4832
4966
|
}, {
|
|
@@ -4834,6 +4968,8 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4834
4968
|
($options.hasSearch)
|
|
4835
4969
|
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4836
4970
|
key: 0,
|
|
4971
|
+
color: "grey-9",
|
|
4972
|
+
flat: "",
|
|
4837
4973
|
icon: "o_clear",
|
|
4838
4974
|
unelevated: "",
|
|
4839
4975
|
onClick: $options.clearSearch
|
|
@@ -4842,6 +4978,8 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4842
4978
|
(!$options.debounce)
|
|
4843
4979
|
? (vue.openBlock(), vue.createBlock(_component_qas_btn, {
|
|
4844
4980
|
key: 1,
|
|
4981
|
+
color: "grey-9",
|
|
4982
|
+
flat: "",
|
|
4845
4983
|
icon: "o_search",
|
|
4846
4984
|
type: "submit",
|
|
4847
4985
|
unelevated: "",
|
|
@@ -5267,11 +5405,9 @@ var viewMixin = {
|
|
|
5267
5405
|
},
|
|
5268
5406
|
|
|
5269
5407
|
mx_setFields (fields = {}) {
|
|
5270
|
-
|
|
5271
|
-
fields[field].name = humps.camelize(fields[field].name);
|
|
5272
|
-
}
|
|
5408
|
+
const camelizedFields = camelizeFieldsName(fields);
|
|
5273
5409
|
|
|
5274
|
-
this.mx_fields = vue.markRaw(
|
|
5410
|
+
this.mx_fields = vue.markRaw(camelizedFields);
|
|
5275
5411
|
},
|
|
5276
5412
|
|
|
5277
5413
|
mx_setMetadata (metadata = {}) {
|
|
@@ -5454,8 +5590,10 @@ var script$k = {
|
|
|
5454
5590
|
},
|
|
5455
5591
|
|
|
5456
5592
|
created () {
|
|
5457
|
-
vueRouter.onBeforeRouteLeave(this.beforeRouteLeave);
|
|
5593
|
+
this.useDialogOnUnsavedChanges && vueRouter.onBeforeRouteLeave(this.beforeRouteLeave);
|
|
5594
|
+
|
|
5458
5595
|
window.addEventListener('delete-success', this.setIgnoreRouterGuard);
|
|
5596
|
+
|
|
5459
5597
|
this.fetch();
|
|
5460
5598
|
},
|
|
5461
5599
|
|
|
@@ -5486,6 +5624,11 @@ var script$k = {
|
|
|
5486
5624
|
return next()
|
|
5487
5625
|
}
|
|
5488
5626
|
|
|
5627
|
+
this.$qas.logger.group(
|
|
5628
|
+
'QasFormView - beforeRouteLeave -> dialog chamado, modelValue diferente do cachedResult',
|
|
5629
|
+
[{ modelValue: clonedModelValue, cachedResult: clonedCachedResult }]
|
|
5630
|
+
);
|
|
5631
|
+
|
|
5489
5632
|
this.handleDialog(() => {
|
|
5490
5633
|
this.ignoreRouterGuard = true;
|
|
5491
5634
|
next();
|
|
@@ -5500,10 +5643,14 @@ var script$k = {
|
|
|
5500
5643
|
this.mx_isFetching = true;
|
|
5501
5644
|
|
|
5502
5645
|
try {
|
|
5503
|
-
const
|
|
5504
|
-
|
|
5646
|
+
const payload = { form: true, id: this.id, params, url: this.fetchURL };
|
|
5647
|
+
|
|
5648
|
+
this.$qas.logger.group(
|
|
5649
|
+
`QasFormView - fetch -> payload do parâmetro do ${this.entity}/fetchSingle`, [payload]
|
|
5505
5650
|
);
|
|
5506
5651
|
|
|
5652
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
|
|
5653
|
+
|
|
5507
5654
|
const { errors, fields, metadata, result } = response.data;
|
|
5508
5655
|
|
|
5509
5656
|
this.mx_setErrors(errors);
|
|
@@ -5516,20 +5663,36 @@ var script$k = {
|
|
|
5516
5663
|
metadata
|
|
5517
5664
|
});
|
|
5518
5665
|
|
|
5666
|
+
this.$qas.logger.group(
|
|
5667
|
+
`QasFormView - fetch -> resposta da action ${this.entity}/fetchSingle`, [response]
|
|
5668
|
+
);
|
|
5669
|
+
|
|
5519
5670
|
if (result) {
|
|
5520
5671
|
this.hasResult = true;
|
|
5521
5672
|
|
|
5522
5673
|
this.$nextTick(() => {
|
|
5523
|
-
|
|
5674
|
+
const modelValue = { ...this.modelValue, ...result };
|
|
5675
|
+
|
|
5676
|
+
this.$emit('update:modelValue', modelValue);
|
|
5677
|
+
|
|
5678
|
+
this.$qas.logger.group('QasFormView - fetch -> modelValue', [modelValue]);
|
|
5524
5679
|
});
|
|
5525
5680
|
|
|
5526
5681
|
this.cachedResult = this.useDialogOnUnsavedChanges && quasar.extend(true, {}, result);
|
|
5682
|
+
|
|
5683
|
+
this.$qas.logger.group('QasFormView - fetch -> cachedResult', [this.cachedResult]);
|
|
5527
5684
|
}
|
|
5528
5685
|
|
|
5529
5686
|
this.$emit('fetch-success', response, this.modelValue);
|
|
5530
5687
|
} catch (error) {
|
|
5531
5688
|
this.mx_fetchError(error);
|
|
5532
5689
|
this.$emit('fetch-error', error);
|
|
5690
|
+
|
|
5691
|
+
this.$qas.logger.group(
|
|
5692
|
+
`QasFormView - fetch -> exceção da action ${this.entity}/fetchSingle`,
|
|
5693
|
+
[error],
|
|
5694
|
+
{ error: true }
|
|
5695
|
+
);
|
|
5533
5696
|
} finally {
|
|
5534
5697
|
this.mx_isFetching = false;
|
|
5535
5698
|
}
|
|
@@ -5595,11 +5758,14 @@ var script$k = {
|
|
|
5595
5758
|
this.isSubmitting = true;
|
|
5596
5759
|
|
|
5597
5760
|
try {
|
|
5598
|
-
const
|
|
5599
|
-
|
|
5600
|
-
|
|
5761
|
+
const payload = { id: this.id, payload: this.modelValue, url: this.url };
|
|
5762
|
+
|
|
5763
|
+
this.$qas.logger.group(
|
|
5764
|
+
`QasFormView - submit -> payload do ${this.entity}/${this.mode}`, [payload]
|
|
5601
5765
|
);
|
|
5602
5766
|
|
|
5767
|
+
const response = await this.$store.dispatch(`${this.entity}/${this.mode}`, payload);
|
|
5768
|
+
|
|
5603
5769
|
if (this.useDialogOnUnsavedChanges) {
|
|
5604
5770
|
this.cachedResult = quasar.extend(true, {}, this.modelValue);
|
|
5605
5771
|
}
|
|
@@ -5607,11 +5773,18 @@ var script$k = {
|
|
|
5607
5773
|
this.mx_setErrors();
|
|
5608
5774
|
NotifySuccess(response.data.status.text || 'Item salvo com sucesso!');
|
|
5609
5775
|
this.$emit('submit-success', response, this.modelValue);
|
|
5776
|
+
|
|
5777
|
+
this.$qas.logger.group(
|
|
5778
|
+
`QasFormView - submit -> resposta da action ${this.entity}/${this.mode}`, [response]
|
|
5779
|
+
);
|
|
5610
5780
|
} catch (error) {
|
|
5611
5781
|
const errors = error?.response?.data?.errors;
|
|
5612
5782
|
const message = error?.response?.data?.status?.text;
|
|
5613
5783
|
const exceptionResponse = error?.response?.data?.exception;
|
|
5614
|
-
|
|
5784
|
+
|
|
5785
|
+
const exception = errors
|
|
5786
|
+
? 'Existem erros de validação no formulário.'
|
|
5787
|
+
: exceptionResponse || error.message;
|
|
5615
5788
|
|
|
5616
5789
|
this.mx_setErrors(errors);
|
|
5617
5790
|
this.$emit('update:errors', this.mx_errors);
|
|
@@ -5619,6 +5792,12 @@ var script$k = {
|
|
|
5619
5792
|
NotifyError(message || 'Ops! Erro ao salvar item.', exception);
|
|
5620
5793
|
|
|
5621
5794
|
this.$emit('submit-error', error);
|
|
5795
|
+
|
|
5796
|
+
this.$qas.logger.group(
|
|
5797
|
+
`QasFormView - fetch -> exceção da action ${this.entity}/${this.mode}`,
|
|
5798
|
+
[error],
|
|
5799
|
+
{ error: true }
|
|
5800
|
+
);
|
|
5622
5801
|
} finally {
|
|
5623
5802
|
this.isSubmitting = false;
|
|
5624
5803
|
}
|
|
@@ -6013,6 +6192,11 @@ var script$i = {
|
|
|
6013
6192
|
computed: {
|
|
6014
6193
|
formattedFields () {
|
|
6015
6194
|
if (this.useEmptyResult) {
|
|
6195
|
+
this.$qas.logger.group(
|
|
6196
|
+
'QasGridGenerator - formattedFields -> this.useEmptyResult tem valor "true"',
|
|
6197
|
+
[this.fields]
|
|
6198
|
+
);
|
|
6199
|
+
|
|
6016
6200
|
return this.fields
|
|
6017
6201
|
}
|
|
6018
6202
|
|
|
@@ -6030,6 +6214,8 @@ var script$i = {
|
|
|
6030
6214
|
}
|
|
6031
6215
|
}
|
|
6032
6216
|
|
|
6217
|
+
this.$qas.logger.group('QasGridGenerator - formattedFields', [fields]);
|
|
6218
|
+
|
|
6033
6219
|
return fields
|
|
6034
6220
|
},
|
|
6035
6221
|
|
|
@@ -6045,11 +6231,19 @@ var script$i = {
|
|
|
6045
6231
|
|
|
6046
6232
|
for (const key in result) {
|
|
6047
6233
|
if (this.formattedFields[key]?.type) {
|
|
6048
|
-
formattedResult[key] =
|
|
6049
|
-
|
|
6234
|
+
formattedResult[key] = (
|
|
6235
|
+
humanize(this.formattedFields[key], result[key]) || this.emptyResultText
|
|
6236
|
+
);
|
|
6237
|
+
|
|
6238
|
+
this.slotValue[key] = {
|
|
6239
|
+
...this.formattedFields[key],
|
|
6240
|
+
formattedResult: formattedResult[key]
|
|
6241
|
+
};
|
|
6050
6242
|
}
|
|
6051
6243
|
}
|
|
6052
6244
|
|
|
6245
|
+
this.$qas.logger.group('QasGridGenerator - getResultsByFields', [formattedResult]);
|
|
6246
|
+
|
|
6053
6247
|
return formattedResult
|
|
6054
6248
|
}
|
|
6055
6249
|
}
|
|
@@ -6448,15 +6642,18 @@ var script$e = {
|
|
|
6448
6642
|
const hasFilters = !!Object.keys(filters).length;
|
|
6449
6643
|
|
|
6450
6644
|
try {
|
|
6451
|
-
const
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6645
|
+
const payload = {
|
|
6646
|
+
...this.mx_context,
|
|
6647
|
+
url: this.url,
|
|
6648
|
+
...(hasFilters && { filters })
|
|
6649
|
+
};
|
|
6650
|
+
|
|
6651
|
+
this.$qas.logger.group(
|
|
6652
|
+
`QasListView - fetchList -> Payload do parâmetro do ${this.entity}/fetchList`, [payload]
|
|
6458
6653
|
);
|
|
6459
6654
|
|
|
6655
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchList`, payload);
|
|
6656
|
+
|
|
6460
6657
|
const { errors, fields, metadata } = response.data;
|
|
6461
6658
|
|
|
6462
6659
|
this.mx_setErrors(errors);
|
|
@@ -6470,10 +6667,20 @@ var script$e = {
|
|
|
6470
6667
|
});
|
|
6471
6668
|
|
|
6472
6669
|
this.$emit('fetch-success', response);
|
|
6670
|
+
|
|
6671
|
+
this.$qas.logger.group(
|
|
6672
|
+
`QasListView - fetchSingle -> resposta da action ${this.entity}/fetchList`, [response]
|
|
6673
|
+
);
|
|
6473
6674
|
} catch (error) {
|
|
6474
6675
|
this.mx_fetchError(error);
|
|
6475
6676
|
this.$emit('update:errors', error);
|
|
6476
6677
|
this.$emit('fetch-error', error);
|
|
6678
|
+
|
|
6679
|
+
this.$qas.logger.group(
|
|
6680
|
+
`QasListView - fetchSingle -> exceção da action ${this.entity}/fetchList`,
|
|
6681
|
+
[error],
|
|
6682
|
+
{ error: true }
|
|
6683
|
+
);
|
|
6477
6684
|
} finally {
|
|
6478
6685
|
this.mx_isFetching = false;
|
|
6479
6686
|
}
|
|
@@ -6849,13 +7056,7 @@ var script$c = {
|
|
|
6849
7056
|
},
|
|
6850
7057
|
|
|
6851
7058
|
children () {
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
for (const key in field?.children) {
|
|
6855
|
-
field.children[key].name = humps.camelize(field?.children[key].name);
|
|
6856
|
-
}
|
|
6857
|
-
|
|
6858
|
-
return field?.children
|
|
7059
|
+
return this.field?.children
|
|
6859
7060
|
},
|
|
6860
7061
|
|
|
6861
7062
|
showDestroyBtn () {
|
|
@@ -6906,13 +7107,17 @@ var script$c = {
|
|
|
6906
7107
|
|
|
6907
7108
|
methods: {
|
|
6908
7109
|
add (row = {}) {
|
|
6909
|
-
|
|
7110
|
+
const payload = { ...this.rowObject, ...row };
|
|
7111
|
+
|
|
7112
|
+
this.nested.push(payload);
|
|
6910
7113
|
|
|
6911
7114
|
this.$nextTick(() => {
|
|
6912
7115
|
this.useAnimation && this.setScroll();
|
|
6913
7116
|
this.setFocus();
|
|
6914
7117
|
});
|
|
6915
7118
|
|
|
7119
|
+
this.$qas.logger.group('QasNestedFields - add', [payload]);
|
|
7120
|
+
|
|
6916
7121
|
return this.updateModelValue()
|
|
6917
7122
|
},
|
|
6918
7123
|
|
|
@@ -6932,6 +7137,8 @@ var script$c = {
|
|
|
6932
7137
|
? this.nested.splice(index, 1)
|
|
6933
7138
|
: this.nested.splice(index, 1, { [this.destroyKey]: true, ...row });
|
|
6934
7139
|
|
|
7140
|
+
this.$qas.logger.group('QasNestedFields - destroy', [{ index, row }]);
|
|
7141
|
+
|
|
6935
7142
|
return this.updateModelValue()
|
|
6936
7143
|
},
|
|
6937
7144
|
|
|
@@ -7177,6 +7384,14 @@ const { hasPreviousRoute, history: history$1, getPreviousRoute } = useHistory();
|
|
|
7177
7384
|
var script$b = {
|
|
7178
7385
|
name: 'QasPageHeader',
|
|
7179
7386
|
|
|
7387
|
+
mixins: [
|
|
7388
|
+
quasar.createMetaMixin(function () {
|
|
7389
|
+
return {
|
|
7390
|
+
title: this.title
|
|
7391
|
+
}
|
|
7392
|
+
})
|
|
7393
|
+
],
|
|
7394
|
+
|
|
7180
7395
|
props: {
|
|
7181
7396
|
breadcrumbs: {
|
|
7182
7397
|
default: '',
|
|
@@ -7239,12 +7454,6 @@ var script$b = {
|
|
|
7239
7454
|
|
|
7240
7455
|
return lastIndex === index ? 'text-grey-7' : 'text-primary'
|
|
7241
7456
|
}
|
|
7242
|
-
},
|
|
7243
|
-
|
|
7244
|
-
meta () {
|
|
7245
|
-
return {
|
|
7246
|
-
title: this.title
|
|
7247
|
-
}
|
|
7248
7457
|
}
|
|
7249
7458
|
};
|
|
7250
7459
|
|
|
@@ -7676,17 +7885,17 @@ const _hoisted_2$3 = /*#__PURE__*/vue.createElementVNode("div", null, "Não há
|
|
|
7676
7885
|
|
|
7677
7886
|
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7678
7887
|
const _component_q_icon = vue.resolveComponent("q-icon");
|
|
7679
|
-
const
|
|
7888
|
+
const _component_qas_input = vue.resolveComponent("qas-input");
|
|
7680
7889
|
const _component_qas_box = vue.resolveComponent("qas-box");
|
|
7681
7890
|
|
|
7682
7891
|
return (vue.openBlock(), vue.createBlock(_component_qas_box, null, {
|
|
7683
7892
|
default: vue.withCtx(() => [
|
|
7684
|
-
vue.createVNode(
|
|
7893
|
+
vue.createVNode(_component_qas_input, {
|
|
7685
7894
|
modelValue: $data.search,
|
|
7686
7895
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.search) = $event)),
|
|
7687
7896
|
clearable: "",
|
|
7688
7897
|
disable: !$props.list.length,
|
|
7689
|
-
|
|
7898
|
+
"hide-bottom-space": "",
|
|
7690
7899
|
placeholder: $props.placeholder
|
|
7691
7900
|
}, {
|
|
7692
7901
|
append: vue.withCtx(() => [
|
|
@@ -8196,11 +8405,15 @@ var script$5 = {
|
|
|
8196
8405
|
this.mx_isFetching = true;
|
|
8197
8406
|
|
|
8198
8407
|
try {
|
|
8199
|
-
const
|
|
8200
|
-
|
|
8201
|
-
|
|
8408
|
+
const payload = { id: this.id, url: this.url, params };
|
|
8409
|
+
|
|
8410
|
+
this.$qas.logger.group(
|
|
8411
|
+
`QasSingleView - fetchSingle -> payload do parâmetro do ${this.entity}/fetchSingle`,
|
|
8412
|
+
[payload]
|
|
8202
8413
|
);
|
|
8203
8414
|
|
|
8415
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
|
|
8416
|
+
|
|
8204
8417
|
const { errors, fields, metadata } = response.data;
|
|
8205
8418
|
|
|
8206
8419
|
this.mx_setErrors(errors);
|
|
@@ -8213,10 +8426,20 @@ var script$5 = {
|
|
|
8213
8426
|
metadata: this.mx_metadata
|
|
8214
8427
|
});
|
|
8215
8428
|
|
|
8429
|
+
this.$qas.logger.group(
|
|
8430
|
+
`QasSingleView - fetchSingle -> resposta da action ${this.entity}/fetchSingle`, [response]
|
|
8431
|
+
);
|
|
8432
|
+
|
|
8216
8433
|
this.$emit('fetch-success', response);
|
|
8217
8434
|
} catch (error) {
|
|
8218
8435
|
this.mx_fetchError(error);
|
|
8219
8436
|
this.$emit('fetch-error', error);
|
|
8437
|
+
|
|
8438
|
+
this.$qas.logger.group(
|
|
8439
|
+
`QasSingleView - fetchSingle -> exceção da action ${this.entity}/fetchSingle`,
|
|
8440
|
+
[error],
|
|
8441
|
+
{ error: true }
|
|
8442
|
+
);
|
|
8220
8443
|
} finally {
|
|
8221
8444
|
this.mx_isFetching = false;
|
|
8222
8445
|
}
|
|
@@ -8508,6 +8731,8 @@ var script$3 = {
|
|
|
8508
8731
|
columnByField(this.fields[index]);
|
|
8509
8732
|
}
|
|
8510
8733
|
|
|
8734
|
+
this.$qas.logger.group('QasTableGenerator - Automatic columns', [columns]);
|
|
8735
|
+
|
|
8511
8736
|
return columns
|
|
8512
8737
|
}
|
|
8513
8738
|
|
|
@@ -8520,6 +8745,8 @@ var script$3 = {
|
|
|
8520
8745
|
}
|
|
8521
8746
|
});
|
|
8522
8747
|
|
|
8748
|
+
this.$qas.logger.group('QasTableGenerator - columns', [columns]);
|
|
8749
|
+
|
|
8523
8750
|
return columns
|
|
8524
8751
|
},
|
|
8525
8752
|
|
|
@@ -8536,16 +8763,22 @@ var script$3 = {
|
|
|
8536
8763
|
},
|
|
8537
8764
|
|
|
8538
8765
|
resultsByFields () {
|
|
8766
|
+
if (!Object.keys(this.fields).length) return []
|
|
8767
|
+
|
|
8539
8768
|
const results = quasar.extend(true, [], this.results);
|
|
8540
8769
|
|
|
8541
|
-
|
|
8770
|
+
const mappedResults = results.map((result, index) => {
|
|
8542
8771
|
for (const key in result) {
|
|
8543
8772
|
result.default = this.results[index];
|
|
8544
8773
|
result[key] = humanize(this.fields[key], result[key]) || this.emptyResultText;
|
|
8545
8774
|
}
|
|
8546
8775
|
|
|
8547
8776
|
return result
|
|
8548
|
-
})
|
|
8777
|
+
});
|
|
8778
|
+
|
|
8779
|
+
this.$qas.logger.group('QasTableGenerator - resultsByFields', [mappedResults]);
|
|
8780
|
+
|
|
8781
|
+
return mappedResults
|
|
8549
8782
|
},
|
|
8550
8783
|
|
|
8551
8784
|
rowsPerPage () {
|
|
@@ -9259,7 +9492,7 @@ script.__file = "src/components/transfer/QasTransfer.vue";
|
|
|
9259
9492
|
|
|
9260
9493
|
var name = "@bildvitta/quasar-ui-asteroid";
|
|
9261
9494
|
var description = "Asteroid";
|
|
9262
|
-
var version$1 = "3.0.0-beta.
|
|
9495
|
+
var version$1 = "3.0.0-beta.13";
|
|
9263
9496
|
var author = "Bild & Vitta <systemteam@bild.com.br>";
|
|
9264
9497
|
var license = "MIT";
|
|
9265
9498
|
var main = "dist/asteroid.cjs.min.js";
|
|
@@ -9415,14 +9648,16 @@ function install (app) {
|
|
|
9415
9648
|
app.config.globalProperties.$qas = {
|
|
9416
9649
|
dialog: Dialog,
|
|
9417
9650
|
error: NotifyError,
|
|
9418
|
-
|
|
9419
|
-
screen: Screen()
|
|
9651
|
+
logger: Logger(),
|
|
9652
|
+
screen: Screen(),
|
|
9653
|
+
success: NotifySuccess
|
|
9420
9654
|
};
|
|
9421
9655
|
|
|
9422
9656
|
app.directive(Test.name, Test);
|
|
9423
9657
|
}
|
|
9424
9658
|
|
|
9425
9659
|
exports.Dialog = Dialog;
|
|
9660
|
+
exports.Logger = Logger;
|
|
9426
9661
|
exports.NotifyError = NotifyError;
|
|
9427
9662
|
exports.NotifySuccess = NotifySuccess;
|
|
9428
9663
|
exports.QasActions = script$L;
|