changeset 5:f282c6ef1671

better support for server side tables
author luka
date Tue, 19 Aug 2025 22:15:16 -0400
parents 84c75d9d90be
children 6ded573b0a61
files publishable/resources/js/ServerTable.js publishable/resources/views/includes/ServerTable.blade.php publishable/resources/views/includes/easymde.blade.php publishable/vite.config.js
diffstat 4 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/publishable/resources/js/ServerTable.js	Tue Aug 19 20:33:35 2025 -0400
+++ b/publishable/resources/js/ServerTable.js	Tue Aug 19 22:15:16 2025 -0400
@@ -174,7 +174,7 @@
                         ) {
                             return `<td></td>`;
                         }
-                        return `<td>${
+                        return `<td class='${ typeof col.class === "string" ? col.class : '' }' >${
                             typeof col.render === "function"
                                 ? col.render(row, col, i)
                                 : row[col.name]
@@ -191,7 +191,7 @@
                         `<tr>${cols
                             .map(
                                 (col) =>
-                                    `<td>${
+                                    `<td class='${ typeof col.class === "string" ? col.class : '' }' >${
                                         typeof col.render === "function"
                                             ? col.render(row, col, i)
                                             : row[col.name]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/publishable/resources/views/includes/ServerTable.blade.php	Tue Aug 19 22:15:16 2025 -0400
@@ -0,0 +1,5 @@
+@pushOnce('styles')
+@endPushOnce
+@pushOnce('scripts')
+    @vite(['resources/js/ServerTable.js'])
+@endPushOnce
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/publishable/resources/views/includes/easymde.blade.php	Tue Aug 19 22:15:16 2025 -0400
@@ -0,0 +1,7 @@
+@pushOnce('styles')
+    <!-- EasyMDE and code block theme -->
+    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github-dark.min.css">
+@endPushOnce
+@pushOnce('scripts')
+    @vite(['resources/js/easymde.js'])
+@endPushOnce
--- a/publishable/vite.config.js	Tue Aug 19 20:33:35 2025 -0400
+++ b/publishable/vite.config.js	Tue Aug 19 22:15:16 2025 -0400
@@ -34,6 +34,7 @@
                 "resources/js/app.js",
                 "resources/js/easymde.js",
                 "resources/js/prismjs.js",
+                "resources/js/ServerTable.js",
                 "resources/sass/app.scss",
                 ...pageScripts,
             ],