From b1c47681e05c7b4434190898205e5df35b785163 Mon Sep 17 00:00:00 2001
From: Tamara Steinwender <tamara.steinwender@tugraz.at>
Date: Wed, 23 Mar 2022 11:34:38 +0100
Subject: [PATCH] Update tabulator table

---
 packages/file-handling/src/clipboard.js       |  3 +++
 .../src/nextcloud-file-picker.js              |  5 +++++
 .../src/tabulator-table-styles.js             | 21 ++++++++++++++++---
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/packages/file-handling/src/clipboard.js b/packages/file-handling/src/clipboard.js
index 807351ef..dc02b6dc 100644
--- a/packages/file-handling/src/clipboard.js
+++ b/packages/file-handling/src/clipboard.js
@@ -6,6 +6,7 @@ import * as commonStyles from '@dbp-toolkit/common/styles';
 import * as fileHandlingStyles from '@dbp-toolkit/file-handling/src/styles';
 import {Icon} from '@dbp-toolkit/common';
 import {TabulatorFull as Tabulator} from 'tabulator-tables';
+import * as tabulatorStyles from './tabulator-table-styles';
 import {humanFileSize} from '@dbp-toolkit/common/i18next';
 import {name as pkgName} from '@dbp-toolkit/file-handling/package.json';
 import {send} from '@dbp-toolkit/common/notification';
@@ -842,6 +843,8 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) {
             ${commonStyles.getModalDialogCSS()}
             ${commonStyles.getRadioAndCheckboxCss()}
             ${fileHandlingStyles.getFileHandlingCss()}
+            ${tabulatorStyles.getTabulatorStyles()}
+
 
             a {
                 border-bottom: var(--dbp-border);
diff --git a/packages/file-handling/src/nextcloud-file-picker.js b/packages/file-handling/src/nextcloud-file-picker.js
index cb1ca181..024a4f4d 100644
--- a/packages/file-handling/src/nextcloud-file-picker.js
+++ b/packages/file-handling/src/nextcloud-file-picker.js
@@ -204,6 +204,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
                         field: 'type',
                         hozAlign: 'center',
                         width: 50,
+                        headerSort: false,
                         responsive: 1,
                         formatter: (cell, formatterParams, onRendered) => {
                             const icon_tag = that.getScopedTagName('dbp-icon');
@@ -303,6 +304,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
                         row.getElement().classList.add('no-select');
                         row.getElement().classList.remove('tabulator-selectable');
                     }
+
+                    if (!this.directoriesOnly && typeof data.mime === 'undefined') {
+                        row.getElement().classList.add('no-select-styles');
+                    }
                 },
             });
 
diff --git a/packages/file-handling/src/tabulator-table-styles.js b/packages/file-handling/src/tabulator-table-styles.js
index 62bb1ffd..7fbf523c 100644
--- a/packages/file-handling/src/tabulator-table-styles.js
+++ b/packages/file-handling/src/tabulator-table-styles.js
@@ -32,9 +32,10 @@ export function getTabulatorStyles() {
             padding-bottom: 20px;
         }
 
-        .tabulator-placeholder-contents {
-            text-align: center;
-            padding-top: 10px;
+        .tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {
+            color: var(--dbp-muted);
+            font-size: 1rem;
+            font-weight: initial;
         }
 
         .tabulator-placeholder {
@@ -51,10 +52,24 @@ export function getTabulatorStyles() {
         .tabulator-row.no-select:hover,
         .tabulator-row.tabulator-selectable.no-select:hover {
             cursor: unset;
+        }
+
+        .no-select-styles,
+        .no-select,
+        .tabulator-row.tabulator-selected.no-select:hover,
+        .tabulator-row.no-select:hover,
+        .tabulator-row.tabulator-selectable.no-select:hover,
+        .tabulator-row.tabulator-selected.no-select-styles:hover,
+        .tabulator-row.no-select-styles:hover,
+        .tabulator-row.tabulator-selectable.no-select-styles:hover{
             color: var(--dbp-content);
             background-color: var(--dbp-background);
         }
 
+        .tabulator .tabulator-tableholder{
+            overflow: inherit;
+        }
+        
         @media only screen and (orientation: portrait) and (max-width: 768px) {
             
         }
-- 
GitLab