vue-laravel-crud 1.6.6 → 1.6.8
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 +79 -3
- package/dist/vue-laravel-crud.min.js +2 -2
- package/dist/vue-laravel-crud.ssr.js +292 -186
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +80 -1
|
@@ -12115,7 +12115,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
12115
12115
|
|
|
12116
12116
|
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}}
|
|
12117
12117
|
|
|
12118
|
-
var css = "tr td[data-v-
|
|
12118
|
+
var css = "tr td[data-v-d24c9f33]:last-child,\ntr td[data-v-d24c9f33]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-d24c9f33] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-d24c9f33] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-d24c9f33] .crud-title[data-v-d24c9f33] {\n margin: 0; }\n .crud-header[data-v-d24c9f33] .crud-search[data-v-d24c9f33] {\n max-width: 15rem; }\n .crud-header[data-v-d24c9f33] .crud-search[data-v-d24c9f33] .btn[data-v-d24c9f33] {\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-d24c9f33] .crud-search[data-v-d24c9f33] .btn[data-v-d24c9f33].open[data-v-d24c9f33] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-d24c9f33] .table-options[data-v-d24c9f33] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-d24c9f33] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-d24c9f33] {\n table-layout: auto; }\n .table[data-v-d24c9f33] tbody[data-v-d24c9f33] td[data-v-d24c9f33] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-d24c9f33] tbody[data-v-d24c9f33] td[data-v-d24c9f33]::-webkit-scrollbar {\n display: none; } }\n";
|
|
12119
12119
|
n(css, {});
|
|
12120
12120
|
|
|
12121
12121
|
function normalizeComponent (
|
|
@@ -12533,6 +12533,10 @@ const _sfc_main = {
|
|
|
12533
12533
|
principalSortColumn: {
|
|
12534
12534
|
type: String,
|
|
12535
12535
|
default: "id"
|
|
12536
|
+
},
|
|
12537
|
+
bulkDelete: {
|
|
12538
|
+
type: Boolean,
|
|
12539
|
+
default: false
|
|
12536
12540
|
}
|
|
12537
12541
|
},
|
|
12538
12542
|
mounted() {
|
|
@@ -12982,6 +12986,69 @@ const _sfc_main = {
|
|
|
12982
12986
|
this.loading = false;
|
|
12983
12987
|
});
|
|
12984
12988
|
},
|
|
12989
|
+
confirmBulkDelete() {
|
|
12990
|
+
this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
|
|
12991
|
+
size: "sm",
|
|
12992
|
+
buttonSize: "sm",
|
|
12993
|
+
okVariant: "danger",
|
|
12994
|
+
okTitle: this.messageRemove,
|
|
12995
|
+
cancelTitle: "NO",
|
|
12996
|
+
centered: true
|
|
12997
|
+
}).then(value => {
|
|
12998
|
+
if (value) {
|
|
12999
|
+
this.deleteItemBulk();
|
|
13000
|
+
}
|
|
13001
|
+
}).catch(error => {
|
|
13002
|
+
this.toastError(error);
|
|
13003
|
+
this.loading = false;
|
|
13004
|
+
});
|
|
13005
|
+
},
|
|
13006
|
+
deleteItemBulk() {
|
|
13007
|
+
if (this.useVuexORM) {
|
|
13008
|
+
return this.deleteItemBulkVuex();
|
|
13009
|
+
}
|
|
13010
|
+
if (!this.ajax) {
|
|
13011
|
+
return this.deleteItemBulkLocal();
|
|
13012
|
+
}
|
|
13013
|
+
let ids = this.selectedItems.map(it => it.id);
|
|
13014
|
+
this.loading = true;
|
|
13015
|
+
axios.delete(this.apiUrl + "/" + this.modelName + "/bulk-destroy", {
|
|
13016
|
+
ids: ids
|
|
13017
|
+
}).then(response => {
|
|
13018
|
+
this.items = this.items.filter(it => ids.includes(it.id));
|
|
13019
|
+
this.toastSuccess("Elemento/s eliminado.");
|
|
13020
|
+
this.$emit("itemDeleted", {});
|
|
13021
|
+
this.loading = false;
|
|
13022
|
+
}).catch(error => {
|
|
13023
|
+
this.toastError(error);
|
|
13024
|
+
this.loading = false;
|
|
13025
|
+
});
|
|
13026
|
+
},
|
|
13027
|
+
async deleteItemBulkLocal() {
|
|
13028
|
+
let ids = this.selectedItems.map(it => it.id);
|
|
13029
|
+
this.items = this.items.filter(it => ids.includes(it.id));
|
|
13030
|
+
this.item = null;
|
|
13031
|
+
this.toastSuccess("Elemento Eliminado");
|
|
13032
|
+
this.$emit("itemDeleted", {});
|
|
13033
|
+
this.loading = false;
|
|
13034
|
+
},
|
|
13035
|
+
async deleteItemBulkVuex() {
|
|
13036
|
+
/*
|
|
13037
|
+
let result = await this.model.api().delete('/' + id, {
|
|
13038
|
+
delete: 1
|
|
13039
|
+
});
|
|
13040
|
+
|
|
13041
|
+
console.debug("delete item vuex", result);
|
|
13042
|
+
let responseStatus = result.response.status;
|
|
13043
|
+
|
|
13044
|
+
if (result.response.data.error) {
|
|
13045
|
+
this.toastError(result.response.data.error);
|
|
13046
|
+
this.loading = false;
|
|
13047
|
+
return;
|
|
13048
|
+
}
|
|
13049
|
+
|
|
13050
|
+
this.toastSuccess("Elemento eliminado.");*/
|
|
13051
|
+
},
|
|
12985
13052
|
deleteItem(id, index) {
|
|
12986
13053
|
if (this.useVuexORM) {
|
|
12987
13054
|
return this.deleteItemVuex(id, index);
|
|
@@ -13584,7 +13651,16 @@ var _sfc_render = function render() {
|
|
|
13584
13651
|
return _vm.togglePrincipalSort();
|
|
13585
13652
|
}
|
|
13586
13653
|
}
|
|
13587
|
-
}, [_vm.principalSort ? _c('b-icon-sort-numeric-down') : _c('b-icon-sort-numeric-up')], 1) : _vm._e(), _vm.
|
|
13654
|
+
}, [_vm.principalSort ? _c('b-icon-sort-numeric-down') : _c('b-icon-sort-numeric-up')], 1) : _vm._e(), _vm.bulkDelete ? _c('b-button', {
|
|
13655
|
+
attrs: {
|
|
13656
|
+
"variant": "danger"
|
|
13657
|
+
},
|
|
13658
|
+
on: {
|
|
13659
|
+
"click": function ($event) {
|
|
13660
|
+
return _vm.confirmBulkDelete();
|
|
13661
|
+
}
|
|
13662
|
+
}
|
|
13663
|
+
}, [_c('b-icon-trash')], 1) : _vm._e(), _vm.showCreateBtn ? _c('b-button', {
|
|
13588
13664
|
attrs: {
|
|
13589
13665
|
"variant": "success",
|
|
13590
13666
|
"disabled": _vm.loading
|
|
@@ -14295,7 +14371,7 @@ var _sfc_render = function render() {
|
|
|
14295
14371
|
}) : _vm._e()], 2)], 1);
|
|
14296
14372
|
};
|
|
14297
14373
|
var _sfc_staticRenderFns = [];
|
|
14298
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
14374
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "d24c9f33", null, null);
|
|
14299
14375
|
var component = __component__.exports;
|
|
14300
14376
|
|
|
14301
14377
|
// Import vue component
|