vue-laravel-crud 1.6.6 → 1.6.7

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.
@@ -12532,7 +12532,7 @@ Plugin.install = function (Vue, options) {
12532
12532
 
12533
12533
  if (typeof window !== 'undefined' && window.Vue) {
12534
12534
  window.Vue.use(Plugin);
12535
- }var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}var css = "tr td[data-v-6dad4180]:last-child,\ntr td[data-v-6dad4180]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-6dad4180] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-6dad4180] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-6dad4180] .crud-title[data-v-6dad4180] {\n margin: 0; }\n .crud-header[data-v-6dad4180] .crud-search[data-v-6dad4180] {\n max-width: 15rem; }\n .crud-header[data-v-6dad4180] .crud-search[data-v-6dad4180] .btn[data-v-6dad4180] {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0.375rem;\n border-bottom-right-radius: 0.375rem; }\n .crud-header[data-v-6dad4180] .crud-search[data-v-6dad4180] .btn[data-v-6dad4180].open[data-v-6dad4180] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-6dad4180] .table-options[data-v-6dad4180] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-6dad4180] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-6dad4180] {\n table-layout: auto; }\n .table[data-v-6dad4180] tbody[data-v-6dad4180] td[data-v-6dad4180] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-6dad4180] tbody[data-v-6dad4180] td[data-v-6dad4180]::-webkit-scrollbar {\n display: none; } }\n";
12535
+ }var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}var css = "tr td[data-v-1a50c07c]:last-child,\ntr td[data-v-1a50c07c]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-1a50c07c] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-1a50c07c] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-1a50c07c] .crud-title[data-v-1a50c07c] {\n margin: 0; }\n .crud-header[data-v-1a50c07c] .crud-search[data-v-1a50c07c] {\n max-width: 15rem; }\n .crud-header[data-v-1a50c07c] .crud-search[data-v-1a50c07c] .btn[data-v-1a50c07c] {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0.375rem;\n border-bottom-right-radius: 0.375rem; }\n .crud-header[data-v-1a50c07c] .crud-search[data-v-1a50c07c] .btn[data-v-1a50c07c].open[data-v-1a50c07c] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-1a50c07c] .table-options[data-v-1a50c07c] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-1a50c07c] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-1a50c07c] {\n table-layout: auto; }\n .table[data-v-1a50c07c] tbody[data-v-1a50c07c] td[data-v-1a50c07c] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-1a50c07c] tbody[data-v-1a50c07c] td[data-v-1a50c07c]::-webkit-scrollbar {\n display: none; } }\n";
12536
12536
  n(css, {});function normalizeComponent (
12537
12537
  scriptExports,
12538
12538
  render,
@@ -13448,18 +13448,25 @@ n(css, {});function normalizeComponent (
13448
13448
  _this12.loading = false;
13449
13449
  });
13450
13450
  },
13451
- deleteItem: function deleteItem(id, index) {
13451
+ deleteItemBulk: function deleteItemBulk() {
13452
13452
  var _this13 = this;
13453
13453
  if (this.useVuexORM) {
13454
- return this.deleteItemVuex(id, index);
13454
+ return this.deleteItemBulkVuex();
13455
13455
  }
13456
13456
  if (!this.ajax) {
13457
- return this.deleteItemLocal(id, index);
13457
+ return this.deleteItemBulkLocal();
13458
13458
  }
13459
+ var ids = this.selectedItems.map(function (it) {
13460
+ return it.id;
13461
+ });
13459
13462
  this.loading = true;
13460
- axios.delete(this.apiUrl + "/" + this.modelName + "/" + id).then(function (response) {
13461
- _this13.items.splice(index, 1);
13462
- _this13.toastSuccess("Elemento eliminado.");
13463
+ axios.delete(this.apiUrl + "/" + this.modelName + "/bulk-destroy", {
13464
+ ids: ids
13465
+ }).then(function (response) {
13466
+ _this13.items = _this13.items.filter(function (it) {
13467
+ return ids.includes(it.id);
13468
+ });
13469
+ _this13.toastSuccess("Elemento/s eliminado.");
13463
13470
  _this13.$emit("itemDeleted", {});
13464
13471
  _this13.loading = false;
13465
13472
  }).catch(function (error) {
@@ -13467,80 +13474,148 @@ n(css, {});function normalizeComponent (
13467
13474
  _this13.loading = false;
13468
13475
  });
13469
13476
  },
13470
- deleteItemLocal: function deleteItemLocal(id, index) {
13477
+ deleteItemBulkLocal: function deleteItemBulkLocal() {
13471
13478
  var _this14 = this;
13472
13479
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
13473
- var itemIndex;
13480
+ var ids;
13474
13481
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13475
13482
  while (1) switch (_context2.prev = _context2.next) {
13483
+ case 0:
13484
+ ids = _this14.selectedItems.map(function (it) {
13485
+ return it.id;
13486
+ });
13487
+ _this14.items = _this14.items.filter(function (it) {
13488
+ return ids.includes(it.id);
13489
+ });
13490
+ _this14.item = null;
13491
+ _this14.toastSuccess("Elemento Eliminado");
13492
+ _this14.$emit("itemDeleted", {});
13493
+ _this14.loading = false;
13494
+ case 6:
13495
+ case "end":
13496
+ return _context2.stop();
13497
+ }
13498
+ }, _callee2);
13499
+ }))();
13500
+ },
13501
+ deleteItemBulkVuex: function deleteItemBulkVuex() {
13502
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
13503
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
13504
+ while (1) switch (_context3.prev = _context3.next) {
13505
+ case 0:
13506
+ case "end":
13507
+ return _context3.stop();
13508
+ }
13509
+ }, _callee3);
13510
+ }))();
13511
+ } /*
13512
+ let result = await this.model.api().delete('/' + id, {
13513
+ delete: 1
13514
+ });
13515
+
13516
+ console.debug("delete item vuex", result);
13517
+ let responseStatus = result.response.status;
13518
+
13519
+ if (result.response.data.error) {
13520
+ this.toastError(result.response.data.error);
13521
+ this.loading = false;
13522
+ return;
13523
+ }
13524
+
13525
+ this.toastSuccess("Elemento eliminado.");*/,
13526
+ deleteItem: function deleteItem(id, index) {
13527
+ var _this15 = this;
13528
+ if (this.useVuexORM) {
13529
+ return this.deleteItemVuex(id, index);
13530
+ }
13531
+ if (!this.ajax) {
13532
+ return this.deleteItemLocal(id, index);
13533
+ }
13534
+ this.loading = true;
13535
+ axios.delete(this.apiUrl + "/" + this.modelName + "/" + id).then(function (response) {
13536
+ _this15.items.splice(index, 1);
13537
+ _this15.toastSuccess("Elemento eliminado.");
13538
+ _this15.$emit("itemDeleted", {});
13539
+ _this15.loading = false;
13540
+ }).catch(function (error) {
13541
+ _this15.toastError(error);
13542
+ _this15.loading = false;
13543
+ });
13544
+ },
13545
+ deleteItemLocal: function deleteItemLocal(id, index) {
13546
+ var _this16 = this;
13547
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
13548
+ var itemIndex;
13549
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
13550
+ while (1) switch (_context4.prev = _context4.next) {
13476
13551
  case 0:
13477
13552
  if (id || index) {
13478
13553
  if (id) {
13479
- itemIndex = _this14.items.findIndex(function (item) {
13480
- return item.id == _this14.item.id;
13554
+ itemIndex = _this16.items.findIndex(function (item) {
13555
+ return item.id == _this16.item.id;
13481
13556
  });
13482
13557
  } else {
13483
13558
  itemIndex = index;
13484
13559
  }
13485
13560
 
13486
13561
  // Assuming this.items is an array
13487
- _this14.items.splice(itemIndex, 1);
13488
- _this14.item = null;
13489
- _this14.toastSuccess("Elemento Eliminado");
13490
- _this14.$emit("itemDeleted", {});
13562
+ _this16.items.splice(itemIndex, 1);
13563
+ _this16.item = null;
13564
+ _this16.toastSuccess("Elemento Eliminado");
13565
+ _this16.$emit("itemDeleted", {});
13491
13566
  } else {
13492
13567
  // Handle the case where there's no item.id or item.index
13493
13568
  console.error("Cannot delete item without ID or index");
13494
13569
  // You might want to show an error message or handle it in a way that fits your application.
13495
13570
  }
13496
- _this14.loading = false;
13571
+ _this16.loading = false;
13497
13572
  case 2:
13498
13573
  case "end":
13499
- return _context2.stop();
13574
+ return _context4.stop();
13500
13575
  }
13501
- }, _callee2);
13576
+ }, _callee4);
13502
13577
  }))();
13503
13578
  },
13504
13579
  deleteItemVuex: function deleteItemVuex(id, index) {
13505
- var _this15 = this;
13506
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
13580
+ var _this17 = this;
13581
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
13507
13582
  var result;
13508
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
13509
- while (1) switch (_context3.prev = _context3.next) {
13583
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
13584
+ while (1) switch (_context5.prev = _context5.next) {
13510
13585
  case 0:
13511
- _context3.next = 2;
13512
- return _this15.model.api().delete('/' + id, {
13586
+ _context5.next = 2;
13587
+ return _this17.model.api().delete('/' + id, {
13513
13588
  delete: 1
13514
13589
  });
13515
13590
  case 2:
13516
- result = _context3.sent;
13591
+ result = _context5.sent;
13517
13592
  console.debug("delete item vuex", result);
13518
13593
  result.response.status;
13519
13594
  if (!result.response.data.error) {
13520
- _context3.next = 9;
13595
+ _context5.next = 9;
13521
13596
  break;
13522
13597
  }
13523
- _this15.toastError(result.response.data.error);
13524
- _this15.loading = false;
13525
- return _context3.abrupt("return");
13598
+ _this17.toastError(result.response.data.error);
13599
+ _this17.loading = false;
13600
+ return _context5.abrupt("return");
13526
13601
  case 9:
13527
- _this15.toastSuccess("Elemento eliminado.");
13602
+ _this17.toastSuccess("Elemento eliminado.");
13528
13603
  case 10:
13529
13604
  case "end":
13530
- return _context3.stop();
13605
+ return _context5.stop();
13531
13606
  }
13532
- }, _callee3);
13607
+ }, _callee5);
13533
13608
  }))();
13534
13609
  },
13535
13610
  saveSort: function saveSort() {
13536
- var _this16 = this;
13611
+ var _this18 = this;
13537
13612
  if (this.orderable) {
13538
13613
  this.loading = true;
13539
13614
  var order = [];
13540
13615
  this.items.forEach(function (v, k) {
13541
13616
  order.push({
13542
13617
  id: v.id,
13543
- order: v[_this16.orderProp]
13618
+ order: v[_this18.orderProp]
13544
13619
  });
13545
13620
  });
13546
13621
  if (!this.ajax) {
@@ -13550,18 +13625,18 @@ n(css, {});function normalizeComponent (
13550
13625
  order: order
13551
13626
  }).then(function (response) {
13552
13627
  response.data;
13553
- _this16.toastSuccess("Orden Actualizado");
13554
- if (_this16.refreshAfterSave) _this16.refresh();
13555
- _this16.loading = false;
13628
+ _this18.toastSuccess("Orden Actualizado");
13629
+ if (_this18.refreshAfterSave) _this18.refresh();
13630
+ _this18.loading = false;
13556
13631
  }).catch(function (error) {
13557
13632
  //console.debug(error);
13558
- _this16.toastError(error);
13559
- _this16.loading = false;
13633
+ _this18.toastError(error);
13634
+ _this18.loading = false;
13560
13635
  });
13561
13636
  }
13562
13637
  },
13563
13638
  getArrayValue: function getArrayValue(value, displayProp) {
13564
- var _this17 = this;
13639
+ var _this19 = this;
13565
13640
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
13566
13641
  if (!Array.isArray(value)) return "N/A";
13567
13642
  var values = [];
@@ -13578,7 +13653,7 @@ n(css, {});function normalizeComponent (
13578
13653
  return "";
13579
13654
  }
13580
13655
  values.forEach(function (val) {
13581
- valuesFinal.push(_this17.getStateValue(val, options));
13656
+ valuesFinal.push(_this19.getStateValue(val, options));
13582
13657
  });
13583
13658
  return values.join(",");
13584
13659
  },
@@ -13600,270 +13675,270 @@ n(css, {});function normalizeComponent (
13600
13675
  return ops.join(", ");
13601
13676
  },
13602
13677
  saveItemVuex: function saveItemVuex() {
13603
- var _this18 = this;
13604
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
13678
+ var _this20 = this;
13679
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
13605
13680
  var jsondata, result, create;
13606
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
13607
- while (1) switch (_context4.prev = _context4.next) {
13681
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
13682
+ while (1) switch (_context6.prev = _context6.next) {
13608
13683
  case 0:
13609
- console.debug("save item 1", _this18.item);
13610
- jsondata = _this18.item.$toJson();
13611
- console.debug("save item 2", _this18.item, jsondata);
13684
+ console.debug("save item 1", _this20.item);
13685
+ jsondata = _this20.item.$toJson();
13686
+ console.debug("save item 2", _this20.item, jsondata);
13612
13687
  create = false;
13613
- if (!_this18.item.id) {
13614
- _context4.next = 12;
13688
+ if (!_this20.item.id) {
13689
+ _context6.next = 12;
13615
13690
  break;
13616
13691
  }
13617
- _context4.next = 8;
13618
- return _this18.model.api().put('/' + _this18.item.id, jsondata);
13692
+ _context6.next = 8;
13693
+ return _this20.model.api().put('/' + _this20.item.id, jsondata);
13619
13694
  case 8:
13620
- result = _context4.sent;
13695
+ result = _context6.sent;
13621
13696
  create = false;
13622
- _context4.next = 16;
13697
+ _context6.next = 16;
13623
13698
  break;
13624
13699
  case 12:
13625
- _context4.next = 14;
13626
- return _this18.model.api().post('', jsondata);
13700
+ _context6.next = 14;
13701
+ return _this20.model.api().post('', jsondata);
13627
13702
  case 14:
13628
- result = _context4.sent;
13703
+ result = _context6.sent;
13629
13704
  create = true;
13630
13705
  case 16:
13631
13706
  result.response.status;
13632
13707
  if (!result.response.data.error) {
13633
- _context4.next = 21;
13708
+ _context6.next = 21;
13634
13709
  break;
13635
13710
  }
13636
- _this18.toastError(result.response.data.error);
13637
- _this18.loading = false;
13638
- return _context4.abrupt("return");
13711
+ _this20.toastError(result.response.data.error);
13712
+ _this20.loading = false;
13713
+ return _context6.abrupt("return");
13639
13714
  case 21:
13640
13715
  result.save();
13641
- if (_this18.refreshAfterSave) _this18.refresh();
13642
- _this18.loading = false;
13643
- _this18.toastSuccess("Elemento Modificado");
13644
- if (_this18.hideModalAfterSave || create && _this18.hideModalAfterCreate || !create && _this18.hideModalAfterUpdate) {
13645
- _this18.$bvModal.hide("modal-form-item-" + _this18.modelName);
13716
+ if (_this20.refreshAfterSave) _this20.refresh();
13717
+ _this20.loading = false;
13718
+ _this20.toastSuccess("Elemento Modificado");
13719
+ if (_this20.hideModalAfterSave || create && _this20.hideModalAfterCreate || !create && _this20.hideModalAfterUpdate) {
13720
+ _this20.$bvModal.hide("modal-form-item-" + _this20.modelName);
13646
13721
  }
13647
13722
  case 26:
13648
13723
  case "end":
13649
- return _context4.stop();
13724
+ return _context6.stop();
13650
13725
  }
13651
- }, _callee4);
13726
+ }, _callee6);
13652
13727
  }))();
13653
13728
  },
13654
13729
  saveItemLocal: function saveItemLocal() {
13655
- var _this19 = this;
13656
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
13730
+ var _this21 = this;
13731
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
13657
13732
  var itemSave, itemIndex;
13658
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
13659
- while (1) switch (_context5.prev = _context5.next) {
13733
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
13734
+ while (1) switch (_context7.prev = _context7.next) {
13660
13735
  case 0:
13661
- itemSave = JSON.parse(JSON.stringify(_this19.item));
13662
- if (_this19.item.id || _this19.item.index) {
13663
- if (_this19.item.id) {
13664
- itemIndex = _this19.items.findIndex(function (item) {
13665
- return item.id == _this19.item.id;
13736
+ itemSave = JSON.parse(JSON.stringify(_this21.item));
13737
+ if (_this21.item.id || _this21.item.index) {
13738
+ if (_this21.item.id) {
13739
+ itemIndex = _this21.items.findIndex(function (item) {
13740
+ return item.id == _this21.item.id;
13666
13741
  });
13667
13742
  } else {
13668
- itemIndex = _this19.items.findIndex(function (item) {
13669
- return item.index == _this19.item.index;
13743
+ itemIndex = _this21.items.findIndex(function (item) {
13744
+ return item.index == _this21.item.index;
13670
13745
  });
13671
13746
  }
13672
- _this19.items[itemIndex] = itemSave;
13673
- if (_this19.hideModalAfterSave || _this19.hideModalAfterUpdate) {
13674
- _this19.$bvModal.hide("modal-form-item-" + _this19.modelName);
13747
+ _this21.items[itemIndex] = itemSave;
13748
+ if (_this21.hideModalAfterSave || _this21.hideModalAfterUpdate) {
13749
+ _this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
13675
13750
  }
13676
13751
  } else {
13677
- itemSave.index = _this19.items.length + 1;
13678
- _this19.items.push(itemSave);
13679
- if (_this19.hideModalAfterSave || _this19.hideModalAfterCreate) {
13680
- _this19.$bvModal.hide("modal-form-item-" + _this19.modelName);
13752
+ itemSave.index = _this21.items.length + 1;
13753
+ _this21.items.push(itemSave);
13754
+ if (_this21.hideModalAfterSave || _this21.hideModalAfterCreate) {
13755
+ _this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
13681
13756
  }
13682
13757
  }
13683
- _this19.toastSuccess("Elemento Modificado");
13684
- _this19.loading = false;
13758
+ _this21.toastSuccess("Elemento Modificado");
13759
+ _this21.loading = false;
13685
13760
  case 5:
13686
13761
  case "end":
13687
- return _context5.stop();
13762
+ return _context7.stop();
13688
13763
  }
13689
- }, _callee5);
13764
+ }, _callee7);
13690
13765
  }))();
13691
13766
  },
13692
13767
  loadOptions: function loadOptions() {
13693
- var _this20 = this;
13694
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
13768
+ var _this22 = this;
13769
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
13695
13770
  var i, column, options;
13696
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
13697
- while (1) switch (_context6.prev = _context6.next) {
13771
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
13772
+ while (1) switch (_context8.prev = _context8.next) {
13698
13773
  case 0:
13699
13774
  i = 0;
13700
13775
  case 1:
13701
- if (!(i < _this20.columns.length)) {
13702
- _context6.next = 12;
13776
+ if (!(i < _this22.columns.length)) {
13777
+ _context8.next = 12;
13703
13778
  break;
13704
13779
  }
13705
- column = _this20.columns[i];
13780
+ column = _this22.columns[i];
13706
13781
  if (!(column.options instanceof Promise)) {
13707
- _context6.next = 9;
13782
+ _context8.next = 9;
13708
13783
  break;
13709
13784
  }
13710
- _context6.next = 6;
13785
+ _context8.next = 6;
13711
13786
  return column.options;
13712
13787
  case 6:
13713
- options = _context6.sent;
13714
- _this20.$set(_this20.columns, i, _objectSpread2(_objectSpread2({}, column), {}, {
13788
+ options = _context8.sent;
13789
+ _this22.$set(_this22.columns, i, _objectSpread2(_objectSpread2({}, column), {}, {
13715
13790
  options: options
13716
13791
  }));
13717
- console.debug("Options promise", _this20.columns);
13792
+ console.debug("Options promise", _this22.columns);
13718
13793
  case 9:
13719
13794
  i++;
13720
- _context6.next = 1;
13795
+ _context8.next = 1;
13721
13796
  break;
13722
13797
  case 12:
13723
- _this20.optionsLoaded = true;
13798
+ _this22.optionsLoaded = true;
13724
13799
  case 13:
13725
13800
  case "end":
13726
- return _context6.stop();
13801
+ return _context8.stop();
13727
13802
  }
13728
- }, _callee6);
13803
+ }, _callee8);
13729
13804
  }))();
13730
13805
  },
13731
13806
  saveItem: function saveItem() {
13732
13807
  var _arguments4 = arguments,
13733
- _this21 = this;
13734
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
13808
+ _this23 = this;
13809
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
13735
13810
  var event, validation_result, validation_error_message, formData;
13736
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
13737
- while (1) switch (_context7.prev = _context7.next) {
13811
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
13812
+ while (1) switch (_context9.prev = _context9.next) {
13738
13813
  case 0:
13739
13814
  event = _arguments4.length > 0 && _arguments4[0] !== undefined ? _arguments4[0] : null;
13740
- _this21.loading = true;
13741
- if (!_this21.validate) {
13742
- _context7.next = 10;
13815
+ _this23.loading = true;
13816
+ if (!_this23.validate) {
13817
+ _context9.next = 10;
13743
13818
  break;
13744
13819
  }
13745
13820
  validation_result = true;
13746
- validation_error_message = _this21.messageDefaultValidationError;
13821
+ validation_error_message = _this23.messageDefaultValidationError;
13747
13822
  if (validation_result) {
13748
- _context7.next = 8;
13823
+ _context9.next = 8;
13749
13824
  break;
13750
13825
  }
13751
- _this21.toastError(validation_error_message);
13752
- return _context7.abrupt("return");
13826
+ _this23.toastError(validation_error_message);
13827
+ return _context9.abrupt("return");
13753
13828
  case 8:
13754
- _context7.next = 11;
13829
+ _context9.next = 11;
13755
13830
  break;
13756
13831
  case 10:
13757
13832
  if (event) event.preventDefault();
13758
13833
  case 11:
13759
- if (!_this21.useVuexORM) {
13760
- _context7.next = 13;
13834
+ if (!_this23.useVuexORM) {
13835
+ _context9.next = 13;
13761
13836
  break;
13762
13837
  }
13763
- return _context7.abrupt("return", _this21.saveItemVuex(event));
13838
+ return _context9.abrupt("return", _this23.saveItemVuex(event));
13764
13839
  case 13:
13765
- if (_this21.ajax) {
13766
- _context7.next = 15;
13840
+ if (_this23.ajax) {
13841
+ _context9.next = 15;
13767
13842
  break;
13768
13843
  }
13769
- return _context7.abrupt("return", _this21.saveItemLocal(event));
13844
+ return _context9.abrupt("return", _this23.saveItemLocal(event));
13770
13845
  case 15:
13771
- if (_this21.item.id) {
13772
- axios.put(_this21.apiUrl + "/" + _this21.modelName + "/" + _this21.item.id, _this21.item).then(function (response) {
13773
- if (_this21.hideModalAfterSave || _this21.hideModalAfterUpdate) {
13774
- _this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
13846
+ if (_this23.item.id) {
13847
+ axios.put(_this23.apiUrl + "/" + _this23.modelName + "/" + _this23.item.id, _this23.item).then(function (response) {
13848
+ if (_this23.hideModalAfterSave || _this23.hideModalAfterUpdate) {
13849
+ _this23.$bvModal.hide("modal-form-item-" + _this23.modelName);
13775
13850
  }
13776
13851
  var itemSv = response.data;
13777
- var itemIndex = _this21.items.findIndex(function (item) {
13778
- return item.id == _this21.item.id;
13852
+ var itemIndex = _this23.items.findIndex(function (item) {
13853
+ return item.id == _this23.item.id;
13779
13854
  });
13780
- _this21.items[itemIndex] = itemSv;
13781
- _this21.item = itemSv;
13782
- _this21.loading = false;
13783
- if (_this21.refreshAfterSave) _this21.refresh();
13784
- _this21.toastSuccess("Elemento Modificado");
13785
- _this21.$emit("itemSaved", {
13786
- item: _this21.item
13855
+ _this23.items[itemIndex] = itemSv;
13856
+ _this23.item = itemSv;
13857
+ _this23.loading = false;
13858
+ if (_this23.refreshAfterSave) _this23.refresh();
13859
+ _this23.toastSuccess("Elemento Modificado");
13860
+ _this23.$emit("itemSaved", {
13861
+ item: _this23.item
13787
13862
  });
13788
- _this21.$emit("itemUpdated", {
13789
- item: _this21.item
13863
+ _this23.$emit("itemUpdated", {
13864
+ item: _this23.item
13790
13865
  });
13791
13866
  }).catch(function (error) {
13792
- _this21.toastError(error);
13793
- _this21.loading = false;
13867
+ _this23.toastError(error);
13868
+ _this23.loading = false;
13794
13869
  });
13795
13870
  } else {
13796
- if (_this21.createMultipart) {
13871
+ if (_this23.createMultipart) {
13797
13872
  formData = new FormData();
13798
- Object.keys(_this21.item).forEach(function (key) {
13799
- if (_this21.item[key][0] && _this21.item[key][0].name) {
13800
- var files = _this21.item[key];
13873
+ Object.keys(_this23.item).forEach(function (key) {
13874
+ if (_this23.item[key][0] && _this23.item[key][0].name) {
13875
+ var files = _this23.item[key];
13801
13876
  for (var x = 0; x < files.length; x++) {
13802
- formData.append(key + "[]", _this21.item[key][x], _this21.item[key][x].name);
13877
+ formData.append(key + "[]", _this23.item[key][x], _this23.item[key][x].name);
13803
13878
  }
13804
- } else formData.append(key, _this21.item[key]);
13879
+ } else formData.append(key, _this23.item[key]);
13805
13880
  });
13806
- axios.post(_this21.apiUrl + "/" + _this21.modelName, formData).then(function (response) {
13807
- _this21.loading = false;
13808
- if (_this21.hideModalAfterSave || _this21.hideModalAfterCreate) {
13809
- _this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
13881
+ axios.post(_this23.apiUrl + "/" + _this23.modelName, formData).then(function (response) {
13882
+ _this23.loading = false;
13883
+ if (_this23.hideModalAfterSave || _this23.hideModalAfterCreate) {
13884
+ _this23.$bvModal.hide("modal-form-item-" + _this23.modelName);
13810
13885
  }
13811
13886
  if (response.data.success) {
13812
13887
  if (response.data.message) {
13813
- _this21.toastSuccess(response.data.message);
13888
+ _this23.toastSuccess(response.data.message);
13814
13889
  }
13815
13890
  return;
13816
13891
  }
13817
13892
  var itemSv = response.data;
13818
- _this21.items.push(itemSv);
13819
- _this21.item = itemSv;
13820
- if (_this21.refreshAfterSave) _this21.refresh();
13821
- _this21.toastSuccess("Elemento Creado");
13822
- _this21.$emit("itemSaved", {
13823
- item: _this21.item
13893
+ _this23.items.push(itemSv);
13894
+ _this23.item = itemSv;
13895
+ if (_this23.refreshAfterSave) _this23.refresh();
13896
+ _this23.toastSuccess("Elemento Creado");
13897
+ _this23.$emit("itemSaved", {
13898
+ item: _this23.item
13824
13899
  });
13825
- _this21.$emit("itemCreated", {
13826
- item: _this21.item
13900
+ _this23.$emit("itemCreated", {
13901
+ item: _this23.item
13827
13902
  });
13828
13903
  }).catch(function (error) {
13829
- _this21.toastError(error);
13830
- _this21.loading = false;
13904
+ _this23.toastError(error);
13905
+ _this23.loading = false;
13831
13906
  });
13832
13907
  } else {
13833
- axios.post(_this21.apiUrl + "/" + _this21.modelName, _this21.item).then(function (response) {
13834
- _this21.loading = false;
13835
- if (_this21.hideModalAfterSave || _this21.hideModalAfterUpdate) {
13836
- _this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
13908
+ axios.post(_this23.apiUrl + "/" + _this23.modelName, _this23.item).then(function (response) {
13909
+ _this23.loading = false;
13910
+ if (_this23.hideModalAfterSave || _this23.hideModalAfterUpdate) {
13911
+ _this23.$bvModal.hide("modal-form-item-" + _this23.modelName);
13837
13912
  }
13838
13913
  if (response.data.success) {
13839
13914
  if (response.data.message) {
13840
- _this21.toastSuccess(response.data.message);
13915
+ _this23.toastSuccess(response.data.message);
13841
13916
  }
13842
13917
  return;
13843
13918
  }
13844
13919
  var itemSv = response.data;
13845
- _this21.items.push(itemSv);
13846
- _this21.item = itemSv;
13847
- if (_this21.refreshAfterSave) _this21.refresh();
13848
- _this21.toastSuccess("Elemento Creado");
13849
- _this21.$emit("itemSaved", {
13850
- item: _this21.item
13920
+ _this23.items.push(itemSv);
13921
+ _this23.item = itemSv;
13922
+ if (_this23.refreshAfterSave) _this23.refresh();
13923
+ _this23.toastSuccess("Elemento Creado");
13924
+ _this23.$emit("itemSaved", {
13925
+ item: _this23.item
13851
13926
  });
13852
- _this21.$emit("itemCreated", {
13853
- item: _this21.item
13927
+ _this23.$emit("itemCreated", {
13928
+ item: _this23.item
13854
13929
  });
13855
13930
  }).catch(function (error) {
13856
- _this21.toastError(error);
13857
- _this21.loading = false;
13931
+ _this23.toastError(error);
13932
+ _this23.loading = false;
13858
13933
  });
13859
13934
  }
13860
13935
  }
13861
13936
  if (event) event.preventDefault();
13862
13937
  case 17:
13863
13938
  case "end":
13864
- return _context7.stop();
13939
+ return _context9.stop();
13865
13940
  }
13866
- }, _callee7);
13941
+ }, _callee9);
13867
13942
  }))();
13868
13943
  },
13869
13944
  clearItems: function clearItems() {
@@ -13922,11 +13997,11 @@ n(css, {});function normalizeComponent (
13922
13997
  });
13923
13998
  },
13924
13999
  onChangeFilter: function onChangeFilter(event) {
13925
- var _this22 = this;
14000
+ var _this24 = this;
13926
14001
  this.forceRecomputeCounter++;
13927
14002
  console.debug("Filters debug ", this.finalFilters, this.internalFilter, this.internalFilters, this.filter, this.filters);
13928
14003
  setTimeout(function () {
13929
- _this22.refresh();
14004
+ _this24.refresh();
13930
14005
  }, 1);
13931
14006
  },
13932
14007
  onPaginationChange: function onPaginationChange(page) {
@@ -14897,7 +14972,7 @@ var _sfc_render = function render() {
14897
14972
  }) : _vm._e()], 2)], 1);
14898
14973
  };
14899
14974
  var _sfc_staticRenderFns = [];
14900
- var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "6dad4180", null, null);
14975
+ var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "1a50c07c", null, null);
14901
14976
  var component$1 = __component__.exports;// Import vue component
14902
14977
 
14903
14978
  // Default export is installable instance of component.