@regcheq/ui-vue-2 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +132 -28
- package/dist/index.esm.js +353 -25
- package/dist/index.js +353 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32735,6 +32735,16 @@ var script$g = {
|
|
|
32735
32735
|
type: String,
|
|
32736
32736
|
default: 'default',
|
|
32737
32737
|
validator: v => ['default', 'round'].includes(v)
|
|
32738
|
+
},
|
|
32739
|
+
// Escape hatch para casos puntuales que no cubren las variantes semánticas
|
|
32740
|
+
// (ej: un color dinámico que viene de datos). Pisan el color de la variante.
|
|
32741
|
+
bgColor: {
|
|
32742
|
+
type: String,
|
|
32743
|
+
default: null
|
|
32744
|
+
},
|
|
32745
|
+
textColor: {
|
|
32746
|
+
type: String,
|
|
32747
|
+
default: null
|
|
32738
32748
|
}
|
|
32739
32749
|
},
|
|
32740
32750
|
computed: {
|
|
@@ -32743,6 +32753,12 @@ var script$g = {
|
|
|
32743
32753
|
variant: this.variant,
|
|
32744
32754
|
roundness: this.roundness
|
|
32745
32755
|
});
|
|
32756
|
+
},
|
|
32757
|
+
inlineStyle() {
|
|
32758
|
+
const style = {};
|
|
32759
|
+
if (this.bgColor) style.backgroundColor = this.bgColor;
|
|
32760
|
+
if (this.textColor) style.color = this.textColor;
|
|
32761
|
+
return style;
|
|
32746
32762
|
}
|
|
32747
32763
|
}
|
|
32748
32764
|
};
|
|
@@ -32756,7 +32772,8 @@ var __vue_render__$g = function () {
|
|
|
32756
32772
|
var _h = _vm.$createElement;
|
|
32757
32773
|
var _c = _vm._self._c || _h;
|
|
32758
32774
|
return _c("span", _vm._g(_vm._b({
|
|
32759
|
-
class: _vm.classes
|
|
32775
|
+
class: _vm.classes,
|
|
32776
|
+
style: _vm.inlineStyle
|
|
32760
32777
|
}, "span", _vm.$attrs, false), _vm.$listeners), [_vm._t("left"), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm._t("right")], 2);
|
|
32761
32778
|
};
|
|
32762
32779
|
var __vue_staticRenderFns__$g = [];
|
|
@@ -34251,7 +34268,7 @@ var __vue_render__$5 = function () {
|
|
|
34251
34268
|
}
|
|
34252
34269
|
}, [_vm._v("\n Limpiar selección\n ")])]), _vm._v(" "), _c("Button", {
|
|
34253
34270
|
attrs: {
|
|
34254
|
-
variant: "
|
|
34271
|
+
variant: "secondary",
|
|
34255
34272
|
size: "md",
|
|
34256
34273
|
"icon-right": "Trash2"
|
|
34257
34274
|
},
|
|
@@ -37248,6 +37265,15 @@ function useTable(props, emit) {
|
|
|
37248
37265
|
}, {
|
|
37249
37266
|
immediate: true
|
|
37250
37267
|
});
|
|
37268
|
+
|
|
37269
|
+
// props.columns puede llegar vacío en el primer render (ej. mientras el
|
|
37270
|
+
// padre carga la vista activa de forma asíncrona) y poblarse después. Sin
|
|
37271
|
+
// este watcher, columnOrder queda pegado al [] inicial para siempre, ya que
|
|
37272
|
+
// el watcher de arriba solo reacciona a cambios de columnOrder, no de
|
|
37273
|
+
// columns. Solo pisa columnOrder si no hay un orden explícito del padre.
|
|
37274
|
+
vue.watch(() => props.columns.map(c => c.key).join('|'), () => {
|
|
37275
|
+
if (!props.columnOrder) columnOrder.value = props.columns.map(c => c.key);
|
|
37276
|
+
});
|
|
37251
37277
|
vue.watch(() => props.pinnedColumns, val => {
|
|
37252
37278
|
columnPinning.value = {
|
|
37253
37279
|
left: val ? [...val] : [],
|
|
@@ -37319,7 +37345,7 @@ function useTable(props, emit) {
|
|
|
37319
37345
|
const left = columnPinning.value.left || [];
|
|
37320
37346
|
if (!left.length) return {};
|
|
37321
37347
|
const offsets = {};
|
|
37322
|
-
let accumulated = props.selectable ? 40 : 0;
|
|
37348
|
+
let accumulated = (props.expandable ? props.expandColWidth || 40 : 0) + (props.selectable ? 40 : 0);
|
|
37323
37349
|
left.forEach(key => {
|
|
37324
37350
|
offsets[key] = accumulated;
|
|
37325
37351
|
const col = props.columns.find(c => c.key === key);
|
|
@@ -37578,11 +37604,64 @@ function useTable(props, emit) {
|
|
|
37578
37604
|
//
|
|
37579
37605
|
//
|
|
37580
37606
|
//
|
|
37607
|
+
//
|
|
37608
|
+
//
|
|
37609
|
+
//
|
|
37610
|
+
//
|
|
37611
|
+
//
|
|
37612
|
+
//
|
|
37613
|
+
//
|
|
37614
|
+
//
|
|
37615
|
+
//
|
|
37616
|
+
//
|
|
37617
|
+
//
|
|
37618
|
+
//
|
|
37619
|
+
//
|
|
37620
|
+
//
|
|
37621
|
+
//
|
|
37622
|
+
//
|
|
37623
|
+
//
|
|
37624
|
+
//
|
|
37625
|
+
//
|
|
37626
|
+
//
|
|
37627
|
+
//
|
|
37628
|
+
//
|
|
37629
|
+
//
|
|
37630
|
+
//
|
|
37631
|
+
//
|
|
37632
|
+
//
|
|
37633
|
+
//
|
|
37634
|
+
//
|
|
37635
|
+
//
|
|
37636
|
+
//
|
|
37637
|
+
//
|
|
37638
|
+
//
|
|
37639
|
+
//
|
|
37640
|
+
//
|
|
37641
|
+
//
|
|
37642
|
+
//
|
|
37643
|
+
//
|
|
37644
|
+
//
|
|
37645
|
+
//
|
|
37646
|
+
//
|
|
37647
|
+
//
|
|
37648
|
+
//
|
|
37649
|
+
//
|
|
37650
|
+
//
|
|
37651
|
+
//
|
|
37652
|
+
//
|
|
37653
|
+
//
|
|
37654
|
+
//
|
|
37655
|
+
//
|
|
37656
|
+
//
|
|
37657
|
+
//
|
|
37658
|
+
//
|
|
37581
37659
|
|
|
37582
37660
|
var script$4 = {
|
|
37583
37661
|
name: 'Table',
|
|
37584
37662
|
components: {
|
|
37585
|
-
Checkbox: __vue_component__$j
|
|
37663
|
+
Checkbox: __vue_component__$j,
|
|
37664
|
+
Tooltip: __vue_component__$f
|
|
37586
37665
|
},
|
|
37587
37666
|
props: {
|
|
37588
37667
|
rows: {
|
|
@@ -37612,6 +37691,28 @@ var script$4 = {
|
|
|
37612
37691
|
maxHeight: {
|
|
37613
37692
|
type: Number,
|
|
37614
37693
|
default: null
|
|
37694
|
+
},
|
|
37695
|
+
expandable: {
|
|
37696
|
+
type: Boolean,
|
|
37697
|
+
default: false
|
|
37698
|
+
},
|
|
37699
|
+
// Alto fijo (no máximo) del contenido expandido; con scroll interno si el
|
|
37700
|
+
// contenido no entra.
|
|
37701
|
+
expandedRowHeight: {
|
|
37702
|
+
type: Number,
|
|
37703
|
+
default: 265
|
|
37704
|
+
},
|
|
37705
|
+
// Ancho de la columna de expandir en px. Default 40 (solo el chevron);
|
|
37706
|
+
// subilo si usás el slot `expand-cell` para agregar contenido extra.
|
|
37707
|
+
expandColWidth: {
|
|
37708
|
+
type: Number,
|
|
37709
|
+
default: 40
|
|
37710
|
+
},
|
|
37711
|
+
// { title, subtitle } para el estado "sin datos". Si no se pasa, se usa
|
|
37712
|
+
// un fallback genérico — el texto específico de dominio vive en el consumidor.
|
|
37713
|
+
emptyState: {
|
|
37714
|
+
type: Object,
|
|
37715
|
+
default: null
|
|
37615
37716
|
}
|
|
37616
37717
|
},
|
|
37617
37718
|
setup(props, {
|
|
@@ -37632,7 +37733,9 @@ var script$4 = {
|
|
|
37632
37733
|
colKey: null,
|
|
37633
37734
|
x: 0,
|
|
37634
37735
|
y: 0
|
|
37635
|
-
}
|
|
37736
|
+
},
|
|
37737
|
+
truncatedCells: {},
|
|
37738
|
+
expandedRowId: null
|
|
37636
37739
|
};
|
|
37637
37740
|
},
|
|
37638
37741
|
computed: {
|
|
@@ -37644,6 +37747,23 @@ var script$4 = {
|
|
|
37644
37747
|
},
|
|
37645
37748
|
PinIcon() {
|
|
37646
37749
|
return Pin;
|
|
37750
|
+
},
|
|
37751
|
+
ExpandIcon() {
|
|
37752
|
+
return ChevronRight;
|
|
37753
|
+
},
|
|
37754
|
+
fullColspan() {
|
|
37755
|
+
return this.columns.length + (this.selectable ? 1 : 0) + (this.expandable ? 1 : 0);
|
|
37756
|
+
},
|
|
37757
|
+
resolvedEmptyState() {
|
|
37758
|
+
return {
|
|
37759
|
+
title: this.emptyState?.title || 'Sin datos',
|
|
37760
|
+
subtitle: this.emptyState?.subtitle || ''
|
|
37761
|
+
};
|
|
37762
|
+
},
|
|
37763
|
+
// Offset sticky de la columna de selección: se corre a la derecha
|
|
37764
|
+
// del ancho de la columna de expandir, cuando ambas están activas
|
|
37765
|
+
selectColOffset() {
|
|
37766
|
+
return this.expandable ? this.expandColWidth : 0;
|
|
37647
37767
|
}
|
|
37648
37768
|
},
|
|
37649
37769
|
methods: {
|
|
@@ -37681,6 +37801,13 @@ var script$4 = {
|
|
|
37681
37801
|
};
|
|
37682
37802
|
}
|
|
37683
37803
|
},
|
|
37804
|
+
// Cierra el popover del chevron antes de arrastrar: su posición se calcula
|
|
37805
|
+
// una sola vez al abrirlo, y reordenar columnas la invalida (bug de
|
|
37806
|
+
// posicionamiento si quedaba abierto apuntando a la columna vieja).
|
|
37807
|
+
handleDragStart(columnKey) {
|
|
37808
|
+
this.closeAll();
|
|
37809
|
+
this.onDragStart(columnKey);
|
|
37810
|
+
},
|
|
37684
37811
|
onChevronClick(columnKey, event) {
|
|
37685
37812
|
this.contextMenu = {
|
|
37686
37813
|
visible: false,
|
|
@@ -37694,12 +37821,19 @@ var script$4 = {
|
|
|
37694
37821
|
}
|
|
37695
37822
|
this.toggleChevron(columnKey);
|
|
37696
37823
|
const th = event.currentTarget.closest('th');
|
|
37697
|
-
const tableRect = this.$el.getBoundingClientRect();
|
|
37698
37824
|
const thRect = th.getBoundingClientRect();
|
|
37825
|
+
// Coordenadas de viewport (no relativas a la tabla): el popover es
|
|
37826
|
+
// position:fixed para no quedar clippado por el overflow:clip de .rq-table
|
|
37699
37827
|
this.chevronPopoverPos = {
|
|
37700
|
-
top: thRect.bottom
|
|
37701
|
-
left: Math.max(100, thRect.left
|
|
37828
|
+
top: thRect.bottom + 4,
|
|
37829
|
+
left: Math.max(100, thRect.left + thRect.width / 2)
|
|
37702
37830
|
};
|
|
37831
|
+
this.$nextTick(() => {
|
|
37832
|
+
if (this.$refs.chevronPopover) {
|
|
37833
|
+
this._chevronPopoverEl = this.$refs.chevronPopover;
|
|
37834
|
+
document.body.appendChild(this._chevronPopoverEl);
|
|
37835
|
+
}
|
|
37836
|
+
});
|
|
37703
37837
|
},
|
|
37704
37838
|
openContextMenu(colKey, event) {
|
|
37705
37839
|
this.closeChevron();
|
|
@@ -37721,16 +37855,69 @@ var script$4 = {
|
|
|
37721
37855
|
x: 0,
|
|
37722
37856
|
y: 0
|
|
37723
37857
|
};
|
|
37858
|
+
},
|
|
37859
|
+
toggleExpand(rowId) {
|
|
37860
|
+
this.expandedRowId = this.expandedRowId === rowId ? null : rowId;
|
|
37861
|
+
this.$emit('update:expanded-row-id', this.expandedRowId);
|
|
37862
|
+
},
|
|
37863
|
+
cellKey(rowId, headerId) {
|
|
37864
|
+
return `${rowId}::${headerId}`;
|
|
37865
|
+
},
|
|
37866
|
+
isTruncated(rowId, headerId) {
|
|
37867
|
+
return !!this.truncatedCells[this.cellKey(rowId, headerId)];
|
|
37868
|
+
},
|
|
37869
|
+
// Compara scrollWidth vs clientWidth de cada celda de texto plano para
|
|
37870
|
+
// saber cuáles están recortadas por el ellipsis y solo a esas envolverlas
|
|
37871
|
+
// en Tooltip. Se dispara por watchers, nunca desde el hook `updated`,
|
|
37872
|
+
// para no re-medir en loop cuando truncatedCells cambia.
|
|
37873
|
+
measureTruncatedCells() {
|
|
37874
|
+
if (!this.$el) return;
|
|
37875
|
+
const els = this.$el.querySelectorAll('.rq-table__cell-text[data-cell-key]');
|
|
37876
|
+
const result = {};
|
|
37877
|
+
els.forEach(el => {
|
|
37878
|
+
result[el.dataset.cellKey] = el.scrollWidth > el.clientWidth;
|
|
37879
|
+
});
|
|
37880
|
+
this.truncatedCells = result;
|
|
37881
|
+
}
|
|
37882
|
+
},
|
|
37883
|
+
watch: {
|
|
37884
|
+
tableRows() {
|
|
37885
|
+
this.$nextTick(this.measureTruncatedCells);
|
|
37886
|
+
},
|
|
37887
|
+
columns: {
|
|
37888
|
+
handler() {
|
|
37889
|
+
this.$nextTick(this.measureTruncatedCells);
|
|
37890
|
+
},
|
|
37891
|
+
deep: true
|
|
37724
37892
|
}
|
|
37725
37893
|
},
|
|
37726
37894
|
mounted() {
|
|
37727
37895
|
this._onKeydown = e => {
|
|
37728
37896
|
if (e.key === 'Escape') this.closeAll();
|
|
37729
37897
|
};
|
|
37898
|
+
this._onDocumentClick = () => this.closeAll();
|
|
37899
|
+
this._onResize = () => this.measureTruncatedCells();
|
|
37900
|
+
// El popover del chevron es position:fixed (coordenadas de viewport);
|
|
37901
|
+
// si cualquier ancestro scrollea (capture:true, scroll no burbujea),
|
|
37902
|
+
// se cierra en vez de quedar desalineado de su columna.
|
|
37903
|
+
this._onScroll = () => this.closeChevron();
|
|
37730
37904
|
document.addEventListener('keydown', this._onKeydown);
|
|
37905
|
+
document.addEventListener('click', this._onDocumentClick);
|
|
37906
|
+
window.addEventListener('resize', this._onResize);
|
|
37907
|
+
window.addEventListener('scroll', this._onScroll, true);
|
|
37908
|
+
this.$nextTick(this.measureTruncatedCells);
|
|
37731
37909
|
},
|
|
37732
37910
|
beforeDestroy() {
|
|
37733
37911
|
document.removeEventListener('keydown', this._onKeydown);
|
|
37912
|
+
document.removeEventListener('click', this._onDocumentClick);
|
|
37913
|
+
window.removeEventListener('resize', this._onResize);
|
|
37914
|
+
window.removeEventListener('scroll', this._onScroll, true);
|
|
37915
|
+
// El popover del chevron se mueve a document.body al abrirse (fuera del
|
|
37916
|
+
// árbol de la tabla); si el componente se destruye con el popover abierto,
|
|
37917
|
+
// destruir el root de la tabla no lo alcanza — hay que sacarlo a mano.
|
|
37918
|
+
if (this._chevronPopoverEl && this._chevronPopoverEl.parentNode) {
|
|
37919
|
+
this._chevronPopoverEl.parentNode.removeChild(this._chevronPopoverEl);
|
|
37920
|
+
}
|
|
37734
37921
|
}
|
|
37735
37922
|
};
|
|
37736
37923
|
|
|
@@ -37743,10 +37930,7 @@ var __vue_render__$4 = function () {
|
|
|
37743
37930
|
var _h = _vm.$createElement;
|
|
37744
37931
|
var _c = _vm._self._c || _h;
|
|
37745
37932
|
return _c("div", _vm._g({
|
|
37746
|
-
class: _vm.classes
|
|
37747
|
-
on: {
|
|
37748
|
-
click: _vm.closeAll
|
|
37749
|
-
}
|
|
37933
|
+
class: _vm.classes
|
|
37750
37934
|
}, _vm.$listeners), [_c("div", {
|
|
37751
37935
|
staticClass: "rq-table__scroll",
|
|
37752
37936
|
style: _vm.maxHeight ? {
|
|
@@ -37760,11 +37944,20 @@ var __vue_render__$4 = function () {
|
|
|
37760
37944
|
return _c("tr", {
|
|
37761
37945
|
key: headerGroup.id,
|
|
37762
37946
|
staticClass: "rq-table__tr rq-table__tr--head"
|
|
37763
|
-
}, [_vm.
|
|
37764
|
-
staticClass: "rq-table__th rq-table__th--
|
|
37947
|
+
}, [_vm.expandable ? _c("th", {
|
|
37948
|
+
staticClass: "rq-table__th rq-table__th--expand",
|
|
37765
37949
|
style: {
|
|
37766
37950
|
position: "sticky",
|
|
37767
37951
|
left: 0,
|
|
37952
|
+
zIndex: 5,
|
|
37953
|
+
width: _vm.expandColWidth + "px",
|
|
37954
|
+
minWidth: _vm.expandColWidth + "px"
|
|
37955
|
+
}
|
|
37956
|
+
}) : _vm._e(), _vm._v(" "), _vm.selectable ? _c("th", {
|
|
37957
|
+
staticClass: "rq-table__th rq-table__th--select",
|
|
37958
|
+
style: {
|
|
37959
|
+
position: "sticky",
|
|
37960
|
+
left: _vm.selectColOffset + "px",
|
|
37768
37961
|
zIndex: 5
|
|
37769
37962
|
}
|
|
37770
37963
|
}, [_c("Checkbox", {
|
|
@@ -37790,7 +37983,7 @@ var __vue_render__$4 = function () {
|
|
|
37790
37983
|
},
|
|
37791
37984
|
on: {
|
|
37792
37985
|
dragstart: function ($event) {
|
|
37793
|
-
return _vm.
|
|
37986
|
+
return _vm.handleDragStart(header.id);
|
|
37794
37987
|
},
|
|
37795
37988
|
dragover: function ($event) {
|
|
37796
37989
|
$event.preventDefault();
|
|
@@ -37833,12 +38026,18 @@ var __vue_render__$4 = function () {
|
|
|
37833
38026
|
}, [_c("td", {
|
|
37834
38027
|
staticClass: "rq-table__td rq-table__td--empty",
|
|
37835
38028
|
attrs: {
|
|
37836
|
-
colspan: _vm.
|
|
38029
|
+
colspan: _vm.fullColspan
|
|
37837
38030
|
}
|
|
37838
38031
|
}, [_vm._t("empty", function () {
|
|
37839
|
-
return [_c("
|
|
38032
|
+
return [_c("div", {
|
|
38033
|
+
staticClass: "rq-table__empty-state"
|
|
38034
|
+
}, [_c("p", {
|
|
38035
|
+
staticClass: "rq-table__empty-title"
|
|
38036
|
+
}, [_vm._v(_vm._s(_vm.resolvedEmptyState.title))]), _vm._v(" "), _vm.resolvedEmptyState.subtitle ? _c("p", {
|
|
38037
|
+
staticClass: "rq-table__empty-subtitle"
|
|
38038
|
+
}, [_vm._v(_vm._s(_vm.resolvedEmptyState.subtitle))]) : _vm._e()])];
|
|
37840
38039
|
})], 2)]) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableRows, function (row) {
|
|
37841
|
-
return _c("tr", {
|
|
38040
|
+
return [_c("tr", {
|
|
37842
38041
|
key: row.id,
|
|
37843
38042
|
staticClass: "rq-table__tr rq-table__tr--body",
|
|
37844
38043
|
on: {
|
|
@@ -37846,11 +38045,43 @@ var __vue_render__$4 = function () {
|
|
|
37846
38045
|
return _vm.$emit("row-click", row.original);
|
|
37847
38046
|
}
|
|
37848
38047
|
}
|
|
37849
|
-
}, [_vm.
|
|
37850
|
-
staticClass: "rq-table__td rq-table__td--
|
|
38048
|
+
}, [_vm.expandable ? _c("td", {
|
|
38049
|
+
staticClass: "rq-table__td rq-table__td--expand",
|
|
37851
38050
|
style: {
|
|
37852
38051
|
position: "sticky",
|
|
37853
38052
|
left: 0,
|
|
38053
|
+
zIndex: 2,
|
|
38054
|
+
width: _vm.expandColWidth + "px",
|
|
38055
|
+
minWidth: _vm.expandColWidth + "px"
|
|
38056
|
+
}
|
|
38057
|
+
}, [_c("div", {
|
|
38058
|
+
staticClass: "rq-table__expand-cell"
|
|
38059
|
+
}, [_c("button", {
|
|
38060
|
+
staticClass: "rq-table__expand-btn",
|
|
38061
|
+
class: {
|
|
38062
|
+
"rq-table__expand-btn--active": _vm.expandedRowId === row.id
|
|
38063
|
+
},
|
|
38064
|
+
attrs: {
|
|
38065
|
+
type: "button"
|
|
38066
|
+
},
|
|
38067
|
+
on: {
|
|
38068
|
+
click: function ($event) {
|
|
38069
|
+
$event.stopPropagation();
|
|
38070
|
+
return _vm.toggleExpand(row.id);
|
|
38071
|
+
}
|
|
38072
|
+
}
|
|
38073
|
+
}, [_c(_vm.ExpandIcon, {
|
|
38074
|
+
tag: "component",
|
|
38075
|
+
attrs: {
|
|
38076
|
+
size: 14
|
|
38077
|
+
}
|
|
38078
|
+
})], 1), _vm._v(" "), _vm._t("expand-cell", null, {
|
|
38079
|
+
row: row.original
|
|
38080
|
+
})], 2)]) : _vm._e(), _vm._v(" "), _vm.selectable ? _c("td", {
|
|
38081
|
+
staticClass: "rq-table__td rq-table__td--select",
|
|
38082
|
+
style: {
|
|
38083
|
+
position: "sticky",
|
|
38084
|
+
left: _vm.selectColOffset + "px",
|
|
37854
38085
|
zIndex: 2
|
|
37855
38086
|
},
|
|
37856
38087
|
on: {
|
|
@@ -37876,12 +38107,42 @@ var __vue_render__$4 = function () {
|
|
|
37876
38107
|
},
|
|
37877
38108
|
style: _vm.getColStyle(header)
|
|
37878
38109
|
}, [_vm._t("cell-" + header.id, function () {
|
|
37879
|
-
return [_vm.
|
|
38110
|
+
return [_vm.isTruncated(row.id, header.id) ? _c("Tooltip", {
|
|
38111
|
+
staticClass: "rq-table__cell-tooltip",
|
|
38112
|
+
attrs: {
|
|
38113
|
+
text: String(row.getValue(header.id))
|
|
38114
|
+
}
|
|
38115
|
+
}, [_c("span", {
|
|
38116
|
+
staticClass: "rq-table__cell-text",
|
|
38117
|
+
attrs: {
|
|
38118
|
+
"data-cell-key": _vm.cellKey(row.id, header.id)
|
|
38119
|
+
}
|
|
38120
|
+
}, [_vm._v(_vm._s(row.getValue(header.id)))])]) : _c("span", {
|
|
38121
|
+
staticClass: "rq-table__cell-text",
|
|
38122
|
+
attrs: {
|
|
38123
|
+
"data-cell-key": _vm.cellKey(row.id, header.id)
|
|
38124
|
+
}
|
|
38125
|
+
}, [_vm._v(_vm._s(row.getValue(header.id)))])];
|
|
37880
38126
|
}, {
|
|
37881
38127
|
row: row.original,
|
|
37882
38128
|
value: row.getValue(header.id)
|
|
37883
38129
|
})], 2);
|
|
37884
|
-
})], 2)
|
|
38130
|
+
})], 2), _vm._v(" "), _vm.expandable && _vm.expandedRowId === row.id ? _c("tr", {
|
|
38131
|
+
key: row.id + "-expanded",
|
|
38132
|
+
staticClass: "rq-table__tr rq-table__tr--expanded"
|
|
38133
|
+
}, [_c("td", {
|
|
38134
|
+
staticClass: "rq-table__td rq-table__td--expanded",
|
|
38135
|
+
attrs: {
|
|
38136
|
+
colspan: _vm.fullColspan
|
|
38137
|
+
}
|
|
38138
|
+
}, [_c("div", {
|
|
38139
|
+
staticClass: "rq-table__expanded-content",
|
|
38140
|
+
style: {
|
|
38141
|
+
height: _vm.expandedRowHeight + "px"
|
|
38142
|
+
}
|
|
38143
|
+
}, [_vm._t("expanded-row", null, {
|
|
38144
|
+
row: row.original
|
|
38145
|
+
})], 2)])]) : _vm._e()];
|
|
37885
38146
|
})], 2)])]), _vm._v(" "), _vm.contextMenu.visible ? _c("div", {
|
|
37886
38147
|
staticClass: "rq-table__context-menu",
|
|
37887
38148
|
style: {
|
|
@@ -37907,6 +38168,7 @@ var __vue_render__$4 = function () {
|
|
|
37907
38168
|
size: 14
|
|
37908
38169
|
}
|
|
37909
38170
|
}), _vm._v("\n " + _vm._s(_vm.contextMenu.colKey in _vm.pinnedLeftWidths ? "Desfijar columna" : "Fijar columna") + "\n ")], 1)]) : _vm._e(), _vm._v(" "), _vm.activeChevronKey ? _c("div", {
|
|
38171
|
+
ref: "chevronPopover",
|
|
37910
38172
|
staticClass: "rq-table__chevron-popover",
|
|
37911
38173
|
style: {
|
|
37912
38174
|
top: _vm.chevronPopoverPos.top + "px",
|
|
@@ -38016,6 +38278,24 @@ const dataTableVariants = cva('rq-data-table', {
|
|
|
38016
38278
|
//
|
|
38017
38279
|
//
|
|
38018
38280
|
//
|
|
38281
|
+
//
|
|
38282
|
+
//
|
|
38283
|
+
//
|
|
38284
|
+
//
|
|
38285
|
+
//
|
|
38286
|
+
//
|
|
38287
|
+
//
|
|
38288
|
+
//
|
|
38289
|
+
//
|
|
38290
|
+
//
|
|
38291
|
+
//
|
|
38292
|
+
//
|
|
38293
|
+
//
|
|
38294
|
+
//
|
|
38295
|
+
//
|
|
38296
|
+
//
|
|
38297
|
+
//
|
|
38298
|
+
//
|
|
38019
38299
|
|
|
38020
38300
|
var script$3 = {
|
|
38021
38301
|
name: 'DataTable',
|
|
@@ -38082,6 +38362,22 @@ var script$3 = {
|
|
|
38082
38362
|
deleteLabel: {
|
|
38083
38363
|
type: String,
|
|
38084
38364
|
default: 'Eliminar'
|
|
38365
|
+
},
|
|
38366
|
+
expandable: {
|
|
38367
|
+
type: Boolean,
|
|
38368
|
+
default: false
|
|
38369
|
+
},
|
|
38370
|
+
expandedRowHeight: {
|
|
38371
|
+
type: Number,
|
|
38372
|
+
default: 265
|
|
38373
|
+
},
|
|
38374
|
+
expandColWidth: {
|
|
38375
|
+
type: Number,
|
|
38376
|
+
default: 40
|
|
38377
|
+
},
|
|
38378
|
+
emptyState: {
|
|
38379
|
+
type: Object,
|
|
38380
|
+
default: null
|
|
38085
38381
|
}
|
|
38086
38382
|
},
|
|
38087
38383
|
data() {
|
|
@@ -38127,6 +38423,8 @@ var __vue_render__$3 = function () {
|
|
|
38127
38423
|
var _c = _vm._self._c || _h;
|
|
38128
38424
|
return _c("div", {
|
|
38129
38425
|
class: _vm.classes
|
|
38426
|
+
}, [_vm.showSearch || _vm.$slots.actions ? _c("div", {
|
|
38427
|
+
staticClass: "rq-data-table__search-row"
|
|
38130
38428
|
}, [_vm.showSearch ? _c("SearchInput", {
|
|
38131
38429
|
staticClass: "rq-data-table__search-bar",
|
|
38132
38430
|
attrs: {
|
|
@@ -38140,7 +38438,11 @@ var __vue_render__$3 = function () {
|
|
|
38140
38438
|
return _vm.$emit("update:search", $event);
|
|
38141
38439
|
}
|
|
38142
38440
|
}
|
|
38143
|
-
}) : _vm._e(), _vm._v(" "), _vm.
|
|
38441
|
+
}) : _vm._e(), _vm._v(" "), _vm.$slots.actions ? _c("div", {
|
|
38442
|
+
staticClass: "rq-data-table__actions"
|
|
38443
|
+
}, [_vm._t("actions")], 2) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _vm.selectable ? _c("div", {
|
|
38444
|
+
staticClass: "rq-data-table__selection-slot"
|
|
38445
|
+
}, [_vm.selectedCount > 0 ? _c("SelectionBar", {
|
|
38144
38446
|
attrs: {
|
|
38145
38447
|
count: _vm.selectedCount,
|
|
38146
38448
|
"delete-label": _vm.deleteLabel
|
|
@@ -38151,7 +38453,7 @@ var __vue_render__$3 = function () {
|
|
|
38151
38453
|
return _vm.$emit("delete-selected", _vm.selectedRows);
|
|
38152
38454
|
}
|
|
38153
38455
|
}
|
|
38154
|
-
}) : _vm._e(), _vm._v(" "), _c("Table", {
|
|
38456
|
+
}) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _c("Table", {
|
|
38155
38457
|
ref: "table",
|
|
38156
38458
|
attrs: {
|
|
38157
38459
|
columns: _vm.columns,
|
|
@@ -38160,7 +38462,11 @@ var __vue_render__$3 = function () {
|
|
|
38160
38462
|
"pinned-columns": _vm.pinnedColumns,
|
|
38161
38463
|
selectable: _vm.selectable,
|
|
38162
38464
|
"row-id": _vm.rowId,
|
|
38163
|
-
"max-height": _vm.maxHeight
|
|
38465
|
+
"max-height": _vm.maxHeight,
|
|
38466
|
+
expandable: _vm.expandable,
|
|
38467
|
+
"expanded-row-height": _vm.expandedRowHeight,
|
|
38468
|
+
"expand-col-width": _vm.expandColWidth,
|
|
38469
|
+
"empty-state": _vm.emptyState
|
|
38164
38470
|
},
|
|
38165
38471
|
on: {
|
|
38166
38472
|
"row-click": function ($event) {
|
|
@@ -38172,6 +38478,9 @@ var __vue_render__$3 = function () {
|
|
|
38172
38478
|
},
|
|
38173
38479
|
"update:pinned-columns": function ($event) {
|
|
38174
38480
|
return _vm.$emit("update:pinned-columns", $event);
|
|
38481
|
+
},
|
|
38482
|
+
"update:expanded-row-id": function ($event) {
|
|
38483
|
+
return _vm.$emit("update:expanded-row-id", $event);
|
|
38175
38484
|
}
|
|
38176
38485
|
},
|
|
38177
38486
|
scopedSlots: _vm._u([_vm._l(_vm.columns, function (col) {
|
|
@@ -38195,6 +38504,16 @@ var __vue_render__$3 = function () {
|
|
|
38195
38504
|
return [_vm._t("empty")];
|
|
38196
38505
|
},
|
|
38197
38506
|
proxy: true
|
|
38507
|
+
}, {
|
|
38508
|
+
key: "expanded-row",
|
|
38509
|
+
fn: function (slotProps) {
|
|
38510
|
+
return [_vm._t("expanded-row", null, null, slotProps)];
|
|
38511
|
+
}
|
|
38512
|
+
}, {
|
|
38513
|
+
key: "expand-cell",
|
|
38514
|
+
fn: function (slotProps) {
|
|
38515
|
+
return [_vm._t("expand-cell", null, null, slotProps)];
|
|
38516
|
+
}
|
|
38198
38517
|
}], null, true)
|
|
38199
38518
|
}), _vm._v(" "), _c("div", {
|
|
38200
38519
|
staticClass: "rq-data-table__pagination"
|
|
@@ -38727,11 +39046,20 @@ var script = {
|
|
|
38727
39046
|
} : {};
|
|
38728
39047
|
}
|
|
38729
39048
|
},
|
|
39049
|
+
watch: {
|
|
39050
|
+
open: {
|
|
39051
|
+
immediate: true,
|
|
39052
|
+
handler(isOpen) {
|
|
39053
|
+
document.body.style.overflow = isOpen ? 'hidden' : '';
|
|
39054
|
+
}
|
|
39055
|
+
}
|
|
39056
|
+
},
|
|
38730
39057
|
mounted() {
|
|
38731
39058
|
document.addEventListener('keydown', this.handleKeydown);
|
|
38732
39059
|
},
|
|
38733
39060
|
beforeDestroy() {
|
|
38734
39061
|
document.removeEventListener('keydown', this.handleKeydown);
|
|
39062
|
+
document.body.style.overflow = '';
|
|
38735
39063
|
},
|
|
38736
39064
|
methods: {
|
|
38737
39065
|
handleKeydown(e) {
|