vue-laravel-crud 2.0.5 → 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 +1 -1
- package/src/ItemCard.vue +45 -4
- package/src/components/CrudCards.vue +19 -3
- package/src/components/CrudCustom.vue +14 -2
- package/src/components/CrudFilters.vue +152 -0
- 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 +5 -1
- package/src/components/kanban/KanbanCard.vue +45 -4
- package/src/components/kanban/KanbanColumn.vue +6 -2
- package/src/components/table/TableCell.vue +66 -20
- package/src/components/table/TableHeader.vue +21 -6
- package/src/components/table/TableRow.vue +5 -1
- package/src/vue-laravel-crud.vue +25 -4
|
@@ -538,9 +538,116 @@ function _nonIterableRest() {
|
|
|
538
538
|
exports: scriptExports,
|
|
539
539
|
options: options
|
|
540
540
|
}
|
|
541
|
-
}
|
|
541
|
+
}// Componente funcional para renderizar filtros custom con callback
|
|
542
|
+
var RenderCustomFilter = {
|
|
543
|
+
functional: true,
|
|
544
|
+
props: {
|
|
545
|
+
renderFunction: {
|
|
546
|
+
type: Function,
|
|
547
|
+
required: true
|
|
548
|
+
},
|
|
549
|
+
customFilter: {
|
|
550
|
+
type: Object,
|
|
551
|
+
required: true
|
|
552
|
+
},
|
|
553
|
+
filter: {
|
|
554
|
+
type: Array,
|
|
555
|
+
default: function _default() {
|
|
556
|
+
return [];
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
internalFilterByProp: {
|
|
560
|
+
type: Function,
|
|
561
|
+
required: true
|
|
562
|
+
},
|
|
563
|
+
getFilterForColumn: {
|
|
564
|
+
type: Function,
|
|
565
|
+
required: true
|
|
566
|
+
},
|
|
567
|
+
onChangeFilter: {
|
|
568
|
+
type: Function,
|
|
569
|
+
required: true
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
render: function render(h, context) {
|
|
573
|
+
var _context$props = context.props,
|
|
574
|
+
renderFunction = _context$props.renderFunction,
|
|
575
|
+
customFilter = _context$props.customFilter,
|
|
576
|
+
filter = _context$props.filter,
|
|
577
|
+
internalFilterByProp = _context$props.internalFilterByProp,
|
|
578
|
+
getFilterForColumn = _context$props.getFilterForColumn,
|
|
579
|
+
onChangeFilter = _context$props.onChangeFilter;
|
|
580
|
+
return renderFunction(h, {
|
|
581
|
+
column: customFilter,
|
|
582
|
+
filter: filter,
|
|
583
|
+
internalFilterByProp: internalFilterByProp,
|
|
584
|
+
getFilterForColumn: getFilterForColumn,
|
|
585
|
+
onChangeFilter: onChangeFilter
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
var _sfc_main$f = {
|
|
542
590
|
name: 'CrudFilters',
|
|
543
|
-
|
|
591
|
+
components: {
|
|
592
|
+
RenderCustomFilter: RenderCustomFilter
|
|
593
|
+
},
|
|
594
|
+
inject: ['columns', 'customFilters', 'isColumnHasFilter', 'isCustomFilterEnabled', 'filter', 'internalFilterByProp', 'optionsLoaded', 'onChangeFilter', 'resetFilters', 'setupFilters', 'internalFilters'],
|
|
595
|
+
methods: {
|
|
596
|
+
// Método helper para obtener el filtro de forma segura, creándolo si no existe
|
|
597
|
+
getFilterForColumn: function getFilterForColumn(column) {
|
|
598
|
+
var filter = this.internalFilterByProp(column.prop);
|
|
599
|
+
|
|
600
|
+
// Si el filtro no existe, intentar inicializar los filtros
|
|
601
|
+
if (!filter) {
|
|
602
|
+
// Verificar si hay filtros inicializados
|
|
603
|
+
if (this.internalFilters && this.internalFilters.length === 0) {
|
|
604
|
+
this.setupFilters();
|
|
605
|
+
// Intentar obtener el filtro nuevamente después de inicializar
|
|
606
|
+
filter = this.internalFilterByProp(column.prop);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// Si aún no existe, crear un objeto temporal para evitar errores
|
|
611
|
+
if (!filter) {
|
|
612
|
+
return {
|
|
613
|
+
value: null
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
return filter;
|
|
617
|
+
},
|
|
618
|
+
// Método helper específico para campos de fecha (from)
|
|
619
|
+
getFilterForDateFrom: function getFilterForDateFrom(column) {
|
|
620
|
+
var filter = this.internalFilterByProp(column.prop + '_from');
|
|
621
|
+
if (!filter) {
|
|
622
|
+
if (this.internalFilters && this.internalFilters.length === 0) {
|
|
623
|
+
this.setupFilters();
|
|
624
|
+
return this.internalFilterByProp(column.prop + '_from') || {
|
|
625
|
+
value: null
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
return {
|
|
629
|
+
value: null
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
return filter;
|
|
633
|
+
},
|
|
634
|
+
// Método helper específico para campos de fecha (to)
|
|
635
|
+
getFilterForDateTo: function getFilterForDateTo(column) {
|
|
636
|
+
var filter = this.internalFilterByProp(column.prop + '_to');
|
|
637
|
+
if (!filter) {
|
|
638
|
+
if (this.internalFilters && this.internalFilters.length === 0) {
|
|
639
|
+
this.setupFilters();
|
|
640
|
+
return this.internalFilterByProp(column.prop + '_to') || {
|
|
641
|
+
value: null
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
return {
|
|
645
|
+
value: null
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
return filter;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
544
651
|
};
|
|
545
652
|
var _sfc_render$f = function render() {
|
|
546
653
|
var _vm = this,
|
|
@@ -550,15 +657,15 @@ var _sfc_render$f = function render() {
|
|
|
550
657
|
}, [_vm._l(_vm.columns, function (column, indexc) {
|
|
551
658
|
return _c('div', {
|
|
552
659
|
key: indexc
|
|
553
|
-
}, [_vm.isColumnHasFilter(column) ? _c('div', [_vm.
|
|
660
|
+
}, [_vm.isColumnHasFilter(column) ? _c('div', [_vm._t('sidebar-filter-' + column.prop, function () {
|
|
554
661
|
return [column.type == 'boolean' ? _c('div', {
|
|
555
662
|
staticClass: "form-group"
|
|
556
663
|
}, [_c('label', [_vm._v(_vm._s(column.label))]), _c('select', {
|
|
557
664
|
directives: [{
|
|
558
665
|
name: "model",
|
|
559
666
|
rawName: "v-model",
|
|
560
|
-
value: _vm.
|
|
561
|
-
expression: "
|
|
667
|
+
value: _vm.getFilterForColumn(column).value,
|
|
668
|
+
expression: "getFilterForColumn(column).value"
|
|
562
669
|
}],
|
|
563
670
|
staticClass: "form-control",
|
|
564
671
|
on: {
|
|
@@ -569,7 +676,7 @@ var _sfc_render$f = function render() {
|
|
|
569
676
|
var val = "_value" in o ? o._value : o.value;
|
|
570
677
|
return val;
|
|
571
678
|
});
|
|
572
|
-
_vm.$set(_vm.
|
|
679
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
573
680
|
}, function ($event) {
|
|
574
681
|
return _vm.onChangeFilter($event);
|
|
575
682
|
}]
|
|
@@ -600,11 +707,11 @@ var _sfc_render$f = function render() {
|
|
|
600
707
|
"locale": "es"
|
|
601
708
|
},
|
|
602
709
|
model: {
|
|
603
|
-
value: _vm.
|
|
710
|
+
value: _vm.getFilterForDateFrom(column).value,
|
|
604
711
|
callback: function callback($$v) {
|
|
605
|
-
_vm.$set(_vm.
|
|
712
|
+
_vm.$set(_vm.getFilterForDateFrom(column), "value", $$v);
|
|
606
713
|
},
|
|
607
|
-
expression: "
|
|
714
|
+
expression: "getFilterForDateFrom(column).value\n "
|
|
608
715
|
}
|
|
609
716
|
})], 1), _c('div', {
|
|
610
717
|
staticClass: "col-6"
|
|
@@ -616,20 +723,90 @@ var _sfc_render$f = function render() {
|
|
|
616
723
|
"locale": "es"
|
|
617
724
|
},
|
|
618
725
|
model: {
|
|
619
|
-
value: _vm.
|
|
726
|
+
value: _vm.getFilterForDateTo(column).value,
|
|
620
727
|
callback: function callback($$v) {
|
|
621
|
-
_vm.$set(_vm.
|
|
728
|
+
_vm.$set(_vm.getFilterForDateTo(column), "value", $$v);
|
|
729
|
+
},
|
|
730
|
+
expression: "getFilterForDateTo(column).value\n "
|
|
731
|
+
}
|
|
732
|
+
})], 1)])]) : column.type == 'number' || column.type == 'money' ? _c('div', {
|
|
733
|
+
staticClass: "form-group"
|
|
734
|
+
}, [_c('label', [_vm._v(_vm._s(column.label))]), _c('div', {
|
|
735
|
+
staticClass: "row"
|
|
736
|
+
}, [_c('div', {
|
|
737
|
+
staticClass: "col-6"
|
|
738
|
+
}, [_c('input', {
|
|
739
|
+
directives: [{
|
|
740
|
+
name: "model",
|
|
741
|
+
rawName: "v-model.number",
|
|
742
|
+
value: _vm.getFilterForDateFrom(column).value,
|
|
743
|
+
expression: "getFilterForDateFrom(column).value",
|
|
744
|
+
modifiers: {
|
|
745
|
+
"number": true
|
|
746
|
+
}
|
|
747
|
+
}],
|
|
748
|
+
staticClass: "form-control",
|
|
749
|
+
attrs: {
|
|
750
|
+
"type": "number",
|
|
751
|
+
"step": column.type == 'money' ? '0.01' : '1',
|
|
752
|
+
"placeholder": "Desde"
|
|
753
|
+
},
|
|
754
|
+
domProps: {
|
|
755
|
+
"value": _vm.getFilterForDateFrom(column).value
|
|
756
|
+
},
|
|
757
|
+
on: {
|
|
758
|
+
"change": function change($event) {
|
|
759
|
+
return _vm.onChangeFilter($event);
|
|
760
|
+
},
|
|
761
|
+
"input": function input($event) {
|
|
762
|
+
if ($event.target.composing) return;
|
|
763
|
+
_vm.$set(_vm.getFilterForDateFrom(column), "value", _vm._n($event.target.value));
|
|
622
764
|
},
|
|
623
|
-
|
|
765
|
+
"blur": function blur($event) {
|
|
766
|
+
return _vm.$forceUpdate();
|
|
767
|
+
}
|
|
624
768
|
}
|
|
625
|
-
})],
|
|
769
|
+
})]), _c('div', {
|
|
770
|
+
staticClass: "col-6"
|
|
771
|
+
}, [_c('input', {
|
|
772
|
+
directives: [{
|
|
773
|
+
name: "model",
|
|
774
|
+
rawName: "v-model.number",
|
|
775
|
+
value: _vm.getFilterForDateTo(column).value,
|
|
776
|
+
expression: "getFilterForDateTo(column).value",
|
|
777
|
+
modifiers: {
|
|
778
|
+
"number": true
|
|
779
|
+
}
|
|
780
|
+
}],
|
|
781
|
+
staticClass: "form-control",
|
|
782
|
+
attrs: {
|
|
783
|
+
"type": "number",
|
|
784
|
+
"step": column.type == 'money' ? '0.01' : '1',
|
|
785
|
+
"placeholder": "Hasta"
|
|
786
|
+
},
|
|
787
|
+
domProps: {
|
|
788
|
+
"value": _vm.getFilterForDateTo(column).value
|
|
789
|
+
},
|
|
790
|
+
on: {
|
|
791
|
+
"change": function change($event) {
|
|
792
|
+
return _vm.onChangeFilter($event);
|
|
793
|
+
},
|
|
794
|
+
"input": function input($event) {
|
|
795
|
+
if ($event.target.composing) return;
|
|
796
|
+
_vm.$set(_vm.getFilterForDateTo(column), "value", _vm._n($event.target.value));
|
|
797
|
+
},
|
|
798
|
+
"blur": function blur($event) {
|
|
799
|
+
return _vm.$forceUpdate();
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
})])])]) : column.type == 'state' ? _c('div', {
|
|
626
803
|
staticClass: "form-group"
|
|
627
|
-
}, [_c('label', [_vm._v(_vm._s(column.label))]),
|
|
804
|
+
}, [_c('label', [_vm._v(_vm._s(column.label))]), column.options && Array.isArray(column.options) ? _c('select', {
|
|
628
805
|
directives: [{
|
|
629
806
|
name: "model",
|
|
630
807
|
rawName: "v-model",
|
|
631
|
-
value: _vm.
|
|
632
|
-
expression: "
|
|
808
|
+
value: _vm.getFilterForColumn(column).value,
|
|
809
|
+
expression: "getFilterForColumn(column).value"
|
|
633
810
|
}],
|
|
634
811
|
staticClass: "form-control",
|
|
635
812
|
on: {
|
|
@@ -640,7 +817,7 @@ var _sfc_render$f = function render() {
|
|
|
640
817
|
var val = "_value" in o ? o._value : o.value;
|
|
641
818
|
return val;
|
|
642
819
|
});
|
|
643
|
-
_vm.$set(_vm.
|
|
820
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
644
821
|
}, function ($event) {
|
|
645
822
|
return _vm.onChangeFilter($event);
|
|
646
823
|
}]
|
|
@@ -651,19 +828,19 @@ var _sfc_render$f = function render() {
|
|
|
651
828
|
}
|
|
652
829
|
}), _vm._l(column.options, function (option) {
|
|
653
830
|
return _c('option', {
|
|
654
|
-
key: option.
|
|
831
|
+
key: option.value || option.id,
|
|
655
832
|
domProps: {
|
|
656
|
-
"value": option.
|
|
833
|
+
"value": option.value
|
|
657
834
|
}
|
|
658
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
835
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
659
836
|
})], 2) : _vm._e()]) : column.type == 'array' ? _c('div', {
|
|
660
837
|
staticClass: "form-group"
|
|
661
|
-
}, [_c('label', [_vm._v(_vm._s(column.label))]),
|
|
838
|
+
}, [_c('label', [_vm._v(_vm._s(column.label))]), column.options && Array.isArray(column.options) ? _c('select', {
|
|
662
839
|
directives: [{
|
|
663
840
|
name: "model",
|
|
664
841
|
rawName: "v-model",
|
|
665
|
-
value: _vm.
|
|
666
|
-
expression: "
|
|
842
|
+
value: _vm.getFilterForColumn(column).value,
|
|
843
|
+
expression: "getFilterForColumn(column).value"
|
|
667
844
|
}],
|
|
668
845
|
staticClass: "form-control",
|
|
669
846
|
on: {
|
|
@@ -674,7 +851,7 @@ var _sfc_render$f = function render() {
|
|
|
674
851
|
var val = "_value" in o ? o._value : o.value;
|
|
675
852
|
return val;
|
|
676
853
|
});
|
|
677
|
-
_vm.$set(_vm.
|
|
854
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
678
855
|
}, function ($event) {
|
|
679
856
|
return _vm.onChangeFilter($event);
|
|
680
857
|
}]
|
|
@@ -683,32 +860,32 @@ var _sfc_render$f = function render() {
|
|
|
683
860
|
attrs: {
|
|
684
861
|
"value": ""
|
|
685
862
|
}
|
|
686
|
-
}),
|
|
863
|
+
}), _vm._l(column.options, function (option) {
|
|
687
864
|
return _c('option', {
|
|
688
|
-
key: option.
|
|
865
|
+
key: option.value || option.id,
|
|
689
866
|
domProps: {
|
|
690
|
-
"value": option.
|
|
867
|
+
"value": option.value
|
|
691
868
|
}
|
|
692
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
693
|
-
})
|
|
869
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
870
|
+
})], 2) : _vm._e()]) : _c('div', {
|
|
694
871
|
staticClass: "form-group"
|
|
695
872
|
}, [_c('label', [_vm._v(_vm._s(column.label))]), _c('input', {
|
|
696
873
|
directives: [{
|
|
697
874
|
name: "model",
|
|
698
875
|
rawName: "v-model.lazy",
|
|
699
|
-
value: _vm.
|
|
700
|
-
expression: "
|
|
876
|
+
value: _vm.getFilterForColumn(column).value,
|
|
877
|
+
expression: "getFilterForColumn(column).value",
|
|
701
878
|
modifiers: {
|
|
702
879
|
"lazy": true
|
|
703
880
|
}
|
|
704
881
|
}],
|
|
705
882
|
staticClass: "form-control",
|
|
706
883
|
domProps: {
|
|
707
|
-
"value": _vm.
|
|
884
|
+
"value": _vm.getFilterForColumn(column).value
|
|
708
885
|
},
|
|
709
886
|
on: {
|
|
710
887
|
"change": [function ($event) {
|
|
711
|
-
_vm.$set(_vm.
|
|
888
|
+
_vm.$set(_vm.getFilterForColumn(column), "value", $event.target.value);
|
|
712
889
|
}, function ($event) {
|
|
713
890
|
return _vm.onChangeFilter($event);
|
|
714
891
|
}]
|
|
@@ -717,8 +894,261 @@ var _sfc_render$f = function render() {
|
|
|
717
894
|
}, {
|
|
718
895
|
"column": column,
|
|
719
896
|
"filter": _vm.filter,
|
|
720
|
-
"internalFilterByProp": _vm.internalFilterByProp
|
|
721
|
-
|
|
897
|
+
"internalFilterByProp": _vm.internalFilterByProp,
|
|
898
|
+
"getFilterForColumn": _vm.getFilterForColumn
|
|
899
|
+
})], 2) : _vm._e()]);
|
|
900
|
+
}), _vm._l(_vm.customFilters, function (customFilter, indexcf) {
|
|
901
|
+
return _c('div', {
|
|
902
|
+
key: 'custom-' + indexcf
|
|
903
|
+
}, [_vm.isCustomFilterEnabled(customFilter) ? _c('div', [_vm._t('sidebar-filter-custom-' + customFilter.prop, function () {
|
|
904
|
+
return [typeof customFilter.type === 'function' ? _c('RenderCustomFilter', {
|
|
905
|
+
attrs: {
|
|
906
|
+
"render-function": customFilter.type,
|
|
907
|
+
"custom-filter": customFilter,
|
|
908
|
+
"filter": _vm.filter,
|
|
909
|
+
"internal-filter-by-prop": _vm.internalFilterByProp,
|
|
910
|
+
"get-filter-for-column": _vm.getFilterForColumn,
|
|
911
|
+
"on-change-filter": _vm.onChangeFilter
|
|
912
|
+
}
|
|
913
|
+
}) : [customFilter.type == 'boolean' ? _c('div', {
|
|
914
|
+
staticClass: "form-group"
|
|
915
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('select', {
|
|
916
|
+
directives: [{
|
|
917
|
+
name: "model",
|
|
918
|
+
rawName: "v-model",
|
|
919
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
920
|
+
expression: "getFilterForColumn(customFilter).value"
|
|
921
|
+
}],
|
|
922
|
+
staticClass: "form-control",
|
|
923
|
+
on: {
|
|
924
|
+
"change": [function ($event) {
|
|
925
|
+
var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) {
|
|
926
|
+
return o.selected;
|
|
927
|
+
}).map(function (o) {
|
|
928
|
+
var val = "_value" in o ? o._value : o.value;
|
|
929
|
+
return val;
|
|
930
|
+
});
|
|
931
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
932
|
+
}, function ($event) {
|
|
933
|
+
return _vm.onChangeFilter($event);
|
|
934
|
+
}]
|
|
935
|
+
}
|
|
936
|
+
}, [_c('option', {
|
|
937
|
+
attrs: {
|
|
938
|
+
"value": ""
|
|
939
|
+
}
|
|
940
|
+
}), _c('option', {
|
|
941
|
+
attrs: {
|
|
942
|
+
"value": "1"
|
|
943
|
+
}
|
|
944
|
+
}, [_vm._v("Sí")]), _c('option', {
|
|
945
|
+
attrs: {
|
|
946
|
+
"value": "0"
|
|
947
|
+
}
|
|
948
|
+
}, [_vm._v("No")])])]) : customFilter.type == 'date' ? _c('div', {
|
|
949
|
+
staticClass: "form-group"
|
|
950
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('div', {
|
|
951
|
+
staticClass: "row"
|
|
952
|
+
}, [_c('div', {
|
|
953
|
+
staticClass: "col-6"
|
|
954
|
+
}, [_c('b-form-datepicker', {
|
|
955
|
+
attrs: {
|
|
956
|
+
"today-button": "",
|
|
957
|
+
"reset-button": "",
|
|
958
|
+
"close-button": "",
|
|
959
|
+
"locale": "es"
|
|
960
|
+
},
|
|
961
|
+
model: {
|
|
962
|
+
value: _vm.getFilterForDateFrom(customFilter).value,
|
|
963
|
+
callback: function callback($$v) {
|
|
964
|
+
_vm.$set(_vm.getFilterForDateFrom(customFilter), "value", $$v);
|
|
965
|
+
},
|
|
966
|
+
expression: "getFilterForDateFrom(customFilter).value\n "
|
|
967
|
+
}
|
|
968
|
+
})], 1), _c('div', {
|
|
969
|
+
staticClass: "col-6"
|
|
970
|
+
}, [_c('b-form-datepicker', {
|
|
971
|
+
attrs: {
|
|
972
|
+
"today-button": "",
|
|
973
|
+
"reset-button": "",
|
|
974
|
+
"close-button": "",
|
|
975
|
+
"locale": "es"
|
|
976
|
+
},
|
|
977
|
+
model: {
|
|
978
|
+
value: _vm.getFilterForDateTo(customFilter).value,
|
|
979
|
+
callback: function callback($$v) {
|
|
980
|
+
_vm.$set(_vm.getFilterForDateTo(customFilter), "value", $$v);
|
|
981
|
+
},
|
|
982
|
+
expression: "getFilterForDateTo(customFilter).value\n "
|
|
983
|
+
}
|
|
984
|
+
})], 1)])]) : customFilter.type == 'number' || customFilter.type == 'money' ? _c('div', {
|
|
985
|
+
staticClass: "form-group"
|
|
986
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('div', {
|
|
987
|
+
staticClass: "row"
|
|
988
|
+
}, [_c('div', {
|
|
989
|
+
staticClass: "col-6"
|
|
990
|
+
}, [_c('input', {
|
|
991
|
+
directives: [{
|
|
992
|
+
name: "model",
|
|
993
|
+
rawName: "v-model.number",
|
|
994
|
+
value: _vm.getFilterForDateFrom(customFilter).value,
|
|
995
|
+
expression: "getFilterForDateFrom(customFilter).value",
|
|
996
|
+
modifiers: {
|
|
997
|
+
"number": true
|
|
998
|
+
}
|
|
999
|
+
}],
|
|
1000
|
+
staticClass: "form-control",
|
|
1001
|
+
attrs: {
|
|
1002
|
+
"type": "number",
|
|
1003
|
+
"step": customFilter.type == 'money' ? '0.01' : '1',
|
|
1004
|
+
"placeholder": "Desde"
|
|
1005
|
+
},
|
|
1006
|
+
domProps: {
|
|
1007
|
+
"value": _vm.getFilterForDateFrom(customFilter).value
|
|
1008
|
+
},
|
|
1009
|
+
on: {
|
|
1010
|
+
"change": function change($event) {
|
|
1011
|
+
return _vm.onChangeFilter($event);
|
|
1012
|
+
},
|
|
1013
|
+
"input": function input($event) {
|
|
1014
|
+
if ($event.target.composing) return;
|
|
1015
|
+
_vm.$set(_vm.getFilterForDateFrom(customFilter), "value", _vm._n($event.target.value));
|
|
1016
|
+
},
|
|
1017
|
+
"blur": function blur($event) {
|
|
1018
|
+
return _vm.$forceUpdate();
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
})]), _c('div', {
|
|
1022
|
+
staticClass: "col-6"
|
|
1023
|
+
}, [_c('input', {
|
|
1024
|
+
directives: [{
|
|
1025
|
+
name: "model",
|
|
1026
|
+
rawName: "v-model.number",
|
|
1027
|
+
value: _vm.getFilterForDateTo(customFilter).value,
|
|
1028
|
+
expression: "getFilterForDateTo(customFilter).value",
|
|
1029
|
+
modifiers: {
|
|
1030
|
+
"number": true
|
|
1031
|
+
}
|
|
1032
|
+
}],
|
|
1033
|
+
staticClass: "form-control",
|
|
1034
|
+
attrs: {
|
|
1035
|
+
"type": "number",
|
|
1036
|
+
"step": customFilter.type == 'money' ? '0.01' : '1',
|
|
1037
|
+
"placeholder": "Hasta"
|
|
1038
|
+
},
|
|
1039
|
+
domProps: {
|
|
1040
|
+
"value": _vm.getFilterForDateTo(customFilter).value
|
|
1041
|
+
},
|
|
1042
|
+
on: {
|
|
1043
|
+
"change": function change($event) {
|
|
1044
|
+
return _vm.onChangeFilter($event);
|
|
1045
|
+
},
|
|
1046
|
+
"input": function input($event) {
|
|
1047
|
+
if ($event.target.composing) return;
|
|
1048
|
+
_vm.$set(_vm.getFilterForDateTo(customFilter), "value", _vm._n($event.target.value));
|
|
1049
|
+
},
|
|
1050
|
+
"blur": function blur($event) {
|
|
1051
|
+
return _vm.$forceUpdate();
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
})])])]) : customFilter.type == 'state' ? _c('div', {
|
|
1055
|
+
staticClass: "form-group"
|
|
1056
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), customFilter.options && Array.isArray(customFilter.options) ? _c('select', {
|
|
1057
|
+
directives: [{
|
|
1058
|
+
name: "model",
|
|
1059
|
+
rawName: "v-model",
|
|
1060
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
1061
|
+
expression: "getFilterForColumn(customFilter).value"
|
|
1062
|
+
}],
|
|
1063
|
+
staticClass: "form-control",
|
|
1064
|
+
on: {
|
|
1065
|
+
"change": [function ($event) {
|
|
1066
|
+
var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) {
|
|
1067
|
+
return o.selected;
|
|
1068
|
+
}).map(function (o) {
|
|
1069
|
+
var val = "_value" in o ? o._value : o.value;
|
|
1070
|
+
return val;
|
|
1071
|
+
});
|
|
1072
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
1073
|
+
}, function ($event) {
|
|
1074
|
+
return _vm.onChangeFilter($event);
|
|
1075
|
+
}]
|
|
1076
|
+
}
|
|
1077
|
+
}, [_c('option', {
|
|
1078
|
+
attrs: {
|
|
1079
|
+
"value": ""
|
|
1080
|
+
}
|
|
1081
|
+
}), _vm._l(customFilter.options, function (option) {
|
|
1082
|
+
return _c('option', {
|
|
1083
|
+
key: option.value || option.id,
|
|
1084
|
+
domProps: {
|
|
1085
|
+
"value": option.value
|
|
1086
|
+
}
|
|
1087
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
1088
|
+
})], 2) : _vm._e()]) : customFilter.type == 'array' ? _c('div', {
|
|
1089
|
+
staticClass: "form-group"
|
|
1090
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), customFilter.options && Array.isArray(customFilter.options) ? _c('select', {
|
|
1091
|
+
directives: [{
|
|
1092
|
+
name: "model",
|
|
1093
|
+
rawName: "v-model",
|
|
1094
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
1095
|
+
expression: "getFilterForColumn(customFilter).value"
|
|
1096
|
+
}],
|
|
1097
|
+
staticClass: "form-control",
|
|
1098
|
+
on: {
|
|
1099
|
+
"change": [function ($event) {
|
|
1100
|
+
var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) {
|
|
1101
|
+
return o.selected;
|
|
1102
|
+
}).map(function (o) {
|
|
1103
|
+
var val = "_value" in o ? o._value : o.value;
|
|
1104
|
+
return val;
|
|
1105
|
+
});
|
|
1106
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.multiple ? $$selectedVal : $$selectedVal[0]);
|
|
1107
|
+
}, function ($event) {
|
|
1108
|
+
return _vm.onChangeFilter($event);
|
|
1109
|
+
}]
|
|
1110
|
+
}
|
|
1111
|
+
}, [_c('option', {
|
|
1112
|
+
attrs: {
|
|
1113
|
+
"value": ""
|
|
1114
|
+
}
|
|
1115
|
+
}), _vm._l(customFilter.options, function (option) {
|
|
1116
|
+
return _c('option', {
|
|
1117
|
+
key: option.value || option.id,
|
|
1118
|
+
domProps: {
|
|
1119
|
+
"value": option.value
|
|
1120
|
+
}
|
|
1121
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
1122
|
+
})], 2) : _vm._e()]) : _c('div', {
|
|
1123
|
+
staticClass: "form-group"
|
|
1124
|
+
}, [_c('label', [_vm._v(_vm._s(customFilter.label))]), _c('input', {
|
|
1125
|
+
directives: [{
|
|
1126
|
+
name: "model",
|
|
1127
|
+
rawName: "v-model.lazy",
|
|
1128
|
+
value: _vm.getFilterForColumn(customFilter).value,
|
|
1129
|
+
expression: "getFilterForColumn(customFilter).value",
|
|
1130
|
+
modifiers: {
|
|
1131
|
+
"lazy": true
|
|
1132
|
+
}
|
|
1133
|
+
}],
|
|
1134
|
+
staticClass: "form-control",
|
|
1135
|
+
domProps: {
|
|
1136
|
+
"value": _vm.getFilterForColumn(customFilter).value
|
|
1137
|
+
},
|
|
1138
|
+
on: {
|
|
1139
|
+
"change": [function ($event) {
|
|
1140
|
+
_vm.$set(_vm.getFilterForColumn(customFilter), "value", $event.target.value);
|
|
1141
|
+
}, function ($event) {
|
|
1142
|
+
return _vm.onChangeFilter($event);
|
|
1143
|
+
}]
|
|
1144
|
+
}
|
|
1145
|
+
})])]];
|
|
1146
|
+
}, {
|
|
1147
|
+
"column": customFilter,
|
|
1148
|
+
"filter": _vm.filter,
|
|
1149
|
+
"internalFilterByProp": _vm.internalFilterByProp,
|
|
1150
|
+
"getFilterForColumn": _vm.getFilterForColumn
|
|
1151
|
+
})], 2) : _vm._e()]);
|
|
722
1152
|
}), _c('div', {
|
|
723
1153
|
staticClass: "mt-3 d-flex justify-content-center"
|
|
724
1154
|
}, [_c('button', {
|
|
@@ -739,7 +1169,7 @@ var _sfc_render$f = function render() {
|
|
|
739
1169
|
};
|
|
740
1170
|
var _sfc_staticRenderFns$f = [];
|
|
741
1171
|
var __component__$f = /*#__PURE__*/normalizeComponent(_sfc_main$f, _sfc_render$f, _sfc_staticRenderFns$f, false, null, null, null, null);
|
|
742
|
-
var CrudFilters = __component__$f.exports;var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}var css$8 = "\n.crud-header[data-v-
|
|
1172
|
+
var CrudFilters = __component__$f.exports;var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}var css$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";
|
|
743
1173
|
n(css$8, {});var _sfc_main$e = {
|
|
744
1174
|
name: 'CrudHeader',
|
|
745
1175
|
components: {
|
|
@@ -750,6 +1180,16 @@ n(css$8, {});var _sfc_main$e = {
|
|
|
750
1180
|
sidebarVisible: function sidebarVisible() {
|
|
751
1181
|
// Acceder directamente al componente padre para obtener reactividad
|
|
752
1182
|
return this.$parent ? this.$parent.filterSidebarOpen : this.filterSidebarOpen;
|
|
1183
|
+
},
|
|
1184
|
+
currentDisplayMode: function currentDisplayMode() {
|
|
1185
|
+
if (!this.displayMode) return 1;
|
|
1186
|
+
if (this.displayMode.value !== undefined) {
|
|
1187
|
+
return this.displayMode.value;
|
|
1188
|
+
}
|
|
1189
|
+
if (typeof this.displayMode === 'function') {
|
|
1190
|
+
return this.displayMode();
|
|
1191
|
+
}
|
|
1192
|
+
return this.displayMode;
|
|
753
1193
|
}
|
|
754
1194
|
},
|
|
755
1195
|
methods: {
|
|
@@ -859,7 +1299,7 @@ var _sfc_render$e = function render() {
|
|
|
859
1299
|
return _vm.toggleDisplayMode();
|
|
860
1300
|
}
|
|
861
1301
|
}
|
|
862
|
-
}, [_vm.
|
|
1302
|
+
}, [_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', {
|
|
863
1303
|
staticClass: "crud-search m-0"
|
|
864
1304
|
}, [_c('b-input-group', [_c('b-input-group-prepend', [_c('b-button', {
|
|
865
1305
|
class: {
|
|
@@ -898,7 +1338,7 @@ var _sfc_render$e = function render() {
|
|
|
898
1338
|
})], 2)], 1)], 1) : _vm._e();
|
|
899
1339
|
};
|
|
900
1340
|
var _sfc_staticRenderFns$e = [];
|
|
901
|
-
var __component__$e = /*#__PURE__*/normalizeComponent(_sfc_main$e, _sfc_render$e, _sfc_staticRenderFns$e, false, null, "
|
|
1341
|
+
var __component__$e = /*#__PURE__*/normalizeComponent(_sfc_main$e, _sfc_render$e, _sfc_staticRenderFns$e, false, null, "d09f8396", null, null);
|
|
902
1342
|
var CrudHeader = __component__$e.exports;var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
903
1343
|
|
|
904
1344
|
function getDefaultExportFromCjs (x) {
|
|
@@ -7049,7 +7489,7 @@ Sortable.mount(Remove, Revert);var sortable_esm=/*#__PURE__*/Object.freeze({__pr
|
|
|
7049
7489
|
} (vuedraggable_umd, vuedraggable_umd.exports));
|
|
7050
7490
|
|
|
7051
7491
|
var vuedraggable_umdExports = vuedraggable_umd.exports;
|
|
7052
|
-
var draggable = /*@__PURE__*/getDefaultExportFromCjs(vuedraggable_umdExports);var css$6 = "\r\n/* Fijar ancho de la columna de acciones en el header */\n.actions-header[data-v-
|
|
7492
|
+
var draggable = /*@__PURE__*/getDefaultExportFromCjs(vuedraggable_umdExports);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";
|
|
7053
7493
|
n(css$6, {});var _sfc_main$d = {
|
|
7054
7494
|
name: 'TableHeader',
|
|
7055
7495
|
inject: ['columns', 'enableFilters', 'filtersVisible', 'isColumnHasFilter', 'internalFilterByProp', 'onChangeFilter', 'toggleAll', 'toggleSortFilter', 'sortable', 'optionsLoaded', 'isAllSelected'],
|
|
@@ -7106,7 +7546,7 @@ var _sfc_render$d = function render() {
|
|
|
7106
7546
|
_vm.hoveredColumn = null;
|
|
7107
7547
|
}
|
|
7108
7548
|
}
|
|
7109
|
-
}, [_vm.enableFilters && _vm.filtersVisible && _vm.isColumnHasFilter(column) && _vm.internalFilterByProp(column.prop) ? _vm._t('filter-' + column.prop, function () {
|
|
7549
|
+
}, [_vm.enableFilters && _vm.filtersVisible && _vm.isColumnHasFilter(column) && (_vm.internalFilterByProp(column.prop) || _vm.internalFilterByProp(column.prop + '_from')) ? _vm._t('filter-' + column.prop, function () {
|
|
7110
7550
|
return [_c('div', {
|
|
7111
7551
|
staticClass: "form-group"
|
|
7112
7552
|
}, [column.type == 'boolean' ? _c('select', {
|
|
@@ -7178,7 +7618,75 @@ var _sfc_render$d = function render() {
|
|
|
7178
7618
|
},
|
|
7179
7619
|
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
7180
7620
|
}
|
|
7181
|
-
})], 1)]) : column.type == '
|
|
7621
|
+
})], 1)]) : column.type == 'number' || column.type == 'money' || column.type == 'price' ? _c('div', {
|
|
7622
|
+
staticClass: "row"
|
|
7623
|
+
}, [_c('div', {
|
|
7624
|
+
staticClass: "col-6"
|
|
7625
|
+
}, [_c('input', {
|
|
7626
|
+
directives: [{
|
|
7627
|
+
name: "model",
|
|
7628
|
+
rawName: "v-model.number",
|
|
7629
|
+
value: _vm.internalFilterByProp(column.prop + '_from').value,
|
|
7630
|
+
expression: "internalFilterByProp(column.prop + '_from').value",
|
|
7631
|
+
modifiers: {
|
|
7632
|
+
"number": true
|
|
7633
|
+
}
|
|
7634
|
+
}],
|
|
7635
|
+
staticClass: "form-control form-control-md p-2",
|
|
7636
|
+
attrs: {
|
|
7637
|
+
"type": "number",
|
|
7638
|
+
"step": column.type == 'money' || column.type == 'price' ? '0.01' : '1',
|
|
7639
|
+
"placeholder": "Desde"
|
|
7640
|
+
},
|
|
7641
|
+
domProps: {
|
|
7642
|
+
"value": _vm.internalFilterByProp(column.prop + '_from').value
|
|
7643
|
+
},
|
|
7644
|
+
on: {
|
|
7645
|
+
"change": function change($event) {
|
|
7646
|
+
return _vm.onChangeFilter($event);
|
|
7647
|
+
},
|
|
7648
|
+
"input": function input($event) {
|
|
7649
|
+
if ($event.target.composing) return;
|
|
7650
|
+
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", _vm._n($event.target.value));
|
|
7651
|
+
},
|
|
7652
|
+
"blur": function blur($event) {
|
|
7653
|
+
return _vm.$forceUpdate();
|
|
7654
|
+
}
|
|
7655
|
+
}
|
|
7656
|
+
})]), _c('div', {
|
|
7657
|
+
staticClass: "col-6"
|
|
7658
|
+
}, [_c('input', {
|
|
7659
|
+
directives: [{
|
|
7660
|
+
name: "model",
|
|
7661
|
+
rawName: "v-model.number",
|
|
7662
|
+
value: _vm.internalFilterByProp(column.prop + '_to').value,
|
|
7663
|
+
expression: "internalFilterByProp(column.prop + '_to').value",
|
|
7664
|
+
modifiers: {
|
|
7665
|
+
"number": true
|
|
7666
|
+
}
|
|
7667
|
+
}],
|
|
7668
|
+
staticClass: "form-control form-control-md p-2",
|
|
7669
|
+
attrs: {
|
|
7670
|
+
"type": "number",
|
|
7671
|
+
"step": column.type == 'money' || column.type == 'price' ? '0.01' : '1',
|
|
7672
|
+
"placeholder": "Hasta"
|
|
7673
|
+
},
|
|
7674
|
+
domProps: {
|
|
7675
|
+
"value": _vm.internalFilterByProp(column.prop + '_to').value
|
|
7676
|
+
},
|
|
7677
|
+
on: {
|
|
7678
|
+
"change": function change($event) {
|
|
7679
|
+
return _vm.onChangeFilter($event);
|
|
7680
|
+
},
|
|
7681
|
+
"input": function input($event) {
|
|
7682
|
+
if ($event.target.composing) return;
|
|
7683
|
+
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", _vm._n($event.target.value));
|
|
7684
|
+
},
|
|
7685
|
+
"blur": function blur($event) {
|
|
7686
|
+
return _vm.$forceUpdate();
|
|
7687
|
+
}
|
|
7688
|
+
}
|
|
7689
|
+
})])]) : column.type == 'state' && column.options && Array.isArray(column.options) ? _c('select', {
|
|
7182
7690
|
directives: [{
|
|
7183
7691
|
name: "model",
|
|
7184
7692
|
rawName: "v-model",
|
|
@@ -7210,10 +7718,10 @@ var _sfc_render$d = function render() {
|
|
|
7210
7718
|
return _c('option', {
|
|
7211
7719
|
key: indexo,
|
|
7212
7720
|
domProps: {
|
|
7213
|
-
"value": option.
|
|
7721
|
+
"value": option.value
|
|
7214
7722
|
}
|
|
7215
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
7216
|
-
})], 2) : column.type == 'array' &&
|
|
7723
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
7724
|
+
})], 2) : column.type == 'array' && column.options && Array.isArray(column.options) ? _c('select', {
|
|
7217
7725
|
directives: [{
|
|
7218
7726
|
name: "model",
|
|
7219
7727
|
rawName: "v-model",
|
|
@@ -7245,9 +7753,9 @@ var _sfc_render$d = function render() {
|
|
|
7245
7753
|
return _c('option', {
|
|
7246
7754
|
key: indexo,
|
|
7247
7755
|
domProps: {
|
|
7248
|
-
"value": option.
|
|
7756
|
+
"value": option.value
|
|
7249
7757
|
}
|
|
7250
|
-
}, [_vm._v(" " + _vm._s(option.text
|
|
7758
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
7251
7759
|
})], 2) : column.type == 'checkbox' ? _c('b-form-checkbox', {
|
|
7252
7760
|
attrs: {
|
|
7253
7761
|
"name": "select-all",
|
|
@@ -7308,19 +7816,26 @@ var _sfc_render$d = function render() {
|
|
|
7308
7816
|
on: {
|
|
7309
7817
|
"change": _vm.toggleAll
|
|
7310
7818
|
}
|
|
7311
|
-
})], 1) : _c('span', [_vm._v(_vm._s(column.label))]), _vm.isSortableColumn(column)
|
|
7312
|
-
staticClass: "sort-filter",
|
|
7819
|
+
})], 1) : _c('span', [_vm._v(_vm._s(column.label))]), _vm.isSortableColumn(column) ? _c('span', {
|
|
7820
|
+
staticClass: "sort-filter ml-1",
|
|
7821
|
+
class: {
|
|
7822
|
+
'sort-filter-visible': _vm.shouldShowSortIcon(column)
|
|
7823
|
+
},
|
|
7313
7824
|
on: {
|
|
7314
7825
|
"click": function click($event) {
|
|
7315
7826
|
return _vm.toggleSortFilter(column);
|
|
7316
7827
|
}
|
|
7317
7828
|
}
|
|
7318
|
-
}, [_vm.getSortIconDirection(column) === 'up' ? _c('b-icon-sort-up') : _vm.
|
|
7829
|
+
}, [_vm.getSortIconDirection(column) === 'up' ? _c('b-icon-sort-up') : _vm.getSortIconDirection(column) === 'down' ? _c('b-icon-sort-down') : _c('b-icon-sort-up', {
|
|
7830
|
+
staticStyle: {
|
|
7831
|
+
"visibility": "hidden"
|
|
7832
|
+
}
|
|
7833
|
+
})], 1) : _vm._e()], 2);
|
|
7319
7834
|
});
|
|
7320
7835
|
})], 2)]);
|
|
7321
7836
|
};
|
|
7322
7837
|
var _sfc_staticRenderFns$d = [];
|
|
7323
|
-
var __component__$d = /*#__PURE__*/normalizeComponent(_sfc_main$d, _sfc_render$d, _sfc_staticRenderFns$d, false, null, "
|
|
7838
|
+
var __component__$d = /*#__PURE__*/normalizeComponent(_sfc_main$d, _sfc_render$d, _sfc_staticRenderFns$d, false, null, "3de96e53", null, null);
|
|
7324
7839
|
var TableHeader = __component__$d.exports;function commonjsRequire(path) {
|
|
7325
7840
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
7326
7841
|
}var moment$1 = {exports: {}};moment$1.exports;
|
|
@@ -13008,7 +13523,7 @@ var TableHeader = __component__$d.exports;function commonjsRequire(path) {
|
|
|
13008
13523
|
} (moment$1, moment$1.exports));
|
|
13009
13524
|
|
|
13010
13525
|
var momentExports = moment$1.exports;
|
|
13011
|
-
var moment = /*@__PURE__*/getDefaultExportFromCjs(momentExports);var css$5 = "\r\n/* Fijar ancho de la columna de acciones */\n.actions-cell[data-v-
|
|
13526
|
+
var moment = /*@__PURE__*/getDefaultExportFromCjs(momentExports);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";
|
|
13012
13527
|
n(css$5, {});var _sfc_main$c = {
|
|
13013
13528
|
name: 'TableCell',
|
|
13014
13529
|
props: {
|
|
@@ -13017,11 +13532,54 @@ n(css$5, {});var _sfc_main$c = {
|
|
|
13017
13532
|
index: Number,
|
|
13018
13533
|
columnIndex: Number
|
|
13019
13534
|
},
|
|
13020
|
-
inject: ['itemValue', 'getStateValue', 'getArrayValue', 'onCheckSelect', 'showItem', 'updateItem', 'removeItem', 'optionsLoaded'],
|
|
13535
|
+
inject: ['itemValue', 'getStateValue', 'getStateOptions', 'getStateBadgeVariant', 'getArrayValue', 'onCheckSelect', 'showItem', 'updateItem', 'removeItem', 'optionsLoaded'],
|
|
13021
13536
|
data: function data() {
|
|
13022
13537
|
return {
|
|
13023
13538
|
moment: moment
|
|
13024
13539
|
};
|
|
13540
|
+
},
|
|
13541
|
+
computed: {
|
|
13542
|
+
stateOptions: function stateOptions() {
|
|
13543
|
+
// Permitir usar opciones incluso si optionsLoaded es false, ya que getStateOptions normaliza internamente
|
|
13544
|
+
if (this.column.type === 'state' && this.column.options && Array.isArray(this.column.options)) {
|
|
13545
|
+
var itemVal = this.itemValue(this.column, this.item);
|
|
13546
|
+
var options = this.column.options;
|
|
13547
|
+
var result = this.getStateOptions(itemVal, options);
|
|
13548
|
+
return result;
|
|
13549
|
+
}
|
|
13550
|
+
return [];
|
|
13551
|
+
}
|
|
13552
|
+
},
|
|
13553
|
+
methods: {
|
|
13554
|
+
formatNumber: function formatNumber(value, column) {
|
|
13555
|
+
if (value === null || value === undefined || value === '') {
|
|
13556
|
+
return '';
|
|
13557
|
+
}
|
|
13558
|
+
var numValue = parseFloat(value);
|
|
13559
|
+
if (isNaN(numValue)) {
|
|
13560
|
+
return value;
|
|
13561
|
+
}
|
|
13562
|
+
var thousandsSep = column.thousandsSeparator || '.';
|
|
13563
|
+
var decimalSep = column.decimalSeparator || ',';
|
|
13564
|
+
var decimals = column.decimals !== undefined ? column.decimals : numValue % 1 === 0 ? 0 : 2;
|
|
13565
|
+
|
|
13566
|
+
// Formatear número con separadores
|
|
13567
|
+
var parts = numValue.toFixed(decimals).split('.');
|
|
13568
|
+
var integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSep);
|
|
13569
|
+
var decimalPart = parts[1] || '';
|
|
13570
|
+
if (decimals > 0 && decimalPart) {
|
|
13571
|
+
return "".concat(integerPart).concat(decimalSep).concat(decimalPart);
|
|
13572
|
+
}
|
|
13573
|
+
return integerPart;
|
|
13574
|
+
},
|
|
13575
|
+
formatMoney: function formatMoney(value, column) {
|
|
13576
|
+
var formatted = this.formatNumber(value, column);
|
|
13577
|
+
if (formatted === '') {
|
|
13578
|
+
return '';
|
|
13579
|
+
}
|
|
13580
|
+
var symbol = column.symbol || '$';
|
|
13581
|
+
return "".concat(symbol).concat(formatted);
|
|
13582
|
+
}
|
|
13025
13583
|
}
|
|
13026
13584
|
};
|
|
13027
13585
|
var _sfc_render$c = function render() {
|
|
@@ -13069,7 +13627,15 @@ var _sfc_render$c = function render() {
|
|
|
13069
13627
|
},
|
|
13070
13628
|
expression: "item.selected"
|
|
13071
13629
|
}
|
|
13072
|
-
})], 1) : _vm.column.type == 'state'
|
|
13630
|
+
})], 1) : _vm.column.type == 'state' ? _c('span', [_vm.stateOptions.length > 0 ? _vm._l(_vm.stateOptions, function (option, optIndex) {
|
|
13631
|
+
return _c('b-badge', {
|
|
13632
|
+
key: optIndex,
|
|
13633
|
+
staticClass: "mr-1",
|
|
13634
|
+
attrs: {
|
|
13635
|
+
"variant": _vm.getStateBadgeVariant(option)
|
|
13636
|
+
}
|
|
13637
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
13638
|
+
}) : _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)) + " ")])];
|
|
13073
13639
|
}, {
|
|
13074
13640
|
"item": _vm.item,
|
|
13075
13641
|
"index": _vm.index,
|
|
@@ -13088,27 +13654,35 @@ var _sfc_render$c = function render() {
|
|
|
13088
13654
|
},
|
|
13089
13655
|
proxy: true
|
|
13090
13656
|
}], null, false, 4241371057)
|
|
13091
|
-
}, [_vm._t("
|
|
13092
|
-
return [
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13657
|
+
}, [_vm._t("rowActions", function () {
|
|
13658
|
+
return [_vm._t("rowAction", function () {
|
|
13659
|
+
return [_c('b-dropdown-item', {
|
|
13660
|
+
on: {
|
|
13661
|
+
"click": function click($event) {
|
|
13662
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
13663
|
+
}
|
|
13096
13664
|
}
|
|
13097
|
-
}
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13665
|
+
}, [_c('b-icon-eye'), _vm._v(" Ver ")], 1), _c('b-dropdown-item', {
|
|
13666
|
+
on: {
|
|
13667
|
+
"click": function click($event) {
|
|
13668
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
13669
|
+
}
|
|
13102
13670
|
}
|
|
13103
|
-
}
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13671
|
+
}, [_c('b-icon-pencil'), _vm._v(" Editar ")], 1), _c('b-dropdown-item', {
|
|
13672
|
+
staticClass: "text-danger",
|
|
13673
|
+
on: {
|
|
13674
|
+
"click": function click($event) {
|
|
13675
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
13676
|
+
}
|
|
13109
13677
|
}
|
|
13110
|
-
}
|
|
13111
|
-
},
|
|
13678
|
+
}, [_c('b-icon-trash'), _vm._v(" Eliminar ")], 1)];
|
|
13679
|
+
}, {
|
|
13680
|
+
"item": _vm.item,
|
|
13681
|
+
"index": _vm.index,
|
|
13682
|
+
"showItem": _vm.showItem,
|
|
13683
|
+
"updateItem": _vm.updateItem,
|
|
13684
|
+
"removeItem": _vm.removeItem
|
|
13685
|
+
})];
|
|
13112
13686
|
}, {
|
|
13113
13687
|
"item": _vm.item,
|
|
13114
13688
|
"index": _vm.index,
|
|
@@ -13117,35 +13691,43 @@ var _sfc_render$c = function render() {
|
|
|
13117
13691
|
"removeItem": _vm.removeItem
|
|
13118
13692
|
})], 2) : _vm.column.type == 'actions' ? _c('b-button-group', {
|
|
13119
13693
|
staticClass: "actions-button-group"
|
|
13120
|
-
}, [_vm._t("
|
|
13121
|
-
return [
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13694
|
+
}, [_vm._t("rowActions", function () {
|
|
13695
|
+
return [_vm._t("rowAction", function () {
|
|
13696
|
+
return [_c('b-button', {
|
|
13697
|
+
attrs: {
|
|
13698
|
+
"variant": "primary"
|
|
13699
|
+
},
|
|
13700
|
+
on: {
|
|
13701
|
+
"click": function click($event) {
|
|
13702
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
13703
|
+
}
|
|
13128
13704
|
}
|
|
13129
|
-
}
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13705
|
+
}, [_c('b-icon-eye')], 1), _c('b-button', {
|
|
13706
|
+
attrs: {
|
|
13707
|
+
"variant": "secondary"
|
|
13708
|
+
},
|
|
13709
|
+
on: {
|
|
13710
|
+
"click": function click($event) {
|
|
13711
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
13712
|
+
}
|
|
13137
13713
|
}
|
|
13138
|
-
}
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13714
|
+
}, [_c('b-icon-pencil')], 1), _c('b-button', {
|
|
13715
|
+
attrs: {
|
|
13716
|
+
"variant": "danger"
|
|
13717
|
+
},
|
|
13718
|
+
on: {
|
|
13719
|
+
"click": function click($event) {
|
|
13720
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
13721
|
+
}
|
|
13146
13722
|
}
|
|
13147
|
-
}
|
|
13148
|
-
},
|
|
13723
|
+
}, [_c('b-icon-trash')], 1)];
|
|
13724
|
+
}, {
|
|
13725
|
+
"item": _vm.item,
|
|
13726
|
+
"index": _vm.index,
|
|
13727
|
+
"showItem": _vm.showItem,
|
|
13728
|
+
"updateItem": _vm.updateItem,
|
|
13729
|
+
"removeItem": _vm.removeItem
|
|
13730
|
+
})];
|
|
13149
13731
|
}, {
|
|
13150
13732
|
"item": _vm.item,
|
|
13151
13733
|
"index": _vm.index,
|
|
@@ -13155,7 +13737,7 @@ var _sfc_render$c = function render() {
|
|
|
13155
13737
|
})], 2) : _vm._e()], 2);
|
|
13156
13738
|
};
|
|
13157
13739
|
var _sfc_staticRenderFns$c = [];
|
|
13158
|
-
var __component__$c = /*#__PURE__*/normalizeComponent(_sfc_main$c, _sfc_render$c, _sfc_staticRenderFns$c, false, null, "
|
|
13740
|
+
var __component__$c = /*#__PURE__*/normalizeComponent(_sfc_main$c, _sfc_render$c, _sfc_staticRenderFns$c, false, null, "e38a3192", null, null);
|
|
13159
13741
|
var TableCell = __component__$c.exports;var _sfc_main$b = {
|
|
13160
13742
|
name: 'TableRow',
|
|
13161
13743
|
components: {
|
|
@@ -13196,7 +13778,15 @@ var _sfc_render$b = function render() {
|
|
|
13196
13778
|
"item": _vm.item,
|
|
13197
13779
|
"index": _vm.index,
|
|
13198
13780
|
"columnIndex": indexc
|
|
13199
|
-
}
|
|
13781
|
+
},
|
|
13782
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
13783
|
+
return {
|
|
13784
|
+
key: name,
|
|
13785
|
+
fn: function fn(slotProps) {
|
|
13786
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
13787
|
+
}
|
|
13788
|
+
};
|
|
13789
|
+
})], null, true)
|
|
13200
13790
|
});
|
|
13201
13791
|
});
|
|
13202
13792
|
}, {
|
|
@@ -13217,12 +13807,24 @@ var TableRow = __component__$b.exports;var _sfc_main$a = {
|
|
|
13217
13807
|
return {
|
|
13218
13808
|
drag: false
|
|
13219
13809
|
};
|
|
13810
|
+
},
|
|
13811
|
+
computed: {
|
|
13812
|
+
currentDisplayMode: function currentDisplayMode() {
|
|
13813
|
+
if (!this.displayMode) return 1;
|
|
13814
|
+
if (this.displayMode.value !== undefined) {
|
|
13815
|
+
return this.displayMode.value;
|
|
13816
|
+
}
|
|
13817
|
+
if (typeof this.displayMode === 'function') {
|
|
13818
|
+
return this.displayMode();
|
|
13819
|
+
}
|
|
13820
|
+
return this.displayMode;
|
|
13821
|
+
}
|
|
13220
13822
|
}
|
|
13221
13823
|
};
|
|
13222
13824
|
var _sfc_render$a = function render() {
|
|
13223
13825
|
var _vm = this,
|
|
13224
13826
|
_c = _vm._self._c;
|
|
13225
|
-
return _vm.
|
|
13827
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_TABLE ? _c('div', {
|
|
13226
13828
|
class: ['table-responsive', _vm.tableContainerClass]
|
|
13227
13829
|
}, [_c('table', {
|
|
13228
13830
|
class: ['table table-hover table-striped w-100', _vm.tableClass]
|
|
@@ -13258,7 +13860,15 @@ var _sfc_render$a = function render() {
|
|
|
13258
13860
|
"item": item,
|
|
13259
13861
|
"index": index,
|
|
13260
13862
|
"grouped": _vm.grouped
|
|
13261
|
-
}
|
|
13863
|
+
},
|
|
13864
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
13865
|
+
return {
|
|
13866
|
+
key: name,
|
|
13867
|
+
fn: function fn(slotProps) {
|
|
13868
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
13869
|
+
}
|
|
13870
|
+
};
|
|
13871
|
+
})], null, true)
|
|
13262
13872
|
});
|
|
13263
13873
|
}), 1)], 1), !_vm.loading && _vm.itemsList && _vm.itemsList.length == 0 && !_vm.infiniteScroll ? _c('p', {
|
|
13264
13874
|
staticClass: "p-3"
|
|
@@ -13515,10 +14125,49 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
13515
14125
|
cardHideFooter: Boolean,
|
|
13516
14126
|
itemValue: Function,
|
|
13517
14127
|
getStateValue: Function,
|
|
14128
|
+
getStateOptions: Function,
|
|
14129
|
+
getStateBadgeVariant: Function,
|
|
13518
14130
|
getArrayValue: Function,
|
|
13519
14131
|
showItem: Function,
|
|
13520
14132
|
updateItem: Function,
|
|
13521
14133
|
removeItem: Function
|
|
14134
|
+
},
|
|
14135
|
+
methods: {
|
|
14136
|
+
getStateOptionsForColumn: function getStateOptionsForColumn(column, item) {
|
|
14137
|
+
if (column.type === 'state' && column.options) {
|
|
14138
|
+
return this.getStateOptions(this.itemValue(column, item), column.options);
|
|
14139
|
+
}
|
|
14140
|
+
return [];
|
|
14141
|
+
},
|
|
14142
|
+
formatNumber: function formatNumber(value, column) {
|
|
14143
|
+
if (value === null || value === undefined || value === '') {
|
|
14144
|
+
return '';
|
|
14145
|
+
}
|
|
14146
|
+
var numValue = parseFloat(value);
|
|
14147
|
+
if (isNaN(numValue)) {
|
|
14148
|
+
return value;
|
|
14149
|
+
}
|
|
14150
|
+
var thousandsSep = column.thousandsSeparator || '.';
|
|
14151
|
+
var decimalSep = column.decimalSeparator || ',';
|
|
14152
|
+
var decimals = column.decimals !== undefined ? column.decimals : numValue % 1 === 0 ? 0 : 2;
|
|
14153
|
+
|
|
14154
|
+
// Formatear número con separadores
|
|
14155
|
+
var parts = numValue.toFixed(decimals).split('.');
|
|
14156
|
+
var integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSep);
|
|
14157
|
+
var decimalPart = parts[1] || '';
|
|
14158
|
+
if (decimals > 0 && decimalPart) {
|
|
14159
|
+
return "".concat(integerPart).concat(decimalSep).concat(decimalPart);
|
|
14160
|
+
}
|
|
14161
|
+
return integerPart;
|
|
14162
|
+
},
|
|
14163
|
+
formatMoney: function formatMoney(value, column) {
|
|
14164
|
+
var formatted = this.formatNumber(value, column);
|
|
14165
|
+
if (formatted === '') {
|
|
14166
|
+
return '';
|
|
14167
|
+
}
|
|
14168
|
+
var symbol = column.symbol || '$';
|
|
14169
|
+
return "".concat(symbol).concat(formatted);
|
|
14170
|
+
}
|
|
13522
14171
|
}
|
|
13523
14172
|
};
|
|
13524
14173
|
var _sfc_render$9 = function render() {
|
|
@@ -13537,35 +14186,43 @@ var _sfc_render$9 = function render() {
|
|
|
13537
14186
|
scopedSlots: _vm._u([{
|
|
13538
14187
|
key: "footer",
|
|
13539
14188
|
fn: function fn() {
|
|
13540
|
-
return [_c('b-button-group', [_vm._t("
|
|
13541
|
-
return [
|
|
13542
|
-
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
14189
|
+
return [_c('b-button-group', [_vm._t("rowActions", function () {
|
|
14190
|
+
return [_vm._t("rowAction", function () {
|
|
14191
|
+
return [_c('b-button', {
|
|
14192
|
+
attrs: {
|
|
14193
|
+
"variant": "primary"
|
|
14194
|
+
},
|
|
14195
|
+
on: {
|
|
14196
|
+
"click": function click($event) {
|
|
14197
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
14198
|
+
}
|
|
13548
14199
|
}
|
|
13549
|
-
}
|
|
13550
|
-
|
|
13551
|
-
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
14200
|
+
}, [_c('b-icon-eye')], 1), _c('b-button', {
|
|
14201
|
+
attrs: {
|
|
14202
|
+
"variant": "secondary"
|
|
14203
|
+
},
|
|
14204
|
+
on: {
|
|
14205
|
+
"click": function click($event) {
|
|
14206
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
14207
|
+
}
|
|
13557
14208
|
}
|
|
13558
|
-
}
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
14209
|
+
}, [_c('b-icon-pencil')], 1), _c('b-button', {
|
|
14210
|
+
attrs: {
|
|
14211
|
+
"variant": "danger"
|
|
14212
|
+
},
|
|
14213
|
+
on: {
|
|
14214
|
+
"click": function click($event) {
|
|
14215
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
14216
|
+
}
|
|
13566
14217
|
}
|
|
13567
|
-
}
|
|
13568
|
-
},
|
|
14218
|
+
}, [_c('b-icon-trash')], 1)];
|
|
14219
|
+
}, {
|
|
14220
|
+
"item": _vm.item,
|
|
14221
|
+
"index": _vm.index,
|
|
14222
|
+
"showItem": _vm.showItem,
|
|
14223
|
+
"updateItem": _vm.updateItem,
|
|
14224
|
+
"removeItem": _vm.removeItem
|
|
14225
|
+
})];
|
|
13569
14226
|
}, {
|
|
13570
14227
|
"item": _vm.item,
|
|
13571
14228
|
"index": _vm.index,
|
|
@@ -13589,7 +14246,15 @@ var _sfc_render$9 = function render() {
|
|
|
13589
14246
|
attrs: {
|
|
13590
14247
|
"variant": "danger"
|
|
13591
14248
|
}
|
|
13592
|
-
}, [_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.
|
|
14249
|
+
}, [_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) {
|
|
14250
|
+
return _c('b-badge', {
|
|
14251
|
+
key: optIndex,
|
|
14252
|
+
staticClass: "mr-1",
|
|
14253
|
+
attrs: {
|
|
14254
|
+
"variant": _vm.getStateBadgeVariant(option)
|
|
14255
|
+
}
|
|
14256
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
14257
|
+
}) : _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)) + " ")])];
|
|
13593
14258
|
}, {
|
|
13594
14259
|
"item": _vm.item,
|
|
13595
14260
|
"index": _vm.index,
|
|
@@ -13611,17 +14276,29 @@ var _sfc_main$8 = {
|
|
|
13611
14276
|
draggable: draggable,
|
|
13612
14277
|
ItemCard: ItemCard
|
|
13613
14278
|
},
|
|
13614
|
-
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'],
|
|
14279
|
+
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'],
|
|
13615
14280
|
data: function data() {
|
|
13616
14281
|
return {
|
|
13617
14282
|
drag: false
|
|
13618
14283
|
};
|
|
14284
|
+
},
|
|
14285
|
+
computed: {
|
|
14286
|
+
currentDisplayMode: function currentDisplayMode() {
|
|
14287
|
+
if (!this.displayMode) return 1;
|
|
14288
|
+
if (this.displayMode.value !== undefined) {
|
|
14289
|
+
return this.displayMode.value;
|
|
14290
|
+
}
|
|
14291
|
+
if (typeof this.displayMode === 'function') {
|
|
14292
|
+
return this.displayMode();
|
|
14293
|
+
}
|
|
14294
|
+
return this.displayMode;
|
|
14295
|
+
}
|
|
13619
14296
|
}
|
|
13620
14297
|
};
|
|
13621
14298
|
var _sfc_render$8 = function render() {
|
|
13622
14299
|
var _vm = this,
|
|
13623
14300
|
_c = _vm._self._c;
|
|
13624
|
-
return _vm.
|
|
14301
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_CARDS ? _c('div', [_c('draggable', {
|
|
13625
14302
|
attrs: {
|
|
13626
14303
|
"group": _vm.draggableGroup,
|
|
13627
14304
|
"draggable": _vm.orderable ? '.item' : '.none',
|
|
@@ -13680,11 +14357,21 @@ var _sfc_render$8 = function render() {
|
|
|
13680
14357
|
"cardHideFooter": _vm.cardHideFooter,
|
|
13681
14358
|
"itemValue": _vm.itemValue,
|
|
13682
14359
|
"getStateValue": _vm.getStateValue,
|
|
14360
|
+
"getStateOptions": _vm.getStateOptions,
|
|
14361
|
+
"getStateBadgeVariant": _vm.getStateBadgeVariant,
|
|
13683
14362
|
"getArrayValue": _vm.getArrayValue,
|
|
13684
14363
|
"showItem": _vm.showItem,
|
|
13685
14364
|
"updateItem": _vm.updateItem,
|
|
13686
14365
|
"removeItem": _vm.removeItem
|
|
13687
|
-
}
|
|
14366
|
+
},
|
|
14367
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
14368
|
+
return {
|
|
14369
|
+
key: name,
|
|
14370
|
+
fn: function fn(slotProps) {
|
|
14371
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
14372
|
+
}
|
|
14373
|
+
};
|
|
14374
|
+
})], null, true)
|
|
13688
14375
|
})];
|
|
13689
14376
|
}, {
|
|
13690
14377
|
"item": item
|
|
@@ -13695,7 +14382,7 @@ var _sfc_render$8 = function render() {
|
|
|
13695
14382
|
};
|
|
13696
14383
|
var _sfc_staticRenderFns$8 = [];
|
|
13697
14384
|
var __component__$8 = /*#__PURE__*/normalizeComponent(_sfc_main$8, _sfc_render$8, _sfc_staticRenderFns$8, false, null, null, null, null);
|
|
13698
|
-
var CrudCards = __component__$8.exports;var css$4 = "\n.kanban-card[data-v-
|
|
14385
|
+
var CrudCards = __component__$8.exports;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";
|
|
13699
14386
|
n(css$4, {});var _sfc_main$7 = {
|
|
13700
14387
|
name: 'KanbanCard',
|
|
13701
14388
|
props: {
|
|
@@ -13706,10 +14393,49 @@ n(css$4, {});var _sfc_main$7 = {
|
|
|
13706
14393
|
cardHideFooter: Boolean,
|
|
13707
14394
|
itemValue: Function,
|
|
13708
14395
|
getStateValue: Function,
|
|
14396
|
+
getStateOptions: Function,
|
|
14397
|
+
getStateBadgeVariant: Function,
|
|
13709
14398
|
getArrayValue: Function,
|
|
13710
14399
|
showItem: Function,
|
|
13711
14400
|
updateItem: Function,
|
|
13712
14401
|
removeItem: Function
|
|
14402
|
+
},
|
|
14403
|
+
methods: {
|
|
14404
|
+
getStateOptionsForColumn: function getStateOptionsForColumn(column, item) {
|
|
14405
|
+
if (column.type === 'state' && column.options) {
|
|
14406
|
+
return this.getStateOptions(this.itemValue(column, item), column.options);
|
|
14407
|
+
}
|
|
14408
|
+
return [];
|
|
14409
|
+
},
|
|
14410
|
+
formatNumber: function formatNumber(value, column) {
|
|
14411
|
+
if (value === null || value === undefined || value === '') {
|
|
14412
|
+
return '';
|
|
14413
|
+
}
|
|
14414
|
+
var numValue = parseFloat(value);
|
|
14415
|
+
if (isNaN(numValue)) {
|
|
14416
|
+
return value;
|
|
14417
|
+
}
|
|
14418
|
+
var thousandsSep = column.thousandsSeparator || '.';
|
|
14419
|
+
var decimalSep = column.decimalSeparator || ',';
|
|
14420
|
+
var decimals = column.decimals !== undefined ? column.decimals : numValue % 1 === 0 ? 0 : 2;
|
|
14421
|
+
|
|
14422
|
+
// Formatear número con separadores
|
|
14423
|
+
var parts = numValue.toFixed(decimals).split('.');
|
|
14424
|
+
var integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSep);
|
|
14425
|
+
var decimalPart = parts[1] || '';
|
|
14426
|
+
if (decimals > 0 && decimalPart) {
|
|
14427
|
+
return "".concat(integerPart).concat(decimalSep).concat(decimalPart);
|
|
14428
|
+
}
|
|
14429
|
+
return integerPart;
|
|
14430
|
+
},
|
|
14431
|
+
formatMoney: function formatMoney(value, column) {
|
|
14432
|
+
var formatted = this.formatNumber(value, column);
|
|
14433
|
+
if (formatted === '') {
|
|
14434
|
+
return '';
|
|
14435
|
+
}
|
|
14436
|
+
var symbol = column.symbol || '$';
|
|
14437
|
+
return "".concat(symbol).concat(formatted);
|
|
14438
|
+
}
|
|
13713
14439
|
}
|
|
13714
14440
|
};
|
|
13715
14441
|
var _sfc_render$7 = function render() {
|
|
@@ -13732,35 +14458,43 @@ var _sfc_render$7 = function render() {
|
|
|
13732
14458
|
attrs: {
|
|
13733
14459
|
"size": "sm"
|
|
13734
14460
|
}
|
|
13735
|
-
}, [_vm._t("
|
|
13736
|
-
return [
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13742
|
-
|
|
14461
|
+
}, [_vm._t("rowActions", function () {
|
|
14462
|
+
return [_vm._t("rowAction", function () {
|
|
14463
|
+
return [_c('b-button', {
|
|
14464
|
+
attrs: {
|
|
14465
|
+
"variant": "primary"
|
|
14466
|
+
},
|
|
14467
|
+
on: {
|
|
14468
|
+
"click": function click($event) {
|
|
14469
|
+
return _vm.showItem(_vm.item.id, _vm.index);
|
|
14470
|
+
}
|
|
13743
14471
|
}
|
|
13744
|
-
}
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
14472
|
+
}, [_c('b-icon-eye')], 1), _c('b-button', {
|
|
14473
|
+
attrs: {
|
|
14474
|
+
"variant": "secondary"
|
|
14475
|
+
},
|
|
14476
|
+
on: {
|
|
14477
|
+
"click": function click($event) {
|
|
14478
|
+
return _vm.updateItem(_vm.item.id, _vm.index);
|
|
14479
|
+
}
|
|
13752
14480
|
}
|
|
13753
|
-
}
|
|
13754
|
-
|
|
13755
|
-
|
|
13756
|
-
|
|
13757
|
-
|
|
13758
|
-
|
|
13759
|
-
|
|
13760
|
-
|
|
14481
|
+
}, [_c('b-icon-pencil')], 1), _c('b-button', {
|
|
14482
|
+
attrs: {
|
|
14483
|
+
"variant": "danger"
|
|
14484
|
+
},
|
|
14485
|
+
on: {
|
|
14486
|
+
"click": function click($event) {
|
|
14487
|
+
return _vm.removeItem(_vm.item.id, _vm.index);
|
|
14488
|
+
}
|
|
13761
14489
|
}
|
|
13762
|
-
}
|
|
13763
|
-
},
|
|
14490
|
+
}, [_c('b-icon-trash')], 1)];
|
|
14491
|
+
}, {
|
|
14492
|
+
"item": _vm.item,
|
|
14493
|
+
"index": _vm.index,
|
|
14494
|
+
"showItem": _vm.showItem,
|
|
14495
|
+
"updateItem": _vm.updateItem,
|
|
14496
|
+
"removeItem": _vm.removeItem
|
|
14497
|
+
})];
|
|
13764
14498
|
}, {
|
|
13765
14499
|
"item": _vm.item,
|
|
13766
14500
|
"index": _vm.index,
|
|
@@ -13788,7 +14522,15 @@ var _sfc_render$7 = function render() {
|
|
|
13788
14522
|
attrs: {
|
|
13789
14523
|
"variant": "danger"
|
|
13790
14524
|
}
|
|
13791
|
-
}, [_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.
|
|
14525
|
+
}, [_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) {
|
|
14526
|
+
return _c('b-badge', {
|
|
14527
|
+
key: optIndex,
|
|
14528
|
+
staticClass: "mr-1",
|
|
14529
|
+
attrs: {
|
|
14530
|
+
"variant": _vm.getStateBadgeVariant(option)
|
|
14531
|
+
}
|
|
14532
|
+
}, [_vm._v(" " + _vm._s(option.text) + " ")]);
|
|
14533
|
+
}) : _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)) + " ")])];
|
|
13792
14534
|
}, {
|
|
13793
14535
|
"item": _vm.item,
|
|
13794
14536
|
"index": _vm.index,
|
|
@@ -13801,8 +14543,8 @@ var _sfc_render$7 = function render() {
|
|
|
13801
14543
|
})], 2)], 1);
|
|
13802
14544
|
};
|
|
13803
14545
|
var _sfc_staticRenderFns$7 = [];
|
|
13804
|
-
var __component__$7 = /*#__PURE__*/normalizeComponent(_sfc_main$7, _sfc_render$7, _sfc_staticRenderFns$7, false, null, "
|
|
13805
|
-
var KanbanCard = __component__$7.exports;var css$3 = "\n.kanban-column[data-v-
|
|
14546
|
+
var __component__$7 = /*#__PURE__*/normalizeComponent(_sfc_main$7, _sfc_render$7, _sfc_staticRenderFns$7, false, null, "ad923ee1", null, null);
|
|
14547
|
+
var KanbanCard = __component__$7.exports;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";
|
|
13806
14548
|
n(css$3, {});var _sfc_main$6 = {
|
|
13807
14549
|
name: 'KanbanColumn',
|
|
13808
14550
|
components: {
|
|
@@ -13816,6 +14558,8 @@ n(css$3, {});var _sfc_main$6 = {
|
|
|
13816
14558
|
columns: Array,
|
|
13817
14559
|
itemValue: Function,
|
|
13818
14560
|
getStateValue: Function,
|
|
14561
|
+
getStateOptions: Function,
|
|
14562
|
+
getStateBadgeVariant: Function,
|
|
13819
14563
|
getArrayValue: Function,
|
|
13820
14564
|
showItem: Function,
|
|
13821
14565
|
updateItem: Function,
|
|
@@ -13884,11 +14628,21 @@ var _sfc_render$6 = function render() {
|
|
|
13884
14628
|
"cardHideFooter": _vm.cardHideFooter,
|
|
13885
14629
|
"itemValue": _vm.itemValue,
|
|
13886
14630
|
"getStateValue": _vm.getStateValue,
|
|
14631
|
+
"getStateOptions": _vm.getStateOptions,
|
|
14632
|
+
"getStateBadgeVariant": _vm.getStateBadgeVariant,
|
|
13887
14633
|
"getArrayValue": _vm.getArrayValue,
|
|
13888
14634
|
"showItem": _vm.showItem,
|
|
13889
14635
|
"updateItem": _vm.updateItem,
|
|
13890
14636
|
"removeItem": _vm.removeItem
|
|
13891
|
-
}
|
|
14637
|
+
},
|
|
14638
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
14639
|
+
return {
|
|
14640
|
+
key: name,
|
|
14641
|
+
fn: function fn(slotProps) {
|
|
14642
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
14643
|
+
}
|
|
14644
|
+
};
|
|
14645
|
+
})], null, true)
|
|
13892
14646
|
})];
|
|
13893
14647
|
}, {
|
|
13894
14648
|
"item": item
|
|
@@ -13896,14 +14650,14 @@ var _sfc_render$6 = function render() {
|
|
|
13896
14650
|
}), 0)], 1);
|
|
13897
14651
|
};
|
|
13898
14652
|
var _sfc_staticRenderFns$6 = [];
|
|
13899
|
-
var __component__$6 = /*#__PURE__*/normalizeComponent(_sfc_main$6, _sfc_render$6, _sfc_staticRenderFns$6, false, null, "
|
|
13900
|
-
var KanbanColumn = __component__$6.exports;var css$2 = "\n.kanban-board[data-v-
|
|
14653
|
+
var __component__$6 = /*#__PURE__*/normalizeComponent(_sfc_main$6, _sfc_render$6, _sfc_staticRenderFns$6, false, null, "a56cf649", null, null);
|
|
14654
|
+
var KanbanColumn = __component__$6.exports;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";
|
|
13901
14655
|
n(css$2, {});var _sfc_main$5 = {
|
|
13902
14656
|
name: 'KanbanBoard',
|
|
13903
14657
|
components: {
|
|
13904
14658
|
KanbanColumn: KanbanColumn
|
|
13905
14659
|
},
|
|
13906
|
-
inject: ['items', 'groupedAttribute', 'columns', 'itemValue', 'getStateValue', 'getArrayValue', 'showItem', 'updateItem', 'removeItem', 'cardClass', 'cardHideFooter', 'onDraggableChange']
|
|
14660
|
+
inject: ['items', 'groupedAttribute', 'columns', 'itemValue', 'getStateValue', 'getStateOptions', 'getStateBadgeVariant', 'getArrayValue', 'showItem', 'updateItem', 'removeItem', 'cardClass', 'cardHideFooter', 'onDraggableChange']
|
|
13907
14661
|
};
|
|
13908
14662
|
var _sfc_render$5 = function render() {
|
|
13909
14663
|
var _vm = this,
|
|
@@ -13922,6 +14676,8 @@ var _sfc_render$5 = function render() {
|
|
|
13922
14676
|
"columns": _vm.columns,
|
|
13923
14677
|
"itemValue": _vm.itemValue,
|
|
13924
14678
|
"getStateValue": _vm.getStateValue,
|
|
14679
|
+
"getStateOptions": _vm.getStateOptions,
|
|
14680
|
+
"getStateBadgeVariant": _vm.getStateBadgeVariant,
|
|
13925
14681
|
"getArrayValue": _vm.getArrayValue,
|
|
13926
14682
|
"showItem": _vm.showItem,
|
|
13927
14683
|
"updateItem": _vm.updateItem,
|
|
@@ -13931,34 +14687,75 @@ var _sfc_render$5 = function render() {
|
|
|
13931
14687
|
},
|
|
13932
14688
|
on: {
|
|
13933
14689
|
"draggableChange": _vm.onDraggableChange
|
|
13934
|
-
}
|
|
14690
|
+
},
|
|
14691
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
14692
|
+
return {
|
|
14693
|
+
key: name,
|
|
14694
|
+
fn: function fn(slotProps) {
|
|
14695
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
14696
|
+
}
|
|
14697
|
+
};
|
|
14698
|
+
})], null, true)
|
|
13935
14699
|
})], 1);
|
|
13936
14700
|
}), 0);
|
|
13937
14701
|
};
|
|
13938
14702
|
var _sfc_staticRenderFns$5 = [];
|
|
13939
|
-
var __component__$5 = /*#__PURE__*/normalizeComponent(_sfc_main$5, _sfc_render$5, _sfc_staticRenderFns$5, false, null, "
|
|
14703
|
+
var __component__$5 = /*#__PURE__*/normalizeComponent(_sfc_main$5, _sfc_render$5, _sfc_staticRenderFns$5, false, null, "516ff294", null, null);
|
|
13940
14704
|
var KanbanBoard = __component__$5.exports;var _sfc_main$4 = {
|
|
13941
14705
|
name: 'CrudKanban',
|
|
13942
14706
|
components: {
|
|
13943
14707
|
KanbanBoard: KanbanBoard
|
|
13944
14708
|
},
|
|
13945
|
-
inject: ['displayMode', 'displayModes']
|
|
14709
|
+
inject: ['displayMode', 'displayModes'],
|
|
14710
|
+
computed: {
|
|
14711
|
+
currentDisplayMode: function currentDisplayMode() {
|
|
14712
|
+
if (!this.displayMode) return 1;
|
|
14713
|
+
if (this.displayMode.value !== undefined) {
|
|
14714
|
+
return this.displayMode.value;
|
|
14715
|
+
}
|
|
14716
|
+
if (typeof this.displayMode === 'function') {
|
|
14717
|
+
return this.displayMode();
|
|
14718
|
+
}
|
|
14719
|
+
return this.displayMode;
|
|
14720
|
+
}
|
|
14721
|
+
}
|
|
13946
14722
|
};
|
|
13947
14723
|
var _sfc_render$4 = function render() {
|
|
13948
14724
|
var _vm = this,
|
|
13949
14725
|
_c = _vm._self._c;
|
|
13950
|
-
return _vm.
|
|
14726
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_KANBAN ? _c('div', [_c('KanbanBoard', {
|
|
14727
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
14728
|
+
return {
|
|
14729
|
+
key: name,
|
|
14730
|
+
fn: function fn(slotProps) {
|
|
14731
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
14732
|
+
}
|
|
14733
|
+
};
|
|
14734
|
+
})], null, true)
|
|
14735
|
+
})], 1) : _vm._e();
|
|
13951
14736
|
};
|
|
13952
14737
|
var _sfc_staticRenderFns$4 = [];
|
|
13953
14738
|
var __component__$4 = /*#__PURE__*/normalizeComponent(_sfc_main$4, _sfc_render$4, _sfc_staticRenderFns$4, false, null, null, null, null);
|
|
13954
14739
|
var CrudKanban = __component__$4.exports;var _sfc_main$3 = {
|
|
13955
14740
|
name: 'CrudCustom',
|
|
13956
|
-
inject: ['displayMode', 'displayModes', 'listContainerClass', 'listItemClass', 'loading', 'items', 'infiniteScroll', 'messageEmptyResults', 'itemsList']
|
|
14741
|
+
inject: ['displayMode', 'displayModes', 'listContainerClass', 'listItemClass', 'loading', 'items', 'infiniteScroll', 'messageEmptyResults', 'itemsList'],
|
|
14742
|
+
computed: {
|
|
14743
|
+
currentDisplayMode: function currentDisplayMode() {
|
|
14744
|
+
if (!this.displayMode) return 1;
|
|
14745
|
+
if (this.displayMode.value !== undefined) {
|
|
14746
|
+
return this.displayMode.value;
|
|
14747
|
+
}
|
|
14748
|
+
if (typeof this.displayMode === 'function') {
|
|
14749
|
+
return this.displayMode();
|
|
14750
|
+
}
|
|
14751
|
+
return this.displayMode;
|
|
14752
|
+
}
|
|
14753
|
+
}
|
|
13957
14754
|
};
|
|
13958
14755
|
var _sfc_render$3 = function render() {
|
|
13959
14756
|
var _vm = this,
|
|
13960
14757
|
_c = _vm._self._c;
|
|
13961
|
-
return _vm.
|
|
14758
|
+
return _vm.currentDisplayMode == _vm.displayModes.MODE_CUSTOM ? _c('div', [_c('div', {
|
|
13962
14759
|
class: _vm.listContainerClass
|
|
13963
14760
|
}, [!_vm.loading && _vm.itemsList && _vm.itemsList.length == 0 && !_vm.infiniteScroll ? _c('p', {
|
|
13964
14761
|
staticClass: "p-3"
|
|
@@ -13975,7 +14772,28 @@ var _sfc_staticRenderFns$3 = [];
|
|
|
13975
14772
|
var __component__$3 = /*#__PURE__*/normalizeComponent(_sfc_main$3, _sfc_render$3, _sfc_staticRenderFns$3, false, null, null, null, null);
|
|
13976
14773
|
var CrudCustom = __component__$3.exports;var _sfc_main$2 = {
|
|
13977
14774
|
name: 'CrudModals',
|
|
13978
|
-
inject: ['modelName', 'title', 'loading', 'validate', 'item', 'messageSave', 'showImport', 'showExport', 'fileImport', 'selectedItems', 'exportFormat', 'saveItem', 'importItems', 'exportItems']
|
|
14775
|
+
inject: ['modelName', 'title', 'loading', 'validate', 'item', 'getItem', 'messageSave', 'showImport', 'showExport', 'fileImport', 'selectedItems', 'exportFormat', 'saveItem', 'importItems', 'exportItems'],
|
|
14776
|
+
computed: {
|
|
14777
|
+
// Computed property para asegurar reactividad del item inyectado
|
|
14778
|
+
reactiveItem: function reactiveItem() {
|
|
14779
|
+
// Si hay una función getItem, usarla para obtener el item actual
|
|
14780
|
+
if (this.getItem && typeof this.getItem === 'function') {
|
|
14781
|
+
return this.getItem();
|
|
14782
|
+
}
|
|
14783
|
+
// Si no, usar el item inyectado directamente
|
|
14784
|
+
return this.item;
|
|
14785
|
+
}
|
|
14786
|
+
},
|
|
14787
|
+
watch: {
|
|
14788
|
+
// Watch el item inyectado para forzar actualización
|
|
14789
|
+
item: {
|
|
14790
|
+
handler: function handler() {
|
|
14791
|
+
this.$forceUpdate();
|
|
14792
|
+
},
|
|
14793
|
+
deep: true,
|
|
14794
|
+
immediate: true
|
|
14795
|
+
}
|
|
14796
|
+
}
|
|
13979
14797
|
};
|
|
13980
14798
|
var _sfc_render$2 = function render() {
|
|
13981
14799
|
var _vm = this,
|
|
@@ -13997,7 +14815,7 @@ var _sfc_render$2 = function render() {
|
|
|
13997
14815
|
on: {
|
|
13998
14816
|
"submit": _vm.saveItem
|
|
13999
14817
|
}
|
|
14000
|
-
}, [_vm.
|
|
14818
|
+
}, [_vm.reactiveItem ? [_vm._t("form", function () {
|
|
14001
14819
|
return [_c('b-form-group', {
|
|
14002
14820
|
attrs: {
|
|
14003
14821
|
"label": "Nombre:",
|
|
@@ -14010,16 +14828,16 @@ var _sfc_render$2 = function render() {
|
|
|
14010
14828
|
"placeholder": "Nombre"
|
|
14011
14829
|
},
|
|
14012
14830
|
model: {
|
|
14013
|
-
value: _vm.
|
|
14831
|
+
value: _vm.reactiveItem.title,
|
|
14014
14832
|
callback: function callback($$v) {
|
|
14015
|
-
_vm.$set(_vm.
|
|
14833
|
+
_vm.$set(_vm.reactiveItem, "title", $$v);
|
|
14016
14834
|
},
|
|
14017
|
-
expression: "
|
|
14835
|
+
expression: "reactiveItem.title"
|
|
14018
14836
|
}
|
|
14019
14837
|
})], 1)];
|
|
14020
14838
|
}, {
|
|
14021
|
-
"item": _vm.
|
|
14022
|
-
}) : _vm._e(), _c('b-button', {
|
|
14839
|
+
"item": _vm.reactiveItem
|
|
14840
|
+
})] : _vm._e(), _c('b-button', {
|
|
14023
14841
|
attrs: {
|
|
14024
14842
|
"block": "",
|
|
14025
14843
|
"type": "submit",
|
|
@@ -14030,8 +14848,8 @@ var _sfc_render$2 = function render() {
|
|
|
14030
14848
|
attrs: {
|
|
14031
14849
|
"small": ""
|
|
14032
14850
|
}
|
|
14033
|
-
}) : _vm._e(), _vm._v(_vm._s(_vm.messageSave) + " ")], 1)], 2)] : _vm._e(), !_vm.validate ? [_vm.
|
|
14034
|
-
return _vm._l(_vm.
|
|
14851
|
+
}) : _vm._e(), _vm._v(_vm._s(_vm.messageSave) + " ")], 1)], 2)] : _vm._e(), !_vm.validate ? [_vm.reactiveItem ? [_vm._t("form", function () {
|
|
14852
|
+
return _vm._l(_vm.reactiveItem, function (value, key) {
|
|
14035
14853
|
return _c('b-form-group', {
|
|
14036
14854
|
key: key,
|
|
14037
14855
|
attrs: {
|
|
@@ -14043,17 +14861,17 @@ var _sfc_render$2 = function render() {
|
|
|
14043
14861
|
"required": ""
|
|
14044
14862
|
},
|
|
14045
14863
|
model: {
|
|
14046
|
-
value: _vm.
|
|
14864
|
+
value: _vm.reactiveItem[key],
|
|
14047
14865
|
callback: function callback($$v) {
|
|
14048
|
-
_vm.$set(_vm.
|
|
14866
|
+
_vm.$set(_vm.reactiveItem, key, $$v);
|
|
14049
14867
|
},
|
|
14050
|
-
expression: "
|
|
14868
|
+
expression: "reactiveItem[key]"
|
|
14051
14869
|
}
|
|
14052
14870
|
})], 1);
|
|
14053
14871
|
});
|
|
14054
14872
|
}, {
|
|
14055
|
-
"item": _vm.
|
|
14056
|
-
}) : _vm._e(), _c('b-button', {
|
|
14873
|
+
"item": _vm.reactiveItem
|
|
14874
|
+
})] : _vm._e(), _c('b-button', {
|
|
14057
14875
|
attrs: {
|
|
14058
14876
|
"block": "",
|
|
14059
14877
|
"type": "submit",
|
|
@@ -14077,8 +14895,8 @@ var _sfc_render$2 = function render() {
|
|
|
14077
14895
|
"title": _vm.title,
|
|
14078
14896
|
"no-close-on-backdrop": ""
|
|
14079
14897
|
}
|
|
14080
|
-
}, [_vm.
|
|
14081
|
-
return [_c('b-list-group', _vm._l(_vm.
|
|
14898
|
+
}, [_vm.reactiveItem ? [_vm._t("show", function () {
|
|
14899
|
+
return [_c('b-list-group', _vm._l(_vm.reactiveItem, function (value, key) {
|
|
14082
14900
|
return _c('b-list-group-item', {
|
|
14083
14901
|
key: key
|
|
14084
14902
|
}, [_c('b-row', {
|
|
@@ -14095,8 +14913,8 @@ var _sfc_render$2 = function render() {
|
|
|
14095
14913
|
}, [_vm._v(_vm._s(JSON.stringify(value)))])], 1)], 1);
|
|
14096
14914
|
}), 1)];
|
|
14097
14915
|
}, {
|
|
14098
|
-
"item": _vm.
|
|
14099
|
-
}) : _vm._e()], 2), _vm.showImport ? _c('b-modal', {
|
|
14916
|
+
"item": _vm.reactiveItem
|
|
14917
|
+
})] : _vm._e()], 2), _vm.showImport ? _c('b-modal', {
|
|
14100
14918
|
ref: "modal-import",
|
|
14101
14919
|
attrs: {
|
|
14102
14920
|
"title": "Importar",
|
|
@@ -14351,6 +15169,12 @@ var CrudPagination = __component__$1.exports;var crudData = {
|
|
|
14351
15169
|
filterSidebarOpen: false,
|
|
14352
15170
|
internalFilters: [],
|
|
14353
15171
|
forceRecomputeCounter: 0,
|
|
15172
|
+
_displayMode: 1,
|
|
15173
|
+
// Propiedad local para displayMode (se inicializará desde la prop en created())
|
|
15174
|
+
displayModeReactive: Vue__default["default"].observable({
|
|
15175
|
+
value: 1
|
|
15176
|
+
}),
|
|
15177
|
+
// Objeto reactivo para provide/inject
|
|
14354
15178
|
displayModes: {
|
|
14355
15179
|
MODE_TABLE: 1,
|
|
14356
15180
|
MODE_CARDS: 2,
|
|
@@ -14381,7 +15205,7 @@ var CrudPagination = __component__$1.exports;var crudData = {
|
|
|
14381
15205
|
if (this.groupedSplit) {
|
|
14382
15206
|
return true;
|
|
14383
15207
|
}
|
|
14384
|
-
return this.
|
|
15208
|
+
return this._displayMode == this.displayModes.MODE_KANBAN;
|
|
14385
15209
|
},
|
|
14386
15210
|
itemsList: function itemsList() {
|
|
14387
15211
|
var items = this.ajax ? this.items : this.items.slice(this.paginationIndexStart, this.paginationIndexEnd);
|
|
@@ -14423,7 +15247,15 @@ var CrudPagination = __component__$1.exports;var crudData = {
|
|
|
14423
15247
|
this.internalFilters.forEach(function (f) {
|
|
14424
15248
|
if (f.value) {
|
|
14425
15249
|
var colname = f.column.replace("_sort", "").replace("_from", "").replace("_to", "");
|
|
14426
|
-
|
|
15250
|
+
var op = f.op;
|
|
15251
|
+
|
|
15252
|
+
// Aplicar operadores automáticamente para filtros de rango
|
|
15253
|
+
if (f.column.endsWith("_from")) {
|
|
15254
|
+
op = ">=";
|
|
15255
|
+
} else if (f.column.endsWith("_to")) {
|
|
15256
|
+
op = "<=";
|
|
15257
|
+
}
|
|
15258
|
+
filter.push([colname, op, f.value]);
|
|
14427
15259
|
}
|
|
14428
15260
|
});
|
|
14429
15261
|
return filter;
|
|
@@ -14466,8 +15298,24 @@ var CrudPagination = __component__$1.exports;var crudData = {
|
|
|
14466
15298
|
this.fetchItems();
|
|
14467
15299
|
}
|
|
14468
15300
|
},
|
|
14469
|
-
|
|
15301
|
+
// Watcher para la prop displayMode (sincroniza cuando cambia desde el componente padre)
|
|
15302
|
+
displayMode: function displayMode(newVal) {
|
|
15303
|
+
// Usar $props para acceder a la prop y evitar conflictos con data properties
|
|
15304
|
+
var propValue = this.$props && this.$props.displayMode !== undefined ? this.$props.displayMode : newVal;
|
|
15305
|
+
if (propValue !== undefined && this._displayMode !== propValue) {
|
|
15306
|
+
this._displayMode = propValue;
|
|
15307
|
+
if (this.displayModeReactive) {
|
|
15308
|
+
this.displayModeReactive.value = propValue;
|
|
15309
|
+
}
|
|
15310
|
+
}
|
|
15311
|
+
},
|
|
15312
|
+
// Watcher para la propiedad local _displayMode (para forzar re-renderizado)
|
|
15313
|
+
_displayMode: function _displayMode(newVal) {
|
|
14470
15314
|
var _this2 = this;
|
|
15315
|
+
// Actualizar el objeto reactivo si existe
|
|
15316
|
+
if (this.displayModeReactive) {
|
|
15317
|
+
this.displayModeReactive.value = newVal;
|
|
15318
|
+
}
|
|
14471
15319
|
// Forzar re-renderizado cuando cambia el modo de visualización
|
|
14472
15320
|
this.$nextTick(function () {
|
|
14473
15321
|
_this2.forceRecomputeCounter++;
|
|
@@ -14535,6 +15383,13 @@ var CrudPagination = __component__$1.exports;var crudData = {
|
|
|
14535
15383
|
deep: true
|
|
14536
15384
|
}
|
|
14537
15385
|
},
|
|
15386
|
+
created: function created() {
|
|
15387
|
+
// Inicializar _displayMode desde la prop displayMode en created() para que esté disponible en provide()
|
|
15388
|
+
if (this.$props && this.$props.displayMode !== undefined) {
|
|
15389
|
+
this._displayMode = this.$props.displayMode;
|
|
15390
|
+
this.displayModeReactive.value = this._displayMode;
|
|
15391
|
+
}
|
|
15392
|
+
},
|
|
14538
15393
|
mounted: function mounted() {
|
|
14539
15394
|
var now = Math.floor(Date.now() / 1000);
|
|
14540
15395
|
this.crudUuid = '' + now;
|
|
@@ -19810,7 +20665,7 @@ axios.default = axios;var crudApi = {
|
|
|
19810
20665
|
dataKey: 'data',
|
|
19811
20666
|
params: {
|
|
19812
20667
|
page: page,
|
|
19813
|
-
limit: _this.pagination.
|
|
20668
|
+
limit: _this.pagination.per_page,
|
|
19814
20669
|
filters: JSON.stringify(_this.finalFilters)
|
|
19815
20670
|
}
|
|
19816
20671
|
});
|
|
@@ -19855,7 +20710,7 @@ axios.default = axios;var crudApi = {
|
|
|
19855
20710
|
return axios.get(this.apiUrl + "/" + this.modelName, {
|
|
19856
20711
|
params: {
|
|
19857
20712
|
page: page,
|
|
19858
|
-
limit: this.
|
|
20713
|
+
limit: this.pagination.per_page,
|
|
19859
20714
|
filters: JSON.stringify(this.finalFilters)
|
|
19860
20715
|
}
|
|
19861
20716
|
}).then(function (response) {
|
|
@@ -20541,15 +21396,15 @@ axios.default = axios;var crudApi = {
|
|
|
20541
21396
|
var _this = this;
|
|
20542
21397
|
this.columns.forEach(function (column) {
|
|
20543
21398
|
if (_this.isColumnHasFilter(column)) {
|
|
20544
|
-
if (column.type == "date") {
|
|
21399
|
+
if (column.type == "date" || column.type == "number" || column.type == "money") {
|
|
20545
21400
|
_this.internalFilters.push({
|
|
20546
21401
|
column: column.prop + "_from",
|
|
20547
|
-
op:
|
|
21402
|
+
op: ">=",
|
|
20548
21403
|
value: null
|
|
20549
21404
|
});
|
|
20550
21405
|
_this.internalFilters.push({
|
|
20551
21406
|
column: column.prop + "_to",
|
|
20552
|
-
op:
|
|
21407
|
+
op: "<=",
|
|
20553
21408
|
value: null
|
|
20554
21409
|
});
|
|
20555
21410
|
} else {
|
|
@@ -20568,6 +21423,46 @@ axios.default = axios;var crudApi = {
|
|
|
20568
21423
|
});
|
|
20569
21424
|
}
|
|
20570
21425
|
});
|
|
21426
|
+
|
|
21427
|
+
// Procesar filtros custom
|
|
21428
|
+
if (this.customFilters && Array.isArray(this.customFilters)) {
|
|
21429
|
+
this.customFilters.forEach(function (customFilter) {
|
|
21430
|
+
if (_this.isCustomFilterEnabled(customFilter)) {
|
|
21431
|
+
// Si el tipo es función (callback), no procesamos automáticamente
|
|
21432
|
+
// El callback se encargará del renderizado y gestión del filtro
|
|
21433
|
+
if (typeof customFilter.type === 'string') {
|
|
21434
|
+
if (customFilter.type == "date" || customFilter.type == "number" || customFilter.type == "money") {
|
|
21435
|
+
_this.internalFilters.push({
|
|
21436
|
+
column: customFilter.prop + "_from",
|
|
21437
|
+
op: ">=",
|
|
21438
|
+
value: null
|
|
21439
|
+
});
|
|
21440
|
+
_this.internalFilters.push({
|
|
21441
|
+
column: customFilter.prop + "_to",
|
|
21442
|
+
op: "<=",
|
|
21443
|
+
value: null
|
|
21444
|
+
});
|
|
21445
|
+
} else {
|
|
21446
|
+
_this.internalFilters.push({
|
|
21447
|
+
column: customFilter.prop,
|
|
21448
|
+
op: customFilter.filterOp ? customFilter.filterOp : "=",
|
|
21449
|
+
value: null
|
|
21450
|
+
});
|
|
21451
|
+
}
|
|
21452
|
+
} else if (typeof customFilter.type === 'function') {
|
|
21453
|
+
// Para callbacks, solo creamos el filtro interno si no existe
|
|
21454
|
+
// El callback se encargará del renderizado
|
|
21455
|
+
if (!_this.internalFilterByProp(customFilter.prop)) {
|
|
21456
|
+
_this.internalFilters.push({
|
|
21457
|
+
column: customFilter.prop,
|
|
21458
|
+
op: customFilter.filterOp ? customFilter.filterOp : "=",
|
|
21459
|
+
value: null
|
|
21460
|
+
});
|
|
21461
|
+
}
|
|
21462
|
+
}
|
|
21463
|
+
}
|
|
21464
|
+
});
|
|
21465
|
+
}
|
|
20571
21466
|
},
|
|
20572
21467
|
toggleSortFilter: function toggleSortFilter(column) {
|
|
20573
21468
|
var _this2 = this;
|
|
@@ -20587,6 +21482,11 @@ axios.default = axios;var crudApi = {
|
|
|
20587
21482
|
toggleFilters: function toggleFilters() {
|
|
20588
21483
|
this.filtersVisible = !this.filtersVisible;
|
|
20589
21484
|
this.filterSidebarOpen = this.filtersVisible;
|
|
21485
|
+
|
|
21486
|
+
// Si se está abriendo el sidebar y los filtros no están inicializados, inicializarlos
|
|
21487
|
+
if (this.filtersVisible && this.internalFilters.length === 0) {
|
|
21488
|
+
this.setupFilters();
|
|
21489
|
+
}
|
|
20590
21490
|
},
|
|
20591
21491
|
resetFilters: function resetFilters() {
|
|
20592
21492
|
var _this3 = this;
|
|
@@ -20603,6 +21503,9 @@ axios.default = axios;var crudApi = {
|
|
|
20603
21503
|
isColumnHasFilter: function isColumnHasFilter(column) {
|
|
20604
21504
|
return column && !column.hideFilter && column.type != "actions";
|
|
20605
21505
|
},
|
|
21506
|
+
isCustomFilterEnabled: function isCustomFilterEnabled(customFilter) {
|
|
21507
|
+
return customFilter && customFilter.prop && !customFilter.hideFilter && customFilter.type != "actions";
|
|
21508
|
+
},
|
|
20606
21509
|
setFilter: function setFilter(column, value) {
|
|
20607
21510
|
var _this4 = this;
|
|
20608
21511
|
var filter = this.filter.find(function (f) {
|
|
@@ -20632,17 +21535,42 @@ axios.default = axios;var crudApi = {
|
|
|
20632
21535
|
}
|
|
20633
21536
|
};var crudValidation = {
|
|
20634
21537
|
methods: {
|
|
21538
|
+
normalizeOptions: function normalizeOptions(options) {
|
|
21539
|
+
if (!Array.isArray(options)) {
|
|
21540
|
+
return options;
|
|
21541
|
+
}
|
|
21542
|
+
return options.map(function (option) {
|
|
21543
|
+
var normalized = _objectSpread2({}, option);
|
|
21544
|
+
|
|
21545
|
+
// Asegurar que siempre tenga id, value y text
|
|
21546
|
+
if (normalized.id === undefined && normalized.value !== undefined) {
|
|
21547
|
+
normalized.id = normalized.value;
|
|
21548
|
+
} else if (normalized.value === undefined && normalized.id !== undefined) {
|
|
21549
|
+
normalized.value = normalized.id;
|
|
21550
|
+
} else if (normalized.id === undefined && normalized.value === undefined) {
|
|
21551
|
+
// Si no tiene ni id ni value, usar text o label como valor por defecto
|
|
21552
|
+
normalized.id = normalized.text || normalized.label || "";
|
|
21553
|
+
normalized.value = normalized.id;
|
|
21554
|
+
}
|
|
21555
|
+
|
|
21556
|
+
// Asegurar que siempre tenga text
|
|
21557
|
+
if (normalized.text === undefined) {
|
|
21558
|
+
normalized.text = normalized.label !== undefined ? normalized.label : "";
|
|
21559
|
+
}
|
|
21560
|
+
return normalized;
|
|
21561
|
+
});
|
|
21562
|
+
},
|
|
20635
21563
|
loadOptions: function loadOptions() {
|
|
20636
21564
|
var _this = this;
|
|
20637
21565
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
20638
|
-
var i, column, options;
|
|
21566
|
+
var i, column, options, normalizedOptions;
|
|
20639
21567
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
20640
21568
|
while (1) switch (_context.prev = _context.next) {
|
|
20641
21569
|
case 0:
|
|
20642
21570
|
i = 0;
|
|
20643
21571
|
case 1:
|
|
20644
21572
|
if (!(i < _this.columns.length)) {
|
|
20645
|
-
_context.next =
|
|
21573
|
+
_context.next = 13;
|
|
20646
21574
|
break;
|
|
20647
21575
|
}
|
|
20648
21576
|
column = _this.columns[i];
|
|
@@ -20659,12 +21587,20 @@ axios.default = axios;var crudApi = {
|
|
|
20659
21587
|
}));
|
|
20660
21588
|
console.debug("Options promise", _this.columns);
|
|
20661
21589
|
case 9:
|
|
21590
|
+
// Normalizar opciones para columnas tipo state y array
|
|
21591
|
+
if ((column.type === 'state' || column.type === 'array') && Array.isArray(column.options)) {
|
|
21592
|
+
normalizedOptions = _this.normalizeOptions(column.options);
|
|
21593
|
+
_this.$set(_this.columns, i, _objectSpread2(_objectSpread2({}, column), {}, {
|
|
21594
|
+
options: normalizedOptions
|
|
21595
|
+
}));
|
|
21596
|
+
}
|
|
21597
|
+
case 10:
|
|
20662
21598
|
i++;
|
|
20663
21599
|
_context.next = 1;
|
|
20664
21600
|
break;
|
|
20665
|
-
case 12:
|
|
20666
|
-
_this.optionsLoaded = true;
|
|
20667
21601
|
case 13:
|
|
21602
|
+
_this.optionsLoaded = true;
|
|
21603
|
+
case 14:
|
|
20668
21604
|
case "end":
|
|
20669
21605
|
return _context.stop();
|
|
20670
21606
|
}
|
|
@@ -20693,22 +21629,70 @@ axios.default = axios;var crudApi = {
|
|
|
20693
21629
|
});
|
|
20694
21630
|
return values.join(",");
|
|
20695
21631
|
},
|
|
20696
|
-
|
|
20697
|
-
if (!options) {
|
|
20698
|
-
|
|
20699
|
-
|
|
21632
|
+
getStateOptions: function getStateOptions(value, options) {
|
|
21633
|
+
if (!options || !Array.isArray(options) || options.length === 0) {
|
|
21634
|
+
return [];
|
|
21635
|
+
}
|
|
21636
|
+
|
|
21637
|
+
// Asegurar que las opciones estén normalizadas (por si loadOptions no se ha ejecutado aún)
|
|
21638
|
+
var normalizedOptions = this.normalizeOptions(options);
|
|
21639
|
+
|
|
21640
|
+
// Si el valor es null o undefined, no hay coincidencias
|
|
21641
|
+
if (value === null || value === undefined) {
|
|
21642
|
+
return [];
|
|
20700
21643
|
}
|
|
20701
|
-
|
|
21644
|
+
|
|
21645
|
+
// Normalizar el valor para comparación (convertir a string)
|
|
21646
|
+
var normalizedValue = String(value).trim();
|
|
21647
|
+
return normalizedOptions.filter(function (option) {
|
|
21648
|
+
// Después de normalizar, las opciones siempre tienen id, value y text
|
|
21649
|
+
// Comparar tanto con id como con value para asegurar compatibilidad
|
|
21650
|
+
var optionId = option.id !== undefined && option.id !== null ? String(option.id).trim() : null;
|
|
21651
|
+
var optionValue = option.value !== undefined && option.value !== null ? String(option.value).trim() : null;
|
|
20702
21652
|
if (Array.isArray(value)) {
|
|
20703
|
-
|
|
21653
|
+
// Para arrays, verificar si alguno de los valores coincide
|
|
21654
|
+
return value.some(function (val) {
|
|
21655
|
+
if (val === null || val === undefined) return false;
|
|
21656
|
+
var normalizedVal = String(val).trim();
|
|
21657
|
+
return optionId && normalizedVal === optionId || optionValue && normalizedVal === optionValue;
|
|
21658
|
+
});
|
|
20704
21659
|
} else {
|
|
20705
|
-
|
|
21660
|
+
// Comparación estricta para valores únicos - comparar con ambos id y value
|
|
21661
|
+
return optionId && optionId === normalizedValue || optionValue && optionValue === normalizedValue;
|
|
20706
21662
|
}
|
|
20707
21663
|
});
|
|
20708
|
-
|
|
20709
|
-
|
|
20710
|
-
|
|
20711
|
-
|
|
21664
|
+
},
|
|
21665
|
+
getStateValue: function getStateValue(value, options) {
|
|
21666
|
+
if (!options) {
|
|
21667
|
+
console.debug("State Column Not hast options returning value", value, options);
|
|
21668
|
+
return value;
|
|
21669
|
+
}
|
|
21670
|
+
var ops = this.getStateOptions(value, options);
|
|
21671
|
+
return ops.map(function (option) {
|
|
21672
|
+
// Usar text directamente (ya normalizado)
|
|
21673
|
+
return option.text !== undefined ? option.text : "";
|
|
21674
|
+
}).join(", ");
|
|
21675
|
+
},
|
|
21676
|
+
getStateBadgeVariant: function getStateBadgeVariant(option) {
|
|
21677
|
+
// Si la opción tiene una propiedad variant, usarla
|
|
21678
|
+
if (option.variant) {
|
|
21679
|
+
return option.variant;
|
|
21680
|
+
}
|
|
21681
|
+
// Si no, intentar inferir del id/value común
|
|
21682
|
+
var idValue = String(option.id || option.value || '').toLowerCase();
|
|
21683
|
+
if (idValue.includes('active') || idValue.includes('activo')) {
|
|
21684
|
+
return 'success';
|
|
21685
|
+
} else if (idValue.includes('inactive') || idValue.includes('inactivo')) {
|
|
21686
|
+
return 'secondary';
|
|
21687
|
+
} else if (idValue.includes('pending') || idValue.includes('pendiente')) {
|
|
21688
|
+
return 'warning';
|
|
21689
|
+
} else if (idValue.includes('done') || idValue.includes('completado')) {
|
|
21690
|
+
return 'success';
|
|
21691
|
+
} else if (idValue.includes('error') || idValue.includes('error')) {
|
|
21692
|
+
return 'danger';
|
|
21693
|
+
}
|
|
21694
|
+
// Variante por defecto
|
|
21695
|
+
return 'primary';
|
|
20712
21696
|
}
|
|
20713
21697
|
}
|
|
20714
21698
|
};var crudHelpers = {
|
|
@@ -20870,46 +21854,146 @@ axios.default = axios;var crudApi = {
|
|
|
20870
21854
|
this.$emit("selectItems", this.selectedItems);
|
|
20871
21855
|
},
|
|
20872
21856
|
showItem: function showItem(id) {
|
|
21857
|
+
var _this5 = this;
|
|
20873
21858
|
var itemIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
21859
|
+
var item;
|
|
20874
21860
|
if (itemIndex == null) {
|
|
20875
|
-
|
|
21861
|
+
item = this.items.find(function (it) {
|
|
20876
21862
|
return it.id == id;
|
|
20877
21863
|
});
|
|
20878
|
-
this.item = item;
|
|
20879
21864
|
} else {
|
|
20880
|
-
|
|
21865
|
+
item = this.items[itemIndex];
|
|
21866
|
+
}
|
|
21867
|
+
if (!item) {
|
|
21868
|
+
console.warn('Item not found for showItem');
|
|
21869
|
+
return;
|
|
21870
|
+
}
|
|
21871
|
+
|
|
21872
|
+
// Hacer copia profunda del objeto para asegurar reactividad
|
|
21873
|
+
var itemCopy = JSON.parse(JSON.stringify(item));
|
|
21874
|
+
if (this.useVuexORM && !this.vuexLocalforage) {
|
|
21875
|
+
var modelInstance = new this.model(itemCopy);
|
|
21876
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21877
|
+
Object.keys(modelInstance).forEach(function (key) {
|
|
21878
|
+
_this5.$set(_this5.item, key, modelInstance[key]);
|
|
21879
|
+
});
|
|
21880
|
+
// Eliminar propiedades que ya no existen
|
|
21881
|
+
Object.keys(this.item).forEach(function (key) {
|
|
21882
|
+
if (!(key in modelInstance)) {
|
|
21883
|
+
_this5.$delete(_this5.item, key);
|
|
21884
|
+
}
|
|
21885
|
+
});
|
|
21886
|
+
} else {
|
|
21887
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21888
|
+
Object.keys(itemCopy).forEach(function (key) {
|
|
21889
|
+
_this5.$set(_this5.item, key, itemCopy[key]);
|
|
21890
|
+
});
|
|
21891
|
+
// Eliminar propiedades que ya no existen
|
|
21892
|
+
Object.keys(this.item).forEach(function (key) {
|
|
21893
|
+
if (!(key in itemCopy)) {
|
|
21894
|
+
_this5.$delete(_this5.item, key);
|
|
21895
|
+
}
|
|
21896
|
+
});
|
|
20881
21897
|
}
|
|
21898
|
+
|
|
21899
|
+
// Forzar actualización para asegurar que los cambios se reflejen
|
|
21900
|
+
this.$forceUpdate();
|
|
20882
21901
|
this.onSelect();
|
|
20883
|
-
this.$
|
|
21902
|
+
this.$nextTick(function () {
|
|
21903
|
+
_this5.$forceUpdate();
|
|
21904
|
+
_this5.$bvModal.show("modal-show-item-" + _this5.modelName);
|
|
21905
|
+
});
|
|
20884
21906
|
},
|
|
20885
21907
|
createItem: function createItem() {
|
|
20886
|
-
|
|
20887
|
-
|
|
20888
|
-
|
|
20889
|
-
|
|
20890
|
-
|
|
20891
|
-
|
|
21908
|
+
var _this6 = this;
|
|
21909
|
+
// Hacer copia profunda del objeto para asegurar reactividad
|
|
21910
|
+
var itemCopy = JSON.parse(JSON.stringify(this.itemDefault));
|
|
21911
|
+
if (this.useVuexORM && !this.vuexLocalforage) {
|
|
21912
|
+
var modelInstance = new this.model(itemCopy);
|
|
21913
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21914
|
+
Object.keys(modelInstance).forEach(function (key) {
|
|
21915
|
+
_this6.$set(_this6.item, key, modelInstance[key]);
|
|
21916
|
+
});
|
|
21917
|
+
// Eliminar propiedades que ya no existen
|
|
21918
|
+
Object.keys(this.item).forEach(function (key) {
|
|
21919
|
+
if (!(key in modelInstance)) {
|
|
21920
|
+
_this6.$delete(_this6.item, key);
|
|
21921
|
+
}
|
|
21922
|
+
});
|
|
20892
21923
|
} else {
|
|
20893
|
-
|
|
21924
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21925
|
+
Object.keys(itemCopy).forEach(function (key) {
|
|
21926
|
+
_this6.$set(_this6.item, key, itemCopy[key]);
|
|
21927
|
+
});
|
|
21928
|
+
// Eliminar propiedades que ya no existen
|
|
21929
|
+
Object.keys(this.item).forEach(function (key) {
|
|
21930
|
+
if (!(key in itemCopy)) {
|
|
21931
|
+
_this6.$delete(_this6.item, key);
|
|
21932
|
+
}
|
|
21933
|
+
});
|
|
20894
21934
|
}
|
|
21935
|
+
|
|
21936
|
+
// Forzar actualización para asegurar que los cambios se reflejen
|
|
21937
|
+
this.$forceUpdate();
|
|
20895
21938
|
this.onSelect();
|
|
20896
|
-
this.$
|
|
21939
|
+
this.$nextTick(function () {
|
|
21940
|
+
_this6.$forceUpdate();
|
|
21941
|
+
_this6.$bvModal.show("modal-form-item-" + _this6.modelName);
|
|
21942
|
+
});
|
|
20897
21943
|
},
|
|
20898
21944
|
updateItem: function updateItem(id) {
|
|
21945
|
+
var _this7 = this;
|
|
20899
21946
|
var itemIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
21947
|
+
var item;
|
|
20900
21948
|
if (itemIndex == null) {
|
|
20901
|
-
|
|
21949
|
+
item = this.items.find(function (it) {
|
|
20902
21950
|
return it.id == id;
|
|
20903
21951
|
});
|
|
20904
|
-
this.item = item;
|
|
20905
21952
|
} else {
|
|
20906
|
-
|
|
21953
|
+
item = this.items[itemIndex];
|
|
21954
|
+
}
|
|
21955
|
+
if (!item) {
|
|
21956
|
+
console.warn('Item not found for updateItem');
|
|
21957
|
+
return;
|
|
21958
|
+
}
|
|
21959
|
+
|
|
21960
|
+
// Hacer copia profunda del objeto para asegurar reactividad
|
|
21961
|
+
var itemCopy = JSON.parse(JSON.stringify(item));
|
|
21962
|
+
if (this.useVuexORM && !this.vuexLocalforage) {
|
|
21963
|
+
var modelInstance = new this.model(itemCopy);
|
|
21964
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21965
|
+
Object.keys(modelInstance).forEach(function (key) {
|
|
21966
|
+
_this7.$set(_this7.item, key, modelInstance[key]);
|
|
21967
|
+
});
|
|
21968
|
+
// Eliminar propiedades que ya no existen
|
|
21969
|
+
Object.keys(this.item).forEach(function (key) {
|
|
21970
|
+
if (!(key in modelInstance)) {
|
|
21971
|
+
_this7.$delete(_this7.item, key);
|
|
21972
|
+
}
|
|
21973
|
+
});
|
|
21974
|
+
} else {
|
|
21975
|
+
// Usar $set para cada propiedad para asegurar reactividad
|
|
21976
|
+
Object.keys(itemCopy).forEach(function (key) {
|
|
21977
|
+
_this7.$set(_this7.item, key, itemCopy[key]);
|
|
21978
|
+
});
|
|
21979
|
+
// Eliminar propiedades que ya no existen
|
|
21980
|
+
Object.keys(this.item).forEach(function (key) {
|
|
21981
|
+
if (!(key in itemCopy)) {
|
|
21982
|
+
_this7.$delete(_this7.item, key);
|
|
21983
|
+
}
|
|
21984
|
+
});
|
|
20907
21985
|
}
|
|
21986
|
+
|
|
21987
|
+
// Forzar actualización para asegurar que los cambios se reflejen
|
|
21988
|
+
this.$forceUpdate();
|
|
20908
21989
|
this.onSelect();
|
|
20909
|
-
this.$
|
|
21990
|
+
this.$nextTick(function () {
|
|
21991
|
+
_this7.$forceUpdate();
|
|
21992
|
+
_this7.$bvModal.show("modal-form-item-" + _this7.modelName);
|
|
21993
|
+
});
|
|
20910
21994
|
},
|
|
20911
21995
|
removeItem: function removeItem(id, index) {
|
|
20912
|
-
var
|
|
21996
|
+
var _this8 = this;
|
|
20913
21997
|
this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
|
|
20914
21998
|
size: "sm",
|
|
20915
21999
|
buttonSize: "sm",
|
|
@@ -20919,15 +22003,15 @@ axios.default = axios;var crudApi = {
|
|
|
20919
22003
|
centered: true
|
|
20920
22004
|
}).then(function (value) {
|
|
20921
22005
|
if (value) {
|
|
20922
|
-
|
|
22006
|
+
_this8.deleteItem(id, index);
|
|
20923
22007
|
}
|
|
20924
22008
|
}).catch(function (error) {
|
|
20925
|
-
|
|
20926
|
-
|
|
22009
|
+
_this8.toastError(error);
|
|
22010
|
+
_this8.loading = false;
|
|
20927
22011
|
});
|
|
20928
22012
|
},
|
|
20929
22013
|
confirmBulkDelete: function confirmBulkDelete() {
|
|
20930
|
-
var
|
|
22014
|
+
var _this9 = this;
|
|
20931
22015
|
this.$bvModal.msgBoxConfirm(this.messageRemoveBulkConfirm, {
|
|
20932
22016
|
size: "sm",
|
|
20933
22017
|
buttonSize: "sm",
|
|
@@ -20937,15 +22021,26 @@ axios.default = axios;var crudApi = {
|
|
|
20937
22021
|
centered: true
|
|
20938
22022
|
}).then(function (value) {
|
|
20939
22023
|
if (value) {
|
|
20940
|
-
|
|
22024
|
+
_this9.deleteItemBulk();
|
|
20941
22025
|
}
|
|
20942
22026
|
}).catch(function (error) {
|
|
20943
|
-
|
|
20944
|
-
|
|
22027
|
+
_this9.toastError(error);
|
|
22028
|
+
_this9.loading = false;
|
|
20945
22029
|
});
|
|
20946
22030
|
},
|
|
20947
22031
|
toggleDisplayMode: function toggleDisplayMode() {
|
|
20948
|
-
|
|
22032
|
+
// Mutar la propiedad local _displayMode y el objeto reactivo
|
|
22033
|
+
if (this._displayMode == this.displayModes.MODE_TABLE) {
|
|
22034
|
+
this._displayMode = this.displayModes.MODE_CARDS;
|
|
22035
|
+
if (this.displayModeReactive) {
|
|
22036
|
+
this.displayModeReactive.value = this.displayModes.MODE_CARDS;
|
|
22037
|
+
}
|
|
22038
|
+
} else if (this._displayMode == this.displayModes.MODE_CARDS) {
|
|
22039
|
+
this._displayMode = this.displayModes.MODE_TABLE;
|
|
22040
|
+
if (this.displayModeReactive) {
|
|
22041
|
+
this.displayModeReactive.value = this.displayModes.MODE_TABLE;
|
|
22042
|
+
}
|
|
22043
|
+
}
|
|
20949
22044
|
},
|
|
20950
22045
|
showExportModal: function showExportModal() {
|
|
20951
22046
|
this.$refs["modal-export"].show();
|
|
@@ -21049,7 +22144,7 @@ axios.default = axios;var crudApi = {
|
|
|
21049
22144
|
link.click();
|
|
21050
22145
|
}
|
|
21051
22146
|
}
|
|
21052
|
-
};var css = "tr td[data-v-
|
|
22147
|
+
};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";
|
|
21053
22148
|
n(css, {});var _sfc_main = {
|
|
21054
22149
|
name: "VueLaravelCrud",
|
|
21055
22150
|
components: {
|
|
@@ -21063,6 +22158,7 @@ n(css, {});var _sfc_main = {
|
|
|
21063
22158
|
},
|
|
21064
22159
|
mixins: [crudData, crudApi, crudFilters, crudValidation, crudHelpers],
|
|
21065
22160
|
provide: function provide() {
|
|
22161
|
+
var _this = this;
|
|
21066
22162
|
return {
|
|
21067
22163
|
// Props
|
|
21068
22164
|
modelName: this.modelName,
|
|
@@ -21075,6 +22171,7 @@ n(css, {});var _sfc_main = {
|
|
|
21075
22171
|
vuexLocalforage: this.vuexLocalforage,
|
|
21076
22172
|
columns: this.columns,
|
|
21077
22173
|
filter: this.filter,
|
|
22174
|
+
customFilters: this.customFilters,
|
|
21078
22175
|
enableFilters: this.enableFilters,
|
|
21079
22176
|
infiniteScroll: this.infiniteScroll,
|
|
21080
22177
|
sortable: this.sortable,
|
|
@@ -21095,7 +22192,7 @@ n(css, {});var _sfc_main = {
|
|
|
21095
22192
|
showHeader: this.showHeader,
|
|
21096
22193
|
showTitle: this.showTitle,
|
|
21097
22194
|
limit: this.limit,
|
|
21098
|
-
displayMode: this.
|
|
22195
|
+
displayMode: this.displayModeReactive,
|
|
21099
22196
|
displayModeToggler: this.displayModeToggler,
|
|
21100
22197
|
colXs: this.colXs,
|
|
21101
22198
|
colSm: this.colSm,
|
|
@@ -21143,6 +22240,10 @@ n(css, {});var _sfc_main = {
|
|
|
21143
22240
|
moment: this.moment,
|
|
21144
22241
|
loading: this.loading,
|
|
21145
22242
|
firstLoad: this.firstLoad,
|
|
22243
|
+
// Proporcionar item como función getter para reactividad
|
|
22244
|
+
getItem: function getItem() {
|
|
22245
|
+
return _this.item;
|
|
22246
|
+
},
|
|
21146
22247
|
item: this.item,
|
|
21147
22248
|
items: this.items,
|
|
21148
22249
|
selectedItems: this.selectedItems,
|
|
@@ -21207,12 +22308,15 @@ n(css, {});var _sfc_main = {
|
|
|
21207
22308
|
toggleFilters: this.toggleFilters,
|
|
21208
22309
|
resetFilters: this.resetFilters,
|
|
21209
22310
|
isColumnHasFilter: this.isColumnHasFilter,
|
|
22311
|
+
isCustomFilterEnabled: this.isCustomFilterEnabled,
|
|
21210
22312
|
setFilter: this.setFilter,
|
|
21211
22313
|
onChangeFilter: this.onChangeFilter,
|
|
21212
22314
|
togglePrincipalSort: this.togglePrincipalSort,
|
|
21213
22315
|
loadOptions: this.loadOptions,
|
|
21214
22316
|
getArrayValue: this.getArrayValue,
|
|
21215
22317
|
getStateValue: this.getStateValue,
|
|
22318
|
+
getStateOptions: this.getStateOptions,
|
|
22319
|
+
getStateBadgeVariant: this.getStateBadgeVariant,
|
|
21216
22320
|
onRowHover: this.onRowHover,
|
|
21217
22321
|
onRowClick: this.onRowClick,
|
|
21218
22322
|
onSort: this.onSort,
|
|
@@ -21288,6 +22392,12 @@ n(css, {});var _sfc_main = {
|
|
|
21288
22392
|
return [];
|
|
21289
22393
|
}
|
|
21290
22394
|
},
|
|
22395
|
+
customFilters: {
|
|
22396
|
+
type: Array,
|
|
22397
|
+
default: function _default() {
|
|
22398
|
+
return [];
|
|
22399
|
+
}
|
|
22400
|
+
},
|
|
21291
22401
|
enableFilters: {
|
|
21292
22402
|
type: Boolean,
|
|
21293
22403
|
default: false
|
|
@@ -21547,7 +22657,34 @@ var _sfc_render = function render() {
|
|
|
21547
22657
|
_c = _vm._self._c;
|
|
21548
22658
|
return _c('div', {
|
|
21549
22659
|
staticClass: "crud"
|
|
21550
|
-
}, [_c('CrudHeader'), _c('CrudTable'
|
|
22660
|
+
}, [_c('CrudHeader'), _c('CrudTable', {
|
|
22661
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
22662
|
+
return {
|
|
22663
|
+
key: name,
|
|
22664
|
+
fn: function fn(slotProps) {
|
|
22665
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
22666
|
+
}
|
|
22667
|
+
};
|
|
22668
|
+
})], null, true)
|
|
22669
|
+
}), _c('CrudCards', {
|
|
22670
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
22671
|
+
return {
|
|
22672
|
+
key: name,
|
|
22673
|
+
fn: function fn(slotProps) {
|
|
22674
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
22675
|
+
}
|
|
22676
|
+
};
|
|
22677
|
+
})], null, true)
|
|
22678
|
+
}), _c('CrudKanban', {
|
|
22679
|
+
scopedSlots: _vm._u([_vm._l(_vm.$scopedSlots, function (slot, name) {
|
|
22680
|
+
return {
|
|
22681
|
+
key: name,
|
|
22682
|
+
fn: function fn(slotProps) {
|
|
22683
|
+
return [_vm._t(name, null, null, slotProps)];
|
|
22684
|
+
}
|
|
22685
|
+
};
|
|
22686
|
+
})], null, true)
|
|
22687
|
+
}), _c('CrudCustom'), _c('b-overlay', {
|
|
21551
22688
|
attrs: {
|
|
21552
22689
|
"show": _vm.loading,
|
|
21553
22690
|
"rounded": "sm"
|
|
@@ -21564,7 +22701,7 @@ var _sfc_render = function render() {
|
|
|
21564
22701
|
})], 1);
|
|
21565
22702
|
};
|
|
21566
22703
|
var _sfc_staticRenderFns = [];
|
|
21567
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
22704
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "9327e2bb", null, null);
|
|
21568
22705
|
var component$1 = __component__.exports;// Import vue component
|
|
21569
22706
|
|
|
21570
22707
|
// Default export is installable instance of component.
|