@formio/js 5.0.0-dev.5746.d82b0b1 → 5.0.0-dev.5748.cd8883d

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.
@@ -33,7 +33,7 @@ export default class FileComponent extends Field {
33
33
  get dataReady(): Promise<any>;
34
34
  loadImage(fileInfo: any): any;
35
35
  get emptyValue(): never[];
36
- getValueAsString(value: any): any;
36
+ getValueAsString(value: any, options: any): any;
37
37
  get defaultValue(): any[];
38
38
  get hasTypes(): any;
39
39
  _fileBrowseHidden: any;
@@ -114,7 +114,12 @@ class FileComponent extends Field_1.default {
114
114
  get emptyValue() {
115
115
  return [];
116
116
  }
117
- getValueAsString(value) {
117
+ getValueAsString(value, options) {
118
+ if ((options === null || options === void 0 ? void 0 : options.review) && !this.component.uploadOnly) {
119
+ return lodash_1.default.map(value, (val, index) => {
120
+ return `<a href="${val.url || '#'}" target="_blank" data-path='${this.path}' data-fileindex='${index}'>${val.originalName}</a>`;
121
+ }).join(', ');
122
+ }
118
123
  if (lodash_1.default.isArray(value)) {
119
124
  return lodash_1.default.map(value, 'originalName').join(', ');
120
125
  }
@@ -33,7 +33,7 @@ export default class FileComponent extends Field {
33
33
  get dataReady(): Promise<any>;
34
34
  loadImage(fileInfo: any): any;
35
35
  get emptyValue(): never[];
36
- getValueAsString(value: any): any;
36
+ getValueAsString(value: any, options: any): any;
37
37
  get defaultValue(): any[];
38
38
  get hasTypes(): any;
39
39
  _fileBrowseHidden: any;
@@ -103,7 +103,12 @@ export default class FileComponent extends Field {
103
103
  get emptyValue() {
104
104
  return [];
105
105
  }
106
- getValueAsString(value) {
106
+ getValueAsString(value, options) {
107
+ if (options?.review && !this.component.uploadOnly) {
108
+ return _.map(value, (val, index) => {
109
+ return `<a href="${val.url || '#'}" target="_blank" data-path='${this.path}' data-fileindex='${index}'>${val.originalName}</a>`;
110
+ }).join(', ');
111
+ }
107
112
  if (_.isArray(value)) {
108
113
  return _.map(value, 'originalName').join(', ');
109
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5746.d82b0b1",
3
+ "version": "5.0.0-dev.5748.cd8883d",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {