vue-laravel-crud 1.6.16 → 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-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-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
  }
@@ -12803,6 +12807,7 @@ const _sfc_main = {
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",
@@ -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, "e80d091a", 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