vue-laravel-crud 1.6.15 → 1.6.17

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.
@@ -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-2a26c95b]:last-child,\ntr td[data-v-2a26c95b]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-2a26c95b] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-2a26c95b] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-2a26c95b] .crud-title[data-v-2a26c95b] {\n margin: 0; }\n .crud-header[data-v-2a26c95b] .crud-search[data-v-2a26c95b] {\n max-width: 15rem; }\n .crud-header[data-v-2a26c95b] .crud-search[data-v-2a26c95b] .btn[data-v-2a26c95b] {\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-2a26c95b] .crud-search[data-v-2a26c95b] .btn[data-v-2a26c95b].open[data-v-2a26c95b] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-2a26c95b] .table-options[data-v-2a26c95b] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-2a26c95b] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-2a26c95b] {\n table-layout: auto; }\n .table[data-v-2a26c95b] tbody[data-v-2a26c95b] td[data-v-2a26c95b] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-2a26c95b] tbody[data-v-2a26c95b] td[data-v-2a26c95b]::-webkit-scrollbar {\n display: none; } }\n";
12118
+ var css = "tr td[data-v-98af7782]:last-child,\ntr td[data-v-98af7782]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-98af7782] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-98af7782] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-98af7782] .crud-title[data-v-98af7782] {\n margin: 0; }\n .crud-header[data-v-98af7782] .crud-search[data-v-98af7782] {\n max-width: 15rem; }\n .crud-header[data-v-98af7782] .crud-search[data-v-98af7782] .btn[data-v-98af7782] {\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-98af7782] .crud-search[data-v-98af7782] .btn[data-v-98af7782].open[data-v-98af7782] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-98af7782] .table-options[data-v-98af7782] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-98af7782] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-98af7782] {\n table-layout: auto; }\n .table[data-v-98af7782] tbody[data-v-98af7782] td[data-v-98af7782] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-98af7782] tbody[data-v-98af7782] td[data-v-98af7782]::-webkit-scrollbar {\n display: none; } }\n";
12119
12119
  n(css, {});
12120
12120
 
12121
12121
  function normalizeComponent (
@@ -12594,7 +12594,11 @@ const _sfc_main = {
12594
12594
  if (this.ajax) {
12595
12595
  this.fetchItems();
12596
12596
  } else {
12597
- this.items = this.models;
12597
+ if (this.grouped) {
12598
+ this.groupItems(this.models);
12599
+ } else {
12600
+ this.items = this.models;
12601
+ }
12598
12602
  this.pagination.total = this.items.length;
12599
12603
  this.firstLoad = true;
12600
12604
  }
@@ -12793,16 +12797,17 @@ const _sfc_main = {
12793
12797
  this.onSelect();
12794
12798
  console.debug("Selected Items", this.selectedItems);
12795
12799
  },
12796
- toggleAll() {
12797
- if (this.selectedItems.length > 0) {
12798
- this.selectedItems = [];
12799
- this.selectedItems.forEach(item => item.selected = false);
12800
- } else {
12800
+ toggleAll(value) {
12801
+ if (value) {
12801
12802
  this.selectedItems = this.items;
12802
12803
  this.selectedItems.forEach(item => item.selected = true);
12804
+ } else {
12805
+ this.selectedItems = [];
12806
+ this.selectedItems.forEach(item => item.selected = false);
12803
12807
  }
12804
12808
  this.onSelect();
12805
12809
  console.debug("toggle all", this.selectedItems);
12810
+ this.$forceUpdate();
12806
12811
  },
12807
12812
  unSelectItem(item) {
12808
12813
  this.selectedItems = this.selectedItems.filter(e => e.id != item.id);
@@ -12940,36 +12945,7 @@ const _sfc_main = {
12940
12945
  this.makePagination(response.data);
12941
12946
  let items = response.data.data;
12942
12947
  if (this.grouped) {
12943
- let itemswithgroup = [];
12944
- let lastcomparevalue = null;
12945
- let compareattr = this.groupedAttribute;
12946
- let groupLabelPre = this.groupedLabelPre;
12947
- let groupLabelAfter = this.groupedLabelAfter;
12948
- items.forEach((item, key) => {
12949
- if (Array.isArray(item)) {
12950
- itemswithgroup.push({
12951
- label: groupLabelPre + key + groupLabelAfter,
12952
- group: true
12953
- });
12954
- item.forEach(sitem => {
12955
- itemswithgroup.push(sitem);
12956
- });
12957
- } else {
12958
- if (lastcomparevalue != item[compareattr]) {
12959
- lastcomparevalue = item[compareattr];
12960
- itemswithgroup.push({
12961
- crudgrouplabel: groupLabelPre + lastcomparevalue + groupLabelAfter,
12962
- crudgroup: true
12963
- });
12964
- }
12965
- itemswithgroup.push(item);
12966
- }
12967
- });
12968
- if (concat) {
12969
- this.items = this.items.concat(itemswithgroup);
12970
- } else {
12971
- this.items = itemswithgroup;
12972
- }
12948
+ this.groupItems(items, concat);
12973
12949
  } else {
12974
12950
  if (concat) {
12975
12951
  this.items = this.items.concat(items);
@@ -12988,6 +12964,38 @@ const _sfc_main = {
12988
12964
  this.fetchError = true;
12989
12965
  });
12990
12966
  },
12967
+ groupItems(items, concat = false) {
12968
+ let itemswithgroup = [];
12969
+ let lastcomparevalue = null;
12970
+ let compareattr = this.groupedAttribute;
12971
+ let groupLabelPre = this.groupedLabelPre;
12972
+ let groupLabelAfter = this.groupedLabelAfter;
12973
+ items.forEach((item, key) => {
12974
+ if (Array.isArray(item)) {
12975
+ itemswithgroup.push({
12976
+ label: groupLabelPre + key + groupLabelAfter,
12977
+ group: true
12978
+ });
12979
+ item.forEach(sitem => {
12980
+ itemswithgroup.push(sitem);
12981
+ });
12982
+ } else {
12983
+ if (lastcomparevalue != item[compareattr]) {
12984
+ lastcomparevalue = item[compareattr];
12985
+ itemswithgroup.push({
12986
+ crudgrouplabel: groupLabelPre + lastcomparevalue + groupLabelAfter,
12987
+ crudgroup: true
12988
+ });
12989
+ }
12990
+ itemswithgroup.push(item);
12991
+ }
12992
+ });
12993
+ if (concat) {
12994
+ this.items = this.items.concat(itemswithgroup);
12995
+ } else {
12996
+ this.items = itemswithgroup;
12997
+ }
12998
+ },
12991
12999
  removeItem(id, index) {
12992
13000
  this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
12993
13001
  size: "sm",
@@ -13919,7 +13927,7 @@ var _sfc_render = function render() {
13919
13927
  },
13920
13928
  on: {
13921
13929
  "change": function ($event) {
13922
- return _vm.toggleAll();
13930
+ return _vm.toggleAll($event);
13923
13931
  }
13924
13932
  }
13925
13933
  }) : column.type == 'select' ? _c('b-form-checkbox', {
@@ -13928,7 +13936,7 @@ var _sfc_render = function render() {
13928
13936
  },
13929
13937
  on: {
13930
13938
  "change": function ($event) {
13931
- return _vm.toggleAll();
13939
+ return _vm.toggleAll($event);
13932
13940
  }
13933
13941
  }
13934
13942
  }) : _c('input', {
@@ -13965,7 +13973,7 @@ var _sfc_render = function render() {
13965
13973
  },
13966
13974
  on: {
13967
13975
  "change": function ($event) {
13968
- return _vm.toggleAll();
13976
+ return _vm.toggleAll($event);
13969
13977
  }
13970
13978
  }
13971
13979
  })], 1) : _c('span', [_vm._v(_vm._s(column.label))]), _vm.sortable && column.type != 'select' && column.type != 'checkbox' && _vm.internalFilterByProp(column.prop + '_sort') ? _c('span', {
@@ -14410,7 +14418,7 @@ var _sfc_render = function render() {
14410
14418
  }) : _vm._e()], 2)], 1);
14411
14419
  };
14412
14420
  var _sfc_staticRenderFns = [];
14413
- var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "2a26c95b", null, null);
14421
+ var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "98af7782", null, null);
14414
14422
  var component = __component__.exports;
14415
14423
 
14416
14424
  // Import vue component