vue-laravel-crud 1.4.27 → 1.4.29
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 +36 -12
- package/dist/vue-laravel-crud.min.js +1 -1
- package/dist/vue-laravel-crud.ssr.js +36 -12
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +142 -127
|
@@ -17305,7 +17305,7 @@ var moment$1 = {
|
|
|
17305
17305
|
})));
|
|
17306
17306
|
} (moment$1));
|
|
17307
17307
|
|
|
17308
|
-
var moment = momentExports;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-
|
|
17308
|
+
var moment = momentExports;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-6cea020c]:last-child,\ntr td[data-v-6cea020c]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-6cea020c] {\n display: flex;\n justify-content: center; }\n\n.crud-header[data-v-6cea020c] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-6cea020c] .crud-title[data-v-6cea020c] {\n margin: 0; }\n .crud-header[data-v-6cea020c] .crud-search[data-v-6cea020c] {\n max-width: 15rem; }\n .crud-header[data-v-6cea020c] .crud-search[data-v-6cea020c] .btn[data-v-6cea020c] {\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-6cea020c] .crud-search[data-v-6cea020c] .btn[data-v-6cea020c].open[data-v-6cea020c] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-6cea020c] .table-options[data-v-6cea020c] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-6cea020c] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-6cea020c] {\n table-layout: auto; }\n .table[data-v-6cea020c] tbody[data-v-6cea020c] td[data-v-6cea020c] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-6cea020c] tbody[data-v-6cea020c] td[data-v-6cea020c]::-webkit-scrollbar {\n display: none; } }\n";
|
|
17309
17309
|
n(css, {});function normalizeComponent (
|
|
17310
17310
|
scriptExports,
|
|
17311
17311
|
render,
|
|
@@ -17653,6 +17653,18 @@ n(css, {});function normalizeComponent (
|
|
|
17653
17653
|
groupedLabelAfter: {
|
|
17654
17654
|
type: String,
|
|
17655
17655
|
default: ""
|
|
17656
|
+
},
|
|
17657
|
+
draggableGroup: {
|
|
17658
|
+
type: String,
|
|
17659
|
+
default: "people"
|
|
17660
|
+
},
|
|
17661
|
+
draggableOptions: {
|
|
17662
|
+
type: Object,
|
|
17663
|
+
default: function _default() {
|
|
17664
|
+
return {
|
|
17665
|
+
clone: false
|
|
17666
|
+
};
|
|
17667
|
+
}
|
|
17656
17668
|
}
|
|
17657
17669
|
},
|
|
17658
17670
|
mounted: function mounted() {
|
|
@@ -17712,6 +17724,10 @@ n(css, {});function normalizeComponent (
|
|
|
17712
17724
|
}
|
|
17713
17725
|
},
|
|
17714
17726
|
methods: {
|
|
17727
|
+
onDraggableAdded: function onDraggableAdded(event) {
|
|
17728
|
+
console.log('Se agregó un nuevo elemento a la lista', event);
|
|
17729
|
+
this.$emit("draggableAdded", event);
|
|
17730
|
+
},
|
|
17715
17731
|
setupFilters: function setupFilters() {
|
|
17716
17732
|
var _this2 = this;
|
|
17717
17733
|
this.columns.forEach(function (column) {
|
|
@@ -18448,7 +18464,7 @@ var _sfc_render = function render() {
|
|
|
18448
18464
|
callback: function callback($$v) {
|
|
18449
18465
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", $$v);
|
|
18450
18466
|
},
|
|
18451
|
-
expression: "
|
|
18467
|
+
expression: "internalFilterByProp(column.prop + '_from').value\n "
|
|
18452
18468
|
}
|
|
18453
18469
|
})], 1), _c('div', {
|
|
18454
18470
|
staticClass: "col-6"
|
|
@@ -18464,7 +18480,7 @@ var _sfc_render = function render() {
|
|
|
18464
18480
|
callback: function callback($$v) {
|
|
18465
18481
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", $$v);
|
|
18466
18482
|
},
|
|
18467
|
-
expression: "
|
|
18483
|
+
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
18468
18484
|
}
|
|
18469
18485
|
})], 1)])]) : column.type == 'state' ? _c('div', {
|
|
18470
18486
|
staticClass: "form-group"
|
|
@@ -18739,7 +18755,7 @@ var _sfc_render = function render() {
|
|
|
18739
18755
|
callback: function callback($$v) {
|
|
18740
18756
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", $$v);
|
|
18741
18757
|
},
|
|
18742
|
-
expression: "
|
|
18758
|
+
expression: "internalFilterByProp(column.prop + '_from').value\n "
|
|
18743
18759
|
}
|
|
18744
18760
|
})], 1), _c('div', {
|
|
18745
18761
|
staticClass: "col-6"
|
|
@@ -18756,7 +18772,7 @@ var _sfc_render = function render() {
|
|
|
18756
18772
|
callback: function callback($$v) {
|
|
18757
18773
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", $$v);
|
|
18758
18774
|
},
|
|
18759
|
-
expression: "
|
|
18775
|
+
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
18760
18776
|
}
|
|
18761
18777
|
})], 1)]) : column.type == 'state' ? _c('select', {
|
|
18762
18778
|
directives: [{
|
|
@@ -18866,13 +18882,14 @@ var _sfc_render = function render() {
|
|
|
18866
18882
|
return _vm.toggleSortFilter(column);
|
|
18867
18883
|
}
|
|
18868
18884
|
}
|
|
18869
|
-
}, [!_vm.internalFilterByProp(column.prop + '_sort').value ? _c('b-icon-sort') : _vm._e(), _vm.internalFilterByProp(column.prop + '_sort').value == 'ASC' ? _c('b-icon-sort-up') : _vm._e(), _vm.internalFilterByProp(column.prop + '_sort').value == 'DESC' ? _c('b-icon-sort-down') : _vm._e()], 1) : _vm._e()], 2);
|
|
18885
|
+
}, [!_vm.internalFilterByProp(column.prop + '_sort').value ? _c('b-icon-sort-down') : _vm._e(), _vm.internalFilterByProp(column.prop + '_sort').value == 'ASC' ? _c('b-icon-sort-up') : _vm._e(), _vm.internalFilterByProp(column.prop + '_sort').value == 'DESC' ? _c('b-icon-sort-down') : _vm._e()], 1) : _vm._e()], 2);
|
|
18870
18886
|
});
|
|
18871
18887
|
})], 2)]), _c('draggable', {
|
|
18872
18888
|
attrs: {
|
|
18873
|
-
"group":
|
|
18889
|
+
"group": _vm.draggableGroup,
|
|
18874
18890
|
"tag": "tbody",
|
|
18875
|
-
"draggable": _vm.orderable ? '.item' : '.none'
|
|
18891
|
+
"draggable": _vm.orderable ? '.item' : '.none',
|
|
18892
|
+
"options": _vm.draggableOptions
|
|
18876
18893
|
},
|
|
18877
18894
|
on: {
|
|
18878
18895
|
"start": function start($event) {
|
|
@@ -18883,6 +18900,9 @@ var _sfc_render = function render() {
|
|
|
18883
18900
|
},
|
|
18884
18901
|
"sort": function sort($event) {
|
|
18885
18902
|
return _vm.onSort();
|
|
18903
|
+
},
|
|
18904
|
+
"added": function added($event) {
|
|
18905
|
+
return _vm.onDraggableAdded($event);
|
|
18886
18906
|
}
|
|
18887
18907
|
},
|
|
18888
18908
|
model: {
|
|
@@ -18924,7 +18944,7 @@ var _sfc_render = function render() {
|
|
|
18924
18944
|
attrs: {
|
|
18925
18945
|
"variant": "danger"
|
|
18926
18946
|
}
|
|
18927
|
-
}, [_c('b-icon-x-circle')], 1) : _vm._e()], 1) : column.type == 'date' ? _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, item) ? _vm.moment(_vm.itemValue(column, item)).format(column.format ? column.format : 'L LT') : _vm.itemValue(column, item)) + " ")]) : column.type == '
|
|
18947
|
+
}, [_c('b-icon-x-circle')], 1) : _vm._e()], 1) : column.type == 'date' ? _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, item) ? _vm.moment(_vm.itemValue(column, item)).format(column.format ? column.format : 'L LT') : _vm.itemValue(column, item)) + " ")]) : column.type == 'select' ? _c('span', [_c('b-form-checkbox', {
|
|
18928
18948
|
on: {
|
|
18929
18949
|
"change": function change($event) {
|
|
18930
18950
|
return _vm.onCheckSelect($event, item);
|
|
@@ -18990,8 +19010,9 @@ var _sfc_render = function render() {
|
|
|
18990
19010
|
}, [_vm._v(" " + _vm._s(_vm.messageEmptyResults) + " ")]) : _vm._e(), _c('draggable', {
|
|
18991
19011
|
staticClass: "row",
|
|
18992
19012
|
attrs: {
|
|
18993
|
-
"group":
|
|
18994
|
-
"draggable": _vm.orderable ? '.item' : '.none'
|
|
19013
|
+
"group": _vm.draggableGroup,
|
|
19014
|
+
"draggable": _vm.orderable ? '.item' : '.none',
|
|
19015
|
+
"options": _vm.draggableOptions
|
|
18995
19016
|
},
|
|
18996
19017
|
on: {
|
|
18997
19018
|
"start": function start($event) {
|
|
@@ -19002,6 +19023,9 @@ var _sfc_render = function render() {
|
|
|
19002
19023
|
},
|
|
19003
19024
|
"sort": function sort($event) {
|
|
19004
19025
|
return _vm.onSort();
|
|
19026
|
+
},
|
|
19027
|
+
"added": function added($event) {
|
|
19028
|
+
return _vm.onDraggableAdded($event);
|
|
19005
19029
|
}
|
|
19006
19030
|
},
|
|
19007
19031
|
model: {
|
|
@@ -19243,7 +19267,7 @@ var _sfc_render = function render() {
|
|
|
19243
19267
|
}) : _vm._e()], 2)], 1);
|
|
19244
19268
|
};
|
|
19245
19269
|
var _sfc_staticRenderFns = [];
|
|
19246
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
19270
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "6cea020c", null, null);
|
|
19247
19271
|
var component$1 = __component__.exports;// Import vue component
|
|
19248
19272
|
|
|
19249
19273
|
// Default export is installable instance of component.
|
package/package.json
CHANGED
package/src/vue-laravel-crud.vue
CHANGED
|
@@ -266,6 +266,19 @@ export default /*#__PURE__*/ {
|
|
|
266
266
|
type: String,
|
|
267
267
|
default: "",
|
|
268
268
|
},
|
|
269
|
+
|
|
270
|
+
draggableGroup: {
|
|
271
|
+
type: String,
|
|
272
|
+
default: "people",
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
draggableOptions: {
|
|
276
|
+
type: Object,
|
|
277
|
+
default: function() {
|
|
278
|
+
return { clone: false };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
},
|
|
269
282
|
},
|
|
270
283
|
|
|
271
284
|
mounted() {
|
|
@@ -277,7 +290,7 @@ export default /*#__PURE__*/ {
|
|
|
277
290
|
this.itemDefault = JSON.parse(JSON.stringify(this.item));
|
|
278
291
|
}
|
|
279
292
|
|
|
280
|
-
console.debug("crud mounted columns"
|
|
293
|
+
console.debug("crud mounted columns", this.columns);
|
|
281
294
|
this.internalFilters = [];
|
|
282
295
|
this.setupFilters();
|
|
283
296
|
|
|
@@ -288,6 +301,7 @@ export default /*#__PURE__*/ {
|
|
|
288
301
|
this.pagination.total = this.items.length;
|
|
289
302
|
}
|
|
290
303
|
|
|
304
|
+
|
|
291
305
|
},
|
|
292
306
|
computed: {
|
|
293
307
|
itemValue() {
|
|
@@ -337,6 +351,11 @@ export default /*#__PURE__*/ {
|
|
|
337
351
|
},
|
|
338
352
|
},
|
|
339
353
|
methods: {
|
|
354
|
+
|
|
355
|
+
onDraggableAdded(event) {
|
|
356
|
+
console.log('Se agregó un nuevo elemento a la lista', event);
|
|
357
|
+
this.$emit("draggableAdded", event);
|
|
358
|
+
},
|
|
340
359
|
setupFilters() {
|
|
341
360
|
this.columns.forEach((column) => {
|
|
342
361
|
if (this.isColumnHasFilter(column)) {
|
|
@@ -858,38 +877,38 @@ export default /*#__PURE__*/ {
|
|
|
858
877
|
let error_message = "Ha ocurrido un error";
|
|
859
878
|
|
|
860
879
|
if (typeof error === "string") {
|
|
861
|
-
|
|
880
|
+
error_message = error;
|
|
862
881
|
} else if (error.response) {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
882
|
+
// handle API errors
|
|
883
|
+
if (error.response.status === 401) {
|
|
884
|
+
error_message = "No estás autorizado para realizar esta acción";
|
|
885
|
+
} else if (error.response.status === 404) {
|
|
886
|
+
error_message = "El recurso solicitado no se encontró";
|
|
887
|
+
} else if (error.response.status >= 400 && error.response.status < 500) {
|
|
888
|
+
error_message = "Hubo un problema con la solicitud realizada";
|
|
889
|
+
} else if (error.response.status >= 500) {
|
|
890
|
+
error_message = "El servidor no pudo procesar la solicitud";
|
|
891
|
+
}
|
|
873
892
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
893
|
+
if (error.response.data) {
|
|
894
|
+
if (typeof error.response.data === "object") {
|
|
895
|
+
if (error.response.data.errors) {
|
|
896
|
+
let errors = error.response.data.errors;
|
|
897
|
+
this.responseErrors = errors;
|
|
898
|
+
error_message = Object.values(errors)[0][0];
|
|
899
|
+
} else if (error.response.data.message) {
|
|
900
|
+
error_message = error.response.data.message;
|
|
901
|
+
}
|
|
902
|
+
} else if (typeof error.response.data === "string") {
|
|
903
|
+
error_message = error.response.data;
|
|
886
904
|
}
|
|
905
|
+
}
|
|
887
906
|
} else if (error.request) {
|
|
888
|
-
|
|
889
|
-
|
|
907
|
+
// handle network errors
|
|
908
|
+
error_message = "No se pudo conectar con el servidor. Verifique su conexión a Internet.";
|
|
890
909
|
} else if (error.message) {
|
|
891
|
-
|
|
892
|
-
|
|
910
|
+
// handle other errors
|
|
911
|
+
error_message = error.message;
|
|
893
912
|
}
|
|
894
913
|
|
|
895
914
|
|
|
@@ -914,7 +933,7 @@ export default /*#__PURE__*/ {
|
|
|
914
933
|
|
|
915
934
|
onChangeFilter(event) {
|
|
916
935
|
this.forceRecomputeCounter++;
|
|
917
|
-
console.debug("Filters debug ",this.finalFilters,this.internalFilter,this.internalFilters,this.filter,this.filters);
|
|
936
|
+
console.debug("Filters debug ", this.finalFilters, this.internalFilter, this.internalFilters, this.filter, this.filters);
|
|
918
937
|
setTimeout(() => {
|
|
919
938
|
this.refresh();
|
|
920
939
|
}, 1);
|
|
@@ -963,14 +982,12 @@ export default /*#__PURE__*/ {
|
|
|
963
982
|
<div class="form-group" v-else-if="column.type == 'date'">
|
|
964
983
|
<div class="row">
|
|
965
984
|
<div class="col-6">
|
|
966
|
-
<b-form-datepicker v-model="
|
|
967
|
-
|
|
968
|
-
" today-button reset-button close-button locale="es"></b-form-datepicker>
|
|
985
|
+
<b-form-datepicker v-model="internalFilterByProp(column.prop + '_from').value
|
|
986
|
+
" today-button reset-button close-button locale="es"></b-form-datepicker>
|
|
969
987
|
</div>
|
|
970
988
|
<div class="col-6">
|
|
971
|
-
<b-form-datepicker v-model="
|
|
972
|
-
|
|
973
|
-
" today-button reset-button close-button locale="es"></b-form-datepicker>
|
|
989
|
+
<b-form-datepicker v-model="internalFilterByProp(column.prop + '_to').value
|
|
990
|
+
" today-button reset-button close-button locale="es"></b-form-datepicker>
|
|
974
991
|
</div>
|
|
975
992
|
</div>
|
|
976
993
|
</div>
|
|
@@ -982,7 +999,8 @@ export default /*#__PURE__*/ {
|
|
|
982
999
|
<select class="form-control" v-model="internalFilterByProp(column.prop).value"
|
|
983
1000
|
@change="onChangeFilter($event)">
|
|
984
1001
|
<option value=""></option>
|
|
985
|
-
<option :value="option.id ? option.id : option.value
|
|
1002
|
+
<option :value="option.id ? option.id : option.value" v-for="option in column.options"
|
|
1003
|
+
:key="option.id ? option.id : option.value">
|
|
986
1004
|
{{
|
|
987
1005
|
option.text
|
|
988
1006
|
? option.text
|
|
@@ -1002,7 +1020,8 @@ export default /*#__PURE__*/ {
|
|
|
1002
1020
|
@change="onChangeFilter($event)">
|
|
1003
1021
|
<option value=""></option>
|
|
1004
1022
|
<template v-if="column.options">
|
|
1005
|
-
<option :value="option.id ? option.id : option.value
|
|
1023
|
+
<option :value="option.id ? option.id : option.value" v-for="option in column.options"
|
|
1024
|
+
:key="option.id ? option.id : option.value">
|
|
1006
1025
|
{{
|
|
1007
1026
|
option.text
|
|
1008
1027
|
? option.text
|
|
@@ -1080,12 +1099,11 @@ export default /*#__PURE__*/ {
|
|
|
1080
1099
|
<th v-for="(column, indexc) in columns" :key="indexc"
|
|
1081
1100
|
:style="{ width: column.width ? column.width : 'inherit' }" scope="col">
|
|
1082
1101
|
<slot :name="'filter-' + column.prop" v-bind:column="column" v-bind:filter="filter"
|
|
1083
|
-
v-bind:internalFilterByProp="internalFilterByProp" v-if="
|
|
1084
|
-
enableFilters &&
|
|
1102
|
+
v-bind:internalFilterByProp="internalFilterByProp" v-if="enableFilters &&
|
|
1085
1103
|
filtersVisible &&
|
|
1086
1104
|
isColumnHasFilter(column) &&
|
|
1087
1105
|
internalFilterByProp(column.prop)
|
|
1088
|
-
|
|
1106
|
+
">
|
|
1089
1107
|
|
|
1090
1108
|
<div class="form-group">
|
|
1091
1109
|
<select v-if="column.type == 'boolean'" class="form-control form-control-md p-2"
|
|
@@ -1097,15 +1115,13 @@ export default /*#__PURE__*/ {
|
|
|
1097
1115
|
|
|
1098
1116
|
<div class="row" v-else-if="column.type == 'date'">
|
|
1099
1117
|
<div class="col-6">
|
|
1100
|
-
<b-form-datepicker v-model="
|
|
1101
|
-
|
|
1102
|
-
" today-button reset-button close-button locale="es"
|
|
1118
|
+
<b-form-datepicker v-model="internalFilterByProp(column.prop + '_from').value
|
|
1119
|
+
" today-button reset-button close-button locale="es"
|
|
1103
1120
|
class="form-control-md p-2"></b-form-datepicker>
|
|
1104
1121
|
</div>
|
|
1105
1122
|
<div class="col-6">
|
|
1106
|
-
<b-form-datepicker v-model="
|
|
1107
|
-
|
|
1108
|
-
" today-button reset-button close-button locale="es"
|
|
1123
|
+
<b-form-datepicker v-model="internalFilterByProp(column.prop + '_to').value
|
|
1124
|
+
" today-button reset-button close-button locale="es"
|
|
1109
1125
|
class="form-control-md p-2"></b-form-datepicker>
|
|
1110
1126
|
</div>
|
|
1111
1127
|
</div>
|
|
@@ -1140,8 +1156,9 @@ export default /*#__PURE__*/ {
|
|
|
1140
1156
|
|
|
1141
1157
|
<b-form-checkbox v-else-if="column.type == 'checkbox'" name="select-all" @change="toggleAll()">
|
|
1142
1158
|
</b-form-checkbox>
|
|
1143
|
-
<input v-else class="form-control form-control-md p-2"
|
|
1144
|
-
|
|
1159
|
+
<input v-else class="form-control form-control-md p-2"
|
|
1160
|
+
v-model="internalFilterByProp(column.prop).value" :placeholder="column.label"
|
|
1161
|
+
@change="onChangeFilter($event)" />
|
|
1145
1162
|
|
|
1146
1163
|
</div>
|
|
1147
1164
|
</slot>
|
|
@@ -1149,9 +1166,9 @@ export default /*#__PURE__*/ {
|
|
|
1149
1166
|
<span v-else>{{ column.label }}</span>
|
|
1150
1167
|
|
|
1151
1168
|
<span v-if="sortable && internalFilterByProp(column.prop + '_sort')" class="sort-filter"
|
|
1152
|
-
@click="toggleSortFilter(column)"><b-icon-sort
|
|
1153
|
-
v-if="!internalFilterByProp(column.prop + '_sort').value"></b-icon-sort><b-icon-sort-up
|
|
1154
|
-
|
|
1169
|
+
@click="toggleSortFilter(column)"><b-icon-sort-down
|
|
1170
|
+
v-if="!internalFilterByProp(column.prop + '_sort').value"></b-icon-sort-down><b-icon-sort-up
|
|
1171
|
+
v-if="internalFilterByProp(column.prop + '_sort').value == 'ASC'"></b-icon-sort-up>
|
|
1155
1172
|
<b-icon-sort-down
|
|
1156
1173
|
v-if="internalFilterByProp(column.prop + '_sort').value == 'DESC'"></b-icon-sort-down>
|
|
1157
1174
|
</span>
|
|
@@ -1160,80 +1177,79 @@ export default /*#__PURE__*/ {
|
|
|
1160
1177
|
</tr>
|
|
1161
1178
|
</thead>
|
|
1162
1179
|
|
|
1163
|
-
<draggable v-model="items" group="
|
|
1164
|
-
@start="drag = true" @end="drag = false" @sort="onSort()"
|
|
1180
|
+
<draggable v-model="items" :group="draggableGroup" tag="tbody" :draggable="orderable ? '.item' : '.none'"
|
|
1181
|
+
@start="drag = true" @end="drag = false" @sort="onSort()" @added="onDraggableAdded($event)"
|
|
1182
|
+
:options="draggableOptions">
|
|
1165
1183
|
<tr v-for="(item, index) in itemsList" v-bind:key="index" @mouseover="onRowHover(item, index)"
|
|
1166
1184
|
@click="onRowClick(item, index)" class="item">
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
itemValue(column, item) == '1'
|
|
1185
|
+
|
|
1186
|
+
<th :colspan="columns.length" v-if="item.group">
|
|
1187
|
+
<span>{{ item.label }}</span>
|
|
1188
|
+
</th>
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
<slot name="row" v-bind:item="item" v-else>
|
|
1192
|
+
<td v-for="(column, indexc) in columns" :key="indexc" :scope="column.prop == 'id' ? 'row' : ''">
|
|
1193
|
+
<slot :name="'cell-' + column.prop" v-bind:item="item" v-bind:index="index" v-bind:itemindex="index"
|
|
1194
|
+
v-bind:columnindex="indexc">
|
|
1195
|
+
<span v-if="column.type == 'boolean'">
|
|
1196
|
+
<b-badge variant="success" v-if="itemValue(column, item) == 'true' ||
|
|
1197
|
+
itemValue(column, item) == 1 ||
|
|
1198
|
+
itemValue(column, item) == '1'
|
|
1182
1199
|
"><b-icon-check-circle></b-icon-check-circle></b-badge>
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
itemValue(column, item) == 'false'
|
|
1200
|
+
<b-badge variant="danger" v-if="!itemValue(column, item) ||
|
|
1201
|
+
itemValue(column, item) == '0' ||
|
|
1202
|
+
itemValue(column, item) == 'false'
|
|
1187
1203
|
"><b-icon-x-circle></b-icon-x-circle></b-badge>
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1204
|
+
</span>
|
|
1205
|
+
<span v-else-if="column.type == 'date'">
|
|
1206
|
+
{{
|
|
1207
|
+
itemValue(column, item)
|
|
1208
|
+
? moment(itemValue(column, item)).format(
|
|
1209
|
+
column.format ? column.format : 'L LT'
|
|
1210
|
+
)
|
|
1211
|
+
: itemValue(column, item)
|
|
1212
|
+
}}
|
|
1213
|
+
</span>
|
|
1214
|
+
<span v-else-if="column.type == 'select'">
|
|
1215
|
+
<b-form-checkbox v-model="item.selected" @change="onCheckSelect($event, item)">
|
|
1216
|
+
</b-form-checkbox>
|
|
1217
|
+
</span>
|
|
1218
|
+
<span v-else-if="column.type == 'state'">
|
|
1219
|
+
{{
|
|
1220
|
+
getStateValue(itemValue(column, item), column.options)
|
|
1221
|
+
}}
|
|
1222
|
+
</span>
|
|
1223
|
+
<span v-else-if="column.type == 'array'">
|
|
1224
|
+
{{
|
|
1225
|
+
getArrayValue(
|
|
1226
|
+
itemValue(column, item),
|
|
1227
|
+
column.displayProp
|
|
1228
|
+
)
|
|
1229
|
+
}}
|
|
1230
|
+
</span>
|
|
1231
|
+
<span v-else>
|
|
1232
|
+
{{ itemValue(column, item) }}
|
|
1233
|
+
</span>
|
|
1234
|
+
</slot>
|
|
1235
|
+
|
|
1236
|
+
<b-button-group v-if="column.type == 'actions'">
|
|
1237
|
+
<slot name="rowAction" v-bind:item="item" v-bind:index="index" v-bind:showItem="showItem"
|
|
1238
|
+
v-bind:updateItem="updateItem" v-bind:removeItem="removeItem">
|
|
1239
|
+
<b-button variant="primary" @click="showItem(item.id, index)">
|
|
1240
|
+
<b-icon-eye></b-icon-eye>
|
|
1241
|
+
</b-button>
|
|
1242
|
+
<b-button variant="secondary" @click="updateItem(item.id, index)">
|
|
1243
|
+
<b-icon-pencil></b-icon-pencil>
|
|
1244
|
+
</b-button>
|
|
1245
|
+
<b-button variant="danger" @click="removeItem(item.id, index)">
|
|
1246
|
+
<b-icon-trash></b-icon-trash>
|
|
1247
|
+
</b-button>
|
|
1218
1248
|
</slot>
|
|
1249
|
+
</b-button-group>
|
|
1250
|
+
</td>
|
|
1251
|
+
</slot>
|
|
1219
1252
|
|
|
1220
|
-
<b-button-group v-if="column.type == 'actions'">
|
|
1221
|
-
<slot name="rowAction" v-bind:item="item" v-bind:index="index" v-bind:showItem="showItem"
|
|
1222
|
-
v-bind:updateItem="updateItem" v-bind:removeItem="removeItem">
|
|
1223
|
-
<b-button variant="primary" @click="showItem(item.id, index)">
|
|
1224
|
-
<b-icon-eye></b-icon-eye>
|
|
1225
|
-
</b-button>
|
|
1226
|
-
<b-button variant="secondary" @click="updateItem(item.id, index)">
|
|
1227
|
-
<b-icon-pencil></b-icon-pencil>
|
|
1228
|
-
</b-button>
|
|
1229
|
-
<b-button variant="danger" @click="removeItem(item.id, index)">
|
|
1230
|
-
<b-icon-trash></b-icon-trash>
|
|
1231
|
-
</b-button>
|
|
1232
|
-
</slot>
|
|
1233
|
-
</b-button-group>
|
|
1234
|
-
</td>
|
|
1235
|
-
</slot>
|
|
1236
|
-
|
|
1237
1253
|
</tr>
|
|
1238
1254
|
</draggable>
|
|
1239
1255
|
</table>
|
|
@@ -1247,8 +1263,9 @@ export default /*#__PURE__*/ {
|
|
|
1247
1263
|
{{ messageEmptyResults }}
|
|
1248
1264
|
</p>
|
|
1249
1265
|
|
|
1250
|
-
<draggable v-model="items" group="
|
|
1251
|
-
@start="drag = true" @end="drag = false" @sort="onSort()"
|
|
1266
|
+
<draggable v-model="items" :group="draggableGroup" class="row" :draggable="orderable ? '.item' : '.none'"
|
|
1267
|
+
@start="drag = true" @end="drag = false" @sort="onSort()" @added="onDraggableAdded($event)"
|
|
1268
|
+
:options="draggableOptions">
|
|
1252
1269
|
<b-col v-for="(item, index) in itemsList" v-bind:key="index" :cols="colXs" :sm="colSm" :md="colMd" :lg="colLg"
|
|
1253
1270
|
:xl="colXl" class="item">
|
|
1254
1271
|
<b-card :title="item.title" tag="article" class="mb-2 card-crud" :class="cardClass"
|
|
@@ -1259,16 +1276,14 @@ export default /*#__PURE__*/ {
|
|
|
1259
1276
|
<slot :name="'cell-' + column.prop" v-bind:item="item" v-bind:index="index" v-bind:itemindex="index"
|
|
1260
1277
|
v-bind:columnindex="indexc">
|
|
1261
1278
|
<span v-if="column.type == 'boolean'">
|
|
1262
|
-
<b-badge variant="success" v-if="
|
|
1263
|
-
itemValue(column, item) == 'true' ||
|
|
1279
|
+
<b-badge variant="success" v-if="itemValue(column, item) == 'true' ||
|
|
1264
1280
|
itemValue(column, item) == 1 ||
|
|
1265
1281
|
itemValue(column, item) == '1'
|
|
1266
|
-
|
|
1267
|
-
<b-badge variant="danger" v-if="
|
|
1268
|
-
!itemValue(column, item) ||
|
|
1282
|
+
"><b-icon-check-circle></b-icon-check-circle></b-badge>
|
|
1283
|
+
<b-badge variant="danger" v-if="!itemValue(column, item) ||
|
|
1269
1284
|
itemValue(column, item) == '0' ||
|
|
1270
1285
|
itemValue(column, item) == 'false'
|
|
1271
|
-
|
|
1286
|
+
"><b-icon-x-circle></b-icon-x-circle></b-badge>
|
|
1272
1287
|
</span>
|
|
1273
1288
|
<span v-else-if="column.type == 'date'">
|
|
1274
1289
|
{{ itemValue(column, item) }}
|