vue-laravel-crud 1.4.15 → 1.4.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.
@@ -17017,7 +17017,7 @@ var moment = momentExports;
17017
17017
 
17018
17018
  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}}
17019
17019
 
17020
- var css = "tr td[data-v-1f4fa85d]:last-child,\ntr td[data-v-1f4fa85d]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-1f4fa85d] {\n display: flex;\n justify-content: center; }\n\n.crud-header[data-v-1f4fa85d] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-1f4fa85d] .crud-title[data-v-1f4fa85d] {\n margin: 0; }\n .crud-header[data-v-1f4fa85d] .crud-search[data-v-1f4fa85d] {\n max-width: 15rem; }\n .crud-header[data-v-1f4fa85d] .crud-search[data-v-1f4fa85d] .btn[data-v-1f4fa85d] {\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-1f4fa85d] .crud-search[data-v-1f4fa85d] .btn[data-v-1f4fa85d].open[data-v-1f4fa85d] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-1f4fa85d] .table-options[data-v-1f4fa85d] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-1f4fa85d] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-1f4fa85d] {\n table-layout: auto; }\n .table[data-v-1f4fa85d] tbody[data-v-1f4fa85d] td[data-v-1f4fa85d] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-1f4fa85d] tbody[data-v-1f4fa85d] td[data-v-1f4fa85d]::-webkit-scrollbar {\n display: none; } }\n";
17020
+ var css = "tr td[data-v-818372ed]:last-child,\ntr td[data-v-818372ed]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-818372ed] {\n display: flex;\n justify-content: center; }\n\n.crud-header[data-v-818372ed] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-818372ed] .crud-title[data-v-818372ed] {\n margin: 0; }\n .crud-header[data-v-818372ed] .crud-search[data-v-818372ed] {\n max-width: 15rem; }\n .crud-header[data-v-818372ed] .crud-search[data-v-818372ed] .btn[data-v-818372ed] {\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-818372ed] .crud-search[data-v-818372ed] .btn[data-v-818372ed].open[data-v-818372ed] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-818372ed] .table-options[data-v-818372ed] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-818372ed] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-818372ed] {\n table-layout: auto; }\n .table[data-v-818372ed] tbody[data-v-818372ed] td[data-v-818372ed] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-818372ed] tbody[data-v-818372ed] td[data-v-818372ed]::-webkit-scrollbar {\n display: none; } }\n";
17021
17021
  n(css, {});
17022
17022
 
17023
17023
  function normalizeComponent (
@@ -17120,14 +17120,13 @@ const _sfc_main = {
17120
17120
  },
17121
17121
  data() {
17122
17122
  return {
17123
- filterSidebarOpen: false,
17124
- forceRecomputeCounter: 0,
17125
- filtersVisible: false,
17123
+ moment: moment,
17126
17124
  loading: false,
17125
+ item: {
17126
+ id: null
17127
+ },
17127
17128
  items: [],
17128
17129
  selectedItems: [],
17129
- moment: moment,
17130
- displaySearch: false,
17131
17130
  pagination: {
17132
17131
  current_page: 1,
17133
17132
  last_page: 1,
@@ -17136,12 +17135,13 @@ const _sfc_main = {
17136
17135
  per_page: 20,
17137
17136
  total: 0
17138
17137
  },
17138
+ displaySearch: false,
17139
17139
  itemDefault: null,
17140
17140
  filters: [],
17141
+ filtersVisible: false,
17142
+ filterSidebarOpen: false,
17141
17143
  internalFilters: [],
17142
- item: {
17143
- id: null
17144
- },
17144
+ forceRecomputeCounter: 0,
17145
17145
  displayModes: {
17146
17146
  MODE_TABLE: 1,
17147
17147
  MODE_CARDS: 2,
@@ -17566,7 +17566,11 @@ const _sfc_main = {
17566
17566
  this.$bvModal.show("modal-show-item-" + this.modelName);
17567
17567
  },
17568
17568
  createItem() {
17569
- this.item = JSON.parse(JSON.stringify(this.itemDefault));
17569
+ if (this.useVuexORM) {
17570
+ this.item = new this.model();
17571
+ } else {
17572
+ this.item = JSON.parse(JSON.stringify(this.itemDefault));
17573
+ }
17570
17574
  this.onSelect();
17571
17575
  this.$bvModal.show("modal-form-item-" + this.modelName);
17572
17576
  },
@@ -17769,8 +17773,9 @@ const _sfc_main = {
17769
17773
  return ops.join(", ");
17770
17774
  },
17771
17775
  async saveItemVuex() {
17776
+ console.debug("save item 1", this.item);
17772
17777
  let jsondata = this.item.$toJson();
17773
- console.debug("save item ", this.item, jsondata);
17778
+ console.debug("save item 2", this.item, jsondata);
17774
17779
  let result;
17775
17780
  if (this.item.id) {
17776
17781
  result = await this.model.api().put('/' + this.item.id, jsondata);
@@ -18707,7 +18712,7 @@ var _sfc_render = function render() {
18707
18712
  on: {
18708
18713
  "submit": _vm.saveItem
18709
18714
  }
18710
- }, [_vm._t("form", function () {
18715
+ }, [_vm.item ? _vm._t("form", function () {
18711
18716
  return [_c('b-form-group', {
18712
18717
  attrs: {
18713
18718
  "label": "Nombre:",
@@ -18729,7 +18734,7 @@ var _sfc_render = function render() {
18729
18734
  })], 1)];
18730
18735
  }, {
18731
18736
  "item": _vm.item
18732
- }), _c('b-button', {
18737
+ }) : _vm._e(), _c('b-button', {
18733
18738
  attrs: {
18734
18739
  "block": "",
18735
18740
  "type": "submit",
@@ -18740,29 +18745,30 @@ var _sfc_render = function render() {
18740
18745
  attrs: {
18741
18746
  "small": ""
18742
18747
  }
18743
- }) : _vm._e(), _vm._v(_vm._s(_vm.messageSave) + " ")], 1)], 2)] : _vm._e(), !_vm.validate ? [_vm._t("form", function () {
18744
- return [_c('b-form-group', {
18745
- attrs: {
18746
- "label": "Nombre:",
18747
- "description": "Nombre "
18748
- }
18749
- }, [_c('b-form-input', {
18750
- attrs: {
18751
- "type": "text",
18752
- "required": "",
18753
- "placeholder": "Nombre"
18754
- },
18755
- model: {
18756
- value: _vm.item.title,
18757
- callback: function ($$v) {
18758
- _vm.$set(_vm.item, "title", $$v);
18748
+ }) : _vm._e(), _vm._v(_vm._s(_vm.messageSave) + " ")], 1)], 2)] : _vm._e(), !_vm.validate ? [_vm.item ? _vm._t("form", function () {
18749
+ return _vm._l(_vm.item, function (value, key) {
18750
+ return _c('b-form-group', {
18751
+ key: key,
18752
+ attrs: {
18753
+ "label": key
18754
+ }
18755
+ }, [_c('b-form-input', {
18756
+ attrs: {
18757
+ "type": "text",
18758
+ "required": ""
18759
18759
  },
18760
- expression: "item.title"
18761
- }
18762
- })], 1)];
18760
+ model: {
18761
+ value: _vm.item[key],
18762
+ callback: function ($$v) {
18763
+ _vm.$set(_vm.item, key, $$v);
18764
+ },
18765
+ expression: "item[key]"
18766
+ }
18767
+ })], 1);
18768
+ });
18763
18769
  }, {
18764
18770
  "item": _vm.item
18765
- }), _c('b-button', {
18771
+ }) : _vm._e(), _c('b-button', {
18766
18772
  attrs: {
18767
18773
  "block": "",
18768
18774
  "type": "submit",
@@ -18786,16 +18792,27 @@ var _sfc_render = function render() {
18786
18792
  "title": _vm.title,
18787
18793
  "no-close-on-backdrop": ""
18788
18794
  }
18789
- }, [_vm._t("show", function () {
18790
- return [_c('p', {
18791
- staticClass: "my-4"
18792
- }, [_vm._v("Show")])];
18795
+ }, [_vm.item ? _vm._t("show", function () {
18796
+ return [_c('b-list-group', _vm._l(_vm.item, function (value, key) {
18797
+ return _c('b-list-group-item', {
18798
+ key: key
18799
+ }, [_c('b-row', [_c('b-col', {
18800
+ staticClass: "font-weight-bold",
18801
+ attrs: {
18802
+ "cols": "4"
18803
+ }
18804
+ }, [_vm._v(_vm._s(key))]), _c('b-col', {
18805
+ attrs: {
18806
+ "cols": "8"
18807
+ }
18808
+ }, [_vm._v(_vm._s(JSON.stringify(value)))])], 1)], 1);
18809
+ }), 1)];
18793
18810
  }, {
18794
18811
  "item": _vm.item
18795
- })], 2)], 1);
18812
+ }) : _vm._e()], 2)], 1);
18796
18813
  };
18797
18814
  var _sfc_staticRenderFns = [];
18798
- var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "1f4fa85d", null, null);
18815
+ var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "818372ed", null, null);
18799
18816
  var component = __component__.exports;
18800
18817
 
18801
18818
  // Import vue component