vue-laravel-crud 1.8.2 → 1.8.4
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/dist/vue-laravel-crud.esm.js +85 -72
- package/dist/vue-laravel-crud.min.js +2 -2
- package/dist/vue-laravel-crud.ssr.js +93 -71
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +55 -36
|
@@ -12311,7 +12311,7 @@ var ItemCard = __component__$1.exports;
|
|
|
12311
12311
|
|
|
12312
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
12313
|
|
|
12314
|
-
var css = "tr td[data-v-
|
|
12314
|
+
var css = "tr td[data-v-9859c699]:last-child,\ntr td[data-v-9859c699]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-9859c699] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-9859c699] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-9859c699] .crud-title[data-v-9859c699] {\n margin: 0; }\n .crud-header[data-v-9859c699] .crud-search[data-v-9859c699] {\n max-width: 15rem; }\n .crud-header[data-v-9859c699] .crud-search[data-v-9859c699] .btn[data-v-9859c699] {\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-9859c699] .crud-search[data-v-9859c699] .btn[data-v-9859c699].open[data-v-9859c699] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-9859c699] .table-options[data-v-9859c699] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-9859c699] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-9859c699] {\n table-layout: auto; }\n .table[data-v-9859c699] tbody[data-v-9859c699] td[data-v-9859c699] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-9859c699] tbody[data-v-9859c699] td[data-v-9859c699]::-webkit-scrollbar {\n display: none; } }\n\n.kanban-board[data-v-9859c699] {\n display: flex;\n gap: 1rem;\n overflow-x: auto;\n padding: 1rem; }\n\n.kanban-column[data-v-9859c699] {\n background: #f4f5f7;\n border-radius: 8px;\n width: 300px;\n display: flex;\n flex-direction: column;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }\n\n.kanban-column-header[data-v-9859c699] {\n font-weight: bold;\n padding: 0.5rem;\n background: #dfe1e6;\n border-radius: 8px 8px 0 0;\n text-align: center; }\n\n.kanban-column-body[data-v-9859c699] {\n padding: 0.5rem;\n min-height: 100px;\n background: #ffffff;\n border-radius: 0 0 8px 8px;\n display: flex;\n flex-direction: column;\n gap: 0.5rem; }\n\n.kanban-card[data-v-9859c699] {\n background: #ffffff;\n border-radius: 4px;\n padding: 1rem;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n cursor: grab; }\n";
|
|
12315
12315
|
n(css, {});
|
|
12316
12316
|
|
|
12317
12317
|
const _sfc_main = {
|
|
@@ -12629,6 +12629,10 @@ const _sfc_main = {
|
|
|
12629
12629
|
type: String,
|
|
12630
12630
|
default: ""
|
|
12631
12631
|
},
|
|
12632
|
+
groupedSplit: {
|
|
12633
|
+
type: Boolean,
|
|
12634
|
+
default: false
|
|
12635
|
+
},
|
|
12632
12636
|
draggableGroup: {
|
|
12633
12637
|
type: String,
|
|
12634
12638
|
default: "people"
|
|
@@ -12751,6 +12755,12 @@ const _sfc_main = {
|
|
|
12751
12755
|
}
|
|
12752
12756
|
};
|
|
12753
12757
|
},
|
|
12758
|
+
isSplitGroups() {
|
|
12759
|
+
if (this.groupedSplit) {
|
|
12760
|
+
return true;
|
|
12761
|
+
}
|
|
12762
|
+
return this.displayMode == this.displayModes.MODE_KANBAN;
|
|
12763
|
+
},
|
|
12754
12764
|
itemsList() {
|
|
12755
12765
|
const items = this.ajax ? this.items : this.items.slice(this.paginationIndexStart, this.paginationIndexEnd);
|
|
12756
12766
|
if (this.masonrySort && !this.isMobile) {
|
|
@@ -13126,8 +13136,8 @@ const _sfc_main = {
|
|
|
13126
13136
|
this.makePagination(response.data);
|
|
13127
13137
|
let items = response.data.data;
|
|
13128
13138
|
if (this.grouped) {
|
|
13129
|
-
this.items = items;
|
|
13130
|
-
|
|
13139
|
+
//this.items = items;
|
|
13140
|
+
this.groupItems(items, concat, this.isSplitGroups);
|
|
13131
13141
|
} else {
|
|
13132
13142
|
if (concat) {
|
|
13133
13143
|
this.items = this.items.concat(items);
|
|
@@ -13146,36 +13156,44 @@ const _sfc_main = {
|
|
|
13146
13156
|
this.fetchError = true;
|
|
13147
13157
|
});
|
|
13148
13158
|
},
|
|
13149
|
-
groupItems(items, concat = false) {
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13159
|
+
groupItems(items, concat = false, splitGroups = false) {
|
|
13160
|
+
const groupedAttribute = this.groupedAttribute;
|
|
13161
|
+
const groupLabelPre = this.groupedLabelPre || '';
|
|
13162
|
+
const groupLabelAfter = this.groupedLabelAfter || '';
|
|
13163
|
+
const itemsWithGroup = [];
|
|
13164
|
+
|
|
13165
|
+
// Usamos un objeto para agrupar los elementos por groupedAttribute
|
|
13166
|
+
const groupedMap = items.reduce((acc, item) => {
|
|
13167
|
+
const groupKey = item[groupedAttribute] || 'undefined';
|
|
13168
|
+
if (!acc[groupKey]) {
|
|
13169
|
+
acc[groupKey] = [];
|
|
13170
|
+
}
|
|
13171
|
+
acc[groupKey].push(item);
|
|
13172
|
+
return acc;
|
|
13173
|
+
}, {});
|
|
13174
|
+
if (splitGroups) {
|
|
13175
|
+
// Dividimos los grupos en arrays separados
|
|
13176
|
+
this.items = Object.entries(groupedMap).map(([groupKey, groupItems]) => ({
|
|
13177
|
+
groupKey,
|
|
13178
|
+
groupLabel: groupLabelPre + groupKey + groupLabelAfter,
|
|
13179
|
+
items: groupItems
|
|
13180
|
+
}));
|
|
13181
|
+
} else {
|
|
13182
|
+
// Creamos la estructura agrupada en un solo array
|
|
13183
|
+
for (const [groupKey, groupItems] of Object.entries(groupedMap)) {
|
|
13184
|
+
itemsWithGroup.push({
|
|
13185
|
+
crudgrouplabel: groupLabelPre + groupKey + groupLabelAfter,
|
|
13186
|
+
crudgroup: true
|
|
13163
13187
|
});
|
|
13188
|
+
itemsWithGroup.push(...groupItems);
|
|
13189
|
+
}
|
|
13190
|
+
|
|
13191
|
+
// Decidimos si concatenar o reemplazar los items existentes
|
|
13192
|
+
if (concat) {
|
|
13193
|
+
this.items = this.items.concat(itemsWithGroup);
|
|
13164
13194
|
} else {
|
|
13165
|
-
|
|
13166
|
-
lastcomparevalue = item[compareattr];
|
|
13167
|
-
itemswithgroup.push({
|
|
13168
|
-
crudgrouplabel: groupLabelPre + lastcomparevalue + groupLabelAfter,
|
|
13169
|
-
crudgroup: true
|
|
13170
|
-
});
|
|
13171
|
-
}
|
|
13172
|
-
itemswithgroup.push(item);
|
|
13195
|
+
this.items = itemsWithGroup;
|
|
13173
13196
|
}
|
|
13174
|
-
});
|
|
13175
|
-
if (concat) {
|
|
13176
|
-
this.items = this.items.concat(itemswithgroup);
|
|
13177
|
-
} else {
|
|
13178
|
-
this.items = itemswithgroup;
|
|
13179
13197
|
}
|
|
13180
13198
|
},
|
|
13181
13199
|
removeItem(id, index) {
|
|
@@ -14460,29 +14478,26 @@ var _sfc_render = function render() {
|
|
|
14460
14478
|
700: '15px'
|
|
14461
14479
|
}
|
|
14462
14480
|
}
|
|
14463
|
-
}, _vm._l(_vm.itemsList, function (item,
|
|
14481
|
+
}, _vm._l(_vm.itemsList, function (item, itemIndex) {
|
|
14464
14482
|
return _c('div', {
|
|
14465
|
-
key:
|
|
14483
|
+
key: itemIndex,
|
|
14466
14484
|
staticClass: "item"
|
|
14467
14485
|
}, [_vm._t("card", function () {
|
|
14468
|
-
return
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
}
|
|
14484
|
-
});
|
|
14485
|
-
});
|
|
14486
|
+
return [_c('ItemCard', {
|
|
14487
|
+
attrs: {
|
|
14488
|
+
"item": item,
|
|
14489
|
+
"columns": _vm.columns,
|
|
14490
|
+
"index": itemIndex,
|
|
14491
|
+
"cardClass": _vm.cardClass,
|
|
14492
|
+
"cardHideFooter": _vm.cardHideFooter,
|
|
14493
|
+
"itemValue": _vm.itemValue,
|
|
14494
|
+
"getStateValue": _vm.getStateValue,
|
|
14495
|
+
"getArrayValue": _vm.getArrayValue,
|
|
14496
|
+
"showItem": _vm.showItem,
|
|
14497
|
+
"updateItem": _vm.updateItem,
|
|
14498
|
+
"removeItem": _vm.removeItem
|
|
14499
|
+
}
|
|
14500
|
+
})];
|
|
14486
14501
|
}, {
|
|
14487
14502
|
"item": item
|
|
14488
14503
|
})], 2);
|
|
@@ -14494,7 +14509,7 @@ var _sfc_render = function render() {
|
|
|
14494
14509
|
staticClass: "kanban-column"
|
|
14495
14510
|
}, [_c('div', {
|
|
14496
14511
|
staticClass: "kanban-column-header"
|
|
14497
|
-
}, [_vm._v(" " + _vm._s(
|
|
14512
|
+
}, [_vm._v(" " + _vm._s(column.groupLabel) + " ")]), _vm._v(" " + _vm._s(JSON.stringify(column)) + " "), _c('draggable', {
|
|
14498
14513
|
staticClass: "kanban-column-body",
|
|
14499
14514
|
attrs: {
|
|
14500
14515
|
"group": "kanban"
|
|
@@ -14509,29 +14524,27 @@ var _sfc_render = function render() {
|
|
|
14509
14524
|
},
|
|
14510
14525
|
expression: "column.items"
|
|
14511
14526
|
}
|
|
14512
|
-
}, _vm._l(
|
|
14527
|
+
}, _vm._l(column.items, function (item, itemIndex) {
|
|
14513
14528
|
return _c('div', {
|
|
14514
|
-
key:
|
|
14529
|
+
key: itemIndex,
|
|
14515
14530
|
staticClass: "item"
|
|
14516
14531
|
}, [_vm._t("card", function () {
|
|
14517
|
-
return
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
});
|
|
14534
|
-
});
|
|
14532
|
+
return [_c('ItemCard', {
|
|
14533
|
+
key: itemIndex,
|
|
14534
|
+
attrs: {
|
|
14535
|
+
"item": item,
|
|
14536
|
+
"columns": _vm.columns,
|
|
14537
|
+
"index": _vm.index,
|
|
14538
|
+
"cardClass": _vm.cardClass,
|
|
14539
|
+
"cardHideFooter": _vm.cardHideFooter,
|
|
14540
|
+
"itemValue": _vm.itemValue,
|
|
14541
|
+
"getStateValue": _vm.getStateValue,
|
|
14542
|
+
"getArrayValue": _vm.getArrayValue,
|
|
14543
|
+
"showItem": _vm.showItem,
|
|
14544
|
+
"updateItem": _vm.updateItem,
|
|
14545
|
+
"removeItem": _vm.removeItem
|
|
14546
|
+
}
|
|
14547
|
+
})];
|
|
14535
14548
|
}, {
|
|
14536
14549
|
"item": item
|
|
14537
14550
|
})], 2);
|
|
@@ -14817,7 +14830,7 @@ var _sfc_render = function render() {
|
|
|
14817
14830
|
}) : _vm._e()], 2) : _vm._e()], 1);
|
|
14818
14831
|
};
|
|
14819
14832
|
var _sfc_staticRenderFns = [];
|
|
14820
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
14833
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "9859c699", null, null);
|
|
14821
14834
|
var component = __component__.exports;
|
|
14822
14835
|
|
|
14823
14836
|
// Import vue component
|