@regcheq/ui-vue-2 1.11.0 → 1.12.1

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
@@ -949,14 +949,13 @@
949
949
  position: relative;
950
950
  display: inline-block;
951
951
  }
952
- .rq-tooltip-wrapper:hover .rq-tooltip, .rq-tooltip-wrapper:focus-within .rq-tooltip {
952
+ .rq-tooltip-wrapper .rq-tooltip--visible {
953
953
  opacity: 1;
954
954
  pointer-events: auto;
955
955
  }
956
956
 
957
957
  .rq-tooltip {
958
- position: absolute;
959
- z-index: 50;
958
+ z-index: 1000;
960
959
  width: max-content;
961
960
  min-width: 100px;
962
961
  max-width: 300px;
@@ -990,8 +989,6 @@
990
989
  height: 0;
991
990
  }
992
991
  .rq-tooltip--top {
993
- bottom: calc(100% + 8px);
994
- left: 50%;
995
992
  transform: translateX(-50%);
996
993
  }
997
994
  .rq-tooltip--top::after {
@@ -1003,8 +1000,6 @@
1003
1000
  border-top: 5px solid #000000;
1004
1001
  }
1005
1002
  .rq-tooltip--bottom {
1006
- top: calc(100% + 8px);
1007
- left: 50%;
1008
1003
  transform: translateX(-50%);
1009
1004
  }
1010
1005
  .rq-tooltip--bottom::after {
@@ -1016,8 +1011,6 @@
1016
1011
  border-bottom: 5px solid #000000;
1017
1012
  }
1018
1013
  .rq-tooltip--left {
1019
- right: calc(100% + 8px);
1020
- top: 50%;
1021
1014
  transform: translateY(-50%);
1022
1015
  }
1023
1016
  .rq-tooltip--left::after {
@@ -1029,8 +1022,6 @@
1029
1022
  border-left: 5px solid #000000;
1030
1023
  }
1031
1024
  .rq-tooltip--right {
1032
- left: calc(100% + 8px);
1033
- top: 50%;
1034
1025
  transform: translateY(-50%);
1035
1026
  }
1036
1027
  .rq-tooltip--right::after {
@@ -1787,8 +1778,7 @@
1787
1778
  .rq-table__td {
1788
1779
  padding: 8px 16px;
1789
1780
  white-space: nowrap;
1790
- overflow: hidden;
1791
- text-overflow: ellipsis;
1781
+ overflow: visible;
1792
1782
  background: inherit;
1793
1783
  font-size: 14px;
1794
1784
  color: #18181b;
package/dist/index.esm.js CHANGED
@@ -32959,7 +32959,24 @@ const tooltipVariants = cva('rq-tooltip', {
32959
32959
  //
32960
32960
  //
32961
32961
  //
32962
+ //
32963
+ //
32964
+ //
32965
+ //
32966
+ //
32967
+ //
32968
+ //
32969
+ //
32970
+ //
32971
+ //
32972
+ //
32973
+ //
32974
+ //
32962
32975
 
32976
+
32977
+ // Separación entre el trigger y la burbuja, en px. Igual al gap que antes
32978
+ // definía el CSS con calc(100% + 8px).
32979
+ const GAP = 8;
32963
32980
  var script$f = {
32964
32981
  name: 'Tooltip',
32965
32982
  props: {
@@ -32978,12 +32995,93 @@ var script$f = {
32978
32995
  default: ''
32979
32996
  }
32980
32997
  },
32998
+ data() {
32999
+ return {
33000
+ visible: false,
33001
+ coords: null
33002
+ };
33003
+ },
32981
33004
  computed: {
32982
33005
  classes() {
32983
33006
  return tooltipVariants({
32984
33007
  side: this.side,
32985
33008
  textAlign: this.textAlign
32986
33009
  });
33010
+ },
33011
+ // position: fixed lo ancla al viewport, así ningún ancestro con overflow
33012
+ // (celda de tabla, panel con scroll, drawer) puede recortarlo. Además deja
33013
+ // de aportar al área scrolleable del contenedor, que con `absolute`
33014
+ // producía scrollbars horizontales aunque el tooltip estuviera oculto.
33015
+ style() {
33016
+ const base = {
33017
+ position: 'fixed'
33018
+ };
33019
+ if (!this.coords) return {
33020
+ ...base,
33021
+ top: '-9999px',
33022
+ left: '-9999px'
33023
+ };
33024
+ return {
33025
+ ...base,
33026
+ top: `${this.coords.top}px`,
33027
+ left: `${this.coords.left}px`
33028
+ };
33029
+ }
33030
+ },
33031
+ beforeDestroy() {
33032
+ this.unbindReposition();
33033
+ },
33034
+ methods: {
33035
+ show() {
33036
+ this.updatePosition();
33037
+ this.visible = true;
33038
+ this.bindReposition();
33039
+ },
33040
+ hide() {
33041
+ this.visible = false;
33042
+ this.unbindReposition();
33043
+ },
33044
+ // Al estar fijo al viewport, el tooltip no sigue al trigger cuando la
33045
+ // página o un contenedor interno scrollea: se recalcula mientras se ve.
33046
+ bindReposition() {
33047
+ if (this._reposition) return;
33048
+ this._reposition = () => this.updatePosition();
33049
+ window.addEventListener('scroll', this._reposition, true);
33050
+ window.addEventListener('resize', this._reposition);
33051
+ },
33052
+ unbindReposition() {
33053
+ if (!this._reposition) return;
33054
+ window.removeEventListener('scroll', this._reposition, true);
33055
+ window.removeEventListener('resize', this._reposition);
33056
+ this._reposition = null;
33057
+ },
33058
+ updatePosition() {
33059
+ const trigger = this.$el;
33060
+ const tooltip = this.$refs.tooltip;
33061
+ if (!trigger || !tooltip) return;
33062
+ const t = trigger.getBoundingClientRect();
33063
+ const b = tooltip.getBoundingClientRect();
33064
+ const centerX = t.left + t.width / 2;
33065
+ const centerY = t.top + t.height / 2;
33066
+ const porLado = {
33067
+ top: {
33068
+ top: t.top - b.height - GAP,
33069
+ left: centerX
33070
+ },
33071
+ bottom: {
33072
+ top: t.bottom + GAP,
33073
+ left: centerX
33074
+ },
33075
+ left: {
33076
+ top: centerY,
33077
+ left: t.left - b.width - GAP
33078
+ },
33079
+ right: {
33080
+ top: centerY,
33081
+ left: t.right + GAP
33082
+ }
33083
+ };
33084
+ this.coords = porLado[this.side] || porLado.top;
32987
33085
  }
32988
33086
  }
32989
33087
  };
@@ -32997,10 +33095,20 @@ var __vue_render__$f = function () {
32997
33095
  var _h = _vm.$createElement;
32998
33096
  var _c = _vm._self._c || _h;
32999
33097
  return _c("div", _vm._g({
33000
- staticClass: "rq-tooltip-wrapper"
33098
+ staticClass: "rq-tooltip-wrapper",
33099
+ on: {
33100
+ mouseenter: _vm.show,
33101
+ mouseleave: _vm.hide,
33102
+ focusin: _vm.show,
33103
+ focusout: _vm.hide
33104
+ }
33001
33105
  }, _vm.$listeners), [_vm._t("default"), _vm._v(" "), _c("div", {
33002
- class: _vm.classes
33003
- }, [_vm._v(_vm._s(_vm.text))])], 2);
33106
+ ref: "tooltip",
33107
+ class: [_vm.classes, {
33108
+ "rq-tooltip--visible": _vm.visible
33109
+ }],
33110
+ style: _vm.style
33111
+ }, [_vm._v("\n " + _vm._s(_vm.text) + "\n ")])], 2);
33004
33112
  };
33005
33113
  var __vue_staticRenderFns__$f = [];
33006
33114
  __vue_render__$f._withStripped = true;
@@ -37790,6 +37898,15 @@ function useTable(props, emit) {
37790
37898
  //
37791
37899
  //
37792
37900
  //
37901
+ //
37902
+ //
37903
+ //
37904
+ //
37905
+ //
37906
+ //
37907
+ //
37908
+ //
37909
+ //
37793
37910
 
37794
37911
  var script$4 = {
37795
37912
  name: 'Table',
@@ -37869,6 +37986,7 @@ var script$4 = {
37869
37986
  y: 0
37870
37987
  },
37871
37988
  truncatedCells: {},
37989
+ cellTexts: {},
37872
37990
  expandedRowId: null
37873
37991
  };
37874
37992
  },
@@ -38029,10 +38147,18 @@ var script$4 = {
38029
38147
  if (!this.$el) return;
38030
38148
  const els = this.$el.querySelectorAll('.rq-table__cell-text[data-cell-key]');
38031
38149
  const result = {};
38150
+ const texts = {};
38032
38151
  els.forEach(el => {
38033
38152
  result[el.dataset.cellKey] = el.scrollWidth > el.clientWidth;
38153
+ // Se guarda el texto ya renderizado: si la celda pasa por un slot que
38154
+ // formatea el valor, el tooltip debe mostrar lo que el usuario ve.
38155
+ texts[el.dataset.cellKey] = el.textContent.trim();
38034
38156
  });
38035
38157
  this.truncatedCells = result;
38158
+ this.cellTexts = texts;
38159
+ },
38160
+ cellTooltipText(rowId, headerId) {
38161
+ return this.cellTexts[this.cellKey(rowId, headerId)] || '';
38036
38162
  }
38037
38163
  },
38038
38164
  watch: {
@@ -38261,27 +38387,32 @@ var __vue_render__$4 = function () {
38261
38387
  "rq-table__td--pinned": header.id in _vm.pinnedLeftWidths
38262
38388
  },
38263
38389
  style: _vm.getColStyle(header)
38390
+ }, [_vm.isTruncated(row.id, header.id) ? _c("Tooltip", {
38391
+ staticClass: "rq-table__cell-tooltip",
38392
+ attrs: {
38393
+ text: _vm.cellTooltipText(row.id, header.id)
38394
+ }
38395
+ }, [_c("span", {
38396
+ staticClass: "rq-table__cell-text",
38397
+ attrs: {
38398
+ "data-cell-key": _vm.cellKey(row.id, header.id)
38399
+ }
38264
38400
  }, [_vm._t("cell-" + header.id, function () {
38265
- return [_vm.isTruncated(row.id, header.id) ? _c("Tooltip", {
38266
- staticClass: "rq-table__cell-tooltip",
38267
- attrs: {
38268
- text: String(row.getValue(header.id))
38269
- }
38270
- }, [_c("span", {
38271
- staticClass: "rq-table__cell-text",
38272
- attrs: {
38273
- "data-cell-key": _vm.cellKey(row.id, header.id)
38274
- }
38275
- }, [_vm._v(_vm._s(row.getValue(header.id)))])]) : _c("span", {
38276
- staticClass: "rq-table__cell-text",
38277
- attrs: {
38278
- "data-cell-key": _vm.cellKey(row.id, header.id)
38279
- }
38280
- }, [_vm._v(_vm._s(row.getValue(header.id)))])];
38401
+ return [_vm._v(_vm._s(row.getValue(header.id)))];
38402
+ }, {
38403
+ row: row.original,
38404
+ value: row.getValue(header.id)
38405
+ })], 2)]) : _c("span", {
38406
+ staticClass: "rq-table__cell-text",
38407
+ attrs: {
38408
+ "data-cell-key": _vm.cellKey(row.id, header.id)
38409
+ }
38410
+ }, [_vm._t("cell-" + header.id, function () {
38411
+ return [_vm._v(_vm._s(row.getValue(header.id)))];
38281
38412
  }, {
38282
38413
  row: row.original,
38283
38414
  value: row.getValue(header.id)
38284
- })], 2);
38415
+ })], 2)], 1);
38285
38416
  })], 2), _vm._v(" "), _vm.expandable && _vm.expandedRowId === row.id ? _c("tr", {
38286
38417
  key: row.id + "-expanded",
38287
38418
  staticClass: "rq-table__tr rq-table__tr--expanded"
@@ -39174,6 +39305,52 @@ const __vue_component__$1 = /*#__PURE__*/normalizeComponent({
39174
39305
  //
39175
39306
  //
39176
39307
 
39308
+
39309
+ // Registro de bloqueos compartido entre todas las instancias: guarda cuántos
39310
+ // drawers abiertos dependen de cada contenedor y cuál era su overflow original.
39311
+ // Sin el contador, cerrar un drawer devolvería el scroll aunque siguiera otro
39312
+ // abierto sobre el mismo contenedor.
39313
+ const scrollLocks = new Map();
39314
+
39315
+ // El scroll de fondo no siempre vive en el body: muchas apps scrollean en un
39316
+ // contenedor interno. Se bloquean todos los ancestros scrolleables más el body.
39317
+ function scrollableAncestors(node) {
39318
+ const targets = [];
39319
+ let el = node;
39320
+ while (el && el !== document.body && el.nodeType === 1) {
39321
+ const {
39322
+ overflowY
39323
+ } = window.getComputedStyle(el);
39324
+ if (overflowY === 'auto' || overflowY === 'scroll') targets.push(el);
39325
+ el = el.parentElement;
39326
+ }
39327
+ targets.push(document.body);
39328
+ return targets;
39329
+ }
39330
+ function lockScroll(targets) {
39331
+ targets.forEach(el => {
39332
+ const lock = scrollLocks.get(el);
39333
+ if (lock) {
39334
+ lock.count += 1;
39335
+ return;
39336
+ }
39337
+ scrollLocks.set(el, {
39338
+ count: 1,
39339
+ previousOverflow: el.style.overflow
39340
+ });
39341
+ el.style.overflow = 'hidden';
39342
+ });
39343
+ }
39344
+ function unlockScroll(targets) {
39345
+ targets.forEach(el => {
39346
+ const lock = scrollLocks.get(el);
39347
+ if (!lock) return;
39348
+ lock.count -= 1;
39349
+ if (lock.count > 0) return;
39350
+ el.style.overflow = lock.previousOverflow;
39351
+ scrollLocks.delete(el);
39352
+ });
39353
+ }
39177
39354
  var script = {
39178
39355
  name: 'Drawer',
39179
39356
  props: {
@@ -39202,21 +39379,33 @@ var script = {
39202
39379
  }
39203
39380
  },
39204
39381
  watch: {
39205
- open: {
39206
- immediate: true,
39207
- handler(isOpen) {
39208
- document.body.style.overflow = isOpen ? 'hidden' : '';
39209
- }
39382
+ open(isOpen) {
39383
+ this.setScrollLock(isOpen);
39210
39384
  }
39211
39385
  },
39386
+ created() {
39387
+ this.locked = false;
39388
+ this.scrollTargets = [];
39389
+ },
39212
39390
  mounted() {
39391
+ // Se resuelven acá y no en cada apertura: en mounted el drawer todavía está
39392
+ // en su lugar del DOM y los ancestros son los que corresponden.
39393
+ this.scrollTargets = scrollableAncestors(this.$el.parentElement);
39213
39394
  document.addEventListener('keydown', this.handleKeydown);
39395
+ if (this.open) this.setScrollLock(true);
39214
39396
  },
39215
39397
  beforeDestroy() {
39216
39398
  document.removeEventListener('keydown', this.handleKeydown);
39217
- document.body.style.overflow = '';
39399
+ this.setScrollLock(false);
39218
39400
  },
39219
39401
  methods: {
39402
+ // Idempotente: solo actúa cuando cambia el estado, para no descuadrar el
39403
+ // contador del registro compartido.
39404
+ setScrollLock(shouldLock) {
39405
+ if (shouldLock === this.locked) return;
39406
+ this.locked = shouldLock;
39407
+ if (shouldLock) lockScroll(this.scrollTargets);else unlockScroll(this.scrollTargets);
39408
+ },
39220
39409
  handleKeydown(e) {
39221
39410
  if (e.key === 'Escape' && this.open) {
39222
39411
  this.$emit('close');
package/dist/index.js CHANGED
@@ -32961,7 +32961,24 @@ const tooltipVariants = cva('rq-tooltip', {
32961
32961
  //
32962
32962
  //
32963
32963
  //
32964
+ //
32965
+ //
32966
+ //
32967
+ //
32968
+ //
32969
+ //
32970
+ //
32971
+ //
32972
+ //
32973
+ //
32974
+ //
32975
+ //
32976
+ //
32964
32977
 
32978
+
32979
+ // Separación entre el trigger y la burbuja, en px. Igual al gap que antes
32980
+ // definía el CSS con calc(100% + 8px).
32981
+ const GAP = 8;
32965
32982
  var script$f = {
32966
32983
  name: 'Tooltip',
32967
32984
  props: {
@@ -32980,12 +32997,93 @@ var script$f = {
32980
32997
  default: ''
32981
32998
  }
32982
32999
  },
33000
+ data() {
33001
+ return {
33002
+ visible: false,
33003
+ coords: null
33004
+ };
33005
+ },
32983
33006
  computed: {
32984
33007
  classes() {
32985
33008
  return tooltipVariants({
32986
33009
  side: this.side,
32987
33010
  textAlign: this.textAlign
32988
33011
  });
33012
+ },
33013
+ // position: fixed lo ancla al viewport, así ningún ancestro con overflow
33014
+ // (celda de tabla, panel con scroll, drawer) puede recortarlo. Además deja
33015
+ // de aportar al área scrolleable del contenedor, que con `absolute`
33016
+ // producía scrollbars horizontales aunque el tooltip estuviera oculto.
33017
+ style() {
33018
+ const base = {
33019
+ position: 'fixed'
33020
+ };
33021
+ if (!this.coords) return {
33022
+ ...base,
33023
+ top: '-9999px',
33024
+ left: '-9999px'
33025
+ };
33026
+ return {
33027
+ ...base,
33028
+ top: `${this.coords.top}px`,
33029
+ left: `${this.coords.left}px`
33030
+ };
33031
+ }
33032
+ },
33033
+ beforeDestroy() {
33034
+ this.unbindReposition();
33035
+ },
33036
+ methods: {
33037
+ show() {
33038
+ this.updatePosition();
33039
+ this.visible = true;
33040
+ this.bindReposition();
33041
+ },
33042
+ hide() {
33043
+ this.visible = false;
33044
+ this.unbindReposition();
33045
+ },
33046
+ // Al estar fijo al viewport, el tooltip no sigue al trigger cuando la
33047
+ // página o un contenedor interno scrollea: se recalcula mientras se ve.
33048
+ bindReposition() {
33049
+ if (this._reposition) return;
33050
+ this._reposition = () => this.updatePosition();
33051
+ window.addEventListener('scroll', this._reposition, true);
33052
+ window.addEventListener('resize', this._reposition);
33053
+ },
33054
+ unbindReposition() {
33055
+ if (!this._reposition) return;
33056
+ window.removeEventListener('scroll', this._reposition, true);
33057
+ window.removeEventListener('resize', this._reposition);
33058
+ this._reposition = null;
33059
+ },
33060
+ updatePosition() {
33061
+ const trigger = this.$el;
33062
+ const tooltip = this.$refs.tooltip;
33063
+ if (!trigger || !tooltip) return;
33064
+ const t = trigger.getBoundingClientRect();
33065
+ const b = tooltip.getBoundingClientRect();
33066
+ const centerX = t.left + t.width / 2;
33067
+ const centerY = t.top + t.height / 2;
33068
+ const porLado = {
33069
+ top: {
33070
+ top: t.top - b.height - GAP,
33071
+ left: centerX
33072
+ },
33073
+ bottom: {
33074
+ top: t.bottom + GAP,
33075
+ left: centerX
33076
+ },
33077
+ left: {
33078
+ top: centerY,
33079
+ left: t.left - b.width - GAP
33080
+ },
33081
+ right: {
33082
+ top: centerY,
33083
+ left: t.right + GAP
33084
+ }
33085
+ };
33086
+ this.coords = porLado[this.side] || porLado.top;
32989
33087
  }
32990
33088
  }
32991
33089
  };
@@ -32999,10 +33097,20 @@ var __vue_render__$f = function () {
32999
33097
  var _h = _vm.$createElement;
33000
33098
  var _c = _vm._self._c || _h;
33001
33099
  return _c("div", _vm._g({
33002
- staticClass: "rq-tooltip-wrapper"
33100
+ staticClass: "rq-tooltip-wrapper",
33101
+ on: {
33102
+ mouseenter: _vm.show,
33103
+ mouseleave: _vm.hide,
33104
+ focusin: _vm.show,
33105
+ focusout: _vm.hide
33106
+ }
33003
33107
  }, _vm.$listeners), [_vm._t("default"), _vm._v(" "), _c("div", {
33004
- class: _vm.classes
33005
- }, [_vm._v(_vm._s(_vm.text))])], 2);
33108
+ ref: "tooltip",
33109
+ class: [_vm.classes, {
33110
+ "rq-tooltip--visible": _vm.visible
33111
+ }],
33112
+ style: _vm.style
33113
+ }, [_vm._v("\n " + _vm._s(_vm.text) + "\n ")])], 2);
33006
33114
  };
33007
33115
  var __vue_staticRenderFns__$f = [];
33008
33116
  __vue_render__$f._withStripped = true;
@@ -37792,6 +37900,15 @@ function useTable(props, emit) {
37792
37900
  //
37793
37901
  //
37794
37902
  //
37903
+ //
37904
+ //
37905
+ //
37906
+ //
37907
+ //
37908
+ //
37909
+ //
37910
+ //
37911
+ //
37795
37912
 
37796
37913
  var script$4 = {
37797
37914
  name: 'Table',
@@ -37871,6 +37988,7 @@ var script$4 = {
37871
37988
  y: 0
37872
37989
  },
37873
37990
  truncatedCells: {},
37991
+ cellTexts: {},
37874
37992
  expandedRowId: null
37875
37993
  };
37876
37994
  },
@@ -38031,10 +38149,18 @@ var script$4 = {
38031
38149
  if (!this.$el) return;
38032
38150
  const els = this.$el.querySelectorAll('.rq-table__cell-text[data-cell-key]');
38033
38151
  const result = {};
38152
+ const texts = {};
38034
38153
  els.forEach(el => {
38035
38154
  result[el.dataset.cellKey] = el.scrollWidth > el.clientWidth;
38155
+ // Se guarda el texto ya renderizado: si la celda pasa por un slot que
38156
+ // formatea el valor, el tooltip debe mostrar lo que el usuario ve.
38157
+ texts[el.dataset.cellKey] = el.textContent.trim();
38036
38158
  });
38037
38159
  this.truncatedCells = result;
38160
+ this.cellTexts = texts;
38161
+ },
38162
+ cellTooltipText(rowId, headerId) {
38163
+ return this.cellTexts[this.cellKey(rowId, headerId)] || '';
38038
38164
  }
38039
38165
  },
38040
38166
  watch: {
@@ -38263,27 +38389,32 @@ var __vue_render__$4 = function () {
38263
38389
  "rq-table__td--pinned": header.id in _vm.pinnedLeftWidths
38264
38390
  },
38265
38391
  style: _vm.getColStyle(header)
38392
+ }, [_vm.isTruncated(row.id, header.id) ? _c("Tooltip", {
38393
+ staticClass: "rq-table__cell-tooltip",
38394
+ attrs: {
38395
+ text: _vm.cellTooltipText(row.id, header.id)
38396
+ }
38397
+ }, [_c("span", {
38398
+ staticClass: "rq-table__cell-text",
38399
+ attrs: {
38400
+ "data-cell-key": _vm.cellKey(row.id, header.id)
38401
+ }
38266
38402
  }, [_vm._t("cell-" + header.id, function () {
38267
- return [_vm.isTruncated(row.id, header.id) ? _c("Tooltip", {
38268
- staticClass: "rq-table__cell-tooltip",
38269
- attrs: {
38270
- text: String(row.getValue(header.id))
38271
- }
38272
- }, [_c("span", {
38273
- staticClass: "rq-table__cell-text",
38274
- attrs: {
38275
- "data-cell-key": _vm.cellKey(row.id, header.id)
38276
- }
38277
- }, [_vm._v(_vm._s(row.getValue(header.id)))])]) : _c("span", {
38278
- staticClass: "rq-table__cell-text",
38279
- attrs: {
38280
- "data-cell-key": _vm.cellKey(row.id, header.id)
38281
- }
38282
- }, [_vm._v(_vm._s(row.getValue(header.id)))])];
38403
+ return [_vm._v(_vm._s(row.getValue(header.id)))];
38404
+ }, {
38405
+ row: row.original,
38406
+ value: row.getValue(header.id)
38407
+ })], 2)]) : _c("span", {
38408
+ staticClass: "rq-table__cell-text",
38409
+ attrs: {
38410
+ "data-cell-key": _vm.cellKey(row.id, header.id)
38411
+ }
38412
+ }, [_vm._t("cell-" + header.id, function () {
38413
+ return [_vm._v(_vm._s(row.getValue(header.id)))];
38283
38414
  }, {
38284
38415
  row: row.original,
38285
38416
  value: row.getValue(header.id)
38286
- })], 2);
38417
+ })], 2)], 1);
38287
38418
  })], 2), _vm._v(" "), _vm.expandable && _vm.expandedRowId === row.id ? _c("tr", {
38288
38419
  key: row.id + "-expanded",
38289
38420
  staticClass: "rq-table__tr rq-table__tr--expanded"
@@ -39176,6 +39307,52 @@ const __vue_component__$1 = /*#__PURE__*/normalizeComponent({
39176
39307
  //
39177
39308
  //
39178
39309
 
39310
+
39311
+ // Registro de bloqueos compartido entre todas las instancias: guarda cuántos
39312
+ // drawers abiertos dependen de cada contenedor y cuál era su overflow original.
39313
+ // Sin el contador, cerrar un drawer devolvería el scroll aunque siguiera otro
39314
+ // abierto sobre el mismo contenedor.
39315
+ const scrollLocks = new Map();
39316
+
39317
+ // El scroll de fondo no siempre vive en el body: muchas apps scrollean en un
39318
+ // contenedor interno. Se bloquean todos los ancestros scrolleables más el body.
39319
+ function scrollableAncestors(node) {
39320
+ const targets = [];
39321
+ let el = node;
39322
+ while (el && el !== document.body && el.nodeType === 1) {
39323
+ const {
39324
+ overflowY
39325
+ } = window.getComputedStyle(el);
39326
+ if (overflowY === 'auto' || overflowY === 'scroll') targets.push(el);
39327
+ el = el.parentElement;
39328
+ }
39329
+ targets.push(document.body);
39330
+ return targets;
39331
+ }
39332
+ function lockScroll(targets) {
39333
+ targets.forEach(el => {
39334
+ const lock = scrollLocks.get(el);
39335
+ if (lock) {
39336
+ lock.count += 1;
39337
+ return;
39338
+ }
39339
+ scrollLocks.set(el, {
39340
+ count: 1,
39341
+ previousOverflow: el.style.overflow
39342
+ });
39343
+ el.style.overflow = 'hidden';
39344
+ });
39345
+ }
39346
+ function unlockScroll(targets) {
39347
+ targets.forEach(el => {
39348
+ const lock = scrollLocks.get(el);
39349
+ if (!lock) return;
39350
+ lock.count -= 1;
39351
+ if (lock.count > 0) return;
39352
+ el.style.overflow = lock.previousOverflow;
39353
+ scrollLocks.delete(el);
39354
+ });
39355
+ }
39179
39356
  var script = {
39180
39357
  name: 'Drawer',
39181
39358
  props: {
@@ -39204,21 +39381,33 @@ var script = {
39204
39381
  }
39205
39382
  },
39206
39383
  watch: {
39207
- open: {
39208
- immediate: true,
39209
- handler(isOpen) {
39210
- document.body.style.overflow = isOpen ? 'hidden' : '';
39211
- }
39384
+ open(isOpen) {
39385
+ this.setScrollLock(isOpen);
39212
39386
  }
39213
39387
  },
39388
+ created() {
39389
+ this.locked = false;
39390
+ this.scrollTargets = [];
39391
+ },
39214
39392
  mounted() {
39393
+ // Se resuelven acá y no en cada apertura: en mounted el drawer todavía está
39394
+ // en su lugar del DOM y los ancestros son los que corresponden.
39395
+ this.scrollTargets = scrollableAncestors(this.$el.parentElement);
39215
39396
  document.addEventListener('keydown', this.handleKeydown);
39397
+ if (this.open) this.setScrollLock(true);
39216
39398
  },
39217
39399
  beforeDestroy() {
39218
39400
  document.removeEventListener('keydown', this.handleKeydown);
39219
- document.body.style.overflow = '';
39401
+ this.setScrollLock(false);
39220
39402
  },
39221
39403
  methods: {
39404
+ // Idempotente: solo actúa cuando cambia el estado, para no descuadrar el
39405
+ // contador del registro compartido.
39406
+ setScrollLock(shouldLock) {
39407
+ if (shouldLock === this.locked) return;
39408
+ this.locked = shouldLock;
39409
+ if (shouldLock) lockScroll(this.scrollTargets);else unlockScroll(this.scrollTargets);
39410
+ },
39222
39411
  handleKeydown(e) {
39223
39412
  if (e.key === 'Escape' && this.open) {
39224
39413
  this.$emit('close');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regcheq/ui-vue-2",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "files": [