vueless 0.0.434 → 0.0.436
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/package.json +1 -1
- package/ui.data-table/UTable.vue +11 -0
- package/ui.data-table/UTableRow.vue +12 -2
- package/web-types.json +16 -1
package/package.json
CHANGED
package/ui.data-table/UTable.vue
CHANGED
|
@@ -184,6 +184,7 @@
|
|
|
184
184
|
v-bind="getRowAttrs(row.id)"
|
|
185
185
|
:class="cx([getRowAttrs(row.id).class, getRowClasses(row)])"
|
|
186
186
|
@click="onClickRow"
|
|
187
|
+
@click-cell="onClickCell"
|
|
187
188
|
@toggle-row-visibility="onToggleRowVisibility"
|
|
188
189
|
>
|
|
189
190
|
<template
|
|
@@ -396,6 +397,12 @@ const emit = defineEmits([
|
|
|
396
397
|
*/
|
|
397
398
|
"clickRow",
|
|
398
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Triggers when the cell is clicked.
|
|
402
|
+
* @property {object} cell
|
|
403
|
+
*/
|
|
404
|
+
"clickCell",
|
|
405
|
+
|
|
399
406
|
/**
|
|
400
407
|
* Triggers when table rows are selected (updated).
|
|
401
408
|
* @property {array} tableRows
|
|
@@ -687,6 +694,10 @@ function onClickRow(row) {
|
|
|
687
694
|
emit("clickRow", row);
|
|
688
695
|
}
|
|
689
696
|
|
|
697
|
+
function onClickCell(cell, row) {
|
|
698
|
+
emit("clickCell", cell, row);
|
|
699
|
+
}
|
|
700
|
+
|
|
690
701
|
function onChangeSelectAll(selectAll) {
|
|
691
702
|
if (selectAll && canSelectAll.value) {
|
|
692
703
|
selectedRows.value = getFlatRows(tableRows.value).map((row) => row.id);
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
:key="index"
|
|
21
21
|
v-bind="bodyCellBaseAttrs"
|
|
22
22
|
:class="cx([columns[index].tdClass, getCellClasses(row, key)])"
|
|
23
|
+
@click="onClickCell(value, row)"
|
|
23
24
|
>
|
|
24
25
|
<div
|
|
25
26
|
v-if="(row.row || nestedLevel || row.nestedData) && index === 0"
|
|
@@ -114,6 +115,7 @@
|
|
|
114
115
|
:selectable="selectable"
|
|
115
116
|
@toggle-row-visibility="onClickToggleRowChild"
|
|
116
117
|
@click="onClick"
|
|
118
|
+
@click-cell="onClickCell"
|
|
117
119
|
>
|
|
118
120
|
<template
|
|
119
121
|
v-for="(value, key, index) in getFilteredRow(nestedRow, columns)"
|
|
@@ -189,7 +191,7 @@ const props = defineProps({
|
|
|
189
191
|
},
|
|
190
192
|
});
|
|
191
193
|
|
|
192
|
-
const emit = defineEmits(["toggleRowVisibility", "click"]);
|
|
194
|
+
const emit = defineEmits(["toggleRowVisibility", "click", "click-cell"]);
|
|
193
195
|
|
|
194
196
|
const selectedRows = defineModel("selectedRows", { type: Array, default: () => [] });
|
|
195
197
|
|
|
@@ -216,7 +218,11 @@ const shift = computed(() => (props.row.row ? 1.5 : 2));
|
|
|
216
218
|
const isSingleNestedRow = computed(() => !Array.isArray(props.row.row));
|
|
217
219
|
|
|
218
220
|
const getToggleIconName = computed(() => (row) => {
|
|
219
|
-
const
|
|
221
|
+
const isHiddenNestedRow = Array.isArray(row.row)
|
|
222
|
+
? row.row.some((nestedRow) => nestedRow.isHidden)
|
|
223
|
+
: row.row?.isHidden;
|
|
224
|
+
|
|
225
|
+
const isHidden = isHiddenNestedRow || row.nestedData?.isHidden;
|
|
220
226
|
|
|
221
227
|
return isHidden ? props.config.defaults.expandIcon : props.config.defaults.collapseIcon;
|
|
222
228
|
});
|
|
@@ -294,4 +300,8 @@ function onClickToggleIcon() {
|
|
|
294
300
|
|
|
295
301
|
props.row.row.forEach(({ id }) => onClickToggleRowChild(id));
|
|
296
302
|
}
|
|
303
|
+
|
|
304
|
+
function onClickCell(cell, row) {
|
|
305
|
+
emit("click-cell", cell, row);
|
|
306
|
+
}
|
|
297
307
|
</script>
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.436",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -8401,6 +8401,18 @@
|
|
|
8401
8401
|
}
|
|
8402
8402
|
]
|
|
8403
8403
|
},
|
|
8404
|
+
{
|
|
8405
|
+
"name": "clickCell",
|
|
8406
|
+
"description": "Triggers when the cell is clicked.",
|
|
8407
|
+
"properties": [
|
|
8408
|
+
{
|
|
8409
|
+
"type": [
|
|
8410
|
+
"object"
|
|
8411
|
+
],
|
|
8412
|
+
"name": "cell"
|
|
8413
|
+
}
|
|
8414
|
+
]
|
|
8415
|
+
},
|
|
8404
8416
|
{
|
|
8405
8417
|
"name": "update:rows",
|
|
8406
8418
|
"description": "Triggers when table rows are selected (updated).",
|
|
@@ -8615,6 +8627,9 @@
|
|
|
8615
8627
|
},
|
|
8616
8628
|
{
|
|
8617
8629
|
"name": "click"
|
|
8630
|
+
},
|
|
8631
|
+
{
|
|
8632
|
+
"name": "click-cell"
|
|
8618
8633
|
}
|
|
8619
8634
|
],
|
|
8620
8635
|
"slots": [
|