vue-laravel-crud 2.0.4 → 2.0.6
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 +1359 -228
- package/dist/vue-laravel-crud.min.js +3 -3
- package/dist/vue-laravel-crud.ssr.js +1378 -241
- package/package.json +2 -1
- package/src/ItemCard.vue +68 -5
- package/src/components/CrudCards.vue +24 -4
- package/src/components/CrudCustom.vue +14 -2
- package/src/components/CrudFilters.vue +247 -32
- package/src/components/CrudHeader.vue +12 -2
- package/src/components/CrudKanban.vue +19 -3
- package/src/components/CrudModals.vue +49 -21
- package/src/components/CrudTable.vue +18 -2
- package/src/components/kanban/KanbanBoard.vue +9 -1
- package/src/components/kanban/KanbanCard.vue +68 -5
- package/src/components/kanban/KanbanColumn.vue +11 -3
- package/src/components/table/TableCell.vue +95 -24
- package/src/components/table/TableHeader.vue +46 -22
- package/src/components/table/TableRow.vue +5 -1
- package/src/vue-laravel-crud.vue +27 -4
|
@@ -93,9 +93,115 @@ function normalizeComponent (
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
// Componente funcional para renderizar filtros custom con callback
|
|
97
|
+
const RenderCustomFilter = {
|
|
98
|
+
functional: true,
|
|
99
|
+
props: {
|
|
100
|
+
renderFunction: {
|
|
101
|
+
type: Function,
|
|
102
|
+
required: true
|
|
103
|
+
},
|
|
104
|
+
customFilter: {
|
|
105
|
+
type: Object,
|
|
106
|
+
required: true
|
|
107
|
+
},
|
|
108
|
+
filter: {
|
|
109
|
+
type: Array,
|
|
110
|
+
default: () => []
|
|
111
|
+
},
|
|
112
|
+
internalFilterByProp: {
|
|
113
|
+
type: Function,
|
|
114
|
+
required: true
|
|
115
|
+
},
|
|
116
|
+
getFilterForColumn: {
|
|
117
|
+
type: Function,
|
|
118
|
+
required: true
|
|
119
|
+
},
|
|
120
|
+
onChangeFilter: {
|
|
121
|
+
type: Function,
|
|
122
|
+
required: true
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
render(h, context) {
|
|
126
|
+
const {
|
|
127
|
+
renderFunction,
|
|
128
|
+
customFilter,
|
|
129
|
+
filter,
|
|
130
|
+
internalFilterByProp,
|
|
131
|
+
getFilterForColumn,
|
|
132
|
+
onChangeFilter
|
|
133
|
+
} = context.props;
|
|
134
|
+
return renderFunction(h, {
|
|
135
|
+
column: customFilter,
|
|
136
|
+
filter: filter,
|
|
137
|
+
internalFilterByProp: internalFilterByProp,
|
|
138
|
+
getFilterForColumn: getFilterForColumn,
|
|
139
|
+
onChangeFilter: onChangeFilter
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
};
|
|
96
143
|
const _sfc_main$f = {
|
|
97
144
|
name: 'CrudFilters',
|
|
98
|
-
|
|
145
|
+
components: {
|
|
146
|
+
RenderCustomFilter
|
|
147
|
+
},
|
|
148
|
+
inject: ['columns', 'customFilters', 'isColumnHasFilter', 'isCustomFilterEnabled', 'filter', 'internalFilterByProp', 'optionsLoaded', 'onChangeFilter', 'resetFilters', 'setupFilters', 'internalFilters'],
|
|
149
|
+
methods: {
|
|
150
|
+
// Método helper para obtener el filtro de forma segura, creándolo si no existe
|
|
151
|
+
getFilterForColumn(column) {
|
|
152
|
+
let filter = this.internalFilterByProp(column.prop);
|
|
153
|
+
|
|
154
|
+
// Si el filtro no existe, intentar inicializar los filtros
|
|
155
|
+
if (!filter) {
|
|
156
|
+
// Verificar si hay filtros inicializados
|
|
157
|
+
if (this.internalFilters && this.internalFilters.length === 0) {
|
|
158
|
+
this.setupFilters();
|
|
159
|
+
// Intentar obtener el filtro nuevamente después de inicializar
|
|
160
|
+
filter = this.internalFilterByProp(column.prop);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Si aún no existe, crear un objeto temporal para evitar errores
|
|
165
|
+
if (!filter) {
|
|
166
|
+
return {
|
|
167
|
+
value: null
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return filter;
|
|
171
|
+
},
|
|
172
|
+
// Método helper específico para campos de fecha (from)
|
|
173
|
+
getFilterForDateFrom(column) {
|
|
174
|
+
const filter = this.internalFilterByProp(column.prop + '_from');
|
|
175
|
+
if (!filter) {
|
|
176
|
+
if (this.internalFilters && this.internalFilters.length === 0) {
|
|
177
|
+
this.setupFilters();
|
|
178
|
+
return this.internalFilterByProp(column.prop + '_from') || {
|
|
179
|
+
value: null
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
value: null
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return filter;
|
|
187
|
+
},
|
|
188
|
+
// Método helper específico para campos de fecha (to)
|
|
189
|
+
getFilterForDateTo(column) {
|
|
190
|
+
const filter = this.internalFilterByProp(column.prop + '_to');
|
|
191
|
+
if (!filter) {
|
|
192
|
+
if (this.internalFilters && this.internalFilters.length === 0) {
|
|
193
|
+
this.setupFilters();
|
|
194
|
+
return this.internalFilterByProp(column.prop + '_to') || {
|
|
195
|
+
value: null
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
value: null
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
return filter;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
99
205
|
};
|
|
100
206
|
var _sfc_render$f = function render() {
|
|
101
207
|
var _vm = this,
|
|
@@ -105,15 +211,15 @@ var _sfc_render$f = function render() {
|
|
|
105
211
|
}, [_vm._l(_vm.columns, function (column, indexc) {
|
|
106
212
|
return _c('div', {
|
|
107
213
|
key: indexc
|
|
108
|
-
}, [_vm.isColumnHasFilter(column) ? _c('div', [_vm.
|
|
214
|
+
}, [_vm.isColumnHasFilter(column) ? _c('div', [_vm._t('sidebar-filter-' + column.prop, function () {
|
|
109
215
|
return [column.type == 'boolean' ? _c('div', {
|
|
110
216
|
staticClass: "form-group"
|
|
111
217
|
}, [_c('label', [_vm._v(_vm._s(column.label))]), _c('select', {
|
|
112
218
|
directives: [{
|
|
113
219
|
name: "model",
|
|
114
220
|
rawName: "v-model",
|
|
115
|
-
value: _vm.
|
|
116
|
-
expression: "
|
|
221
|
+
value: _vm.getFilterForColumn(column).value,
|
|
222
|
+
expression: "getFilterForColumn(column).value"
|
|
117
223
|
}],
|
|
118
224
|
staticClass: "form-control",
|
|
119
225
|
on: {
|
|
@@ -124,7 +230,7 @@ var _sfc_render$f = function render() {
|
|
|
124
230
|
var val = "_value" in o ? o._value : o.value;
|
|
125
231
|
return val;
|
|
126
232
|
});
|
|
127
|
-
_vm.$set(_vm.
|
|
233
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
128
234
|
}, function ($event) {
|
|
129
235
|
return _vm.onChangeFilter($event);
|
|
130
236
|
}]
|
|
@@ -155,11 +261,11 @@ var _sfc_render$f = function render() {
|
|
|
155
261
|
"locale": "es"
|
|
156
262
|
},
|
|
157
263
|
model: {
|
|
158
|
-
value: _vm.
|
|
264
|
+
value: _vm.getFilterForDateFrom(column).value,
|
|
159
265
|
callback: function ($$v) {
|
|
160
|
-
_vm.$set(_vm.
|
|
266
|
+
_vm.$set(_vm.getFilterForDateFrom(column), "value", $$v);
|
|
161
267
|
},
|
|
162
|
-
expression: "
|
|
268
|
+
expression: "getFilterForDateFrom(column).value\n "
|
|
163
269
|
}
|
|
164
270
|
})], 1), _c('div', {
|
|
165
271
|
staticClass: "col-6"
|
|
@@ -171,20 +277,90 @@ var _sfc_render$f = function render() {
|
|
|
171
277
|
"locale": "es"
|
|
172
278
|
},
|
|
173
279
|
model: {
|
|
174
|
-
value: _vm.
|
|
280
|
+
value: _vm.getFilterForDateTo(column).value,
|
|
175
281
|
callback: function ($$v) {
|
|
176
|
-
_vm.$set(_vm.
|
|
282
|
+
_vm.$set(_vm.getFilterForDateTo(column), "value", $$v);
|
|
283
|
+
},
|
|
284
|
+
expression: "getFilterForDateTo(column).value\n "
|
|
285
|
+
}
|
|
286
|
+
})], 1)])]) : column.type == 'number' || column.type == 'money' ? _c('div', {
|
|
287
|
+
staticClass: "form-group"
|
|
288
|
+
}, [_c('label', [_vm._v(_vm._s(column.label))]), _c('div', {
|
|
289
|
+
staticClass: "row"
|
|
290
|
+
}, [_c('div', {
|
|
291
|
+
staticClass: "col-6"
|
|
292
|
+
}, [_c('input', {
|
|
293
|
+
directives: [{
|
|
294
|
+
name: "model",
|
|
295
|
+
rawName: "v-model.number",
|
|
296
|
+
value: _vm.getFilterForDateFrom(column).value,
|
|
297
|
+
expression: "getFilterForDateFrom(column).value",
|
|
298
|
+
modifiers: {
|
|
299
|
+
"number": true
|
|
300
|
+
}
|
|
301
|
+
}],
|
|
302
|
+
staticClass: "form-control",
|
|
303
|
+
attrs: {
|
|
304
|
+
"type": "number",
|
|
305
|
+
"step": column.type == 'money' ? '0.01' : '1',
|
|
306
|
+
"placeholder": "Desde"
|
|
307
|
+
},
|
|
308
|
+
domProps: {
|
|
309
|
+
"value": _vm.getFilterForDateFrom(column).value
|
|
310
|
+
},
|
|
311
|
+
on: {
|
|
312
|
+
"change": function ($event) {
|
|
313
|
+
return _vm.onChangeFilter($event);
|
|
314
|
+
},
|
|
315
|
+
"input": function ($event) {
|
|
316
|
+
if ($event.target.composing) return;
|
|
317
|
+
_vm.$set(_vm.getFilterForDateFrom(column), "value", _vm._n($event.target.value));
|
|
177
318
|
},
|
|
178
|
-
|
|
319
|
+
"blur": function ($event) {
|
|
320
|
+
return _vm.$forceUpdate();
|
|
321
|
+
}
|
|
179
322
|
}
|
|
180
|
-
})],
|
|
323
|
+
})]), _c('div', {
|
|
324
|
+
staticClass: "col-6"
|
|
325
|
+
}, [_c('input', {
|
|
326
|
+
directives: [{
|
|
327
|
+
name: "model",
|
|
328
|
+
rawName: "v-model.number",
|
|
329
|
+
value: _vm.getFilterForDateTo(column).value,
|
|
330
|
+
expression: "getFilterForDateTo(column).value",
|
|
331
|
+
modifiers: {
|
|
332
|
+
"number": true
|
|
333
|
+
}
|
|
334
|
+
}],
|
|
335
|
+
staticClass: "form-control",
|
|
336
|
+
attrs: {
|
|
337
|
+
"type": "number",
|
|
338
|
+
"step": column.type == 'money' ? '0.01' : '1',
|
|
339
|
+
"placeholder": "Hasta"
|
|
340
|
+
},
|
|
341
|
+
domProps: {
|
|
342
|
+
"value": _vm.getFilterForDateTo(column).value
|
|
343
|
+
},
|
|
344
|
+
on: {
|
|
345
|
+
"change": function ($event) {
|
|
346
|
+
return _vm.onChangeFilter($event);
|
|
347
|
+
},
|
|
348
|
+
"input": function ($event) {
|
|
349
|
+
if ($event.target.composing) return;
|
|
350
|
+
_vm.$set(_vm.getFilterForDateTo(column), "value", _vm._n($event.target.value));
|
|
351
|
+
},
|
|
352
|
+
"blur": function ($event) {
|
|
353
|
+
return _vm.$forceUpdate();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
})])])]) : column.type == 'state' ? _c('div', {
|
|
181
357
|
staticClass: "form-group"
|
|
182
|
-
}, [_c('label', [_vm._v(_vm._s(column.label))]),
|
|
358
|
+
}, [_c('label', [_vm._v(_vm._s(column.label))]), column.options && Array.isArray(column.options) ? _c('select', {
|
|
183
359
|
directives: [{
|
|
184
360
|
name: "model",
|
|
185
361
|
rawName: "v-model",
|
|
186
|
-
value: _vm.
|
|
187
|
-
expression: "
|
|
362
|
+
value: _vm.getFilterForColumn(column).value,
|
|
363
|
+
expression: "getFilterForColumn(column).value"
|
|
188
364
|
}],
|
|
189
365
|
staticClass: "form-control",
|
|
190
366
|
on: {
|
|
@@ -195,7 +371,7 @@ var _sfc_render$f = function render() {
|
|
|
195
371
|
var val = "_value" in o ? o._value : o.value;
|
|
196
372
|
return val;
|
|
197
373
|
});
|
|
198
|
-
_vm.$set(_vm.
|
|
374
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
199
375
|
}, function ($event) {
|
|
200
376
|
return _vm.onChangeFilter($event);
|
|
201
377
|
}]
|
|
@@ -206,19 +382,19 @@ var _sfc_render$f = function render() {
|
|
|
206
382
|
}
|
|
207
383
|
}), _vm._l(column.options, function (option) {
|
|
208
384
|
return _c('option', {
|
|
209
|
-
key: option.
|
|
385
|
+
key: option.value || option.id,
|
|
210
386
|
domProps: {
|
|
211
|
-
"value": option.
|
|
387
|
+
"value": option.value
|
|
212
388
|
}
|
|
213
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
389
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
214
390
|
})], 2) : _vm._e()]) : column.type == 'array' ? _c('div', {
|
|
215
391
|
staticClass: "form-group"
|
|
216
|
-
}, [_c('label', [_vm._v(_vm._s(column.label))]),
|
|
392
|
+
}, [_c('label', [_vm._v(_vm._s(column.label))]), column.options && Array.isArray(column.options) ? _c('select', {
|
|
217
393
|
directives: [{
|
|
218
394
|
name: "model",
|
|
219
395
|
rawName: "v-model",
|
|
220
|
-
value: _vm.
|
|
221
|
-
expression: "
|
|
396
|
+
value: _vm.getFilterForColumn(column).value,
|
|
397
|
+
expression: "getFilterForColumn(column).value"
|
|
222
398
|
}],
|
|
223
399
|
staticClass: "form-control",
|
|
224
400
|
on: {
|
|
@@ -229,7 +405,7 @@ var _sfc_render$f = function render() {
|
|
|
229
405
|
var val = "_value" in o ? o._value : o.value;
|
|
230
406
|
return val;
|
|
231
407
|
});
|
|
232
|
-
_vm.$set(_vm.
|
|
408
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
233
409
|
}, function ($event) {
|
|
234
410
|
return _vm.onChangeFilter($event);
|
|
235
411
|
}]
|
|
@@ -238,32 +414,32 @@ var _sfc_render$f = function render() {
|
|
|
238
414
|
attrs: {
|
|
239
415
|
"value": ""
|
|
240
416
|
}
|
|
241
|
-
}),
|
|
417
|
+
}), _vm._l(column.options, function (option) {
|
|
242
418
|
return _c('option', {
|
|
243
|
-
key: option.
|
|
419
|
+
key: option.value || option.id,
|
|
244
420
|
domProps: {
|
|
245
|
-
"value": option.
|
|
421
|
+
"value": option.value
|
|
246
422
|
}
|
|
247
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
248
|
-
})
|
|
423
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
424
|
+
})], 2) : _vm._e()]) : _c('div', {
|
|
249
425
|
staticClass: "form-group"
|
|
250
426
|
}, [_c('label', [_vm._v(_vm._s(column.label))]), _c('input', {
|
|
251
427
|
directives: [{
|
|
252
428
|
name: "model",
|
|
253
429
|
rawName: "v-model.lazy",
|
|
254
|
-
value: _vm.
|
|
255
|
-
expression: "
|
|
430
|
+
value: _vm.getFilterForColumn(column).value,
|
|
431
|
+
expression: "getFilterForColumn(column).value",
|
|
256
432
|
modifiers: {
|
|
257
433
|
"lazy": true
|
|
258
434
|
}
|
|
259
435
|
}],
|
|
260
436
|
staticClass: "form-control",
|
|
261
437
|
domProps: {
|
|
262
|
-
"value": _vm.
|
|
438
|
+
"value": _vm.getFilterForColumn(column).value
|
|
263
439
|
},
|
|
264
440
|
on: {
|
|
265
441
|
"change": [function ($event) {
|
|
266
|
-
_vm.$set(_vm.
|
|
442
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.value);
|
|
267
443
|
}, function ($event) {
|
|
268
444
|
return _vm.onChangeFilter($event);
|
|
269
445
|
}]
|
|
@@ -272,8 +448,261 @@ var _sfc_render$f = function render() {
|
|
|
272
448
|
}, {
|
|
273
449
|
"column": column,
|
|
274
450
|
"filter": _vm.filter,
|
|
275
|
-
"internalFilterByProp": _vm.internalFilterByProp
|
|
276
|
-
|
|
451
|
+
"internalFilterByProp": _vm.internalFilterByProp,
|
|
452
|
+
"getFilterForColumn": _vm.getFilterForColumn
|
|
453
|
+
})], 2) : _vm._e()]);
|
|
454
|
+
}), _vm._l(_vm.customFilters, function (customFilter, indexcf) {
|
|
455
|
+
return _c('div', {
|
|
456
|
+
key: 'custom-' + indexcf
|
|
457
|
+
}, [_vm.isCustomFilterEnabled(customFilter) ? _c('div', [_vm._t('sidebar-filter-custom-' + customFilter.prop, function () {
|
|
458
|
+
return [typeof customFilter.type === 'function' ? _c('RenderCustomFilter', {
|
|
459
|
+
attrs: {
|
|
460
|
+
"render-function": customFilter.type,
|
|
461
|
+
"custom-filter": customFilter,
|
|
462
|
+
"filter": _vm.filter,
|
|
463
|
+
"internal-filter-by-prop": _vm.internalFilterByProp,
|
|
464
|
+
"get-filter-for-column": _vm.getFilterForColumn,
|
|
465
|
+
"on-change-filter": _vm.onChangeFilter
|
|
466
|
+
}
|
|
467
|
+
}) : [customFilter.type == 'boolean' ? _c('div', {
|
|
468
|
+
staticClass: "form-group"
|
|
469
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('select', {
|
|
470
|
+
directives: [{
|
|
471
|
+
name: "model",
|
|
472
|
+
rawName: "v-model",
|
|
473
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
474
|
+
expression: "getFilterForColumn(customFilter).value"
|
|
475
|
+
}],
|
|
476
|
+
staticClass: "form-control",
|
|
477
|
+
on: {
|
|
478
|
+
"change": [function ($event) {
|
|
479
|
+
var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) {
|
|
480
|
+
return o.selected;
|
|
481
|
+
}).map(function (o) {
|
|
482
|
+
var val = "_value" in o ? o._value : o.value;
|
|
483
|
+
return val;
|
|
484
|
+
});
|
|
485
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
486
|
+
}, function ($event) {
|
|
487
|
+
return _vm.onChangeFilter($event);
|
|
488
|
+
}]
|
|
489
|
+
}
|
|
490
|
+
}, [_c('option', {
|
|
491
|
+
attrs: {
|
|
492
|
+
"value": ""
|
|
493
|
+
}
|
|
494
|
+
}), _c('option', {
|
|
495
|
+
attrs: {
|
|
496
|
+
"value": "1"
|
|
497
|
+
}
|
|
498
|
+
}, [_vm._v("Sí")]), _c('option', {
|
|
499
|
+
attrs: {
|
|
500
|
+
"value": "0"
|
|
501
|
+
}
|
|
502
|
+
}, [_vm._v("No")])])]) : customFilter.type == 'date' ? _c('div', {
|
|
503
|
+
staticClass: "form-group"
|
|
504
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('div', {
|
|
505
|
+
staticClass: "row"
|
|
506
|
+
}, [_c('div', {
|
|
507
|
+
staticClass: "col-6"
|
|
508
|
+
}, [_c('b-form-datepicker', {
|
|
509
|
+
attrs: {
|
|
510
|
+
"today-button": "",
|
|
511
|
+
"reset-button": "",
|
|
512
|
+
"close-button": "",
|
|
513
|
+
"locale": "es"
|
|
514
|
+
},
|
|
515
|
+
model: {
|
|
516
|
+
value: _vm.getFilterForDateFrom(customFilter).value,
|
|
517
|
+
callback: function ($$v) {
|
|
518
|
+
_vm.$set(_vm.getFilterForDateFrom(customFilter), "value", $$v);
|
|
519
|
+
},
|
|
520
|
+
expression: "getFilterForDateFrom(customFilter).value\n "
|
|
521
|
+
}
|
|
522
|
+
})], 1), _c('div', {
|
|
523
|
+
staticClass: "col-6"
|
|
524
|
+
}, [_c('b-form-datepicker', {
|
|
525
|
+
attrs: {
|
|
526
|
+
"today-button": "",
|
|
527
|
+
"reset-button": "",
|
|
528
|
+
"close-button": "",
|
|
529
|
+
"locale": "es"
|
|
530
|
+
},
|
|
531
|
+
model: {
|
|
532
|
+
value: _vm.getFilterForDateTo(customFilter).value,
|
|
533
|
+
callback: function ($$v) {
|
|
534
|
+
_vm.$set(_vm.getFilterForDateTo(customFilter), "value", $$v);
|
|
535
|
+
},
|
|
536
|
+
expression: "getFilterForDateTo(customFilter).value\n "
|
|
537
|
+
}
|
|
538
|
+
})], 1)])]) : customFilter.type == 'number' || customFilter.type == 'money' ? _c('div', {
|
|
539
|
+
staticClass: "form-group"
|
|
540
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('div', {
|
|
541
|
+
staticClass: "row"
|
|
542
|
+
}, [_c('div', {
|
|
543
|
+
staticClass: "col-6"
|
|
544
|
+
}, [_c('input', {
|
|
545
|
+
directives: [{
|
|
546
|
+
name: "model",
|
|
547
|
+
rawName: "v-model.number",
|
|
548
|
+
value: _vm.getFilterForDateFrom(customFilter).value,
|
|
549
|
+
expression: "getFilterForDateFrom(customFilter).value",
|
|
550
|
+
modifiers: {
|
|
551
|
+
"number": true
|
|
552
|
+
}
|
|
553
|
+
}],
|
|
554
|
+
staticClass: "form-control",
|
|
555
|
+
attrs: {
|
|
556
|
+
"type": "number",
|
|
557
|
+
"step": customFilter.type == 'money' ? '0.01' : '1',
|
|
558
|
+
"placeholder": "Desde"
|
|
559
|
+
},
|
|
560
|
+
domProps: {
|
|
561
|
+
"value": _vm.getFilterForDateFrom(customFilter).value
|
|
562
|
+
},
|
|
563
|
+
on: {
|
|
564
|
+
"change": function ($event) {
|
|
565
|
+
return _vm.onChangeFilter($event);
|
|
566
|
+
},
|
|
567
|
+
"input": function ($event) {
|
|
568
|
+
if ($event.target.composing) return;
|
|
569
|
+
_vm.$set(_vm.getFilterForDateFrom(customFilter), "value", _vm._n($event.target.value));
|
|
570
|
+
},
|
|
571
|
+
"blur": function ($event) {
|
|
572
|
+
return _vm.$forceUpdate();
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
})]), _c('div', {
|
|
576
|
+
staticClass: "col-6"
|
|
577
|
+
}, [_c('input', {
|
|
578
|
+
directives: [{
|
|
579
|
+
name: "model",
|
|
580
|
+
rawName: "v-model.number",
|
|
581
|
+
value: _vm.getFilterForDateTo(customFilter).value,
|
|
582
|
+
expression: "getFilterForDateTo(customFilter).value",
|
|
583
|
+
modifiers: {
|
|
584
|
+
"number": true
|
|
585
|
+
}
|
|
586
|
+
}],
|
|
587
|
+
staticClass: "form-control",
|
|
588
|
+
attrs: {
|
|
589
|
+
"type": "number",
|
|
590
|
+
"step": customFilter.type == 'money' ? '0.01' : '1',
|
|
591
|
+
"placeholder": "Hasta"
|
|
592
|
+
},
|
|
593
|
+
domProps: {
|
|
594
|
+
"value": _vm.getFilterForDateTo(customFilter).value
|
|
595
|
+
},
|
|
596
|
+
on: {
|
|
597
|
+
"change": function ($event) {
|
|
598
|
+
return _vm.onChangeFilter($event);
|
|
599
|
+
},
|
|
600
|
+
"input": function ($event) {
|
|
601
|
+
if ($event.target.composing) return;
|
|
602
|
+
_vm.$set(_vm.getFilterForDateTo(customFilter), "value", _vm._n($event.target.value));
|
|
603
|
+
},
|
|
604
|
+
"blur": function ($event) {
|
|
605
|
+
return _vm.$forceUpdate();
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
})])])]) : customFilter.type == 'state' ? _c('div', {
|
|
609
|
+
staticClass: "form-group"
|
|
610
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), customFilter.options && Array.isArray(customFilter.options) ? _c('select', {
|
|
611
|
+
directives: [{
|
|
612
|
+
name: "model",
|
|
613
|
+
rawName: "v-model",
|
|
614
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
615
|
+
expression: "getFilterForColumn(customFilter).value"
|
|
616
|
+
}],
|
|
617
|
+
staticClass: "form-control",
|
|
618
|
+
on: {
|
|
619
|
+
"change": [function ($event) {
|
|
620
|
+
var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) {
|
|
621
|
+
return o.selected;
|
|
622
|
+
}).map(function (o) {
|
|
623
|
+
var val = "_value" in o ? o._value : o.value;
|
|
624
|
+
return val;
|
|
625
|
+
});
|
|
626
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
627
|
+
}, function ($event) {
|
|
628
|
+
return _vm.onChangeFilter($event);
|
|
629
|
+
}]
|
|
630
|
+
}
|
|
631
|
+
}, [_c('option', {
|
|
632
|
+
attrs: {
|
|
633
|
+
"value": ""
|
|
634
|
+
}
|
|
635
|
+
}), _vm._l(customFilter.options, function (option) {
|
|
636
|
+
return _c('option', {
|
|
637
|
+
key: option.value || option.id,
|
|
638
|
+
domProps: {
|
|
639
|
+
"value": option.value
|
|
640
|
+
}
|
|
641
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
642
|
+
})], 2) : _vm._e()]) : customFilter.type == 'array' ? _c('div', {
|
|
643
|
+
staticClass: "form-group"
|
|
644
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), customFilter.options && Array.isArray(customFilter.options) ? _c('select', {
|
|
645
|
+
directives: [{
|
|
646
|
+
name: "model",
|
|
647
|
+
rawName: "v-model",
|
|
648
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
649
|
+
expression: "getFilterForColumn(customFilter).value"
|
|
650
|
+
}],
|
|
651
|
+
staticClass: "form-control",
|
|
652
|
+
on: {
|
|
653
|
+
"change": [function ($event) {
|
|
654
|
+
var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) {
|
|
655
|
+
return o.selected;
|
|
656
|
+
}).map(function (o) {
|
|
657
|
+
var val = "_value" in o ? o._value : o.value;
|
|
658
|
+
return val;
|
|
659
|
+
});
|
|
660
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
661
|
+
}, function ($event) {
|
|
662
|
+
return _vm.onChangeFilter($event);
|
|
663
|
+
}]
|
|
664
|
+
}
|
|
665
|
+
}, [_c('option', {
|
|
666
|
+
attrs: {
|
|
667
|
+
"value": ""
|
|
668
|
+
}
|
|
669
|
+
}), _vm._l(customFilter.options, function (option) {
|
|
670
|
+
return _c('option', {
|
|
671
|
+
key: option.value || option.id,
|
|
672
|
+
domProps: {
|
|
673
|
+
"value": option.value
|
|
674
|
+
}
|
|
675
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
676
|
+
})], 2) : _vm._e()]) : _c('div', {
|
|
677
|
+
staticClass: "form-group"
|
|
678
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('input', {
|
|
679
|
+
directives: [{
|
|
680
|
+
name: "model",
|
|
681
|
+
rawName: "v-model.lazy",
|
|
682
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
683
|
+
expression: "getFilterForColumn(customFilter).value",
|
|
684
|
+
modifiers: {
|
|
685
|
+
"lazy": true
|
|
686
|
+
}
|
|
687
|
+
}],
|
|
688
|
+
staticClass: "form-control",
|
|
689
|
+
domProps: {
|
|
690
|
+
"value": _vm.getFilterForColumn(customFilter).value
|
|
691
|
+
},
|
|
692
|
+
on: {
|
|
693
|
+
"change": [function ($event) {
|
|
694
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.value);
|
|
695
|
+
}, function ($event) {
|
|
696
|
+
return _vm.onChangeFilter($event);
|
|
697
|
+
}]
|
|
698
|
+
}
|
|
699
|
+
})])]];
|
|
700
|
+
}, {
|
|
701
|
+
"column": customFilter,
|
|
702
|
+
"filter": _vm.filter,
|
|
703
|
+
"internalFilterByProp": _vm.internalFilterByProp,
|
|
704
|
+
"getFilterForColumn": _vm.getFilterForColumn
|
|
705
|
+
})], 2) : _vm._e()]);
|
|
277
706
|
}), _c('div', {
|
|
278
707
|
staticClass: "mt-3 d-flex justify-content-center"
|
|
279
708
|
}, [_c('button', {
|
|
@@ -298,7 +727,7 @@ var CrudFilters = __component__$f.exports;
|
|
|
298
727
|
|
|
299
728
|
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}}
|
|
300
729
|
|
|
301
|
-
var css$8 = "\n.crud-header[data-v-
|
|
730
|
+
var css$8 = "\n.crud-header[data-v-d09f8396] {\r\n display: flex;\r\n justify-content: space-between;\r\n max-height: 3rem;\n}\n.crud-title[data-v-d09f8396] {\r\n margin: 0;\n}\n.crud-search[data-v-d09f8396] {\r\n max-width: 15rem;\n}\n.crud-search .btn[data-v-d09f8396] {\r\n border-top-left-radius: 0;\r\n border-bottom-left-radius: 0;\r\n border-top-right-radius: 0.375rem;\r\n border-bottom-right-radius: 0.375rem;\n}\n.crud-search .btn.open[data-v-d09f8396] {\r\n border-top-right-radius: 0;\r\n border-bottom-right-radius: 0;\n}\n.table-options[data-v-d09f8396] {\r\n margin-bottom: 1rem;\r\n display: flex;\r\n align-items: center;\r\n justify-content: flex-end;\n}\r\n";
|
|
302
731
|
n(css$8, {});
|
|
303
732
|
|
|
304
733
|
const _sfc_main$e = {
|
|
@@ -311,6 +740,16 @@ const _sfc_main$e = {
|
|
|
311
740
|
sidebarVisible() {
|
|
312
741
|
// Acceder directamente al componente padre para obtener reactividad
|
|
313
742
|
return this.$parent ? this.$parent.filterSidebarOpen : this.filterSidebarOpen;
|
|
743
|
+
},
|
|
744
|
+
currentDisplayMode() {
|
|
745
|
+
if (!this.displayMode) return 1;
|
|
746
|
+
if (this.displayMode.value !== undefined) {
|
|
747
|
+
return this.displayMode.value;
|
|
748
|
+
}
|
|
749
|
+
if (typeof this.displayMode === 'function') {
|
|
750
|
+
return this.displayMode();
|
|
751
|
+
}
|
|
752
|
+
return this.displayMode;
|
|
314
753
|
}
|
|
315
754
|
},
|
|
316
755
|
methods: {
|
|
@@ -420,7 +859,7 @@ var _sfc_render$e = function render() {
|
|
|
420
859
|
return _vm.toggleDisplayMode();
|
|
421
860
|
}
|
|
422
861
|
}
|
|
423
|
-
}, [_vm.
|
|
862
|
+
}, [_vm.currentDisplayMode == _vm.displayModes.MODE_TABLE ? _c('b-icon-card-list') : _vm.currentDisplayMode == _vm.displayModes.MODE_CARDS ? _c('b-icon-table') : _vm._e()], 1) : _vm._e(), _vm.showSearch ? _c('div', {
|
|
424
863
|
staticClass: "crud-search m-0"
|
|
425
864
|
}, [_c('b-input-group', [_c('b-input-group-prepend', [_c('b-button', {
|
|
426
865
|
class: {
|
|
@@ -459,7 +898,7 @@ var _sfc_render$e = function render() {
|
|
|
459
898
|
})], 2)], 1)], 1) : _vm._e();
|
|
460
899
|
};
|
|
461
900
|
var _sfc_staticRenderFns$e = [];
|
|
462
|
-
var __component__$e = /*#__PURE__*/normalizeComponent(_sfc_main$e, _sfc_render$e, _sfc_staticRenderFns$e, false, null, "
|
|
901
|
+
var __component__$e = /*#__PURE__*/normalizeComponent(_sfc_main$e, _sfc_render$e, _sfc_staticRenderFns$e, false, null, "d09f8396", null, null);
|
|
463
902
|
var CrudHeader = __component__$e.exports;
|
|
464
903
|
|
|
465
904
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -6630,7 +7069,7 @@ vuedraggable_umd.exports;
|
|
|
6630
7069
|
var vuedraggable_umdExports = vuedraggable_umd.exports;
|
|
6631
7070
|
var draggable = /*@__PURE__*/getDefaultExportFromCjs(vuedraggable_umdExports);
|
|
6632
7071
|
|
|
6633
|
-
var css$6 = "\r\n/* Fijar ancho de la columna de acciones en el header */\n.actions-header[data-v-
|
|
7072
|
+
var css$6 = "\r\n/* Fijar ancho de la columna de acciones en el header */\n.actions-header[data-v-3de96e53] {\r\n width: 1%;\r\n white-space: nowrap;\n}\n.sort-filter[data-v-3de96e53] {\r\n cursor: pointer;\r\n visibility: hidden;\r\n display: inline-block;\n}\n.sort-filter-visible[data-v-3de96e53] {\r\n visibility: visible;\n}\r\n";
|
|
6634
7073
|
n(css$6, {});
|
|
6635
7074
|
|
|
6636
7075
|
const _sfc_main$d = {
|
|
@@ -6689,7 +7128,7 @@ var _sfc_render$d = function render() {
|
|
|
6689
7128
|
_vm.hoveredColumn = null;
|
|
6690
7129
|
}
|
|
6691
7130
|
}
|
|
6692
|
-
}, [_vm.enableFilters && _vm.filtersVisible && _vm.isColumnHasFilter(column) && _vm.internalFilterByProp(column.prop) ? _vm._t('filter-' + column.prop, function () {
|
|
7131
|
+
}, [_vm.enableFilters && _vm.filtersVisible && _vm.isColumnHasFilter(column) && (_vm.internalFilterByProp(column.prop) || _vm.internalFilterByProp(column.prop + '_from')) ? _vm._t('filter-' + column.prop, function () {
|
|
6693
7132
|
return [_c('div', {
|
|
6694
7133
|
staticClass: "form-group"
|
|
6695
7134
|
}, [column.type == 'boolean' ? _c('select', {
|
|
@@ -6761,7 +7200,75 @@ var _sfc_render$d = function render() {
|
|
|
6761
7200
|
},
|
|
6762
7201
|
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
6763
7202
|
}
|
|
6764
|
-
})], 1)]) : column.type == '
|
|
7203
|
+
})], 1)]) : column.type == 'number' || column.type == 'money' || column.type == 'price' ? _c('div', {
|
|
7204
|
+
staticClass: "row"
|
|
7205
|
+
}, [_c('div', {
|
|
7206
|
+
staticClass: "col-6"
|
|
7207
|
+
}, [_c('input', {
|
|
7208
|
+
directives: [{
|
|
7209
|
+
name: "model",
|
|
7210
|
+
rawName: "v-model.number",
|
|
7211
|
+
value: _vm.internalFilterByProp(column.prop + '_from').value,
|
|
7212
|
+
expression: "internalFilterByProp(column.prop + '_from').value",
|
|
7213
|
+
modifiers: {
|
|
7214
|
+
"number": true
|
|
7215
|
+
}
|
|
7216
|
+
}],
|
|
7217
|
+
staticClass: "form-control form-control-md p-2",
|
|
7218
|
+
attrs: {
|
|
7219
|
+
"type": "number",
|
|
7220
|
+
"step": column.type == 'money' || column.type == 'price' ? '0.01' : '1',
|
|
7221
|
+
"placeholder": "Desde"
|
|
7222
|
+
},
|
|
7223
|
+
domProps: {
|
|
7224
|
+
"value": _vm.internalFilterByProp(column.prop + '_from').value
|
|
7225
|
+
},
|
|
7226
|
+
on: {
|
|
7227
|
+
"change": function ($event) {
|
|
7228
|
+
return _vm.onChangeFilter($event);
|
|
7229
|
+
},
|
|
7230
|
+
"input": function ($event) {
|
|
7231
|
+
if ($event.target.composing) return;
|
|
7232
|
+
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", _vm._n($event.target.value));
|
|
7233
|
+
},
|
|
7234
|
+
"blur": function ($event) {
|
|
7235
|
+
return _vm.$forceUpdate();
|
|
7236
|
+
}
|
|
7237
|
+
}
|
|
7238
|
+
})]), _c('div', {
|
|
7239
|
+
staticClass: "col-6"
|
|
7240
|
+
}, [_c('input', {
|
|
7241
|
+
directives: [{
|
|
7242
|
+
name: "model",
|
|
7243
|
+
rawName: "v-model.number",
|
|
7244
|
+
value: _vm.internalFilterByProp(column.prop + '_to').value,
|
|
7245
|
+
expression: "internalFilterByProp(column.prop + '_to').value",
|
|
7246
|
+
modifiers: {
|
|
7247
|
+
"number": true
|
|
7248
|
+
}
|
|
7249
|
+
}],
|
|
7250
|
+
staticClass: "form-control form-control-md p-2",
|
|
7251
|
+
attrs: {
|
|
7252
|
+
"type": "number",
|
|
7253
|
+
"step": column.type == 'money' || column.type == 'price' ? '0.01' : '1',
|
|
7254
|
+
"placeholder": "Hasta"
|
|
7255
|
+
},
|
|
7256
|
+
domProps: {
|
|
7257
|
+
"value": _vm.internalFilterByProp(column.prop + '_to').value
|
|
7258
|
+
},
|
|
7259
|
+
on: {
|
|
7260
|
+
"change": function ($event) {
|
|
7261
|
+
return _vm.onChangeFilter($event);
|
|
7262
|
+
},
|
|
7263
|
+
"input": function ($event) {
|
|
7264
|
+
if ($event.target.composing) return;
|
|
7265
|
+
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", _vm._n($event.target.value));
|
|
7266
|
+
},
|
|
7267
|
+
"blur": function ($event) {
|
|
7268
|
+
return _vm.$forceUpdate();
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7271
|
+
})])]) : column.type == 'state' && column.options && Array.isArray(column.options) ? _c('select', {
|
|
6765
7272
|
directives: [{
|
|
6766
7273
|
name: "model",
|
|
6767
7274
|
rawName: "v-model",
|
|
@@ -6793,10 +7300,10 @@ var _sfc_render$d = function render() {
|
|
|
6793
7300
|
return _c('option', {
|
|
6794
7301
|
key: indexo,
|
|
6795
7302
|
domProps: {
|
|
6796
|
-
"value": option.
|
|
7303
|
+
"value": option.value
|
|
6797
7304
|
}
|
|
6798
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
6799
|
-
})], 2) : column.type == 'array' &&
|
|
7305
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
7306
|
+
})], 2) : column.type == 'array' && column.options && Array.isArray(column.options) ? _c('select', {
|
|
6800
7307
|
directives: [{
|
|
6801
7308
|
name: "model",
|
|
6802
7309
|
rawName: "v-model",
|
|
@@ -6828,9 +7335,9 @@ var _sfc_render$d = function render() {
|
|
|
6828
7335
|
return _c('option', {
|
|
6829
7336
|
key: indexo,
|
|
6830
7337
|
domProps: {
|
|
6831
|
-
"value": option.
|
|
7338
|
+
"value": option.value
|
|
6832
7339
|
}
|
|
6833
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
7340
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
6834
7341
|
})], 2) : column.type == 'checkbox' ? _c('b-form-checkbox', {
|
|
6835
7342
|
attrs: {
|
|
6836
7343
|
"name": "select-all",
|
|
@@ -6891,19 +7398,26 @@ var _sfc_render$d = function render() {
|
|
|
6891
7398
|
on: {
|
|
6892
7399
|
"change": _vm.toggleAll
|
|
6893
7400
|
}
|
|
6894
|
-
})], 1) : _c('span', [_vm._v(_vm._s(column.label))]), _vm.isSortableColumn(column)
|
|
6895
|
-
staticClass: "sort-filter",
|
|
7401
|
+
})], 1) : _c('span', [_vm._v(_vm._s(column.label))]), _vm.isSortableColumn(column) ? _c('span', {
|
|
7402
|
+
staticClass: "sort-filter ml-1",
|
|
7403
|
+
class: {
|
|
7404
|
+
'sort-filter-visible': _vm.shouldShowSortIcon(column)
|
|
7405
|
+
},
|
|
6896
7406
|
on: {
|
|
6897
7407
|
"click": function ($event) {
|
|
6898
7408
|
return _vm.toggleSortFilter(column);
|
|
6899
7409
|
}
|
|
6900
7410
|
}
|
|
6901
|
-
}, [_vm.getSortIconDirection(column) === 'up' ? _c('b-icon-sort-up') : _vm.
|
|
7411
|
+
}, [_vm.getSortIconDirection(column) === 'up' ? _c('b-icon-sort-up') : _vm.getSortIconDirection(column) === 'down' ? _c('b-icon-sort-down') : _c('b-icon-sort-up', {
|
|
7412
|
+
staticStyle: {
|
|
7413
|
+
"visibility": "hidden"
|
|
7414
|
+
}
|
|
7415
|
+
})], 1) : _vm._e()], 2);
|
|
6902
7416
|
});
|
|
6903
7417
|
})], 2)]);
|
|
6904
7418
|
};
|
|
6905
7419
|
var _sfc_staticRenderFns$d = [];
|
|
6906
|
-
var __component__$d = /*#__PURE__*/normalizeComponent(_sfc_main$d, _sfc_render$d, _sfc_staticRenderFns$d, false, null, "
|
|
7420
|
+
var __component__$d = /*#__PURE__*/normalizeComponent(_sfc_main$d, _sfc_render$d, _sfc_staticRenderFns$d, false, null, "3de96e53", null, null);
|
|
6907
7421
|
var TableHeader = __component__$d.exports;
|
|
6908
7422
|
|
|
6909
7423
|
function commonjsRequire(path) {
|
|
@@ -12599,7 +13113,7 @@ moment$1.exports;
|
|
|
12599
13113
|
var momentExports = moment$1.exports;
|
|
12600
13114
|
var moment = /*@__PURE__*/getDefaultExportFromCjs(momentExports);
|
|
12601
13115
|
|
|
12602
|
-
var css$5 = "\r\n/* Fijar ancho de la columna de acciones */\n.actions-cell[data-v-
|
|
13116
|
+
var css$5 = "\r\n/* Fijar ancho de la columna de acciones */\n.actions-cell[data-v-e38a3192] {\r\n width: 1%;\r\n white-space: nowrap;\n}\n.actions-button-group[data-v-e38a3192] {\r\n display: inline-flex;\r\n flex-wrap: nowrap;\n}\n.actions-dropdown[data-v-e38a3192] {\r\n display: inline-block;\n}\r\n\r\n/* Asegurar que los botones no se expandan */\n.actions-button-group .btn[data-v-e38a3192] {\r\n flex-shrink: 0;\n}\r\n";
|
|
12603
13117
|
n(css$5, {});
|
|
12604
13118
|
|
|
12605
13119
|
const _sfc_main$c = {
|
|
@@ -12610,11 +13124,54 @@ const _sfc_main$c = {
|
|
|
12610
13124
|
index: Number,
|
|
12611
13125
|
columnIndex: Number
|
|
12612
13126
|
},
|
|
12613
|
-
inject: ['itemValue', 'getStateValue', 'getArrayValue', 'onCheckSelect', 'showItem', 'updateItem', 'removeItem', 'optionsLoaded'],
|
|
13127
|
+
inject: ['itemValue', 'getStateValue', 'getStateOptions', 'getStateBadgeVariant', 'getArrayValue', 'onCheckSelect', 'showItem', 'updateItem', 'removeItem', 'optionsLoaded'],
|
|
12614
13128
|
data() {
|
|
12615
13129
|
return {
|
|
12616
13130
|
moment: moment
|
|
12617
13131
|
};
|
|
13132
|
+
},
|
|
13133
|
+
computed: {
|
|
13134
|
+
stateOptions() {
|
|
13135
|
+
// Permitir usar opciones incluso si optionsLoaded es false, ya que getStateOptions normaliza internamente
|
|
13136
|
+
if (this.column.type === 'state' && this.column.options && Array.isArray(this.column.options)) {
|
|
13137
|
+
const itemVal = this.itemValue(this.column, this.item);
|
|
13138
|
+
const options = this.column.options;
|
|
13139
|
+
const result = this.getStateOptions(itemVal, options);
|
|
13140
|
+
return result;
|
|
13141
|
+
}
|
|
13142
|
+
return [];
|
|
13143
|
+
}
|
|
13144
|
+
},
|
|
13145
|
+
methods: {
|
|
13146
|
+
formatNumber(value, column) {
|
|
13147
|
+
if (value === null || value === undefined || value === '') {
|
|
13148
|
+
return '';
|
|
13149
|
+
}
|
|
13150
|
+
const numValue = parseFloat(value);
|
|
13151
|
+
if (isNaN(numValue)) {
|
|
13152
|
+
return value;
|
|
13153
|
+
}
|
|
13154
|
+
const thousandsSep = column.thousandsSeparator || '.';
|
|
13155
|
+
const decimalSep = column.decimalSeparator || ',';
|
|
13156
|
+
const decimals = column.decimals !== undefined ? column.decimals : numValue % 1 === 0 ? 0 : 2;
|
|
13157
|
+
|
|
13158
|
+
// Formatear número con separadores
|
|
13159
|
+
const parts = numValue.toFixed(decimals).split('.');
|
|
13160
|
+
const integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSep);
|
|
13161
|
+
const decimalPart = parts[1] || '';
|
|
13162
|
+
if (decimals > 0 && decimalPart) {
|
|
13163
|
+
return `${integerPart}${decimalSep}${decimalPart}`;
|
|
13164
|
+
}
|
|
13165
|
+
return integerPart;
|
|
13166
|
+
},
|
|
13167
|
+
formatMoney(value, column) {
|
|
13168
|
+
const formatted = this.formatNumber(value, column);
|
|
13169
|
+
if (formatted === '') {
|
|
13170
|
+
return '';
|
|
13171
|
+
}
|
|
13172
|
+
const symbol = column.symbol || '$';
|
|
13173
|
+
return `${symbol}${formatted}`;
|
|
13174
|
+
}
|
|
12618
13175
|
}
|
|
12619
13176
|
};
|
|
12620
13177
|
var _sfc_render$c = function render() {
|
|
@@ -12662,7 +13219,15 @@ var _sfc_render$c = function render() {
|
|
|
12662
13219
|
},
|
|
12663
13220
|
expression: "item.selected"
|
|
12664
13221
|
}
|
|
12665
|
-
})], 1) : _vm.column.type == 'state'
|
|
13222
|
+
})], 1) : _vm.column.type == 'state' ? _c('span', [_vm.stateOptions.length > 0 ? _vm._l(_vm.stateOptions, function (option, optIndex) {
|
|
13223
|
+
return _c('b-badge', {
|
|
13224
|
+
key: optIndex,
|
|
13225
|
+
staticClass: "mr-1",
|
|
13226
|
+
attrs: {
|
|
13227
|
+
"variant": _vm.getStateBadgeVariant(option)
|
|
13228
|
+
}
|
|
13229
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
13230
|
+
}) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(_vm.column, _vm.item)) + " ")])], 2) : _vm.column.type == 'array' && _vm.optionsLoaded ? _c('span', [_vm._v(" " + _vm._s(_vm.getArrayValue(_vm.itemValue(_vm.column, _vm.item), _vm.column.displayProp, _vm.column.options)) + " ")]) : _vm.column.type == 'money' || _vm.column.type == 'price' ? _c('span', [_vm._v(" " + _vm._s(_vm.formatMoney(_vm.itemValue(_vm.column, _vm.item), _vm.column)) + " ")]) : _vm.column.type == 'number' && (_vm.column.thousandsSeparator || _vm.column.decimalSeparator || _vm.column.decimals !== undefined) ? _c('span', [_vm._v(" " + _vm._s(_vm.formatNumber(_vm.itemValue(_vm.column, _vm.item), _vm.column)) + " ")]) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(_vm.column, _vm.item)) + " ")])];
|
|
12666
13231
|
}, {
|
|
12667
13232
|
"item": _vm.item,
|
|
12668
13233
|
"index": _vm.index,
|
|
@@ -12681,27 +13246,35 @@ var _sfc_render$c = function render() {
|
|
|
12681
13246
|
},
|
|
12682
13247
|
proxy: true
|
|
12683
13248
|
}], null, false, 4241371057)
|
|
12684
|
-
}, [_vm._t("
|
|
12685
|
-
return [
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
-
|
|
13249
|
+
}, [_vm._t("rowActions", function () {
|
|
13250
|
+
return [_vm._t("rowAction", function () {
|
|
13251
|
+
return [_c('b-dropdown-item', {
|
|
13252
|
+
on: {
|
|
13253
|
+
"click": function ($event) {
|
|
13254
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
13255
|
+
}
|
|
12689
13256
|
}
|
|
12690
|
-
}
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
13257
|
+
}, [_c('b-icon-eye'), _vm._v(" Ver ")], 1), _c('b-dropdown-item', {
|
|
13258
|
+
on: {
|
|
13259
|
+
"click": function ($event) {
|
|
13260
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
13261
|
+
}
|
|
12695
13262
|
}
|
|
12696
|
-
}
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
13263
|
+
}, [_c('b-icon-pencil'), _vm._v(" Editar ")], 1), _c('b-dropdown-item', {
|
|
13264
|
+
staticClass: "text-danger",
|
|
13265
|
+
on: {
|
|
13266
|
+
"click": function ($event) {
|
|
13267
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
13268
|
+
}
|
|
12702
13269
|
}
|
|
12703
|
-
}
|
|
12704
|
-
},
|
|
13270
|
+
}, [_c('b-icon-trash'), _vm._v(" Eliminar ")], 1)];
|
|
13271
|
+
}, {
|
|
13272
|
+
"item": _vm.item,
|
|
13273
|
+
"index": _vm.index,
|
|
13274
|
+
"showItem": _vm.showItem,
|
|
13275
|
+
"updateItem": _vm.updateItem,
|
|
13276
|
+
"removeItem": _vm.removeItem
|
|
13277
|
+
})];
|
|
12705
13278
|
}, {
|
|
12706
13279
|
"item": _vm.item,
|
|
12707
13280
|
"index": _vm.index,
|
|
@@ -12710,35 +13283,43 @@ var _sfc_render$c = function render() {
|
|
|
12710
13283
|
"removeItem": _vm.removeItem
|
|
12711
13284
|
})], 2) : _vm.column.type == 'actions' ? _c('b-button-group', {
|
|
12712
13285
|
staticClass: "actions-button-group"
|
|
12713
|
-
}, [_vm._t("
|
|
12714
|
-
return [
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
13286
|
+
}, [_vm._t("rowActions", function () {
|
|
13287
|
+
return [_vm._t("rowAction", function () {
|
|
13288
|
+
return [_c('b-button', {
|
|
13289
|
+
attrs: {
|
|
13290
|
+
"variant": "primary"
|
|
13291
|
+
},
|
|
13292
|
+
on: {
|
|
13293
|
+
"click": function ($event) {
|
|
13294
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
13295
|
+
}
|
|
12721
13296
|
}
|
|
12722
|
-
}
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
13297
|
+
}, [_c('b-icon-eye')], 1), _c('b-button', {
|
|
13298
|
+
attrs: {
|
|
13299
|
+
"variant": "secondary"
|
|
13300
|
+
},
|
|
13301
|
+
on: {
|
|
13302
|
+
"click": function ($event) {
|
|
13303
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
13304
|
+
}
|
|
12730
13305
|
}
|
|
12731
|
-
}
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
13306
|
+
}, [_c('b-icon-pencil')], 1), _c('b-button', {
|
|
13307
|
+
attrs: {
|
|
13308
|
+
"variant": "danger"
|
|
13309
|
+
},
|
|
13310
|
+
on: {
|
|
13311
|
+
"click": function ($event) {
|
|
13312
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
13313
|
+
}
|
|
12739
13314
|
}
|
|
12740
|
-
}
|
|
12741
|
-
},
|
|
13315
|
+
}, [_c('b-icon-trash')], 1)];
|
|
13316
|
+
}, {
|
|
13317
|
+
"item": _vm.item,
|
|
13318
|
+
"index": _vm.index,
|
|
13319
|
+
"showItem": _vm.showItem,
|
|
13320
|
+
"updateItem": _vm.updateItem,
|
|
13321
|
+
"removeItem": _vm.removeItem
|
|
13322
|
+
})];
|
|
12742
13323
|
}, {
|
|
12743
13324
|
"item": _vm.item,
|
|
12744
13325
|
"index": _vm.index,
|
|
@@ -12748,7 +13329,7 @@ var _sfc_render$c = function render() {
|
|
|
12748
13329
|
})], 2) : _vm._e()], 2);
|
|
12749
13330
|
};
|
|
12750
13331
|
var _sfc_staticRenderFns$c = [];
|
|
12751
|
-
var __component__$c = /*#__PURE__*/normalizeComponent(_sfc_main$c, _sfc_render$c, _sfc_staticRenderFns$c, false, null, "
|
|
13332
|
+
var __component__$c = /*#__PURE__*/normalizeComponent(_sfc_main$c, _sfc_render$c, _sfc_staticRenderFns$c, false, null, "e38a3192", null, null);
|
|
12752
13333
|
var TableCell = __component__$c.exports;
|
|
12753
13334
|
|
|
12754
13335
|
const _sfc_main$b = {
|
|
@@ -12791,7 +13372,15 @@ var _sfc_render$b = function render() {
|
|
|
12791
13372
|
"item": _vm.item,
|
|
12792
13373
|
"index": _vm.index,
|
|
12793
13374
|
"columnIndex": indexc
|
|
12794
|
-
}
|
|
13375
|
+
},
|
|
13376
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
13377
|
+
return {
|
|
13378
|
+
key: name,
|
|
13379
|
+
fn: function (slotProps) {
|
|
13380
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
13381
|
+
}
|
|
13382
|
+
};
|
|
13383
|
+
})], null, true)
|
|
12795
13384
|
});
|
|
12796
13385
|
});
|
|
12797
13386
|
}, {
|
|
@@ -12814,12 +13403,24 @@ const _sfc_main$a = {
|
|
|
12814
13403
|
return {
|
|
12815
13404
|
drag: false
|
|
12816
13405
|
};
|
|
13406
|
+
},
|
|
13407
|
+
computed: {
|
|
13408
|
+
currentDisplayMode() {
|
|
13409
|
+
if (!this.displayMode) return 1;
|
|
13410
|
+
if (this.displayMode.value !== undefined) {
|
|
13411
|
+
return this.displayMode.value;
|
|
13412
|
+
}
|
|
13413
|
+
if (typeof this.displayMode === 'function') {
|
|
13414
|
+
return this.displayMode();
|
|
13415
|
+
}
|
|
13416
|
+
return this.displayMode;
|
|
13417
|
+
}
|
|
12817
13418
|
}
|
|
12818
13419
|
};
|
|
12819
13420
|
var _sfc_render$a = function render() {
|
|
12820
13421
|
var _vm = this,
|
|
12821
13422
|
_c = _vm._self._c;
|
|
12822
|
-
return _vm.
|
|
13423
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_TABLE ? _c('div', {
|
|
12823
13424
|
class: ['table-responsive', _vm.tableContainerClass]
|
|
12824
13425
|
}, [_c('table', {
|
|
12825
13426
|
class: ['table table-hover table-striped w-100', _vm.tableClass]
|
|
@@ -12855,7 +13456,15 @@ var _sfc_render$a = function render() {
|
|
|
12855
13456
|
"item": item,
|
|
12856
13457
|
"index": index,
|
|
12857
13458
|
"grouped": _vm.grouped
|
|
12858
|
-
}
|
|
13459
|
+
},
|
|
13460
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
13461
|
+
return {
|
|
13462
|
+
key: name,
|
|
13463
|
+
fn: function (slotProps) {
|
|
13464
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
13465
|
+
}
|
|
13466
|
+
};
|
|
13467
|
+
})], null, true)
|
|
12859
13468
|
});
|
|
12860
13469
|
}), 1)], 1), !_vm.loading && _vm.itemsList && _vm.itemsList.length == 0 && !_vm.infiniteScroll ? _c('p', {
|
|
12861
13470
|
staticClass: "p-3"
|
|
@@ -13116,10 +13725,49 @@ const _sfc_main$9 = {
|
|
|
13116
13725
|
cardHideFooter: Boolean,
|
|
13117
13726
|
itemValue: Function,
|
|
13118
13727
|
getStateValue: Function,
|
|
13728
|
+
getStateOptions: Function,
|
|
13729
|
+
getStateBadgeVariant: Function,
|
|
13119
13730
|
getArrayValue: Function,
|
|
13120
13731
|
showItem: Function,
|
|
13121
13732
|
updateItem: Function,
|
|
13122
13733
|
removeItem: Function
|
|
13734
|
+
},
|
|
13735
|
+
methods: {
|
|
13736
|
+
getStateOptionsForColumn(column, item) {
|
|
13737
|
+
if (column.type === 'state' && column.options) {
|
|
13738
|
+
return this.getStateOptions(this.itemValue(column, item), column.options);
|
|
13739
|
+
}
|
|
13740
|
+
return [];
|
|
13741
|
+
},
|
|
13742
|
+
formatNumber(value, column) {
|
|
13743
|
+
if (value === null || value === undefined || value === '') {
|
|
13744
|
+
return '';
|
|
13745
|
+
}
|
|
13746
|
+
const numValue = parseFloat(value);
|
|
13747
|
+
if (isNaN(numValue)) {
|
|
13748
|
+
return value;
|
|
13749
|
+
}
|
|
13750
|
+
const thousandsSep = column.thousandsSeparator || '.';
|
|
13751
|
+
const decimalSep = column.decimalSeparator || ',';
|
|
13752
|
+
const decimals = column.decimals !== undefined ? column.decimals : numValue % 1 === 0 ? 0 : 2;
|
|
13753
|
+
|
|
13754
|
+
// Formatear número con separadores
|
|
13755
|
+
const parts = numValue.toFixed(decimals).split('.');
|
|
13756
|
+
const integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSep);
|
|
13757
|
+
const decimalPart = parts[1] || '';
|
|
13758
|
+
if (decimals > 0 && decimalPart) {
|
|
13759
|
+
return `${integerPart}${decimalSep}${decimalPart}`;
|
|
13760
|
+
}
|
|
13761
|
+
return integerPart;
|
|
13762
|
+
},
|
|
13763
|
+
formatMoney(value, column) {
|
|
13764
|
+
const formatted = this.formatNumber(value, column);
|
|
13765
|
+
if (formatted === '') {
|
|
13766
|
+
return '';
|
|
13767
|
+
}
|
|
13768
|
+
const symbol = column.symbol || '$';
|
|
13769
|
+
return `${symbol}${formatted}`;
|
|
13770
|
+
}
|
|
13123
13771
|
}
|
|
13124
13772
|
};
|
|
13125
13773
|
var _sfc_render$9 = function render() {
|
|
@@ -13138,35 +13786,43 @@ var _sfc_render$9 = function render() {
|
|
|
13138
13786
|
scopedSlots: _vm._u([{
|
|
13139
13787
|
key: "footer",
|
|
13140
13788
|
fn: function () {
|
|
13141
|
-
return [_c('b-button-group', [_vm._t("
|
|
13142
|
-
return [
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13789
|
+
return [_c('b-button-group', [_vm._t("rowActions", function () {
|
|
13790
|
+
return [_vm._t("rowAction", function () {
|
|
13791
|
+
return [_c('b-button', {
|
|
13792
|
+
attrs: {
|
|
13793
|
+
"variant": "primary"
|
|
13794
|
+
},
|
|
13795
|
+
on: {
|
|
13796
|
+
"click": function ($event) {
|
|
13797
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
13798
|
+
}
|
|
13149
13799
|
}
|
|
13150
|
-
}
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13800
|
+
}, [_c('b-icon-eye')], 1), _c('b-button', {
|
|
13801
|
+
attrs: {
|
|
13802
|
+
"variant": "secondary"
|
|
13803
|
+
},
|
|
13804
|
+
on: {
|
|
13805
|
+
"click": function ($event) {
|
|
13806
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
13807
|
+
}
|
|
13158
13808
|
}
|
|
13159
|
-
}
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13809
|
+
}, [_c('b-icon-pencil')], 1), _c('b-button', {
|
|
13810
|
+
attrs: {
|
|
13811
|
+
"variant": "danger"
|
|
13812
|
+
},
|
|
13813
|
+
on: {
|
|
13814
|
+
"click": function ($event) {
|
|
13815
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
13816
|
+
}
|
|
13167
13817
|
}
|
|
13168
|
-
}
|
|
13169
|
-
},
|
|
13818
|
+
}, [_c('b-icon-trash')], 1)];
|
|
13819
|
+
}, {
|
|
13820
|
+
"item": _vm.item,
|
|
13821
|
+
"index": _vm.index,
|
|
13822
|
+
"showItem": _vm.showItem,
|
|
13823
|
+
"updateItem": _vm.updateItem,
|
|
13824
|
+
"removeItem": _vm.removeItem
|
|
13825
|
+
})];
|
|
13170
13826
|
}, {
|
|
13171
13827
|
"item": _vm.item,
|
|
13172
13828
|
"index": _vm.index,
|
|
@@ -13190,7 +13846,15 @@ var _sfc_render$9 = function render() {
|
|
|
13190
13846
|
attrs: {
|
|
13191
13847
|
"variant": "danger"
|
|
13192
13848
|
}
|
|
13193
|
-
}, [_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.
|
|
13849
|
+
}, [_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.getStateOptionsForColumn(column, _vm.item).length > 0 ? _vm._l(_vm.getStateOptionsForColumn(column, _vm.item), function (option, optIndex) {
|
|
13850
|
+
return _c('b-badge', {
|
|
13851
|
+
key: optIndex,
|
|
13852
|
+
staticClass: "mr-1",
|
|
13853
|
+
attrs: {
|
|
13854
|
+
"variant": _vm.getStateBadgeVariant(option)
|
|
13855
|
+
}
|
|
13856
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
13857
|
+
}) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, _vm.item)) + " ")])], 2) : column.type === 'array' ? _c('span', [_vm._v(" " + _vm._s(_vm.getArrayValue(_vm.itemValue(column, _vm.item), column.displayProp, column.options)) + " ")]) : column.type === 'money' || column.type === 'price' ? _c('span', [_vm._v(" " + _vm._s(_vm.formatMoney(_vm.itemValue(column, _vm.item), column)) + " ")]) : column.type === 'number' && (column.thousandsSeparator || column.decimalSeparator || column.decimals !== undefined) ? _c('span', [_vm._v(" " + _vm._s(_vm.formatNumber(_vm.itemValue(column, _vm.item), column)) + " ")]) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, _vm.item)) + " ")])];
|
|
13194
13858
|
}, {
|
|
13195
13859
|
"item": _vm.item,
|
|
13196
13860
|
"index": _vm.index,
|
|
@@ -13214,17 +13878,29 @@ const _sfc_main$8 = {
|
|
|
13214
13878
|
draggable,
|
|
13215
13879
|
ItemCard
|
|
13216
13880
|
},
|
|
13217
|
-
inject: ['displayMode', 'displayModes', 'items', 'draggableGroup', 'orderable', 'draggableOptions', 'itemsList', 'colLg', 'colXl', 'colMd', 'colSm', 'colXs', 'columns', 'cardClass', 'cardHideFooter', 'itemValue', 'getStateValue', 'getArrayValue', 'showItem', 'updateItem', 'removeItem', 'loading', 'infiniteScroll', 'messageEmptyResults', 'onSort', 'onDraggableAdded', 'onDraggableChange'],
|
|
13881
|
+
inject: ['displayMode', 'displayModes', 'items', 'draggableGroup', 'orderable', 'draggableOptions', 'itemsList', 'colLg', 'colXl', 'colMd', 'colSm', 'colXs', 'columns', 'cardClass', 'cardHideFooter', 'itemValue', 'getStateValue', 'getStateOptions', 'getStateBadgeVariant', 'getArrayValue', 'showItem', 'updateItem', 'removeItem', 'loading', 'infiniteScroll', 'messageEmptyResults', 'onSort', 'onDraggableAdded', 'onDraggableChange'],
|
|
13218
13882
|
data() {
|
|
13219
13883
|
return {
|
|
13220
13884
|
drag: false
|
|
13221
13885
|
};
|
|
13886
|
+
},
|
|
13887
|
+
computed: {
|
|
13888
|
+
currentDisplayMode() {
|
|
13889
|
+
if (!this.displayMode) return 1;
|
|
13890
|
+
if (this.displayMode.value !== undefined) {
|
|
13891
|
+
return this.displayMode.value;
|
|
13892
|
+
}
|
|
13893
|
+
if (typeof this.displayMode === 'function') {
|
|
13894
|
+
return this.displayMode();
|
|
13895
|
+
}
|
|
13896
|
+
return this.displayMode;
|
|
13897
|
+
}
|
|
13222
13898
|
}
|
|
13223
13899
|
};
|
|
13224
13900
|
var _sfc_render$8 = function render() {
|
|
13225
13901
|
var _vm = this,
|
|
13226
13902
|
_c = _vm._self._c;
|
|
13227
|
-
return _vm.
|
|
13903
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_CARDS ? _c('div', [_c('draggable', {
|
|
13228
13904
|
attrs: {
|
|
13229
13905
|
"group": _vm.draggableGroup,
|
|
13230
13906
|
"draggable": _vm.orderable ? '.item' : '.none',
|
|
@@ -13283,11 +13959,21 @@ var _sfc_render$8 = function render() {
|
|
|
13283
13959
|
"cardHideFooter": _vm.cardHideFooter,
|
|
13284
13960
|
"itemValue": _vm.itemValue,
|
|
13285
13961
|
"getStateValue": _vm.getStateValue,
|
|
13962
|
+
"getStateOptions": _vm.getStateOptions,
|
|
13963
|
+
"getStateBadgeVariant": _vm.getStateBadgeVariant,
|
|
13286
13964
|
"getArrayValue": _vm.getArrayValue,
|
|
13287
13965
|
"showItem": _vm.showItem,
|
|
13288
13966
|
"updateItem": _vm.updateItem,
|
|
13289
13967
|
"removeItem": _vm.removeItem
|
|
13290
|
-
}
|
|
13968
|
+
},
|
|
13969
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
13970
|
+
return {
|
|
13971
|
+
key: name,
|
|
13972
|
+
fn: function (slotProps) {
|
|
13973
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
13974
|
+
}
|
|
13975
|
+
};
|
|
13976
|
+
})], null, true)
|
|
13291
13977
|
})];
|
|
13292
13978
|
}, {
|
|
13293
13979
|
"item": item
|
|
@@ -13300,7 +13986,7 @@ var _sfc_staticRenderFns$8 = [];
|
|
|
13300
13986
|
var __component__$8 = /*#__PURE__*/normalizeComponent(_sfc_main$8, _sfc_render$8, _sfc_staticRenderFns$8, false, null, null, null, null);
|
|
13301
13987
|
var CrudCards = __component__$8.exports;
|
|
13302
13988
|
|
|
13303
|
-
var css$4 = "\n.kanban-card[data-v-
|
|
13989
|
+
var css$4 = "\n.kanban-card[data-v-ad923ee1] {\r\n background: #ffffff;\r\n border-radius: 4px;\r\n padding: 0.5rem;\r\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\r\n cursor: grab;\r\n transition: box-shadow 0.2s ease;\n}\n.kanban-card[data-v-ad923ee1]:hover {\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);\n}\n.kanban-card[data-v-ad923ee1]:active {\r\n cursor: grabbing;\n}\n.card-crud[data-v-ad923ee1] {\r\n border: 1px solid #e1e5e9;\n}\n.card-crud .card-title[data-v-ad923ee1] {\r\n font-size: 0.9rem;\r\n margin-bottom: 0.5rem;\n}\n.card-crud .card-text[data-v-ad923ee1] {\r\n font-size: 0.8rem;\r\n margin-bottom: 0.25rem;\n}\r\n";
|
|
13304
13990
|
n(css$4, {});
|
|
13305
13991
|
|
|
13306
13992
|
const _sfc_main$7 = {
|
|
@@ -13313,10 +13999,49 @@ const _sfc_main$7 = {
|
|
|
13313
13999
|
cardHideFooter: Boolean,
|
|
13314
14000
|
itemValue: Function,
|
|
13315
14001
|
getStateValue: Function,
|
|
14002
|
+
getStateOptions: Function,
|
|
14003
|
+
getStateBadgeVariant: Function,
|
|
13316
14004
|
getArrayValue: Function,
|
|
13317
14005
|
showItem: Function,
|
|
13318
14006
|
updateItem: Function,
|
|
13319
14007
|
removeItem: Function
|
|
14008
|
+
},
|
|
14009
|
+
methods: {
|
|
14010
|
+
getStateOptionsForColumn(column, item) {
|
|
14011
|
+
if (column.type === 'state' && column.options) {
|
|
14012
|
+
return this.getStateOptions(this.itemValue(column, item), column.options);
|
|
14013
|
+
}
|
|
14014
|
+
return [];
|
|
14015
|
+
},
|
|
14016
|
+
formatNumber(value, column) {
|
|
14017
|
+
if (value === null || value === undefined || value === '') {
|
|
14018
|
+
return '';
|
|
14019
|
+
}
|
|
14020
|
+
const numValue = parseFloat(value);
|
|
14021
|
+
if (isNaN(numValue)) {
|
|
14022
|
+
return value;
|
|
14023
|
+
}
|
|
14024
|
+
const thousandsSep = column.thousandsSeparator || '.';
|
|
14025
|
+
const decimalSep = column.decimalSeparator || ',';
|
|
14026
|
+
const decimals = column.decimals !== undefined ? column.decimals : numValue % 1 === 0 ? 0 : 2;
|
|
14027
|
+
|
|
14028
|
+
// Formatear número con separadores
|
|
14029
|
+
const parts = numValue.toFixed(decimals).split('.');
|
|
14030
|
+
const integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSep);
|
|
14031
|
+
const decimalPart = parts[1] || '';
|
|
14032
|
+
if (decimals > 0 && decimalPart) {
|
|
14033
|
+
return `${integerPart}${decimalSep}${decimalPart}`;
|
|
14034
|
+
}
|
|
14035
|
+
return integerPart;
|
|
14036
|
+
},
|
|
14037
|
+
formatMoney(value, column) {
|
|
14038
|
+
const formatted = this.formatNumber(value, column);
|
|
14039
|
+
if (formatted === '') {
|
|
14040
|
+
return '';
|
|
14041
|
+
}
|
|
14042
|
+
const symbol = column.symbol || '$';
|
|
14043
|
+
return `${symbol}${formatted}`;
|
|
14044
|
+
}
|
|
13320
14045
|
}
|
|
13321
14046
|
};
|
|
13322
14047
|
var _sfc_render$7 = function render() {
|
|
@@ -13339,35 +14064,43 @@ var _sfc_render$7 = function render() {
|
|
|
13339
14064
|
attrs: {
|
|
13340
14065
|
"size": "sm"
|
|
13341
14066
|
}
|
|
13342
|
-
}, [_vm._t("
|
|
13343
|
-
return [
|
|
13344
|
-
|
|
13345
|
-
|
|
13346
|
-
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
|
|
14067
|
+
}, [_vm._t("rowActions", function () {
|
|
14068
|
+
return [_vm._t("rowAction", function () {
|
|
14069
|
+
return [_c('b-button', {
|
|
14070
|
+
attrs: {
|
|
14071
|
+
"variant": "primary"
|
|
14072
|
+
},
|
|
14073
|
+
on: {
|
|
14074
|
+
"click": function ($event) {
|
|
14075
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
14076
|
+
}
|
|
13350
14077
|
}
|
|
13351
|
-
}
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
14078
|
+
}, [_c('b-icon-eye')], 1), _c('b-button', {
|
|
14079
|
+
attrs: {
|
|
14080
|
+
"variant": "secondary"
|
|
14081
|
+
},
|
|
14082
|
+
on: {
|
|
14083
|
+
"click": function ($event) {
|
|
14084
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
14085
|
+
}
|
|
13359
14086
|
}
|
|
13360
|
-
}
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
14087
|
+
}, [_c('b-icon-pencil')], 1), _c('b-button', {
|
|
14088
|
+
attrs: {
|
|
14089
|
+
"variant": "danger"
|
|
14090
|
+
},
|
|
14091
|
+
on: {
|
|
14092
|
+
"click": function ($event) {
|
|
14093
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
14094
|
+
}
|
|
13368
14095
|
}
|
|
13369
|
-
}
|
|
13370
|
-
},
|
|
14096
|
+
}, [_c('b-icon-trash')], 1)];
|
|
14097
|
+
}, {
|
|
14098
|
+
"item": _vm.item,
|
|
14099
|
+
"index": _vm.index,
|
|
14100
|
+
"showItem": _vm.showItem,
|
|
14101
|
+
"updateItem": _vm.updateItem,
|
|
14102
|
+
"removeItem": _vm.removeItem
|
|
14103
|
+
})];
|
|
13371
14104
|
}, {
|
|
13372
14105
|
"item": _vm.item,
|
|
13373
14106
|
"index": _vm.index,
|
|
@@ -13395,7 +14128,15 @@ var _sfc_render$7 = function render() {
|
|
|
13395
14128
|
attrs: {
|
|
13396
14129
|
"variant": "danger"
|
|
13397
14130
|
}
|
|
13398
|
-
}, [_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.
|
|
14131
|
+
}, [_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.getStateOptionsForColumn(column, _vm.item).length > 0 ? _vm._l(_vm.getStateOptionsForColumn(column, _vm.item), function (option, optIndex) {
|
|
14132
|
+
return _c('b-badge', {
|
|
14133
|
+
key: optIndex,
|
|
14134
|
+
staticClass: "mr-1",
|
|
14135
|
+
attrs: {
|
|
14136
|
+
"variant": _vm.getStateBadgeVariant(option)
|
|
14137
|
+
}
|
|
14138
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
14139
|
+
}) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, _vm.item)) + " ")])], 2) : column.type === 'array' ? _c('span', [_vm._v(" " + _vm._s(_vm.getArrayValue(_vm.itemValue(column, _vm.item), column.displayProp, column.options)) + " ")]) : column.type === 'money' || column.type === 'price' ? _c('span', [_vm._v(" " + _vm._s(_vm.formatMoney(_vm.itemValue(column, _vm.item), column)) + " ")]) : column.type === 'number' && (column.thousandsSeparator || column.decimalSeparator || column.decimals !== undefined) ? _c('span', [_vm._v(" " + _vm._s(_vm.formatNumber(_vm.itemValue(column, _vm.item), column)) + " ")]) : _c('span', [_vm._v(" " + _vm._s(_vm.itemValue(column, _vm.item)) + " ")])];
|
|
13399
14140
|
}, {
|
|
13400
14141
|
"item": _vm.item,
|
|
13401
14142
|
"index": _vm.index,
|
|
@@ -13408,10 +14149,10 @@ var _sfc_render$7 = function render() {
|
|
|
13408
14149
|
})], 2)], 1);
|
|
13409
14150
|
};
|
|
13410
14151
|
var _sfc_staticRenderFns$7 = [];
|
|
13411
|
-
var __component__$7 = /*#__PURE__*/normalizeComponent(_sfc_main$7, _sfc_render$7, _sfc_staticRenderFns$7, false, null, "
|
|
14152
|
+
var __component__$7 = /*#__PURE__*/normalizeComponent(_sfc_main$7, _sfc_render$7, _sfc_staticRenderFns$7, false, null, "ad923ee1", null, null);
|
|
13412
14153
|
var KanbanCard = __component__$7.exports;
|
|
13413
14154
|
|
|
13414
|
-
var css$3 = "\n.kanban-column[data-v-
|
|
14155
|
+
var css$3 = "\n.kanban-column[data-v-a56cf649] {\r\n background: #f4f5f7;\r\n border-radius: 8px;\r\n width: 300px;\r\n display: flex;\r\n flex-direction: column;\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n.kanban-column-header[data-v-a56cf649] {\r\n font-weight: bold;\r\n padding: 0.5rem;\r\n background: #dfe1e6;\r\n border-radius: 8px 8px 0 0;\r\n text-align: center;\n}\n.kanban-column-body[data-v-a56cf649] {\r\n padding: 0.5rem;\r\n min-height: 100px;\r\n background: #ffffff;\r\n border-radius: 0 0 8px 8px;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.5rem;\n}\r\n";
|
|
13415
14156
|
n(css$3, {});
|
|
13416
14157
|
|
|
13417
14158
|
const _sfc_main$6 = {
|
|
@@ -13427,6 +14168,8 @@ const _sfc_main$6 = {
|
|
|
13427
14168
|
columns: Array,
|
|
13428
14169
|
itemValue: Function,
|
|
13429
14170
|
getStateValue: Function,
|
|
14171
|
+
getStateOptions: Function,
|
|
14172
|
+
getStateBadgeVariant: Function,
|
|
13430
14173
|
getArrayValue: Function,
|
|
13431
14174
|
showItem: Function,
|
|
13432
14175
|
updateItem: Function,
|
|
@@ -13495,11 +14238,21 @@ var _sfc_render$6 = function render() {
|
|
|
13495
14238
|
"cardHideFooter": _vm.cardHideFooter,
|
|
13496
14239
|
"itemValue": _vm.itemValue,
|
|
13497
14240
|
"getStateValue": _vm.getStateValue,
|
|
14241
|
+
"getStateOptions": _vm.getStateOptions,
|
|
14242
|
+
"getStateBadgeVariant": _vm.getStateBadgeVariant,
|
|
13498
14243
|
"getArrayValue": _vm.getArrayValue,
|
|
13499
14244
|
"showItem": _vm.showItem,
|
|
13500
14245
|
"updateItem": _vm.updateItem,
|
|
13501
14246
|
"removeItem": _vm.removeItem
|
|
13502
|
-
}
|
|
14247
|
+
},
|
|
14248
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
14249
|
+
return {
|
|
14250
|
+
key: name,
|
|
14251
|
+
fn: function (slotProps) {
|
|
14252
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
14253
|
+
}
|
|
14254
|
+
};
|
|
14255
|
+
})], null, true)
|
|
13503
14256
|
})];
|
|
13504
14257
|
}, {
|
|
13505
14258
|
"item": item
|
|
@@ -13507,10 +14260,10 @@ var _sfc_render$6 = function render() {
|
|
|
13507
14260
|
}), 0)], 1);
|
|
13508
14261
|
};
|
|
13509
14262
|
var _sfc_staticRenderFns$6 = [];
|
|
13510
|
-
var __component__$6 = /*#__PURE__*/normalizeComponent(_sfc_main$6, _sfc_render$6, _sfc_staticRenderFns$6, false, null, "
|
|
14263
|
+
var __component__$6 = /*#__PURE__*/normalizeComponent(_sfc_main$6, _sfc_render$6, _sfc_staticRenderFns$6, false, null, "a56cf649", null, null);
|
|
13511
14264
|
var KanbanColumn = __component__$6.exports;
|
|
13512
14265
|
|
|
13513
|
-
var css$2 = "\n.kanban-board[data-v-
|
|
14266
|
+
var css$2 = "\n.kanban-board[data-v-516ff294] {\r\n display: flex;\r\n gap: 1rem;\r\n overflow-x: auto;\r\n padding: 1rem;\n}\n.kanban-column[data-v-516ff294] {\r\n background: #f4f5f7;\r\n border-radius: 8px;\r\n width: 300px;\r\n display: flex;\r\n flex-direction: column;\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\r\n min-width: 300px;\n}\r\n";
|
|
13514
14267
|
n(css$2, {});
|
|
13515
14268
|
|
|
13516
14269
|
const _sfc_main$5 = {
|
|
@@ -13518,7 +14271,7 @@ const _sfc_main$5 = {
|
|
|
13518
14271
|
components: {
|
|
13519
14272
|
KanbanColumn
|
|
13520
14273
|
},
|
|
13521
|
-
inject: ['items', 'groupedAttribute', 'columns', 'itemValue', 'getStateValue', 'getArrayValue', 'showItem', 'updateItem', 'removeItem', 'cardClass', 'cardHideFooter', 'onDraggableChange']
|
|
14274
|
+
inject: ['items', 'groupedAttribute', 'columns', 'itemValue', 'getStateValue', 'getStateOptions', 'getStateBadgeVariant', 'getArrayValue', 'showItem', 'updateItem', 'removeItem', 'cardClass', 'cardHideFooter', 'onDraggableChange']
|
|
13522
14275
|
};
|
|
13523
14276
|
var _sfc_render$5 = function render() {
|
|
13524
14277
|
var _vm = this,
|
|
@@ -13537,6 +14290,8 @@ var _sfc_render$5 = function render() {
|
|
|
13537
14290
|
"columns": _vm.columns,
|
|
13538
14291
|
"itemValue": _vm.itemValue,
|
|
13539
14292
|
"getStateValue": _vm.getStateValue,
|
|
14293
|
+
"getStateOptions": _vm.getStateOptions,
|
|
14294
|
+
"getStateBadgeVariant": _vm.getStateBadgeVariant,
|
|
13540
14295
|
"getArrayValue": _vm.getArrayValue,
|
|
13541
14296
|
"showItem": _vm.showItem,
|
|
13542
14297
|
"updateItem": _vm.updateItem,
|
|
@@ -13546,12 +14301,20 @@ var _sfc_render$5 = function render() {
|
|
|
13546
14301
|
},
|
|
13547
14302
|
on: {
|
|
13548
14303
|
"draggableChange": _vm.onDraggableChange
|
|
13549
|
-
}
|
|
14304
|
+
},
|
|
14305
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
14306
|
+
return {
|
|
14307
|
+
key: name,
|
|
14308
|
+
fn: function (slotProps) {
|
|
14309
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
14310
|
+
}
|
|
14311
|
+
};
|
|
14312
|
+
})], null, true)
|
|
13550
14313
|
})], 1);
|
|
13551
14314
|
}), 0);
|
|
13552
14315
|
};
|
|
13553
14316
|
var _sfc_staticRenderFns$5 = [];
|
|
13554
|
-
var __component__$5 = /*#__PURE__*/normalizeComponent(_sfc_main$5, _sfc_render$5, _sfc_staticRenderFns$5, false, null, "
|
|
14317
|
+
var __component__$5 = /*#__PURE__*/normalizeComponent(_sfc_main$5, _sfc_render$5, _sfc_staticRenderFns$5, false, null, "516ff294", null, null);
|
|
13555
14318
|
var KanbanBoard = __component__$5.exports;
|
|
13556
14319
|
|
|
13557
14320
|
const _sfc_main$4 = {
|
|
@@ -13559,12 +14322,33 @@ const _sfc_main$4 = {
|
|
|
13559
14322
|
components: {
|
|
13560
14323
|
KanbanBoard
|
|
13561
14324
|
},
|
|
13562
|
-
inject: ['displayMode', 'displayModes']
|
|
14325
|
+
inject: ['displayMode', 'displayModes'],
|
|
14326
|
+
computed: {
|
|
14327
|
+
currentDisplayMode() {
|
|
14328
|
+
if (!this.displayMode) return 1;
|
|
14329
|
+
if (this.displayMode.value !== undefined) {
|
|
14330
|
+
return this.displayMode.value;
|
|
14331
|
+
}
|
|
14332
|
+
if (typeof this.displayMode === 'function') {
|
|
14333
|
+
return this.displayMode();
|
|
14334
|
+
}
|
|
14335
|
+
return this.displayMode;
|
|
14336
|
+
}
|
|
14337
|
+
}
|
|
13563
14338
|
};
|
|
13564
14339
|
var _sfc_render$4 = function render() {
|
|
13565
14340
|
var _vm = this,
|
|
13566
14341
|
_c = _vm._self._c;
|
|
13567
|
-
return _vm.
|
|
14342
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_KANBAN ? _c('div', [_c('KanbanBoard', {
|
|
14343
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
14344
|
+
return {
|
|
14345
|
+
key: name,
|
|
14346
|
+
fn: function (slotProps) {
|
|
14347
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
14348
|
+
}
|
|
14349
|
+
};
|
|
14350
|
+
})], null, true)
|
|
14351
|
+
})], 1) : _vm._e();
|
|
13568
14352
|
};
|
|
13569
14353
|
var _sfc_staticRenderFns$4 = [];
|
|
13570
14354
|
var __component__$4 = /*#__PURE__*/normalizeComponent(_sfc_main$4, _sfc_render$4, _sfc_staticRenderFns$4, false, null, null, null, null);
|
|
@@ -13572,12 +14356,24 @@ var CrudKanban = __component__$4.exports;
|
|
|
13572
14356
|
|
|
13573
14357
|
const _sfc_main$3 = {
|
|
13574
14358
|
name: 'CrudCustom',
|
|
13575
|
-
inject: ['displayMode', 'displayModes', 'listContainerClass', 'listItemClass', 'loading', 'items', 'infiniteScroll', 'messageEmptyResults', 'itemsList']
|
|
14359
|
+
inject: ['displayMode', 'displayModes', 'listContainerClass', 'listItemClass', 'loading', 'items', 'infiniteScroll', 'messageEmptyResults', 'itemsList'],
|
|
14360
|
+
computed: {
|
|
14361
|
+
currentDisplayMode() {
|
|
14362
|
+
if (!this.displayMode) return 1;
|
|
14363
|
+
if (this.displayMode.value !== undefined) {
|
|
14364
|
+
return this.displayMode.value;
|
|
14365
|
+
}
|
|
14366
|
+
if (typeof this.displayMode === 'function') {
|
|
14367
|
+
return this.displayMode();
|
|
14368
|
+
}
|
|
14369
|
+
return this.displayMode;
|
|
14370
|
+
}
|
|
14371
|
+
}
|
|
13576
14372
|
};
|
|
13577
14373
|
var _sfc_render$3 = function render() {
|
|
13578
14374
|
var _vm = this,
|
|
13579
14375
|
_c = _vm._self._c;
|
|
13580
|
-
return _vm.
|
|
14376
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_CUSTOM ? _c('div', [_c('div', {
|
|
13581
14377
|
class: _vm.listContainerClass
|
|
13582
14378
|
}, [!_vm.loading && _vm.itemsList && _vm.itemsList.length == 0 && !_vm.infiniteScroll ? _c('p', {
|
|
13583
14379
|
staticClass: "p-3"
|
|
@@ -13596,7 +14392,28 @@ var CrudCustom = __component__$3.exports;
|
|
|
13596
14392
|
|
|
13597
14393
|
const _sfc_main$2 = {
|
|
13598
14394
|
name: 'CrudModals',
|
|
13599
|
-
inject: ['modelName', 'title', 'loading', 'validate', 'item', 'messageSave', 'showImport', 'showExport', 'fileImport', 'selectedItems', 'exportFormat', 'saveItem', 'importItems', 'exportItems']
|
|
14395
|
+
inject: ['modelName', 'title', 'loading', 'validate', 'item', 'getItem', 'messageSave', 'showImport', 'showExport', 'fileImport', 'selectedItems', 'exportFormat', 'saveItem', 'importItems', 'exportItems'],
|
|
14396
|
+
computed: {
|
|
14397
|
+
// Computed property para asegurar reactividad del item inyectado
|
|
14398
|
+
reactiveItem() {
|
|
14399
|
+
// Si hay una función getItem, usarla para obtener el item actual
|
|
14400
|
+
if (this.getItem && typeof this.getItem === 'function') {
|
|
14401
|
+
return this.getItem();
|
|
14402
|
+
}
|
|
14403
|
+
// Si no, usar el item inyectado directamente
|
|
14404
|
+
return this.item;
|
|
14405
|
+
}
|
|
14406
|
+
},
|
|
14407
|
+
watch: {
|
|
14408
|
+
// Watch el item inyectado para forzar actualización
|
|
14409
|
+
item: {
|
|
14410
|
+
handler() {
|
|
14411
|
+
this.$forceUpdate();
|
|
14412
|
+
},
|
|
14413
|
+
deep: true,
|
|
14414
|
+
immediate: true
|
|
14415
|
+
}
|
|
14416
|
+
}
|
|
13600
14417
|
};
|
|
13601
14418
|
var _sfc_render$2 = function render() {
|
|
13602
14419
|
var _vm = this,
|
|
@@ -13618,7 +14435,7 @@ var _sfc_render$2 = function render() {
|
|
|
13618
14435
|
on: {
|
|
13619
14436
|
"submit": _vm.saveItem
|
|
13620
14437
|
}
|
|
13621
|
-
}, [_vm.
|
|
14438
|
+
}, [_vm.reactiveItem ? [_vm._t("form", function () {
|
|
13622
14439
|
return [_c('b-form-group', {
|
|
13623
14440
|
attrs: {
|
|
13624
14441
|
"label": "Nombre:",
|
|
@@ -13631,16 +14448,16 @@ var _sfc_render$2 = function render() {
|
|
|
13631
14448
|
"placeholder": "Nombre"
|
|
13632
14449
|
},
|
|
13633
14450
|
model: {
|
|
13634
|
-
value: _vm.
|
|
14451
|
+
value: _vm.reactiveItem.title,
|
|
13635
14452
|
callback: function ($$v) {
|
|
13636
|
-
_vm.$set(_vm.
|
|
14453
|
+
_vm.$set(_vm.reactiveItem, "title", $$v);
|
|
13637
14454
|
},
|
|
13638
|
-
expression: "
|
|
14455
|
+
expression: "reactiveItem.title"
|
|
13639
14456
|
}
|
|
13640
14457
|
})], 1)];
|
|
13641
14458
|
}, {
|
|
13642
|
-
"item": _vm.
|
|
13643
|
-
}) : _vm._e(), _c('b-button', {
|
|
14459
|
+
"item": _vm.reactiveItem
|
|
14460
|
+
})] : _vm._e(), _c('b-button', {
|
|
13644
14461
|
attrs: {
|
|
13645
14462
|
"block": "",
|
|
13646
14463
|
"type": "submit",
|
|
@@ -13651,8 +14468,8 @@ var _sfc_render$2 = function render() {
|
|
|
13651
14468
|
attrs: {
|
|
13652
14469
|
"small": ""
|
|
13653
14470
|
}
|
|
13654
|
-
}) : _vm._e(), _vm._v(_vm._s(_vm.messageSave) + " ")], 1)], 2)] : _vm._e(), !_vm.validate ? [_vm.
|
|
13655
|
-
return _vm._l(_vm.
|
|
14471
|
+
}) : _vm._e(), _vm._v(_vm._s(_vm.messageSave) + " ")], 1)], 2)] : _vm._e(), !_vm.validate ? [_vm.reactiveItem ? [_vm._t("form", function () {
|
|
14472
|
+
return _vm._l(_vm.reactiveItem, function (value, key) {
|
|
13656
14473
|
return _c('b-form-group', {
|
|
13657
14474
|
key: key,
|
|
13658
14475
|
attrs: {
|
|
@@ -13664,17 +14481,17 @@ var _sfc_render$2 = function render() {
|
|
|
13664
14481
|
"required": ""
|
|
13665
14482
|
},
|
|
13666
14483
|
model: {
|
|
13667
|
-
value: _vm.
|
|
14484
|
+
value: _vm.reactiveItem[key],
|
|
13668
14485
|
callback: function ($$v) {
|
|
13669
|
-
_vm.$set(_vm.
|
|
14486
|
+
_vm.$set(_vm.reactiveItem, key, $$v);
|
|
13670
14487
|
},
|
|
13671
|
-
expression: "
|
|
14488
|
+
expression: "reactiveItem[key]"
|
|
13672
14489
|
}
|
|
13673
14490
|
})], 1);
|
|
13674
14491
|
});
|
|
13675
14492
|
}, {
|
|
13676
|
-
"item": _vm.
|
|
13677
|
-
}) : _vm._e(), _c('b-button', {
|
|
14493
|
+
"item": _vm.reactiveItem
|
|
14494
|
+
})] : _vm._e(), _c('b-button', {
|
|
13678
14495
|
attrs: {
|
|
13679
14496
|
"block": "",
|
|
13680
14497
|
"type": "submit",
|
|
@@ -13698,8 +14515,8 @@ var _sfc_render$2 = function render() {
|
|
|
13698
14515
|
"title": _vm.title,
|
|
13699
14516
|
"no-close-on-backdrop": ""
|
|
13700
14517
|
}
|
|
13701
|
-
}, [_vm.
|
|
13702
|
-
return [_c('b-list-group', _vm._l(_vm.
|
|
14518
|
+
}, [_vm.reactiveItem ? [_vm._t("show", function () {
|
|
14519
|
+
return [_c('b-list-group', _vm._l(_vm.reactiveItem, function (value, key) {
|
|
13703
14520
|
return _c('b-list-group-item', {
|
|
13704
14521
|
key: key
|
|
13705
14522
|
}, [_c('b-row', {
|
|
@@ -13716,8 +14533,8 @@ var _sfc_render$2 = function render() {
|
|
|
13716
14533
|
}, [_vm._v(_vm._s(JSON.stringify(value)))])], 1)], 1);
|
|
13717
14534
|
}), 1)];
|
|
13718
14535
|
}, {
|
|
13719
|
-
"item": _vm.
|
|
13720
|
-
}) : _vm._e()], 2), _vm.showImport ? _c('b-modal', {
|
|
14536
|
+
"item": _vm.reactiveItem
|
|
14537
|
+
})] : _vm._e()], 2), _vm.showImport ? _c('b-modal', {
|
|
13721
14538
|
ref: "modal-import",
|
|
13722
14539
|
attrs: {
|
|
13723
14540
|
"title": "Importar",
|
|
@@ -13982,6 +14799,12 @@ var crudData = {
|
|
|
13982
14799
|
filterSidebarOpen: false,
|
|
13983
14800
|
internalFilters: [],
|
|
13984
14801
|
forceRecomputeCounter: 0,
|
|
14802
|
+
_displayMode: 1,
|
|
14803
|
+
// Propiedad local para displayMode (se inicializará desde la prop en created())
|
|
14804
|
+
displayModeReactive: Vue.observable({
|
|
14805
|
+
value: 1
|
|
14806
|
+
}),
|
|
14807
|
+
// Objeto reactivo para provide/inject
|
|
13985
14808
|
displayModes: {
|
|
13986
14809
|
MODE_TABLE: 1,
|
|
13987
14810
|
MODE_CARDS: 2,
|
|
@@ -14012,7 +14835,7 @@ var crudData = {
|
|
|
14012
14835
|
if (this.groupedSplit) {
|
|
14013
14836
|
return true;
|
|
14014
14837
|
}
|
|
14015
|
-
return this.
|
|
14838
|
+
return this._displayMode == this.displayModes.MODE_KANBAN;
|
|
14016
14839
|
},
|
|
14017
14840
|
itemsList() {
|
|
14018
14841
|
const items = this.ajax ? this.items : this.items.slice(this.paginationIndexStart, this.paginationIndexEnd);
|
|
@@ -14054,7 +14877,15 @@ var crudData = {
|
|
|
14054
14877
|
this.internalFilters.forEach(f => {
|
|
14055
14878
|
if (f.value) {
|
|
14056
14879
|
let colname = f.column.replace("_sort", "").replace("_from", "").replace("_to", "");
|
|
14057
|
-
|
|
14880
|
+
let op = f.op;
|
|
14881
|
+
|
|
14882
|
+
// Aplicar operadores automáticamente para filtros de rango
|
|
14883
|
+
if (f.column.endsWith("_from")) {
|
|
14884
|
+
op = ">=";
|
|
14885
|
+
} else if (f.column.endsWith("_to")) {
|
|
14886
|
+
op = "<=";
|
|
14887
|
+
}
|
|
14888
|
+
filter.push([colname, op, f.value]);
|
|
14058
14889
|
}
|
|
14059
14890
|
});
|
|
14060
14891
|
return filter;
|
|
@@ -14094,7 +14925,23 @@ var crudData = {
|
|
|
14094
14925
|
this.fetchItems();
|
|
14095
14926
|
}
|
|
14096
14927
|
},
|
|
14097
|
-
displayMode()
|
|
14928
|
+
// Watcher para la prop displayMode (sincroniza cuando cambia desde el componente padre)
|
|
14929
|
+
displayMode(newVal) {
|
|
14930
|
+
// Usar $props para acceder a la prop y evitar conflictos con data properties
|
|
14931
|
+
const propValue = this.$props && this.$props.displayMode !== undefined ? this.$props.displayMode : newVal;
|
|
14932
|
+
if (propValue !== undefined && this._displayMode !== propValue) {
|
|
14933
|
+
this._displayMode = propValue;
|
|
14934
|
+
if (this.displayModeReactive) {
|
|
14935
|
+
this.displayModeReactive.value = propValue;
|
|
14936
|
+
}
|
|
14937
|
+
}
|
|
14938
|
+
},
|
|
14939
|
+
// Watcher para la propiedad local _displayMode (para forzar re-renderizado)
|
|
14940
|
+
_displayMode(newVal) {
|
|
14941
|
+
// Actualizar el objeto reactivo si existe
|
|
14942
|
+
if (this.displayModeReactive) {
|
|
14943
|
+
this.displayModeReactive.value = newVal;
|
|
14944
|
+
}
|
|
14098
14945
|
// Forzar re-renderizado cuando cambia el modo de visualización
|
|
14099
14946
|
this.$nextTick(() => {
|
|
14100
14947
|
this.forceRecomputeCounter++;
|
|
@@ -14154,6 +15001,13 @@ var crudData = {
|
|
|
14154
15001
|
deep: true
|
|
14155
15002
|
}
|
|
14156
15003
|
},
|
|
15004
|
+
created() {
|
|
15005
|
+
// Inicializar _displayMode desde la prop displayMode en created() para que esté disponible en provide()
|
|
15006
|
+
if (this.$props && this.$props.displayMode !== undefined) {
|
|
15007
|
+
this._displayMode = this.$props.displayMode;
|
|
15008
|
+
this.displayModeReactive.value = this._displayMode;
|
|
15009
|
+
}
|
|
15010
|
+
},
|
|
14157
15011
|
mounted() {
|
|
14158
15012
|
const now = Math.floor(Date.now() / 1000);
|
|
14159
15013
|
this.crudUuid = '' + now;
|
|
@@ -19501,7 +20355,7 @@ var crudApi = {
|
|
|
19501
20355
|
dataKey: 'data',
|
|
19502
20356
|
params: {
|
|
19503
20357
|
page: page,
|
|
19504
|
-
limit: this.pagination.
|
|
20358
|
+
limit: this.pagination.per_page,
|
|
19505
20359
|
filters: JSON.stringify(this.finalFilters)
|
|
19506
20360
|
}
|
|
19507
20361
|
});
|
|
@@ -19535,7 +20389,7 @@ var crudApi = {
|
|
|
19535
20389
|
return axios.get(this.apiUrl + "/" + this.modelName, {
|
|
19536
20390
|
params: {
|
|
19537
20391
|
page: page,
|
|
19538
|
-
limit: this.
|
|
20392
|
+
limit: this.pagination.per_page,
|
|
19539
20393
|
filters: JSON.stringify(this.finalFilters)
|
|
19540
20394
|
}
|
|
19541
20395
|
}).then(response => {
|
|
@@ -20025,15 +20879,15 @@ var crudFilters = {
|
|
|
20025
20879
|
setupFilters() {
|
|
20026
20880
|
this.columns.forEach(column => {
|
|
20027
20881
|
if (this.isColumnHasFilter(column)) {
|
|
20028
|
-
if (column.type == "date") {
|
|
20882
|
+
if (column.type == "date" || column.type == "number" || column.type == "money") {
|
|
20029
20883
|
this.internalFilters.push({
|
|
20030
20884
|
column: column.prop + "_from",
|
|
20031
|
-
op:
|
|
20885
|
+
op: ">=",
|
|
20032
20886
|
value: null
|
|
20033
20887
|
});
|
|
20034
20888
|
this.internalFilters.push({
|
|
20035
20889
|
column: column.prop + "_to",
|
|
20036
|
-
op:
|
|
20890
|
+
op: "<=",
|
|
20037
20891
|
value: null
|
|
20038
20892
|
});
|
|
20039
20893
|
} else {
|
|
@@ -20052,6 +20906,46 @@ var crudFilters = {
|
|
|
20052
20906
|
});
|
|
20053
20907
|
}
|
|
20054
20908
|
});
|
|
20909
|
+
|
|
20910
|
+
// Procesar filtros custom
|
|
20911
|
+
if (this.customFilters && Array.isArray(this.customFilters)) {
|
|
20912
|
+
this.customFilters.forEach(customFilter => {
|
|
20913
|
+
if (this.isCustomFilterEnabled(customFilter)) {
|
|
20914
|
+
// Si el tipo es función (callback), no procesamos automáticamente
|
|
20915
|
+
// El callback se encargará del renderizado y gestión del filtro
|
|
20916
|
+
if (typeof customFilter.type === 'string') {
|
|
20917
|
+
if (customFilter.type == "date" || customFilter.type == "number" || customFilter.type == "money") {
|
|
20918
|
+
this.internalFilters.push({
|
|
20919
|
+
column: customFilter.prop + "_from",
|
|
20920
|
+
op: ">=",
|
|
20921
|
+
value: null
|
|
20922
|
+
});
|
|
20923
|
+
this.internalFilters.push({
|
|
20924
|
+
column: customFilter.prop + "_to",
|
|
20925
|
+
op: "<=",
|
|
20926
|
+
value: null
|
|
20927
|
+
});
|
|
20928
|
+
} else {
|
|
20929
|
+
this.internalFilters.push({
|
|
20930
|
+
column: customFilter.prop,
|
|
20931
|
+
op: customFilter.filterOp ? customFilter.filterOp : "=",
|
|
20932
|
+
value: null
|
|
20933
|
+
});
|
|
20934
|
+
}
|
|
20935
|
+
} else if (typeof customFilter.type === 'function') {
|
|
20936
|
+
// Para callbacks, solo creamos el filtro interno si no existe
|
|
20937
|
+
// El callback se encargará del renderizado
|
|
20938
|
+
if (!this.internalFilterByProp(customFilter.prop)) {
|
|
20939
|
+
this.internalFilters.push({
|
|
20940
|
+
column: customFilter.prop,
|
|
20941
|
+
op: customFilter.filterOp ? customFilter.filterOp : "=",
|
|
20942
|
+
value: null
|
|
20943
|
+
});
|
|
20944
|
+
}
|
|
20945
|
+
}
|
|
20946
|
+
}
|
|
20947
|
+
});
|
|
20948
|
+
}
|
|
20055
20949
|
},
|
|
20056
20950
|
toggleSortFilter(column) {
|
|
20057
20951
|
let value = this.internalFilterByProp(column.prop + "_sort").value;
|
|
@@ -20070,6 +20964,11 @@ var crudFilters = {
|
|
|
20070
20964
|
toggleFilters() {
|
|
20071
20965
|
this.filtersVisible = !this.filtersVisible;
|
|
20072
20966
|
this.filterSidebarOpen = this.filtersVisible;
|
|
20967
|
+
|
|
20968
|
+
// Si se está abriendo el sidebar y los filtros no están inicializados, inicializarlos
|
|
20969
|
+
if (this.filtersVisible && this.internalFilters.length === 0) {
|
|
20970
|
+
this.setupFilters();
|
|
20971
|
+
}
|
|
20073
20972
|
},
|
|
20074
20973
|
resetFilters(refresh = true) {
|
|
20075
20974
|
this.internalFilters = [];
|
|
@@ -20084,6 +20983,9 @@ var crudFilters = {
|
|
|
20084
20983
|
isColumnHasFilter(column) {
|
|
20085
20984
|
return column && !column.hideFilter && column.type != "actions";
|
|
20086
20985
|
},
|
|
20986
|
+
isCustomFilterEnabled(customFilter) {
|
|
20987
|
+
return customFilter && customFilter.prop && !customFilter.hideFilter && customFilter.type != "actions";
|
|
20988
|
+
},
|
|
20087
20989
|
setFilter(column, value) {
|
|
20088
20990
|
let filter = this.filter.find(f => f.column == column);
|
|
20089
20991
|
filter.value = value;
|
|
@@ -20110,6 +21012,33 @@ var crudFilters = {
|
|
|
20110
21012
|
|
|
20111
21013
|
var crudValidation = {
|
|
20112
21014
|
methods: {
|
|
21015
|
+
normalizeOptions(options) {
|
|
21016
|
+
if (!Array.isArray(options)) {
|
|
21017
|
+
return options;
|
|
21018
|
+
}
|
|
21019
|
+
return options.map(option => {
|
|
21020
|
+
const normalized = {
|
|
21021
|
+
...option
|
|
21022
|
+
};
|
|
21023
|
+
|
|
21024
|
+
// Asegurar que siempre tenga id, value y text
|
|
21025
|
+
if (normalized.id === undefined && normalized.value !== undefined) {
|
|
21026
|
+
normalized.id = normalized.value;
|
|
21027
|
+
} else if (normalized.value === undefined && normalized.id !== undefined) {
|
|
21028
|
+
normalized.value = normalized.id;
|
|
21029
|
+
} else if (normalized.id === undefined && normalized.value === undefined) {
|
|
21030
|
+
// Si no tiene ni id ni value, usar text o label como valor por defecto
|
|
21031
|
+
normalized.id = normalized.text || normalized.label || "";
|
|
21032
|
+
normalized.value = normalized.id;
|
|
21033
|
+
}
|
|
21034
|
+
|
|
21035
|
+
// Asegurar que siempre tenga text
|
|
21036
|
+
if (normalized.text === undefined) {
|
|
21037
|
+
normalized.text = normalized.label !== undefined ? normalized.label : "";
|
|
21038
|
+
}
|
|
21039
|
+
return normalized;
|
|
21040
|
+
});
|
|
21041
|
+
},
|
|
20113
21042
|
async loadOptions() {
|
|
20114
21043
|
for (let i = 0; i < this.columns.length; i++) {
|
|
20115
21044
|
const column = this.columns[i];
|
|
@@ -20122,6 +21051,15 @@ var crudValidation = {
|
|
|
20122
21051
|
});
|
|
20123
21052
|
console.debug("Options promise", this.columns);
|
|
20124
21053
|
}
|
|
21054
|
+
|
|
21055
|
+
// Normalizar opciones para columnas tipo state y array
|
|
21056
|
+
if ((column.type === 'state' || column.type === 'array') && Array.isArray(column.options)) {
|
|
21057
|
+
const normalizedOptions = this.normalizeOptions(column.options);
|
|
21058
|
+
this.$set(this.columns, i, {
|
|
21059
|
+
...column,
|
|
21060
|
+
options: normalizedOptions
|
|
21061
|
+
});
|
|
21062
|
+
}
|
|
20125
21063
|
}
|
|
20126
21064
|
this.optionsLoaded = true;
|
|
20127
21065
|
},
|
|
@@ -20143,22 +21081,70 @@ var crudValidation = {
|
|
|
20143
21081
|
});
|
|
20144
21082
|
return values.join(",");
|
|
20145
21083
|
},
|
|
20146
|
-
|
|
20147
|
-
if (!options) {
|
|
20148
|
-
|
|
20149
|
-
return value;
|
|
21084
|
+
getStateOptions(value, options) {
|
|
21085
|
+
if (!options || !Array.isArray(options) || options.length === 0) {
|
|
21086
|
+
return [];
|
|
20150
21087
|
}
|
|
20151
|
-
|
|
21088
|
+
|
|
21089
|
+
// Asegurar que las opciones estén normalizadas (por si loadOptions no se ha ejecutado aún)
|
|
21090
|
+
const normalizedOptions = this.normalizeOptions(options);
|
|
21091
|
+
|
|
21092
|
+
// Si el valor es null o undefined, no hay coincidencias
|
|
21093
|
+
if (value === null || value === undefined) {
|
|
21094
|
+
return [];
|
|
21095
|
+
}
|
|
21096
|
+
|
|
21097
|
+
// Normalizar el valor para comparación (convertir a string)
|
|
21098
|
+
const normalizedValue = String(value).trim();
|
|
21099
|
+
return normalizedOptions.filter(option => {
|
|
21100
|
+
// Después de normalizar, las opciones siempre tienen id, value y text
|
|
21101
|
+
// Comparar tanto con id como con value para asegurar compatibilidad
|
|
21102
|
+
const optionId = option.id !== undefined && option.id !== null ? String(option.id).trim() : null;
|
|
21103
|
+
const optionValue = option.value !== undefined && option.value !== null ? String(option.value).trim() : null;
|
|
20152
21104
|
if (Array.isArray(value)) {
|
|
20153
|
-
|
|
21105
|
+
// Para arrays, verificar si alguno de los valores coincide
|
|
21106
|
+
return value.some(val => {
|
|
21107
|
+
if (val === null || val === undefined) return false;
|
|
21108
|
+
const normalizedVal = String(val).trim();
|
|
21109
|
+
return optionId && normalizedVal === optionId || optionValue && normalizedVal === optionValue;
|
|
21110
|
+
});
|
|
20154
21111
|
} else {
|
|
20155
|
-
|
|
21112
|
+
// Comparación estricta para valores únicos - comparar con ambos id y value
|
|
21113
|
+
return optionId && optionId === normalizedValue || optionValue && optionValue === normalizedValue;
|
|
20156
21114
|
}
|
|
20157
21115
|
});
|
|
20158
|
-
|
|
20159
|
-
|
|
20160
|
-
|
|
20161
|
-
|
|
21116
|
+
},
|
|
21117
|
+
getStateValue(value, options) {
|
|
21118
|
+
if (!options) {
|
|
21119
|
+
console.debug("State Column Not hast options returning value", value, options);
|
|
21120
|
+
return value;
|
|
21121
|
+
}
|
|
21122
|
+
const ops = this.getStateOptions(value, options);
|
|
21123
|
+
return ops.map(option => {
|
|
21124
|
+
// Usar text directamente (ya normalizado)
|
|
21125
|
+
return option.text !== undefined ? option.text : "";
|
|
21126
|
+
}).join(", ");
|
|
21127
|
+
},
|
|
21128
|
+
getStateBadgeVariant(option) {
|
|
21129
|
+
// Si la opción tiene una propiedad variant, usarla
|
|
21130
|
+
if (option.variant) {
|
|
21131
|
+
return option.variant;
|
|
21132
|
+
}
|
|
21133
|
+
// Si no, intentar inferir del id/value común
|
|
21134
|
+
const idValue = String(option.id || option.value || '').toLowerCase();
|
|
21135
|
+
if (idValue.includes('active') || idValue.includes('activo')) {
|
|
21136
|
+
return 'success';
|
|
21137
|
+
} else if (idValue.includes('inactive') || idValue.includes('inactivo')) {
|
|
21138
|
+
return 'secondary';
|
|
21139
|
+
} else if (idValue.includes('pending') || idValue.includes('pendiente')) {
|
|
21140
|
+
return 'warning';
|
|
21141
|
+
} else if (idValue.includes('done') || idValue.includes('completado')) {
|
|
21142
|
+
return 'success';
|
|
21143
|
+
} else if (idValue.includes('error') || idValue.includes('error')) {
|
|
21144
|
+
return 'danger';
|
|
21145
|
+
}
|
|
21146
|
+
// Variante por defecto
|
|
21147
|
+
return 'primary';
|
|
20162
21148
|
}
|
|
20163
21149
|
}
|
|
20164
21150
|
};
|
|
@@ -20294,37 +21280,134 @@ var crudHelpers = {
|
|
|
20294
21280
|
this.$emit("selectItems", this.selectedItems);
|
|
20295
21281
|
},
|
|
20296
21282
|
showItem(id, itemIndex = null) {
|
|
21283
|
+
let item;
|
|
20297
21284
|
if (itemIndex == null) {
|
|
20298
|
-
|
|
20299
|
-
this.item = item;
|
|
21285
|
+
item = this.items.find(it => it.id == id);
|
|
20300
21286
|
} else {
|
|
20301
|
-
|
|
21287
|
+
item = this.items[itemIndex];
|
|
21288
|
+
}
|
|
21289
|
+
if (!item) {
|
|
21290
|
+
console.warn('Item not found for showItem');
|
|
21291
|
+
return;
|
|
21292
|
+
}
|
|
21293
|
+
|
|
21294
|
+
// Hacer copia profunda del objeto para asegurar reactividad
|
|
21295
|
+
const itemCopy = JSON.parse(JSON.stringify(item));
|
|
21296
|
+
if (this.useVuexORM && !this.vuexLocalforage) {
|
|
21297
|
+
const modelInstance = new this.model(itemCopy);
|
|
21298
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21299
|
+
Object.keys(modelInstance).forEach(key => {
|
|
21300
|
+
this.$set(this.item, key, modelInstance[key]);
|
|
21301
|
+
});
|
|
21302
|
+
// Eliminar propiedades que ya no existen
|
|
21303
|
+
Object.keys(this.item).forEach(key => {
|
|
21304
|
+
if (!(key in modelInstance)) {
|
|
21305
|
+
this.$delete(this.item, key);
|
|
21306
|
+
}
|
|
21307
|
+
});
|
|
21308
|
+
} else {
|
|
21309
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21310
|
+
Object.keys(itemCopy).forEach(key => {
|
|
21311
|
+
this.$set(this.item, key, itemCopy[key]);
|
|
21312
|
+
});
|
|
21313
|
+
// Eliminar propiedades que ya no existen
|
|
21314
|
+
Object.keys(this.item).forEach(key => {
|
|
21315
|
+
if (!(key in itemCopy)) {
|
|
21316
|
+
this.$delete(this.item, key);
|
|
21317
|
+
}
|
|
21318
|
+
});
|
|
20302
21319
|
}
|
|
21320
|
+
|
|
21321
|
+
// Forzar actualización para asegurar que los cambios se reflejen
|
|
21322
|
+
this.$forceUpdate();
|
|
20303
21323
|
this.onSelect();
|
|
20304
|
-
this.$
|
|
21324
|
+
this.$nextTick(() => {
|
|
21325
|
+
this.$forceUpdate();
|
|
21326
|
+
this.$bvModal.show("modal-show-item-" + this.modelName);
|
|
21327
|
+
});
|
|
20305
21328
|
},
|
|
20306
21329
|
createItem() {
|
|
20307
|
-
|
|
20308
|
-
|
|
20309
|
-
|
|
20310
|
-
|
|
20311
|
-
|
|
20312
|
-
|
|
21330
|
+
// Hacer copia profunda del objeto para asegurar reactividad
|
|
21331
|
+
const itemCopy = JSON.parse(JSON.stringify(this.itemDefault));
|
|
21332
|
+
if (this.useVuexORM && !this.vuexLocalforage) {
|
|
21333
|
+
const modelInstance = new this.model(itemCopy);
|
|
21334
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21335
|
+
Object.keys(modelInstance).forEach(key => {
|
|
21336
|
+
this.$set(this.item, key, modelInstance[key]);
|
|
21337
|
+
});
|
|
21338
|
+
// Eliminar propiedades que ya no existen
|
|
21339
|
+
Object.keys(this.item).forEach(key => {
|
|
21340
|
+
if (!(key in modelInstance)) {
|
|
21341
|
+
this.$delete(this.item, key);
|
|
21342
|
+
}
|
|
21343
|
+
});
|
|
20313
21344
|
} else {
|
|
20314
|
-
|
|
21345
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21346
|
+
Object.keys(itemCopy).forEach(key => {
|
|
21347
|
+
this.$set(this.item, key, itemCopy[key]);
|
|
21348
|
+
});
|
|
21349
|
+
// Eliminar propiedades que ya no existen
|
|
21350
|
+
Object.keys(this.item).forEach(key => {
|
|
21351
|
+
if (!(key in itemCopy)) {
|
|
21352
|
+
this.$delete(this.item, key);
|
|
21353
|
+
}
|
|
21354
|
+
});
|
|
20315
21355
|
}
|
|
21356
|
+
|
|
21357
|
+
// Forzar actualización para asegurar que los cambios se reflejen
|
|
21358
|
+
this.$forceUpdate();
|
|
20316
21359
|
this.onSelect();
|
|
20317
|
-
this.$
|
|
21360
|
+
this.$nextTick(() => {
|
|
21361
|
+
this.$forceUpdate();
|
|
21362
|
+
this.$bvModal.show("modal-form-item-" + this.modelName);
|
|
21363
|
+
});
|
|
20318
21364
|
},
|
|
20319
21365
|
updateItem(id, itemIndex = null) {
|
|
21366
|
+
let item;
|
|
20320
21367
|
if (itemIndex == null) {
|
|
20321
|
-
|
|
20322
|
-
this.item = item;
|
|
21368
|
+
item = this.items.find(it => it.id == id);
|
|
20323
21369
|
} else {
|
|
20324
|
-
|
|
21370
|
+
item = this.items[itemIndex];
|
|
21371
|
+
}
|
|
21372
|
+
if (!item) {
|
|
21373
|
+
console.warn('Item not found for updateItem');
|
|
21374
|
+
return;
|
|
21375
|
+
}
|
|
21376
|
+
|
|
21377
|
+
// Hacer copia profunda del objeto para asegurar reactividad
|
|
21378
|
+
const itemCopy = JSON.parse(JSON.stringify(item));
|
|
21379
|
+
if (this.useVuexORM && !this.vuexLocalforage) {
|
|
21380
|
+
const modelInstance = new this.model(itemCopy);
|
|
21381
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21382
|
+
Object.keys(modelInstance).forEach(key => {
|
|
21383
|
+
this.$set(this.item, key, modelInstance[key]);
|
|
21384
|
+
});
|
|
21385
|
+
// Eliminar propiedades que ya no existen
|
|
21386
|
+
Object.keys(this.item).forEach(key => {
|
|
21387
|
+
if (!(key in modelInstance)) {
|
|
21388
|
+
this.$delete(this.item, key);
|
|
21389
|
+
}
|
|
21390
|
+
});
|
|
21391
|
+
} else {
|
|
21392
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21393
|
+
Object.keys(itemCopy).forEach(key => {
|
|
21394
|
+
this.$set(this.item, key, itemCopy[key]);
|
|
21395
|
+
});
|
|
21396
|
+
// Eliminar propiedades que ya no existen
|
|
21397
|
+
Object.keys(this.item).forEach(key => {
|
|
21398
|
+
if (!(key in itemCopy)) {
|
|
21399
|
+
this.$delete(this.item, key);
|
|
21400
|
+
}
|
|
21401
|
+
});
|
|
20325
21402
|
}
|
|
21403
|
+
|
|
21404
|
+
// Forzar actualización para asegurar que los cambios se reflejen
|
|
21405
|
+
this.$forceUpdate();
|
|
20326
21406
|
this.onSelect();
|
|
20327
|
-
this.$
|
|
21407
|
+
this.$nextTick(() => {
|
|
21408
|
+
this.$forceUpdate();
|
|
21409
|
+
this.$bvModal.show("modal-form-item-" + this.modelName);
|
|
21410
|
+
});
|
|
20328
21411
|
},
|
|
20329
21412
|
removeItem(id, index) {
|
|
20330
21413
|
this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
|
|
@@ -20361,7 +21444,18 @@ var crudHelpers = {
|
|
|
20361
21444
|
});
|
|
20362
21445
|
},
|
|
20363
21446
|
toggleDisplayMode() {
|
|
20364
|
-
|
|
21447
|
+
// Mutar la propiedad local _displayMode y el objeto reactivo
|
|
21448
|
+
if (this._displayMode == this.displayModes.MODE_TABLE) {
|
|
21449
|
+
this._displayMode = this.displayModes.MODE_CARDS;
|
|
21450
|
+
if (this.displayModeReactive) {
|
|
21451
|
+
this.displayModeReactive.value = this.displayModes.MODE_CARDS;
|
|
21452
|
+
}
|
|
21453
|
+
} else if (this._displayMode == this.displayModes.MODE_CARDS) {
|
|
21454
|
+
this._displayMode = this.displayModes.MODE_TABLE;
|
|
21455
|
+
if (this.displayModeReactive) {
|
|
21456
|
+
this.displayModeReactive.value = this.displayModes.MODE_TABLE;
|
|
21457
|
+
}
|
|
21458
|
+
}
|
|
20365
21459
|
},
|
|
20366
21460
|
showExportModal() {
|
|
20367
21461
|
this.$refs["modal-export"].show();
|
|
@@ -20466,7 +21560,7 @@ var crudHelpers = {
|
|
|
20466
21560
|
}
|
|
20467
21561
|
};
|
|
20468
21562
|
|
|
20469
|
-
var css = "tr td[data-v-
|
|
21563
|
+
var css = "tr td[data-v-9327e2bb]:last-child,\ntr td[data-v-9327e2bb]:first-child {\n width: 1%;\n white-space: nowrap; }\n\ntbody tr.selected[data-v-9327e2bb] {\n background-color: #e3f2fd !important; }\n tbody tr.selected[data-v-9327e2bb] td[data-v-9327e2bb] {\n background-color: transparent !important; }\n tbody tr.selected[data-v-9327e2bb][data-v-9327e2bb]:hover {\n background-color: #bbdefb !important; }\n tbody tr.selected[data-v-9327e2bb][data-v-9327e2bb]:hover td[data-v-9327e2bb] {\n background-color: transparent !important; }\n\n.table-striped tbody tr.selected[data-v-9327e2bb]:nth-of-type(odd) {\n background-color: #e3f2fd !important; }\n .table-striped tbody tr.selected[data-v-9327e2bb]:nth-of-type(odd) td[data-v-9327e2bb] {\n background-color: transparent !important; }\n\n.table-striped tbody tr.selected[data-v-9327e2bb]:nth-of-type(even) {\n background-color: #e3f2fd !important; }\n .table-striped tbody tr.selected[data-v-9327e2bb]:nth-of-type(even) td[data-v-9327e2bb] {\n background-color: transparent !important; }\n\n.crud-pagination[data-v-9327e2bb] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-9327e2bb] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-9327e2bb] .crud-title[data-v-9327e2bb] {\n margin: 0; }\n .crud-header[data-v-9327e2bb] .crud-search[data-v-9327e2bb] {\n max-width: 15rem; }\n .crud-header[data-v-9327e2bb] .crud-search[data-v-9327e2bb] .btn[data-v-9327e2bb] {\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-9327e2bb] .crud-search[data-v-9327e2bb] .btn[data-v-9327e2bb].open[data-v-9327e2bb] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-9327e2bb] .table-options[data-v-9327e2bb] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-9327e2bb] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-9327e2bb] {\n table-layout: auto; }\n .table[data-v-9327e2bb] tbody[data-v-9327e2bb] td[data-v-9327e2bb] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-9327e2bb] tbody[data-v-9327e2bb] td[data-v-9327e2bb]::-webkit-scrollbar {\n display: none; } }\n\n.kanban-board[data-v-9327e2bb] {\n display: flex;\n gap: 1rem;\n overflow-x: auto;\n padding: 1rem; }\n\n.kanban-column[data-v-9327e2bb] {\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-9327e2bb] {\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-9327e2bb] {\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-9327e2bb] {\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";
|
|
20470
21564
|
n(css, {});
|
|
20471
21565
|
|
|
20472
21566
|
const _sfc_main = {
|
|
@@ -20494,6 +21588,7 @@ const _sfc_main = {
|
|
|
20494
21588
|
vuexLocalforage: this.vuexLocalforage,
|
|
20495
21589
|
columns: this.columns,
|
|
20496
21590
|
filter: this.filter,
|
|
21591
|
+
customFilters: this.customFilters,
|
|
20497
21592
|
enableFilters: this.enableFilters,
|
|
20498
21593
|
infiniteScroll: this.infiniteScroll,
|
|
20499
21594
|
sortable: this.sortable,
|
|
@@ -20514,7 +21609,7 @@ const _sfc_main = {
|
|
|
20514
21609
|
showHeader: this.showHeader,
|
|
20515
21610
|
showTitle: this.showTitle,
|
|
20516
21611
|
limit: this.limit,
|
|
20517
|
-
displayMode: this.
|
|
21612
|
+
displayMode: this.displayModeReactive,
|
|
20518
21613
|
displayModeToggler: this.displayModeToggler,
|
|
20519
21614
|
colXs: this.colXs,
|
|
20520
21615
|
colSm: this.colSm,
|
|
@@ -20562,6 +21657,8 @@ const _sfc_main = {
|
|
|
20562
21657
|
moment: this.moment,
|
|
20563
21658
|
loading: this.loading,
|
|
20564
21659
|
firstLoad: this.firstLoad,
|
|
21660
|
+
// Proporcionar item como función getter para reactividad
|
|
21661
|
+
getItem: () => this.item,
|
|
20565
21662
|
item: this.item,
|
|
20566
21663
|
items: this.items,
|
|
20567
21664
|
selectedItems: this.selectedItems,
|
|
@@ -20626,12 +21723,15 @@ const _sfc_main = {
|
|
|
20626
21723
|
toggleFilters: this.toggleFilters,
|
|
20627
21724
|
resetFilters: this.resetFilters,
|
|
20628
21725
|
isColumnHasFilter: this.isColumnHasFilter,
|
|
21726
|
+
isCustomFilterEnabled: this.isCustomFilterEnabled,
|
|
20629
21727
|
setFilter: this.setFilter,
|
|
20630
21728
|
onChangeFilter: this.onChangeFilter,
|
|
20631
21729
|
togglePrincipalSort: this.togglePrincipalSort,
|
|
20632
21730
|
loadOptions: this.loadOptions,
|
|
20633
21731
|
getArrayValue: this.getArrayValue,
|
|
20634
21732
|
getStateValue: this.getStateValue,
|
|
21733
|
+
getStateOptions: this.getStateOptions,
|
|
21734
|
+
getStateBadgeVariant: this.getStateBadgeVariant,
|
|
20635
21735
|
onRowHover: this.onRowHover,
|
|
20636
21736
|
onRowClick: this.onRowClick,
|
|
20637
21737
|
onSort: this.onSort,
|
|
@@ -20703,6 +21803,10 @@ const _sfc_main = {
|
|
|
20703
21803
|
type: Array,
|
|
20704
21804
|
default: () => []
|
|
20705
21805
|
},
|
|
21806
|
+
customFilters: {
|
|
21807
|
+
type: Array,
|
|
21808
|
+
default: () => []
|
|
21809
|
+
},
|
|
20706
21810
|
enableFilters: {
|
|
20707
21811
|
type: Boolean,
|
|
20708
21812
|
default: false
|
|
@@ -20962,7 +22066,34 @@ var _sfc_render = function render() {
|
|
|
20962
22066
|
_c = _vm._self._c;
|
|
20963
22067
|
return _c('div', {
|
|
20964
22068
|
staticClass: "crud"
|
|
20965
|
-
}, [_c('CrudHeader'), _c('CrudTable'
|
|
22069
|
+
}, [_c('CrudHeader'), _c('CrudTable', {
|
|
22070
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
22071
|
+
return {
|
|
22072
|
+
key: name,
|
|
22073
|
+
fn: function (slotProps) {
|
|
22074
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
22075
|
+
}
|
|
22076
|
+
};
|
|
22077
|
+
})], null, true)
|
|
22078
|
+
}), _c('CrudCards', {
|
|
22079
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
22080
|
+
return {
|
|
22081
|
+
key: name,
|
|
22082
|
+
fn: function (slotProps) {
|
|
22083
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
22084
|
+
}
|
|
22085
|
+
};
|
|
22086
|
+
})], null, true)
|
|
22087
|
+
}), _c('CrudKanban', {
|
|
22088
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
22089
|
+
return {
|
|
22090
|
+
key: name,
|
|
22091
|
+
fn: function (slotProps) {
|
|
22092
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
22093
|
+
}
|
|
22094
|
+
};
|
|
22095
|
+
})], null, true)
|
|
22096
|
+
}), _c('CrudCustom'), _c('b-overlay', {
|
|
20966
22097
|
attrs: {
|
|
20967
22098
|
"show": _vm.loading,
|
|
20968
22099
|
"rounded": "sm"
|
|
@@ -20979,7 +22110,7 @@ var _sfc_render = function render() {
|
|
|
20979
22110
|
})], 1);
|
|
20980
22111
|
};
|
|
20981
22112
|
var _sfc_staticRenderFns = [];
|
|
20982
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
22113
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "9327e2bb", null, null);
|
|
20983
22114
|
var component = __component__.exports;
|
|
20984
22115
|
|
|
20985
22116
|
// Import vue component
|