diff --git a/docs/components/modeler/forms/form-element-library/forms-element-library-document-preview.md b/docs/components/modeler/forms/form-element-library/forms-element-library-document-preview.md new file mode 100644 index 00000000000..452899523ad --- /dev/null +++ b/docs/components/modeler/forms/form-element-library/forms-element-library-document-preview.md @@ -0,0 +1,30 @@ +--- +id: forms-element-library-document-preview +title: Document preview +description: A form element to preview documents +--- + +A form element to select files. + +Form Document preview Symbol + +### Configurable properties + +- **Title**: Title displayed on top of the file picker. Can either be an [expression](../../feel/language-guide/feel-expressions-introduction.md), plain text, or [templating syntax](../configuration/forms-config-templating-syntax.md). +- **Document reference**: Data used to render the documents. This can only be an [expression](../../feel/language-guide/feel-expressions-introduction.md). The resulting value must have the following structure: + +```json +[ + { + "documentId": "u123", + "metadata": { + "fileName": "Document.pdf", + "contentType": "application/pdf" + } + } +] +``` + +- **Document URL**: A context key which contains the URL value used to get each document. This can only be an [expression](../../feel/language-guide/feel-expressions-introduction.md). The resulting value must be a string and it must contain the placeholder `{documentId}` which will be replaced with the document ID present in the **Document reference** data. By default this component will use the key `defaultDocumentsEndpointKey`, if you leave this field unchanged it will work without any extra configuration on Tasklist and you won't have inject this variable in the process instance context. +- **Hide if**: [Expression](../../feel/language-guide/feel-expressions-introduction.md) to hide the file picker. +- **Max height of preview container**: A number which will define the maximum height of each document preview. Any document with a bigger height will display a scroll bar. diff --git a/docs/components/modeler/forms/sidebar-schema.js b/docs/components/modeler/forms/sidebar-schema.js index 3e455627265..d4040d1e88d 100644 --- a/docs/components/modeler/forms/sidebar-schema.js +++ b/docs/components/modeler/forms/sidebar-schema.js @@ -25,6 +25,7 @@ module.exports = { lib_dir + "forms-element-library-table", lib_dir + "forms-element-library-expression", lib_dir + "forms-element-library-filepicker", + lib_dir + "forms-element-library-document-preview", lib_dir + "forms-element-library-image", lib_dir + "forms-element-library-spacer", lib_dir + "forms-element-library-separator", diff --git a/static/img/form-icons/form-documentPreview.svg b/static/img/form-icons/form-documentPreview.svg new file mode 100644 index 00000000000..95663ca2e43 --- /dev/null +++ b/static/img/form-icons/form-documentPreview.svg @@ -0,0 +1 @@ + \ No newline at end of file