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