From a2b707eb6ef48372f78d4c1f58927ceada0feb2c Mon Sep 17 00:00:00 2001 From: Afiq Date: Wed, 6 Aug 2025 13:38:11 +0800 Subject: [PATCH] Enhance RepeatingTable Component with Performance Optimizations - Added a performance warning for tables with more than 20 columns, advising users to reduce column count for better performance. - Implemented lazy loading for cell values to improve rendering efficiency in large datasets. - Introduced column virtualization to limit visible columns to the first 20 for performance enhancement. - Updated pagination controls and improved the overall structure of the table for better user experience. - Enhanced styling for performance warnings and loading states, ensuring a more responsive interface. --- components/RepeatingTable.vue | 463 ++++++++++++++++++++++++---------- 1 file changed, 330 insertions(+), 133 deletions(-) diff --git a/components/RepeatingTable.vue b/components/RepeatingTable.vue index 34aca28..bd34e27 100644 --- a/components/RepeatingTable.vue +++ b/components/RepeatingTable.vue @@ -55,16 +55,31 @@
+ +
+
+ +
+

Performance Notice

+

+ This table has {{ config.columns.length }} columns. For optimal performance, only the first 20 columns are displayed. + Consider reducing the number of columns for better user experience. +

+
+
+
+
-
+
@@ -85,12 +100,17 @@
{{ getRowNumber(index) }}
#
{{ column.label }} @@ -77,7 +92,7 @@
- {{ formatCellValue(record[column.name], column) }} +
@@ -124,20 +144,16 @@
-
- -
-
-

No records yet

-

- {{ searchQuery ? 'No records match your search criteria.' : 'Click "' + (config.buttonText || 'Add Record') + '" to add your first record.' }} -

-
+ +

No records yet

+

+ {{ config.help || 'Add your first record to get started.' }} +

{{ config.buttonText || 'Add Record' }} @@ -147,92 +163,56 @@
-
+
- - Showing {{ startRecord }} to {{ endRecord }} of {{ filteredData.length }} records - + Showing {{ startRecord }} to {{ endRecord }} of {{ filteredData.length }} records
-
-
- - - per page + + + Previous + + +
+ + {{ page }} +
- + + Next + +
-