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.
- package/dist/vue-laravel-crud.esm.js +41 -33
- package/dist/vue-laravel-crud.min.js +2 -2
- package/dist/vue-laravel-crud.ssr.js +42 -33
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +32 -21
|
@@ -12532,7 +12532,7 @@ Plugin.install = function (Vue, options) {
|
|
|
12532
12532
|
|
|
12533
12533
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
12534
12534
|
window.Vue.use(Plugin);
|
|
12535
|
-
}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-
|
|
12535
|
+
}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-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";
|
|
12536
12536
|
n(css, {});function normalizeComponent (
|
|
12537
12537
|
scriptExports,
|
|
12538
12538
|
render,
|
|
@@ -13012,7 +13012,11 @@ n(css, {});function normalizeComponent (
|
|
|
13012
13012
|
if (this.ajax) {
|
|
13013
13013
|
this.fetchItems();
|
|
13014
13014
|
} else {
|
|
13015
|
-
this.
|
|
13015
|
+
if (this.grouped) {
|
|
13016
|
+
this.groupItems(this.models);
|
|
13017
|
+
} else {
|
|
13018
|
+
this.items = this.models;
|
|
13019
|
+
}
|
|
13016
13020
|
this.pagination.total = this.items.length;
|
|
13017
13021
|
this.firstLoad = true;
|
|
13018
13022
|
}
|
|
@@ -13234,6 +13238,7 @@ n(css, {});function normalizeComponent (
|
|
|
13234
13238
|
}
|
|
13235
13239
|
this.onSelect();
|
|
13236
13240
|
console.debug("toggle all", this.selectedItems);
|
|
13241
|
+
this.$forceUpdate();
|
|
13237
13242
|
},
|
|
13238
13243
|
unSelectItem: function unSelectItem(item) {
|
|
13239
13244
|
this.selectedItems = this.selectedItems.filter(function (e) {
|
|
@@ -13411,36 +13416,7 @@ n(css, {});function normalizeComponent (
|
|
|
13411
13416
|
_this11.makePagination(response.data);
|
|
13412
13417
|
var items = response.data.data;
|
|
13413
13418
|
if (_this11.grouped) {
|
|
13414
|
-
|
|
13415
|
-
var lastcomparevalue = null;
|
|
13416
|
-
var compareattr = _this11.groupedAttribute;
|
|
13417
|
-
var groupLabelPre = _this11.groupedLabelPre;
|
|
13418
|
-
var groupLabelAfter = _this11.groupedLabelAfter;
|
|
13419
|
-
items.forEach(function (item, key) {
|
|
13420
|
-
if (Array.isArray(item)) {
|
|
13421
|
-
itemswithgroup.push({
|
|
13422
|
-
label: groupLabelPre + key + groupLabelAfter,
|
|
13423
|
-
group: true
|
|
13424
|
-
});
|
|
13425
|
-
item.forEach(function (sitem) {
|
|
13426
|
-
itemswithgroup.push(sitem);
|
|
13427
|
-
});
|
|
13428
|
-
} else {
|
|
13429
|
-
if (lastcomparevalue != item[compareattr]) {
|
|
13430
|
-
lastcomparevalue = item[compareattr];
|
|
13431
|
-
itemswithgroup.push({
|
|
13432
|
-
crudgrouplabel: groupLabelPre + lastcomparevalue + groupLabelAfter,
|
|
13433
|
-
crudgroup: true
|
|
13434
|
-
});
|
|
13435
|
-
}
|
|
13436
|
-
itemswithgroup.push(item);
|
|
13437
|
-
}
|
|
13438
|
-
});
|
|
13439
|
-
if (concat) {
|
|
13440
|
-
_this11.items = _this11.items.concat(itemswithgroup);
|
|
13441
|
-
} else {
|
|
13442
|
-
_this11.items = itemswithgroup;
|
|
13443
|
-
}
|
|
13419
|
+
_this11.groupItems(items, concat);
|
|
13444
13420
|
} else {
|
|
13445
13421
|
if (concat) {
|
|
13446
13422
|
_this11.items = _this11.items.concat(items);
|
|
@@ -13459,6 +13435,39 @@ n(css, {});function normalizeComponent (
|
|
|
13459
13435
|
_this11.fetchError = true;
|
|
13460
13436
|
});
|
|
13461
13437
|
},
|
|
13438
|
+
groupItems: function groupItems(items) {
|
|
13439
|
+
var concat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
13440
|
+
var itemswithgroup = [];
|
|
13441
|
+
var lastcomparevalue = null;
|
|
13442
|
+
var compareattr = this.groupedAttribute;
|
|
13443
|
+
var groupLabelPre = this.groupedLabelPre;
|
|
13444
|
+
var groupLabelAfter = this.groupedLabelAfter;
|
|
13445
|
+
items.forEach(function (item, key) {
|
|
13446
|
+
if (Array.isArray(item)) {
|
|
13447
|
+
itemswithgroup.push({
|
|
13448
|
+
label: groupLabelPre + key + groupLabelAfter,
|
|
13449
|
+
group: true
|
|
13450
|
+
});
|
|
13451
|
+
item.forEach(function (sitem) {
|
|
13452
|
+
itemswithgroup.push(sitem);
|
|
13453
|
+
});
|
|
13454
|
+
} else {
|
|
13455
|
+
if (lastcomparevalue != item[compareattr]) {
|
|
13456
|
+
lastcomparevalue = item[compareattr];
|
|
13457
|
+
itemswithgroup.push({
|
|
13458
|
+
crudgrouplabel: groupLabelPre + lastcomparevalue + groupLabelAfter,
|
|
13459
|
+
crudgroup: true
|
|
13460
|
+
});
|
|
13461
|
+
}
|
|
13462
|
+
itemswithgroup.push(item);
|
|
13463
|
+
}
|
|
13464
|
+
});
|
|
13465
|
+
if (concat) {
|
|
13466
|
+
this.items = this.items.concat(itemswithgroup);
|
|
13467
|
+
} else {
|
|
13468
|
+
this.items = itemswithgroup;
|
|
13469
|
+
}
|
|
13470
|
+
},
|
|
13462
13471
|
removeItem: function removeItem(id, index) {
|
|
13463
13472
|
var _this12 = this;
|
|
13464
13473
|
this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
|
|
@@ -15048,7 +15057,7 @@ var _sfc_render = function render() {
|
|
|
15048
15057
|
}) : _vm._e()], 2)], 1);
|
|
15049
15058
|
};
|
|
15050
15059
|
var _sfc_staticRenderFns = [];
|
|
15051
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
15060
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "98af7782", null, null);
|
|
15052
15061
|
var component$1 = __component__.exports;// Import vue component
|
|
15053
15062
|
|
|
15054
15063
|
// Default export is installable instance of component.
|
package/package.json
CHANGED
package/src/vue-laravel-crud.vue
CHANGED
|
@@ -419,7 +419,13 @@ export default /*#__PURE__*/ {
|
|
|
419
419
|
if (this.ajax) {
|
|
420
420
|
this.fetchItems();
|
|
421
421
|
} else {
|
|
422
|
-
|
|
422
|
+
|
|
423
|
+
if (this.grouped) {
|
|
424
|
+
this.groupItems(this.models);
|
|
425
|
+
} else {
|
|
426
|
+
this.items = this.models;
|
|
427
|
+
}
|
|
428
|
+
|
|
423
429
|
this.pagination.total = this.items.length;
|
|
424
430
|
this.firstLoad = true;
|
|
425
431
|
}
|
|
@@ -666,6 +672,7 @@ export default /*#__PURE__*/ {
|
|
|
666
672
|
this.onSelect();
|
|
667
673
|
|
|
668
674
|
console.debug("toggle all",this.selectedItems);
|
|
675
|
+
this.$forceUpdate();
|
|
669
676
|
},
|
|
670
677
|
unSelectItem(item){
|
|
671
678
|
this.selectedItems = this.selectedItems.filter(
|
|
@@ -817,7 +824,30 @@ export default /*#__PURE__*/ {
|
|
|
817
824
|
this.makePagination(response.data);
|
|
818
825
|
let items = response.data.data;
|
|
819
826
|
if (this.grouped) {
|
|
820
|
-
|
|
827
|
+
this.groupItems(items,concat);
|
|
828
|
+
} else {
|
|
829
|
+
if (concat) {
|
|
830
|
+
this.items = this.items.concat(items);
|
|
831
|
+
} else {
|
|
832
|
+
this.items = items;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
this.loading = false;
|
|
837
|
+
this.firstLoad = true;
|
|
838
|
+
this.$emit("afterFetch", {});
|
|
839
|
+
})
|
|
840
|
+
.catch((error) => {
|
|
841
|
+
//console.debug(error);
|
|
842
|
+
this.toastError(error);
|
|
843
|
+
this.loading = false;
|
|
844
|
+
this.firstLoad = true;
|
|
845
|
+
this.fetchError = true;
|
|
846
|
+
});
|
|
847
|
+
},
|
|
848
|
+
|
|
849
|
+
groupItems(items,concat = false){
|
|
850
|
+
let itemswithgroup = [];
|
|
821
851
|
let lastcomparevalue = null;
|
|
822
852
|
let compareattr = this.groupedAttribute;
|
|
823
853
|
let groupLabelPre = this.groupedLabelPre;
|
|
@@ -848,25 +878,6 @@ export default /*#__PURE__*/ {
|
|
|
848
878
|
} else {
|
|
849
879
|
this.items = itemswithgroup;
|
|
850
880
|
}
|
|
851
|
-
} else {
|
|
852
|
-
if (concat) {
|
|
853
|
-
this.items = this.items.concat(items);
|
|
854
|
-
} else {
|
|
855
|
-
this.items = items;
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
this.loading = false;
|
|
860
|
-
this.firstLoad = true;
|
|
861
|
-
this.$emit("afterFetch", {});
|
|
862
|
-
})
|
|
863
|
-
.catch((error) => {
|
|
864
|
-
//console.debug(error);
|
|
865
|
-
this.toastError(error);
|
|
866
|
-
this.loading = false;
|
|
867
|
-
this.firstLoad = true;
|
|
868
|
-
this.fetchError = true;
|
|
869
|
-
});
|
|
870
881
|
},
|
|
871
882
|
removeItem(id, index) {
|
|
872
883
|
this.$bvModal
|