diff --git a/demo-shell/resources/i18n/en.json b/demo-shell/resources/i18n/en.json index 5eb8d9adf4..17e745dcd7 100644 --- a/demo-shell/resources/i18n/en.json +++ b/demo-shell/resources/i18n/en.json @@ -179,9 +179,7 @@ "REPLACE_COLUMNS": "Replace columns", "LOAD_NODE": "Load Node", "MULTISELECT": "Multiselect", - "MULTISELECT_DESCRIPTION": "Use Cmd (Mac) or Ctrl (Windows) to toggle selection of multiple items", - "CLICK_TO_COPY": "Click to copy", - "SUCCESS_COPY": "Text copied to clipboard" + "MULTISELECT_DESCRIPTION": "Use Cmd (Mac) or Ctrl (Windows) to toggle selection of multiple items" }, "ANALYTICS_REPORT": { "NO_REPORT_MESSAGE": "No report selected. Choose a report from the list" diff --git a/lib/core/datatable/components/datatable/datatable-cell.component.ts b/lib/core/datatable/components/datatable/datatable-cell.component.ts index fd39b6f8a4..d1caf3c6dc 100644 --- a/lib/core/datatable/components/datatable/datatable-cell.component.ts +++ b/lib/core/datatable/components/datatable/datatable-cell.component.ts @@ -36,8 +36,8 @@ import { Node } from '@alfresco/js-api'; template: ` diff --git a/lib/core/datatable/components/datatable/json-cell.component.scss b/lib/core/datatable/components/datatable/json-cell.component.scss index 69b91154fe..6ee7d6d74c 100644 --- a/lib/core/datatable/components/datatable/json-cell.component.scss +++ b/lib/core/datatable/components/datatable/json-cell.component.scss @@ -2,3 +2,7 @@ white-space: pre-wrap; word-wrap: break-word; } + +.adf-datatable-cell-value { + position: relative; +} diff --git a/lib/core/datatable/components/datatable/json-cell.component.ts b/lib/core/datatable/components/datatable/json-cell.component.ts index b0c2cacce2..5f459c05a0 100644 --- a/lib/core/datatable/components/datatable/json-cell.component.ts +++ b/lib/core/datatable/components/datatable/json-cell.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation, Input } from '@angular/core'; import { DataTableCellComponent } from './datatable-cell.component'; @Component({ @@ -23,10 +23,20 @@ import { DataTableCellComponent } from './datatable-cell.component'; changeDetection: ChangeDetectionStrategy.OnPush, template: ` + +
+                    {{ value$ | async | json }}
+                
+
+
+
{{ value$ | async | json }}
-
+ `, styleUrls: ['./json-cell.component.scss'], encapsulation: ViewEncapsulation.None, @@ -34,6 +44,10 @@ import { DataTableCellComponent } from './datatable-cell.component'; }) export class JsonCellComponent extends DataTableCellComponent implements OnInit { + /** Enables/disables a Clipboard directive to allow copying of the cell's content. */ + @Input() + copyContent: boolean; + ngOnInit() { if (this.column && this.column.key && this.row && this.data) { this.value$.next(this.data.getValue(this.row, this.column)); diff --git a/lib/core/i18n/en.json b/lib/core/i18n/en.json index 16807a4fcc..992c958be8 100644 --- a/lib/core/i18n/en.json +++ b/lib/core/i18n/en.json @@ -422,6 +422,9 @@ "CRYPTODOC_ENABLED": "Is Cryptodoc Enabled" } } - + }, + "CLIPBOARD": { + "CLICK_TO_COPY": "Click to copy", + "SUCCESS_COPY": "Text copied to clipboard" } }