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