vue-laravel-crud 1.6.16 → 1.6.19

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-e80d091a]:last-child,\ntr td[data-v-e80d091a]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-e80d091a] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-e80d091a] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-e80d091a] .crud-title[data-v-e80d091a] {\n margin: 0; }\n .crud-header[data-v-e80d091a] .crud-search[data-v-e80d091a] {\n max-width: 15rem; }\n .crud-header[data-v-e80d091a] .crud-search[data-v-e80d091a] .btn[data-v-e80d091a] {\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-e80d091a] .crud-search[data-v-e80d091a] .btn[data-v-e80d091a].open[data-v-e80d091a] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-e80d091a] .table-options[data-v-e80d091a] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-e80d091a] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-e80d091a] {\n table-layout: auto; }\n .table[data-v-e80d091a] tbody[data-v-e80d091a] td[data-v-e80d091a] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-e80d091a] tbody[data-v-e80d091a] td[data-v-e80d091a]::-webkit-scrollbar {\n display: none; } }\n";
12118
+ var css = "tr td[data-v-373bb24e]:last-child,\ntr td[data-v-373bb24e]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-373bb24e] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-373bb24e] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-373bb24e] .crud-title[data-v-373bb24e] {\n margin: 0; }\n .crud-header[data-v-373bb24e] .crud-search[data-v-373bb24e] {\n max-width: 15rem; }\n .crud-header[data-v-373bb24e] .crud-search[data-v-373bb24e] .btn[data-v-373bb24e] {\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-373bb24e] .crud-search[data-v-373bb24e] .btn[data-v-373bb24e].open[data-v-373bb24e] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-373bb24e] .table-options[data-v-373bb24e] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-373bb24e] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-373bb24e] {\n table-layout: auto; }\n .table[data-v-373bb24e] tbody[data-v-373bb24e] td[data-v-373bb24e] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-373bb24e] tbody[data-v-373bb24e] td[data-v-373bb24e]::-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
  }
@@ -12641,7 +12645,10 @@ const _sfc_main = {
12641
12645
  let filter = [];
12642
12646
  this.forceRecomputeCounter;
12643
12647
  this.internalFilters.forEach(f => {
12644
- if (f.value) filter.push([f.column, f.op, f.value]);
12648
+ if (f.value) {
12649
+ let colname = f.column.replace("_sort", "").replace("_from", "").replace("_to", "");
12650
+ filter.push([colname, f.op, f.value]);
12651
+ }
12645
12652
  });
12646
12653
  return filter;
12647
12654
  },
@@ -12798,22 +12805,23 @@ const _sfc_main = {
12798
12805
  this.selectedItems = this.items;
12799
12806
  this.selectedItems.forEach(item => item.selected = true);
12800
12807
  } else {
12801
- this.selectedItems = [];
12802
12808
  this.selectedItems.forEach(item => item.selected = false);
12809
+ this.items.forEach(item => item.selected = false);
12810
+ this.selectedItems = [];
12803
12811
  }
12804
12812
  this.onSelect();
12805
12813
  console.debug("toggle all", this.selectedItems);
12814
+ this.$forceUpdate();
12806
12815
  },
12807
12816
  unSelectItem(item) {
12808
- this.selectedItems = this.selectedItems.filter(e => e.id != item.id);
12809
12817
  item.selected = false;
12818
+ this.selectedItems = this.selectedItems.filter(e => e.id != item.id);
12810
12819
  },
12811
12820
  selectItem() {
12812
12821
  let sitem = this.selectedItems.find(e => e.id == this.item.id);
12813
12822
  if (sitem) {
12814
12823
  this.item.selected = false;
12815
12824
  this.selectedItems = this.selectedItems.filter(e => e.id != this.item.id);
12816
- this.item.selected = false;
12817
12825
  } else {
12818
12826
  this.item.selected = true;
12819
12827
  this.selectedItems.push(this.item);
@@ -12940,36 +12948,7 @@ const _sfc_main = {
12940
12948
  this.makePagination(response.data);
12941
12949
  let items = response.data.data;
12942
12950
  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
- }
12951
+ this.groupItems(items, concat);
12973
12952
  } else {
12974
12953
  if (concat) {
12975
12954
  this.items = this.items.concat(items);
@@ -12988,6 +12967,38 @@ const _sfc_main = {
12988
12967
  this.fetchError = true;
12989
12968
  });
12990
12969
  },
12970
+ groupItems(items, concat = false) {
12971
+ let itemswithgroup = [];
12972
+ let lastcomparevalue = null;
12973
+ let compareattr = this.groupedAttribute;
12974
+ let groupLabelPre = this.groupedLabelPre;
12975
+ let groupLabelAfter = this.groupedLabelAfter;
12976
+ items.forEach((item, key) => {
12977
+ if (Array.isArray(item)) {
12978
+ itemswithgroup.push({
12979
+ label: groupLabelPre + key + groupLabelAfter,
12980
+ group: true
12981
+ });
12982
+ item.forEach(sitem => {
12983
+ itemswithgroup.push(sitem);
12984
+ });
12985
+ } else {
12986
+ if (lastcomparevalue != item[compareattr]) {
12987
+ lastcomparevalue = item[compareattr];
12988
+ itemswithgroup.push({
12989
+ crudgrouplabel: groupLabelPre + lastcomparevalue + groupLabelAfter,
12990
+ crudgroup: true
12991
+ });
12992
+ }
12993
+ itemswithgroup.push(item);
12994
+ }
12995
+ });
12996
+ if (concat) {
12997
+ this.items = this.items.concat(itemswithgroup);
12998
+ } else {
12999
+ this.items = itemswithgroup;
13000
+ }
13001
+ },
12991
13002
  removeItem(id, index) {
12992
13003
  this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
12993
13004
  size: "sm",
@@ -14410,7 +14421,7 @@ var _sfc_render = function render() {
14410
14421
  }) : _vm._e()], 2)], 1);
14411
14422
  };
14412
14423
  var _sfc_staticRenderFns = [];
14413
- var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "e80d091a", null, null);
14424
+ var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "373bb24e", null, null);
14414
14425
  var component = __component__.exports;
14415
14426
 
14416
14427
  // Import vue component