From bbc7dfe29a31748483b74b067e3757390acc24ca Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 16 Sep 2025 16:17:03 +0000 Subject: [PATCH] feat(demo): add demo sections for wide properties and scrollable table with actions --- ts_web/elements/dees-table/dees-table.demo.ts | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/ts_web/elements/dees-table/dees-table.demo.ts b/ts_web/elements/dees-table/dees-table.demo.ts index 6510a2f..ae70cb9 100644 --- a/ts_web/elements/dees-table/dees-table.demo.ts +++ b/ts_web/elements/dees-table/dees-table.demo.ts @@ -579,6 +579,100 @@ export const demoFunc = () => html` dataName="people" > + +
+

Wide Properties + Many Actions

+

A table with many columns and rich actions to stress test layout and sticky Actions.

+ { console.log('view', item); } }, + { name: 'Edit', iconName: 'lucide:edit', type: ['inRow', 'contextmenu'], actionFunc: async ({ item }) => { console.log('edit', item); } }, + { name: 'Delete', iconName: 'lucide:trash', type: ['inRow', 'contextmenu'], actionFunc: async ({ item }) => { console.log('delete', item); } }, + { name: 'Message', iconName: 'lucide:message-square', type: ['inRow'], actionFunc: async ({ item }) => { console.log('message', item); } }, + { name: 'History', iconName: 'lucide:clock', type: ['inRow'], actionFunc: async ({ item }) => { console.log('history', item); } }, + { name: 'Add New', iconName: 'lucide:plus', type: ['header'], actionFunc: async ({ table }) => { console.log('add'); } }, + { name: 'Export CSV', iconName: 'lucide:download', type: ['header'], actionFunc: async ({ table }) => { console.log('export'); } }, + { name: 'Bulk Delete', iconName: 'lucide:trash-2', type: ['footer'], actionFunc: async ({ table }) => { console.log('bulk delete'); } }, + ] as ITableAction[]} + > +
+ +
+

Scrollable Small Height

+

Same as above, but with many items and a small fixed height to force vertical scrolling inside the table. Actions remain visible on the right; horizontal scroll appears if needed.

+ + ({ + id: i + 1, + name: `User ${i + 1}`, + role: ['Engineer','Designer','Manager','QA','Support'][i % 5], + department: ['R&D','Design','Ops','QA','CS'][i % 5], + email: `user${i+1}@corp.com`, + phone: `+1 202 555 ${String(1000 + i).slice(-4)}`, + location: ['Berlin','Paris','London','Madrid','Rome'][i % 5], + status: ['Active','Inactive','On Leave'][i % 3], + createdAt: `2023-${String((i%12)+1).padStart(2,'0')}-${String((i%28)+1).padStart(2,'0')}`, + updatedAt: `2024-${String(((i+3)%12)+1).padStart(2,'0')}-${String(((i+7)%28)+1).padStart(2,'0')}`, + lastLogin: `2024-${String(((i+6)%12)+1).padStart(2,'0')}-${String(((i+10)%28)+1).padStart(2,'0')}`, + projects: (i % 12), + tags: i % 2 ? 'typescript' : 'design', + notes: i % 3 ? '' : 'Note', + }))} + .dataActions=${[ + { name: 'View', iconName: 'lucide:eye', type: ['inRow'], actionFunc: async ({ item }) => {} }, + { name: 'Edit', iconName: 'lucide:edit', type: ['inRow'], actionFunc: async ({ item }) => {} }, + { name: 'Delete', iconName: 'lucide:trash', type: ['inRow'], actionFunc: async ({ item }) => {} }, + ] as ITableAction[]} + > +
`;