vueless 0.0.546 → 0.0.547
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 +10 -3
- package/web-types.json +17 -2
package/package.json
CHANGED
package/ui.data-table/UTable.vue
CHANGED
|
@@ -61,6 +61,12 @@ const emit = defineEmits([
|
|
|
61
61
|
*/
|
|
62
62
|
"clickRow",
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Triggers when the row is double-clicked.
|
|
66
|
+
* @property {object} row
|
|
67
|
+
*/
|
|
68
|
+
"doubleClickRow",
|
|
69
|
+
|
|
64
70
|
/**
|
|
65
71
|
* Triggers when the cell is clicked.
|
|
66
72
|
* @property {object} cell
|
|
@@ -394,6 +400,10 @@ function onClickRow(row: Row) {
|
|
|
394
400
|
emit("clickRow", row);
|
|
395
401
|
}
|
|
396
402
|
|
|
403
|
+
function onDoubleClickRow(row: Row) {
|
|
404
|
+
emit("doubleClickRow", row);
|
|
405
|
+
}
|
|
406
|
+
|
|
397
407
|
function onClickCell(cell: Cell, row: Row) {
|
|
398
408
|
emit("clickCell", cell, row);
|
|
399
409
|
}
|
|
@@ -665,6 +675,7 @@ defineExpose({
|
|
|
665
675
|
:empty-cell-label="emptyCellLabel"
|
|
666
676
|
:data-test="`${dataTest}-row`"
|
|
667
677
|
@click="onClickRow"
|
|
678
|
+
@dblclick="onDoubleClickRow"
|
|
668
679
|
@click-cell="onClickCell"
|
|
669
680
|
@toggle-row-visibility="onToggleRowVisibility"
|
|
670
681
|
>
|
|
@@ -22,7 +22,7 @@ const LAST_NESTED_ROW_SHIFT_REM = 2;
|
|
|
22
22
|
|
|
23
23
|
const props = defineProps<UTableRowProps>();
|
|
24
24
|
|
|
25
|
-
const emit = defineEmits(["toggleRowVisibility", "click", "
|
|
25
|
+
const emit = defineEmits(["toggleRowVisibility", "click", "dblclick", "clickCell"]);
|
|
26
26
|
|
|
27
27
|
const selectedRows = defineModel("selectedRows", { type: Array, default: () => [] });
|
|
28
28
|
|
|
@@ -103,7 +103,7 @@ function getIconWidth() {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
function getCellClasses(row: Row, key: string) {
|
|
106
|
-
const isCellData = typeof row[key] === "object" && "class" in row[key];
|
|
106
|
+
const isCellData = typeof row[key] === "object" && row[key] !== null && "class" in row[key];
|
|
107
107
|
const cell = row[key] as CellObject;
|
|
108
108
|
const cellClasses = isCellData ? cell?.class : undefined;
|
|
109
109
|
|
|
@@ -155,6 +155,10 @@ function onClick(row: Row) {
|
|
|
155
155
|
emit("click", row);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
function onDoubleClick(row: Row) {
|
|
159
|
+
emit("dblclick", row);
|
|
160
|
+
}
|
|
161
|
+
|
|
158
162
|
function setCellTitle(mutations: MutationRecord[]) {
|
|
159
163
|
mutations.forEach((mutation) => {
|
|
160
164
|
const { target } = mutation;
|
|
@@ -196,7 +200,7 @@ function onClickToggleIcon() {
|
|
|
196
200
|
}
|
|
197
201
|
|
|
198
202
|
function onClickCell(cell: unknown | string | number, row: Row) {
|
|
199
|
-
emit("
|
|
203
|
+
emit("clickCell", cell, row);
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
function getRowClasses(row: Row) {
|
|
@@ -217,6 +221,7 @@ function getRowAttrs(rowId: string | number) {
|
|
|
217
221
|
v-bind="{ ...$attrs, ...getRowAttrs(row.id) }"
|
|
218
222
|
:class="cx([getRowAttrs(row.id).class, getRowClasses(row)])"
|
|
219
223
|
@click="onClick(props.row)"
|
|
224
|
+
@dblclick="onDoubleClick(props.row)"
|
|
220
225
|
>
|
|
221
226
|
<td
|
|
222
227
|
v-if="selectable"
|
|
@@ -326,6 +331,7 @@ function getRowAttrs(rowId: string | number) {
|
|
|
326
331
|
:empty-cell-label="emptyCellLabel"
|
|
327
332
|
@toggle-row-visibility="onClickToggleRowChild"
|
|
328
333
|
@click="onClick"
|
|
334
|
+
@dblclick="onDoubleClick"
|
|
329
335
|
>
|
|
330
336
|
<template
|
|
331
337
|
v-for="(value, key, index) in mapRowColumns(singleNestedRow, columns)"
|
|
@@ -356,6 +362,7 @@ function getRowAttrs(rowId: string | number) {
|
|
|
356
362
|
:empty-cell-label="emptyCellLabel"
|
|
357
363
|
@toggle-row-visibility="onClickToggleRowChild"
|
|
358
364
|
@click="onClick"
|
|
365
|
+
@dblclick="onDoubleClick"
|
|
359
366
|
@click-cell="onClickCell"
|
|
360
367
|
>
|
|
361
368
|
<template
|
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.547",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -10478,6 +10478,18 @@
|
|
|
10478
10478
|
}
|
|
10479
10479
|
]
|
|
10480
10480
|
},
|
|
10481
|
+
{
|
|
10482
|
+
"name": "doubleClickRow",
|
|
10483
|
+
"description": "Triggers when the row is double-clicked.",
|
|
10484
|
+
"properties": [
|
|
10485
|
+
{
|
|
10486
|
+
"type": [
|
|
10487
|
+
"object"
|
|
10488
|
+
],
|
|
10489
|
+
"name": "row"
|
|
10490
|
+
}
|
|
10491
|
+
]
|
|
10492
|
+
},
|
|
10481
10493
|
{
|
|
10482
10494
|
"name": "clickCell",
|
|
10483
10495
|
"description": "Triggers when the cell is clicked.",
|
|
@@ -10717,7 +10729,10 @@
|
|
|
10717
10729
|
"name": "click"
|
|
10718
10730
|
},
|
|
10719
10731
|
{
|
|
10720
|
-
"name": "
|
|
10732
|
+
"name": "dblclick"
|
|
10733
|
+
},
|
|
10734
|
+
{
|
|
10735
|
+
"name": "clickCell"
|
|
10721
10736
|
}
|
|
10722
10737
|
],
|
|
10723
10738
|
"slots": [
|