@regcheq/ui-vue-2 1.15.2 → 1.16.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 +6 -0
- package/dist/index.esm.js +37 -2
- package/dist/index.js +37 -2
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -2212,6 +2212,12 @@ td[data-v-6ca52014],th[data-v-6ca52014]{padding:2px;background-color:#fff}td.tod
|
|
|
2212
2212
|
outline: 2px solid #5497ea;
|
|
2213
2213
|
outline-offset: -2px;
|
|
2214
2214
|
}
|
|
2215
|
+
.rq-table__td--expand-disabled {
|
|
2216
|
+
cursor: default;
|
|
2217
|
+
}
|
|
2218
|
+
.rq-table__td--expand-disabled .rq-table__expand-btn {
|
|
2219
|
+
color: #d4d4d8;
|
|
2220
|
+
}
|
|
2215
2221
|
.rq-table__td--expanded {
|
|
2216
2222
|
padding: 0;
|
|
2217
2223
|
cursor: default;
|
package/dist/index.esm.js
CHANGED
|
@@ -39054,6 +39054,8 @@ function useTable(props, emit) {
|
|
|
39054
39054
|
//
|
|
39055
39055
|
//
|
|
39056
39056
|
//
|
|
39057
|
+
//
|
|
39058
|
+
//
|
|
39057
39059
|
|
|
39058
39060
|
var script$4 = {
|
|
39059
39061
|
name: 'Table',
|
|
@@ -39105,6 +39107,15 @@ var script$4 = {
|
|
|
39105
39107
|
type: Boolean,
|
|
39106
39108
|
default: false
|
|
39107
39109
|
},
|
|
39110
|
+
// Predicado opcional por fila: recibe la fila original y decide si se
|
|
39111
|
+
// puede expandir. Sirve para las filas que no tienen contenido que
|
|
39112
|
+
// desplegar (p. ej. una ficha sin personas relacionadas). El guard vive
|
|
39113
|
+
// acá y no en el consumidor porque expandedRowId es estado interno de la
|
|
39114
|
+
// tabla: bloquear el evento afuera no evita que la fila se abra.
|
|
39115
|
+
rowExpandable: {
|
|
39116
|
+
type: Function,
|
|
39117
|
+
default: null
|
|
39118
|
+
},
|
|
39108
39119
|
// Alto fijo (no máximo) del contenido expandido; con scroll interno si el
|
|
39109
39120
|
// contenido no entra.
|
|
39110
39121
|
expandedRowHeight: {
|
|
@@ -39340,7 +39351,19 @@ var script$4 = {
|
|
|
39340
39351
|
y: 0
|
|
39341
39352
|
};
|
|
39342
39353
|
},
|
|
39354
|
+
canExpand(row) {
|
|
39355
|
+
if (!this.rowExpandable) return true;
|
|
39356
|
+
return !!this.rowExpandable(row.original);
|
|
39357
|
+
},
|
|
39358
|
+
canExpandById(rowId) {
|
|
39359
|
+
if (!this.rowExpandable) return true;
|
|
39360
|
+
const row = this.tableRows.find(r => r.id === rowId);
|
|
39361
|
+
return row ? this.canExpand(row) : true;
|
|
39362
|
+
},
|
|
39343
39363
|
toggleExpand(rowId) {
|
|
39364
|
+
// Colapsar siempre se permite: si la fila abierta dejara de ser
|
|
39365
|
+
// expandible (cambió la data), igual tiene que poder cerrarse.
|
|
39366
|
+
if (this.expandedRowId !== rowId && !this.canExpandById(rowId)) return;
|
|
39344
39367
|
this.expandedRowId = this.expandedRowId === rowId ? null : rowId;
|
|
39345
39368
|
this.$emit('update:expanded-row-id', this.expandedRowId);
|
|
39346
39369
|
if (this.expandedRowId) {
|
|
@@ -39580,6 +39603,9 @@ var __vue_render__$4 = function () {
|
|
|
39580
39603
|
}
|
|
39581
39604
|
}, [_vm.expandable ? _c("td", {
|
|
39582
39605
|
staticClass: "rq-table__td rq-table__td--expand",
|
|
39606
|
+
class: {
|
|
39607
|
+
"rq-table__td--expand-disabled": !_vm.canExpand(row)
|
|
39608
|
+
},
|
|
39583
39609
|
style: {
|
|
39584
39610
|
position: "sticky",
|
|
39585
39611
|
left: 0,
|
|
@@ -39589,8 +39615,9 @@ var __vue_render__$4 = function () {
|
|
|
39589
39615
|
},
|
|
39590
39616
|
attrs: {
|
|
39591
39617
|
role: "button",
|
|
39592
|
-
tabindex:
|
|
39593
|
-
"aria-expanded": _vm.expandedRowId === row.id
|
|
39618
|
+
tabindex: _vm.canExpand(row) ? 0 : -1,
|
|
39619
|
+
"aria-expanded": _vm.expandedRowId === row.id,
|
|
39620
|
+
"aria-disabled": !_vm.canExpand(row)
|
|
39594
39621
|
},
|
|
39595
39622
|
on: {
|
|
39596
39623
|
click: function ($event) {
|
|
@@ -39874,6 +39901,7 @@ const dataTableVariants = cva('rq-data-table', {
|
|
|
39874
39901
|
//
|
|
39875
39902
|
//
|
|
39876
39903
|
//
|
|
39904
|
+
//
|
|
39877
39905
|
|
|
39878
39906
|
var script$3 = {
|
|
39879
39907
|
name: 'DataTable',
|
|
@@ -39953,6 +39981,12 @@ var script$3 = {
|
|
|
39953
39981
|
type: Boolean,
|
|
39954
39982
|
default: false
|
|
39955
39983
|
},
|
|
39984
|
+
// Se reenvía a Table: predicado por fila para las que no tienen nada que
|
|
39985
|
+
// desplegar (ver Table.rowExpandable).
|
|
39986
|
+
rowExpandable: {
|
|
39987
|
+
type: Function,
|
|
39988
|
+
default: null
|
|
39989
|
+
},
|
|
39956
39990
|
expandedRowHeight: {
|
|
39957
39991
|
type: Number,
|
|
39958
39992
|
default: 265
|
|
@@ -40090,6 +40124,7 @@ var __vue_render__$3 = function () {
|
|
|
40090
40124
|
"row-id": _vm.rowId,
|
|
40091
40125
|
"max-height": _vm.maxHeight,
|
|
40092
40126
|
expandable: _vm.expandable,
|
|
40127
|
+
"row-expandable": _vm.rowExpandable,
|
|
40093
40128
|
"expanded-row-height": _vm.expandedRowHeight,
|
|
40094
40129
|
"expand-col-width": _vm.expandColWidth,
|
|
40095
40130
|
"empty-state": _vm.emptyState,
|
package/dist/index.js
CHANGED
|
@@ -39056,6 +39056,8 @@ function useTable(props, emit) {
|
|
|
39056
39056
|
//
|
|
39057
39057
|
//
|
|
39058
39058
|
//
|
|
39059
|
+
//
|
|
39060
|
+
//
|
|
39059
39061
|
|
|
39060
39062
|
var script$4 = {
|
|
39061
39063
|
name: 'Table',
|
|
@@ -39107,6 +39109,15 @@ var script$4 = {
|
|
|
39107
39109
|
type: Boolean,
|
|
39108
39110
|
default: false
|
|
39109
39111
|
},
|
|
39112
|
+
// Predicado opcional por fila: recibe la fila original y decide si se
|
|
39113
|
+
// puede expandir. Sirve para las filas que no tienen contenido que
|
|
39114
|
+
// desplegar (p. ej. una ficha sin personas relacionadas). El guard vive
|
|
39115
|
+
// acá y no en el consumidor porque expandedRowId es estado interno de la
|
|
39116
|
+
// tabla: bloquear el evento afuera no evita que la fila se abra.
|
|
39117
|
+
rowExpandable: {
|
|
39118
|
+
type: Function,
|
|
39119
|
+
default: null
|
|
39120
|
+
},
|
|
39110
39121
|
// Alto fijo (no máximo) del contenido expandido; con scroll interno si el
|
|
39111
39122
|
// contenido no entra.
|
|
39112
39123
|
expandedRowHeight: {
|
|
@@ -39342,7 +39353,19 @@ var script$4 = {
|
|
|
39342
39353
|
y: 0
|
|
39343
39354
|
};
|
|
39344
39355
|
},
|
|
39356
|
+
canExpand(row) {
|
|
39357
|
+
if (!this.rowExpandable) return true;
|
|
39358
|
+
return !!this.rowExpandable(row.original);
|
|
39359
|
+
},
|
|
39360
|
+
canExpandById(rowId) {
|
|
39361
|
+
if (!this.rowExpandable) return true;
|
|
39362
|
+
const row = this.tableRows.find(r => r.id === rowId);
|
|
39363
|
+
return row ? this.canExpand(row) : true;
|
|
39364
|
+
},
|
|
39345
39365
|
toggleExpand(rowId) {
|
|
39366
|
+
// Colapsar siempre se permite: si la fila abierta dejara de ser
|
|
39367
|
+
// expandible (cambió la data), igual tiene que poder cerrarse.
|
|
39368
|
+
if (this.expandedRowId !== rowId && !this.canExpandById(rowId)) return;
|
|
39346
39369
|
this.expandedRowId = this.expandedRowId === rowId ? null : rowId;
|
|
39347
39370
|
this.$emit('update:expanded-row-id', this.expandedRowId);
|
|
39348
39371
|
if (this.expandedRowId) {
|
|
@@ -39582,6 +39605,9 @@ var __vue_render__$4 = function () {
|
|
|
39582
39605
|
}
|
|
39583
39606
|
}, [_vm.expandable ? _c("td", {
|
|
39584
39607
|
staticClass: "rq-table__td rq-table__td--expand",
|
|
39608
|
+
class: {
|
|
39609
|
+
"rq-table__td--expand-disabled": !_vm.canExpand(row)
|
|
39610
|
+
},
|
|
39585
39611
|
style: {
|
|
39586
39612
|
position: "sticky",
|
|
39587
39613
|
left: 0,
|
|
@@ -39591,8 +39617,9 @@ var __vue_render__$4 = function () {
|
|
|
39591
39617
|
},
|
|
39592
39618
|
attrs: {
|
|
39593
39619
|
role: "button",
|
|
39594
|
-
tabindex:
|
|
39595
|
-
"aria-expanded": _vm.expandedRowId === row.id
|
|
39620
|
+
tabindex: _vm.canExpand(row) ? 0 : -1,
|
|
39621
|
+
"aria-expanded": _vm.expandedRowId === row.id,
|
|
39622
|
+
"aria-disabled": !_vm.canExpand(row)
|
|
39596
39623
|
},
|
|
39597
39624
|
on: {
|
|
39598
39625
|
click: function ($event) {
|
|
@@ -39876,6 +39903,7 @@ const dataTableVariants = cva('rq-data-table', {
|
|
|
39876
39903
|
//
|
|
39877
39904
|
//
|
|
39878
39905
|
//
|
|
39906
|
+
//
|
|
39879
39907
|
|
|
39880
39908
|
var script$3 = {
|
|
39881
39909
|
name: 'DataTable',
|
|
@@ -39955,6 +39983,12 @@ var script$3 = {
|
|
|
39955
39983
|
type: Boolean,
|
|
39956
39984
|
default: false
|
|
39957
39985
|
},
|
|
39986
|
+
// Se reenvía a Table: predicado por fila para las que no tienen nada que
|
|
39987
|
+
// desplegar (ver Table.rowExpandable).
|
|
39988
|
+
rowExpandable: {
|
|
39989
|
+
type: Function,
|
|
39990
|
+
default: null
|
|
39991
|
+
},
|
|
39958
39992
|
expandedRowHeight: {
|
|
39959
39993
|
type: Number,
|
|
39960
39994
|
default: 265
|
|
@@ -40092,6 +40126,7 @@ var __vue_render__$3 = function () {
|
|
|
40092
40126
|
"row-id": _vm.rowId,
|
|
40093
40127
|
"max-height": _vm.maxHeight,
|
|
40094
40128
|
expandable: _vm.expandable,
|
|
40129
|
+
"row-expandable": _vm.rowExpandable,
|
|
40095
40130
|
"expanded-row-height": _vm.expandedRowHeight,
|
|
40096
40131
|
"expand-col-width": _vm.expandColWidth,
|
|
40097
40132
|
"empty-state": _vm.emptyState,
|