@regcheq/ui-vue-2 1.6.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 CHANGED
@@ -686,6 +686,7 @@
686
686
  justify-content: center;
687
687
  flex-shrink: 0;
688
688
  vertical-align: middle;
689
+ margin-bottom: 4px;
689
690
  width: 16px;
690
691
  height: 16px;
691
692
  border-radius: 4px;
@@ -839,8 +840,8 @@
839
840
  align-items: center;
840
841
  justify-content: center;
841
842
  gap: 4px;
842
- height: 32px;
843
- padding: 4px 12px;
843
+ height: 20px;
844
+ padding: 0 12px;
844
845
  font-family: "Inter", sans-serif;
845
846
  font-weight: 400;
846
847
  font-size: 12px;
@@ -1536,9 +1537,10 @@
1536
1537
  display: flex;
1537
1538
  align-items: center;
1538
1539
  justify-content: space-between;
1540
+ min-height: 56px;
1539
1541
  padding: 12px 16px;
1540
1542
  background: #e6f0fc;
1541
- border-radius: 8px;
1543
+ border-radius: 0px;
1542
1544
  }
1543
1545
  .rq-selection-bar__info {
1544
1546
  display: flex;
@@ -1552,7 +1554,7 @@
1552
1554
  width: 6px;
1553
1555
  height: 6px;
1554
1556
  border-radius: 999px;
1555
- background: #0064e0;
1557
+ background: #00479f;
1556
1558
  }
1557
1559
  .rq-selection-bar__clear {
1558
1560
  background: none;
@@ -1562,8 +1564,23 @@
1562
1564
  font-size: 14px;
1563
1565
  color: #0064e0;
1564
1566
  cursor: pointer;
1565
- text-decoration: underline;
1567
+ text-decoration: none;
1568
+ }
1569
+ .rq-table__expanded-content::-webkit-scrollbar, .rq-table__scroll::-webkit-scrollbar {
1570
+ width: 6px;
1571
+ height: 6px;
1572
+ }
1573
+ .rq-table__expanded-content::-webkit-scrollbar-track, .rq-table__scroll::-webkit-scrollbar-track {
1574
+ background: transparent;
1575
+ }
1576
+ .rq-table__expanded-content::-webkit-scrollbar-thumb, .rq-table__scroll::-webkit-scrollbar-thumb {
1577
+ background: #e4e4e7;
1578
+ border-radius: 999px;
1579
+ }
1580
+ .rq-table__expanded-content::-webkit-scrollbar-corner, .rq-table__scroll::-webkit-scrollbar-corner {
1581
+ background: transparent;
1566
1582
  }
1583
+
1567
1584
  .rq-table {
1568
1585
  position: relative;
1569
1586
  display: flex;
@@ -1579,20 +1596,6 @@
1579
1596
  overflow: auto;
1580
1597
  flex: 1;
1581
1598
  }
1582
- .rq-table__scroll::-webkit-scrollbar {
1583
- width: 6px;
1584
- height: 6px;
1585
- }
1586
- .rq-table__scroll::-webkit-scrollbar-track {
1587
- background: transparent;
1588
- }
1589
- .rq-table__scroll::-webkit-scrollbar-thumb {
1590
- background: #e4e4e7;
1591
- border-radius: 999px;
1592
- }
1593
- .rq-table__scroll::-webkit-scrollbar-corner {
1594
- background: transparent;
1595
- }
1596
1599
  .rq-table__table {
1597
1600
  width: 100%;
1598
1601
  border-collapse: separate;
@@ -1606,6 +1609,7 @@
1606
1609
  background: #040045;
1607
1610
  }
1608
1611
  .rq-table__tr--body {
1612
+ height: 38px;
1609
1613
  cursor: pointer;
1610
1614
  background: #ffffff;
1611
1615
  transition: background 100ms ease;
@@ -1627,8 +1631,6 @@
1627
1631
  font-weight: 500;
1628
1632
  color: #ffffff;
1629
1633
  text-align: left;
1630
- white-space: nowrap;
1631
- overflow: hidden;
1632
1634
  background: #040045;
1633
1635
  cursor: grab;
1634
1636
  user-select: none;
@@ -1664,6 +1666,12 @@
1664
1666
  .rq-table__th--drag-over {
1665
1667
  border-left: 2px solid #5497ea;
1666
1668
  }
1669
+ .rq-table__th--expand {
1670
+ width: 40px;
1671
+ min-width: 40px;
1672
+ cursor: default;
1673
+ background: #040045;
1674
+ }
1667
1675
  .rq-table__th-content {
1668
1676
  display: flex;
1669
1677
  align-items: center;
@@ -1672,8 +1680,8 @@
1672
1680
  }
1673
1681
  .rq-table__th-label {
1674
1682
  flex: 1;
1675
- overflow: hidden;
1676
- text-overflow: ellipsis;
1683
+ white-space: normal;
1684
+ word-break: break-word;
1677
1685
  }
1678
1686
  .rq-table__chevron-btn {
1679
1687
  display: flex;
@@ -1697,10 +1705,38 @@
1697
1705
  color: #ffffff;
1698
1706
  transform: rotate(180deg);
1699
1707
  }
1708
+ .rq-table__expand-cell {
1709
+ display: flex;
1710
+ align-items: center;
1711
+ gap: 6px;
1712
+ }
1713
+ .rq-table__expand-btn {
1714
+ display: flex;
1715
+ align-items: center;
1716
+ justify-content: center;
1717
+ flex-shrink: 0;
1718
+ width: 20px;
1719
+ height: 20px;
1720
+ border: none;
1721
+ background: transparent;
1722
+ cursor: pointer;
1723
+ border-radius: 2px;
1724
+ color: #71717a;
1725
+ padding: 0;
1726
+ transition: color 200ms ease, background 200ms ease, transform 100ms ease;
1727
+ }
1728
+ .rq-table__expand-btn:hover {
1729
+ color: #18181b;
1730
+ background: #f4f4f5;
1731
+ }
1732
+ .rq-table__expand-btn--active {
1733
+ color: #18181b;
1734
+ transform: rotate(90deg);
1735
+ }
1700
1736
  .rq-table__chevron-popover {
1701
- position: absolute;
1737
+ position: fixed;
1702
1738
  transform: translateX(-50%);
1703
- z-index: 10;
1739
+ z-index: 1000;
1704
1740
  background: #ffffff;
1705
1741
  border: 1px solid #e4e4e7;
1706
1742
  border-radius: 8px;
@@ -1727,10 +1763,64 @@
1727
1763
  text-align: center;
1728
1764
  text-overflow: clip;
1729
1765
  }
1766
+ .rq-table__td--expand {
1767
+ width: 40px;
1768
+ min-width: 40px;
1769
+ text-overflow: clip;
1770
+ }
1730
1771
  .rq-table__td--empty {
1731
1772
  padding: 48px 16px;
1732
1773
  text-align: center;
1733
- color: #a1a1aa;
1774
+ }
1775
+ .rq-table__td--expanded {
1776
+ padding: 0;
1777
+ cursor: default;
1778
+ border-bottom: 1px solid #f4f4f5;
1779
+ }
1780
+ .rq-table__tr--expanded {
1781
+ background: #e6e6ec;
1782
+ cursor: default;
1783
+ }
1784
+ .rq-table__tr--expanded .rq-table__td:first-child {
1785
+ border-left: 2px solid #040045;
1786
+ }
1787
+ .rq-table__expanded-content {
1788
+ display: flex;
1789
+ justify-content: center;
1790
+ overflow-y: auto;
1791
+ padding: 16px;
1792
+ }
1793
+ .rq-table__empty-state {
1794
+ display: flex;
1795
+ flex-direction: column;
1796
+ align-items: center;
1797
+ gap: 8px;
1798
+ }
1799
+ .rq-table__empty-title {
1800
+ font-family: "Inter", sans-serif;
1801
+ font-weight: 600;
1802
+ font-size: 16px;
1803
+ color: #18181b;
1804
+ margin: 0;
1805
+ }
1806
+ .rq-table__empty-subtitle {
1807
+ font-family: "Inter", sans-serif;
1808
+ font-weight: 400;
1809
+ font-size: 14px;
1810
+ line-height: 22px;
1811
+ color: #71717a;
1812
+ max-width: 480px;
1813
+ margin: 0;
1814
+ }
1815
+ .rq-table__cell-tooltip {
1816
+ display: block;
1817
+ width: 100%;
1818
+ }
1819
+ .rq-table__cell-text {
1820
+ display: block;
1821
+ width: 100%;
1822
+ overflow: hidden;
1823
+ text-overflow: ellipsis;
1734
1824
  }
1735
1825
  .rq-table__context-menu {
1736
1826
  position: absolute;
@@ -1769,9 +1859,23 @@
1769
1859
  border-radius: 12px;
1770
1860
  padding: 16px;
1771
1861
  }
1862
+ .rq-data-table__search-row {
1863
+ display: flex;
1864
+ align-items: center;
1865
+ gap: 12px;
1866
+ }
1772
1867
  .rq-data-table__search-bar {
1773
1868
  display: flex;
1774
1869
  }
1870
+ .rq-data-table__actions {
1871
+ display: flex;
1872
+ align-items: center;
1873
+ gap: 8px;
1874
+ margin-left: auto;
1875
+ }
1876
+ .rq-data-table__selection-slot {
1877
+ min-height: 56px;
1878
+ }
1775
1879
  .rq-data-table__pagination {
1776
1880
  display: flex;
1777
1881
  align-items: center;
package/dist/index.esm.js CHANGED
@@ -32733,6 +32733,16 @@ var script$g = {
32733
32733
  type: String,
32734
32734
  default: 'default',
32735
32735
  validator: v => ['default', 'round'].includes(v)
32736
+ },
32737
+ // Escape hatch para casos puntuales que no cubren las variantes semánticas
32738
+ // (ej: un color dinámico que viene de datos). Pisan el color de la variante.
32739
+ bgColor: {
32740
+ type: String,
32741
+ default: null
32742
+ },
32743
+ textColor: {
32744
+ type: String,
32745
+ default: null
32736
32746
  }
32737
32747
  },
32738
32748
  computed: {
@@ -32741,6 +32751,12 @@ var script$g = {
32741
32751
  variant: this.variant,
32742
32752
  roundness: this.roundness
32743
32753
  });
32754
+ },
32755
+ inlineStyle() {
32756
+ const style = {};
32757
+ if (this.bgColor) style.backgroundColor = this.bgColor;
32758
+ if (this.textColor) style.color = this.textColor;
32759
+ return style;
32744
32760
  }
32745
32761
  }
32746
32762
  };
@@ -32754,7 +32770,8 @@ var __vue_render__$g = function () {
32754
32770
  var _h = _vm.$createElement;
32755
32771
  var _c = _vm._self._c || _h;
32756
32772
  return _c("span", _vm._g(_vm._b({
32757
- class: _vm.classes
32773
+ class: _vm.classes,
32774
+ style: _vm.inlineStyle
32758
32775
  }, "span", _vm.$attrs, false), _vm.$listeners), [_vm._t("left"), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm._t("right")], 2);
32759
32776
  };
32760
32777
  var __vue_staticRenderFns__$g = [];
@@ -34249,7 +34266,7 @@ var __vue_render__$5 = function () {
34249
34266
  }
34250
34267
  }, [_vm._v("\n Limpiar selección\n ")])]), _vm._v(" "), _c("Button", {
34251
34268
  attrs: {
34252
- variant: "primary",
34269
+ variant: "secondary",
34253
34270
  size: "md",
34254
34271
  "icon-right": "Trash2"
34255
34272
  },
@@ -37326,7 +37343,7 @@ function useTable(props, emit) {
37326
37343
  const left = columnPinning.value.left || [];
37327
37344
  if (!left.length) return {};
37328
37345
  const offsets = {};
37329
- let accumulated = props.selectable ? 40 : 0;
37346
+ let accumulated = (props.expandable ? props.expandColWidth || 40 : 0) + (props.selectable ? 40 : 0);
37330
37347
  left.forEach(key => {
37331
37348
  offsets[key] = accumulated;
37332
37349
  const col = props.columns.find(c => c.key === key);
@@ -37585,11 +37602,64 @@ function useTable(props, emit) {
37585
37602
  //
37586
37603
  //
37587
37604
  //
37605
+ //
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
+ //
37588
37657
 
37589
37658
  var script$4 = {
37590
37659
  name: 'Table',
37591
37660
  components: {
37592
- Checkbox: __vue_component__$j
37661
+ Checkbox: __vue_component__$j,
37662
+ Tooltip: __vue_component__$f
37593
37663
  },
37594
37664
  props: {
37595
37665
  rows: {
@@ -37619,6 +37689,28 @@ var script$4 = {
37619
37689
  maxHeight: {
37620
37690
  type: Number,
37621
37691
  default: null
37692
+ },
37693
+ expandable: {
37694
+ type: Boolean,
37695
+ default: false
37696
+ },
37697
+ // Alto fijo (no máximo) del contenido expandido; con scroll interno si el
37698
+ // contenido no entra.
37699
+ expandedRowHeight: {
37700
+ type: Number,
37701
+ default: 265
37702
+ },
37703
+ // Ancho de la columna de expandir en px. Default 40 (solo el chevron);
37704
+ // subilo si usás el slot `expand-cell` para agregar contenido extra.
37705
+ expandColWidth: {
37706
+ type: Number,
37707
+ default: 40
37708
+ },
37709
+ // { title, subtitle } para el estado "sin datos". Si no se pasa, se usa
37710
+ // un fallback genérico — el texto específico de dominio vive en el consumidor.
37711
+ emptyState: {
37712
+ type: Object,
37713
+ default: null
37622
37714
  }
37623
37715
  },
37624
37716
  setup(props, {
@@ -37639,7 +37731,9 @@ var script$4 = {
37639
37731
  colKey: null,
37640
37732
  x: 0,
37641
37733
  y: 0
37642
- }
37734
+ },
37735
+ truncatedCells: {},
37736
+ expandedRowId: null
37643
37737
  };
37644
37738
  },
37645
37739
  computed: {
@@ -37651,6 +37745,23 @@ var script$4 = {
37651
37745
  },
37652
37746
  PinIcon() {
37653
37747
  return Pin;
37748
+ },
37749
+ ExpandIcon() {
37750
+ return ChevronRight;
37751
+ },
37752
+ fullColspan() {
37753
+ return this.columns.length + (this.selectable ? 1 : 0) + (this.expandable ? 1 : 0);
37754
+ },
37755
+ resolvedEmptyState() {
37756
+ return {
37757
+ title: this.emptyState?.title || 'Sin datos',
37758
+ subtitle: this.emptyState?.subtitle || ''
37759
+ };
37760
+ },
37761
+ // Offset sticky de la columna de selección: se corre a la derecha
37762
+ // del ancho de la columna de expandir, cuando ambas están activas
37763
+ selectColOffset() {
37764
+ return this.expandable ? this.expandColWidth : 0;
37654
37765
  }
37655
37766
  },
37656
37767
  methods: {
@@ -37688,6 +37799,13 @@ var script$4 = {
37688
37799
  };
37689
37800
  }
37690
37801
  },
37802
+ // Cierra el popover del chevron antes de arrastrar: su posición se calcula
37803
+ // una sola vez al abrirlo, y reordenar columnas la invalida (bug de
37804
+ // posicionamiento si quedaba abierto apuntando a la columna vieja).
37805
+ handleDragStart(columnKey) {
37806
+ this.closeAll();
37807
+ this.onDragStart(columnKey);
37808
+ },
37691
37809
  onChevronClick(columnKey, event) {
37692
37810
  this.contextMenu = {
37693
37811
  visible: false,
@@ -37701,12 +37819,19 @@ var script$4 = {
37701
37819
  }
37702
37820
  this.toggleChevron(columnKey);
37703
37821
  const th = event.currentTarget.closest('th');
37704
- const tableRect = this.$el.getBoundingClientRect();
37705
37822
  const thRect = th.getBoundingClientRect();
37823
+ // Coordenadas de viewport (no relativas a la tabla): el popover es
37824
+ // position:fixed para no quedar clippado por el overflow:clip de .rq-table
37706
37825
  this.chevronPopoverPos = {
37707
- top: thRect.bottom - tableRect.top + 4,
37708
- left: Math.max(100, thRect.left - tableRect.left + thRect.width / 2)
37826
+ top: thRect.bottom + 4,
37827
+ left: Math.max(100, thRect.left + thRect.width / 2)
37709
37828
  };
37829
+ this.$nextTick(() => {
37830
+ if (this.$refs.chevronPopover) {
37831
+ this._chevronPopoverEl = this.$refs.chevronPopover;
37832
+ document.body.appendChild(this._chevronPopoverEl);
37833
+ }
37834
+ });
37710
37835
  },
37711
37836
  openContextMenu(colKey, event) {
37712
37837
  this.closeChevron();
@@ -37728,6 +37853,40 @@ var script$4 = {
37728
37853
  x: 0,
37729
37854
  y: 0
37730
37855
  };
37856
+ },
37857
+ toggleExpand(rowId) {
37858
+ this.expandedRowId = this.expandedRowId === rowId ? null : rowId;
37859
+ this.$emit('update:expanded-row-id', this.expandedRowId);
37860
+ },
37861
+ cellKey(rowId, headerId) {
37862
+ return `${rowId}::${headerId}`;
37863
+ },
37864
+ isTruncated(rowId, headerId) {
37865
+ return !!this.truncatedCells[this.cellKey(rowId, headerId)];
37866
+ },
37867
+ // Compara scrollWidth vs clientWidth de cada celda de texto plano para
37868
+ // saber cuáles están recortadas por el ellipsis y solo a esas envolverlas
37869
+ // en Tooltip. Se dispara por watchers, nunca desde el hook `updated`,
37870
+ // para no re-medir en loop cuando truncatedCells cambia.
37871
+ measureTruncatedCells() {
37872
+ if (!this.$el) return;
37873
+ const els = this.$el.querySelectorAll('.rq-table__cell-text[data-cell-key]');
37874
+ const result = {};
37875
+ els.forEach(el => {
37876
+ result[el.dataset.cellKey] = el.scrollWidth > el.clientWidth;
37877
+ });
37878
+ this.truncatedCells = result;
37879
+ }
37880
+ },
37881
+ watch: {
37882
+ tableRows() {
37883
+ this.$nextTick(this.measureTruncatedCells);
37884
+ },
37885
+ columns: {
37886
+ handler() {
37887
+ this.$nextTick(this.measureTruncatedCells);
37888
+ },
37889
+ deep: true
37731
37890
  }
37732
37891
  },
37733
37892
  mounted() {
@@ -37735,12 +37894,28 @@ var script$4 = {
37735
37894
  if (e.key === 'Escape') this.closeAll();
37736
37895
  };
37737
37896
  this._onDocumentClick = () => this.closeAll();
37897
+ this._onResize = () => this.measureTruncatedCells();
37898
+ // El popover del chevron es position:fixed (coordenadas de viewport);
37899
+ // si cualquier ancestro scrollea (capture:true, scroll no burbujea),
37900
+ // se cierra en vez de quedar desalineado de su columna.
37901
+ this._onScroll = () => this.closeChevron();
37738
37902
  document.addEventListener('keydown', this._onKeydown);
37739
37903
  document.addEventListener('click', this._onDocumentClick);
37904
+ window.addEventListener('resize', this._onResize);
37905
+ window.addEventListener('scroll', this._onScroll, true);
37906
+ this.$nextTick(this.measureTruncatedCells);
37740
37907
  },
37741
37908
  beforeDestroy() {
37742
37909
  document.removeEventListener('keydown', this._onKeydown);
37743
37910
  document.removeEventListener('click', this._onDocumentClick);
37911
+ window.removeEventListener('resize', this._onResize);
37912
+ window.removeEventListener('scroll', this._onScroll, true);
37913
+ // El popover del chevron se mueve a document.body al abrirse (fuera del
37914
+ // árbol de la tabla); si el componente se destruye con el popover abierto,
37915
+ // destruir el root de la tabla no lo alcanza — hay que sacarlo a mano.
37916
+ if (this._chevronPopoverEl && this._chevronPopoverEl.parentNode) {
37917
+ this._chevronPopoverEl.parentNode.removeChild(this._chevronPopoverEl);
37918
+ }
37744
37919
  }
37745
37920
  };
37746
37921
 
@@ -37767,11 +37942,20 @@ var __vue_render__$4 = function () {
37767
37942
  return _c("tr", {
37768
37943
  key: headerGroup.id,
37769
37944
  staticClass: "rq-table__tr rq-table__tr--head"
37770
- }, [_vm.selectable ? _c("th", {
37771
- staticClass: "rq-table__th rq-table__th--select",
37945
+ }, [_vm.expandable ? _c("th", {
37946
+ staticClass: "rq-table__th rq-table__th--expand",
37772
37947
  style: {
37773
37948
  position: "sticky",
37774
37949
  left: 0,
37950
+ zIndex: 5,
37951
+ width: _vm.expandColWidth + "px",
37952
+ minWidth: _vm.expandColWidth + "px"
37953
+ }
37954
+ }) : _vm._e(), _vm._v(" "), _vm.selectable ? _c("th", {
37955
+ staticClass: "rq-table__th rq-table__th--select",
37956
+ style: {
37957
+ position: "sticky",
37958
+ left: _vm.selectColOffset + "px",
37775
37959
  zIndex: 5
37776
37960
  }
37777
37961
  }, [_c("Checkbox", {
@@ -37797,7 +37981,7 @@ var __vue_render__$4 = function () {
37797
37981
  },
37798
37982
  on: {
37799
37983
  dragstart: function ($event) {
37800
- return _vm.onDragStart(header.id);
37984
+ return _vm.handleDragStart(header.id);
37801
37985
  },
37802
37986
  dragover: function ($event) {
37803
37987
  $event.preventDefault();
@@ -37840,12 +38024,18 @@ var __vue_render__$4 = function () {
37840
38024
  }, [_c("td", {
37841
38025
  staticClass: "rq-table__td rq-table__td--empty",
37842
38026
  attrs: {
37843
- colspan: _vm.columns.length + (_vm.selectable ? 1 : 0)
38027
+ colspan: _vm.fullColspan
37844
38028
  }
37845
38029
  }, [_vm._t("empty", function () {
37846
- return [_c("span", [_vm._v("Sin datos")])];
38030
+ return [_c("div", {
38031
+ staticClass: "rq-table__empty-state"
38032
+ }, [_c("p", {
38033
+ staticClass: "rq-table__empty-title"
38034
+ }, [_vm._v(_vm._s(_vm.resolvedEmptyState.title))]), _vm._v(" "), _vm.resolvedEmptyState.subtitle ? _c("p", {
38035
+ staticClass: "rq-table__empty-subtitle"
38036
+ }, [_vm._v(_vm._s(_vm.resolvedEmptyState.subtitle))]) : _vm._e()])];
37847
38037
  })], 2)]) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableRows, function (row) {
37848
- return _c("tr", {
38038
+ return [_c("tr", {
37849
38039
  key: row.id,
37850
38040
  staticClass: "rq-table__tr rq-table__tr--body",
37851
38041
  on: {
@@ -37853,11 +38043,43 @@ var __vue_render__$4 = function () {
37853
38043
  return _vm.$emit("row-click", row.original);
37854
38044
  }
37855
38045
  }
37856
- }, [_vm.selectable ? _c("td", {
37857
- staticClass: "rq-table__td rq-table__td--select",
38046
+ }, [_vm.expandable ? _c("td", {
38047
+ staticClass: "rq-table__td rq-table__td--expand",
37858
38048
  style: {
37859
38049
  position: "sticky",
37860
38050
  left: 0,
38051
+ zIndex: 2,
38052
+ width: _vm.expandColWidth + "px",
38053
+ minWidth: _vm.expandColWidth + "px"
38054
+ }
38055
+ }, [_c("div", {
38056
+ staticClass: "rq-table__expand-cell"
38057
+ }, [_c("button", {
38058
+ staticClass: "rq-table__expand-btn",
38059
+ class: {
38060
+ "rq-table__expand-btn--active": _vm.expandedRowId === row.id
38061
+ },
38062
+ attrs: {
38063
+ type: "button"
38064
+ },
38065
+ on: {
38066
+ click: function ($event) {
38067
+ $event.stopPropagation();
38068
+ return _vm.toggleExpand(row.id);
38069
+ }
38070
+ }
38071
+ }, [_c(_vm.ExpandIcon, {
38072
+ tag: "component",
38073
+ attrs: {
38074
+ size: 14
38075
+ }
38076
+ })], 1), _vm._v(" "), _vm._t("expand-cell", null, {
38077
+ row: row.original
38078
+ })], 2)]) : _vm._e(), _vm._v(" "), _vm.selectable ? _c("td", {
38079
+ staticClass: "rq-table__td rq-table__td--select",
38080
+ style: {
38081
+ position: "sticky",
38082
+ left: _vm.selectColOffset + "px",
37861
38083
  zIndex: 2
37862
38084
  },
37863
38085
  on: {
@@ -37883,12 +38105,42 @@ var __vue_render__$4 = function () {
37883
38105
  },
37884
38106
  style: _vm.getColStyle(header)
37885
38107
  }, [_vm._t("cell-" + header.id, function () {
37886
- return [_vm._v("\n " + _vm._s(row.getValue(header.id)) + "\n ")];
38108
+ return [_vm.isTruncated(row.id, header.id) ? _c("Tooltip", {
38109
+ staticClass: "rq-table__cell-tooltip",
38110
+ attrs: {
38111
+ text: String(row.getValue(header.id))
38112
+ }
38113
+ }, [_c("span", {
38114
+ staticClass: "rq-table__cell-text",
38115
+ attrs: {
38116
+ "data-cell-key": _vm.cellKey(row.id, header.id)
38117
+ }
38118
+ }, [_vm._v(_vm._s(row.getValue(header.id)))])]) : _c("span", {
38119
+ staticClass: "rq-table__cell-text",
38120
+ attrs: {
38121
+ "data-cell-key": _vm.cellKey(row.id, header.id)
38122
+ }
38123
+ }, [_vm._v(_vm._s(row.getValue(header.id)))])];
37887
38124
  }, {
37888
38125
  row: row.original,
37889
38126
  value: row.getValue(header.id)
37890
38127
  })], 2);
37891
- })], 2);
38128
+ })], 2), _vm._v(" "), _vm.expandable && _vm.expandedRowId === row.id ? _c("tr", {
38129
+ key: row.id + "-expanded",
38130
+ staticClass: "rq-table__tr rq-table__tr--expanded"
38131
+ }, [_c("td", {
38132
+ staticClass: "rq-table__td rq-table__td--expanded",
38133
+ attrs: {
38134
+ colspan: _vm.fullColspan
38135
+ }
38136
+ }, [_c("div", {
38137
+ staticClass: "rq-table__expanded-content",
38138
+ style: {
38139
+ height: _vm.expandedRowHeight + "px"
38140
+ }
38141
+ }, [_vm._t("expanded-row", null, {
38142
+ row: row.original
38143
+ })], 2)])]) : _vm._e()];
37892
38144
  })], 2)])]), _vm._v(" "), _vm.contextMenu.visible ? _c("div", {
37893
38145
  staticClass: "rq-table__context-menu",
37894
38146
  style: {
@@ -37914,6 +38166,7 @@ var __vue_render__$4 = function () {
37914
38166
  size: 14
37915
38167
  }
37916
38168
  }), _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", {
38169
+ ref: "chevronPopover",
37917
38170
  staticClass: "rq-table__chevron-popover",
37918
38171
  style: {
37919
38172
  top: _vm.chevronPopoverPos.top + "px",
@@ -38023,6 +38276,24 @@ const dataTableVariants = cva('rq-data-table', {
38023
38276
  //
38024
38277
  //
38025
38278
  //
38279
+ //
38280
+ //
38281
+ //
38282
+ //
38283
+ //
38284
+ //
38285
+ //
38286
+ //
38287
+ //
38288
+ //
38289
+ //
38290
+ //
38291
+ //
38292
+ //
38293
+ //
38294
+ //
38295
+ //
38296
+ //
38026
38297
 
38027
38298
  var script$3 = {
38028
38299
  name: 'DataTable',
@@ -38089,6 +38360,22 @@ var script$3 = {
38089
38360
  deleteLabel: {
38090
38361
  type: String,
38091
38362
  default: 'Eliminar'
38363
+ },
38364
+ expandable: {
38365
+ type: Boolean,
38366
+ default: false
38367
+ },
38368
+ expandedRowHeight: {
38369
+ type: Number,
38370
+ default: 265
38371
+ },
38372
+ expandColWidth: {
38373
+ type: Number,
38374
+ default: 40
38375
+ },
38376
+ emptyState: {
38377
+ type: Object,
38378
+ default: null
38092
38379
  }
38093
38380
  },
38094
38381
  data() {
@@ -38134,6 +38421,8 @@ var __vue_render__$3 = function () {
38134
38421
  var _c = _vm._self._c || _h;
38135
38422
  return _c("div", {
38136
38423
  class: _vm.classes
38424
+ }, [_vm.showSearch || _vm.$slots.actions ? _c("div", {
38425
+ staticClass: "rq-data-table__search-row"
38137
38426
  }, [_vm.showSearch ? _c("SearchInput", {
38138
38427
  staticClass: "rq-data-table__search-bar",
38139
38428
  attrs: {
@@ -38147,7 +38436,11 @@ var __vue_render__$3 = function () {
38147
38436
  return _vm.$emit("update:search", $event);
38148
38437
  }
38149
38438
  }
38150
- }) : _vm._e(), _vm._v(" "), _vm.selectable && _vm.selectedCount > 0 ? _c("SelectionBar", {
38439
+ }) : _vm._e(), _vm._v(" "), _vm.$slots.actions ? _c("div", {
38440
+ staticClass: "rq-data-table__actions"
38441
+ }, [_vm._t("actions")], 2) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _vm.selectable ? _c("div", {
38442
+ staticClass: "rq-data-table__selection-slot"
38443
+ }, [_vm.selectedCount > 0 ? _c("SelectionBar", {
38151
38444
  attrs: {
38152
38445
  count: _vm.selectedCount,
38153
38446
  "delete-label": _vm.deleteLabel
@@ -38158,7 +38451,7 @@ var __vue_render__$3 = function () {
38158
38451
  return _vm.$emit("delete-selected", _vm.selectedRows);
38159
38452
  }
38160
38453
  }
38161
- }) : _vm._e(), _vm._v(" "), _c("Table", {
38454
+ }) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _c("Table", {
38162
38455
  ref: "table",
38163
38456
  attrs: {
38164
38457
  columns: _vm.columns,
@@ -38167,7 +38460,11 @@ var __vue_render__$3 = function () {
38167
38460
  "pinned-columns": _vm.pinnedColumns,
38168
38461
  selectable: _vm.selectable,
38169
38462
  "row-id": _vm.rowId,
38170
- "max-height": _vm.maxHeight
38463
+ "max-height": _vm.maxHeight,
38464
+ expandable: _vm.expandable,
38465
+ "expanded-row-height": _vm.expandedRowHeight,
38466
+ "expand-col-width": _vm.expandColWidth,
38467
+ "empty-state": _vm.emptyState
38171
38468
  },
38172
38469
  on: {
38173
38470
  "row-click": function ($event) {
@@ -38179,6 +38476,9 @@ var __vue_render__$3 = function () {
38179
38476
  },
38180
38477
  "update:pinned-columns": function ($event) {
38181
38478
  return _vm.$emit("update:pinned-columns", $event);
38479
+ },
38480
+ "update:expanded-row-id": function ($event) {
38481
+ return _vm.$emit("update:expanded-row-id", $event);
38182
38482
  }
38183
38483
  },
38184
38484
  scopedSlots: _vm._u([_vm._l(_vm.columns, function (col) {
@@ -38202,6 +38502,16 @@ var __vue_render__$3 = function () {
38202
38502
  return [_vm._t("empty")];
38203
38503
  },
38204
38504
  proxy: true
38505
+ }, {
38506
+ key: "expanded-row",
38507
+ fn: function (slotProps) {
38508
+ return [_vm._t("expanded-row", null, null, slotProps)];
38509
+ }
38510
+ }, {
38511
+ key: "expand-cell",
38512
+ fn: function (slotProps) {
38513
+ return [_vm._t("expand-cell", null, null, slotProps)];
38514
+ }
38205
38515
  }], null, true)
38206
38516
  }), _vm._v(" "), _c("div", {
38207
38517
  staticClass: "rq-data-table__pagination"
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: "primary",
34271
+ variant: "secondary",
34255
34272
  size: "md",
34256
34273
  "icon-right": "Trash2"
34257
34274
  },
@@ -37328,7 +37345,7 @@ function useTable(props, emit) {
37328
37345
  const left = columnPinning.value.left || [];
37329
37346
  if (!left.length) return {};
37330
37347
  const offsets = {};
37331
- let accumulated = props.selectable ? 40 : 0;
37348
+ let accumulated = (props.expandable ? props.expandColWidth || 40 : 0) + (props.selectable ? 40 : 0);
37332
37349
  left.forEach(key => {
37333
37350
  offsets[key] = accumulated;
37334
37351
  const col = props.columns.find(c => c.key === key);
@@ -37587,11 +37604,64 @@ function useTable(props, emit) {
37587
37604
  //
37588
37605
  //
37589
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
+ //
37590
37659
 
37591
37660
  var script$4 = {
37592
37661
  name: 'Table',
37593
37662
  components: {
37594
- Checkbox: __vue_component__$j
37663
+ Checkbox: __vue_component__$j,
37664
+ Tooltip: __vue_component__$f
37595
37665
  },
37596
37666
  props: {
37597
37667
  rows: {
@@ -37621,6 +37691,28 @@ var script$4 = {
37621
37691
  maxHeight: {
37622
37692
  type: Number,
37623
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
37624
37716
  }
37625
37717
  },
37626
37718
  setup(props, {
@@ -37641,7 +37733,9 @@ var script$4 = {
37641
37733
  colKey: null,
37642
37734
  x: 0,
37643
37735
  y: 0
37644
- }
37736
+ },
37737
+ truncatedCells: {},
37738
+ expandedRowId: null
37645
37739
  };
37646
37740
  },
37647
37741
  computed: {
@@ -37653,6 +37747,23 @@ var script$4 = {
37653
37747
  },
37654
37748
  PinIcon() {
37655
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;
37656
37767
  }
37657
37768
  },
37658
37769
  methods: {
@@ -37690,6 +37801,13 @@ var script$4 = {
37690
37801
  };
37691
37802
  }
37692
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
+ },
37693
37811
  onChevronClick(columnKey, event) {
37694
37812
  this.contextMenu = {
37695
37813
  visible: false,
@@ -37703,12 +37821,19 @@ var script$4 = {
37703
37821
  }
37704
37822
  this.toggleChevron(columnKey);
37705
37823
  const th = event.currentTarget.closest('th');
37706
- const tableRect = this.$el.getBoundingClientRect();
37707
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
37708
37827
  this.chevronPopoverPos = {
37709
- top: thRect.bottom - tableRect.top + 4,
37710
- left: Math.max(100, thRect.left - tableRect.left + thRect.width / 2)
37828
+ top: thRect.bottom + 4,
37829
+ left: Math.max(100, thRect.left + thRect.width / 2)
37711
37830
  };
37831
+ this.$nextTick(() => {
37832
+ if (this.$refs.chevronPopover) {
37833
+ this._chevronPopoverEl = this.$refs.chevronPopover;
37834
+ document.body.appendChild(this._chevronPopoverEl);
37835
+ }
37836
+ });
37712
37837
  },
37713
37838
  openContextMenu(colKey, event) {
37714
37839
  this.closeChevron();
@@ -37730,6 +37855,40 @@ var script$4 = {
37730
37855
  x: 0,
37731
37856
  y: 0
37732
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
37733
37892
  }
37734
37893
  },
37735
37894
  mounted() {
@@ -37737,12 +37896,28 @@ var script$4 = {
37737
37896
  if (e.key === 'Escape') this.closeAll();
37738
37897
  };
37739
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();
37740
37904
  document.addEventListener('keydown', this._onKeydown);
37741
37905
  document.addEventListener('click', this._onDocumentClick);
37906
+ window.addEventListener('resize', this._onResize);
37907
+ window.addEventListener('scroll', this._onScroll, true);
37908
+ this.$nextTick(this.measureTruncatedCells);
37742
37909
  },
37743
37910
  beforeDestroy() {
37744
37911
  document.removeEventListener('keydown', this._onKeydown);
37745
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
+ }
37746
37921
  }
37747
37922
  };
37748
37923
 
@@ -37769,11 +37944,20 @@ var __vue_render__$4 = function () {
37769
37944
  return _c("tr", {
37770
37945
  key: headerGroup.id,
37771
37946
  staticClass: "rq-table__tr rq-table__tr--head"
37772
- }, [_vm.selectable ? _c("th", {
37773
- staticClass: "rq-table__th rq-table__th--select",
37947
+ }, [_vm.expandable ? _c("th", {
37948
+ staticClass: "rq-table__th rq-table__th--expand",
37774
37949
  style: {
37775
37950
  position: "sticky",
37776
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",
37777
37961
  zIndex: 5
37778
37962
  }
37779
37963
  }, [_c("Checkbox", {
@@ -37799,7 +37983,7 @@ var __vue_render__$4 = function () {
37799
37983
  },
37800
37984
  on: {
37801
37985
  dragstart: function ($event) {
37802
- return _vm.onDragStart(header.id);
37986
+ return _vm.handleDragStart(header.id);
37803
37987
  },
37804
37988
  dragover: function ($event) {
37805
37989
  $event.preventDefault();
@@ -37842,12 +38026,18 @@ var __vue_render__$4 = function () {
37842
38026
  }, [_c("td", {
37843
38027
  staticClass: "rq-table__td rq-table__td--empty",
37844
38028
  attrs: {
37845
- colspan: _vm.columns.length + (_vm.selectable ? 1 : 0)
38029
+ colspan: _vm.fullColspan
37846
38030
  }
37847
38031
  }, [_vm._t("empty", function () {
37848
- return [_c("span", [_vm._v("Sin datos")])];
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()])];
37849
38039
  })], 2)]) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableRows, function (row) {
37850
- return _c("tr", {
38040
+ return [_c("tr", {
37851
38041
  key: row.id,
37852
38042
  staticClass: "rq-table__tr rq-table__tr--body",
37853
38043
  on: {
@@ -37855,11 +38045,43 @@ var __vue_render__$4 = function () {
37855
38045
  return _vm.$emit("row-click", row.original);
37856
38046
  }
37857
38047
  }
37858
- }, [_vm.selectable ? _c("td", {
37859
- staticClass: "rq-table__td rq-table__td--select",
38048
+ }, [_vm.expandable ? _c("td", {
38049
+ staticClass: "rq-table__td rq-table__td--expand",
37860
38050
  style: {
37861
38051
  position: "sticky",
37862
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",
37863
38085
  zIndex: 2
37864
38086
  },
37865
38087
  on: {
@@ -37885,12 +38107,42 @@ var __vue_render__$4 = function () {
37885
38107
  },
37886
38108
  style: _vm.getColStyle(header)
37887
38109
  }, [_vm._t("cell-" + header.id, function () {
37888
- return [_vm._v("\n " + _vm._s(row.getValue(header.id)) + "\n ")];
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)))])];
37889
38126
  }, {
37890
38127
  row: row.original,
37891
38128
  value: row.getValue(header.id)
37892
38129
  })], 2);
37893
- })], 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()];
37894
38146
  })], 2)])]), _vm._v(" "), _vm.contextMenu.visible ? _c("div", {
37895
38147
  staticClass: "rq-table__context-menu",
37896
38148
  style: {
@@ -37916,6 +38168,7 @@ var __vue_render__$4 = function () {
37916
38168
  size: 14
37917
38169
  }
37918
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",
37919
38172
  staticClass: "rq-table__chevron-popover",
37920
38173
  style: {
37921
38174
  top: _vm.chevronPopoverPos.top + "px",
@@ -38025,6 +38278,24 @@ const dataTableVariants = cva('rq-data-table', {
38025
38278
  //
38026
38279
  //
38027
38280
  //
38281
+ //
38282
+ //
38283
+ //
38284
+ //
38285
+ //
38286
+ //
38287
+ //
38288
+ //
38289
+ //
38290
+ //
38291
+ //
38292
+ //
38293
+ //
38294
+ //
38295
+ //
38296
+ //
38297
+ //
38298
+ //
38028
38299
 
38029
38300
  var script$3 = {
38030
38301
  name: 'DataTable',
@@ -38091,6 +38362,22 @@ var script$3 = {
38091
38362
  deleteLabel: {
38092
38363
  type: String,
38093
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
38094
38381
  }
38095
38382
  },
38096
38383
  data() {
@@ -38136,6 +38423,8 @@ var __vue_render__$3 = function () {
38136
38423
  var _c = _vm._self._c || _h;
38137
38424
  return _c("div", {
38138
38425
  class: _vm.classes
38426
+ }, [_vm.showSearch || _vm.$slots.actions ? _c("div", {
38427
+ staticClass: "rq-data-table__search-row"
38139
38428
  }, [_vm.showSearch ? _c("SearchInput", {
38140
38429
  staticClass: "rq-data-table__search-bar",
38141
38430
  attrs: {
@@ -38149,7 +38438,11 @@ var __vue_render__$3 = function () {
38149
38438
  return _vm.$emit("update:search", $event);
38150
38439
  }
38151
38440
  }
38152
- }) : _vm._e(), _vm._v(" "), _vm.selectable && _vm.selectedCount > 0 ? _c("SelectionBar", {
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", {
38153
38446
  attrs: {
38154
38447
  count: _vm.selectedCount,
38155
38448
  "delete-label": _vm.deleteLabel
@@ -38160,7 +38453,7 @@ var __vue_render__$3 = function () {
38160
38453
  return _vm.$emit("delete-selected", _vm.selectedRows);
38161
38454
  }
38162
38455
  }
38163
- }) : _vm._e(), _vm._v(" "), _c("Table", {
38456
+ }) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _c("Table", {
38164
38457
  ref: "table",
38165
38458
  attrs: {
38166
38459
  columns: _vm.columns,
@@ -38169,7 +38462,11 @@ var __vue_render__$3 = function () {
38169
38462
  "pinned-columns": _vm.pinnedColumns,
38170
38463
  selectable: _vm.selectable,
38171
38464
  "row-id": _vm.rowId,
38172
- "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
38173
38470
  },
38174
38471
  on: {
38175
38472
  "row-click": function ($event) {
@@ -38181,6 +38478,9 @@ var __vue_render__$3 = function () {
38181
38478
  },
38182
38479
  "update:pinned-columns": function ($event) {
38183
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);
38184
38484
  }
38185
38485
  },
38186
38486
  scopedSlots: _vm._u([_vm._l(_vm.columns, function (col) {
@@ -38204,6 +38504,16 @@ var __vue_render__$3 = function () {
38204
38504
  return [_vm._t("empty")];
38205
38505
  },
38206
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
+ }
38207
38517
  }], null, true)
38208
38518
  }), _vm._v(" "), _c("div", {
38209
38519
  staticClass: "rq-data-table__pagination"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regcheq/ui-vue-2",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "files": [