vue-laravel-crud 1.5.13 → 1.6.1
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 +666 -418
- package/dist/vue-laravel-crud.min.js +3 -10
- package/dist/vue-laravel-crud.ssr.js +910 -654
- package/package.json +3 -1
- package/src/vue-laravel-crud.vue +21 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-laravel-crud",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/clonixdev/vue-laravel-crud",
|
|
6
6
|
"main": "dist/vue-laravel-crud.ssr.js",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"axios": "^1.3.5",
|
|
24
24
|
"bootstrap-vue": "^2.21.2",
|
|
25
25
|
"moment": "^2.29.1",
|
|
26
|
+
"sass-loader": "^14.1.1",
|
|
26
27
|
"vue-infinite-loading": "^2.4.5",
|
|
28
|
+
"vue-masonry-css": "^1.0.3",
|
|
27
29
|
"vuedraggable": "^2.24.3"
|
|
28
30
|
},
|
|
29
31
|
"devDependencies": {
|
package/src/vue-laravel-crud.vue
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
import draggable from "vuedraggable";
|
|
3
3
|
import moment from "moment";
|
|
4
4
|
import InfiniteLoading from 'vue-infinite-loading';
|
|
5
|
+
import Vue from 'vue'
|
|
6
|
+
import VueMasonry from 'vue-masonry-css'
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
export default /*#__PURE__*/ {
|
|
7
11
|
name: "VueLaravelCrud",
|
|
8
12
|
components: {
|
|
9
13
|
draggable,
|
|
10
|
-
InfiniteLoading
|
|
14
|
+
InfiniteLoading,
|
|
15
|
+
VueMasonry
|
|
11
16
|
},
|
|
12
17
|
data() {
|
|
13
18
|
return {
|
|
@@ -45,6 +50,7 @@ export default /*#__PURE__*/ {
|
|
|
45
50
|
optionsLoaded: false,
|
|
46
51
|
isMobile: false,
|
|
47
52
|
refreshing: false,
|
|
53
|
+
fetchError: false,
|
|
48
54
|
|
|
49
55
|
};
|
|
50
56
|
},
|
|
@@ -314,6 +320,10 @@ export default /*#__PURE__*/ {
|
|
|
314
320
|
}
|
|
315
321
|
|
|
316
322
|
},
|
|
323
|
+
masonryEnabled: {
|
|
324
|
+
type: Boolean,
|
|
325
|
+
default: false,
|
|
326
|
+
},
|
|
317
327
|
|
|
318
328
|
masonrySort: {
|
|
319
329
|
type: Boolean,
|
|
@@ -460,11 +470,13 @@ export default /*#__PURE__*/ {
|
|
|
460
470
|
},
|
|
461
471
|
infiniteHandler($state) {
|
|
462
472
|
|
|
473
|
+
|
|
463
474
|
const hasNextPage = (this.pagination.total > 0 || !this.firstLoad) && (!this.firstLoad || (this.pagination.current_page * this.pagination.per_page) <= this.pagination.total);
|
|
464
475
|
console.debug("Has next page", hasNextPage, this.pagination);
|
|
465
476
|
if (hasNextPage) {
|
|
466
477
|
const page = this.pagination.current_page + 1;
|
|
467
478
|
this.fetchItems(page, true).then(() => {
|
|
479
|
+
console.debug("infinite handler then");
|
|
468
480
|
$state.loaded();
|
|
469
481
|
}).catch(error => {
|
|
470
482
|
console.debug("infinite handler error", error);
|
|
@@ -787,6 +799,8 @@ export default /*#__PURE__*/ {
|
|
|
787
799
|
//console.debug(error);
|
|
788
800
|
this.toastError(error);
|
|
789
801
|
this.loading = false;
|
|
802
|
+
this.firstLoad = true;
|
|
803
|
+
this.fetchError = true;
|
|
790
804
|
});
|
|
791
805
|
},
|
|
792
806
|
removeItem(id, index) {
|
|
@@ -1548,6 +1562,11 @@ export default /*#__PURE__*/ {
|
|
|
1548
1562
|
<draggable v-model="items" :group="draggableGroup" class="row" :draggable="orderable ? '.item' : '.none'"
|
|
1549
1563
|
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1550
1564
|
@change="onDraggableChange($event)" :options="draggableOptions">
|
|
1565
|
+
<masonry
|
|
1566
|
+
:cols="{default: colLg, 1000: colMd, 700: colSm, 400: colXs}"
|
|
1567
|
+
:gutter="{default: '30px', 700: '15px'}"
|
|
1568
|
+
>
|
|
1569
|
+
|
|
1551
1570
|
<b-col v-for="(item, index) in itemsList" v-bind:key="index" :cols="colXs" :sm="colSm" :md="colMd" :lg="colLg"
|
|
1552
1571
|
:xl="colXl" class="item">
|
|
1553
1572
|
<b-card :title="item.title" tag="article" class="mb-2 card-crud" :class="cardClass"
|
|
@@ -1610,7 +1629,7 @@ export default /*#__PURE__*/ {
|
|
|
1610
1629
|
</template>
|
|
1611
1630
|
</b-card>
|
|
1612
1631
|
</b-col>
|
|
1613
|
-
|
|
1632
|
+
</masonry>
|
|
1614
1633
|
</draggable>
|
|
1615
1634
|
|
|
1616
1635
|
<p v-if="!loading && items && items.length == 0 && !infiniteScroll" class="p-3">
|