|
| 1 | +export default [ |
| 2 | + { |
| 3 | + key: 'resourceInfo', |
| 4 | + weight: -10, |
| 5 | + type: 'htmlelement', |
| 6 | + tag: 'div', |
| 7 | + className: 'alert alert-danger', |
| 8 | + content: 'This component has been deprecated and will be removed in a future version of Formio.js.', |
| 9 | + }, |
| 10 | + { |
| 11 | + type: 'select', |
| 12 | + input: true, |
| 13 | + dataSrc: 'url', |
| 14 | + data: { |
| 15 | + url: '/form?type=resource&limit=1000000&select=_id,title', |
| 16 | + }, |
| 17 | + authenticate: true, |
| 18 | + template: '<span>{{ item.title }}</span>', |
| 19 | + valueProperty: '_id', |
| 20 | + label: 'Resource', |
| 21 | + key: 'resource', |
| 22 | + weight: 50, |
| 23 | + tooltip: 'The resource to be used with this field.', |
| 24 | + }, |
| 25 | + { |
| 26 | + type: 'tags', |
| 27 | + input: true, |
| 28 | + key: 'selectFields', |
| 29 | + label: 'Select Fields', |
| 30 | + tooltip: 'The properties on the resource to return as part of the options. If left blank, all properties will be returned.', |
| 31 | + placeholder: 'Enter the fields to select.', |
| 32 | + weight: 51, |
| 33 | + }, |
| 34 | + { |
| 35 | + type: 'tags', |
| 36 | + input: true, |
| 37 | + key: 'searchFields', |
| 38 | + label: 'Search Fields', |
| 39 | + tooltip: 'A list of search filters based on the fields of the resource. See the <a target=\'_blank\' href=\'https://github.com/travist/resourcejs#filtering-the-results\'>Resource.js documentation</a> for the format of these filters.', |
| 40 | + placeholder: 'The fields to query on the server', |
| 41 | + weight: 52, |
| 42 | + }, |
| 43 | + { |
| 44 | + type: 'textfield', |
| 45 | + input: true, |
| 46 | + key: 'filter', |
| 47 | + label: 'Filter Query', |
| 48 | + weight: 53, |
| 49 | + description: 'The filter query for results.', |
| 50 | + tooltip: 'Use this to provide additional filtering using query parameters.', |
| 51 | + }, |
| 52 | + { |
| 53 | + type: 'textfield', |
| 54 | + input: true, |
| 55 | + key: 'sort', |
| 56 | + label: 'Sort Query', |
| 57 | + weight: 53, |
| 58 | + description: 'The sort query for results', |
| 59 | + tooltip: 'Use this to provide additional sorting using query parameters', |
| 60 | + }, |
| 61 | + { |
| 62 | + type: 'textarea', |
| 63 | + input: true, |
| 64 | + key: 'template', |
| 65 | + label: 'Item Template', |
| 66 | + editor: 'ace', |
| 67 | + as: 'html', |
| 68 | + rows: 3, |
| 69 | + weight: 53, |
| 70 | + tooltip: 'The HTML template for the result data items.', |
| 71 | + }, |
| 72 | + { |
| 73 | + type: 'checkbox', |
| 74 | + input: true, |
| 75 | + weight: 54, |
| 76 | + key: 'addResource', |
| 77 | + label: 'Add Resource', |
| 78 | + tooltip: 'Allows to create a new resource while entering a submission.', |
| 79 | + conditional: { |
| 80 | + json: { '===': [{ var: 'data.dataSrc' }, 'resource'] }, |
| 81 | + }, |
| 82 | + }, |
| 83 | + { |
| 84 | + type: 'textfield', |
| 85 | + label: 'Add Resource Label', |
| 86 | + key: 'addResourceLabel', |
| 87 | + tooltip: 'Set the text of the Add Resource button.', |
| 88 | + placeholder: 'Add Resource', |
| 89 | + weight: 55, |
| 90 | + input: true, |
| 91 | + conditional: { |
| 92 | + json: { |
| 93 | + and: [ |
| 94 | + { '===': [{ var: 'data.dataSrc' }, 'resource'] }, |
| 95 | + { '!!': { var: 'data.addResource' } }, |
| 96 | + ], |
| 97 | + }, |
| 98 | + }, |
| 99 | + }, |
| 100 | +]; |
0 commit comments