vue-laravel-crud 1.6.7 → 1.6.9
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.
- package/dist/vue-laravel-crud.esm.js +43 -4
- package/dist/vue-laravel-crud.min.js +3 -3
- package/dist/vue-laravel-crud.ssr.js +188 -148
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +31 -6
|
@@ -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-
|
|
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-aefbf0b6]:last-child,\ntr td[data-v-aefbf0b6]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-aefbf0b6] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-aefbf0b6] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-aefbf0b6] .crud-title[data-v-aefbf0b6] {\n margin: 0; }\n .crud-header[data-v-aefbf0b6] .crud-search[data-v-aefbf0b6] {\n max-width: 15rem; }\n .crud-header[data-v-aefbf0b6] .crud-search[data-v-aefbf0b6] .btn[data-v-aefbf0b6] {\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-aefbf0b6] .crud-search[data-v-aefbf0b6] .btn[data-v-aefbf0b6].open[data-v-aefbf0b6] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-aefbf0b6] .table-options[data-v-aefbf0b6] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-aefbf0b6] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-aefbf0b6] {\n table-layout: auto; }\n .table[data-v-aefbf0b6] tbody[data-v-aefbf0b6] td[data-v-aefbf0b6] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-aefbf0b6] tbody[data-v-aefbf0b6] td[data-v-aefbf0b6]::-webkit-scrollbar {\n display: none; } }\n";
|
|
12536
12536
|
n(css, {});function normalizeComponent (
|
|
12537
12537
|
scriptExports,
|
|
12538
12538
|
render,
|
|
@@ -12950,6 +12950,10 @@ n(css, {});function normalizeComponent (
|
|
|
12950
12950
|
principalSortColumn: {
|
|
12951
12951
|
type: String,
|
|
12952
12952
|
default: "id"
|
|
12953
|
+
},
|
|
12954
|
+
bulkDelete: {
|
|
12955
|
+
type: Boolean,
|
|
12956
|
+
default: false
|
|
12953
12957
|
}
|
|
12954
12958
|
},
|
|
12955
12959
|
mounted: function mounted() {
|
|
@@ -13448,8 +13452,26 @@ n(css, {});function normalizeComponent (
|
|
|
13448
13452
|
_this12.loading = false;
|
|
13449
13453
|
});
|
|
13450
13454
|
},
|
|
13451
|
-
|
|
13455
|
+
confirmBulkDelete: function confirmBulkDelete() {
|
|
13452
13456
|
var _this13 = this;
|
|
13457
|
+
this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
|
|
13458
|
+
size: "sm",
|
|
13459
|
+
buttonSize: "sm",
|
|
13460
|
+
okVariant: "danger",
|
|
13461
|
+
okTitle: this.messageRemove,
|
|
13462
|
+
cancelTitle: "NO",
|
|
13463
|
+
centered: true
|
|
13464
|
+
}).then(function (value) {
|
|
13465
|
+
if (value) {
|
|
13466
|
+
_this13.deleteItemBulk();
|
|
13467
|
+
}
|
|
13468
|
+
}).catch(function (error) {
|
|
13469
|
+
_this13.toastError(error);
|
|
13470
|
+
_this13.loading = false;
|
|
13471
|
+
});
|
|
13472
|
+
},
|
|
13473
|
+
deleteItemBulk: function deleteItemBulk() {
|
|
13474
|
+
var _this14 = this;
|
|
13453
13475
|
if (this.useVuexORM) {
|
|
13454
13476
|
return this.deleteItemBulkVuex();
|
|
13455
13477
|
}
|
|
@@ -13463,34 +13485,34 @@ n(css, {});function normalizeComponent (
|
|
|
13463
13485
|
axios.delete(this.apiUrl + "/" + this.modelName + "/bulk-destroy", {
|
|
13464
13486
|
ids: ids
|
|
13465
13487
|
}).then(function (response) {
|
|
13466
|
-
|
|
13488
|
+
_this14.items = _this14.items.filter(function (it) {
|
|
13467
13489
|
return ids.includes(it.id);
|
|
13468
13490
|
});
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13491
|
+
_this14.toastSuccess("Elemento/s eliminado.");
|
|
13492
|
+
_this14.$emit("itemDeleted", {});
|
|
13493
|
+
_this14.loading = false;
|
|
13472
13494
|
}).catch(function (error) {
|
|
13473
|
-
|
|
13474
|
-
|
|
13495
|
+
_this14.toastError(error);
|
|
13496
|
+
_this14.loading = false;
|
|
13475
13497
|
});
|
|
13476
13498
|
},
|
|
13477
13499
|
deleteItemBulkLocal: function deleteItemBulkLocal() {
|
|
13478
|
-
var
|
|
13500
|
+
var _this15 = this;
|
|
13479
13501
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
13480
13502
|
var ids;
|
|
13481
13503
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
13482
13504
|
while (1) switch (_context2.prev = _context2.next) {
|
|
13483
13505
|
case 0:
|
|
13484
|
-
ids =
|
|
13506
|
+
ids = _this15.selectedItems.map(function (it) {
|
|
13485
13507
|
return it.id;
|
|
13486
13508
|
});
|
|
13487
|
-
|
|
13509
|
+
_this15.items = _this15.items.filter(function (it) {
|
|
13488
13510
|
return ids.includes(it.id);
|
|
13489
13511
|
});
|
|
13490
|
-
|
|
13491
|
-
|
|
13492
|
-
|
|
13493
|
-
|
|
13512
|
+
_this15.item = null;
|
|
13513
|
+
_this15.toastSuccess("Elemento Eliminado");
|
|
13514
|
+
_this15.$emit("itemDeleted", {});
|
|
13515
|
+
_this15.loading = false;
|
|
13494
13516
|
case 6:
|
|
13495
13517
|
case "end":
|
|
13496
13518
|
return _context2.stop();
|
|
@@ -13524,7 +13546,7 @@ n(css, {});function normalizeComponent (
|
|
|
13524
13546
|
|
|
13525
13547
|
this.toastSuccess("Elemento eliminado.");*/,
|
|
13526
13548
|
deleteItem: function deleteItem(id, index) {
|
|
13527
|
-
var
|
|
13549
|
+
var _this16 = this;
|
|
13528
13550
|
if (this.useVuexORM) {
|
|
13529
13551
|
return this.deleteItemVuex(id, index);
|
|
13530
13552
|
}
|
|
@@ -13533,17 +13555,17 @@ n(css, {});function normalizeComponent (
|
|
|
13533
13555
|
}
|
|
13534
13556
|
this.loading = true;
|
|
13535
13557
|
axios.delete(this.apiUrl + "/" + this.modelName + "/" + id).then(function (response) {
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
|
|
13558
|
+
_this16.items.splice(index, 1);
|
|
13559
|
+
_this16.toastSuccess("Elemento eliminado.");
|
|
13560
|
+
_this16.$emit("itemDeleted", {});
|
|
13561
|
+
_this16.loading = false;
|
|
13540
13562
|
}).catch(function (error) {
|
|
13541
|
-
|
|
13542
|
-
|
|
13563
|
+
_this16.toastError(error);
|
|
13564
|
+
_this16.loading = false;
|
|
13543
13565
|
});
|
|
13544
13566
|
},
|
|
13545
13567
|
deleteItemLocal: function deleteItemLocal(id, index) {
|
|
13546
|
-
var
|
|
13568
|
+
var _this17 = this;
|
|
13547
13569
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
13548
13570
|
var itemIndex;
|
|
13549
13571
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
@@ -13551,24 +13573,24 @@ n(css, {});function normalizeComponent (
|
|
|
13551
13573
|
case 0:
|
|
13552
13574
|
if (id || index) {
|
|
13553
13575
|
if (id) {
|
|
13554
|
-
itemIndex =
|
|
13555
|
-
return item.id ==
|
|
13576
|
+
itemIndex = _this17.items.findIndex(function (item) {
|
|
13577
|
+
return item.id == _this17.item.id;
|
|
13556
13578
|
});
|
|
13557
13579
|
} else {
|
|
13558
13580
|
itemIndex = index;
|
|
13559
13581
|
}
|
|
13560
13582
|
|
|
13561
13583
|
// Assuming this.items is an array
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13584
|
+
_this17.items.splice(itemIndex, 1);
|
|
13585
|
+
_this17.item = null;
|
|
13586
|
+
_this17.toastSuccess("Elemento Eliminado");
|
|
13587
|
+
_this17.$emit("itemDeleted", {});
|
|
13566
13588
|
} else {
|
|
13567
13589
|
// Handle the case where there's no item.id or item.index
|
|
13568
13590
|
console.error("Cannot delete item without ID or index");
|
|
13569
13591
|
// You might want to show an error message or handle it in a way that fits your application.
|
|
13570
13592
|
}
|
|
13571
|
-
|
|
13593
|
+
_this17.loading = false;
|
|
13572
13594
|
case 2:
|
|
13573
13595
|
case "end":
|
|
13574
13596
|
return _context4.stop();
|
|
@@ -13577,14 +13599,14 @@ n(css, {});function normalizeComponent (
|
|
|
13577
13599
|
}))();
|
|
13578
13600
|
},
|
|
13579
13601
|
deleteItemVuex: function deleteItemVuex(id, index) {
|
|
13580
|
-
var
|
|
13602
|
+
var _this18 = this;
|
|
13581
13603
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
13582
13604
|
var result;
|
|
13583
13605
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
13584
13606
|
while (1) switch (_context5.prev = _context5.next) {
|
|
13585
13607
|
case 0:
|
|
13586
13608
|
_context5.next = 2;
|
|
13587
|
-
return
|
|
13609
|
+
return _this18.model.api().delete('/' + id, {
|
|
13588
13610
|
delete: 1
|
|
13589
13611
|
});
|
|
13590
13612
|
case 2:
|
|
@@ -13595,11 +13617,11 @@ n(css, {});function normalizeComponent (
|
|
|
13595
13617
|
_context5.next = 9;
|
|
13596
13618
|
break;
|
|
13597
13619
|
}
|
|
13598
|
-
|
|
13599
|
-
|
|
13620
|
+
_this18.toastError(result.response.data.error);
|
|
13621
|
+
_this18.loading = false;
|
|
13600
13622
|
return _context5.abrupt("return");
|
|
13601
13623
|
case 9:
|
|
13602
|
-
|
|
13624
|
+
_this18.toastSuccess("Elemento eliminado.");
|
|
13603
13625
|
case 10:
|
|
13604
13626
|
case "end":
|
|
13605
13627
|
return _context5.stop();
|
|
@@ -13608,14 +13630,14 @@ n(css, {});function normalizeComponent (
|
|
|
13608
13630
|
}))();
|
|
13609
13631
|
},
|
|
13610
13632
|
saveSort: function saveSort() {
|
|
13611
|
-
var
|
|
13633
|
+
var _this19 = this;
|
|
13612
13634
|
if (this.orderable) {
|
|
13613
13635
|
this.loading = true;
|
|
13614
13636
|
var order = [];
|
|
13615
13637
|
this.items.forEach(function (v, k) {
|
|
13616
13638
|
order.push({
|
|
13617
13639
|
id: v.id,
|
|
13618
|
-
order: v[
|
|
13640
|
+
order: v[_this19.orderProp]
|
|
13619
13641
|
});
|
|
13620
13642
|
});
|
|
13621
13643
|
if (!this.ajax) {
|
|
@@ -13625,18 +13647,18 @@ n(css, {});function normalizeComponent (
|
|
|
13625
13647
|
order: order
|
|
13626
13648
|
}).then(function (response) {
|
|
13627
13649
|
response.data;
|
|
13628
|
-
|
|
13629
|
-
if (
|
|
13630
|
-
|
|
13650
|
+
_this19.toastSuccess("Orden Actualizado");
|
|
13651
|
+
if (_this19.refreshAfterSave) _this19.refresh();
|
|
13652
|
+
_this19.loading = false;
|
|
13631
13653
|
}).catch(function (error) {
|
|
13632
13654
|
//console.debug(error);
|
|
13633
|
-
|
|
13634
|
-
|
|
13655
|
+
_this19.toastError(error);
|
|
13656
|
+
_this19.loading = false;
|
|
13635
13657
|
});
|
|
13636
13658
|
}
|
|
13637
13659
|
},
|
|
13638
13660
|
getArrayValue: function getArrayValue(value, displayProp) {
|
|
13639
|
-
var
|
|
13661
|
+
var _this20 = this;
|
|
13640
13662
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
13641
13663
|
if (!Array.isArray(value)) return "N/A";
|
|
13642
13664
|
var values = [];
|
|
@@ -13653,7 +13675,7 @@ n(css, {});function normalizeComponent (
|
|
|
13653
13675
|
return "";
|
|
13654
13676
|
}
|
|
13655
13677
|
values.forEach(function (val) {
|
|
13656
|
-
valuesFinal.push(
|
|
13678
|
+
valuesFinal.push(_this20.getStateValue(val, options));
|
|
13657
13679
|
});
|
|
13658
13680
|
return values.join(",");
|
|
13659
13681
|
},
|
|
@@ -13675,22 +13697,22 @@ n(css, {});function normalizeComponent (
|
|
|
13675
13697
|
return ops.join(", ");
|
|
13676
13698
|
},
|
|
13677
13699
|
saveItemVuex: function saveItemVuex() {
|
|
13678
|
-
var
|
|
13700
|
+
var _this21 = this;
|
|
13679
13701
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
13680
13702
|
var jsondata, result, create;
|
|
13681
13703
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
13682
13704
|
while (1) switch (_context6.prev = _context6.next) {
|
|
13683
13705
|
case 0:
|
|
13684
|
-
console.debug("save item 1",
|
|
13685
|
-
jsondata =
|
|
13686
|
-
console.debug("save item 2",
|
|
13706
|
+
console.debug("save item 1", _this21.item);
|
|
13707
|
+
jsondata = _this21.item.$toJson();
|
|
13708
|
+
console.debug("save item 2", _this21.item, jsondata);
|
|
13687
13709
|
create = false;
|
|
13688
|
-
if (!
|
|
13710
|
+
if (!_this21.item.id) {
|
|
13689
13711
|
_context6.next = 12;
|
|
13690
13712
|
break;
|
|
13691
13713
|
}
|
|
13692
13714
|
_context6.next = 8;
|
|
13693
|
-
return
|
|
13715
|
+
return _this21.model.api().put('/' + _this21.item.id, jsondata);
|
|
13694
13716
|
case 8:
|
|
13695
13717
|
result = _context6.sent;
|
|
13696
13718
|
create = false;
|
|
@@ -13698,7 +13720,7 @@ n(css, {});function normalizeComponent (
|
|
|
13698
13720
|
break;
|
|
13699
13721
|
case 12:
|
|
13700
13722
|
_context6.next = 14;
|
|
13701
|
-
return
|
|
13723
|
+
return _this21.model.api().post('', jsondata);
|
|
13702
13724
|
case 14:
|
|
13703
13725
|
result = _context6.sent;
|
|
13704
13726
|
create = true;
|
|
@@ -13708,16 +13730,16 @@ n(css, {});function normalizeComponent (
|
|
|
13708
13730
|
_context6.next = 21;
|
|
13709
13731
|
break;
|
|
13710
13732
|
}
|
|
13711
|
-
|
|
13712
|
-
|
|
13733
|
+
_this21.toastError(result.response.data.error);
|
|
13734
|
+
_this21.loading = false;
|
|
13713
13735
|
return _context6.abrupt("return");
|
|
13714
13736
|
case 21:
|
|
13715
13737
|
result.save();
|
|
13716
|
-
if (
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
if (
|
|
13720
|
-
|
|
13738
|
+
if (_this21.refreshAfterSave) _this21.refresh();
|
|
13739
|
+
_this21.loading = false;
|
|
13740
|
+
_this21.toastSuccess("Elemento Modificado");
|
|
13741
|
+
if (_this21.hideModalAfterSave || create && _this21.hideModalAfterCreate || !create && _this21.hideModalAfterUpdate) {
|
|
13742
|
+
_this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
|
|
13721
13743
|
}
|
|
13722
13744
|
case 26:
|
|
13723
13745
|
case "end":
|
|
@@ -13727,36 +13749,36 @@ n(css, {});function normalizeComponent (
|
|
|
13727
13749
|
}))();
|
|
13728
13750
|
},
|
|
13729
13751
|
saveItemLocal: function saveItemLocal() {
|
|
13730
|
-
var
|
|
13752
|
+
var _this22 = this;
|
|
13731
13753
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
13732
13754
|
var itemSave, itemIndex;
|
|
13733
13755
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
13734
13756
|
while (1) switch (_context7.prev = _context7.next) {
|
|
13735
13757
|
case 0:
|
|
13736
|
-
itemSave = JSON.parse(JSON.stringify(
|
|
13737
|
-
if (
|
|
13738
|
-
if (
|
|
13739
|
-
itemIndex =
|
|
13740
|
-
return item.id ==
|
|
13758
|
+
itemSave = JSON.parse(JSON.stringify(_this22.item));
|
|
13759
|
+
if (_this22.item.id || _this22.item.index) {
|
|
13760
|
+
if (_this22.item.id) {
|
|
13761
|
+
itemIndex = _this22.items.findIndex(function (item) {
|
|
13762
|
+
return item.id == _this22.item.id;
|
|
13741
13763
|
});
|
|
13742
13764
|
} else {
|
|
13743
|
-
itemIndex =
|
|
13744
|
-
return item.index ==
|
|
13765
|
+
itemIndex = _this22.items.findIndex(function (item) {
|
|
13766
|
+
return item.index == _this22.item.index;
|
|
13745
13767
|
});
|
|
13746
13768
|
}
|
|
13747
|
-
|
|
13748
|
-
if (
|
|
13749
|
-
|
|
13769
|
+
_this22.items[itemIndex] = itemSave;
|
|
13770
|
+
if (_this22.hideModalAfterSave || _this22.hideModalAfterUpdate) {
|
|
13771
|
+
_this22.$bvModal.hide("modal-form-item-" + _this22.modelName);
|
|
13750
13772
|
}
|
|
13751
13773
|
} else {
|
|
13752
|
-
itemSave.index =
|
|
13753
|
-
|
|
13754
|
-
if (
|
|
13755
|
-
|
|
13774
|
+
itemSave.index = _this22.items.length + 1;
|
|
13775
|
+
_this22.items.push(itemSave);
|
|
13776
|
+
if (_this22.hideModalAfterSave || _this22.hideModalAfterCreate) {
|
|
13777
|
+
_this22.$bvModal.hide("modal-form-item-" + _this22.modelName);
|
|
13756
13778
|
}
|
|
13757
13779
|
}
|
|
13758
|
-
|
|
13759
|
-
|
|
13780
|
+
_this22.toastSuccess("Elemento Modificado");
|
|
13781
|
+
_this22.loading = false;
|
|
13760
13782
|
case 5:
|
|
13761
13783
|
case "end":
|
|
13762
13784
|
return _context7.stop();
|
|
@@ -13765,7 +13787,7 @@ n(css, {});function normalizeComponent (
|
|
|
13765
13787
|
}))();
|
|
13766
13788
|
},
|
|
13767
13789
|
loadOptions: function loadOptions() {
|
|
13768
|
-
var
|
|
13790
|
+
var _this23 = this;
|
|
13769
13791
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
13770
13792
|
var i, column, options;
|
|
13771
13793
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
@@ -13773,11 +13795,11 @@ n(css, {});function normalizeComponent (
|
|
|
13773
13795
|
case 0:
|
|
13774
13796
|
i = 0;
|
|
13775
13797
|
case 1:
|
|
13776
|
-
if (!(i <
|
|
13798
|
+
if (!(i < _this23.columns.length)) {
|
|
13777
13799
|
_context8.next = 12;
|
|
13778
13800
|
break;
|
|
13779
13801
|
}
|
|
13780
|
-
column =
|
|
13802
|
+
column = _this23.columns[i];
|
|
13781
13803
|
if (!(column.options instanceof Promise)) {
|
|
13782
13804
|
_context8.next = 9;
|
|
13783
13805
|
break;
|
|
@@ -13786,16 +13808,16 @@ n(css, {});function normalizeComponent (
|
|
|
13786
13808
|
return column.options;
|
|
13787
13809
|
case 6:
|
|
13788
13810
|
options = _context8.sent;
|
|
13789
|
-
|
|
13811
|
+
_this23.$set(_this23.columns, i, _objectSpread2(_objectSpread2({}, column), {}, {
|
|
13790
13812
|
options: options
|
|
13791
13813
|
}));
|
|
13792
|
-
console.debug("Options promise",
|
|
13814
|
+
console.debug("Options promise", _this23.columns);
|
|
13793
13815
|
case 9:
|
|
13794
13816
|
i++;
|
|
13795
13817
|
_context8.next = 1;
|
|
13796
13818
|
break;
|
|
13797
13819
|
case 12:
|
|
13798
|
-
|
|
13820
|
+
_this23.optionsLoaded = true;
|
|
13799
13821
|
case 13:
|
|
13800
13822
|
case "end":
|
|
13801
13823
|
return _context8.stop();
|
|
@@ -13805,25 +13827,25 @@ n(css, {});function normalizeComponent (
|
|
|
13805
13827
|
},
|
|
13806
13828
|
saveItem: function saveItem() {
|
|
13807
13829
|
var _arguments4 = arguments,
|
|
13808
|
-
|
|
13830
|
+
_this24 = this;
|
|
13809
13831
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
13810
13832
|
var event, validation_result, validation_error_message, formData;
|
|
13811
13833
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
13812
13834
|
while (1) switch (_context9.prev = _context9.next) {
|
|
13813
13835
|
case 0:
|
|
13814
13836
|
event = _arguments4.length > 0 && _arguments4[0] !== undefined ? _arguments4[0] : null;
|
|
13815
|
-
|
|
13816
|
-
if (!
|
|
13837
|
+
_this24.loading = true;
|
|
13838
|
+
if (!_this24.validate) {
|
|
13817
13839
|
_context9.next = 10;
|
|
13818
13840
|
break;
|
|
13819
13841
|
}
|
|
13820
13842
|
validation_result = true;
|
|
13821
|
-
validation_error_message =
|
|
13843
|
+
validation_error_message = _this24.messageDefaultValidationError;
|
|
13822
13844
|
if (validation_result) {
|
|
13823
13845
|
_context9.next = 8;
|
|
13824
13846
|
break;
|
|
13825
13847
|
}
|
|
13826
|
-
|
|
13848
|
+
_this24.toastError(validation_error_message);
|
|
13827
13849
|
return _context9.abrupt("return");
|
|
13828
13850
|
case 8:
|
|
13829
13851
|
_context9.next = 11;
|
|
@@ -13831,105 +13853,105 @@ n(css, {});function normalizeComponent (
|
|
|
13831
13853
|
case 10:
|
|
13832
13854
|
if (event) event.preventDefault();
|
|
13833
13855
|
case 11:
|
|
13834
|
-
if (!
|
|
13856
|
+
if (!_this24.useVuexORM) {
|
|
13835
13857
|
_context9.next = 13;
|
|
13836
13858
|
break;
|
|
13837
13859
|
}
|
|
13838
|
-
return _context9.abrupt("return",
|
|
13860
|
+
return _context9.abrupt("return", _this24.saveItemVuex(event));
|
|
13839
13861
|
case 13:
|
|
13840
|
-
if (
|
|
13862
|
+
if (_this24.ajax) {
|
|
13841
13863
|
_context9.next = 15;
|
|
13842
13864
|
break;
|
|
13843
13865
|
}
|
|
13844
|
-
return _context9.abrupt("return",
|
|
13866
|
+
return _context9.abrupt("return", _this24.saveItemLocal(event));
|
|
13845
13867
|
case 15:
|
|
13846
|
-
if (
|
|
13847
|
-
axios.put(
|
|
13848
|
-
if (
|
|
13849
|
-
|
|
13868
|
+
if (_this24.item.id) {
|
|
13869
|
+
axios.put(_this24.apiUrl + "/" + _this24.modelName + "/" + _this24.item.id, _this24.item).then(function (response) {
|
|
13870
|
+
if (_this24.hideModalAfterSave || _this24.hideModalAfterUpdate) {
|
|
13871
|
+
_this24.$bvModal.hide("modal-form-item-" + _this24.modelName);
|
|
13850
13872
|
}
|
|
13851
13873
|
var itemSv = response.data;
|
|
13852
|
-
var itemIndex =
|
|
13853
|
-
return item.id ==
|
|
13874
|
+
var itemIndex = _this24.items.findIndex(function (item) {
|
|
13875
|
+
return item.id == _this24.item.id;
|
|
13854
13876
|
});
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
if (
|
|
13859
|
-
|
|
13860
|
-
|
|
13861
|
-
item:
|
|
13877
|
+
_this24.items[itemIndex] = itemSv;
|
|
13878
|
+
_this24.item = itemSv;
|
|
13879
|
+
_this24.loading = false;
|
|
13880
|
+
if (_this24.refreshAfterSave) _this24.refresh();
|
|
13881
|
+
_this24.toastSuccess("Elemento Modificado");
|
|
13882
|
+
_this24.$emit("itemSaved", {
|
|
13883
|
+
item: _this24.item
|
|
13862
13884
|
});
|
|
13863
|
-
|
|
13864
|
-
item:
|
|
13885
|
+
_this24.$emit("itemUpdated", {
|
|
13886
|
+
item: _this24.item
|
|
13865
13887
|
});
|
|
13866
13888
|
}).catch(function (error) {
|
|
13867
|
-
|
|
13868
|
-
|
|
13889
|
+
_this24.toastError(error);
|
|
13890
|
+
_this24.loading = false;
|
|
13869
13891
|
});
|
|
13870
13892
|
} else {
|
|
13871
|
-
if (
|
|
13893
|
+
if (_this24.createMultipart) {
|
|
13872
13894
|
formData = new FormData();
|
|
13873
|
-
Object.keys(
|
|
13874
|
-
if (
|
|
13875
|
-
var files =
|
|
13895
|
+
Object.keys(_this24.item).forEach(function (key) {
|
|
13896
|
+
if (_this24.item[key][0] && _this24.item[key][0].name) {
|
|
13897
|
+
var files = _this24.item[key];
|
|
13876
13898
|
for (var x = 0; x < files.length; x++) {
|
|
13877
|
-
formData.append(key + "[]",
|
|
13899
|
+
formData.append(key + "[]", _this24.item[key][x], _this24.item[key][x].name);
|
|
13878
13900
|
}
|
|
13879
|
-
} else formData.append(key,
|
|
13901
|
+
} else formData.append(key, _this24.item[key]);
|
|
13880
13902
|
});
|
|
13881
|
-
axios.post(
|
|
13882
|
-
|
|
13883
|
-
if (
|
|
13884
|
-
|
|
13903
|
+
axios.post(_this24.apiUrl + "/" + _this24.modelName, formData).then(function (response) {
|
|
13904
|
+
_this24.loading = false;
|
|
13905
|
+
if (_this24.hideModalAfterSave || _this24.hideModalAfterCreate) {
|
|
13906
|
+
_this24.$bvModal.hide("modal-form-item-" + _this24.modelName);
|
|
13885
13907
|
}
|
|
13886
13908
|
if (response.data.success) {
|
|
13887
13909
|
if (response.data.message) {
|
|
13888
|
-
|
|
13910
|
+
_this24.toastSuccess(response.data.message);
|
|
13889
13911
|
}
|
|
13890
13912
|
return;
|
|
13891
13913
|
}
|
|
13892
13914
|
var itemSv = response.data;
|
|
13893
|
-
|
|
13894
|
-
|
|
13895
|
-
if (
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
item:
|
|
13915
|
+
_this24.items.push(itemSv);
|
|
13916
|
+
_this24.item = itemSv;
|
|
13917
|
+
if (_this24.refreshAfterSave) _this24.refresh();
|
|
13918
|
+
_this24.toastSuccess("Elemento Creado");
|
|
13919
|
+
_this24.$emit("itemSaved", {
|
|
13920
|
+
item: _this24.item
|
|
13899
13921
|
});
|
|
13900
|
-
|
|
13901
|
-
item:
|
|
13922
|
+
_this24.$emit("itemCreated", {
|
|
13923
|
+
item: _this24.item
|
|
13902
13924
|
});
|
|
13903
13925
|
}).catch(function (error) {
|
|
13904
|
-
|
|
13905
|
-
|
|
13926
|
+
_this24.toastError(error);
|
|
13927
|
+
_this24.loading = false;
|
|
13906
13928
|
});
|
|
13907
13929
|
} else {
|
|
13908
|
-
axios.post(
|
|
13909
|
-
|
|
13910
|
-
if (
|
|
13911
|
-
|
|
13930
|
+
axios.post(_this24.apiUrl + "/" + _this24.modelName, _this24.item).then(function (response) {
|
|
13931
|
+
_this24.loading = false;
|
|
13932
|
+
if (_this24.hideModalAfterSave || _this24.hideModalAfterUpdate) {
|
|
13933
|
+
_this24.$bvModal.hide("modal-form-item-" + _this24.modelName);
|
|
13912
13934
|
}
|
|
13913
13935
|
if (response.data.success) {
|
|
13914
13936
|
if (response.data.message) {
|
|
13915
|
-
|
|
13937
|
+
_this24.toastSuccess(response.data.message);
|
|
13916
13938
|
}
|
|
13917
13939
|
return;
|
|
13918
13940
|
}
|
|
13919
13941
|
var itemSv = response.data;
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
if (
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
item:
|
|
13942
|
+
_this24.items.push(itemSv);
|
|
13943
|
+
_this24.item = itemSv;
|
|
13944
|
+
if (_this24.refreshAfterSave) _this24.refresh();
|
|
13945
|
+
_this24.toastSuccess("Elemento Creado");
|
|
13946
|
+
_this24.$emit("itemSaved", {
|
|
13947
|
+
item: _this24.item
|
|
13926
13948
|
});
|
|
13927
|
-
|
|
13928
|
-
item:
|
|
13949
|
+
_this24.$emit("itemCreated", {
|
|
13950
|
+
item: _this24.item
|
|
13929
13951
|
});
|
|
13930
13952
|
}).catch(function (error) {
|
|
13931
|
-
|
|
13932
|
-
|
|
13953
|
+
_this24.toastError(error);
|
|
13954
|
+
_this24.loading = false;
|
|
13933
13955
|
});
|
|
13934
13956
|
}
|
|
13935
13957
|
}
|
|
@@ -13997,11 +14019,11 @@ n(css, {});function normalizeComponent (
|
|
|
13997
14019
|
});
|
|
13998
14020
|
},
|
|
13999
14021
|
onChangeFilter: function onChangeFilter(event) {
|
|
14000
|
-
var
|
|
14022
|
+
var _this25 = this;
|
|
14001
14023
|
this.forceRecomputeCounter++;
|
|
14002
14024
|
console.debug("Filters debug ", this.finalFilters, this.internalFilter, this.internalFilters, this.filter, this.filters);
|
|
14003
14025
|
setTimeout(function () {
|
|
14004
|
-
|
|
14026
|
+
_this25.refresh();
|
|
14005
14027
|
}, 1);
|
|
14006
14028
|
},
|
|
14007
14029
|
onPaginationChange: function onPaginationChange(page) {
|
|
@@ -14261,7 +14283,16 @@ var _sfc_render = function render() {
|
|
|
14261
14283
|
return _vm.togglePrincipalSort();
|
|
14262
14284
|
}
|
|
14263
14285
|
}
|
|
14264
|
-
}, [_vm.principalSort ? _c('b-icon-sort-numeric-down') : _c('b-icon-sort-numeric-up')], 1) : _vm._e(), _vm.
|
|
14286
|
+
}, [_vm.principalSort ? _c('b-icon-sort-numeric-down') : _c('b-icon-sort-numeric-up')], 1) : _vm._e(), _vm.bulkDelete ? _c('b-button', {
|
|
14287
|
+
attrs: {
|
|
14288
|
+
"variant": "danger"
|
|
14289
|
+
},
|
|
14290
|
+
on: {
|
|
14291
|
+
"click": function click($event) {
|
|
14292
|
+
return _vm.confirmBulkDelete();
|
|
14293
|
+
}
|
|
14294
|
+
}
|
|
14295
|
+
}, [_c('b-icon-trash')], 1) : _vm._e(), _vm.showCreateBtn ? _c('b-button', {
|
|
14265
14296
|
attrs: {
|
|
14266
14297
|
"variant": "success",
|
|
14267
14298
|
"disabled": _vm.loading
|
|
@@ -14530,7 +14561,16 @@ var _sfc_render = function render() {
|
|
|
14530
14561
|
"column": column,
|
|
14531
14562
|
"filter": _vm.filter,
|
|
14532
14563
|
"internalFilterByProp": _vm.internalFilterByProp
|
|
14533
|
-
}) :
|
|
14564
|
+
}) : column.type == 'select' ? _c('span', [_c('b-form-checkbox', {
|
|
14565
|
+
attrs: {
|
|
14566
|
+
"name": "select-all"
|
|
14567
|
+
},
|
|
14568
|
+
on: {
|
|
14569
|
+
"change": function change($event) {
|
|
14570
|
+
return _vm.toggleAll();
|
|
14571
|
+
}
|
|
14572
|
+
}
|
|
14573
|
+
})], 1) : _c('span', [_vm._v(_vm._s(column.label))]), _vm.sortable && _vm.internalFilterByProp(column.prop + '_sort') ? _c('span', {
|
|
14534
14574
|
staticClass: "sort-filter",
|
|
14535
14575
|
on: {
|
|
14536
14576
|
"click": function click($event) {
|
|
@@ -14972,7 +15012,7 @@ var _sfc_render = function render() {
|
|
|
14972
15012
|
}) : _vm._e()], 2)], 1);
|
|
14973
15013
|
};
|
|
14974
15014
|
var _sfc_staticRenderFns = [];
|
|
14975
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
15015
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "aefbf0b6", null, null);
|
|
14976
15016
|
var component$1 = __component__.exports;// Import vue component
|
|
14977
15017
|
|
|
14978
15018
|
// Default export is installable instance of component.
|