vue-laravel-crud 1.6.21 → 1.6.22
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 +138 -8
- package/dist/vue-laravel-crud.min.js +3 -3
- package/dist/vue-laravel-crud.ssr.js +245 -111
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +292 -184
|
@@ -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-c0990da7]:last-child,\ntr td[data-v-c0990da7]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-c0990da7] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-c0990da7] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-c0990da7] .crud-title[data-v-c0990da7] {\n margin: 0; }\n .crud-header[data-v-c0990da7] .crud-search[data-v-c0990da7] {\n max-width: 15rem; }\n .crud-header[data-v-c0990da7] .crud-search[data-v-c0990da7] .btn[data-v-c0990da7] {\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-c0990da7] .crud-search[data-v-c0990da7] .btn[data-v-c0990da7].open[data-v-c0990da7] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-c0990da7] .table-options[data-v-c0990da7] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-c0990da7] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-c0990da7] {\n table-layout: auto; }\n .table[data-v-c0990da7] tbody[data-v-c0990da7] td[data-v-c0990da7] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-c0990da7] tbody[data-v-c0990da7] td[data-v-c0990da7]::-webkit-scrollbar {\n display: none; } }\n";
|
|
12119
12119
|
n(css, {});
|
|
12120
12120
|
|
|
12121
12121
|
function normalizeComponent (
|
|
@@ -12462,6 +12462,14 @@ const _sfc_main = {
|
|
|
12462
12462
|
type: String,
|
|
12463
12463
|
default: "Nuevo"
|
|
12464
12464
|
},
|
|
12465
|
+
messageImport: {
|
|
12466
|
+
type: String,
|
|
12467
|
+
default: "Importar"
|
|
12468
|
+
},
|
|
12469
|
+
messageExport: {
|
|
12470
|
+
type: String,
|
|
12471
|
+
default: "Exportar"
|
|
12472
|
+
},
|
|
12465
12473
|
messageEmptyResults: {
|
|
12466
12474
|
type: String,
|
|
12467
12475
|
default: "No se han encontrado resultados"
|
|
@@ -12541,6 +12549,14 @@ const _sfc_main = {
|
|
|
12541
12549
|
bulkDelete: {
|
|
12542
12550
|
type: Boolean,
|
|
12543
12551
|
default: false
|
|
12552
|
+
},
|
|
12553
|
+
showImport: {
|
|
12554
|
+
type: Boolean,
|
|
12555
|
+
default: false
|
|
12556
|
+
},
|
|
12557
|
+
showExport: {
|
|
12558
|
+
type: Boolean,
|
|
12559
|
+
default: false
|
|
12544
12560
|
}
|
|
12545
12561
|
},
|
|
12546
12562
|
mounted() {
|
|
@@ -13160,6 +13176,58 @@ const _sfc_main = {
|
|
|
13160
13176
|
});
|
|
13161
13177
|
}
|
|
13162
13178
|
},
|
|
13179
|
+
exportItems() {
|
|
13180
|
+
if (this.useVuexORM) {
|
|
13181
|
+
return;
|
|
13182
|
+
}
|
|
13183
|
+
if (!this.ajax) {
|
|
13184
|
+
return;
|
|
13185
|
+
}
|
|
13186
|
+
let exportItems = true;
|
|
13187
|
+
let params;
|
|
13188
|
+
let ids = this.selectedItems.map(it => it.id);
|
|
13189
|
+
if (ids.length) {
|
|
13190
|
+
params = {
|
|
13191
|
+
ids: ids,
|
|
13192
|
+
exportItems: exportItems
|
|
13193
|
+
};
|
|
13194
|
+
} else {
|
|
13195
|
+
params = {
|
|
13196
|
+
filters: JSON.stringify(this.finalFilters),
|
|
13197
|
+
exportItems: exportItems
|
|
13198
|
+
};
|
|
13199
|
+
}
|
|
13200
|
+
this.loading = true;
|
|
13201
|
+
axios.delete(this.apiUrl + "/" + this.modelName + "/export", {
|
|
13202
|
+
params: params
|
|
13203
|
+
}).then(response => {
|
|
13204
|
+
this.downloadBlobResponse(response, extension);
|
|
13205
|
+
this.loading = false;
|
|
13206
|
+
}).catch(error => {
|
|
13207
|
+
this.toastError(error);
|
|
13208
|
+
this.loading = false;
|
|
13209
|
+
});
|
|
13210
|
+
},
|
|
13211
|
+
importItems() {
|
|
13212
|
+
let formData = new FormData();
|
|
13213
|
+
formData.append("file", this.fileImport);
|
|
13214
|
+
axios.post(this.apiUrl + "/" + this.modelName + "/impport", formData, {
|
|
13215
|
+
headers: {
|
|
13216
|
+
"Content-Type": "multipart/form-data"
|
|
13217
|
+
}
|
|
13218
|
+
}).then(response => {
|
|
13219
|
+
if (response && response.data && response.data.success == true) {
|
|
13220
|
+
this.$refs["modal-import"].hide();
|
|
13221
|
+
this.toastSuccess("Datos Importados con Éxito");
|
|
13222
|
+
this.$refs["crud"].refresh();
|
|
13223
|
+
} else {
|
|
13224
|
+
this.toastError("No se pudo importar los datos.");
|
|
13225
|
+
}
|
|
13226
|
+
}).catch(error => {
|
|
13227
|
+
console.error(error);
|
|
13228
|
+
this.toastError(error);
|
|
13229
|
+
});
|
|
13230
|
+
},
|
|
13163
13231
|
getArrayValue(value, displayProp, options = []) {
|
|
13164
13232
|
if (!Array.isArray(value)) return "N/A";
|
|
13165
13233
|
let values = [];
|
|
@@ -13528,7 +13596,7 @@ var _sfc_render = function render() {
|
|
|
13528
13596
|
callback: function ($$v) {
|
|
13529
13597
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", $$v);
|
|
13530
13598
|
},
|
|
13531
|
-
expression: "internalFilterByProp(column.prop + '_from').value\n
|
|
13599
|
+
expression: "internalFilterByProp(column.prop + '_from').value\n "
|
|
13532
13600
|
}
|
|
13533
13601
|
})], 1), _c('div', {
|
|
13534
13602
|
staticClass: "col-6"
|
|
@@ -13544,7 +13612,7 @@ var _sfc_render = function render() {
|
|
|
13544
13612
|
callback: function ($$v) {
|
|
13545
13613
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", $$v);
|
|
13546
13614
|
},
|
|
13547
|
-
expression: "internalFilterByProp(column.prop + '_to').value\n
|
|
13615
|
+
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
13548
13616
|
}
|
|
13549
13617
|
})], 1)])]) : column.type == 'state' ? _c('div', {
|
|
13550
13618
|
staticClass: "form-group"
|
|
@@ -13673,7 +13741,27 @@ var _sfc_render = function render() {
|
|
|
13673
13741
|
}, [_vm._t("tableActions", function () {
|
|
13674
13742
|
return [_vm._t("tableActionsPrepend", null, {
|
|
13675
13743
|
"loading": _vm.loading
|
|
13676
|
-
}), _vm.
|
|
13744
|
+
}), _vm.showImport ? _c('b-button', {
|
|
13745
|
+
directives: [{
|
|
13746
|
+
name: "b-modal",
|
|
13747
|
+
rawName: "v-b-modal.modal-import",
|
|
13748
|
+
modifiers: {
|
|
13749
|
+
"modal-import": true
|
|
13750
|
+
}
|
|
13751
|
+
}],
|
|
13752
|
+
attrs: {
|
|
13753
|
+
"variant": "info"
|
|
13754
|
+
}
|
|
13755
|
+
}, [_c('b-icon-cloud-upload'), _vm._v(_vm._s(_vm.messageImport) + " ")], 1) : _vm._e(), _vm.showExport ? _c('b-button', {
|
|
13756
|
+
attrs: {
|
|
13757
|
+
"variant": "info"
|
|
13758
|
+
},
|
|
13759
|
+
on: {
|
|
13760
|
+
"click": function ($event) {
|
|
13761
|
+
return _vm.exportItems();
|
|
13762
|
+
}
|
|
13763
|
+
}
|
|
13764
|
+
}, [_c('b-icon-cloud-download'), _vm._v(_vm._s(_vm.messageExport) + " ")], 1) : _vm._e(), _vm.showPrincipalSortBtn ? _c('b-button', {
|
|
13677
13765
|
attrs: {
|
|
13678
13766
|
"variant": "info",
|
|
13679
13767
|
"disabled": _vm.loading
|
|
@@ -13835,7 +13923,7 @@ var _sfc_render = function render() {
|
|
|
13835
13923
|
callback: function ($$v) {
|
|
13836
13924
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", $$v);
|
|
13837
13925
|
},
|
|
13838
|
-
expression: "internalFilterByProp(column.prop + '_from').value\n
|
|
13926
|
+
expression: "internalFilterByProp(column.prop + '_from').value\n "
|
|
13839
13927
|
}
|
|
13840
13928
|
})], 1), _c('div', {
|
|
13841
13929
|
staticClass: "col-6"
|
|
@@ -13852,7 +13940,7 @@ var _sfc_render = function render() {
|
|
|
13852
13940
|
callback: function ($$v) {
|
|
13853
13941
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", $$v);
|
|
13854
13942
|
},
|
|
13855
|
-
expression: "internalFilterByProp(column.prop + '_to').value\n
|
|
13943
|
+
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
13856
13944
|
}
|
|
13857
13945
|
})], 1)]) : column.type == 'state' && _vm.optionsLoaded ? _c('select', {
|
|
13858
13946
|
directives: [{
|
|
@@ -14420,10 +14508,52 @@ var _sfc_render = function render() {
|
|
|
14420
14508
|
}), 1)];
|
|
14421
14509
|
}, {
|
|
14422
14510
|
"item": _vm.item
|
|
14423
|
-
}) : _vm._e()], 2)
|
|
14511
|
+
}) : _vm._e()], 2), _vm.showImport ? _c('b-modal', {
|
|
14512
|
+
ref: "modal-import",
|
|
14513
|
+
attrs: {
|
|
14514
|
+
"id": "modal-import",
|
|
14515
|
+
"title": "Importar",
|
|
14516
|
+
"hide-footer": ""
|
|
14517
|
+
}
|
|
14518
|
+
}, [_vm.item ? _vm._t("import", function () {
|
|
14519
|
+
return [_c('b-overlay', {
|
|
14520
|
+
attrs: {
|
|
14521
|
+
"show": _vm.loading,
|
|
14522
|
+
"rounded": "sm"
|
|
14523
|
+
}
|
|
14524
|
+
}, [_c('b-form-file', {
|
|
14525
|
+
attrs: {
|
|
14526
|
+
"state": Boolean(_vm.fileImport),
|
|
14527
|
+
"browse-text": "Explorar",
|
|
14528
|
+
"placeholder": "Importar...",
|
|
14529
|
+
"drop-placeholder": "Arrastrar Archivo aquí..."
|
|
14530
|
+
},
|
|
14531
|
+
model: {
|
|
14532
|
+
value: _vm.fileImport,
|
|
14533
|
+
callback: function ($$v) {
|
|
14534
|
+
_vm.fileImport = $$v;
|
|
14535
|
+
},
|
|
14536
|
+
expression: "fileImport"
|
|
14537
|
+
}
|
|
14538
|
+
}), _c('div', {
|
|
14539
|
+
staticClass: "text-center mt-3"
|
|
14540
|
+
}, [_c('b-button', {
|
|
14541
|
+
attrs: {
|
|
14542
|
+
"variant": "info",
|
|
14543
|
+
"disabled": _vm.loading
|
|
14544
|
+
},
|
|
14545
|
+
on: {
|
|
14546
|
+
"click": function ($event) {
|
|
14547
|
+
return _vm.importItems();
|
|
14548
|
+
}
|
|
14549
|
+
}
|
|
14550
|
+
}, [_c('b-icon-cloud-upload'), _vm._v(" " + _vm._s(_vm.loading ? "Cargando..." : "Importar") + " ")], 1)], 1)], 1)];
|
|
14551
|
+
}, {
|
|
14552
|
+
"item": _vm.item
|
|
14553
|
+
}) : _vm._e()], 2) : _vm._e()], 1);
|
|
14424
14554
|
};
|
|
14425
14555
|
var _sfc_staticRenderFns = [];
|
|
14426
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
14556
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "c0990da7", null, null);
|
|
14427
14557
|
var component = __component__.exports;
|
|
14428
14558
|
|
|
14429
14559
|
// Import vue component
|