vue-laravel-crud 1.4.26 → 1.4.28

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