@bildvitta/quasar-ui-asteroid 3.0.0-beta.9 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/api/QasAppBar.json +0 -4
  2. package/dist/api/QasBtn.json +2 -1
  3. package/dist/api/QasCard.json +13 -9
  4. package/dist/api/QasDateTimeInput.json +12 -12
  5. package/dist/api/QasDialog.json +6 -2
  6. package/dist/api/QasFilters.json +4 -4
  7. package/dist/api/QasFormGenerator.json +33 -2
  8. package/dist/api/QasFormView.json +26 -9
  9. package/dist/api/QasGridGenerator.json +5 -4
  10. package/dist/api/QasInput.json +1 -1
  11. package/dist/api/QasListItems.json +18 -17
  12. package/dist/api/QasListView.json +21 -7
  13. package/dist/api/QasNestedFields.json +13 -3
  14. package/dist/api/QasNumericInput.json +10 -10
  15. package/dist/api/QasPasswordInput.json +1 -1
  16. package/dist/api/QasSearchBox.json +80 -1
  17. package/dist/api/QasSelect.json +79 -6
  18. package/dist/api/QasSelectList.json +16 -14
  19. package/dist/api/QasSignaturePad.json +1 -1
  20. package/dist/api/QasSingleView.json +13 -4
  21. package/dist/api/QasTabsGenerator.json +5 -2
  22. package/dist/api/QasUploader.json +5 -0
  23. package/dist/asteroid.cjs.css +1 -1
  24. package/dist/asteroid.cjs.js +1463 -663
  25. package/dist/asteroid.cjs.min.js +2 -2
  26. package/dist/asteroid.esm.css +1 -1
  27. package/dist/asteroid.esm.js +1466 -666
  28. package/dist/asteroid.esm.min.js +2 -2
  29. package/dist/asteroid.umd.css +1 -1
  30. package/dist/asteroid.umd.js +1466 -667
  31. package/dist/asteroid.umd.min.js +2 -2
  32. package/dist/vetur/asteroid-attributes.json +162 -94
  33. package/dist/vetur/asteroid-tags.json +54 -37
  34. package/package.json +1 -1
  35. package/src/components/actions-menu/QasActionsMenu.vue +2 -8
  36. package/src/components/app-bar/QasAppBar.vue +16 -12
  37. package/src/components/app-bar/QasAppBar.yml +0 -4
  38. package/src/components/avatar/QasAvatar.vue +0 -4
  39. package/src/components/btn/QasBtn.vue +5 -8
  40. package/src/components/btn/QasBtn.yml +2 -1
  41. package/src/components/card/QasCard.vue +18 -9
  42. package/src/components/card/QasCard.yml +13 -9
  43. package/src/components/date-time-input/QasDateTimeInput.vue +39 -41
  44. package/src/components/date-time-input/QasDateTimeInput.yml +11 -12
  45. package/src/components/delete/QasDelete.vue +15 -1
  46. package/src/components/dialog/QasDialog.vue +26 -3
  47. package/src/components/dialog/QasDialog.yml +6 -3
  48. package/src/components/dialog-router/QasDialogRouter.vue +1 -1
  49. package/src/components/field/QasField.vue +15 -14
  50. package/src/components/filters/QasFilters.vue +27 -10
  51. package/src/components/filters/QasFilters.yml +4 -4
  52. package/src/components/form-generator/QasFormGenerator.vue +87 -12
  53. package/src/components/form-generator/QasFormGenerator.yml +16 -2
  54. package/src/components/form-view/QasFormView.vue +99 -39
  55. package/src/components/form-view/QasFormView.yml +22 -9
  56. package/src/components/grid-generator/QasGridGenerator.vue +23 -7
  57. package/src/components/grid-generator/QasGridGenerator.yml +5 -4
  58. package/src/components/input/QasInput.vue +37 -21
  59. package/src/components/input/QasInput.yml +1 -1
  60. package/src/components/layout/QasLayout.vue +4 -0
  61. package/src/components/list-items/QasListItems.vue +15 -23
  62. package/src/components/list-items/QasListItems.yml +14 -15
  63. package/src/components/list-view/QasListView.vue +45 -24
  64. package/src/components/list-view/QasListView.yml +19 -7
  65. package/src/components/map/QasMap.vue +5 -5
  66. package/src/components/nested-fields/QasNestedFields.vue +29 -21
  67. package/src/components/nested-fields/QasNestedFields.yml +9 -3
  68. package/src/components/numeric-input/QasNumericInput.vue +14 -14
  69. package/src/components/numeric-input/QasNumericInput.yml +10 -10
  70. package/src/components/page-header/QasPageHeader.vue +14 -11
  71. package/src/components/password-input/QasPasswordInput.vue +17 -16
  72. package/src/components/password-input/QasPasswordInput.yml +1 -1
  73. package/src/components/profile/QasProfile.vue +1 -1
  74. package/src/components/search-box/QasSearchBox.vue +137 -36
  75. package/src/components/search-box/QasSearchBox.yml +66 -1
  76. package/src/components/select/QasSelect.vue +62 -46
  77. package/src/components/select/QasSelect.yml +63 -6
  78. package/src/components/select-list/QasSelectList.vue +11 -27
  79. package/src/components/select-list/QasSelectList.yml +13 -14
  80. package/src/components/signature-pad/QasSignaturePad.yml +1 -1
  81. package/src/components/signature-uploader/QasSignatureUploader.vue +7 -5
  82. package/src/components/single-view/QasSingleView.vue +22 -6
  83. package/src/components/single-view/QasSingleView.yml +11 -4
  84. package/src/components/table-generator/QasTableGenerator.vue +11 -1
  85. package/src/components/tabs-generator/QasTabsGenerator.vue +2 -2
  86. package/src/components/tabs-generator/QasTabsGenerator.yml +2 -2
  87. package/src/components/text-truncate/QasTextTruncate.vue +1 -1
  88. package/src/components/uploader/QasUploader.vue +62 -15
  89. package/src/components/uploader/QasUploader.yml +5 -0
  90. package/src/helpers/camelize-fields-name.js +15 -0
  91. package/src/helpers/filters.js +2 -0
  92. package/src/helpers/get-normalized-options.js +20 -0
  93. package/src/helpers/handle-process.js +13 -0
  94. package/src/helpers/index.js +3 -0
  95. package/src/mixins/generator.js +10 -2
  96. package/src/mixins/index.js +2 -0
  97. package/src/mixins/search-filter.js +227 -0
  98. package/src/mixins/view.js +32 -12
  99. package/src/plugins/index.js +4 -2
  100. package/src/plugins/logger/Logger.js +44 -0
  101. package/src/plugins/logger/Logger.yml +9 -0
  102. package/src/vue-plugin.js +6 -3
@@ -1,18 +1,19 @@
1
1
  /*!
2
- * @bildvitta/quasar-ui-asteroid v3.0.0-beta.9
2
+ * @bildvitta/quasar-ui-asteroid v3.0.0
3
3
  * (c) 2022 Bild & Vitta <systemteam@bild.com.br>
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, resolveComponent, createBlock, mergeProps, createSlots, withCtx, renderList, normalizeProps, guardReactiveProps, createVNode, Fragment, toDisplayString, createCommentVNode, resolveDynamicComponent, createTextVNode, resolveDirective, withDirectives, reactive, computed, markRaw, vShow, normalizeStyle, withModifiers, TransitionGroup } from 'vue';
7
- import { camelize, camelizeKeys } from 'humps';
7
+ import { camelize, camelizeKeys, decamelize } 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, QInfiniteScroll, 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';
14
14
  import SignaturePad from 'signature_pad';
15
15
  import { onBeforeRouteLeave } from 'vue-router';
16
+ import { isEqual as isEqual$1 } from 'lodash';
16
17
  import Fuse from 'fuse.js';
17
18
  import Sortable from 'sortablejs';
18
19
  import VueGoogleMaps from '@fawmi/vue-google-maps';
@@ -45,14 +46,14 @@ var script$L = {
45
46
  }
46
47
  };
47
48
 
48
- const _hoisted_1$s = { class: "col-12 col-sm-auto" };
49
+ const _hoisted_1$t = { class: "col-12 col-sm-auto" };
49
50
  const _hoisted_2$l = { class: "col-12 col-sm-auto" };
50
51
 
51
52
  function render$L(_ctx, _cache, $props, $setup, $data, $options) {
52
53
  return (openBlock(), createElementBlock("div", {
53
54
  class: normalizeClass($options.classes)
54
55
  }, [
55
- createElementVNode("div", _hoisted_1$s, [
56
+ createElementVNode("div", _hoisted_1$t, [
56
57
  renderSlot(_ctx.$slots, "secondary")
57
58
  ]),
58
59
  createElementVNode("div", _hoisted_2$l, [
@@ -68,13 +69,14 @@ var script$K = {
68
69
  name: 'QasBtn',
69
70
 
70
71
  props: {
71
- hideLabelOnSmallScreen: {
72
+ useLabelOnSmallScreen: {
73
+ default: true,
72
74
  type: Boolean
73
75
  },
74
76
 
75
77
  label: {
76
- type: String,
77
- default: ''
78
+ default: '',
79
+ type: String
78
80
  }
79
81
  },
80
82
 
@@ -86,12 +88,8 @@ var script$K = {
86
88
  }
87
89
  },
88
90
 
89
- hasLabel () {
90
- return !!this.label
91
- },
92
-
93
91
  showLabel () {
94
- return this.hasLabel && !(this.hideLabelOnSmallScreen && this.$qas.screen.isSmall)
92
+ return this.useLabelOnSmallScreen || !this.$qas.screen.isSmall
95
93
  },
96
94
 
97
95
  slots () {
@@ -167,8 +165,6 @@ var script$J = {
167
165
  }
168
166
  },
169
167
 
170
- emits: ['delete-success'],
171
-
172
168
  computed: {
173
169
  hasDelete () {
174
170
  return !!Object.keys(this.deleteProps).length
@@ -181,15 +177,11 @@ var script$J = {
181
177
  const { handler, ...filtered } = item;
182
178
  item.handler(filtered);
183
179
  }
184
- },
185
-
186
- onDeleteSuccess () {
187
- this.$emit('delete-success');
188
180
  }
189
181
  }
190
182
  };
191
183
 
192
- const _hoisted_1$r = { class: "flex items-center justify-center q-gutter-x-md" };
184
+ const _hoisted_1$s = { class: "flex items-center justify-center q-gutter-x-md" };
193
185
  const _hoisted_2$k = { class: "flex items-center justify-center q-gutter-x-sm" };
194
186
 
195
187
  function render$J(_ctx, _cache, $props, $setup, $data, $options) {
@@ -204,11 +196,11 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
204
196
  return (openBlock(), createBlock(_component_qas_btn, {
205
197
  class: "qas-actions-menu",
206
198
  color: "primary",
207
- "hide-label-on-small-screen": "",
208
199
  icon: $props.icon,
209
200
  label: $props.label,
210
201
  outline: "",
211
- padding: "md"
202
+ padding: "md",
203
+ "use-label-on-small-screen": ""
212
204
  }, {
213
205
  default: withCtx(() => [
214
206
  createVNode(_component_q_menu, { class: "qas-actions-menu__menu" }, {
@@ -230,7 +222,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
230
222
  default: withCtx(() => [
231
223
  createVNode(_component_q_item_section, null, {
232
224
  default: withCtx(() => [
233
- createElementVNode("div", _hoisted_1$r, [
225
+ createElementVNode("div", _hoisted_1$s, [
234
226
  createVNode(_component_q_icon, {
235
227
  name: item.icon,
236
228
  size: "sm"
@@ -249,8 +241,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
249
241
  ? (openBlock(), createBlock(_component_qas_delete, mergeProps({ key: 0 }, $props.deleteProps, {
250
242
  class: "text-negative",
251
243
  clickable: "",
252
- tag: "q-item",
253
- onSuccess: $options.onDeleteSuccess
244
+ tag: "q-item"
254
245
  }), {
255
246
  default: withCtx(() => [
256
247
  createVNode(_component_q_item_section, null, {
@@ -267,7 +258,7 @@ function render$J(_ctx, _cache, $props, $setup, $data, $options) {
267
258
  })
268
259
  ]),
269
260
  _: 1 /* STABLE */
270
- }, 16 /* FULL_PROPS */, ["onSuccess"]))
261
+ }, 16 /* FULL_PROPS */))
271
262
  : createCommentVNode("v-if", true)
272
263
  ]),
273
264
  _: 3 /* FORWARDED */
@@ -471,6 +462,41 @@ function getGreatestCommonDivisor (first, second) {
471
462
  return first
472
463
  }
473
464
 
465
+ function camelizeFieldsName (fields) {
466
+ for (const field in fields) {
467
+ const currentField = fields[field];
468
+
469
+ currentField.name = camelize(currentField.name);
470
+
471
+ if (Object.keys(currentField.children || {}).length) {
472
+ camelizeFieldsName(currentField.children);
473
+ }
474
+ }
475
+
476
+ return fields
477
+ }
478
+
479
+ /**
480
+ * param {options: object[], label: string, value: string} object
481
+ *
482
+ * @example getNormalizedOptions({
483
+ * options: [{ name: 'Test 1', uuid: '1' }, { name: 'Test 2', uuid: '2' }],
484
+ * label: 'name'
485
+ * value: 'uuid'
486
+ * }) // retorna [{ label: 'Test 1', value: '1' }, { label: 'Test 2', value: '2' }]
487
+ */
488
+ var getNormalizedOptions = ({ options = [], label, value }) => {
489
+ return options.map(option => {
490
+ const { [label]: labelKey, [value]: valueKey, ...payload } = option;
491
+
492
+ return {
493
+ label: option[label],
494
+ value: option[value],
495
+ ...payload
496
+ }
497
+ })
498
+ };
499
+
474
500
  // Private
475
501
  function __format (value, token, options = {}) {
476
502
  if (!value) {
@@ -568,6 +594,8 @@ function humanize (field = {}, value) {
568
594
  case 'time': return time(value)
569
595
  case 'radio': return selectLabel(field.options, value)
570
596
  case 'percent': return formatPercent(value)
597
+ case 'money': return money(value)
598
+ case 'decimal': return decimal(value)
571
599
  default: return value
572
600
  }
573
601
  }
@@ -721,7 +749,7 @@ var script$H = {
721
749
  }
722
750
  };
723
751
 
724
- const _hoisted_1$q = { class: "q-gutter-md q-mr-lg" };
752
+ const _hoisted_1$r = { class: "q-gutter-md q-mr-lg" };
725
753
  const _hoisted_2$j = {
726
754
  key: 0,
727
755
  class: "text-bold text-h5"
@@ -745,7 +773,7 @@ function render$H(_ctx, _cache, $props, $setup, $data, $options) {
745
773
  rounded: "",
746
774
  onClick: $options.close
747
775
  }, null, 8 /* PROPS */, ["color", "onClick"]),
748
- createElementVNode("div", _hoisted_1$q, [
776
+ createElementVNode("div", _hoisted_1$r, [
749
777
  renderSlot(_ctx.$slots, "header", {}, () => [
750
778
  ($props.title)
751
779
  ? (openBlock(), createElementBlock("h5", _hoisted_2$j, toDisplayString($props.title), 1 /* TEXT */))
@@ -812,20 +840,16 @@ var script$G = {
812
840
  }
813
841
 
814
842
  const contrastColor = this.color ? this.color : this.contrastColor;
815
- // const contrastColor = this.textColor ? this.textColor : this.contrastColor
816
843
 
817
844
  return [
818
845
  this.dark
819
846
  ? `bg-${this.textColor} text-${contrastColor}`
820
847
  : `bg-${contrastColor} text-${this.textColor}`
821
- // ? `bg-${this.color} text-${contrastColor}`
822
- // : `bg-${contrastColor} text-${this.color}`
823
848
  ]
824
849
  },
825
850
 
826
851
  contrastColor () {
827
852
  return `${this.textColor}-contrast`
828
- // return `${this.color}-contrast`
829
853
  },
830
854
 
831
855
  firstLetter () {
@@ -904,10 +928,6 @@ var script$F = {
904
928
  type: String
905
929
  },
906
930
 
907
- isAuth: {
908
- type: Boolean
909
- },
910
-
911
931
  title: {
912
932
  type: String,
913
933
  default: ''
@@ -962,6 +982,14 @@ var script$F = {
962
982
 
963
983
  showTitle () {
964
984
  return this.title && !this.brand
985
+ },
986
+
987
+ hasUser () {
988
+ return !!Object.keys(this.user).length
989
+ },
990
+
991
+ userName () {
992
+ return this.user.name || this.user.givenName
965
993
  }
966
994
  },
967
995
 
@@ -984,7 +1012,7 @@ var script$F = {
984
1012
  }
985
1013
  };
986
1014
 
987
- const _hoisted_1$p = ["alt", "src"];
1015
+ const _hoisted_1$q = ["alt", "src"];
988
1016
  const _hoisted_2$i = {
989
1017
  key: 1,
990
1018
  class: "text-bold text-grey-9 text-subtitle1 text-uppercase"
@@ -1007,11 +1035,10 @@ const _hoisted_14$1 = { class: "q-mt-sm" };
1007
1035
 
1008
1036
  function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1009
1037
  const _component_q_ajax_bar = resolveComponent("q-ajax-bar");
1010
- const _component_q_btn = resolveComponent("q-btn");
1038
+ const _component_qas_btn = resolveComponent("qas-btn");
1011
1039
  const _component_q_badge = resolveComponent("q-badge");
1012
1040
  const _component_q_toolbar_title = resolveComponent("q-toolbar-title");
1013
1041
  const _component_qas_avatar = resolveComponent("qas-avatar");
1014
- const _component_qas_btn = resolveComponent("qas-btn");
1015
1042
  const _component_q_menu = resolveComponent("q-menu");
1016
1043
  const _component_q_toolbar = resolveComponent("q-toolbar");
1017
1044
  const _component_q_header = resolveComponent("q-header");
@@ -1032,7 +1059,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1032
1059
  position: "top",
1033
1060
  size: "2px"
1034
1061
  }),
1035
- createVNode(_component_q_btn, {
1062
+ createVNode(_component_qas_btn, {
1036
1063
  color: "grey-7",
1037
1064
  dense: "",
1038
1065
  flat: "",
@@ -1052,7 +1079,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1052
1079
  alt: $props.title,
1053
1080
  class: "q-mr-sm qas-app-bar__brand",
1054
1081
  src: $props.brand
1055
- }, null, 8 /* PROPS */, _hoisted_1$p))
1082
+ }, null, 8 /* PROPS */, _hoisted_1$q))
1056
1083
  : createCommentVNode("v-if", true),
1057
1084
  ($options.showTitle)
1058
1085
  ? (openBlock(), createElementBlock("span", _hoisted_2$i, toDisplayString($props.title), 1 /* TEXT */))
@@ -1072,7 +1099,7 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1072
1099
  }),
1073
1100
  ($options.hasNotifications)
1074
1101
  ? (openBlock(), createElementBlock("div", _hoisted_3$e, [
1075
- createVNode(_component_q_btn, {
1102
+ createVNode(_component_qas_btn, {
1076
1103
  class: "q-mr-md",
1077
1104
  dense: "",
1078
1105
  icon: "o_notifications",
@@ -1099,11 +1126,11 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1099
1126
  : createCommentVNode("v-if", true),
1100
1127
  createElementVNode("div", _hoisted_4$a, [
1101
1128
  renderSlot(_ctx.$slots, "tools"),
1102
- ($props.isAuth)
1129
+ ($options.hasUser)
1103
1130
  ? (openBlock(), createElementBlock("div", {
1104
1131
  key: 0,
1105
1132
  class: "cursor-pointer items-center q-mr-sm qas-app-bar__user rounded-borders row text-grey-9",
1106
- title: $props.user.name || $props.user.givenName
1133
+ title: $options.userName
1107
1134
  }, [
1108
1135
  createVNode(_component_qas_avatar, {
1109
1136
  class: "rounded-borders-left",
@@ -1113,10 +1140,10 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1113
1140
  rounded: "",
1114
1141
  size: "42px",
1115
1142
  "text-color": "primary",
1116
- title: $props.user.name || $props.user.givenName
1143
+ title: $options.userName
1117
1144
  }, null, 8 /* PROPS */, ["image", "title"]),
1118
1145
  createElementVNode("div", _hoisted_6$4, [
1119
- createElementVNode("div", _hoisted_7$4, toDisplayString($props.user.name || $props.user.givenName), 1 /* TEXT */),
1146
+ createElementVNode("div", _hoisted_7$4, toDisplayString($options.userName), 1 /* TEXT */),
1120
1147
  createElementVNode("div", _hoisted_8$3, toDisplayString($props.user.email), 1 /* TEXT */)
1121
1148
  ]),
1122
1149
  createVNode(_component_q_menu, {
@@ -1136,10 +1163,10 @@ function render$F(_ctx, _cache, $props, $setup, $data, $options) {
1136
1163
  createVNode(_component_qas_avatar, {
1137
1164
  image: $props.user.photo,
1138
1165
  size: "145px",
1139
- title: $props.user.name || $props.user.givenName
1166
+ title: $options.userName
1140
1167
  }, null, 8 /* PROPS */, ["image", "title"])
1141
1168
  ]),
1142
- createElementVNode("div", _hoisted_11$1, toDisplayString($props.user.name || $props.user.givenName), 1 /* TEXT */),
1169
+ createElementVNode("div", _hoisted_11$1, toDisplayString($options.userName), 1 /* TEXT */),
1143
1170
  createElementVNode("div", _hoisted_12$1, toDisplayString($props.user.email), 1 /* TEXT */),
1144
1171
  createElementVNode("div", _hoisted_13$1, [
1145
1172
  createVNode(_component_qas_btn, {
@@ -1318,7 +1345,7 @@ var script$E = {
1318
1345
  }
1319
1346
  };
1320
1347
 
1321
- const _hoisted_1$o = { class: "column flex full-height justify-between no-wrap overflow-x-hidden" };
1348
+ const _hoisted_1$p = { class: "column flex full-height justify-between no-wrap overflow-x-hidden" };
1322
1349
  const _hoisted_2$h = {
1323
1350
  key: 0,
1324
1351
  class: "q-ma-md"
@@ -1351,7 +1378,7 @@ function render$E(_ctx, _cache, $props, $setup, $data, $options) {
1351
1378
  onMiniState: $options.setMiniState
1352
1379
  }, {
1353
1380
  default: withCtx(() => [
1354
- createElementVNode("div", _hoisted_1$o, [
1381
+ createElementVNode("div", _hoisted_1$p, [
1355
1382
  createElementVNode("div", null, [
1356
1383
  ($options.displayModuleSection)
1357
1384
  ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
@@ -1528,15 +1555,11 @@ var script$C = {
1528
1555
  name: 'QasCard',
1529
1556
 
1530
1557
  props: {
1531
- bgImagePosition: {
1558
+ imagePosition: {
1532
1559
  type: String,
1533
1560
  default: 'center'
1534
1561
  },
1535
1562
 
1536
- formMode: {
1537
- type: Boolean
1538
- },
1539
-
1540
1563
  gutter: {
1541
1564
  type: String,
1542
1565
  default: 'sm'
@@ -1547,6 +1570,14 @@ var script$C = {
1547
1570
  type: Array
1548
1571
  },
1549
1572
 
1573
+ outlined: {
1574
+ type: Boolean
1575
+ },
1576
+
1577
+ unelevated: {
1578
+ type: Boolean
1579
+ },
1580
+
1550
1581
  useHeader: {
1551
1582
  type: Boolean
1552
1583
  }
@@ -1559,12 +1590,17 @@ var script$C = {
1559
1590
  },
1560
1591
 
1561
1592
  computed: {
1562
- bgImagePositionClass () {
1563
- return `bg-position-${this.bgImagePosition}`
1593
+ imagePositionClass () {
1594
+ return `bg-position-${this.imagePosition}`
1564
1595
  },
1565
1596
 
1566
1597
  cardClasses () {
1567
- return this.formMode ? 'bg-white border-primary no-shadow' : 'shadow-14'
1598
+ return {
1599
+ 'shadow-14': !this.unelevated,
1600
+ 'border-primary': this.outlined,
1601
+ 'no-shadow': this.outlined,
1602
+ 'bg-white': this.outlined
1603
+ }
1568
1604
  },
1569
1605
 
1570
1606
  gutterClass () {
@@ -1595,7 +1631,7 @@ var script$C = {
1595
1631
  }
1596
1632
  };
1597
1633
 
1598
- const _hoisted_1$n = { class: "col-12 col-lg-3 col-md-4 col-sm-6" };
1634
+ const _hoisted_1$o = { class: "col-12 col-lg-3 col-md-4 col-sm-6" };
1599
1635
  const _hoisted_2$g = {
1600
1636
  key: 0,
1601
1637
  class: "overflow-hidden relative-position w-full"
@@ -1613,7 +1649,7 @@ function render$C(_ctx, _cache, $props, $setup, $data, $options) {
1613
1649
  const _component_q_card_section = resolveComponent("q-card-section");
1614
1650
  const _component_q_card = resolveComponent("q-card");
1615
1651
 
1616
- return (openBlock(), createElementBlock("div", _hoisted_1$n, [
1652
+ return (openBlock(), createElementBlock("div", _hoisted_1$o, [
1617
1653
  createVNode(_component_q_card, {
1618
1654
  class: normalizeClass(["border-radius-lg column full-height overflow-hidden", $options.cardClasses])
1619
1655
  }, {
@@ -1647,7 +1683,7 @@ function render$C(_ctx, _cache, $props, $setup, $data, $options) {
1647
1683
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.imagesList, (item, index) => {
1648
1684
  return (openBlock(), createBlock(_component_q_carousel_slide, {
1649
1685
  key: index,
1650
- class: normalizeClass(["bg-no-repeat", $options.bgImagePositionClass]),
1686
+ class: normalizeClass(["bg-no-repeat", $options.imagePositionClass]),
1651
1687
  "img-src": item,
1652
1688
  name: index
1653
1689
  }, null, 8 /* PROPS */, ["class", "img-src", "name"]))
@@ -1876,7 +1912,7 @@ var script$A = {
1876
1912
  }
1877
1913
  };
1878
1914
 
1879
- const _hoisted_1$m = /*#__PURE__*/createTextVNode("Copiar");
1915
+ const _hoisted_1$n = /*#__PURE__*/createTextVNode("Copiar");
1880
1916
 
1881
1917
  function render$A(_ctx, _cache, $props, $setup, $data, $options) {
1882
1918
  const _component_q_tooltip = resolveComponent("q-tooltip");
@@ -1899,7 +1935,7 @@ function render$A(_ctx, _cache, $props, $setup, $data, $options) {
1899
1935
  default: withCtx(() => [
1900
1936
  createVNode(_component_q_tooltip, null, {
1901
1937
  default: withCtx(() => [
1902
- _hoisted_1$m
1938
+ _hoisted_1$n
1903
1939
  ]),
1904
1940
  _: 1 /* STABLE */
1905
1941
  })
@@ -1923,33 +1959,33 @@ var script$z = {
1923
1959
  type: String
1924
1960
  },
1925
1961
 
1926
- dateOnly: {
1927
- type: Boolean
1928
- },
1929
-
1930
1962
  dateProps: {
1931
1963
  default: () => ({}),
1932
1964
  type: Object
1933
1965
  },
1934
1966
 
1935
- gmt: {
1936
- type: Boolean
1937
- },
1938
-
1939
1967
  timeMask: {
1940
1968
  default: 'HH:mm',
1941
1969
  type: String
1942
1970
  },
1943
1971
 
1944
- timeOnly: {
1945
- type: Boolean
1946
- },
1947
-
1948
1972
  timeProps: {
1949
1973
  default: () => ({}),
1950
1974
  type: Object
1951
1975
  },
1952
1976
 
1977
+ useIso: {
1978
+ type: Boolean
1979
+ },
1980
+
1981
+ useTimeOnly: {
1982
+ type: Boolean
1983
+ },
1984
+
1985
+ useDateOnly: {
1986
+ type: Boolean
1987
+ },
1988
+
1953
1989
  modelValue: {
1954
1990
  default: '',
1955
1991
  type: String
@@ -1986,16 +2022,16 @@ var script$z = {
1986
2022
  maskDate () {
1987
2023
  const mask = [];
1988
2024
 
1989
- if (!this.timeOnly) { mask.push(this.dateMask); }
1990
- if (!this.dateOnly) { mask.push(this.timeMask); }
2025
+ if (!this.useTimeOnly) { mask.push(this.dateMask); }
2026
+ if (!this.useDateOnly) { mask.push(this.timeMask); }
1991
2027
 
1992
2028
  return mask.join(' ')
1993
2029
  }
1994
2030
  },
1995
2031
 
1996
2032
  watch: {
1997
- value (current, original) {
1998
- if (!current || this.timeOnly) {
2033
+ modelValue (current, original) {
2034
+ if (!current || this.useTimeOnly) {
1999
2035
  this.currentValue = current;
2000
2036
  return
2001
2037
  }
@@ -2021,18 +2057,18 @@ var script$z = {
2021
2057
 
2022
2058
  updateModelValue (value) {
2023
2059
  this.currentValue = value;
2024
- const valueLength = value.replace(/_/g, '').length;
2060
+ const valueLength = value?.replace?.(/_/g, '')?.length;
2025
2061
 
2026
2062
  if (value === '' || valueLength === this.mask.length) {
2027
- this.lastValue = this.timeOnly ? value : this.toISOString(value);
2063
+ this.lastValue = this.useTimeOnly ? value : this.toISOString(value);
2028
2064
  this.$emit('update:modelValue', this.lastValue);
2029
2065
  }
2030
2066
 
2031
- if (this.dateOnly) {
2067
+ if (this.useDateOnly) {
2032
2068
  this.$refs.dateProxy.hide();
2033
2069
  }
2034
2070
 
2035
- if (this.timeOnly) {
2071
+ if (this.useTimeOnly) {
2036
2072
  this.$refs.timeProxy.hide();
2037
2073
  }
2038
2074
  },
@@ -2042,11 +2078,11 @@ var script$z = {
2042
2078
  return ''
2043
2079
  }
2044
2080
 
2045
- if (this.dateOnly && !this.gmt) {
2081
+ if (this.useDateOnly && !this.useIso) {
2046
2082
  return date(date$1.extractDate(value, this.maskDate), 'yyyy-MM-dd')
2047
2083
  }
2048
2084
 
2049
- if (this.timeOnly && !this.gmt) {
2085
+ if (this.useTimeOnly && !this.useIso) {
2050
2086
  return date$1.extractDate(value, 'HH:MM')
2051
2087
  }
2052
2088
 
@@ -2054,14 +2090,14 @@ var script$z = {
2054
2090
  },
2055
2091
 
2056
2092
  toMask (value) {
2057
- if (!value || this.timeOnly) {
2093
+ if (!value || this.useTimeOnly) {
2058
2094
  return value || ''
2059
2095
  }
2060
2096
 
2061
2097
  const newDate = new Date(value).toISOString();
2062
2098
 
2063
2099
  return date$1.formatDate(
2064
- this.dateOnly ? newDate.slice(0, 23) : newDate,
2100
+ this.useDateOnly ? newDate.slice(0, 23) : newDate,
2065
2101
  this.maskDate
2066
2102
  )
2067
2103
  }
@@ -2075,75 +2111,73 @@ function render$z(_ctx, _cache, $props, $setup, $data, $options) {
2075
2111
  const _component_q_time = resolveComponent("q-time");
2076
2112
  const _component_qas_input = resolveComponent("qas-input");
2077
2113
 
2078
- return (openBlock(), createElementBlock("div", null, [
2079
- createVNode(_component_qas_input, mergeProps({ ref: "input" }, $options.attributes, {
2080
- modelValue: $data.currentValue,
2081
- "onUpdate:modelValue": [
2082
- _cache[2] || (_cache[2] = $event => (($data.currentValue) = $event)),
2083
- $options.updateModelValue
2084
- ],
2085
- "unmasked-value": false
2086
- }), {
2087
- append: withCtx(() => [
2088
- (!$props.timeOnly)
2089
- ? (openBlock(), createBlock(_component_q_icon, {
2090
- key: 0,
2091
- class: "cursor-pointer",
2092
- name: "o_event"
2093
- }, {
2094
- default: withCtx(() => [
2095
- createVNode(_component_q_popup_proxy, {
2096
- ref: "dateProxy",
2097
- "transition-hide": "scale",
2098
- "transition-show": "scale"
2099
- }, {
2100
- default: withCtx(() => [
2101
- createVNode(_component_q_date, mergeProps({
2102
- modelValue: $data.currentValue,
2103
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.currentValue) = $event))
2104
- }, $props.dateProps, {
2105
- mask: $options.maskDate,
2106
- "onUpdate:modelValue": $options.updateModelValue
2107
- }), null, 16 /* FULL_PROPS */, ["modelValue", "mask", "onUpdate:modelValue"])
2108
- ]),
2109
- _: 1 /* STABLE */
2110
- }, 512 /* NEED_PATCH */)
2111
- ]),
2112
- _: 1 /* STABLE */
2113
- }))
2114
- : createCommentVNode("v-if", true),
2115
- (!$props.dateOnly)
2116
- ? (openBlock(), createBlock(_component_q_icon, {
2117
- key: 1,
2118
- class: "cursor-pointer q-ml-md",
2119
- name: "o_access_time"
2120
- }, {
2121
- default: withCtx(() => [
2122
- createVNode(_component_q_popup_proxy, {
2123
- ref: "timeProxy",
2124
- "transition-hide": "scale",
2125
- "transition-show": "scale"
2126
- }, {
2127
- default: withCtx(() => [
2128
- createVNode(_component_q_time, mergeProps({
2129
- modelValue: $data.currentValue,
2130
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.currentValue) = $event))
2131
- }, $props.timeProps, {
2132
- format24h: "",
2133
- mask: $options.maskDate,
2134
- "onUpdate:modelValue": $options.updateModelValue
2135
- }), null, 16 /* FULL_PROPS */, ["modelValue", "mask", "onUpdate:modelValue"])
2136
- ]),
2137
- _: 1 /* STABLE */
2138
- }, 512 /* NEED_PATCH */)
2139
- ]),
2140
- _: 1 /* STABLE */
2141
- }))
2142
- : createCommentVNode("v-if", true)
2143
- ]),
2144
- _: 1 /* STABLE */
2145
- }, 16 /* FULL_PROPS */, ["modelValue", "onUpdate:modelValue"])
2146
- ]))
2114
+ return (openBlock(), createBlock(_component_qas_input, mergeProps({ ref: "input" }, $options.attributes, {
2115
+ modelValue: $data.currentValue,
2116
+ "onUpdate:modelValue": [
2117
+ _cache[2] || (_cache[2] = $event => (($data.currentValue) = $event)),
2118
+ $options.updateModelValue
2119
+ ],
2120
+ "unmasked-value": false
2121
+ }), {
2122
+ append: withCtx(() => [
2123
+ (!$props.useTimeOnly)
2124
+ ? (openBlock(), createBlock(_component_q_icon, {
2125
+ key: 0,
2126
+ class: "cursor-pointer",
2127
+ name: "o_event"
2128
+ }, {
2129
+ default: withCtx(() => [
2130
+ createVNode(_component_q_popup_proxy, {
2131
+ ref: "dateProxy",
2132
+ "transition-hide": "scale",
2133
+ "transition-show": "scale"
2134
+ }, {
2135
+ default: withCtx(() => [
2136
+ createVNode(_component_q_date, mergeProps({
2137
+ modelValue: $data.currentValue,
2138
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.currentValue) = $event))
2139
+ }, $props.dateProps, {
2140
+ mask: $options.maskDate,
2141
+ "onUpdate:modelValue": $options.updateModelValue
2142
+ }), null, 16 /* FULL_PROPS */, ["modelValue", "mask", "onUpdate:modelValue"])
2143
+ ]),
2144
+ _: 1 /* STABLE */
2145
+ }, 512 /* NEED_PATCH */)
2146
+ ]),
2147
+ _: 1 /* STABLE */
2148
+ }))
2149
+ : createCommentVNode("v-if", true),
2150
+ (!$props.useDateOnly)
2151
+ ? (openBlock(), createBlock(_component_q_icon, {
2152
+ key: 1,
2153
+ class: "cursor-pointer q-ml-md",
2154
+ name: "o_access_time"
2155
+ }, {
2156
+ default: withCtx(() => [
2157
+ createVNode(_component_q_popup_proxy, {
2158
+ ref: "timeProxy",
2159
+ "transition-hide": "scale",
2160
+ "transition-show": "scale"
2161
+ }, {
2162
+ default: withCtx(() => [
2163
+ createVNode(_component_q_time, mergeProps({
2164
+ modelValue: $data.currentValue,
2165
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.currentValue) = $event))
2166
+ }, $props.timeProps, {
2167
+ format24h: "",
2168
+ mask: $options.maskDate,
2169
+ "onUpdate:modelValue": $options.updateModelValue
2170
+ }), null, 16 /* FULL_PROPS */, ["modelValue", "mask", "onUpdate:modelValue"])
2171
+ ]),
2172
+ _: 1 /* STABLE */
2173
+ }, 512 /* NEED_PATCH */)
2174
+ ]),
2175
+ _: 1 /* STABLE */
2176
+ }))
2177
+ : createCommentVNode("v-if", true)
2178
+ ]),
2179
+ _: 1 /* STABLE */
2180
+ }, 16 /* FULL_PROPS */, ["modelValue", "onUpdate:modelValue"]))
2147
2181
  }
2148
2182
 
2149
2183
  script$z.render = render$z;
@@ -2161,12 +2195,12 @@ var script$y = {
2161
2195
  }
2162
2196
  };
2163
2197
 
2164
- const _hoisted_1$l = { class: "bg-grey-3 q-my-md q-pa-md rounded-borders" };
2198
+ const _hoisted_1$m = { class: "bg-grey-3 q-my-md q-pa-md rounded-borders" };
2165
2199
  const _hoisted_2$f = /*#__PURE__*/createElementVNode("summary", null, "Debugger", -1 /* HOISTED */);
2166
2200
  const _hoisted_3$b = { class: "row" };
2167
2201
 
2168
2202
  function render$y(_ctx, _cache, $props, $setup, $data, $options) {
2169
- return (openBlock(), createElementBlock("details", _hoisted_1$l, [
2203
+ return (openBlock(), createElementBlock("details", _hoisted_1$m, [
2170
2204
  _hoisted_2$f,
2171
2205
  createElementVNode("div", _hoisted_3$b, [
2172
2206
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.inspect, (item, index) => {
@@ -2244,7 +2278,11 @@ var script$x = {
2244
2278
  type: Boolean
2245
2279
  },
2246
2280
 
2247
- useCloseIcon: {
2281
+ useCloseButton: {
2282
+ type: Boolean
2283
+ },
2284
+
2285
+ useValidationAllAtOnce: {
2248
2286
  type: Boolean
2249
2287
  }
2250
2288
  },
@@ -2292,7 +2330,26 @@ var script$x = {
2292
2330
 
2293
2331
  methods: {
2294
2332
  async submitHandler () {
2295
- this.useForm && this.$emit('validate', await this.$refs.form.validate());
2333
+ if (!this.useForm) return
2334
+
2335
+ if (this.useValidationAllAtOnce) {
2336
+ let isAllComponentValid = true;
2337
+ const components = this.$refs.form.getValidationComponents() || [];
2338
+
2339
+ for (const component of components) {
2340
+ const isValid = component?.validate?.();
2341
+
2342
+ if (!isValid) {
2343
+ isAllComponentValid = false;
2344
+ }
2345
+ }
2346
+
2347
+ this.$emit('validate', isAllComponentValid);
2348
+
2349
+ return
2350
+ }
2351
+
2352
+ this.$emit('validate', await this.$refs.form.validate());
2296
2353
  },
2297
2354
 
2298
2355
  // método para funcionar como plugin
@@ -2311,7 +2368,7 @@ var script$x = {
2311
2368
  }
2312
2369
  };
2313
2370
 
2314
- const _hoisted_1$k = { class: "justify-between row" };
2371
+ const _hoisted_1$l = { class: "justify-between row" };
2315
2372
  const _hoisted_2$e = { class: "text-bold text-h6" };
2316
2373
  const _hoisted_3$a = { key: 0 };
2317
2374
 
@@ -2336,9 +2393,9 @@ function render$x(_ctx, _cache, $props, $setup, $data, $options) {
2336
2393
  createVNode(_component_q_card_section, null, {
2337
2394
  default: withCtx(() => [
2338
2395
  renderSlot(_ctx.$slots, "header", {}, () => [
2339
- createElementVNode("div", _hoisted_1$k, [
2396
+ createElementVNode("div", _hoisted_1$l, [
2340
2397
  createElementVNode("div", _hoisted_2$e, toDisplayString($props.card.title), 1 /* TEXT */),
2341
- ($props.useCloseIcon)
2398
+ ($props.useCloseButton)
2342
2399
  ? withDirectives((openBlock(), createBlock(_component_qas_btn, {
2343
2400
  key: 0,
2344
2401
  dense: "",
@@ -2422,6 +2479,51 @@ var Dialog = (componentProps = {}) => {
2422
2479
  });
2423
2480
  };
2424
2481
 
2482
+ var Logger = () => {
2483
+ const isDebugEnabled = process.env.DEBUGGING;
2484
+
2485
+ const normalizeMessage = msg => `%c ${msg}`;
2486
+ const getStyle = isError => (
2487
+ `
2488
+ background: ${isError ? '#C10015 ' : '#1976d2'};
2489
+ font-weight: bold;
2490
+ color: white;
2491
+ padding: 6px 20px;
2492
+ border-radius: 4px;
2493
+ display: block;
2494
+ width: 100%;
2495
+ font-size: 12px;
2496
+ `
2497
+ );
2498
+
2499
+ return {
2500
+ group (message, payload = [], { error } = {}) {
2501
+ if (!isDebugEnabled) return
2502
+
2503
+ console.groupCollapsed(normalizeMessage(message), getStyle(error));
2504
+
2505
+ for (const item of payload) {
2506
+ if (typeof item === 'string') {
2507
+ console.info(normalizeMessage(item), getStyle(error));
2508
+ continue
2509
+ }
2510
+
2511
+ console.table(item);
2512
+ }
2513
+
2514
+ console.groupEnd();
2515
+ },
2516
+
2517
+ info (message) {
2518
+ isDebugEnabled && console.info(normalizeMessage(message), getStyle());
2519
+ },
2520
+
2521
+ error (message) {
2522
+ isDebugEnabled && console.info(normalizeMessage(message), getStyle(true));
2523
+ }
2524
+ }
2525
+ };
2526
+
2425
2527
  Notify.registerType('error', {
2426
2528
  color: 'negative',
2427
2529
  progress: true
@@ -2608,7 +2710,13 @@ var script$w = {
2608
2710
  try {
2609
2711
  const { destroyRoutes, history } = useHistory();
2610
2712
 
2611
- await this.$store.dispatch(`${this.entity}/destroy`, { id: this.id, url: this.url });
2713
+ const payload = { id: this.id, url: this.url };
2714
+
2715
+ this.$qas.logger.group(
2716
+ `QasDelete - destroy -> Payload do parâmetro do ${this.entity}/destroy`, [payload]
2717
+ );
2718
+
2719
+ await this.$store.dispatch(`${this.entity}/destroy`, payload);
2612
2720
 
2613
2721
  NotifySuccess('Item deletado com sucesso!');
2614
2722
 
@@ -2622,9 +2730,17 @@ var script$w = {
2622
2730
  this.createDeleteSuccessEvent();
2623
2731
 
2624
2732
  this.$emit('success');
2733
+
2734
+ this.$qas.logger.info('QasDelete - destroy -> item deletado com sucesso!');
2625
2735
  } catch (error) {
2626
2736
  NotifyError('Ops! Não foi possível deletar o item.');
2627
2737
  this.$emit('error', error);
2738
+
2739
+ this.$qas.logger.group(
2740
+ `QasDelete - destroy -> exceção da action ${this.entity}/destroy`,
2741
+ [error],
2742
+ { error: true }
2743
+ );
2628
2744
  } finally {
2629
2745
  Loading.hide();
2630
2746
  this.$emit('update:deleting', false);
@@ -2766,8 +2882,8 @@ function render$v(_ctx, _cache, $props, $setup, $data, $options) {
2766
2882
  ($data.component)
2767
2883
  ? (openBlock(), createBlock(resolveDynamicComponent($data.component), {
2768
2884
  key: 0,
2769
- dialog: "",
2770
2885
  route: $data.route,
2886
+ "use-boundary": false,
2771
2887
  onHide: $options.hide
2772
2888
  }, null, 8 /* PROPS */, ["route", "onHide"]))
2773
2889
  : createCommentVNode("v-if", true)
@@ -2791,32 +2907,32 @@ var script$u = {
2791
2907
  inheritAttrs: false,
2792
2908
 
2793
2909
  props: {
2910
+ error: {
2911
+ type: Boolean
2912
+ },
2913
+
2914
+ errorMessage: {
2915
+ type: String,
2916
+ default: ''
2917
+ },
2918
+
2794
2919
  modelValue: {
2795
2920
  default: '',
2796
2921
  type: [String, Number]
2797
2922
  },
2798
2923
 
2799
- unmaskedValue: {
2800
- default: true,
2801
- type: Boolean
2802
- },
2803
-
2804
2924
  outlined: {
2805
2925
  default: true,
2806
2926
  type: Boolean
2807
2927
  },
2808
2928
 
2809
- removeErrorOnType: {
2929
+ unmaskedValue: {
2930
+ default: true,
2810
2931
  type: Boolean
2811
2932
  },
2812
2933
 
2813
- error: {
2934
+ useRemoveErrorOnType: {
2814
2935
  type: Boolean
2815
- },
2816
-
2817
- errorMessage: {
2818
- type: String,
2819
- default: ''
2820
2936
  }
2821
2937
  },
2822
2938
 
@@ -2861,7 +2977,7 @@ var script$u = {
2861
2977
  },
2862
2978
 
2863
2979
  set (value) {
2864
- if (this.removeErrorOnType && this.error) {
2980
+ if (this.useRemoveErrorOnType && this.error) {
2865
2981
  this.errorData = false;
2866
2982
  this.errorMessageData = '';
2867
2983
  }
@@ -2873,7 +2989,7 @@ var script$u = {
2873
2989
 
2874
2990
  watch: {
2875
2991
  mask () {
2876
- const input = this.inputReference.$el?.querySelector('input');
2992
+ const input = this.getInput();
2877
2993
 
2878
2994
  requestAnimationFrame(() => {
2879
2995
  input.selectionStart = input.value ? input.value.length : '';
@@ -2907,12 +3023,30 @@ var script$u = {
2907
3023
  },
2908
3024
 
2909
3025
  toggleMask (first, second) {
3026
+ if (!this.modelValue?.length) return
3027
+
2910
3028
  const length = first.split('#').length - 2;
2911
3029
  return this.modelValue?.length > length ? second : first
2912
3030
  },
2913
3031
 
2914
3032
  validate (value) {
2915
3033
  return this.inputReference.validate(value)
3034
+ },
3035
+
3036
+ onPaste (event) {
3037
+ if (!this.mask) return
3038
+
3039
+ const value = event.clipboardData.getData('text');
3040
+ const input = this.getInput();
3041
+
3042
+ requestAnimationFrame(() => {
3043
+ this.$emit('update:modelValue', value);
3044
+ input.selectionStart = input.value ? input.value.length : '';
3045
+ });
3046
+ },
3047
+
3048
+ getInput () {
3049
+ return this.inputReference.$el?.querySelector('input')
2916
3050
  }
2917
3051
  }
2918
3052
  };
@@ -2920,29 +3054,28 @@ var script$u = {
2920
3054
  function render$u(_ctx, _cache, $props, $setup, $data, $options) {
2921
3055
  const _component_q_input = resolveComponent("q-input");
2922
3056
 
2923
- return (openBlock(), createElementBlock("div", null, [
2924
- createVNode(_component_q_input, mergeProps({
2925
- ref: "input",
2926
- modelValue: $options.model,
2927
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
2928
- "bottom-slots": "",
2929
- error: $data.errorData
2930
- }, _ctx.$attrs, {
2931
- "error-message": _ctx.errorMessageData,
2932
- mask: $options.mask,
2933
- outlined: $props.outlined,
2934
- "unmasked-value": $props.unmaskedValue
2935
- }), createSlots({ _: 2 /* DYNAMIC */ }, [
2936
- renderList(_ctx.$slots, (_, name) => {
2937
- return {
2938
- name: name,
2939
- fn: withCtx((context) => [
2940
- renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(context || {})))
2941
- ])
2942
- }
2943
- })
2944
- ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "error", "error-message", "mask", "outlined", "unmasked-value"])
2945
- ]))
3057
+ return (openBlock(), createBlock(_component_q_input, mergeProps({
3058
+ ref: "input",
3059
+ modelValue: $options.model,
3060
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
3061
+ "bottom-slots": "",
3062
+ error: $data.errorData
3063
+ }, _ctx.$attrs, {
3064
+ "error-message": _ctx.errorMessageData,
3065
+ mask: $options.mask,
3066
+ outlined: $props.outlined,
3067
+ "unmasked-value": $props.unmaskedValue,
3068
+ onPaste: $options.onPaste
3069
+ }), createSlots({ _: 2 /* DYNAMIC */ }, [
3070
+ renderList(_ctx.$slots, (_, name) => {
3071
+ return {
3072
+ name: name,
3073
+ fn: withCtx((context) => [
3074
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(context || {})))
3075
+ ])
3076
+ }
3077
+ })
3078
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "error", "error-message", "mask", "outlined", "unmasked-value", "onPaste"]))
2946
3079
  }
2947
3080
 
2948
3081
  script$u.render = render$u;
@@ -2959,17 +3092,7 @@ var script$t = {
2959
3092
  name: 'QasNumericInput',
2960
3093
 
2961
3094
  props: {
2962
- allowNegative: {
2963
- default: true,
2964
- type: Boolean
2965
- },
2966
-
2967
- allowPositive: {
2968
- default: true,
2969
- type: Boolean
2970
- },
2971
-
2972
- autonumericProps: {
3095
+ autonumericOptions: {
2973
3096
  default: () => ({}),
2974
3097
  type: Object
2975
3098
  },
@@ -3001,6 +3124,16 @@ var script$t = {
3001
3124
  preset: {
3002
3125
  default: false,
3003
3126
  type: [Boolean, String]
3127
+ },
3128
+
3129
+ useNegative: {
3130
+ default: true,
3131
+ type: Boolean
3132
+ },
3133
+
3134
+ usePositive: {
3135
+ default: true,
3136
+ type: Boolean
3004
3137
  }
3005
3138
  },
3006
3139
 
@@ -3044,11 +3177,11 @@ var script$t = {
3044
3177
  Object.assign(options, autoNumericPredefinedOptions[value]);
3045
3178
  }
3046
3179
 
3047
- if (!this.allowNegative) {
3180
+ if (!this.useNegative) {
3048
3181
  options.minimumValue = 0;
3049
3182
  }
3050
3183
 
3051
- if (!this.allowPositive) {
3184
+ if (!this.usePositive) {
3052
3185
  options.maximumValue = 0;
3053
3186
  }
3054
3187
 
@@ -3056,7 +3189,7 @@ var script$t = {
3056
3189
  options.decimalPlaces = this.decimalPlaces;
3057
3190
  }
3058
3191
 
3059
- Object.assign(options, this.autonumericProps);
3192
+ Object.assign(options, this.autonumericOptions);
3060
3193
 
3061
3194
  this.$nextTick(() => {
3062
3195
  this.autoNumeric = new AutoNumeric(this.$refs.input, options);
@@ -3086,7 +3219,7 @@ var script$t = {
3086
3219
  }
3087
3220
  };
3088
3221
 
3089
- const _hoisted_1$j = ["id"];
3222
+ const _hoisted_1$k = ["id"];
3090
3223
 
3091
3224
  function render$t(_ctx, _cache, $props, $setup, $data, $options) {
3092
3225
  const _component_q_field = resolveComponent("q-field");
@@ -3103,7 +3236,7 @@ function render$t(_ctx, _cache, $props, $setup, $data, $options) {
3103
3236
  onBlur: _cache[0] || (_cache[0] = (...args) => ($options.emitValue && $options.emitValue(...args))),
3104
3237
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.setSelect && $options.setSelect(...args))),
3105
3238
  onInput: _cache[2] || (_cache[2] = $event => ($options.emitUpdateModel($event.target.value)))
3106
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$j), [
3239
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$k), [
3107
3240
  [vShow, floatingLabel]
3108
3241
  ])
3109
3242
  ]),
@@ -3266,13 +3399,13 @@ var script$s = {
3266
3399
  }
3267
3400
  };
3268
3401
 
3269
- const _hoisted_1$i = { key: 0 };
3402
+ const _hoisted_1$j = { key: 0 };
3270
3403
 
3271
3404
  function render$s(_ctx, _cache, $props, $setup, $data, $options) {
3272
3405
  const _component_q_linear_progress = resolveComponent("q-linear-progress");
3273
3406
 
3274
3407
  return ($options.length)
3275
- ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
3408
+ ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
3276
3409
  renderSlot(_ctx.$slots, "default", { level: $options.level }, () => [
3277
3410
  createVNode(_component_q_linear_progress, {
3278
3411
  color: $options.level.color,
@@ -3299,8 +3432,11 @@ var script$r = {
3299
3432
 
3300
3433
  mixins: [passwordMixin],
3301
3434
 
3435
+ inheritAttrs: false,
3436
+
3302
3437
  props: {
3303
- hideStrengthChecker: {
3438
+ useStrengthChecker: {
3439
+ default: true,
3304
3440
  type: Boolean
3305
3441
  },
3306
3442
 
@@ -3360,44 +3496,41 @@ function render$r(_ctx, _cache, $props, $setup, $data, $options) {
3360
3496
  const _component_qas_password_strength_checker = resolveComponent("qas-password-strength-checker");
3361
3497
  const _component_qas_input = resolveComponent("qas-input");
3362
3498
 
3363
- return (openBlock(), createElementBlock("div", null, [
3364
- createVNode(_component_qas_input, mergeProps({
3365
- modelValue: $options.model,
3366
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
3367
- "bottom-slots": false,
3368
- color: "negative"
3369
- }, _ctx.$attrs, {
3370
- "remove-error-on-type": "",
3371
- type: $options.type
3372
- }), createSlots({
3373
- append: withCtx(() => [
3374
- createVNode(_component_q_icon, {
3375
- class: "cursor-pointer",
3376
- color: $props.iconColor,
3377
- name: $options.icon,
3378
- onClick: $options.toggle
3379
- }, null, 8 /* PROPS */, ["color", "name", "onClick"])
3380
- ]),
3381
- _: 2 /* DYNAMIC */
3382
- }, [
3383
- renderList(_ctx.$slots, (_, name) => {
3384
- return {
3385
- name: name,
3386
- fn: withCtx((context) => [
3387
- renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(context || {})))
3499
+ return (openBlock(), createBlock(_component_qas_input, mergeProps({
3500
+ modelValue: $options.model,
3501
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
3502
+ "bottom-slots": false
3503
+ }, _ctx.$attrs, {
3504
+ type: $options.type,
3505
+ "use-remove-error-on-type": ""
3506
+ }), createSlots({
3507
+ append: withCtx(() => [
3508
+ createVNode(_component_q_icon, {
3509
+ class: "cursor-pointer",
3510
+ color: $props.iconColor,
3511
+ name: $options.icon,
3512
+ onClick: $options.toggle
3513
+ }, null, 8 /* PROPS */, ["color", "name", "onClick"])
3514
+ ]),
3515
+ _: 2 /* DYNAMIC */
3516
+ }, [
3517
+ renderList(_ctx.$slots, (_, name) => {
3518
+ return {
3519
+ name: name,
3520
+ fn: withCtx((context) => [
3521
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(context || {})))
3522
+ ])
3523
+ }
3524
+ }),
3525
+ ($props.useStrengthChecker)
3526
+ ? {
3527
+ name: "hint",
3528
+ fn: withCtx(() => [
3529
+ createVNode(_component_qas_password_strength_checker, mergeProps($options.strengthCheckerProps, { password: $options.model }), null, 16 /* FULL_PROPS */, ["password"])
3388
3530
  ])
3389
3531
  }
3390
- }),
3391
- (!$props.hideStrengthChecker)
3392
- ? {
3393
- name: "hint",
3394
- fn: withCtx(() => [
3395
- createVNode(_component_qas_password_strength_checker, mergeProps($options.strengthCheckerProps, { password: $options.model }), null, 16 /* FULL_PROPS */, ["password"])
3396
- ])
3397
- }
3398
- : undefined
3399
- ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "type"])
3400
- ]))
3532
+ : undefined
3533
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "type"]))
3401
3534
  }
3402
3535
 
3403
3536
  script$r.render = render$r;
@@ -3471,7 +3604,11 @@ var script$q = {
3471
3604
 
3472
3605
  uploading: {
3473
3606
  type: Boolean
3474
- }
3607
+ },
3608
+
3609
+ useObjectModel: {
3610
+ type: Boolean
3611
+ }
3475
3612
  },
3476
3613
 
3477
3614
  emits: ['update:modelValue', 'update:uploading'],
@@ -3584,12 +3721,19 @@ var script$q = {
3584
3721
  uploaded (response) {
3585
3722
  const fullPath = response.xhr.responseURL.split('?').shift();
3586
3723
 
3587
- this.$emit(
3588
- 'update:modelValue',
3589
- this.isMultiple ? [...this.modelValue, fullPath] : fullPath || ''
3590
- );
3724
+ const objectValue = {
3725
+ format: response.files[0].type,
3726
+ url: fullPath,
3727
+ name: response.files[0].name
3728
+ };
3729
+
3730
+ const model = this.useObjectModel ? objectValue : fullPath;
3731
+
3732
+ this.$emit('update:modelValue', this.isMultiple ? [...this.modelValue, model] : model || '');
3591
3733
 
3592
3734
  this.updateUploading(false);
3735
+
3736
+ this.$qas.logger.group('QasUploader - uploaded', [this.modelValue]);
3593
3737
  },
3594
3738
 
3595
3739
  async fetchCredentials (filename) {
@@ -3600,6 +3744,12 @@ var script$q = {
3600
3744
  entity: this.entity,
3601
3745
  filename
3602
3746
  });
3747
+
3748
+ this.$qas.logger.group(
3749
+ 'QasUploader - fetchCredentials -> resposta de /upload-credentials/',
3750
+ [data]
3751
+ );
3752
+
3603
3753
  return data
3604
3754
  } finally {
3605
3755
  this.isFetching = false;
@@ -3618,8 +3768,16 @@ var script$q = {
3618
3768
  }
3619
3769
 
3620
3770
  const clonedValue = extend(true, [], this.modelValue);
3621
- const numberIndex = this.modelValue.findIndex(file => this.getFileName(file) === index);
3771
+ const numberIndex = this.modelValue.findIndex(file => {
3772
+ if (this.useObjectModel) {
3773
+ return file.uuid === index || file.url.includes(index)
3774
+ }
3775
+
3776
+ return this.getFileName(file) === index
3777
+ });
3778
+
3622
3779
  clonedValue.splice(numberIndex, 1);
3780
+
3623
3781
  this.$emit('update:modelValue', clonedValue);
3624
3782
  },
3625
3783
 
@@ -3628,12 +3786,10 @@ var script$q = {
3628
3786
  },
3629
3787
 
3630
3788
  getFilesList (uploadedFiles) {
3631
- const pathsList = Array.isArray(this.modelValue) ? this.modelValue : (this.modelValue ? [this.modelValue] : []);
3632
-
3633
3789
  uploadedFiles = uploadedFiles.map((file, indexToDelete) => {
3634
3790
  return {
3635
3791
  isUploaded: true,
3636
- image: file.xhr ? file.xhr.responseURL.split('?').shift() : '',
3792
+ url: file.xhr ? file.xhr.responseURL.split('?').shift() : '',
3637
3793
  name: file.name,
3638
3794
  progressLabel: file.__progressLabel,
3639
3795
  sizeLabel: file.__sizeLabel,
@@ -3642,11 +3798,20 @@ var script$q = {
3642
3798
  }
3643
3799
  });
3644
3800
 
3801
+ const pathsList = Array.isArray(this.modelValue)
3802
+ ? this.modelValue
3803
+ : (this.modelValue ? [this.modelValue] : []);
3804
+
3645
3805
  const mergedList = [...pathsList, ...uploadedFiles];
3646
3806
 
3647
3807
  const files = {};
3648
3808
 
3649
3809
  mergedList.forEach(file => {
3810
+ if (this.useObjectModel && file.uuid) {
3811
+ files[file.uuid] = file;
3812
+ return
3813
+ }
3814
+
3650
3815
  if (file.isFailed) {
3651
3816
  files[file.name] = file;
3652
3817
  return
@@ -3654,16 +3819,18 @@ var script$q = {
3654
3819
 
3655
3820
  if (typeof file === 'string') {
3656
3821
  const fileName = this.getFileName(file);
3657
- files[fileName] = { image: file, isUploaded: false, name: fileName };
3822
+ files[fileName] = { url: file, isUploaded: false, name: fileName };
3658
3823
  return
3659
3824
  }
3660
3825
 
3661
- if (file.image) {
3662
- const fileName = this.getFileName(file.image);
3826
+ if (file.url) {
3827
+ const fileName = this.getFileName(file.url);
3663
3828
  files[fileName] = file;
3664
3829
  }
3665
3830
  });
3666
3831
 
3832
+ this.$qas.logger.group('QasUploader - getFilesList', [files]);
3833
+
3667
3834
  return files
3668
3835
  },
3669
3836
 
@@ -3683,6 +3850,8 @@ var script$q = {
3683
3850
  const filesList = Array.from(this.hiddenInputElement.files);
3684
3851
  const processedFiles = [];
3685
3852
 
3853
+ this.$refs.hiddenInput.value = '';
3854
+
3686
3855
  filesList.forEach(file => processedFiles.push(this.resizeImage(file)));
3687
3856
  this.uploader.addFiles(await Promise.all(processedFiles));
3688
3857
  },
@@ -3702,7 +3871,14 @@ var script$q = {
3702
3871
  // Retorna largura e altura da original da imagem
3703
3872
  const { width, height } = await getImageSize(image);
3704
3873
 
3705
- if (width <= this.sizeLimit) return file
3874
+ if (width <= this.sizeLimit) {
3875
+ this.$qas.logger.info(`
3876
+ QasUploader - resizeImage -> Tamanho da imagem menor que o tamanho limite,
3877
+ sendo assim, não faz o resize
3878
+ `);
3879
+
3880
+ return file
3881
+ }
3706
3882
 
3707
3883
  // Retorna os novos tamanhos redimensionados
3708
3884
  const resizedDimensions = getResizeDimensions(this.sizeLimit, width, height);
@@ -3720,7 +3896,11 @@ var script$q = {
3720
3896
  const resizedImage = await pica.resize(image, canvas, this.defaultPicaResizeOptions);
3721
3897
  const blob = await pica.toBlob(resizedImage, type, 0.90);
3722
3898
 
3723
- return new File([blob], file.name, { type })
3899
+ const newFile = new File([blob], file.name, { type });
3900
+
3901
+ this.$qas.logger.group('QasUploader - resizeImage -> nova imagem', [newFile]);
3902
+
3903
+ return newFile
3724
3904
  } catch {
3725
3905
  // Caso não consiga redimensionar retorna o arquivo original
3726
3906
  return file
@@ -3733,7 +3913,7 @@ var script$q = {
3733
3913
  }
3734
3914
  };
3735
3915
 
3736
- const _hoisted_1$h = { class: "flex flex-center full-width justify-between no-border no-wrap q-gutter-xs q-pa-sm text-white transparent" };
3916
+ const _hoisted_1$i = { class: "flex flex-center full-width justify-between no-border no-wrap q-gutter-xs q-pa-sm text-white transparent" };
3737
3917
  const _hoisted_2$d = { class: "col column items-start justify-center" };
3738
3918
  const _hoisted_3$9 = {
3739
3919
  key: 0,
@@ -3743,7 +3923,7 @@ const _hoisted_4$7 = {
3743
3923
  key: 1,
3744
3924
  class: "q-uploader__subtitle"
3745
3925
  };
3746
- const _hoisted_5$5 = ["multiple"];
3926
+ const _hoisted_5$5 = ["accept", "multiple"];
3747
3927
  const _hoisted_6$3 = { class: "col-12 q-col-gutter-md row" };
3748
3928
  const _hoisted_7$3 = { class: "col items-center no-wrap row" };
3749
3929
  const _hoisted_8$2 = {
@@ -3786,7 +3966,7 @@ function render$q(_ctx, _cache, $props, $setup, $data, $options) {
3786
3966
  }), {
3787
3967
  header: withCtx((scope) => [
3788
3968
  renderSlot(_ctx.$slots, "header", { scope: scope }, () => [
3789
- createElementVNode("div", _hoisted_1$h, [
3969
+ createElementVNode("div", _hoisted_1$i, [
3790
3970
  (scope.isUploading)
3791
3971
  ? (openBlock(), createBlock(_component_q_spinner, {
3792
3972
  key: 0,
@@ -3815,6 +3995,7 @@ function render$q(_ctx, _cache, $props, $setup, $data, $options) {
3815
3995
  : createCommentVNode("v-if", true),
3816
3996
  createElementVNode("input", {
3817
3997
  ref: "hiddenInput",
3998
+ accept: $options.attributes.accept,
3818
3999
  class: "qas-uploader__input",
3819
4000
  multiple: $options.isMultiple,
3820
4001
  type: "file"
@@ -3862,7 +4043,7 @@ function render$q(_ctx, _cache, $props, $setup, $data, $options) {
3862
4043
  class: "q-mr-sm",
3863
4044
  color: "contrast-primary",
3864
4045
  icon: "o_attach_file",
3865
- image: file.image,
4046
+ image: file.url,
3866
4047
  rounded: "",
3867
4048
  "text-color": $options.getColorFileIcon(file)
3868
4049
  }, null, 8 /* PROPS */, ["image", "text-color"]),
@@ -4023,7 +4204,7 @@ var script$p = {
4023
4204
  }
4024
4205
  };
4025
4206
 
4026
- const _hoisted_1$g = {
4207
+ const _hoisted_1$h = {
4027
4208
  ref: "signatureContainer",
4028
4209
  class: "qas-signature-pad relative-position"
4029
4210
  };
@@ -4033,7 +4214,7 @@ function render$p(_ctx, _cache, $props, $setup, $data, $options) {
4033
4214
  const _component_qas_btn = resolveComponent("qas-btn");
4034
4215
 
4035
4216
  return (openBlock(), createElementBlock(Fragment, null, [
4036
- createElementVNode("div", _hoisted_1$g, [
4217
+ createElementVNode("div", _hoisted_1$h, [
4037
4218
  createElementVNode("canvas", {
4038
4219
  id: $data.canvasId,
4039
4220
  ref: _ctx.$attrs.ref,
@@ -4068,6 +4249,7 @@ var script$o = {
4068
4249
  name: 'QasSignatureUploader',
4069
4250
 
4070
4251
  components: {
4252
+ QasBtn: script$K,
4071
4253
  QasDialog: script$x,
4072
4254
  QasUploader: script$q,
4073
4255
  QasSignaturePad: script$p
@@ -4196,7 +4378,7 @@ var script$o = {
4196
4378
  }
4197
4379
  };
4198
4380
 
4199
- const _hoisted_1$f = { class: "col column items-start justify-center" };
4381
+ const _hoisted_1$g = { class: "col column items-start justify-center" };
4200
4382
  const _hoisted_2$b = {
4201
4383
  key: 0,
4202
4384
  class: "q-uploader__title"
@@ -4204,7 +4386,7 @@ const _hoisted_2$b = {
4204
4386
  const _hoisted_3$8 = /*#__PURE__*/createElementVNode("div", { class: "text-bold text-center" }, "Insira sua assinatura digital no campo abaixo", -1 /* HOISTED */);
4205
4387
 
4206
4388
  function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4207
- const _component_q_btn = resolveComponent("q-btn");
4389
+ const _component_qas_btn = resolveComponent("qas-btn");
4208
4390
  const _component_qas_uploader = resolveComponent("qas-uploader");
4209
4391
  const _component_qas_signature_pad = resolveComponent("qas-signature-pad");
4210
4392
  const _component_qas_dialog = resolveComponent("qas-dialog");
@@ -4223,14 +4405,15 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4223
4405
  class: normalizeClass(["cursor-pointer flex flex-center full-width justify-between no-border no-wrap q-gutter-xs text-white transparent", $options.headerClass]),
4224
4406
  onClick: _cache[0] || (_cache[0] = (...args) => ($options.openDialog && $options.openDialog(...args)))
4225
4407
  }, [
4226
- createElementVNode("div", _hoisted_1$f, [
4408
+ createElementVNode("div", _hoisted_1$g, [
4227
4409
  ($props.uploadLabel)
4228
4410
  ? (openBlock(), createElementBlock("div", _hoisted_2$b, toDisplayString($props.uploadLabel), 1 /* TEXT */))
4229
4411
  : createCommentVNode("v-if", true)
4230
4412
  ]),
4231
4413
  (!$props.readonly)
4232
- ? (openBlock(), createBlock(_component_q_btn, {
4414
+ ? (openBlock(), createBlock(_component_qas_btn, {
4233
4415
  key: 0,
4416
+ color: "white",
4234
4417
  dense: "",
4235
4418
  flat: "",
4236
4419
  icon: "o_add",
@@ -4238,12 +4421,12 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4238
4421
  onClick: $options.openDialog
4239
4422
  }, null, 8 /* PROPS */, ["onClick"]))
4240
4423
  : createCommentVNode("v-if", true),
4241
- createVNode(_component_q_btn, {
4424
+ createVNode(_component_qas_btn, {
4242
4425
  ref: "forceUpload",
4243
4426
  class: "hidden",
4244
4427
  onClick: $event => ($options.upload(scope))
4245
4428
  }, null, 8 /* PROPS */, ["onClick"]),
4246
- createVNode(_component_q_btn, {
4429
+ createVNode(_component_qas_btn, {
4247
4430
  ref: "buttonCleanFiles",
4248
4431
  class: "hidden",
4249
4432
  onClick: scope.removeUploadedFiles
@@ -4272,7 +4455,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4272
4455
  ], 4 /* STYLE */)
4273
4456
  ]),
4274
4457
  actions: withCtx(() => [
4275
- createVNode(_component_q_btn, {
4458
+ createVNode(_component_qas_btn, {
4276
4459
  class: "full-width",
4277
4460
  color: "primary",
4278
4461
  disable: $data.isEmpty,
@@ -4280,7 +4463,7 @@ function render$o(_ctx, _cache, $props, $setup, $data, $options) {
4280
4463
  "no-caps": "",
4281
4464
  onClick: $options.getSignatureData
4282
4465
  }, null, 8 /* PROPS */, ["disable", "onClick"]),
4283
- createVNode(_component_q_btn, {
4466
+ createVNode(_component_qas_btn, {
4284
4467
  class: "full-width q-mt-sm",
4285
4468
  color: "primary",
4286
4469
  flat: "",
@@ -4316,6 +4499,8 @@ var script$n = {
4316
4499
  QasSignatureUploader: script$o
4317
4500
  },
4318
4501
 
4502
+ inheritAttrs: false,
4503
+
4319
4504
  props: {
4320
4505
  error: {
4321
4506
  default: '',
@@ -4355,8 +4540,9 @@ var script$n = {
4355
4540
  type,
4356
4541
  mask,
4357
4542
  maxFiles,
4358
- searchable,
4359
- gmt
4543
+ useIso,
4544
+ useSearch,
4545
+ useLazyLoading
4360
4546
  } = this.formattedField;
4361
4547
 
4362
4548
  // Default error attributes for Quasar.
@@ -4378,11 +4564,11 @@ var script$n = {
4378
4564
  minlength,
4379
4565
  suffix,
4380
4566
  prefix,
4381
- gmt
4567
+ useIso
4382
4568
  };
4383
4569
 
4384
4570
  const numericInput = { is: 'qas-numeric-input', ...input };
4385
- const datetimeInput = { is: 'qas-date-time-input', gmt, ...input };
4571
+ const datetimeInput = { is: 'qas-date-time-input', useIso, ...input };
4386
4572
 
4387
4573
  // It'll generate a list of acceptable files extensions.
4388
4574
  const accept = extensions && extensions.length ? extensions.map(extension => `.${extension}`).join(',') : '';
@@ -4410,9 +4596,9 @@ var script$n = {
4410
4596
  money: { ...numericInput, mode: 'money' },
4411
4597
  percent: { ...numericInput, mode: 'percent' },
4412
4598
 
4413
- date: { ...datetimeInput, dateOnly: true },
4599
+ date: { ...datetimeInput, useDateOnly: true },
4414
4600
  datetime: { ...datetimeInput },
4415
- time: { ...datetimeInput, timeOnly: true },
4601
+ time: { ...datetimeInput, useTimeOnly: true },
4416
4602
 
4417
4603
  boolean: { is: 'q-toggle', label, ...error },
4418
4604
  checkbox: { is: 'qas-checkbox-group', label, options, ...error },
@@ -4423,7 +4609,7 @@ var script$n = {
4423
4609
 
4424
4610
  'signature-uploader': { is: 'qas-signature-uploader', entity, uploadLabel: label, ...error },
4425
4611
 
4426
- select: { is: 'qas-select', multiple, options, searchable, ...input }
4612
+ select: { is: 'qas-select', entity, name, multiple, options, useSearch, useLazyLoading, ...input }
4427
4613
  };
4428
4614
 
4429
4615
  return { ...(profiles[type] || profiles.default), ...this.$attrs }
@@ -4485,22 +4671,20 @@ var script$n = {
4485
4671
  };
4486
4672
 
4487
4673
  function render$n(_ctx, _cache, $props, $setup, $data, $options) {
4488
- return (openBlock(), createElementBlock("div", null, [
4489
- (openBlock(), createBlock(resolveDynamicComponent($options.component.is), mergeProps($options.component, {
4490
- "data-cy": $props.field.name,
4491
- "model-value": $options.formattedValue,
4492
- "onUpdate:modelValue": $options.updateModel
4493
- }), createSlots({ _: 2 /* DYNAMIC */ }, [
4494
- renderList(_ctx.$slots, (_, name) => {
4495
- return {
4496
- name: name,
4497
- fn: withCtx((context) => [
4498
- renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(context || {})))
4499
- ])
4500
- }
4501
- })
4502
- ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["data-cy", "model-value", "onUpdate:modelValue"]))
4503
- ]))
4674
+ return (openBlock(), createBlock(resolveDynamicComponent($options.component.is), mergeProps($options.component, {
4675
+ "data-cy": $props.field.name,
4676
+ "model-value": $options.formattedValue,
4677
+ "onUpdate:modelValue": $options.updateModel
4678
+ }), createSlots({ _: 2 /* DYNAMIC */ }, [
4679
+ renderList(_ctx.$slots, (_, name) => {
4680
+ return {
4681
+ name: name,
4682
+ fn: withCtx((context) => [
4683
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(context || {})))
4684
+ ])
4685
+ }
4686
+ })
4687
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["data-cy", "model-value", "onUpdate:modelValue"]))
4504
4688
  }
4505
4689
 
4506
4690
  script$n.render = render$n;
@@ -4519,6 +4703,7 @@ var script$m = {
4519
4703
  name: 'QasFilters',
4520
4704
 
4521
4705
  components: {
4706
+ QasBtn: script$K,
4522
4707
  QasField: script$n
4523
4708
  },
4524
4709
 
@@ -4560,7 +4745,7 @@ var script$m = {
4560
4745
  type: String
4561
4746
  },
4562
4747
 
4563
- forceRefetch: {
4748
+ useForceRefetch: {
4564
4749
  type: Boolean
4565
4750
  }
4566
4751
  },
@@ -4691,7 +4876,7 @@ var script$m = {
4691
4876
  },
4692
4877
 
4693
4878
  async fetchFilters () {
4694
- if (!this.forceRefetch && (this.hasFields || !this.useFilterButton)) {
4879
+ if (!this.useForceRefetch && (this.hasFields || !this.useFilterButton)) {
4695
4880
  return null
4696
4881
  }
4697
4882
 
@@ -4699,11 +4884,26 @@ var script$m = {
4699
4884
  this.isFetching = true;
4700
4885
 
4701
4886
  try {
4887
+ this.$qas.logger.group(
4888
+ `QasFilters - fetchFilters -> Payload do parâmetro do ${this.entity}/fetchFilters`,
4889
+ [{ url: this.url }]
4890
+ );
4891
+
4702
4892
  const response = await this.$store.dispatch(`${this.entity}/fetchFilters`, { url: this.url });
4703
4893
  this.$emit('fetch-success', response);
4894
+
4895
+ this.$qas.logger.group(
4896
+ `QasFilters - fetchFilters -> resposta da action ${this.entity}/fetchFilters`, [response]
4897
+ );
4704
4898
  } catch (error) {
4705
4899
  this.hasFetchError = true;
4706
4900
  this.$emit('fetch-error', error);
4901
+
4902
+ this.$qas.logger.group(
4903
+ `QasFilters - fetchFilters -> exceção da action ${this.entity}/fetchFilters`,
4904
+ [error],
4905
+ { error: true }
4906
+ );
4707
4907
  } finally {
4708
4908
  this.isFetching = false;
4709
4909
  }
@@ -4762,7 +4962,7 @@ var script$m = {
4762
4962
  }
4763
4963
  };
4764
4964
 
4765
- const _hoisted_1$e = { class: "q-mb-lg" };
4965
+ const _hoisted_1$f = { class: "q-mb-lg" };
4766
4966
  const _hoisted_2$a = {
4767
4967
  key: 0,
4768
4968
  class: "q-gutter-x-md row"
@@ -4786,8 +4986,8 @@ const _hoisted_7$2 = {
4786
4986
  };
4787
4987
 
4788
4988
  function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4789
- const _component_q_btn = resolveComponent("q-btn");
4790
- const _component_q_input = resolveComponent("q-input");
4989
+ const _component_qas_btn = resolveComponent("qas-btn");
4990
+ const _component_qas_input = resolveComponent("qas-input");
4791
4991
  const _component_q_form = resolveComponent("q-form");
4792
4992
  const _component_q_spinner = resolveComponent("q-spinner");
4793
4993
  const _component_q_icon = resolveComponent("q-icon");
@@ -4795,7 +4995,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4795
4995
  const _component_q_menu = resolveComponent("q-menu");
4796
4996
  const _component_q_chip = resolveComponent("q-chip");
4797
4997
 
4798
- return (openBlock(), createElementBlock("section", _hoisted_1$e, [
4998
+ return (openBlock(), createElementBlock("section", _hoisted_1$f, [
4799
4999
  ($options.showFilters)
4800
5000
  ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
4801
5001
  ($options.showSearch)
@@ -4807,26 +5007,32 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4807
5007
  onSubmit: _cache[2] || (_cache[2] = withModifiers($event => ($options.filter()), ["prevent"]))
4808
5008
  }, {
4809
5009
  default: withCtx(() => [
4810
- createVNode(_component_q_input, {
5010
+ createVNode(_component_qas_input, {
4811
5011
  modelValue: $data.search,
4812
5012
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.search) = $event)),
4813
5013
  debounce: $options.debounce,
4814
5014
  dense: "",
5015
+ "hide-bottom-space": "",
5016
+ outlined: false,
4815
5017
  placeholder: $props.searchPlaceholder,
4816
5018
  type: "search"
4817
5019
  }, {
4818
5020
  append: withCtx(() => [
4819
5021
  ($options.hasSearch)
4820
- ? (openBlock(), createBlock(_component_q_btn, {
5022
+ ? (openBlock(), createBlock(_component_qas_btn, {
4821
5023
  key: 0,
5024
+ color: "grey-9",
5025
+ flat: "",
4822
5026
  icon: "o_clear",
4823
5027
  unelevated: "",
4824
5028
  onClick: $options.clearSearch
4825
5029
  }, null, 8 /* PROPS */, ["onClick"]))
4826
5030
  : createCommentVNode("v-if", true),
4827
5031
  (!$options.debounce)
4828
- ? (openBlock(), createBlock(_component_q_btn, {
5032
+ ? (openBlock(), createBlock(_component_qas_btn, {
4829
5033
  key: 1,
5034
+ color: "grey-9",
5035
+ flat: "",
4830
5036
  icon: "o_search",
4831
5037
  type: "submit",
4832
5038
  unelevated: "",
@@ -4849,7 +5055,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4849
5055
  filter: $options.filter
4850
5056
  }, () => [
4851
5057
  ($props.useFilterButton)
4852
- ? (openBlock(), createBlock(_component_q_btn, {
5058
+ ? (openBlock(), createBlock(_component_qas_btn, {
4853
5059
  key: 0,
4854
5060
  color: $options.filterButtonColor,
4855
5061
  flat: "",
@@ -4894,16 +5100,19 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
4894
5100
  ]))
4895
5101
  }), 128 /* KEYED_FRAGMENT */)),
4896
5102
  createElementVNode("div", _hoisted_6$2, [
4897
- createVNode(_component_q_btn, {
5103
+ createVNode(_component_qas_btn, {
4898
5104
  class: "q-mr-sm",
5105
+ flat: "",
4899
5106
  label: "Limpar",
5107
+ "no-caps": false,
4900
5108
  size: "12px",
4901
5109
  unelevated: "",
4902
5110
  onClick: $options.clearFilters
4903
5111
  }, null, 8 /* PROPS */, ["onClick"]),
4904
- createVNode(_component_q_btn, {
5112
+ createVNode(_component_qas_btn, {
4905
5113
  color: "primary",
4906
5114
  label: "Filtrar",
5115
+ "no-caps": false,
4907
5116
  size: "12px",
4908
5117
  type: "submit",
4909
5118
  unelevated: ""
@@ -4972,7 +5181,9 @@ var generatorMixin = {
4972
5181
  gutter: {
4973
5182
  default: 'md',
4974
5183
  type: [String, Boolean],
4975
- validator: value => ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
5184
+ validator: value => {
5185
+ return typeof value === 'boolean' || ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
5186
+ }
4976
5187
  }
4977
5188
  },
4978
5189
 
@@ -5021,7 +5232,13 @@ var generatorMixin = {
5021
5232
  },
5022
5233
 
5023
5234
  mx_handleColumnsByIndex (index, isGridGenerator) {
5024
- const fields = isGridGenerator ? this.fields : this.groupedFields.visible;
5235
+ const fields = isGridGenerator ? this.fields : {};
5236
+
5237
+ if (!isGridGenerator) {
5238
+ for (const key in this.normalizedFields) {
5239
+ Object.assign(fields, this.normalizedFields[key].fields.visible);
5240
+ }
5241
+ }
5025
5242
 
5026
5243
  if (!Array.isArray(fields)) {
5027
5244
  index = Object.keys(fields).findIndex(field => field === index);
@@ -5071,6 +5288,19 @@ var script$l = {
5071
5288
  default: () => ({}),
5072
5289
  required: true,
5073
5290
  type: Object
5291
+ },
5292
+
5293
+ fieldset: {
5294
+ default: () => ({}),
5295
+ type: Object
5296
+ },
5297
+
5298
+ fieldsetGutter: {
5299
+ default: 'lg',
5300
+ type: [String, Boolean],
5301
+ validator: value => {
5302
+ return typeof value === 'boolean' || ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
5303
+ }
5074
5304
  }
5075
5305
  },
5076
5306
 
@@ -5080,6 +5310,8 @@ var script$l = {
5080
5310
  groupedFields () {
5081
5311
  const fields = { hidden: {}, visible: {} };
5082
5312
 
5313
+ if (this.hasFieldset) return fields
5314
+
5083
5315
  for (const key in this.fields) {
5084
5316
  const field = this.fields[key];
5085
5317
  fields[field.type === 'hidden' ? 'hidden' : 'visible'][key] = field;
@@ -5096,6 +5328,58 @@ var script$l = {
5096
5328
  }
5097
5329
 
5098
5330
  return fields
5331
+ },
5332
+
5333
+ normalizedFields () {
5334
+ if (!this.hasFieldset) {
5335
+ return {
5336
+ default: {
5337
+ fields: this.groupedFields
5338
+ }
5339
+ }
5340
+ }
5341
+
5342
+ const fields = {};
5343
+
5344
+ for (const fieldsetKey in this.fieldset) {
5345
+ const fieldsetItem = this.fieldset[fieldsetKey];
5346
+
5347
+ fields[fieldsetKey] = {
5348
+ label: fieldsetItem.label,
5349
+ fields: { hidden: {}, visible: {} }
5350
+ };
5351
+
5352
+ for (const fieldName of fieldsetItem.fields) {
5353
+ const field = this.fields[fieldName];
5354
+
5355
+ if (!field) continue
5356
+
5357
+ Object.assign(
5358
+ fields[fieldsetKey].fields[
5359
+ field.type === 'hidden' ? 'hidden' : 'visible'
5360
+ ],
5361
+ {
5362
+ [fieldName]: field
5363
+ }
5364
+ );
5365
+ }
5366
+ }
5367
+
5368
+ return fields
5369
+ },
5370
+
5371
+ hasFieldset () {
5372
+ return !!Object.keys(this.fieldset).length
5373
+ },
5374
+
5375
+ fieldsetClasses () {
5376
+ const classes = ['row'];
5377
+
5378
+ if (this.fieldsetGutter) {
5379
+ classes.push(`q-col-gutter-y-${this.fieldsetGutter}`);
5380
+ }
5381
+
5382
+ return classes
5099
5383
  }
5100
5384
  },
5101
5385
 
@@ -5110,51 +5394,290 @@ var script$l = {
5110
5394
  };
5111
5395
 
5112
5396
  function render$l(_ctx, _cache, $props, $setup, $data, $options) {
5397
+ const _component_qas_label = resolveComponent("qas-label");
5113
5398
  const _component_qas_field = resolveComponent("qas-field");
5114
5399
 
5115
- return (openBlock(), createElementBlock("div", null, [
5116
- createElementVNode("div", {
5117
- class: normalizeClass(_ctx.mx_classes)
5118
- }, [
5119
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.groupedFields.visible, (field, key) => {
5120
- return (openBlock(), createElementBlock("div", {
5121
- key: key,
5122
- class: normalizeClass(_ctx.mx_getFieldClass(key))
5123
- }, [
5124
- renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
5125
- createVNode(_component_qas_field, mergeProps($props.fieldsProps[field.name], {
5126
- error: $props.errors[key],
5127
- field: field,
5128
- "model-value": $props.modelValue[field.name],
5129
- "onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
5130
- }), null, 16 /* FULL_PROPS */, ["error", "field", "model-value", "onUpdate:modelValue"])
5131
- ])
5132
- ], 2 /* CLASS */))
5133
- }), 128 /* KEYED_FRAGMENT */))
5134
- ], 2 /* CLASS */),
5135
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.groupedFields.hidden, (field, key) => {
5136
- return (openBlock(), createElementBlock("div", { key: key }, [
5137
- renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
5138
- createVNode(_component_qas_field, mergeProps($props.fieldsProps[field.name], {
5139
- field: field,
5140
- "model-value": $props.modelValue[field.name],
5141
- "onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
5142
- }), null, 16 /* FULL_PROPS */, ["field", "model-value", "onUpdate:modelValue"])
5400
+ return (openBlock(), createElementBlock("div", {
5401
+ class: normalizeClass($options.fieldsetClasses)
5402
+ }, [
5403
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.normalizedFields, (fieldsetItem, fieldsetItemKey) => {
5404
+ return (openBlock(), createElementBlock("div", {
5405
+ key: fieldsetItemKey,
5406
+ class: "full-width"
5407
+ }, [
5408
+ (fieldsetItem.label)
5409
+ ? renderSlot(_ctx.$slots, `legend-${fieldsetItemKey}`, { key: 0 }, () => [
5410
+ createVNode(_component_qas_label, {
5411
+ label: fieldsetItem.label
5412
+ }, null, 8 /* PROPS */, ["label"])
5413
+ ])
5414
+ : createCommentVNode("v-if", true),
5415
+ createElementVNode("div", null, [
5416
+ createElementVNode("div", {
5417
+ class: normalizeClass(_ctx.mx_classes)
5418
+ }, [
5419
+ (openBlock(true), createElementBlock(Fragment, null, renderList(fieldsetItem.fields.visible, (field, key) => {
5420
+ return (openBlock(), createElementBlock("div", {
5421
+ key: key,
5422
+ class: normalizeClass(_ctx.mx_getFieldClass(key))
5423
+ }, [
5424
+ renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
5425
+ createVNode(_component_qas_field, mergeProps($props.fieldsProps[field.name], {
5426
+ error: $props.errors[key],
5427
+ field: field,
5428
+ "model-value": $props.modelValue[field.name],
5429
+ "onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
5430
+ }), null, 16 /* FULL_PROPS */, ["error", "field", "model-value", "onUpdate:modelValue"])
5431
+ ])
5432
+ ], 2 /* CLASS */))
5433
+ }), 128 /* KEYED_FRAGMENT */))
5434
+ ], 2 /* CLASS */),
5435
+ (openBlock(true), createElementBlock(Fragment, null, renderList(fieldsetItem.fields.hidden, (field, key) => {
5436
+ return (openBlock(), createElementBlock("div", { key: key }, [
5437
+ renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
5438
+ createVNode(_component_qas_field, mergeProps($props.fieldsProps[field.name], {
5439
+ field: field,
5440
+ "model-value": $props.modelValue[field.name],
5441
+ "onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
5442
+ }), null, 16 /* FULL_PROPS */, ["field", "model-value", "onUpdate:modelValue"])
5443
+ ])
5444
+ ]))
5445
+ }), 128 /* KEYED_FRAGMENT */))
5143
5446
  ])
5144
5447
  ]))
5145
5448
  }), 128 /* KEYED_FRAGMENT */))
5146
- ]))
5449
+ ], 2 /* CLASS */))
5147
5450
  }
5148
5451
 
5149
5452
  script$l.render = render$l;
5150
5453
  script$l.__file = "src/components/form-generator/QasFormGenerator.vue";
5151
5454
 
5152
- var viewMixin = {
5455
+ var searchFilterMixin = {
5153
5456
  props: {
5154
- dialog: {
5457
+ entity: {
5458
+ default: '',
5459
+ type: String
5460
+ },
5461
+
5462
+ lazyLoadingProps: {
5463
+ default: () => ({}),
5464
+ type: Object
5465
+ },
5466
+
5467
+ name: {
5468
+ default: '',
5469
+ type: String
5470
+ },
5471
+
5472
+ useLazyLoading: {
5155
5473
  type: Boolean
5156
5474
  },
5157
5475
 
5476
+ fetching: {
5477
+ type: Boolean
5478
+ }
5479
+ },
5480
+
5481
+ emits: [
5482
+ 'update:modelValue',
5483
+ 'update:fetching',
5484
+ 'fetch-options-success',
5485
+ 'fetch-options-error'
5486
+ ],
5487
+
5488
+ data () {
5489
+ return {
5490
+ mx_filteredOptions: [],
5491
+ mx_hasFetchError: false,
5492
+ mx_isFetching: false,
5493
+ mx_isScrolling: false,
5494
+ mx_search: '',
5495
+ mx_fetchCount: 0,
5496
+ mx_pagination: {
5497
+ page: 1,
5498
+ lastPage: null,
5499
+ hasCount: true,
5500
+ hasNextPage: false
5501
+ }
5502
+ }
5503
+ },
5504
+
5505
+ computed: {
5506
+ mx_defaultLazyLoadingProps () {
5507
+ const {
5508
+ url,
5509
+ params,
5510
+ decamelizeFieldName
5511
+ } = this.lazyLoadingProps;
5512
+
5513
+ const defaultParams = { limit: 48 };
5514
+
5515
+ return {
5516
+ url: url || '',
5517
+ params: {
5518
+ ...defaultParams,
5519
+ ...params
5520
+ },
5521
+ decamelizeFieldName: decamelizeFieldName === undefined ? true : decamelizeFieldName
5522
+ }
5523
+ },
5524
+
5525
+ mx_hasFilteredOptions () {
5526
+ return !!this.mx_filteredOptions.length
5527
+ },
5528
+
5529
+ mx_isFilterByFuse () {
5530
+ return !this.useLazyLoading
5531
+ }
5532
+ },
5533
+
5534
+ watch: {
5535
+ lazyLoadingProps: {
5536
+ handler (value, oldValue) {
5537
+ if (isEqual$1(value, oldValue)) return
5538
+
5539
+ this.mx_filterOptionsByStore('');
5540
+ this.$emit('update:modelValue', '');
5541
+ }
5542
+ }
5543
+ },
5544
+
5545
+ methods: {
5546
+ async mx_filterOptionsByStore (search) {
5547
+ this.mx_resetFilter(search);
5548
+ await this.mx_setFetchOptions();
5549
+ },
5550
+
5551
+ mx_resetFilter (search) {
5552
+ this.mx_filteredOptions = [];
5553
+ this.mx_search = search;
5554
+ this.mx_pagination = {
5555
+ page: 1,
5556
+ lastPage: null,
5557
+ hasCount: true,
5558
+ hasNextPage: false
5559
+ };
5560
+ },
5561
+
5562
+ async mx_onVirtualScroll ({ index, ref }) {
5563
+ const lastIndex = this.mx_filteredOptions.length - 1;
5564
+
5565
+ if (index === lastIndex && this.mx_canFetchOptions()) {
5566
+ await this.mx_loadMoreOptions();
5567
+
5568
+ this.$nextTick(() => {
5569
+ ref.reset();
5570
+ ref.refresh(lastIndex);
5571
+ });
5572
+ }
5573
+ },
5574
+
5575
+ async mx_loadMoreOptions () {
5576
+ this.mx_isScrolling = true;
5577
+
5578
+ const options = await this.mx_fetchOptions();
5579
+ this.mx_filteredOptions.push(...options);
5580
+
5581
+ // this is to prevent the virtual-scroll event to be fired again
5582
+ this.$nextTick(() => {
5583
+ this.mx_isScrolling = false;
5584
+ });
5585
+ },
5586
+
5587
+ async mx_fetchOptions () {
5588
+ this.mx_fetchCount++;
5589
+
5590
+ try {
5591
+ if (!this.entity) this.mx_setMissingPropsMessage('entity');
5592
+ if (!this.name) this.mx_setMissingPropsMessage('name');
5593
+
5594
+ this.mx_hasFetchError = false;
5595
+ this.mx_isFetching = true;
5596
+
5597
+ this.$emit('update:fetching', true);
5598
+
5599
+ const { url, params, decamelizeFieldName } = this.mx_defaultLazyLoadingProps;
5600
+
5601
+ const { data } = await this.$store.dispatch(`${this.entity}/fetchFieldOptions`, {
5602
+ url,
5603
+ field: decamelizeFieldName ? decamelize(this.name, { separator: '-' }) : this.name,
5604
+ params: {
5605
+ ...params,
5606
+ search: this.mx_search,
5607
+ offset: (this.mx_pagination.page - 1) * params.limit
5608
+ }
5609
+ });
5610
+
5611
+ const { results, count, hasNextPage } = data;
5612
+ const hasCount = count !== undefined;
5613
+
5614
+ this.mx_pagination = {
5615
+ page: this.mx_pagination.page + 1,
5616
+ lastPage: hasCount ? Math.ceil(count / params.limit) : null,
5617
+ hasCount,
5618
+ hasNextPage
5619
+ };
5620
+
5621
+ this.$emit('fetch-options-success', data);
5622
+
5623
+ return this.mx_handleOptions(results)
5624
+ } catch (error) {
5625
+ this.$qas.logger.group(
5626
+ `Mixin: searchFilterMixin - mx_fetchOptions -> exceção da action ${this.entity}/fetchFieldOptions`,
5627
+ [error],
5628
+ { error: true }
5629
+ );
5630
+
5631
+ this.mx_hasFetchError = true;
5632
+ this.$emit('fetch-options-error', error);
5633
+
5634
+ return []
5635
+ } finally {
5636
+ this.mx_isFetching = false;
5637
+ this.$emit('update:fetching', false);
5638
+ }
5639
+ },
5640
+
5641
+ async mx_setFetchOptions () {
5642
+ this.mx_filteredOptions = await this.mx_fetchOptions();
5643
+ },
5644
+
5645
+ mx_canFetchOptions () {
5646
+ const { lastPage, page, hasCount, hasNextPage } = this.mx_pagination;
5647
+
5648
+ const hasMorePages = hasCount ? lastPage && page <= lastPage : hasNextPage;
5649
+
5650
+ return hasMorePages && !this.mx_isFetching && !this.mx_isScrolling && this.useLazyLoading
5651
+ },
5652
+
5653
+ mx_handleOptions (options) {
5654
+ if (this.labelKey && this.valueKey) {
5655
+ return getNormalizedOptions({
5656
+ options,
5657
+ label: this.labelKey,
5658
+ value: this.valueKey
5659
+ })
5660
+ }
5661
+
5662
+ return options
5663
+ },
5664
+
5665
+ mx_getMissingPropsMessage (prop) {
5666
+ return `A propriedade "${prop}" é obrigatória quando a propriedade "useLazyLoading" está ativa.`
5667
+ },
5668
+
5669
+ mx_setMissingPropsMessage (prop) {
5670
+ throw new Error(this.mx_getMissingPropsMessage(prop))
5671
+ },
5672
+
5673
+ mx_getNormalizedFuseResults (results = []) {
5674
+ return results.map(({ item }) => item)
5675
+ }
5676
+ }
5677
+ };
5678
+
5679
+ var viewMixin = {
5680
+ props: {
5158
5681
  entity: {
5159
5682
  required: true,
5160
5683
  type: String
@@ -5182,6 +5705,16 @@ var viewMixin = {
5182
5705
 
5183
5706
  fetching: {
5184
5707
  type: Boolean
5708
+ },
5709
+
5710
+ useBoundary: {
5711
+ default: true,
5712
+ type: Boolean
5713
+ },
5714
+
5715
+ beforeFetch: {
5716
+ default: null,
5717
+ type: Function
5185
5718
  }
5186
5719
  },
5187
5720
 
@@ -5197,7 +5730,7 @@ var viewMixin = {
5197
5730
  mx_errors: {},
5198
5731
  mx_fields: {},
5199
5732
  mx_metadata: {},
5200
-
5733
+ mx_cancelBeforeFetch: false,
5201
5734
  mx_isFetching: false
5202
5735
  }
5203
5736
  },
@@ -5210,11 +5743,11 @@ var viewMixin = {
5210
5743
 
5211
5744
  computed: {
5212
5745
  mx_componentTag () {
5213
- return this.dialog ? 'div' : 'q-page'
5746
+ return this.useBoundary ? 'q-page' : 'div'
5214
5747
  },
5215
5748
 
5216
5749
  mx_componentClass () {
5217
- return !this.dialog && 'container spaced'
5750
+ return this.useBoundary && 'container spaced'
5218
5751
  },
5219
5752
 
5220
5753
  mx_hasFooterSlot () {
@@ -5248,11 +5781,9 @@ var viewMixin = {
5248
5781
  },
5249
5782
 
5250
5783
  mx_setFields (fields = {}) {
5251
- for (const field in fields) {
5252
- fields[field].name = camelize(fields[field].name);
5253
- }
5784
+ const camelizedFields = camelizeFieldsName(fields);
5254
5785
 
5255
- this.mx_fields = markRaw(fields);
5786
+ this.mx_fields = markRaw(camelizedFields);
5256
5787
  },
5257
5788
 
5258
5789
  mx_setMetadata (metadata = {}) {
@@ -5265,6 +5796,22 @@ var viewMixin = {
5265
5796
 
5266
5797
  this.$emit(`update:${key}`, models[key]);
5267
5798
  }
5799
+ },
5800
+
5801
+ mx_fetchHandler (payload, resolve) {
5802
+ const hasBeforeFetch = typeof this.beforeFetch === 'function';
5803
+
5804
+ if (hasBeforeFetch && !this.mx_cancelBeforeFetch) {
5805
+ return this.beforeFetch({
5806
+ payload,
5807
+ resolve: payload => resolve(payload),
5808
+ done: () => {
5809
+ this.mx_cancelBeforeFetch = true;
5810
+ }
5811
+ })
5812
+ }
5813
+
5814
+ resolve();
5268
5815
  }
5269
5816
  }
5270
5817
  };
@@ -5309,7 +5856,7 @@ var script$k = {
5309
5856
  type: Object
5310
5857
  },
5311
5858
 
5312
- showDialogOnUnsavedChanges: {
5859
+ useDialogOnUnsavedChanges: {
5313
5860
  default: true,
5314
5861
  type: Boolean
5315
5862
  },
@@ -5346,6 +5893,11 @@ var script$k = {
5346
5893
  useSubmitButton: {
5347
5894
  default: true,
5348
5895
  type: Boolean
5896
+ },
5897
+
5898
+ beforeSubmit: {
5899
+ default: null,
5900
+ type: Function
5349
5901
  }
5350
5902
  },
5351
5903
 
@@ -5362,7 +5914,6 @@ var script$k = {
5362
5914
  data () {
5363
5915
  return {
5364
5916
  cachedResult: {},
5365
- hasResult: false,
5366
5917
  isSubmitting: false,
5367
5918
  showDialog: false,
5368
5919
  ignoreRouterGuard: false,
@@ -5419,25 +5970,17 @@ var script$k = {
5419
5970
  },
5420
5971
 
5421
5972
  watch: {
5422
- mx_fields (fields) {
5423
- const models = { ...this.getModelsByFields(fields), ...this.modelValue };
5424
-
5425
- this.$emit('update:modelValue', models);
5426
-
5427
- if (!this.hasResult && this.showDialogOnUnsavedChanges) {
5428
- this.cachedResult = extend(true, {}, models);
5429
- }
5430
- },
5431
-
5432
5973
  isSubmitting (value) {
5433
5974
  this.$emit('update:submitting', value);
5434
5975
  }
5435
5976
  },
5436
5977
 
5437
5978
  created () {
5438
- onBeforeRouteLeave(this.beforeRouteLeave);
5979
+ this.useDialogOnUnsavedChanges && onBeforeRouteLeave(this.beforeRouteLeave);
5980
+
5439
5981
  window.addEventListener('delete-success', this.setIgnoreRouterGuard);
5440
- this.fetch();
5982
+
5983
+ this.mx_fetchHandler({ form: true, id: this.id, url: this.fetchURL }, this.fetchSingle);
5441
5984
  },
5442
5985
 
5443
5986
  onUnmounted () {
@@ -5450,13 +5993,13 @@ var script$k = {
5450
5993
  const clonedCachedResult = extend(true, {}, this.cachedResult);
5451
5994
 
5452
5995
  /**
5453
- * Se a propriedade "showDialogOnUnsavedChanges" for false ou a variável
5996
+ * Se a propriedade "useDialogOnUnsavedChanges" for false ou a variável
5454
5997
  * "ignoreRouterGuard" for true, então **não** iremos checar se o usuário
5455
5998
  * alterou algum campo antes de sair da pagina, senão iremos validar pela função isEqualWith
5456
5999
  * e mostrar um dialog antes do usuário sair da página.
5457
6000
  */
5458
6001
  if (
5459
- !this.showDialogOnUnsavedChanges ||
6002
+ !this.useDialogOnUnsavedChanges ||
5460
6003
  this.ignoreRouterGuard ||
5461
6004
  isEqualWith(
5462
6005
  clonedModelValue,
@@ -5467,6 +6010,11 @@ var script$k = {
5467
6010
  return next()
5468
6011
  }
5469
6012
 
6013
+ this.$qas.logger.group(
6014
+ 'QasFormView - beforeRouteLeave -> dialog chamado, modelValue diferente do cachedResult',
6015
+ [{ modelValue: clonedModelValue, cachedResult: clonedCachedResult }]
6016
+ );
6017
+
5470
6018
  this.handleDialog(() => {
5471
6019
  this.ignoreRouterGuard = true;
5472
6020
  next();
@@ -5474,45 +6022,64 @@ var script$k = {
5474
6022
  },
5475
6023
 
5476
6024
  cancel () {
5477
- if (!this.dialog) {
5478
- this.handleCancelRoute();
5479
- }
6025
+ this.handleCancelRoute();
5480
6026
  },
5481
6027
 
5482
- async fetch (params) {
6028
+ async fetchSingle (externalPayload = {}) {
5483
6029
  this.mx_isFetching = true;
5484
6030
 
5485
6031
  try {
5486
- const response = await this.$store.dispatch(
5487
- `${this.entity}/fetchSingle`, { form: true, id: this.id, params, url: this.fetchURL }
6032
+ const payload = {
6033
+ form: true,
6034
+ id: this.id,
6035
+ url: this.fetchURL,
6036
+ ...externalPayload
6037
+ };
6038
+
6039
+ this.$qas.logger.group(
6040
+ `QasFormView - fetchSingle -> payload do parâmetro do ${this.entity}/fetchSingle`, [payload]
5488
6041
  );
5489
6042
 
6043
+ const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
6044
+
5490
6045
  const { errors, fields, metadata, result } = response.data;
5491
6046
 
6047
+ const modelValue = { ...this.getModelsByFields(fields), ...this.modelValue };
6048
+
5492
6049
  this.mx_setErrors(errors);
5493
6050
  this.mx_setFields(fields);
5494
6051
  this.mx_setMetadata(metadata);
5495
6052
 
5496
6053
  this.mx_updateModels({
5497
- errors: errors,
6054
+ errors,
5498
6055
  fields: this.mx_fields,
5499
6056
  metadata
5500
6057
  });
5501
6058
 
5502
- if (result) {
5503
- this.hasResult = true;
6059
+ result && Object.assign(modelValue, result);
5504
6060
 
5505
- this.$nextTick(() => {
5506
- this.$emit('update:modelValue', { ...this.modelValue, ...result });
5507
- });
6061
+ this.$qas.logger.group(
6062
+ `QasFormView - fetchSingle -> resposta da action ${this.entity}/fetchSingle`, [response]
6063
+ );
5508
6064
 
5509
- this.cachedResult = this.showDialogOnUnsavedChanges && extend(true, {}, result);
6065
+ if (this.useDialogOnUnsavedChanges) {
6066
+ this.cachedResult = extend(true, {}, result || modelValue);
6067
+ this.$qas.logger.group('QasFormView - fetchSingle -> cachedResult', [this.cachedResult]);
5510
6068
  }
5511
6069
 
6070
+ this.$emit('update:modelValue', modelValue);
5512
6071
  this.$emit('fetch-success', response, this.modelValue);
6072
+
6073
+ this.$qas.logger.group('QasFormView - fetchSingle -> modelValue', [modelValue]);
5513
6074
  } catch (error) {
5514
6075
  this.mx_fetchError(error);
5515
6076
  this.$emit('fetch-error', error);
6077
+
6078
+ this.$qas.logger.group(
6079
+ `QasFormView - fetchSingle -> exceção da action ${this.entity}/fetchSingle`,
6080
+ [error],
6081
+ { error: true }
6082
+ );
5516
6083
  } finally {
5517
6084
  this.mx_isFetching = false;
5518
6085
  }
@@ -5549,6 +6116,7 @@ var script$k = {
5549
6116
  const { addRoute } = useHistory();
5550
6117
 
5551
6118
  this.defaultDialogProps.ok.onClick = () => addRoute(this.$route);
6119
+
5552
6120
  this.defaultDialogProps.cancel.onClick = next;
5553
6121
  },
5554
6122
 
@@ -5568,33 +6136,66 @@ var script$k = {
5568
6136
  });
5569
6137
  },
5570
6138
 
5571
- async submit (event) {
5572
- if (this.disable) return null
5573
-
6139
+ /**
6140
+ * Se existe a propriedade com callback "beforeSubmit", então o controle de quando e como chamar o método "submit"
6141
+ * está sendo controlado fora do QasFormView, se não existir a propriedade "beforeSubmit", então o controle do método
6142
+ * submit é feito pelo próprio QasFormView, chamado pelo evento @submit.
6143
+ */
6144
+ submitHandler (event) {
5574
6145
  if (event) {
5575
6146
  event.preventDefault();
5576
6147
  }
5577
6148
 
6149
+ const hasBeforeSubmit = typeof this.beforeSubmit === 'function';
6150
+
6151
+ if (hasBeforeSubmit) {
6152
+ return this.beforeSubmit({
6153
+ payload: { id: this.id, payload: this.modelValue, url: this.url },
6154
+ resolve: payload => this.submit(payload)
6155
+ })
6156
+ }
6157
+
6158
+ this.submit();
6159
+ },
6160
+
6161
+ async submit (externalPayload = {}) {
6162
+ if (this.disable) return null
6163
+
5578
6164
  this.isSubmitting = true;
5579
6165
 
5580
6166
  try {
5581
- const response = await this.$store.dispatch(
5582
- `${this.entity}/${this.mode}`,
5583
- { id: this.id, payload: this.modelValue, url: this.url }
6167
+ const payload = {
6168
+ id: this.id,
6169
+ payload: this.modelValue,
6170
+ url: this.url,
6171
+ ...externalPayload
6172
+ };
6173
+
6174
+ this.$qas.logger.group(
6175
+ `QasFormView - submit -> payload do ${this.entity}/${this.mode}`, [payload]
5584
6176
  );
5585
6177
 
5586
- if (this.showDialogOnUnsavedChanges) {
6178
+ const response = await this.$store.dispatch(`${this.entity}/${this.mode}`, payload);
6179
+
6180
+ if (this.useDialogOnUnsavedChanges) {
5587
6181
  this.cachedResult = extend(true, {}, this.modelValue);
5588
6182
  }
5589
6183
 
5590
6184
  this.mx_setErrors();
5591
6185
  NotifySuccess(response.data.status.text || 'Item salvo com sucesso!');
5592
6186
  this.$emit('submit-success', response, this.modelValue);
6187
+
6188
+ this.$qas.logger.group(
6189
+ `QasFormView - submit -> resposta da action ${this.entity}/${this.mode}`, [response]
6190
+ );
5593
6191
  } catch (error) {
5594
6192
  const errors = error?.response?.data?.errors;
5595
6193
  const message = error?.response?.data?.status?.text;
5596
6194
  const exceptionResponse = error?.response?.data?.exception;
5597
- const exception = errors ? 'Existem erros de validação no formulário.' : exceptionResponse || error.message;
6195
+
6196
+ const exception = errors
6197
+ ? 'Existem erros de validação no formulário.'
6198
+ : exceptionResponse || error.message;
5598
6199
 
5599
6200
  this.mx_setErrors(errors);
5600
6201
  this.$emit('update:errors', this.mx_errors);
@@ -5602,6 +6203,12 @@ var script$k = {
5602
6203
  NotifyError(message || 'Ops! Erro ao salvar item.', exception);
5603
6204
 
5604
6205
  this.$emit('submit-error', error);
6206
+
6207
+ this.$qas.logger.group(
6208
+ `QasFormView - submit -> exceção da action ${this.entity}/${this.mode}`,
6209
+ [error],
6210
+ { error: true }
6211
+ );
5605
6212
  } finally {
5606
6213
  this.isSubmitting = false;
5607
6214
  }
@@ -5613,7 +6220,7 @@ var script$k = {
5613
6220
  }
5614
6221
  };
5615
6222
 
5616
- const _hoisted_1$d = { key: 0 };
6223
+ const _hoisted_1$e = { key: 0 };
5617
6224
  const _hoisted_2$9 = { class: "justify-end q-col-gutter-md q-my-lg row" };
5618
6225
  const _hoisted_3$6 = { key: 1 };
5619
6226
 
@@ -5630,13 +6237,13 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
5630
6237
  }, {
5631
6238
  default: withCtx(() => [
5632
6239
  (_ctx.mx_hasHeaderSlot)
5633
- ? (openBlock(), createElementBlock("header", _hoisted_1$d, [
6240
+ ? (openBlock(), createElementBlock("header", _hoisted_1$e, [
5634
6241
  renderSlot(_ctx.$slots, "header")
5635
6242
  ]))
5636
6243
  : createCommentVNode("v-if", true),
5637
6244
  createVNode(_component_q_form, {
5638
6245
  ref: "form",
5639
- onSubmit: $options.submit
6246
+ onSubmit: $options.submitHandler
5640
6247
  }, {
5641
6248
  default: withCtx(() => [
5642
6249
  renderSlot(_ctx.$slots, "default"),
@@ -5657,7 +6264,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
5657
6264
  type: "button",
5658
6265
  onClick: $options.cancel
5659
6266
  }, null, 8 /* PROPS */, ["data-cy", "disable", "label", "onClick"]), [
5660
- [_directive_close_popup, _ctx.dialog]
6267
+ [_directive_close_popup]
5661
6268
  ])
5662
6269
  ], 2 /* CLASS */))
5663
6270
  : createCommentVNode("v-if", true),
@@ -5827,7 +6434,7 @@ var script$j = {
5827
6434
  }
5828
6435
  };
5829
6436
 
5830
- const _hoisted_1$c = { class: "q-col-gutter-md row" };
6437
+ const _hoisted_1$d = { class: "q-col-gutter-md row" };
5831
6438
  const _hoisted_2$8 = {
5832
6439
  key: 0,
5833
6440
  class: "full-width text-center"
@@ -5849,7 +6456,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
5849
6456
 
5850
6457
  return (openBlock(), createBlock(_component_qas_box, { class: "gallery" }, {
5851
6458
  default: withCtx(() => [
5852
- createElementVNode("div", _hoisted_1$c, [
6459
+ createElementVNode("div", _hoisted_1$d, [
5853
6460
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.initialImages(), (image, index) => {
5854
6461
  return (openBlock(), createElementBlock("div", {
5855
6462
  key: index,
@@ -5971,10 +6578,6 @@ var script$i = {
5971
6578
  type: [Array, Object, String]
5972
6579
  },
5973
6580
 
5974
- hideEmptyResult: {
5975
- type: Boolean
5976
- },
5977
-
5978
6581
  emptyResultText: {
5979
6582
  default: '-',
5980
6583
  type: String
@@ -5983,6 +6586,11 @@ var script$i = {
5983
6586
  result: {
5984
6587
  default: () => ({}),
5985
6588
  type: Object
6589
+ },
6590
+
6591
+ useEmptyResult: {
6592
+ default: true,
6593
+ type: Boolean
5986
6594
  }
5987
6595
  },
5988
6596
 
@@ -5994,7 +6602,12 @@ var script$i = {
5994
6602
 
5995
6603
  computed: {
5996
6604
  formattedFields () {
5997
- if (!this.hideEmptyResult) {
6605
+ if (this.useEmptyResult) {
6606
+ this.$qas.logger.group(
6607
+ 'QasGridGenerator - formattedFields -> this.useEmptyResult tem valor "true"',
6608
+ [this.fields]
6609
+ );
6610
+
5998
6611
  return this.fields
5999
6612
  }
6000
6613
 
@@ -6012,6 +6625,8 @@ var script$i = {
6012
6625
  }
6013
6626
  }
6014
6627
 
6628
+ this.$qas.logger.group('QasGridGenerator - formattedFields', [fields]);
6629
+
6015
6630
  return fields
6016
6631
  },
6017
6632
 
@@ -6027,11 +6642,19 @@ var script$i = {
6027
6642
 
6028
6643
  for (const key in result) {
6029
6644
  if (this.formattedFields[key]?.type) {
6030
- formattedResult[key] = humanize(this.formattedFields[key], result[key]) || this.emptyResultText;
6031
- this.slotValue[key] = { ...this.formattedFields[key], formattedResult: formattedResult[key] };
6645
+ formattedResult[key] = (
6646
+ humanize(this.formattedFields[key], result[key]) || this.emptyResultText
6647
+ );
6648
+
6649
+ this.slotValue[key] = {
6650
+ ...this.formattedFields[key],
6651
+ formattedResult: formattedResult[key]
6652
+ };
6032
6653
  }
6033
6654
  }
6034
6655
 
6656
+ this.$qas.logger.group('QasGridGenerator - getResultsByFields', [formattedResult]);
6657
+
6035
6658
  return formattedResult
6036
6659
  }
6037
6660
  }
@@ -6167,6 +6790,10 @@ var script$g = {
6167
6790
  }
6168
6791
  },
6169
6792
 
6793
+ mounted () {
6794
+ this.menuDrawer = !this.$qas.screen.untilMedium;
6795
+ },
6796
+
6170
6797
  methods: {
6171
6798
  toggleMenuDrawer () {
6172
6799
  this.menuDrawer = !this.menuDrawer;
@@ -6227,42 +6854,34 @@ var script$f = {
6227
6854
  type: Array
6228
6855
  },
6229
6856
 
6230
- redirectKey: {
6231
- default: 'uuid',
6232
- type: String
6233
- },
6234
-
6235
- redirectOnIcon: {
6236
- default: true,
6857
+ useClickableItem: {
6237
6858
  type: Boolean
6238
6859
  },
6239
6860
 
6240
- to: {
6241
- default: () => ({}),
6242
- type: Object
6243
- },
6244
-
6245
6861
  useSectionActions: {
6246
6862
  default: true,
6247
6863
  type: Boolean
6248
6864
  }
6249
6865
  },
6250
6866
 
6867
+ emits: ['click-item'],
6868
+
6251
6869
  methods: {
6252
- getRedirectPayload (item) {
6253
- return {
6254
- params: { [this.redirectKey]: item[this.redirectKey] },
6255
- ...this.to
6256
- }
6257
- },
6870
+ onClick ({ item, index }, fromItem) {
6871
+ /**
6872
+ * se o click veio do q-item e "useClickableItem" for "false", ou
6873
+ * se o click não veio do q-item e "useClickableItem" for "true", então retorna sem emitir.
6874
+ */
6875
+ if (
6876
+ (fromItem && !this.useClickableItem) || (!fromItem && this.useClickableItem)
6877
+ ) return
6258
6878
 
6259
- redirect (item) {
6260
- return this.redirectOnIcon ? undefined : this.getRedirectPayload(item)
6879
+ this.$emit('click-item', { item, index });
6261
6880
  }
6262
6881
  }
6263
6882
  };
6264
6883
 
6265
- const _hoisted_1$b = { class: "qas-list-items shadow-14" };
6884
+ const _hoisted_1$c = { class: "qas-list-items shadow-14" };
6266
6885
 
6267
6886
  function render$f(_ctx, _cache, $props, $setup, $data, $options) {
6268
6887
  const _component_q_item_section = resolveComponent("q-item-section");
@@ -6272,7 +6891,7 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
6272
6891
  const _component_q_list = resolveComponent("q-list");
6273
6892
  const _directive_ripple = resolveDirective("ripple");
6274
6893
 
6275
- return (openBlock(), createElementBlock("div", _hoisted_1$b, [
6894
+ return (openBlock(), createElementBlock("div", _hoisted_1$c, [
6276
6895
  createVNode(_component_q_list, {
6277
6896
  bordered: "",
6278
6897
  class: "rounded-borders",
@@ -6282,8 +6901,8 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
6282
6901
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.list, (item, index) => {
6283
6902
  return withDirectives((openBlock(), createBlock(_component_q_item, {
6284
6903
  key: index,
6285
- clickable: !$props.redirectOnIcon,
6286
- to: $options.redirect(item)
6904
+ clickable: $props.useClickableItem,
6905
+ onClick: $event => ($options.onClick({ item, index }, true))
6287
6906
  }, {
6288
6907
  default: withCtx(() => [
6289
6908
  renderSlot(_ctx.$slots, "item", {
@@ -6292,7 +6911,7 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
6292
6911
  }, () => [
6293
6912
  createVNode(_component_q_item_section, null, {
6294
6913
  default: withCtx(() => [
6295
- renderSlot(_ctx.$slots, "item-section-left", {
6914
+ renderSlot(_ctx.$slots, "item-section", {
6296
6915
  index: index,
6297
6916
  item: item
6298
6917
  })
@@ -6312,13 +6931,13 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
6312
6931
  createVNode(_component_qas_btn, {
6313
6932
  flat: "",
6314
6933
  round: "",
6315
- to: $options.getRedirectPayload(item)
6934
+ onClick: $event => ($options.onClick({ item, index }))
6316
6935
  }, {
6317
6936
  default: withCtx(() => [
6318
6937
  createVNode(_component_q_icon, normalizeProps(guardReactiveProps($props.iconProps)), null, 16 /* FULL_PROPS */)
6319
6938
  ]),
6320
6939
  _: 2 /* DYNAMIC */
6321
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["to"])
6940
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])
6322
6941
  ])
6323
6942
  ]),
6324
6943
  _: 2 /* DYNAMIC */
@@ -6327,7 +6946,7 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
6327
6946
  ])
6328
6947
  ]),
6329
6948
  _: 2 /* DYNAMIC */
6330
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["clickable", "to"])), [
6949
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["clickable", "onClick"])), [
6331
6950
  [_directive_ripple]
6332
6951
  ])
6333
6952
  }), 128 /* KEYED_FRAGMENT */))
@@ -6348,15 +6967,6 @@ var script$e = {
6348
6967
  mixins: [contextMixin, viewMixin],
6349
6968
 
6350
6969
  props: {
6351
- disableRefresh: {
6352
- type: Boolean
6353
- },
6354
-
6355
- useFilter: {
6356
- default: true,
6357
- type: Boolean
6358
- },
6359
-
6360
6970
  filtersProps: {
6361
6971
  default: () => ({}),
6362
6972
  type: Object
@@ -6365,6 +6975,20 @@ var script$e = {
6365
6975
  results: {
6366
6976
  default: () => [],
6367
6977
  type: Array
6978
+ },
6979
+
6980
+ useRefresh: {
6981
+ default: true,
6982
+ type: Boolean
6983
+ },
6984
+
6985
+ useFilter: {
6986
+ default: true,
6987
+ type: Boolean
6988
+ },
6989
+
6990
+ useResultsAreaOnly: {
6991
+ type: Boolean
6368
6992
  }
6369
6993
  },
6370
6994
 
@@ -6400,13 +7024,17 @@ var script$e = {
6400
7024
 
6401
7025
  totalPages () {
6402
7026
  return this.$store.getters[`${this.entity}/totalPages`]
7027
+ },
7028
+
7029
+ showResults () {
7030
+ return this.hasResults || this.useResultsAreaOnly
6403
7031
  }
6404
7032
  },
6405
7033
 
6406
7034
  watch: {
6407
7035
  $route (to, from) {
6408
7036
  if (to.name === from.name) {
6409
- this.fetchList();
7037
+ this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
6410
7038
  this.setCurrentPage();
6411
7039
  }
6412
7040
  },
@@ -6421,7 +7049,8 @@ var script$e = {
6421
7049
  },
6422
7050
 
6423
7051
  created () {
6424
- this.fetchList();
7052
+ this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
7053
+
6425
7054
  this.setCurrentPage();
6426
7055
  },
6427
7056
 
@@ -6431,21 +7060,22 @@ var script$e = {
6431
7060
  this.$router.push({ query });
6432
7061
  },
6433
7062
 
6434
- async fetchList (filters = {}) {
7063
+ async fetchList (externalPayload = {}) {
6435
7064
  this.mx_isFetching = true;
6436
7065
 
6437
- const hasFilters = !!Object.keys(filters).length;
6438
-
6439
7066
  try {
6440
- const response = await this.$store.dispatch(
6441
- `${this.entity}/fetchList`,
6442
- {
6443
- ...this.mx_context,
6444
- url: this.url,
6445
- ...(hasFilters && { filters })
6446
- }
7067
+ const payload = {
7068
+ ...this.mx_context,
7069
+ url: this.url,
7070
+ ...externalPayload
7071
+ };
7072
+
7073
+ this.$qas.logger.group(
7074
+ `QasListView - fetchList -> Payload do parâmetro do ${this.entity}/fetchList`, [payload]
6447
7075
  );
6448
7076
 
7077
+ const response = await this.$store.dispatch(`${this.entity}/fetchList`, payload);
7078
+
6449
7079
  const { errors, fields, metadata } = response.data;
6450
7080
 
6451
7081
  this.mx_setErrors(errors);
@@ -6459,17 +7089,27 @@ var script$e = {
6459
7089
  });
6460
7090
 
6461
7091
  this.$emit('fetch-success', response);
7092
+
7093
+ this.$qas.logger.group(
7094
+ `QasListView - fetchList -> resposta da action ${this.entity}/fetchList`, [response]
7095
+ );
6462
7096
  } catch (error) {
6463
7097
  this.mx_fetchError(error);
6464
7098
  this.$emit('update:errors', error);
6465
7099
  this.$emit('fetch-error', error);
7100
+
7101
+ this.$qas.logger.group(
7102
+ `QasListView - fetchSingle -> exceção da action ${this.entity}/fetchList`,
7103
+ [error],
7104
+ { error: true }
7105
+ );
6466
7106
  } finally {
6467
7107
  this.mx_isFetching = false;
6468
7108
  }
6469
7109
  },
6470
7110
 
6471
7111
  async refresh (done) {
6472
- await this.fetchList();
7112
+ await this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
6473
7113
 
6474
7114
  if (typeof done === 'function') {
6475
7115
  done();
@@ -6482,7 +7122,7 @@ var script$e = {
6482
7122
  }
6483
7123
  };
6484
7124
 
6485
- const _hoisted_1$a = { key: 0 };
7125
+ const _hoisted_1$b = { key: 0 };
6486
7126
  const _hoisted_2$7 = { class: "relative-position" };
6487
7127
  const _hoisted_3$4 = { key: 0 };
6488
7128
  const _hoisted_4$4 = { key: 1 };
@@ -6510,12 +7150,12 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
6510
7150
  }, {
6511
7151
  default: withCtx(() => [
6512
7152
  createVNode(_component_q_pull_to_refresh, {
6513
- disable: $props.disableRefresh,
7153
+ disable: !$props.useRefresh,
6514
7154
  onRefresh: $options.refresh
6515
7155
  }, {
6516
7156
  default: withCtx(() => [
6517
7157
  ($options.hasHeaderSlot)
6518
- ? (openBlock(), createElementBlock("header", _hoisted_1$a, [
7158
+ ? (openBlock(), createElementBlock("header", _hoisted_1$b, [
6519
7159
  renderSlot(_ctx.$slots, "header")
6520
7160
  ]))
6521
7161
  : createCommentVNode("v-if", true),
@@ -6525,7 +7165,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
6525
7165
  ])
6526
7166
  : createCommentVNode("v-if", true),
6527
7167
  createElementVNode("main", _hoisted_2$7, [
6528
- ($options.hasResults)
7168
+ ($options.showResults)
6529
7169
  ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
6530
7170
  renderSlot(_ctx.$slots, "default")
6531
7171
  ]))
@@ -6602,13 +7242,13 @@ var script$d = {
6602
7242
  default: () => []
6603
7243
  },
6604
7244
 
6605
- usePopup: {
6606
- type: Boolean
6607
- },
6608
-
6609
7245
  zoom: {
6610
7246
  type: Number,
6611
7247
  default: 17
7248
+ },
7249
+
7250
+ usePopup: {
7251
+ type: Boolean
6612
7252
  }
6613
7253
  },
6614
7254
 
@@ -6642,7 +7282,7 @@ var script$d = {
6642
7282
  }
6643
7283
  };
6644
7284
 
6645
- const _hoisted_1$9 = { class: "qas-map" };
7285
+ const _hoisted_1$a = { class: "qas-map" };
6646
7286
  const _hoisted_2$6 = { class: "text-weight-bold" };
6647
7287
 
6648
7288
  function render$d(_ctx, _cache, $props, $setup, $data, $options) {
@@ -6650,7 +7290,7 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
6650
7290
  const _component_g_map_marker = resolveComponent("g-map-marker");
6651
7291
  const _component_g_map_map = resolveComponent("g-map-map");
6652
7292
 
6653
- return (openBlock(), createElementBlock("div", _hoisted_1$9, [
7293
+ return (openBlock(), createElementBlock("div", _hoisted_1$a, [
6654
7294
  createVNode(_component_g_map_map, {
6655
7295
  center: $props.centerPosition,
6656
7296
  class: "qas-map__draw",
@@ -6709,7 +7349,7 @@ var script$c = {
6709
7349
  default: 'Inserir novo campo'
6710
7350
  },
6711
7351
 
6712
- btnDestroyProps: {
7352
+ buttonDestroyProps: {
6713
7353
  type: Object,
6714
7354
  default: () => {
6715
7355
  return {
@@ -6721,14 +7361,14 @@ var script$c = {
6721
7361
  }
6722
7362
  },
6723
7363
 
6724
- btnDuplicateProps: {
7364
+ buttonDuplicateProps: {
6725
7365
  type: Object,
6726
7366
  default: () => {
6727
7367
  return {
6728
7368
  label: 'Duplicar',
6729
7369
  icon: 'o_content_copy',
6730
7370
  flat: true,
6731
- hideMobileLabel: true,
7371
+ useLabelOnSmallScreen: false,
6732
7372
  dense: true
6733
7373
  }
6734
7374
  }
@@ -6773,6 +7413,11 @@ var script$c = {
6773
7413
  }
6774
7414
  },
6775
7415
 
7416
+ identifierItemKey: {
7417
+ type: String,
7418
+ default: 'uuid'
7419
+ },
7420
+
6776
7421
  rowLabel: {
6777
7422
  type: String,
6778
7423
  default: ''
@@ -6838,13 +7483,7 @@ var script$c = {
6838
7483
  },
6839
7484
 
6840
7485
  children () {
6841
- const field = extend(true, {}, this.field);
6842
-
6843
- for (const key in field?.children) {
6844
- field.children[key].name = camelize(field?.children[key].name);
6845
- }
6846
-
6847
- return field?.children
7486
+ return this.field?.children
6848
7487
  },
6849
7488
 
6850
7489
  showDestroyBtn () {
@@ -6871,8 +7510,7 @@ var script$c = {
6871
7510
 
6872
7511
  return {
6873
7512
  tag: 'div',
6874
- enterActiveClass: 'animated slideInDown',
6875
- leaveActiveClass: 'animated slideOutUp'
7513
+ enterActiveClass: 'animated slideInDown'
6876
7514
  }
6877
7515
  }
6878
7516
  },
@@ -6885,9 +7523,9 @@ var script$c = {
6885
7523
  immediate: true
6886
7524
  },
6887
7525
 
6888
- field: {
7526
+ rowObject: {
6889
7527
  handler () {
6890
- !this.modelValue.length && this.setDefaultNestedValue();
7528
+ if (!this.nested.length) return this.setDefaultNestedValue()
6891
7529
  },
6892
7530
  immediate: true
6893
7531
  }
@@ -6895,13 +7533,22 @@ var script$c = {
6895
7533
 
6896
7534
  methods: {
6897
7535
  add (row = {}) {
6898
- this.nested.push({ ...this.rowObject, ...row });
7536
+ const payload = { ...this.rowObject, ...row };
7537
+ const hasIdentifierKey = payload[this.identifierItemKey];
7538
+
7539
+ if (hasIdentifierKey) {
7540
+ delete payload[this.identifierItemKey];
7541
+ }
7542
+
7543
+ this.nested.push(payload);
6899
7544
 
6900
7545
  this.$nextTick(() => {
6901
7546
  this.useAnimation && this.setScroll();
6902
7547
  this.setFocus();
6903
7548
  });
6904
7549
 
7550
+ this.$qas.logger.group('QasNestedFields - add', [payload]);
7551
+
6905
7552
  return this.updateModelValue()
6906
7553
  },
6907
7554
 
@@ -6917,10 +7564,12 @@ var script$c = {
6917
7564
  },
6918
7565
 
6919
7566
  destroy (index, row) {
6920
- this.useRemoveOnDestroy
7567
+ !row[this.identifierItemKey] && this.useRemoveOnDestroy
6921
7568
  ? this.nested.splice(index, 1)
6922
7569
  : this.nested.splice(index, 1, { [this.destroyKey]: true, ...row });
6923
7570
 
7571
+ this.$qas.logger.group('QasNestedFields - destroy', [{ index, row }]);
7572
+
6924
7573
  return this.updateModelValue()
6925
7574
  },
6926
7575
 
@@ -6946,7 +7595,7 @@ var script$c = {
6946
7595
  });
6947
7596
  },
6948
7597
 
6949
- setRowLabel (rowKey) {
7598
+ getRowLabel (rowKey) {
6950
7599
  if (this.rowLabel) {
6951
7600
  return this.useIndexLabel ? `${this.rowLabel} ${rowKey + 1}` : this.rowLabel
6952
7601
  }
@@ -6956,7 +7605,7 @@ var script$c = {
6956
7605
  }
6957
7606
  };
6958
7607
 
6959
- const _hoisted_1$8 = ["id"];
7608
+ const _hoisted_1$9 = ["id"];
6960
7609
  const _hoisted_2$5 = { class: "text-left" };
6961
7610
  const _hoisted_3$3 = { ref: "inputContent" };
6962
7611
  const _hoisted_4$3 = ["id"];
@@ -7017,18 +7666,18 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
7017
7666
  (!$props.useSingleLabel)
7018
7667
  ? (openBlock(), createBlock(_component_qas_label, {
7019
7668
  key: 0,
7020
- label: $options.setRowLabel(index)
7669
+ label: $options.getRowLabel(index)
7021
7670
  }, null, 8 /* PROPS */, ["label"]))
7022
7671
  : createCommentVNode("v-if", true),
7023
7672
  (!$props.useInlineActions)
7024
7673
  ? (openBlock(), createElementBlock("div", _hoisted_6, [
7025
7674
  ($props.useDuplicate)
7026
- ? (openBlock(), createBlock(_component_qas_btn, mergeProps({ key: 0 }, $props.btnDuplicateProps, {
7675
+ ? (openBlock(), createBlock(_component_qas_btn, mergeProps({ key: 0 }, $props.buttonDuplicateProps, {
7027
7676
  onClick: $event => ($options.add(row))
7028
7677
  }), null, 16 /* FULL_PROPS */, ["onClick"]))
7029
7678
  : createCommentVNode("v-if", true),
7030
7679
  ($options.showDestroyBtn)
7031
- ? (openBlock(), createBlock(_component_qas_btn, mergeProps({ key: 1 }, $props.btnDestroyProps, {
7680
+ ? (openBlock(), createBlock(_component_qas_btn, mergeProps({ key: 1 }, $props.buttonDestroyProps, {
7032
7681
  onClick: $event => ($options.destroy(index, row))
7033
7682
  }), null, 16 /* FULL_PROPS */, ["onClick"]))
7034
7683
  : createCommentVNode("v-if", true)
@@ -7155,7 +7804,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
7155
7804
  ])
7156
7805
  ])
7157
7806
  ], 512 /* NEED_PATCH */)
7158
- ], 8 /* PROPS */, _hoisted_1$8))
7807
+ ], 8 /* PROPS */, _hoisted_1$9))
7159
7808
  }
7160
7809
 
7161
7810
  script$c.render = render$c;
@@ -7166,17 +7815,20 @@ const { hasPreviousRoute, history: history$1, getPreviousRoute } = useHistory();
7166
7815
  var script$b = {
7167
7816
  name: 'QasPageHeader',
7168
7817
 
7818
+ mixins: [
7819
+ createMetaMixin(function () {
7820
+ return {
7821
+ title: this.title
7822
+ }
7823
+ })
7824
+ ],
7825
+
7169
7826
  props: {
7170
7827
  breadcrumbs: {
7171
7828
  default: '',
7172
7829
  type: [Array, String]
7173
7830
  },
7174
7831
 
7175
- useBreadcrumbs: {
7176
- default: true,
7177
- type: Boolean
7178
- },
7179
-
7180
7832
  root: {
7181
7833
  default: '',
7182
7834
  type: [Object, String]
@@ -7185,6 +7837,11 @@ var script$b = {
7185
7837
  title: {
7186
7838
  default: '',
7187
7839
  type: String
7840
+ },
7841
+
7842
+ useBreadcrumbs: {
7843
+ default: true,
7844
+ type: Boolean
7188
7845
  }
7189
7846
  },
7190
7847
 
@@ -7228,16 +7885,10 @@ var script$b = {
7228
7885
 
7229
7886
  return lastIndex === index ? 'text-grey-7' : 'text-primary'
7230
7887
  }
7231
- },
7232
-
7233
- meta () {
7234
- return {
7235
- title: this.title
7236
- }
7237
7888
  }
7238
7889
  };
7239
7890
 
7240
- const _hoisted_1$7 = { class: "ellipsis" };
7891
+ const _hoisted_1$8 = { class: "ellipsis" };
7241
7892
 
7242
7893
  function render$b(_ctx, _cache, $props, $setup, $data, $options) {
7243
7894
  const _component_q_icon = resolveComponent("q-icon");
@@ -7248,7 +7899,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
7248
7899
 
7249
7900
  return (openBlock(), createBlock(_component_q_toolbar, { class: "justify-between q-mb-lg q-px-none" }, {
7250
7901
  default: withCtx(() => [
7251
- createElementVNode("div", _hoisted_1$7, [
7902
+ createElementVNode("div", _hoisted_1$8, [
7252
7903
  ($props.title)
7253
7904
  ? (openBlock(), createBlock(_component_q_toolbar_title, {
7254
7905
  key: 0,
@@ -7364,7 +8015,7 @@ var script$a = {
7364
8015
  }
7365
8016
  };
7366
8017
 
7367
- const _hoisted_1$6 = { class: "q-col-gutter-md row" };
8018
+ const _hoisted_1$7 = { class: "q-col-gutter-md row" };
7368
8019
  const _hoisted_2$4 = { class: "col-lg-5 col-xs-12" };
7369
8020
  const _hoisted_3$2 = { class: "justify-center lg:q-mb-none md:q-mr-lg row xs:q-mb-md" };
7370
8021
  const _hoisted_4$2 = { class: "text-bold text-h6" };
@@ -7376,7 +8027,7 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
7376
8027
 
7377
8028
  return (openBlock(), createBlock(resolveDynamicComponent($props.tag), null, {
7378
8029
  default: withCtx(() => [
7379
- createElementVNode("div", _hoisted_1$6, [
8030
+ createElementVNode("div", _hoisted_1$7, [
7380
8031
  createElementVNode("div", _hoisted_2$4, [
7381
8032
  createElementVNode("div", {
7382
8033
  class: normalizeClass(["no-wrap q-col-gutter-md", $options.directionClasses])
@@ -7401,8 +8052,8 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
7401
8052
  class: "col-lg-7 col-xs-12 items-center",
7402
8053
  columns: $props.columns,
7403
8054
  fields: $options.filterObject($props.fields, $props.list),
7404
- "hide-empty-result": "",
7405
- result: $props.result
8055
+ result: $props.result,
8056
+ "use-empty-result": false
7406
8057
  }, createSlots({ _: 2 /* DYNAMIC */ }, [
7407
8058
  renderList(_ctx.$slots, (_, name) => {
7408
8059
  return {
@@ -7502,7 +8153,7 @@ var script$9 = {
7502
8153
  }
7503
8154
  };
7504
8155
 
7505
- const _hoisted_1$5 = /*#__PURE__*/createElementVNode("div", { class: "absolute-full bg-grey-2 flex flex-center text-grey" }, "⚠︎", -1 /* HOISTED */);
8156
+ const _hoisted_1$6 = /*#__PURE__*/createElementVNode("div", { class: "absolute-full bg-grey-2 flex flex-center text-grey" }, "⚠︎", -1 /* HOISTED */);
7506
8157
 
7507
8158
  function render$9(_ctx, _cache, $props, $setup, $data, $options) {
7508
8159
  const _component_q_img = resolveComponent("q-img");
@@ -7513,7 +8164,7 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
7513
8164
  src: $options.imageSource
7514
8165
  }, {
7515
8166
  error: withCtx(() => [
7516
- _hoisted_1$5
8167
+ _hoisted_1$6
7517
8168
  ]),
7518
8169
  _: 1 /* STABLE */
7519
8170
  }, 8 /* PROPS */, ["ratio", "src"]))
@@ -7526,15 +8177,23 @@ var script$8 = {
7526
8177
  name: 'QasSearchBox',
7527
8178
 
7528
8179
  components: {
7529
- QasBox: script$D
8180
+ QasBox: script$D,
8181
+ QInfiniteScroll
7530
8182
  },
7531
8183
 
8184
+ mixins: [searchFilterMixin],
8185
+
7532
8186
  props: {
7533
8187
  emptyListHeight: {
7534
8188
  default: '100px',
7535
8189
  type: String
7536
8190
  },
7537
8191
 
8192
+ emptyResultText: {
8193
+ default: 'Não há resultados disponíveis.',
8194
+ type: String
8195
+ },
8196
+
7538
8197
  fuseOptions: {
7539
8198
  default: () => ({}),
7540
8199
  type: Object
@@ -7579,15 +8238,52 @@ var script$8 = {
7579
8238
 
7580
8239
  data () {
7581
8240
  return {
7582
- fuse: null,
7583
- searchResults: this.list,
7584
- search: ''
8241
+ fuse: null
7585
8242
  }
7586
8243
  },
7587
8244
 
7588
8245
  computed: {
7589
- contentStyle () {
7590
- return { height: this.list.length ? this.height : this.emptyListHeight }
8246
+ attributes () {
8247
+ return {
8248
+ clearable: true,
8249
+ disable: this.isDisabled,
8250
+ debounce: this.useLazyLoading ? 500 : 0,
8251
+ outlined: true,
8252
+ placeholder: this.placeholder,
8253
+ hideBottomSpace: true,
8254
+ error: this.mx_hasFetchError,
8255
+ loading: this.mx_isFetching
8256
+ }
8257
+ },
8258
+
8259
+ containerStyle () {
8260
+ return { height: this.containerHeight }
8261
+ },
8262
+
8263
+ hasNoOptionsOnFirstFetch () {
8264
+ return this.mx_fetchCount === 1 && !this.mx_hasFilteredOptions
8265
+ },
8266
+
8267
+ containerHeight () {
8268
+ const hasEmptyList = (!this.list.length && !this.useLazyLoading) || this.hasNoOptionsOnFirstFetch;
8269
+
8270
+ return hasEmptyList ? this.emptyListHeight : this.height
8271
+ },
8272
+
8273
+ component () {
8274
+ const infiniteScrollProps = {
8275
+ offset: 100,
8276
+ scrollTarget: this.$refs.scrollContainer,
8277
+ ref: 'infiniteScrollRef'
8278
+ };
8279
+
8280
+ return {
8281
+ is: this.useLazyLoading ? 'q-infinite-scroll' : 'div',
8282
+ props: {
8283
+ ...(this.useLazyLoading && infiniteScrollProps),
8284
+ ...(this.useLazyLoading && { onLoad: this.onInfiniteScroll })
8285
+ }
8286
+ }
7591
8287
  },
7592
8288
 
7593
8289
  defaultFuseOptions () {
@@ -7599,85 +8295,127 @@ var script$8 = {
7599
8295
  }
7600
8296
  },
7601
8297
 
7602
- hasResults () {
7603
- return !!this.searchResults.length
8298
+ isDisabled () {
8299
+ return (!this.useLazyLoading && !this.list.length) || this.mx_isFetching || this.hasNoOptionsOnFirstFetch
8300
+ },
8301
+
8302
+ showEmptyResult () {
8303
+ return this.useEmptySlot && !this.mx_hasFilteredOptions && !this.mx_isFetching
8304
+ },
8305
+
8306
+ showSpinnerDots () {
8307
+ return this.mx_hasFilteredOptions && this.mx_isFetching
8308
+ },
8309
+
8310
+ showInnerLoading () {
8311
+ return !this.mx_hasFilteredOptions && this.mx_isFetching
7604
8312
  }
7605
8313
  },
7606
8314
 
7607
8315
  watch: {
7608
8316
  defaultFuseOptions (value) {
8317
+ if (this.useLazyLoading) return
8318
+
7609
8319
  this.fuse.options = { ...this.fuse.options, ...value };
7610
8320
  },
7611
8321
 
7612
- hasResults (value) {
8322
+ mx_hasFilteredOptions (value) {
7613
8323
  !value && this.$emit('empty-result');
7614
8324
  },
7615
8325
 
7616
- list: {
7617
- handler (value) {
7618
- this.fuse = new Fuse(value, this.defaultFuseOptions);
8326
+ mx_search: {
8327
+ async handler (value) {
8328
+ this.$emit('update:modelValue', value);
7619
8329
 
7620
- this.setResults(this.search);
7621
- this.updateResultsModel(value);
7622
- },
8330
+ if (this.useLazyLoading) {
8331
+ await this.mx_filterOptionsByStore(value);
8332
+
8333
+ this.$refs.infiniteScrollRef.resume();
8334
+ this.$refs.search.focus();
8335
+
8336
+ return
8337
+ }
7623
8338
 
7624
- deep: true
8339
+ this.filterOptionsByFuse(value);
8340
+ }
7625
8341
  },
7626
8342
 
7627
- search: {
8343
+ modelValue: {
7628
8344
  handler (value) {
7629
- this.setResults(value);
7630
- this.$emit('update:modelValue', value);
8345
+ this.mx_search = value;
7631
8346
  },
7632
8347
 
7633
8348
  immediate: true
7634
8349
  },
7635
8350
 
7636
- searchResults: {
7637
- handler (value) {
7638
- this.updateResultsModel(value);
8351
+ mx_filteredOptions: {
8352
+ handler (options) {
8353
+ this.$emit('update:results', options);
7639
8354
  },
8355
+
7640
8356
  immediate: true
7641
8357
  }
7642
8358
  },
7643
8359
 
7644
8360
  created () {
7645
- this.search = this.modelValue;
8361
+ if (this.useLazyLoading) return
8362
+
8363
+ this.mx_filteredOptions = this.list;
7646
8364
  this.fuse = new Fuse(this.list, this.defaultFuseOptions);
7647
- this.setResults();
8365
+
8366
+ this.setListWatcher();
7648
8367
  },
7649
8368
 
7650
8369
  methods: {
7651
- setResults (value) {
7652
- this.searchResults = value
7653
- ? this.fuse.search(value)
7654
- : this.list;
8370
+ filterOptionsByFuse (value) {
8371
+ this.mx_filteredOptions = value ? this.mx_getNormalizedFuseResults(this.fuse.search(value)) : this.list;
8372
+ },
8373
+
8374
+ async onInfiniteScroll (_, done) {
8375
+ // Se tiver erro no primeiro fetch, retorna o "done" na proxima.
8376
+ if (((this.mx_hasFetchError && !this.mx_hasFilteredOptions) || this.hasNoOptionsOnFirstFetch)) return done()
8377
+
8378
+ if (!this.mx_hasFilteredOptions && !this.mx_search) {
8379
+ await this.mx_setFetchOptions();
8380
+ return done()
8381
+ }
8382
+
8383
+ if (this.mx_canFetchOptions()) {
8384
+ await this.mx_loadMoreOptions();
8385
+ return done()
8386
+ }
8387
+
8388
+ done(true);
7655
8389
  },
7656
8390
 
7657
- updateResultsModel (value) {
7658
- this.$emit('update:results', value.map(result => result.item || result));
8391
+ setListWatcher () {
8392
+ this.$watch('list', value => {
8393
+ this.fuse = new Fuse(value, this.defaultFuseOptions);
8394
+
8395
+ this.filterOptionsByFuse(this.mx_search);
8396
+ }, { deep: true });
7659
8397
  }
7660
8398
  }
7661
8399
  };
7662
8400
 
7663
- const _hoisted_1$4 = { class: "absolute-center text-center" };
7664
- const _hoisted_2$3 = /*#__PURE__*/createElementVNode("div", null, "Não há resultados disponíveis.", -1 /* HOISTED */);
8401
+ const _hoisted_1$5 = { class: "flex justify-center q-pb-sm" };
8402
+ const _hoisted_2$3 = { class: "absolute-center text-center" };
7665
8403
 
7666
8404
  function render$8(_ctx, _cache, $props, $setup, $data, $options) {
7667
8405
  const _component_q_icon = resolveComponent("q-icon");
7668
- const _component_q_input = resolveComponent("q-input");
8406
+ const _component_qas_input = resolveComponent("qas-input");
8407
+ const _component_q_spinner_dots = resolveComponent("q-spinner-dots");
8408
+ const _component_q_spinner = resolveComponent("q-spinner");
8409
+ const _component_q_inner_loading = resolveComponent("q-inner-loading");
7669
8410
  const _component_qas_box = resolveComponent("qas-box");
7670
8411
 
7671
8412
  return (openBlock(), createBlock(_component_qas_box, null, {
7672
8413
  default: withCtx(() => [
7673
- createVNode(_component_q_input, {
7674
- modelValue: $data.search,
7675
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.search) = $event)),
7676
- clearable: "",
7677
- disable: !$props.list.length,
7678
- outlined: "",
7679
- placeholder: $props.placeholder
7680
- }, {
8414
+ createVNode(_component_qas_input, mergeProps($options.attributes, {
8415
+ ref: "search",
8416
+ modelValue: _ctx.mx_search,
8417
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.mx_search) = $event))
8418
+ }), {
7681
8419
  append: withCtx(() => [
7682
8420
  createVNode(_component_q_icon, {
7683
8421
  color: "primary",
@@ -7685,26 +8423,52 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
7685
8423
  })
7686
8424
  ]),
7687
8425
  _: 1 /* STABLE */
7688
- }, 8 /* PROPS */, ["modelValue", "disable", "placeholder"]),
8426
+ }, 16 /* FULL_PROPS */, ["modelValue"]),
7689
8427
  createElementVNode("div", {
8428
+ ref: "scrollContainer",
7690
8429
  class: "overflow-auto q-mt-xs relative-position",
7691
- style: normalizeStyle($options.contentStyle)
8430
+ style: normalizeStyle($options.containerStyle)
7692
8431
  }, [
7693
- ($options.hasResults)
7694
- ? renderSlot(_ctx.$slots, "default", { key: 0 })
7695
- : ($props.useEmptySlot)
7696
- ? renderSlot(_ctx.$slots, "empty-result", { key: 1 }, () => [
7697
- createElementVNode("div", _hoisted_1$4, [
7698
- createVNode(_component_q_icon, {
7699
- class: "q-mb-sm text-center",
7700
- color: "primary",
7701
- name: "o_search",
7702
- size: "38px"
7703
- }),
7704
- _hoisted_2$3
7705
- ])
8432
+ (openBlock(), createBlock(resolveDynamicComponent($options.component.is), normalizeProps(guardReactiveProps($options.component.props)), {
8433
+ default: withCtx(() => [
8434
+ (_ctx.mx_hasFilteredOptions)
8435
+ ? renderSlot(_ctx.$slots, "default", { key: 0 })
8436
+ : createCommentVNode("v-if", true)
8437
+ ]),
8438
+ _: 3 /* FORWARDED */
8439
+ }, 16 /* FULL_PROPS */)),
8440
+ ($options.showSpinnerDots)
8441
+ ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
8442
+ createElementVNode("div", _hoisted_1$5, [
8443
+ createVNode(_component_q_spinner_dots, {
8444
+ color: "primary",
8445
+ size: "20px"
8446
+ })
7706
8447
  ])
7707
- : createCommentVNode("v-if", true)
8448
+ ])
8449
+ : createCommentVNode("v-if", true),
8450
+ ($options.showEmptyResult)
8451
+ ? renderSlot(_ctx.$slots, "empty-result", { key: 1 }, () => [
8452
+ createElementVNode("div", _hoisted_2$3, [
8453
+ createVNode(_component_q_icon, {
8454
+ class: "q-mb-sm text-center",
8455
+ color: "primary",
8456
+ name: "o_search",
8457
+ size: "38px"
8458
+ }),
8459
+ createElementVNode("div", null, toDisplayString($props.emptyResultText), 1 /* TEXT */)
8460
+ ])
8461
+ ])
8462
+ : createCommentVNode("v-if", true),
8463
+ createVNode(_component_q_inner_loading, { showing: $options.showInnerLoading }, {
8464
+ default: withCtx(() => [
8465
+ createVNode(_component_q_spinner, {
8466
+ color: "grey",
8467
+ size: "3em"
8468
+ })
8469
+ ]),
8470
+ _: 1 /* STABLE */
8471
+ }, 8 /* PROPS */, ["showing"])
7708
8472
  ], 4 /* STYLE */)
7709
8473
  ]),
7710
8474
  _: 3 /* FORWARDED */
@@ -7717,6 +8481,8 @@ script$8.__file = "src/components/search-box/QasSearchBox.vue";
7717
8481
  var script$7 = {
7718
8482
  name: 'QasSelect',
7719
8483
 
8484
+ mixins: [searchFilterMixin],
8485
+
7720
8486
  props: {
7721
8487
  fuseOptions: {
7722
8488
  default: () => ({}),
@@ -7730,7 +8496,7 @@ var script$7 = {
7730
8496
 
7731
8497
  modelValue: {
7732
8498
  default: () => [],
7733
- type: [Array, Object, String, Number]
8499
+ type: [Array, Object, String, Number, Boolean]
7734
8500
  },
7735
8501
 
7736
8502
  noOptionLabel: {
@@ -7743,13 +8509,13 @@ var script$7 = {
7743
8509
  type: Array
7744
8510
  },
7745
8511
 
7746
- searchable: {
7747
- type: Boolean
7748
- },
7749
-
7750
8512
  valueKey: {
7751
8513
  default: '',
7752
8514
  type: String
8515
+ },
8516
+
8517
+ useSearch: {
8518
+ type: Boolean
7753
8519
  }
7754
8520
  },
7755
8521
 
@@ -7757,7 +8523,6 @@ var script$7 = {
7757
8523
 
7758
8524
  data () {
7759
8525
  return {
7760
- filteredOptions: [],
7761
8526
  fuse: null
7762
8527
  }
7763
8528
  },
@@ -7765,15 +8530,18 @@ var script$7 = {
7765
8530
  computed: {
7766
8531
  attributes () {
7767
8532
  return {
7768
- clearable: this.searchable,
8533
+ clearable: this.isSearchable,
7769
8534
  emitValue: true,
7770
8535
  mapOptions: true,
7771
8536
  outlined: true,
7772
-
7773
8537
  ...this.$attrs,
7774
8538
 
7775
- options: this.filteredOptions,
7776
- useInput: this.searchable
8539
+ options: this.mx_filteredOptions,
8540
+ useInput: this.isSearchable,
8541
+ error: this.hasError,
8542
+ loading: this.hasLoading,
8543
+ ...(this.useLazyLoading && { onVirtualScroll: this.mx_onVirtualScroll }),
8544
+ ...(this.isSearchable && { onFilter: this.onFilter })
7777
8545
  }
7778
8546
  },
7779
8547
 
@@ -7787,12 +8555,20 @@ var script$7 = {
7787
8555
  }
7788
8556
  },
7789
8557
 
7790
- formattedResult () {
7791
- if (!this.labelKey && !this.valueKey) {
7792
- return this.options
7793
- }
8558
+ isSearchable () {
8559
+ return this.useSearch || this.useLazyLoading
8560
+ },
8561
+
8562
+ defaultOptions () {
8563
+ return this.mx_handleOptions(this.options)
8564
+ },
8565
+
8566
+ hasError () {
8567
+ return this.mx_hasFetchError || this.$attrs.error
8568
+ },
7794
8569
 
7795
- return this.options.map(item => this.renameKey(item))
8570
+ hasLoading () {
8571
+ return this.mx_isFetching || this.$attrs.loading
7796
8572
  },
7797
8573
 
7798
8574
  model: {
@@ -7813,11 +8589,11 @@ var script$7 = {
7813
8589
 
7814
8590
  options: {
7815
8591
  handler () {
7816
- if (this.fuse) {
7817
- this.fuse.list = this.formattedResult;
7818
- }
8592
+ if (this.useLazyLoading && this.mx_hasFilteredOptions) return
8593
+
8594
+ if (this.fuse) this.setFuse();
7819
8595
 
7820
- this.filteredOptions = this.formattedResult;
8596
+ this.mx_filteredOptions = this.defaultOptions;
7821
8597
  },
7822
8598
 
7823
8599
  immediate: true
@@ -7826,59 +8602,57 @@ var script$7 = {
7826
8602
 
7827
8603
  created () {
7828
8604
  this.setFuse();
8605
+ this.useLazyLoading && this.mx_setFetchOptions('');
7829
8606
  },
7830
8607
 
7831
8608
  methods: {
7832
- filterOptions (value, update) {
7833
- update(() => {
7834
- if (!this.searchable) return
7835
-
7836
- if (value === '') {
7837
- this.filteredOptions = this.formattedResult;
7838
- } else {
7839
- const results = this.fuse.search(value);
7840
- this.filteredOptions = results.map(item => item.item);
7841
- }
7842
- });
8609
+ setFuse () {
8610
+ if (this.useSearch) {
8611
+ this.fuse = new Fuse(this.defaultOptions, this.defaultFuseOptions);
8612
+ }
7843
8613
  },
7844
8614
 
7845
- renameKey (item) {
7846
- const mapKeys = {
7847
- label: this.labelKey,
7848
- value: this.valueKey
7849
- };
8615
+ async onFilter (value, update) {
8616
+ if (this.useLazyLoading && value !== this.mx_search) {
8617
+ await this.mx_filterOptionsByStore(value);
8618
+ }
7850
8619
 
7851
- for (const newKey in mapKeys) {
7852
- if (!item.hasOwnProperty.call(newKey)) {
7853
- item[newKey] = item[mapKeys[newKey]];
7854
- delete item[mapKeys[newKey]];
7855
- }
8620
+ if (!this.useLazyLoading && this.useSearch) {
8621
+ this.filterOptionsByFuse(value);
7856
8622
  }
7857
8623
 
7858
- return item
8624
+ update();
7859
8625
  },
7860
8626
 
7861
- setFuse () {
7862
- if (this.searchable) {
7863
- this.fuse = new Fuse(this.options, this.defaultFuseOptions);
8627
+ filterOptionsByFuse (value) {
8628
+ if (value === '') {
8629
+ this.mx_filteredOptions = this.defaultOptions;
8630
+ return
7864
8631
  }
8632
+
8633
+ const results = this.fuse.search(value);
8634
+
8635
+ this.mx_filteredOptions = this.mx_getNormalizedFuseResults(results);
7865
8636
  }
7866
8637
  }
7867
8638
  };
7868
8639
 
8640
+ const _hoisted_1$4 = { class: "flex justify-center q-pb-sm" };
8641
+
7869
8642
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
7870
8643
  const _component_q_icon = resolveComponent("q-icon");
7871
8644
  const _component_q_item_section = resolveComponent("q-item-section");
7872
8645
  const _component_q_item = resolveComponent("q-item");
8646
+ const _component_q_spinner_dots = resolveComponent("q-spinner-dots");
7873
8647
  const _component_q_select = resolveComponent("q-select");
7874
8648
 
7875
8649
  return (openBlock(), createBlock(_component_q_select, mergeProps({
7876
8650
  modelValue: $options.model,
7877
8651
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event))
7878
- }, $options.attributes, { onFilter: $options.filterOptions }), createSlots({
8652
+ }, $options.attributes), createSlots({
7879
8653
  append: withCtx(() => [
7880
8654
  renderSlot(_ctx.$slots, "append", {}, () => [
7881
- ($props.searchable)
8655
+ ($options.isSearchable)
7882
8656
  ? (openBlock(), createBlock(_component_q_icon, {
7883
8657
  key: 0,
7884
8658
  name: "o_search"
@@ -7887,19 +8661,33 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
7887
8661
  ])
7888
8662
  ]),
7889
8663
  "no-option": withCtx(() => [
7890
- renderSlot(_ctx.$slots, "no-option", {}, () => [
7891
- createVNode(_component_q_item, null, {
7892
- default: withCtx(() => [
7893
- createVNode(_component_q_item_section, { class: "text-grey" }, {
8664
+ (!_ctx.mx_isFetching)
8665
+ ? renderSlot(_ctx.$slots, "no-option", { key: 0 }, () => [
8666
+ createVNode(_component_q_item, null, {
7894
8667
  default: withCtx(() => [
7895
- createTextVNode(toDisplayString($props.noOptionLabel), 1 /* TEXT */)
8668
+ createVNode(_component_q_item_section, { class: "text-grey" }, {
8669
+ default: withCtx(() => [
8670
+ createTextVNode(toDisplayString($props.noOptionLabel), 1 /* TEXT */)
8671
+ ]),
8672
+ _: 1 /* STABLE */
8673
+ })
7896
8674
  ]),
7897
8675
  _: 1 /* STABLE */
7898
8676
  })
7899
- ]),
7900
- _: 1 /* STABLE */
7901
- })
7902
- ])
8677
+ ])
8678
+ : createCommentVNode("v-if", true)
8679
+ ]),
8680
+ "after-options": withCtx(() => [
8681
+ (_ctx.mx_isFetching)
8682
+ ? renderSlot(_ctx.$slots, "after-options", { key: 0 }, () => [
8683
+ createElementVNode("div", _hoisted_1$4, [
8684
+ createVNode(_component_q_spinner_dots, {
8685
+ color: "primary",
8686
+ size: "20px"
8687
+ })
8688
+ ])
8689
+ ])
8690
+ : createCommentVNode("v-if", true)
7903
8691
  ]),
7904
8692
  _: 2 /* DYNAMIC */
7905
8693
  }, [
@@ -7911,7 +8699,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
7911
8699
  ])
7912
8700
  }
7913
8701
  })
7914
- ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue", "onFilter"]))
8702
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["modelValue"]))
7915
8703
  }
7916
8704
 
7917
8705
  script$7.render = render$7;
@@ -7945,26 +8733,16 @@ var script$6 = {
7945
8733
  default: () => []
7946
8734
  },
7947
8735
 
7948
- to: {
7949
- default: () => ({}),
7950
- type: Object
7951
- },
7952
-
7953
- redirectKey: {
7954
- default: 'uuid',
7955
- type: String
7956
- },
7957
-
7958
- paramKey: {
7959
- default: 'id',
7960
- type: String
8736
+ useClickableLabel: {
8737
+ type: Boolean
7961
8738
  }
7962
8739
  },
7963
8740
 
7964
8741
  emits: [
7965
8742
  'added',
7966
- 'update:modelValue',
7967
- 'removed'
8743
+ 'click-label',
8744
+ 'removed',
8745
+ 'update:modelValue'
7968
8746
  ],
7969
8747
 
7970
8748
  data () {
@@ -7976,12 +8754,8 @@ var script$6 = {
7976
8754
  },
7977
8755
 
7978
8756
  computed: {
7979
- isRedirectEnabled () {
7980
- return Object.keys(this.to).length
7981
- },
7982
-
7983
8757
  labelClass () {
7984
- return this.isRedirectEnabled ? 'cursor-pointer' : ''
8758
+ return this.useClickableLabel && 'cursor-pointer'
7985
8759
  },
7986
8760
 
7987
8761
  slotData () {
@@ -8010,6 +8784,7 @@ var script$6 = {
8010
8784
  this.values = [...value];
8011
8785
  },
8012
8786
 
8787
+ deep: true,
8013
8788
  immediate: true
8014
8789
  }
8015
8790
  },
@@ -8031,7 +8806,7 @@ var script$6 = {
8031
8806
 
8032
8807
  return {
8033
8808
  dense: this.$qas.screen.isSmall,
8034
- hideLabelOnSmallScreen: true,
8809
+ useLabelOnSmallScreen: false,
8035
8810
  icon: !this.$qas.screen.isSmall ? undefined : isSelected ? 'o_close' : 'o_add',
8036
8811
  label: isSelected ? 'Remover' : 'Adicionar',
8037
8812
  outline: isSelected,
@@ -8056,11 +8831,8 @@ var script$6 = {
8056
8831
  });
8057
8832
  },
8058
8833
 
8059
- redirectRoute (item) {
8060
- return this.isRedirectEnabled && this.$router.push({
8061
- params: { [this.paramKey]: item[this.redirectKey] },
8062
- ...this.to
8063
- })
8834
+ onClickLabel ({ item, index }) {
8835
+ this.useClickableLabel && this.$emit('click-label', { item, index });
8064
8836
  },
8065
8837
 
8066
8838
  remove (item) {
@@ -8114,7 +8886,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
8114
8886
  default: withCtx(() => [
8115
8887
  createElementVNode("div", {
8116
8888
  class: normalizeClass($options.labelClass),
8117
- onClick: $event => ($options.redirectRoute(result))
8889
+ onClick: $event => ($options.onClickLabel({ item: result, index: _ctx.index }))
8118
8890
  }, toDisplayString(result.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_1$3)
8119
8891
  ]),
8120
8892
  _: 2 /* DYNAMIC */
@@ -8185,7 +8957,9 @@ var script$5 = {
8185
8957
 
8186
8958
  watch: {
8187
8959
  $route (to, from) {
8188
- to.name === from.name && this.fetchSingle();
8960
+ if (to.name === from.name) {
8961
+ this.mx_fetchHandler({ id: this.id, url: this.url }, this.fetchSingle);
8962
+ }
8189
8963
  },
8190
8964
 
8191
8965
  resultModel (value) {
@@ -8194,19 +8968,23 @@ var script$5 = {
8194
8968
  },
8195
8969
 
8196
8970
  created () {
8197
- this.fetchSingle();
8971
+ this.mx_fetchHandler({ id: this.id, url: this.url }, this.fetchSingle);
8198
8972
  },
8199
8973
 
8200
8974
  methods: {
8201
- async fetchSingle (params = {}) {
8975
+ async fetchSingle (externalPayload = {}) {
8202
8976
  this.mx_isFetching = true;
8203
8977
 
8204
8978
  try {
8205
- const response = await this.$store.dispatch(
8206
- `${this.entity}/fetchSingle`,
8207
- { id: this.id, url: this.url, params }
8979
+ const payload = { id: this.id, url: this.url, ...externalPayload };
8980
+
8981
+ this.$qas.logger.group(
8982
+ `QasSingleView - fetchSingle -> payload do parâmetro do ${this.entity}/fetchSingle`,
8983
+ [payload]
8208
8984
  );
8209
8985
 
8986
+ const response = await this.$store.dispatch(`${this.entity}/fetchSingle`, payload);
8987
+
8210
8988
  const { errors, fields, metadata } = response.data;
8211
8989
 
8212
8990
  this.mx_setErrors(errors);
@@ -8219,10 +8997,20 @@ var script$5 = {
8219
8997
  metadata: this.mx_metadata
8220
8998
  });
8221
8999
 
9000
+ this.$qas.logger.group(
9001
+ `QasSingleView - fetchSingle -> resposta da action ${this.entity}/fetchSingle`, [response]
9002
+ );
9003
+
8222
9004
  this.$emit('fetch-success', response);
8223
9005
  } catch (error) {
8224
9006
  this.mx_fetchError(error);
8225
9007
  this.$emit('fetch-error', error);
9008
+
9009
+ this.$qas.logger.group(
9010
+ `QasSingleView - fetchSingle -> exceção da action ${this.entity}/fetchSingle`,
9011
+ [error],
9012
+ { error: true }
9013
+ );
8226
9014
  } finally {
8227
9015
  this.mx_isFetching = false;
8228
9016
  }
@@ -8514,6 +9302,8 @@ var script$3 = {
8514
9302
  columnByField(this.fields[index]);
8515
9303
  }
8516
9304
 
9305
+ this.$qas.logger.group('QasTableGenerator - Automatic columns', [columns]);
9306
+
8517
9307
  return columns
8518
9308
  }
8519
9309
 
@@ -8526,6 +9316,8 @@ var script$3 = {
8526
9316
  }
8527
9317
  });
8528
9318
 
9319
+ this.$qas.logger.group('QasTableGenerator - columns', [columns]);
9320
+
8529
9321
  return columns
8530
9322
  },
8531
9323
 
@@ -8542,16 +9334,22 @@ var script$3 = {
8542
9334
  },
8543
9335
 
8544
9336
  resultsByFields () {
9337
+ if (!Object.keys(this.fields).length) return []
9338
+
8545
9339
  const results = extend(true, [], this.results);
8546
9340
 
8547
- return results.map((result, index) => {
9341
+ const mappedResults = results.map((result, index) => {
8548
9342
  for (const key in result) {
8549
9343
  result.default = this.results[index];
8550
9344
  result[key] = humanize(this.fields[key], result[key]) || this.emptyResultText;
8551
9345
  }
8552
9346
 
8553
9347
  return result
8554
- })
9348
+ });
9349
+
9350
+ this.$qas.logger.group('QasTableGenerator - resultsByFields', [mappedResults]);
9351
+
9352
+ return mappedResults
8555
9353
  },
8556
9354
 
8557
9355
  rowsPerPage () {
@@ -8713,7 +9511,7 @@ var script$2 = {
8713
9511
  tabs: {
8714
9512
  default: () => ({}),
8715
9513
  required: true,
8716
- type: Object
9514
+ type: [Object, Array]
8717
9515
  }
8718
9516
  },
8719
9517
 
@@ -8770,7 +9568,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
8770
9568
  (openBlock(), createBlock(_component_q_tab, mergeProps({ key: key }, tab, {
8771
9569
  class: $props.tabClass,
8772
9570
  label: tab.label,
8773
- name: key
9571
+ name: tab.value
8774
9572
  }), {
8775
9573
  default: withCtx(() => [
8776
9574
  renderSlot(_ctx.$slots, `tab-after-${tab.value}`, { item: tab }, () => [
@@ -8855,7 +9653,7 @@ var script$1 = {
8855
9653
  return {
8856
9654
  cancel: false,
8857
9655
  ok: false,
8858
- useCloseIcon: true,
9656
+ useCloseButton: true,
8859
9657
  ...this.dialogProps,
8860
9658
  card: {
8861
9659
  title: this.dialogTitle,
@@ -9265,7 +10063,7 @@ script.__file = "src/components/transfer/QasTransfer.vue";
9265
10063
 
9266
10064
  var name = "@bildvitta/quasar-ui-asteroid";
9267
10065
  var description = "Asteroid";
9268
- var version$1 = "3.0.0-beta.9";
10066
+ var version$1 = "3.0.0";
9269
10067
  var author = "Bild & Vitta <systemteam@bild.com.br>";
9270
10068
  var license = "MIT";
9271
10069
  var main = "dist/asteroid.cjs.min.js";
@@ -9421,8 +10219,9 @@ function install (app) {
9421
10219
  app.config.globalProperties.$qas = {
9422
10220
  dialog: Dialog,
9423
10221
  error: NotifyError,
9424
- success: NotifySuccess,
9425
- screen: Screen()
10222
+ logger: Logger(),
10223
+ screen: Screen(),
10224
+ success: NotifySuccess
9426
10225
  };
9427
10226
 
9428
10227
  app.directive(Test.name, Test);
@@ -9480,10 +10279,11 @@ var VuePlugin = /*#__PURE__*/Object.freeze({
9480
10279
  QasTransfer: script,
9481
10280
  QasUploader: script$q,
9482
10281
  Dialog: Dialog,
10282
+ Logger: Logger,
9483
10283
  NotifyError: NotifyError,
9484
10284
  NotifySuccess: NotifySuccess,
9485
10285
  Screen: Screen,
9486
10286
  install: install
9487
10287
  });
9488
10288
 
9489
- 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 };
10289
+ 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 };