@bildvitta/quasar-ui-asteroid 3.0.0-beta.13 → 3.0.0-beta.16

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.
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,700;1,400;1,700&display=swap";:root{--qas-background-color: #f5f5f5;--qas-generic-border-radius: 8px}h1{font-size:6rem;font-weight:800;letter-spacing:0;line-height:6rem;margin:0}h2{font-size:3.75rem;font-weight:700;letter-spacing:0;line-height:3.75rem;margin:0}h3{font-size:3rem;font-weight:600;letter-spacing:0;line-height:2.5rem;margin:0}h4{font-size:2.125rem;font-weight:800;letter-spacing:0;line-height:2.5rem;margin:0}h5{font-size:1.5rem;font-weight:700;letter-spacing:0;line-height:2rem;margin:0}h6{font-size:1.25rem;font-weight:600;letter-spacing:0;line-height:2rem;margin:0}body{background-color:var(--qas-background-color)}.q-field--outlined .q-field__inner{background-color:#fff;border-radius:var(--qas-generic-border-radius)}.q-radio__inner::before{color:var(--q-primary)}.q-tabs__arrow{color:var(--q-primary)}.bg-no-repeat{background-repeat:no-repeat !important}.bg-size-contain{background-size:contain !important}.bg-size-cover{background-size:cover !important}.bg-position-bottom{background-position:bottom !important}.bg-position-center{background-position:center !important}.bg-position-left{background-position:left !important}.bg-position-right{background-position:right !important}.bg-position-top{background-position:top !important}.border-secondary-contrast:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right),.border-secondary:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right),.border-primary-contrast:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right),.border-primary:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right){border-width:1px !important}.border-primary{border:0 solid var(--q-primary) !important}.border-primary-contrast{border:0 solid var(--q-primary-contrast) !important}.border-secondary{border:0 solid var(--q-secondary) !important}.border-secondary-contrast{border:0 solid var(--q-secondary-contrast) !important}.border-top{border-top-width:1px !important}.border-left{border-left-width:1px !important}.border-bottom{border-bottom-width:1px !important}.border-right{border-right-width:1px !important}.rounded-borders-sm{border-radius:calc(var(--qas-generic-border-radius) / 2) !important}.rounded-borders-lg{border-radius:calc(var(--qas-generic-border-radius) * 2) !important}.rounded-borders-top{border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-borders-right{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-borders-bottom{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-borders-left{border-bottom-right-radius:0 !important;border-top-right-radius:0 !important}.container,.container-xs,.container-sm,.container-md,.container-lg,.container-xl{margin-left:auto;margin-right:auto;max-width:1280px;width:calc(100% - 80px)}.container.spaced,.container-xs.spaced,.container-sm.spaced,.container-md.spaced,.container-lg.spaced,.container-xl.spaced{padding-bottom:20px;padding-top:20px}@media(max-width: 599px){.container,.container-xs,.container-sm,.container-md,.container-lg,.container-xl{width:calc(100% - 20px)}}.container-xs{max-width:599px !important}.container-sm{max-width:1023px !important}.container-md{max-width:1439px !important}.container-lg{max-width:1919px !important}body{font-family:Inter,system-ui,sans-serif}.qs-lh-xs{line-height:.85 !important}.qs-lh-sm{line-height:1 !important}.qs-lh-md{line-height:1.15 !important}.qs-lh-lg{line-height:1.3 !important}.qs-lh-xl{line-height:1.5 !important}.opacity-10{opacity:0.1 !important}.opacity-20{opacity:0.2 !important}.opacity-30{opacity:0.3 !important}.opacity-40{opacity:0.4 !important}.opacity-50{opacity:0.5 !important}.opacity-60{opacity:0.6 !important}.opacity-70{opacity:0.7 !important}.opacity-80{opacity:0.8 !important}.opacity-90{opacity:0.9 !important}.text-baseline{vertical-align:baseline !important}.text-break{word-break:break-all !important}.text-underline{text-decoration:underline !important}.text-no-decoration{text-decoration:none !important}.unset{all:unset}a.unset,button.unset{cursor:pointer}.qas-actions-menu__list{width:265px;z-index:1}.qas-app-bar__toolbar{height:70px}.qas-app-bar__brand{height:24px;margin-right:8px;position:relative;top:4px}.qas-app-bar__user{background-color:var(--qas-background-color);transition:background-color .3s cubic-bezier(0.25, 0.8, 0.5, 1)}.qas-app-bar__user:focus,.qas-app-bar__user:hover{background-color:rgba(255,255,255,.2)}.qas-app-bar__user-data{max-width:180px}.qas-app-bar__user-menu{width:260px}@media(max-width: 599px){.qas-app-bar__user-data{display:none}}.q-expansion-item--expanded .q-item:not(.qas-app-menu--active.q-item){background-color:#fafafa}.qas-alert{border-style:solid;border-width:0 10px}.qas-list-items .q-list>.q-item{padding:24px 16px}.qas-map__draw{height:300px;width:100%}.qas-nested-fields__actions{height:56px}.qas-signature-pad__canvas{border:1px solid rgba(0,0,0,.12)}.qas-table-generator .q-table th{font-weight:bold}.qas-table-generator--mobile{margin:0 -10px}.qas-table-generator--mobile .q-table{margin-left:10px}.qas-transfer__icon{transform:rotate(-90deg)}.qas-uploader__input{display:none}
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,700;1,400;1,700&display=swap";:root{--qas-background-color: #f5f5f5;--qas-generic-border-radius: 8px}h1{font-size:6rem;font-weight:800;letter-spacing:0;line-height:6rem;margin:0}h2{font-size:3.75rem;font-weight:700;letter-spacing:0;line-height:3.75rem;margin:0}h3{font-size:3rem;font-weight:600;letter-spacing:0;line-height:2.5rem;margin:0}h4{font-size:2.125rem;font-weight:800;letter-spacing:0;line-height:2.5rem;margin:0}h5{font-size:1.5rem;font-weight:700;letter-spacing:0;line-height:2rem;margin:0}h6{font-size:1.25rem;font-weight:600;letter-spacing:0;line-height:2rem;margin:0}body{background-color:var(--qas-background-color)}.q-field--outlined .q-field__inner{background-color:#fff;border-radius:var(--qas-generic-border-radius)}.q-radio__inner::before{color:var(--q-primary)}.q-tabs__arrow{color:var(--q-primary)}.bg-no-repeat{background-repeat:no-repeat !important}.bg-size-contain{background-size:contain !important}.bg-size-cover{background-size:cover !important}.bg-position-bottom{background-position:bottom !important}.bg-position-center{background-position:center !important}.bg-position-left{background-position:left !important}.bg-position-right{background-position:right !important}.bg-position-top{background-position:top !important}.border-secondary-contrast:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right),.border-secondary:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right),.border-primary-contrast:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right),.border-primary:not(.border-top):not(.border-left):not(.border-bottom):not(.border-right){border-width:1px !important}.border-primary{border:0 solid var(--q-primary) !important}.border-primary-contrast{border:0 solid var(--q-primary-contrast) !important}.border-secondary{border:0 solid var(--q-secondary) !important}.border-secondary-contrast{border:0 solid var(--q-secondary-contrast) !important}.border-top{border-top-width:1px !important}.border-left{border-left-width:1px !important}.border-bottom{border-bottom-width:1px !important}.border-right{border-right-width:1px !important}.rounded-borders-sm{border-radius:calc(var(--qas-generic-border-radius) / 2) !important}.rounded-borders-lg{border-radius:calc(var(--qas-generic-border-radius) * 2) !important}.rounded-borders-top{border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-borders-right{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-borders-bottom{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-borders-left{border-bottom-right-radius:0 !important;border-top-right-radius:0 !important}.container,.container-xs,.container-sm,.container-md,.container-lg,.container-xl{margin-left:auto;margin-right:auto;max-width:1280px;width:calc(100% - 80px)}.container.spaced,.container-xs.spaced,.container-sm.spaced,.container-md.spaced,.container-lg.spaced,.container-xl.spaced{padding-bottom:20px;padding-top:20px}@media(max-width: 599px){.container,.container-xs,.container-sm,.container-md,.container-lg,.container-xl{width:calc(100% - 20px)}}.container-xs{max-width:599px !important}.container-sm{max-width:1023px !important}.container-md{max-width:1439px !important}.container-lg{max-width:1919px !important}body{font-family:Inter,system-ui,sans-serif}.qs-lh-xs{line-height:.85 !important}.qs-lh-sm{line-height:1 !important}.qs-lh-md{line-height:1.15 !important}.qs-lh-lg{line-height:1.3 !important}.qs-lh-xl{line-height:1.5 !important}.opacity-10{opacity:0.1 !important}.opacity-20{opacity:0.2 !important}.opacity-30{opacity:0.3 !important}.opacity-40{opacity:0.4 !important}.opacity-50{opacity:0.5 !important}.opacity-60{opacity:0.6 !important}.opacity-70{opacity:0.7 !important}.opacity-80{opacity:0.8 !important}.opacity-90{opacity:0.9 !important}.text-baseline{vertical-align:baseline !important}.text-break{word-break:break-all !important}.text-underline{text-decoration:underline !important}.text-no-decoration{text-decoration:none !important}.unset{all:unset}a.unset,button.unset{cursor:pointer}.qas-alert{border-style:solid;border-width:0 10px}.qas-actions-menu__list{width:265px;z-index:1}.qas-app-bar__toolbar{height:70px}.qas-app-bar__brand{height:24px;margin-right:8px;position:relative;top:4px}.qas-app-bar__user{background-color:var(--qas-background-color);transition:background-color .3s cubic-bezier(0.25, 0.8, 0.5, 1)}.qas-app-bar__user:focus,.qas-app-bar__user:hover{background-color:rgba(255,255,255,.2)}.qas-app-bar__user-data{max-width:180px}.qas-app-bar__user-menu{width:260px}@media(max-width: 599px){.qas-app-bar__user-data{display:none}}.q-expansion-item--expanded .q-item:not(.qas-app-menu--active.q-item){background-color:#fafafa}.qas-list-items .q-list>.q-item{padding:24px 16px}.qas-nested-fields__actions{height:56px}.qas-map__draw{height:300px;width:100%}.qas-signature-pad__canvas{border:1px solid rgba(0,0,0,.12)}.qas-table-generator .q-table th{font-weight:bold}.qas-table-generator--mobile{margin:0 -10px}.qas-table-generator--mobile .q-table{margin-left:10px}.qas-transfer__icon{transform:rotate(-90deg)}.qas-uploader__input{display:none}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @bildvitta/quasar-ui-asteroid v3.0.0-beta.13
2
+ * @bildvitta/quasar-ui-asteroid v3.0.0-beta.16
3
3
  * (c) 2022 Bild & Vitta <systemteam@bild.com.br>
4
4
  * Released under the MIT License.
5
5
  */
@@ -5326,6 +5326,11 @@ var viewMixin = {
5326
5326
  useBoundary: {
5327
5327
  default: true,
5328
5328
  type: Boolean
5329
+ },
5330
+
5331
+ beforeFetch: {
5332
+ default: null,
5333
+ type: Function
5329
5334
  }
5330
5335
  },
5331
5336
 
@@ -5341,7 +5346,7 @@ var viewMixin = {
5341
5346
  mx_errors: {},
5342
5347
  mx_fields: {},
5343
5348
  mx_metadata: {},
5344
-
5349
+ mx_cancelBeforeFetch: false,
5345
5350
  mx_isFetching: false
5346
5351
  }
5347
5352
  },
@@ -5407,6 +5412,22 @@ var viewMixin = {
5407
5412
 
5408
5413
  this.$emit(`update:${key}`, models[key]);
5409
5414
  }
5415
+ },
5416
+
5417
+ mx_fetchHandler (payload, resolve) {
5418
+ const hasBeforeFetch = typeof this.beforeFetch === 'function';
5419
+
5420
+ if (hasBeforeFetch && !this.mx_cancelBeforeFetch) {
5421
+ return this.beforeFetch({
5422
+ payload,
5423
+ resolve: payload => resolve(payload),
5424
+ done: () => {
5425
+ this.mx_cancelBeforeFetch = true;
5426
+ }
5427
+ })
5428
+ }
5429
+
5430
+ resolve();
5410
5431
  }
5411
5432
  }
5412
5433
  };
@@ -5488,6 +5509,11 @@ var script$k = {
5488
5509
  useSubmitButton: {
5489
5510
  default: true,
5490
5511
  type: Boolean
5512
+ },
5513
+
5514
+ beforeSubmit: {
5515
+ default: null,
5516
+ type: Function
5491
5517
  }
5492
5518
  },
5493
5519
 
@@ -5581,7 +5607,7 @@ var script$k = {
5581
5607
 
5582
5608
  window.addEventListener('delete-success', this.setIgnoreRouterGuard);
5583
5609
 
5584
- this.fetch();
5610
+ this.mx_fetchHandler({ form: true, id: this.id, url: this.fetchURL }, this.fetch);
5585
5611
  },
5586
5612
 
5587
5613
  onUnmounted () {
@@ -5716,6 +5742,7 @@ var script$k = {
5716
5742
  const { addRoute } = useHistory();
5717
5743
 
5718
5744
  this.defaultDialogProps.ok.onClick = () => addRoute(this.$route);
5745
+
5719
5746
  this.defaultDialogProps.cancel.onClick = next;
5720
5747
  },
5721
5748
 
@@ -5735,17 +5762,35 @@ var script$k = {
5735
5762
  });
5736
5763
  },
5737
5764
 
5738
- async submit (event) {
5739
- if (this.disable) return null
5740
-
5765
+ /**
5766
+ * Se existe a propriedade com callback "beforeSubmit", então o controle de quando e como chamar o método "submit"
5767
+ * está sendo controlado fora do QasFormView, se não existir a propriedade "beforeSubmit", então o controle do método
5768
+ * submit é feito pelo próprio QasFormView, chamado pelo evento @submit.
5769
+ */
5770
+ submitHandler (event) {
5741
5771
  if (event) {
5742
5772
  event.preventDefault();
5743
5773
  }
5744
5774
 
5775
+ const hasBeforeSubmit = typeof this.beforeSubmit === 'function';
5776
+
5777
+ if (hasBeforeSubmit) {
5778
+ return this.beforeSubmit({
5779
+ payload: { id: this.id, payload: this.modelValue, url: this.url },
5780
+ resolve: payload => this.submit(payload)
5781
+ })
5782
+ }
5783
+
5784
+ this.submit();
5785
+ },
5786
+
5787
+ async submit (externalPayload = {}) {
5788
+ if (this.disable) return null
5789
+
5745
5790
  this.isSubmitting = true;
5746
5791
 
5747
5792
  try {
5748
- const payload = { id: this.id, payload: this.modelValue, url: this.url };
5793
+ const payload = { id: this.id, payload: this.modelValue, url: this.url, ...externalPayload };
5749
5794
 
5750
5795
  this.$qas.logger.group(
5751
5796
  `QasFormView - submit -> payload do ${this.entity}/${this.mode}`, [payload]
@@ -5819,7 +5864,7 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) {
5819
5864
  : createCommentVNode("v-if", true),
5820
5865
  createVNode(_component_q_form, {
5821
5866
  ref: "form",
5822
- onSubmit: $options.submit
5867
+ onSubmit: $options.submitHandler
5823
5868
  }, {
5824
5869
  default: withCtx(() => [
5825
5870
  renderSlot(_ctx.$slots, "default"),
@@ -6557,6 +6602,10 @@ var script$e = {
6557
6602
  useFilter: {
6558
6603
  default: true,
6559
6604
  type: Boolean
6605
+ },
6606
+
6607
+ useResultsAreaOnly: {
6608
+ type: Boolean
6560
6609
  }
6561
6610
  },
6562
6611
 
@@ -6592,13 +6641,17 @@ var script$e = {
6592
6641
 
6593
6642
  totalPages () {
6594
6643
  return this.$store.getters[`${this.entity}/totalPages`]
6644
+ },
6645
+
6646
+ showResults () {
6647
+ return this.hasResults || this.useResultsAreaOnly
6595
6648
  }
6596
6649
  },
6597
6650
 
6598
6651
  watch: {
6599
6652
  $route (to, from) {
6600
6653
  if (to.name === from.name) {
6601
- this.fetchList();
6654
+ this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
6602
6655
  this.setCurrentPage();
6603
6656
  }
6604
6657
  },
@@ -6613,7 +6666,8 @@ var script$e = {
6613
6666
  },
6614
6667
 
6615
6668
  created () {
6616
- this.fetchList();
6669
+ this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList);
6670
+
6617
6671
  this.setCurrentPage();
6618
6672
  },
6619
6673
 
@@ -6623,16 +6677,14 @@ var script$e = {
6623
6677
  this.$router.push({ query });
6624
6678
  },
6625
6679
 
6626
- async fetchList (filters = {}) {
6680
+ async fetchList (externalPayload = {}) {
6627
6681
  this.mx_isFetching = true;
6628
6682
 
6629
- const hasFilters = !!Object.keys(filters).length;
6630
-
6631
6683
  try {
6632
6684
  const payload = {
6633
6685
  ...this.mx_context,
6634
6686
  url: this.url,
6635
- ...(hasFilters && { filters })
6687
+ ...externalPayload
6636
6688
  };
6637
6689
 
6638
6690
  this.$qas.logger.group(
@@ -6656,7 +6708,7 @@ var script$e = {
6656
6708
  this.$emit('fetch-success', response);
6657
6709
 
6658
6710
  this.$qas.logger.group(
6659
- `QasListView - fetchSingle -> resposta da action ${this.entity}/fetchList`, [response]
6711
+ `QasListView - fetchList -> resposta da action ${this.entity}/fetchList`, [response]
6660
6712
  );
6661
6713
  } catch (error) {
6662
6714
  this.mx_fetchError(error);
@@ -6730,7 +6782,7 @@ function render$e(_ctx, _cache, $props, $setup, $data, $options) {
6730
6782
  ])
6731
6783
  : createCommentVNode("v-if", true),
6732
6784
  createElementVNode("main", _hoisted_2$7, [
6733
- ($options.hasResults)
6785
+ ($options.showResults)
6734
6786
  ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
6735
6787
  renderSlot(_ctx.$slots, "default")
6736
6788
  ]))
@@ -6978,6 +7030,11 @@ var script$c = {
6978
7030
  }
6979
7031
  },
6980
7032
 
7033
+ identifierItemKey: {
7034
+ type: String,
7035
+ default: 'uuid'
7036
+ },
7037
+
6981
7038
  rowLabel: {
6982
7039
  type: String,
6983
7040
  default: ''
@@ -7080,13 +7137,8 @@ var script$c = {
7080
7137
  modelValue: {
7081
7138
  handler (value) {
7082
7139
  this.nested = extend(true, [], value);
7083
- },
7084
- immediate: true
7085
- },
7086
7140
 
7087
- field: {
7088
- handler () {
7089
- !this.modelValue.length && this.setDefaultNestedValue();
7141
+ if (!this.nested.length) return this.setDefaultNestedValue()
7090
7142
  },
7091
7143
  immediate: true
7092
7144
  }
@@ -7095,6 +7147,11 @@ var script$c = {
7095
7147
  methods: {
7096
7148
  add (row = {}) {
7097
7149
  const payload = { ...this.rowObject, ...row };
7150
+ const hasIdentifierKey = payload[this.identifierItemKey];
7151
+
7152
+ if (hasIdentifierKey) {
7153
+ delete payload[this.identifierItemKey];
7154
+ }
7098
7155
 
7099
7156
  this.nested.push(payload);
7100
7157
 
@@ -7120,7 +7177,7 @@ var script$c = {
7120
7177
  },
7121
7178
 
7122
7179
  destroy (index, row) {
7123
- this.useRemoveOnDestroy
7180
+ !row[this.identifierItemKey] || this.useRemoveOnDestroy
7124
7181
  ? this.nested.splice(index, 1)
7125
7182
  : this.nested.splice(index, 1, { [this.destroyKey]: true, ...row });
7126
7183
 
@@ -8375,7 +8432,9 @@ var script$5 = {
8375
8432
 
8376
8433
  watch: {
8377
8434
  $route (to, from) {
8378
- to.name === from.name && this.fetchSingle();
8435
+ if (to.name === from.name) {
8436
+ this.mx_fetchHandler({ id: this.id, url: this.url }, this.fetchSingle);
8437
+ }
8379
8438
  },
8380
8439
 
8381
8440
  resultModel (value) {
@@ -8384,15 +8443,15 @@ var script$5 = {
8384
8443
  },
8385
8444
 
8386
8445
  created () {
8387
- this.fetchSingle();
8446
+ this.mx_fetchHandler({ id: this.id, url: this.url }, this.fetchSingle);
8388
8447
  },
8389
8448
 
8390
8449
  methods: {
8391
- async fetchSingle (params = {}) {
8450
+ async fetchSingle (externalPayload = {}) {
8392
8451
  this.mx_isFetching = true;
8393
8452
 
8394
8453
  try {
8395
- const payload = { id: this.id, url: this.url, params };
8454
+ const payload = { id: this.id, url: this.url, ...externalPayload };
8396
8455
 
8397
8456
  this.$qas.logger.group(
8398
8457
  `QasSingleView - fetchSingle -> payload do parâmetro do ${this.entity}/fetchSingle`,
@@ -9479,7 +9538,7 @@ script.__file = "src/components/transfer/QasTransfer.vue";
9479
9538
 
9480
9539
  var name = "@bildvitta/quasar-ui-asteroid";
9481
9540
  var description = "Asteroid";
9482
- var version$1 = "3.0.0-beta.13";
9541
+ var version$1 = "3.0.0-beta.16";
9483
9542
  var author = "Bild & Vitta <systemteam@bild.com.br>";
9484
9543
  var license = "MIT";
9485
9544
  var main = "dist/asteroid.cjs.min.js";