vue-laravel-crud 1.6.3 → 1.6.5

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.
@@ -1,5 +1,3 @@
1
- import 'vue';
2
-
3
1
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
2
 
5
3
  function getDefaultExportFromCjs (x) {
@@ -12117,7 +12115,7 @@ if (typeof window !== 'undefined' && window.Vue) {
12117
12115
 
12118
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}}
12119
12117
 
12120
- var css = "tr td[data-v-9af445d8]:last-child,\ntr td[data-v-9af445d8]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-9af445d8] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-9af445d8] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-9af445d8] .crud-title[data-v-9af445d8] {\n margin: 0; }\n .crud-header[data-v-9af445d8] .crud-search[data-v-9af445d8] {\n max-width: 15rem; }\n .crud-header[data-v-9af445d8] .crud-search[data-v-9af445d8] .btn[data-v-9af445d8] {\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-9af445d8] .crud-search[data-v-9af445d8] .btn[data-v-9af445d8].open[data-v-9af445d8] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-9af445d8] .table-options[data-v-9af445d8] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-9af445d8] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-9af445d8] {\n table-layout: auto; }\n .table[data-v-9af445d8] tbody[data-v-9af445d8] td[data-v-9af445d8] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-9af445d8] tbody[data-v-9af445d8] td[data-v-9af445d8]::-webkit-scrollbar {\n display: none; } }\n";
12118
+ var css = "tr td[data-v-a4bec9a9]:last-child,\ntr td[data-v-a4bec9a9]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-a4bec9a9] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-a4bec9a9] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-a4bec9a9] .crud-title[data-v-a4bec9a9] {\n margin: 0; }\n .crud-header[data-v-a4bec9a9] .crud-search[data-v-a4bec9a9] {\n max-width: 15rem; }\n .crud-header[data-v-a4bec9a9] .crud-search[data-v-a4bec9a9] .btn[data-v-a4bec9a9] {\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-a4bec9a9] .crud-search[data-v-a4bec9a9] .btn[data-v-a4bec9a9].open[data-v-a4bec9a9] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-a4bec9a9] .table-options[data-v-a4bec9a9] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-a4bec9a9] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-a4bec9a9] {\n table-layout: auto; }\n .table[data-v-a4bec9a9] tbody[data-v-a4bec9a9] td[data-v-a4bec9a9] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-a4bec9a9] tbody[data-v-a4bec9a9] td[data-v-a4bec9a9]::-webkit-scrollbar {\n display: none; } }\n";
12121
12119
  n(css, {});
12122
12120
 
12123
12121
  function normalizeComponent (
@@ -12379,6 +12377,10 @@ const _sfc_main = {
12379
12377
  type: Boolean,
12380
12378
  default: true
12381
12379
  },
12380
+ showPrincipalSortBtn: {
12381
+ type: Boolean,
12382
+ default: false
12383
+ },
12382
12384
  showHeader: {
12383
12385
  type: Boolean,
12384
12386
  default: true
@@ -12416,7 +12418,7 @@ const _sfc_main = {
12416
12418
  type: Number
12417
12419
  },
12418
12420
  colXl: {
12419
- default: 3,
12421
+ default: 4,
12420
12422
  type: Number
12421
12423
  },
12422
12424
  selectHover: {
@@ -12526,6 +12528,10 @@ const _sfc_main = {
12526
12528
  masonryColumns: {
12527
12529
  type: Number,
12528
12530
  default: 3
12531
+ },
12532
+ principalSortColumn: {
12533
+ type: String,
12534
+ default: "id"
12529
12535
  }
12530
12536
  },
12531
12537
  mounted() {
@@ -12609,7 +12615,18 @@ const _sfc_main = {
12609
12615
  return this.paginationIndexStart + this.pagination.per_page;
12610
12616
  },
12611
12617
  finalFilters() {
12612
- return [...this.filters, ...this.filter, ...this.internalFilter];
12618
+ return [...this.filters, ...this.filter, ...this.internalFilter, ...this.sortFilter];
12619
+ },
12620
+ sortFilter() {
12621
+ if (this.showPrincipalSortBtn) {
12622
+ if (this.principalSort) {
12623
+ return [[this.principalSortColumn, 'SORTASC', '']];
12624
+ } else {
12625
+ return [[this.principalSortColumn, 'SORTDESC', '']];
12626
+ }
12627
+ } else {
12628
+ return [];
12629
+ }
12613
12630
  },
12614
12631
  internalFilter() {
12615
12632
  let filter = [];
@@ -12633,6 +12650,12 @@ const _sfc_main = {
12633
12650
  // Actualizar isMobile cuando cambia el tamaño de la pantalla
12634
12651
  this.isMobile = window.matchMedia("(max-width: 1024px)").matches;
12635
12652
  },
12653
+ togglePrincipalSort() {
12654
+ this.principalSort = !this.principalSort;
12655
+ setTimeout(() => {
12656
+ this.refresh();
12657
+ }, 1);
12658
+ },
12636
12659
  infiniteHandler($state) {
12637
12660
  const hasNextPage = (this.pagination.total > 0 || !this.firstLoad) && (!this.firstLoad || this.pagination.current_page * this.pagination.per_page <= this.pagination.total);
12638
12661
  console.debug("Has next page", hasNextPage, this.pagination);
@@ -13550,7 +13573,17 @@ var _sfc_render = function render() {
13550
13573
  }, [_vm._t("tableActions", function () {
13551
13574
  return [_vm._t("tableActionsPrepend", null, {
13552
13575
  "loading": _vm.loading
13553
- }), _vm.showCreateBtn ? _c('b-button', {
13576
+ }), _vm.showPrincipalSortBtn ? _c('b-button', {
13577
+ attrs: {
13578
+ "variant": "success",
13579
+ "disabled": _vm.loading
13580
+ },
13581
+ on: {
13582
+ "click": function ($event) {
13583
+ return _vm.togglePrincipalSort();
13584
+ }
13585
+ }
13586
+ }, [_vm.principalSort ? _c('b-icon-sort-numeric-down') : _c('b-icon-sort-numeric-up')], 1) : _vm._e(), _vm.showCreateBtn ? _c('b-button', {
13554
13587
  attrs: {
13555
13588
  "variant": "success",
13556
13589
  "disabled": _vm.loading
@@ -13979,12 +14012,12 @@ var _sfc_render = function render() {
13979
14012
  }, [_c('masonry', {
13980
14013
  attrs: {
13981
14014
  "cols": {
13982
- default: _vm.colLg,
13983
- 1400: _vm.colXl,
13984
- 1200: _vm.colLg,
13985
- 1000: _vm.colMd,
13986
- 700: _vm.colSm,
13987
- 400: _vm.colXs
14015
+ default: 12 / _vm.colLg,
14016
+ 1400: 12 / _vm.colXl,
14017
+ 1200: 12 / _vm.colLg,
14018
+ 1000: 12 / _vm.colMd,
14019
+ 700: 12 / _vm.colSm,
14020
+ 400: 12 / _vm.colXs
13988
14021
  },
13989
14022
  "gutter": {
13990
14023
  default: '15px',
@@ -14255,7 +14288,7 @@ var _sfc_render = function render() {
14255
14288
  }) : _vm._e()], 2)], 1);
14256
14289
  };
14257
14290
  var _sfc_staticRenderFns = [];
14258
- var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "9af445d8", null, null);
14291
+ var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "a4bec9a9", null, null);
14259
14292
  var component = __component__.exports;
14260
14293
 
14261
14294
  // Import vue component