vue-laravel-crud 1.7.5 → 1.7.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 -15
- package/dist/vue-laravel-crud.min.js +1 -1
- package/dist/vue-laravel-crud.ssr.js +79 -15
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +42 -12
|
@@ -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-6fd1b6ca]:last-child,\ntr td[data-v-6fd1b6ca]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-6fd1b6ca] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-6fd1b6ca] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-6fd1b6ca] .crud-title[data-v-6fd1b6ca] {\n margin: 0; }\n .crud-header[data-v-6fd1b6ca] .crud-search[data-v-6fd1b6ca] {\n max-width: 15rem; }\n .crud-header[data-v-6fd1b6ca] .crud-search[data-v-6fd1b6ca] .btn[data-v-6fd1b6ca] {\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-6fd1b6ca] .crud-search[data-v-6fd1b6ca] .btn[data-v-6fd1b6ca].open[data-v-6fd1b6ca] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-6fd1b6ca] .table-options[data-v-6fd1b6ca] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-6fd1b6ca] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-6fd1b6ca] {\n table-layout: auto; }\n .table[data-v-6fd1b6ca] tbody[data-v-6fd1b6ca] td[data-v-6fd1b6ca] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-6fd1b6ca] tbody[data-v-6fd1b6ca] td[data-v-6fd1b6ca]::-webkit-scrollbar {\n display: none; } }\n";
|
|
12119
12119
|
n(css, {});
|
|
12120
12120
|
|
|
12121
12121
|
function normalizeComponent (
|
|
@@ -12220,6 +12220,7 @@ const _sfc_main = {
|
|
|
12220
12220
|
},
|
|
12221
12221
|
data() {
|
|
12222
12222
|
return {
|
|
12223
|
+
crudUuid: string,
|
|
12223
12224
|
moment: moment,
|
|
12224
12225
|
loading: false,
|
|
12225
12226
|
firstLoad: false,
|
|
@@ -12253,7 +12254,8 @@ const _sfc_main = {
|
|
|
12253
12254
|
isMobile: false,
|
|
12254
12255
|
refreshing: false,
|
|
12255
12256
|
fetchError: false,
|
|
12256
|
-
principalSort: false
|
|
12257
|
+
principalSort: false,
|
|
12258
|
+
exportFormat: 'JSON'
|
|
12257
12259
|
};
|
|
12258
12260
|
},
|
|
12259
12261
|
watch: {
|
|
@@ -12564,6 +12566,7 @@ const _sfc_main = {
|
|
|
12564
12566
|
}
|
|
12565
12567
|
},
|
|
12566
12568
|
mounted() {
|
|
12569
|
+
this.crudUuid = ''.now;
|
|
12567
12570
|
this.isMobile = window.matchMedia("(max-width: 1024px)").matches;
|
|
12568
12571
|
|
|
12569
12572
|
// Agregar un oyente de eventos para actualizar isMobile cuando cambia el tamaño de la pantalla
|
|
@@ -13215,6 +13218,9 @@ const _sfc_main = {
|
|
|
13215
13218
|
});
|
|
13216
13219
|
}
|
|
13217
13220
|
},
|
|
13221
|
+
showExportModal() {
|
|
13222
|
+
this.$refs["modal-export"].show();
|
|
13223
|
+
},
|
|
13218
13224
|
exportItems() {
|
|
13219
13225
|
if (this.useVuexORM) {
|
|
13220
13226
|
return;
|
|
@@ -13236,7 +13242,7 @@ const _sfc_main = {
|
|
|
13236
13242
|
exportItems: exportItems
|
|
13237
13243
|
};
|
|
13238
13244
|
}
|
|
13239
|
-
params.format =
|
|
13245
|
+
params.format = this.exportFormat;
|
|
13240
13246
|
this.loading = true;
|
|
13241
13247
|
axios.get(this.apiUrl + "/" + this.modelName + "/export", {
|
|
13242
13248
|
params: params,
|
|
@@ -13249,6 +13255,9 @@ const _sfc_main = {
|
|
|
13249
13255
|
this.loading = false;
|
|
13250
13256
|
});
|
|
13251
13257
|
},
|
|
13258
|
+
showImportModal() {
|
|
13259
|
+
this.$refs["modal-import"].show();
|
|
13260
|
+
},
|
|
13252
13261
|
importItems() {
|
|
13253
13262
|
let formData = new FormData();
|
|
13254
13263
|
formData.append("file", this.fileImport);
|
|
@@ -13310,10 +13319,14 @@ const _sfc_main = {
|
|
|
13310
13319
|
let create = false;
|
|
13311
13320
|
if (this.vuexLocalforage) {
|
|
13312
13321
|
if (this.item.id) {
|
|
13313
|
-
result = await this.model.$update(this.item.id,
|
|
13322
|
+
result = await this.model.$update(this.item.id, {
|
|
13323
|
+
data: this.item
|
|
13324
|
+
});
|
|
13314
13325
|
create = false;
|
|
13315
13326
|
} else {
|
|
13316
|
-
result = await this.model.$create(
|
|
13327
|
+
result = await this.model.$create({
|
|
13328
|
+
data: this.item
|
|
13329
|
+
});
|
|
13317
13330
|
create = true;
|
|
13318
13331
|
}
|
|
13319
13332
|
} else {
|
|
@@ -13812,15 +13825,13 @@ var _sfc_render = function render() {
|
|
|
13812
13825
|
return [_vm._t("tableActionsPrepend", null, {
|
|
13813
13826
|
"loading": _vm.loading
|
|
13814
13827
|
}), _vm.showImport ? _c('b-button', {
|
|
13815
|
-
directives: [{
|
|
13816
|
-
name: "b-modal",
|
|
13817
|
-
rawName: "v-b-modal.modal-import",
|
|
13818
|
-
modifiers: {
|
|
13819
|
-
"modal-import": true
|
|
13820
|
-
}
|
|
13821
|
-
}],
|
|
13822
13828
|
attrs: {
|
|
13823
13829
|
"variant": "info"
|
|
13830
|
+
},
|
|
13831
|
+
on: {
|
|
13832
|
+
"click": function ($event) {
|
|
13833
|
+
return _vm.showImportModal();
|
|
13834
|
+
}
|
|
13824
13835
|
}
|
|
13825
13836
|
}, [_c('b-icon-cloud-upload'), _vm._v(_vm._s(_vm.messageImport) + " ")], 1) : _vm._e(), _vm.showExport ? _c('b-button', {
|
|
13826
13837
|
attrs: {
|
|
@@ -13828,7 +13839,7 @@ var _sfc_render = function render() {
|
|
|
13828
13839
|
},
|
|
13829
13840
|
on: {
|
|
13830
13841
|
"click": function ($event) {
|
|
13831
|
-
return _vm.
|
|
13842
|
+
return _vm.showExportModal();
|
|
13832
13843
|
}
|
|
13833
13844
|
}
|
|
13834
13845
|
}, [_c('b-icon-cloud-download'), _vm._v(_vm._s(_vm.messageExport) + " ")], 1) : _vm._e(), _vm.showPrincipalSortBtn ? _c('b-button', {
|
|
@@ -14581,7 +14592,6 @@ var _sfc_render = function render() {
|
|
|
14581
14592
|
}) : _vm._e()], 2), _vm.showImport ? _c('b-modal', {
|
|
14582
14593
|
ref: "modal-import",
|
|
14583
14594
|
attrs: {
|
|
14584
|
-
"id": "modal-import",
|
|
14585
14595
|
"title": "Importar",
|
|
14586
14596
|
"hide-footer": ""
|
|
14587
14597
|
}
|
|
@@ -14620,10 +14630,64 @@ var _sfc_render = function render() {
|
|
|
14620
14630
|
}, [_c('b-icon-cloud-upload'), _vm._v(" " + _vm._s(_vm.loading ? "Cargando..." : "Importar") + " ")], 1)], 1)], 1)];
|
|
14621
14631
|
}, {
|
|
14622
14632
|
"item": _vm.item
|
|
14633
|
+
}) : _vm._e()], 2) : _vm._e(), _vm.showExport ? _c('b-modal', {
|
|
14634
|
+
ref: "modal-export",
|
|
14635
|
+
attrs: {
|
|
14636
|
+
"title": "Exportar",
|
|
14637
|
+
"hide-footer": ""
|
|
14638
|
+
}
|
|
14639
|
+
}, [_vm.item ? _vm._t("export", function () {
|
|
14640
|
+
return [_c('b-overlay', {
|
|
14641
|
+
attrs: {
|
|
14642
|
+
"show": _vm.loading,
|
|
14643
|
+
"rounded": "sm"
|
|
14644
|
+
}
|
|
14645
|
+
}, [_vm.selectedItems.length ? _c('p', [_vm._v("Se exportará " + _vm._s(_vm.selectedItems.length) + " elementos.")]) : _c('p', [_vm._v("Se exportará la consulta actual.")]), _c('select', {
|
|
14646
|
+
directives: [{
|
|
14647
|
+
name: "model",
|
|
14648
|
+
rawName: "v-model",
|
|
14649
|
+
value: _vm.exportFormat,
|
|
14650
|
+
expression: "exportFormat"
|
|
14651
|
+
}],
|
|
14652
|
+
staticClass: "form-control",
|
|
14653
|
+
on: {
|
|
14654
|
+
"change": function ($event) {
|
|
14655
|
+
var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) {
|
|
14656
|
+
return o.selected;
|
|
14657
|
+
}).map(function (o) {
|
|
14658
|
+
var val = "_value" in o ? o._value : o.value;
|
|
14659
|
+
return val;
|
|
14660
|
+
});
|
|
14661
|
+
_vm.exportFormat = $event.target.multiple ? $$selectedVal : $$selectedVal[0];
|
|
14662
|
+
}
|
|
14663
|
+
}
|
|
14664
|
+
}, [_c('option', {
|
|
14665
|
+
attrs: {
|
|
14666
|
+
"value": "JSON"
|
|
14667
|
+
}
|
|
14668
|
+
}, [_vm._v("JSON")]), _c('option', {
|
|
14669
|
+
attrs: {
|
|
14670
|
+
"value": "XLSX"
|
|
14671
|
+
}
|
|
14672
|
+
}, [_vm._v("XLSX")])]), _c('div', {
|
|
14673
|
+
staticClass: "text-center mt-3"
|
|
14674
|
+
}, [_c('b-button', {
|
|
14675
|
+
attrs: {
|
|
14676
|
+
"variant": "info",
|
|
14677
|
+
"disabled": _vm.loading
|
|
14678
|
+
},
|
|
14679
|
+
on: {
|
|
14680
|
+
"click": function ($event) {
|
|
14681
|
+
return _vm.exportItems();
|
|
14682
|
+
}
|
|
14683
|
+
}
|
|
14684
|
+
}, [_c('b-icon-cloud-upload'), _vm._v(" " + _vm._s(_vm.loading ? "Cargando..." : "Exportar") + " ")], 1)], 1)])];
|
|
14685
|
+
}, {
|
|
14686
|
+
"item": _vm.item
|
|
14623
14687
|
}) : _vm._e()], 2) : _vm._e()], 1);
|
|
14624
14688
|
};
|
|
14625
14689
|
var _sfc_staticRenderFns = [];
|
|
14626
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
14690
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "6fd1b6ca", null, null);
|
|
14627
14691
|
var component = __component__.exports;
|
|
14628
14692
|
|
|
14629
14693
|
// Import vue component
|