vue-laravel-crud 1.5.13 → 1.6.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-laravel-crud",
3
- "version": "1.5.13",
3
+ "version": "1.6.0",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/clonixdev/vue-laravel-crud",
6
6
  "main": "dist/vue-laravel-crud.ssr.js",
@@ -24,6 +24,7 @@
24
24
  "bootstrap-vue": "^2.21.2",
25
25
  "moment": "^2.29.1",
26
26
  "vue-infinite-loading": "^2.4.5",
27
+ "vue-masonry-css": "^1.0.3",
27
28
  "vuedraggable": "^2.24.3"
28
29
  },
29
30
  "devDependencies": {
@@ -45,6 +45,7 @@ export default /*#__PURE__*/ {
45
45
  optionsLoaded: false,
46
46
  isMobile: false,
47
47
  refreshing: false,
48
+ fetchError: false,
48
49
 
49
50
  };
50
51
  },
@@ -314,6 +315,10 @@ export default /*#__PURE__*/ {
314
315
  }
315
316
 
316
317
  },
318
+ masonryEnabled: {
319
+ type: Boolean,
320
+ default: false,
321
+ },
317
322
 
318
323
  masonrySort: {
319
324
  type: Boolean,
@@ -460,11 +465,13 @@ export default /*#__PURE__*/ {
460
465
  },
461
466
  infiniteHandler($state) {
462
467
 
468
+
463
469
  const hasNextPage = (this.pagination.total > 0 || !this.firstLoad) && (!this.firstLoad || (this.pagination.current_page * this.pagination.per_page) <= this.pagination.total);
464
470
  console.debug("Has next page", hasNextPage, this.pagination);
465
471
  if (hasNextPage) {
466
472
  const page = this.pagination.current_page + 1;
467
473
  this.fetchItems(page, true).then(() => {
474
+ console.debug("infinite handler then");
468
475
  $state.loaded();
469
476
  }).catch(error => {
470
477
  console.debug("infinite handler error", error);
@@ -787,6 +794,8 @@ export default /*#__PURE__*/ {
787
794
  //console.debug(error);
788
795
  this.toastError(error);
789
796
  this.loading = false;
797
+ this.firstLoad = true;
798
+ this.fetchError = true;
790
799
  });
791
800
  },
792
801
  removeItem(id, index) {
@@ -1548,6 +1557,11 @@ export default /*#__PURE__*/ {
1548
1557
  <draggable v-model="items" :group="draggableGroup" class="row" :draggable="orderable ? '.item' : '.none'"
1549
1558
  @start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
1550
1559
  @change="onDraggableChange($event)" :options="draggableOptions">
1560
+ <masonry
1561
+ :cols="{default: colLg, 1000: colMd, 700: colSm, 400: colXs}"
1562
+ :gutter="{default: '30px', 700: '15px'}"
1563
+ >
1564
+
1551
1565
  <b-col v-for="(item, index) in itemsList" v-bind:key="index" :cols="colXs" :sm="colSm" :md="colMd" :lg="colLg"
1552
1566
  :xl="colXl" class="item">
1553
1567
  <b-card :title="item.title" tag="article" class="mb-2 card-crud" :class="cardClass"
@@ -1610,7 +1624,7 @@ export default /*#__PURE__*/ {
1610
1624
  </template>
1611
1625
  </b-card>
1612
1626
  </b-col>
1613
-
1627
+ </masonry>
1614
1628
  </draggable>
1615
1629
 
1616
1630
  <p v-if="!loading && items && items.length == 0 && !infiniteScroll" class="p-3">