vue-laravel-crud 1.7.19 → 1.7.21

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.
@@ -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-3065a246]:last-child,\ntr td[data-v-3065a246]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-3065a246] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-3065a246] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-3065a246] .crud-title[data-v-3065a246] {\n margin: 0; }\n .crud-header[data-v-3065a246] .crud-search[data-v-3065a246] {\n max-width: 15rem; }\n .crud-header[data-v-3065a246] .crud-search[data-v-3065a246] .btn[data-v-3065a246] {\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-3065a246] .crud-search[data-v-3065a246] .btn[data-v-3065a246].open[data-v-3065a246] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-3065a246] .table-options[data-v-3065a246] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-3065a246] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-3065a246] {\n table-layout: auto; }\n .table[data-v-3065a246] tbody[data-v-3065a246] td[data-v-3065a246] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-3065a246] tbody[data-v-3065a246] td[data-v-3065a246]::-webkit-scrollbar {\n display: none; } }\n";
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-4d8afc06]:last-child,\ntr td[data-v-4d8afc06]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-4d8afc06] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-4d8afc06] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-4d8afc06] .crud-title[data-v-4d8afc06] {\n margin: 0; }\n .crud-header[data-v-4d8afc06] .crud-search[data-v-4d8afc06] {\n max-width: 15rem; }\n .crud-header[data-v-4d8afc06] .crud-search[data-v-4d8afc06] .btn[data-v-4d8afc06] {\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-4d8afc06] .crud-search[data-v-4d8afc06] .btn[data-v-4d8afc06].open[data-v-4d8afc06] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-4d8afc06] .table-options[data-v-4d8afc06] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-4d8afc06] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-4d8afc06] {\n table-layout: auto; }\n .table[data-v-4d8afc06] tbody[data-v-4d8afc06] td[data-v-4d8afc06] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-4d8afc06] tbody[data-v-4d8afc06] td[data-v-4d8afc06]::-webkit-scrollbar {\n display: none; } }\n";
12536
12536
  n(css, {});function normalizeComponent (
12537
12537
  scriptExports,
12538
12538
  render,
@@ -13035,7 +13035,7 @@ n(css, {});function normalizeComponent (
13035
13035
  }*/
13036
13036
 
13037
13037
  if (typeof field.value === 'function') {
13038
- itemDefault[fieldName] = field.default();
13038
+ itemDefault[fieldName] = field.value();
13039
13039
  } else if (field.value) {
13040
13040
  itemDefault[fieldName] = field.value;
13041
13041
  } else {
@@ -13442,7 +13442,7 @@ n(css, {});function normalizeComponent (
13442
13442
  case 9:
13443
13443
  _this11.model.deleteAll();
13444
13444
  _context.next = 12;
13445
- return _this11.model.api().get('', {
13445
+ return _this11.model.api().get(_this11.apiUrl + "/" + _this11.modelName, {
13446
13446
  params: {
13447
13447
  page: page,
13448
13448
  limit: _this11.pagination.perPage,
@@ -13658,7 +13658,7 @@ n(css, {});function normalizeComponent (
13658
13658
  break;
13659
13659
  case 6:
13660
13660
  _context3.next = 8;
13661
- return _this17.model.api().delete('/bulk-destroy', {
13661
+ return _this17.model.api().delete(_this17.apiUrl + "/" + _this17.modelName + '/bulk-destroy', {
13662
13662
  params: {
13663
13663
  ids: ids
13664
13664
  },
@@ -13755,7 +13755,7 @@ n(css, {});function normalizeComponent (
13755
13755
  break;
13756
13756
  case 5:
13757
13757
  _context5.next = 7;
13758
- return _this20.model.api().delete('/' + id, {
13758
+ return _this20.model.api().delete(_this20.apiUrl + "/" + _this20.modelName + '/' + id, {
13759
13759
  delete: 1
13760
13760
  });
13761
13761
  case 7:
@@ -13959,7 +13959,7 @@ n(css, {});function normalizeComponent (
13959
13959
  break;
13960
13960
  }
13961
13961
  _context6.next = 25;
13962
- return _this25.model.api().put('/' + _this25.item.id, jsondata);
13962
+ return _this25.model.api().put(_this25.apiUrl + "/" + _this25.modelName + '/' + _this25.item.id, jsondata);
13963
13963
  case 25:
13964
13964
  result = _context6.sent;
13965
13965
  create = false;
@@ -13967,7 +13967,7 @@ n(css, {});function normalizeComponent (
13967
13967
  break;
13968
13968
  case 29:
13969
13969
  _context6.next = 31;
13970
- return _this25.model.api().post('', jsondata);
13970
+ return _this25.model.api().post(_this25.apiUrl + "/" + _this25.modelName, jsondata);
13971
13971
  case 31:
13972
13972
  result = _context6.sent;
13973
13973
  create = true;
@@ -15404,7 +15404,7 @@ var _sfc_render = function render() {
15404
15404
  }) : _vm._e()], 2) : _vm._e()], 1);
15405
15405
  };
15406
15406
  var _sfc_staticRenderFns = [];
15407
- var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "3065a246", null, null);
15407
+ var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "4d8afc06", null, null);
15408
15408
  var component$1 = __component__.exports;// Import vue component
15409
15409
 
15410
15410
  // Default export is installable instance of component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-laravel-crud",
3
- "version": "1.7.19",
3
+ "version": "1.7.21",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/clonixdev/vue-laravel-crud",
6
6
  "main": "dist/vue-laravel-crud.ssr.js",
@@ -443,7 +443,7 @@ export default /*#__PURE__*/ {
443
443
 
444
444
 
445
445
  if (typeof field.value === 'function') {
446
- itemDefault[fieldName] = field.default();
446
+ itemDefault[fieldName] = field.value();
447
447
  }else if(field.value){
448
448
  itemDefault[fieldName] = field.value;
449
449
  }else{
@@ -859,7 +859,7 @@ export default /*#__PURE__*/ {
859
859
  } else {
860
860
  this.model.deleteAll();
861
861
 
862
- result = await this.model.api().get('', {
862
+ result = await this.model.api().get(this.apiUrl + "/" + this.modelName, {
863
863
  params: {
864
864
  page: page,
865
865
  limit: this.pagination.perPage,
@@ -1055,7 +1055,7 @@ export default /*#__PURE__*/ {
1055
1055
  await this.model.$delete(ids);
1056
1056
 
1057
1057
  } else {
1058
- let result = await this.model.api().delete('/bulk-destroy' , {
1058
+ let result = await this.model.api().delete(this.apiUrl + "/" + this.modelName+'/bulk-destroy' , {
1059
1059
  params: { ids: ids},
1060
1060
  delete: ids
1061
1061
  });
@@ -1129,7 +1129,7 @@ export default /*#__PURE__*/ {
1129
1129
  await this.model.$delete(id);
1130
1130
 
1131
1131
  } else {
1132
- let result = await this.model.api().delete('/' + id, {
1132
+ let result = await this.model.api().delete(this.apiUrl + "/" + this.modelName+'/' + id, {
1133
1133
  delete: 1
1134
1134
  });
1135
1135
 
@@ -1313,10 +1313,10 @@ export default /*#__PURE__*/ {
1313
1313
  let jsondata = this.item.$toJson();
1314
1314
  console.debug("save item 2", this.item, jsondata);
1315
1315
  if (this.item.id) {
1316
- result = await this.model.api().put('/' + this.item.id, jsondata);
1316
+ result = await this.model.api().put(this.apiUrl + "/" + this.modelName+'/' + this.item.id, jsondata);
1317
1317
  create = false;
1318
1318
  } else {
1319
- result = await this.model.api().post('', jsondata);
1319
+ result = await this.model.api().post(this.apiUrl + "/" + this.modelName, jsondata);
1320
1320
  create = true;
1321
1321
  }
1322
1322