From 1d1bf5162924b4743ec99842fdd8de9ef5f6ec13 Mon Sep 17 00:00:00 2001 From: hechang27-sprt Date: Mon, 13 Apr 2026 11:43:13 +0800 Subject: [PATCH] feat: list-table-v2 PR2 --- .../hechang27-sprt/04-10-code-review.md | 3 +- examples/view/base/table-v2.vue | 94 +++++++---- packages/base/data/list-table-v2/index.ts | 6 + .../base/data/list-table-v2/list-table-v2.vue | 147 ++++++++++++++---- packages/base/data/list-table-v2/no-data.vue | 116 ++++++++++++++ .../list-table-v2/usePretextColumnWidths.ts | 6 +- packages/base/index.ts | 14 +- 7 files changed, 322 insertions(+), 64 deletions(-) create mode 100644 packages/base/data/list-table-v2/no-data.vue diff --git a/.trellis/workspace/hechang27-sprt/04-10-code-review.md b/.trellis/workspace/hechang27-sprt/04-10-code-review.md index 911c0a3..8847bba 100644 --- a/.trellis/workspace/hechang27-sprt/04-10-code-review.md +++ b/.trellis/workspace/hechang27-sprt/04-10-code-review.md @@ -91,5 +91,4 @@ # Response -› 4 is intentional, 1/2/3 should be fixed. However, there is an additional problem: when using custom slots like the table - 11 in the demo page, the inner elements consistently overflows the table cell even with overflow: hidden... +› 4 is intentional, 1/2/3 should be fixed. However, there is an additional problem: when using custom slots like the table 11 in the demo page, the inner elements consistently overflows the table cell even with overflow: hidden... diff --git a/examples/view/base/table-v2.vue b/examples/view/base/table-v2.vue index a246801..eb2c504 100644 --- a/examples/view/base/table-v2.vue +++ b/examples/view/base/table-v2.vue @@ -8,10 +8,25 @@
-

1. {{ sections[0].label }}

+

0. {{ sections[0].label }}

+

Empty Table (Default min-height: 300px)

+ + + +

Empty Table (flex)

+
+ +
+
+ + +
+

1. {{ sections[1].label }}

Basic data binding with columns, pagination, and event handling.

@@ -61,8 +76,8 @@ const basicColumns = [ -
-

2. {{ sections[1].label }}

+
+

2. {{ sections[2].label }}

Table borders and column content alignment via border and align props.

@@ -100,8 +115,8 @@ const styleColumns = [ -
-

3. {{ sections[2].label }}

+
+

3. {{ sections[3].label }}

Fix columns to left or right using fixed: "left" or fixed: "right".

@@ -141,8 +156,8 @@ const styleColumns = [ -
-

4. {{ sections[3].label }}

+
+

4. {{ sections[4].label }}

Built-in formatting for timestamps, dictionaries, and file sizes.

-
-

5. {{ sections[4].label }}

+
+

5. {{ sections[5].label }}

Custom cell content via cellRenderer function. Returns JSX. Critical: must work correctly with the mini-table probe row for dynamic height measurement. @@ -222,8 +237,8 @@ const rendererColumns = [ -

-

6. {{ sections[5].label }}

+
+

6. {{ sections[6].label }}

Custom header content via headerCellRenderer function. Must also sync with mini-table header probe.

@@ -271,8 +286,8 @@ const headerColumns = [ -
-

7. {{ sections[6].label }}

+
+

7. {{ sections[7].label }}

Dynamic height mode uses a hidden mini-table to probe actual row and header heights. debug shows estimated values. No rowHeight or estimatedRowHeight needed — @@ -313,8 +328,8 @@ const headerColumns = [ -

-

8. {{ sections[7].label }}

+
+

8. {{ sections[8].label }}

Fixed height mode via :row-height="60". Disables the mini-table probe. Better performance for large datasets since no measurement needed. @@ -352,8 +367,8 @@ const headerColumns = [ -

-

9. {{ sections[8].label }}

+
+

9. {{ sections[9].label }}

Control column widths with width (fixed) and minWidth (flexible). Columns without explicit width use auto-derived flex factors greater than 1 to fill remaining space. @@ -383,8 +398,8 @@ const headerColumns = [ -

-

10. {{ sections[9].label }}

+
+

10. {{ sections[10].label }}

Control table dimensions with height, maxHeight, and headerHeight. Auto-resizer handles width automatically. @@ -422,8 +437,8 @@ const headerColumns = [ -

-

11. {{ sections[10].label }}

+
+

11. {{ sections[11].label }}

Custom cell content via Vue template slots. Use slot: true on column and define #columnKey template in parent. @@ -450,7 +465,7 @@ const headerColumns = [