vue-laravel-crud 1.7.20 → 1.8.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.
@@ -12113,11 +12113,6 @@ if (typeof window !== 'undefined' && window.Vue) {
12113
12113
  window.Vue.use(Plugin);
12114
12114
  }
12115
12115
 
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}}
12117
-
12118
- var css = "tr td[data-v-3083d6fc]:last-child,\ntr td[data-v-3083d6fc]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-3083d6fc] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-3083d6fc] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-3083d6fc] .crud-title[data-v-3083d6fc] {\n margin: 0; }\n .crud-header[data-v-3083d6fc] .crud-search[data-v-3083d6fc] {\n max-width: 15rem; }\n .crud-header[data-v-3083d6fc] .crud-search[data-v-3083d6fc] .btn[data-v-3083d6fc] {\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-3083d6fc] .crud-search[data-v-3083d6fc] .btn[data-v-3083d6fc].open[data-v-3083d6fc] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-3083d6fc] .table-options[data-v-3083d6fc] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-3083d6fc] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-3083d6fc] {\n table-layout: auto; }\n .table[data-v-3083d6fc] tbody[data-v-3083d6fc] td[data-v-3083d6fc] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-3083d6fc] tbody[data-v-3083d6fc] td[data-v-3083d6fc]::-webkit-scrollbar {\n display: none; } }\n";
12119
- n(css, {});
12120
-
12121
12116
  function normalizeComponent (
12122
12117
  scriptExports,
12123
12118
  render,
@@ -12211,12 +12206,121 @@ function normalizeComponent (
12211
12206
  }
12212
12207
  }
12213
12208
 
12209
+ const _sfc_main$1 = {
12210
+ props: {
12211
+ item: Object,
12212
+ columns: Array,
12213
+ index: Number,
12214
+ itemClass: {
12215
+ type: String,
12216
+ default: 'item'
12217
+ },
12218
+ cardClass: String,
12219
+ cardHideFooter: Boolean,
12220
+ itemValue: Function,
12221
+ getStateValue: Function,
12222
+ getArrayValue: Function,
12223
+ showItem: Function,
12224
+ updateItem: Function,
12225
+ removeItem: Function
12226
+ }
12227
+ };
12228
+ var _sfc_render$1 = function render() {
12229
+ var _vm = this,
12230
+ _c = _vm._self._c;
12231
+ return _c('div', {
12232
+ class: _vm.itemClass
12233
+ }, [_c('b-card', {
12234
+ staticClass: "mb-2 card-crud",
12235
+ class: _vm.cardClass,
12236
+ attrs: {
12237
+ "title": _vm.item.title,
12238
+ "tag": "article",
12239
+ "hide-footer": _vm.cardHideFooter
12240
+ },
12241
+ scopedSlots: _vm._u([{
12242
+ key: "footer",
12243
+ fn: function () {
12244
+ return [_c('b-button-group', [_vm._t("rowAction", function () {
12245
+ return [_c('b-button', {
12246
+ attrs: {
12247
+ "variant": "primary"
12248
+ },
12249
+ on: {
12250
+ "click": function ($event) {
12251
+ return _vm.showItem(_vm.item.id, _vm.index);
12252
+ }
12253
+ }
12254
+ }, [_c('b-icon-eye')], 1), _c('b-button', {
12255
+ attrs: {
12256
+ "variant": "secondary"
12257
+ },
12258
+ on: {
12259
+ "click": function ($event) {
12260
+ return _vm.updateItem(_vm.item.id, _vm.index);
12261
+ }
12262
+ }
12263
+ }, [_c('b-icon-pencil')], 1), _c('b-button', {
12264
+ attrs: {
12265
+ "variant": "danger"
12266
+ },
12267
+ on: {
12268
+ "click": function ($event) {
12269
+ return _vm.removeItem(_vm.item.id, _vm.index);
12270
+ }
12271
+ }
12272
+ }, [_c('b-icon-trash')], 1)];
12273
+ }, {
12274
+ "item": _vm.item,
12275
+ "index": _vm.index,
12276
+ "showItem": _vm.showItem,
12277
+ "updateItem": _vm.updateItem,
12278
+ "removeItem": _vm.removeItem
12279
+ })], 2)];
12280
+ },
12281
+ proxy: true
12282
+ }], null, true)
12283
+ }, [_vm._t("card", function () {
12284
+ return _vm._l(_vm.columns, function (column, indexc) {
12285
+ return _c('div', {
12286
+ key: indexc
12287
+ }, [column.type !== 'actions' ? _c('b-card-text', [_vm._v(" " + _vm._s(column.label) + ": "), _vm._t('cell-' + column.prop, function () {
12288
+ return [column.type === 'boolean' ? _c('span', [_vm.itemValue(column, _vm.item) ? _c('b-badge', {
12289
+ attrs: {
12290
+ "variant": "success"
12291
+ }
12292
+ }, [_c('b-icon-check-circle')], 1) : _c('b-badge', {
12293
+ attrs: {
12294
+ "variant": "danger"
12295
+ }
12296
+ }, [_c('b-icon-x-circle')], 1)], 1) : column.type === 'date' ? _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, _vm.item)) + " ")]) : column.type === 'state' ? _c('span', [_vm._v(" " + _vm._s(_vm.getStateValue(_vm.itemValue(column, _vm.item), column.options)) + " ")]) : column.type === 'array' ? _c('span', [_vm._v(" " + _vm._s(_vm.getArrayValue(_vm.itemValue(column, _vm.item), column.displayProp, column.options)) + " ")]) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, _vm.item)) + " ")])];
12297
+ }, {
12298
+ "item": _vm.item,
12299
+ "index": _vm.index,
12300
+ "itemindex": _vm.index,
12301
+ "columnindex": indexc
12302
+ })], 2) : _vm._e()], 1);
12303
+ });
12304
+ }, {
12305
+ "item": _vm.item
12306
+ })], 2)], 1);
12307
+ };
12308
+ var _sfc_staticRenderFns$1 = [];
12309
+ var __component__$1 = /*#__PURE__*/normalizeComponent(_sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
12310
+ var ItemCard = __component__$1.exports;
12311
+
12312
+ 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}}
12313
+
12314
+ var css = "tr td[data-v-ce8ebda1]:last-child,\ntr td[data-v-ce8ebda1]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-ce8ebda1] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-ce8ebda1] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-ce8ebda1] .crud-title[data-v-ce8ebda1] {\n margin: 0; }\n .crud-header[data-v-ce8ebda1] .crud-search[data-v-ce8ebda1] {\n max-width: 15rem; }\n .crud-header[data-v-ce8ebda1] .crud-search[data-v-ce8ebda1] .btn[data-v-ce8ebda1] {\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-ce8ebda1] .crud-search[data-v-ce8ebda1] .btn[data-v-ce8ebda1].open[data-v-ce8ebda1] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-ce8ebda1] .table-options[data-v-ce8ebda1] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-ce8ebda1] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-ce8ebda1] {\n table-layout: auto; }\n .table[data-v-ce8ebda1] tbody[data-v-ce8ebda1] td[data-v-ce8ebda1] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-ce8ebda1] tbody[data-v-ce8ebda1] td[data-v-ce8ebda1]::-webkit-scrollbar {\n display: none; } }\n";
12315
+ n(css, {});
12316
+
12214
12317
  const _sfc_main = {
12215
12318
  name: "VueLaravelCrud",
12216
12319
  components: {
12217
12320
  draggable,
12218
12321
  InfiniteLoading,
12219
- VueMasonry: Plugin
12322
+ VueMasonry: Plugin,
12323
+ ItemCard
12220
12324
  },
12221
12325
  data() {
12222
12326
  return {
@@ -12247,7 +12351,8 @@ const _sfc_main = {
12247
12351
  displayModes: {
12248
12352
  MODE_TABLE: 1,
12249
12353
  MODE_CARDS: 2,
12250
- MODE_CUSTOM: 3
12354
+ MODE_CUSTOM: 3,
12355
+ MODE_KANBAN: 4
12251
12356
  },
12252
12357
  infiniteScrollKey: 1,
12253
12358
  optionsLoaded: false,
@@ -12968,7 +13073,7 @@ const _sfc_main = {
12968
13073
  await this.model.$fetch();
12969
13074
  } else {
12970
13075
  this.model.deleteAll();
12971
- result = await this.model.api().get('', {
13076
+ result = await this.model.api().get(this.apiUrl + "/" + this.modelName, {
12972
13077
  params: {
12973
13078
  page: page,
12974
13079
  limit: this.pagination.perPage,
@@ -13135,7 +13240,7 @@ const _sfc_main = {
13135
13240
  if (this.vuexLocalforage) {
13136
13241
  await this.model.$delete(ids);
13137
13242
  } else {
13138
- let result = await this.model.api().delete('/bulk-destroy', {
13243
+ let result = await this.model.api().delete(this.apiUrl + "/" + this.modelName + '/bulk-destroy', {
13139
13244
  params: {
13140
13245
  ids: ids
13141
13246
  },
@@ -13194,7 +13299,7 @@ const _sfc_main = {
13194
13299
  if (this.vuexLocalforage) {
13195
13300
  await this.model.$delete(id);
13196
13301
  } else {
13197
- let result = await this.model.api().delete('/' + id, {
13302
+ let result = await this.model.api().delete(this.apiUrl + "/" + this.modelName + '/' + id, {
13198
13303
  delete: 1
13199
13304
  });
13200
13305
  console.debug("delete item vuex", result);
@@ -13354,10 +13459,10 @@ const _sfc_main = {
13354
13459
  let jsondata = this.item.$toJson();
13355
13460
  console.debug("save item 2", this.item, jsondata);
13356
13461
  if (this.item.id) {
13357
- result = await this.model.api().put('/' + this.item.id, jsondata);
13462
+ result = await this.model.api().put(this.apiUrl + "/" + this.modelName + '/' + this.item.id, jsondata);
13358
13463
  create = false;
13359
13464
  } else {
13360
- result = await this.model.api().post('', jsondata);
13465
+ result = await this.model.api().post(this.apiUrl + "/" + this.modelName, jsondata);
13361
13466
  create = true;
13362
13467
  }
13363
13468
  result.response.status;
@@ -14351,83 +14456,57 @@ var _sfc_render = function render() {
14351
14456
  return _c('div', {
14352
14457
  key: index,
14353
14458
  staticClass: "item"
14354
- }, [_c('b-card', {
14355
- staticClass: "mb-2 card-crud",
14356
- class: _vm.cardClass,
14357
- attrs: {
14358
- "title": item.title,
14359
- "tag": "article",
14360
- "hideFooter": _vm.cardHideFooter
14361
- },
14362
- scopedSlots: _vm._u([{
14363
- key: "footer",
14364
- fn: function () {
14365
- return [_c('b-button-group', [_vm._t("rowAction", function () {
14366
- return [_c('b-button', {
14367
- attrs: {
14368
- "variant": "primary"
14369
- },
14370
- on: {
14371
- "click": function ($event) {
14372
- return _vm.showItem(item.id, index);
14373
- }
14374
- }
14375
- }, [_c('b-icon-eye')], 1), _c('b-button', {
14376
- attrs: {
14377
- "variant": "secondary"
14378
- },
14379
- on: {
14380
- "click": function ($event) {
14381
- return _vm.updateItem(item.id, index);
14382
- }
14383
- }
14384
- }, [_c('b-icon-pencil')], 1), _c('b-button', {
14385
- attrs: {
14386
- "variant": "danger"
14387
- },
14388
- on: {
14389
- "click": function ($event) {
14390
- return _vm.removeItem(item.id, index);
14391
- }
14392
- }
14393
- }, [_c('b-icon-trash')], 1)];
14394
- }, {
14459
+ }, [_vm._t("card", function () {
14460
+ return _vm._l(_vm.itemsList, function (item, index) {
14461
+ return _c('ItemCard', {
14462
+ key: index,
14463
+ attrs: {
14395
14464
  "item": item,
14465
+ "columns": _vm.columns,
14396
14466
  "index": index,
14467
+ "cardClass": _vm.cardClass,
14468
+ "cardHideFooter": _vm.cardHideFooter,
14469
+ "itemValue": _vm.itemValue,
14470
+ "getStateValue": _vm.getStateValue,
14471
+ "getArrayValue": _vm.getArrayValue,
14397
14472
  "showItem": _vm.showItem,
14398
14473
  "updateItem": _vm.updateItem,
14399
14474
  "removeItem": _vm.removeItem
14400
- })], 2)];
14401
- },
14402
- proxy: true
14403
- }], null, true)
14404
- }, [_vm._t("card", function () {
14405
- return _vm._l(_vm.columns, function (column, indexc) {
14406
- return _c('div', {
14407
- key: indexc
14408
- }, [column.type != 'actions' ? _c('b-card-text', [_vm._v(_vm._s(column.label) + ": "), _vm._t('cell-' + column.prop, function () {
14409
- return [column.type == 'boolean' ? _c('span', [_vm.itemValue(column, item) == 'true' || _vm.itemValue(column, item) == 1 || _vm.itemValue(column, item) == '1' ? _c('b-badge', {
14410
- attrs: {
14411
- "variant": "success"
14412
- }
14413
- }, [_c('b-icon-check-circle')], 1) : _vm._e(), !_vm.itemValue(column, item) || _vm.itemValue(column, item) == '0' || _vm.itemValue(column, item) == 'false' ? _c('b-badge', {
14414
- attrs: {
14415
- "variant": "danger"
14416
- }
14417
- }, [_c('b-icon-x-circle')], 1) : _vm._e()], 1) : column.type == 'date' ? _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, item)) + " ")]) : column.type == 'state' ? _c('span', [_vm._v(" " + _vm._s(_vm.getStateValue(_vm.itemValue(column, item), column.options)) + " ")]) : column.type == 'array' ? _c('span', [_vm._v(" " + _vm._s(_vm.getArrayValue(_vm.itemValue(column, item), column.displayProp, column.options)) + " ")]) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, item)) + " ")])];
14418
- }, {
14419
- "item": item,
14420
- "index": index,
14421
- "itemindex": index,
14422
- "columnindex": indexc
14423
- })], 2) : _vm._e()], 1);
14475
+ }
14476
+ });
14424
14477
  });
14425
14478
  }, {
14426
14479
  "item": item
14427
- })], 2)], 1);
14480
+ })], 2);
14428
14481
  }), 0)], 1), !_vm.loading && _vm.items && _vm.items.length == 0 && !_vm.infiniteScroll ? _c('p', {
14429
14482
  staticClass: "p-3"
14430
- }, [_vm._v(" " + _vm._s(_vm.messageEmptyResults) + " ")]) : _vm._e()], 1) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CUSTOM ? _c('div', [_c('div', {
14483
+ }, [_vm._v(" " + _vm._s(_vm.messageEmptyResults) + " ")]) : _vm._e()], 1) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_KANBAN ? _c('div', _vm._l(_vm.itemsList, function (item, index) {
14484
+ return _c('div', {
14485
+ key: index,
14486
+ staticClass: "item"
14487
+ }, [_vm._t("card", function () {
14488
+ return _vm._l(_vm.itemsList, function (item, index) {
14489
+ return _c('ItemCard', {
14490
+ key: index,
14491
+ attrs: {
14492
+ "item": item,
14493
+ "columns": _vm.columns,
14494
+ "index": index,
14495
+ "cardClass": _vm.cardClass,
14496
+ "cardHideFooter": _vm.cardHideFooter,
14497
+ "itemValue": _vm.itemValue,
14498
+ "getStateValue": _vm.getStateValue,
14499
+ "getArrayValue": _vm.getArrayValue,
14500
+ "showItem": _vm.showItem,
14501
+ "updateItem": _vm.updateItem,
14502
+ "removeItem": _vm.removeItem
14503
+ }
14504
+ });
14505
+ });
14506
+ }, {
14507
+ "item": item
14508
+ })], 2);
14509
+ }), 0) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CUSTOM ? _c('div', [_c('div', {
14431
14510
  class: _vm.listContainerClass
14432
14511
  }, [!_vm.loading && _vm.items && _vm.items.length == 0 && !_vm.infiniteScroll ? _c('p', {
14433
14512
  staticClass: "p-3"
@@ -14708,7 +14787,7 @@ var _sfc_render = function render() {
14708
14787
  }) : _vm._e()], 2) : _vm._e()], 1);
14709
14788
  };
14710
14789
  var _sfc_staticRenderFns = [];
14711
- var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "3083d6fc", null, null);
14790
+ var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "ce8ebda1", null, null);
14712
14791
  var component = __component__.exports;
14713
14792
 
14714
14793
  // Import vue component