@ministryofjustice/hmpps-digital-prison-reporting-frontend 2.4.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,8 @@ export interface Header {
6
6
  }
7
7
 
8
8
  export interface Cell {
9
- text: string
9
+ text?: string
10
+ html?: string
10
11
  format?: string
11
12
  classes?: string
12
13
  }
@@ -78,8 +78,9 @@ exports.default = {
78
78
  default:
79
79
  fieldFormat = 'string';
80
80
  }
81
+ const isHtml = f.type === 'HTML';
81
82
  const cell = {
82
- text,
83
+ ...(isHtml ? { html: text } : { text }),
83
84
  format: fieldFormat,
84
85
  classes: f.wordWrap ? `data-table-cell-wrap-${f.wordWrap.toLowerCase()}` : null,
85
86
  };
@@ -102,9 +102,9 @@ export default {
102
102
  default:
103
103
  fieldFormat = 'string'
104
104
  }
105
-
105
+ const isHtml = f.type === 'HTML'
106
106
  const cell: Cell = {
107
- text,
107
+ ...(isHtml ? { html: text } : { text }),
108
108
  format: fieldFormat,
109
109
  classes: f.wordWrap ? `data-table-cell-wrap-${f.wordWrap.toLowerCase()}` : null,
110
110
  }
@@ -74,7 +74,7 @@ export interface components {
74
74
  sortable: boolean
75
75
  defaultsort: boolean
76
76
  /** @enum {string} */
77
- type: 'string' | 'date' | 'long' | 'time'
77
+ type: 'string' | 'date' | 'long' | 'time' | 'HTML'
78
78
  }
79
79
  FilterDefinition: {
80
80
  /** @enum {string} */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ministryofjustice/hmpps-digital-prison-reporting-frontend",
3
3
  "description": "The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.",
4
- "version": "2.4.2",
4
+ "version": "2.5.0",
5
5
  "main": "dpr/assets/js/client.js",
6
6
  "sass": "dpr/all.scss",
7
7
  "engines": {
package/package.zip CHANGED
Binary file