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.
- package/dist/vue-laravel-crud.esm.js +48 -2
- package/dist/vue-laravel-crud.min.js +2 -2
- package/dist/vue-laravel-crud.ssr.js +257 -182
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +54 -0
|
@@ -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-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";
|
|
12119
12119
|
n(css, {});
|
|
12120
12120
|
|
|
12121
12121
|
function normalizeComponent (
|
|
@@ -12982,6 +12982,52 @@ const _sfc_main = {
|
|
|
12982
12982
|
this.loading = false;
|
|
12983
12983
|
});
|
|
12984
12984
|
},
|
|
12985
|
+
deleteItemBulk() {
|
|
12986
|
+
if (this.useVuexORM) {
|
|
12987
|
+
return this.deleteItemBulkVuex();
|
|
12988
|
+
}
|
|
12989
|
+
if (!this.ajax) {
|
|
12990
|
+
return this.deleteItemBulkLocal();
|
|
12991
|
+
}
|
|
12992
|
+
let ids = this.selectedItems.map(it => it.id);
|
|
12993
|
+
this.loading = true;
|
|
12994
|
+
axios.delete(this.apiUrl + "/" + this.modelName + "/bulk-destroy", {
|
|
12995
|
+
ids: ids
|
|
12996
|
+
}).then(response => {
|
|
12997
|
+
this.items = this.items.filter(it => ids.includes(it.id));
|
|
12998
|
+
this.toastSuccess("Elemento/s eliminado.");
|
|
12999
|
+
this.$emit("itemDeleted", {});
|
|
13000
|
+
this.loading = false;
|
|
13001
|
+
}).catch(error => {
|
|
13002
|
+
this.toastError(error);
|
|
13003
|
+
this.loading = false;
|
|
13004
|
+
});
|
|
13005
|
+
},
|
|
13006
|
+
async deleteItemBulkLocal() {
|
|
13007
|
+
let ids = this.selectedItems.map(it => it.id);
|
|
13008
|
+
this.items = this.items.filter(it => ids.includes(it.id));
|
|
13009
|
+
this.item = null;
|
|
13010
|
+
this.toastSuccess("Elemento Eliminado");
|
|
13011
|
+
this.$emit("itemDeleted", {});
|
|
13012
|
+
this.loading = false;
|
|
13013
|
+
},
|
|
13014
|
+
async deleteItemBulkVuex() {
|
|
13015
|
+
/*
|
|
13016
|
+
let result = await this.model.api().delete('/' + id, {
|
|
13017
|
+
delete: 1
|
|
13018
|
+
});
|
|
13019
|
+
|
|
13020
|
+
console.debug("delete item vuex", result);
|
|
13021
|
+
let responseStatus = result.response.status;
|
|
13022
|
+
|
|
13023
|
+
if (result.response.data.error) {
|
|
13024
|
+
this.toastError(result.response.data.error);
|
|
13025
|
+
this.loading = false;
|
|
13026
|
+
return;
|
|
13027
|
+
}
|
|
13028
|
+
|
|
13029
|
+
this.toastSuccess("Elemento eliminado.");*/
|
|
13030
|
+
},
|
|
12985
13031
|
deleteItem(id, index) {
|
|
12986
13032
|
if (this.useVuexORM) {
|
|
12987
13033
|
return this.deleteItemVuex(id, index);
|
|
@@ -14295,7 +14341,7 @@ var _sfc_render = function render() {
|
|
|
14295
14341
|
}) : _vm._e()], 2)], 1);
|
|
14296
14342
|
};
|
|
14297
14343
|
var _sfc_staticRenderFns = [];
|
|
14298
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
14344
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "1a50c07c", null, null);
|
|
14299
14345
|
var component = __component__.exports;
|
|
14300
14346
|
|
|
14301
14347
|
// Import vue component
|