@formio/js 5.0.0-rc.39 → 5.0.0-rc.41
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.builder.css +2 -2
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +2 -2
- package/dist/formio.form.js +5373 -2370
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +25 -7
- package/dist/formio.full.css +2 -2
- package/dist/formio.full.js +5715 -2704
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +25 -7
- package/dist/formio.js +143 -61
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +13 -1
- package/dist/formio.utils.js +149 -96
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +4 -4
- package/lib/cjs/Element.js +1 -0
- package/lib/cjs/Embed.js +121 -121
- package/lib/cjs/Webform.js +36 -13
- package/lib/cjs/WebformBuilder.js +4 -2
- package/lib/cjs/Wizard.js +6 -1
- package/lib/cjs/components/_classes/component/Component.js +33 -22
- package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +8 -0
- package/lib/cjs/components/_classes/component/fixtures/comp5.js +2 -2
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +2 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +2 -2
- package/lib/cjs/components/address/fixtures/comp3.js +1 -1
- package/lib/cjs/components/builder.js +0 -2
- package/lib/cjs/components/button/Button.js +7 -1
- package/lib/cjs/components/datagrid/DataGrid.js +16 -3
- package/lib/cjs/components/datagrid/fixtures/comp-with-allow-calculate-override.js +68 -0
- package/lib/cjs/components/datagrid/fixtures/comp6.js +1 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +5 -1
- package/lib/cjs/components/datagrid/fixtures/two-comp-with-allow-calculate-override.js +104 -0
- package/lib/cjs/components/editgrid/EditGrid.js +11 -4
- package/lib/cjs/components/editgrid/fixtures/formsWithEditGridAndConditions.js +923 -0
- package/lib/cjs/components/file/File.js +2 -2
- package/lib/cjs/components/file/editForm/File.edit.file.js +1 -1
- package/lib/cjs/components/form/Form.js +1 -1
- package/lib/cjs/components/html/HTML.js +11 -2
- package/lib/cjs/components/html/fixtures/index.js +1 -3
- package/lib/cjs/components/index.js +0 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.js +46 -46
- package/lib/cjs/components/select/Select.js +3 -1
- package/lib/cjs/components/select/fixtures/comp20.js +46 -0
- package/lib/cjs/components/select/fixtures/comp21.js +106 -0
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.js +1 -1
- package/lib/cjs/components/textfield/TextField.js +63 -3
- package/lib/cjs/providers/storage/s3.js +5 -3
- package/lib/cjs/providers/storage/uploadAdapter.js +1 -1
- package/lib/cjs/providers/storage/url.js +19 -13
- package/lib/cjs/templates/Templates.js +4 -4
- package/lib/cjs/translations/en.js +10 -6
- package/lib/cjs/utils/Evaluator.js +1 -1
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/lib/cjs/utils/formUtils.js +3 -3
- package/lib/cjs/utils/utils.js +4 -19
- package/lib/cjs/widgets/CalendarWidget.js +1 -1
- package/lib/mjs/Element.js +1 -0
- package/lib/mjs/Embed.js +1 -2
- package/lib/mjs/FormBuilder.js +1 -2
- package/lib/mjs/Webform.js +36 -13
- package/lib/mjs/WebformBuilder.js +4 -2
- package/lib/mjs/Wizard.js +6 -1
- package/lib/mjs/builders/Builders.js +1 -2
- package/lib/mjs/components/Components.js +1 -2
- package/lib/mjs/components/_classes/component/Component.js +33 -24
- package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +8 -0
- package/lib/mjs/components/_classes/component/fixtures/comp5.js +2 -2
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +2 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +2 -2
- package/lib/mjs/components/address/fixtures/comp3.js +1 -1
- package/lib/mjs/components/builder.js +0 -2
- package/lib/mjs/components/button/Button.js +7 -1
- package/lib/mjs/components/datagrid/DataGrid.js +15 -3
- package/lib/mjs/components/datagrid/fixtures/comp-with-allow-calculate-override.js +66 -0
- package/lib/mjs/components/datagrid/fixtures/comp6.js +1 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +3 -1
- package/lib/mjs/components/datagrid/fixtures/two-comp-with-allow-calculate-override.js +102 -0
- package/lib/mjs/components/editgrid/EditGrid.js +11 -4
- package/lib/mjs/components/editgrid/fixtures/formsWithEditGridAndConditions.js +921 -0
- package/lib/mjs/components/file/File.js +2 -2
- package/lib/mjs/components/file/editForm/File.edit.file.js +1 -1
- package/lib/mjs/components/form/Form.js +1 -1
- package/lib/mjs/components/html/HTML.js +10 -2
- package/lib/mjs/components/html/fixtures/index.js +1 -2
- package/lib/mjs/components/index.js +0 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.js +32 -43
- package/lib/mjs/components/select/Select.js +3 -1
- package/lib/mjs/components/select/fixtures/comp20.js +44 -0
- package/lib/mjs/components/select/fixtures/comp21.js +104 -0
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.js +1 -1
- package/lib/mjs/components/textfield/TextField.js +62 -3
- package/lib/mjs/displays/Displays.js +1 -2
- package/lib/mjs/licenses/Licenses.js +1 -2
- package/lib/mjs/providers/Providers.js +1 -2
- package/lib/mjs/providers/storage/s3.js +5 -3
- package/lib/mjs/providers/storage/uploadAdapter.js +1 -1
- package/lib/mjs/providers/storage/url.js +19 -13
- package/lib/mjs/templates/Templates.js +1 -1
- package/lib/mjs/translations/en.js +10 -6
- package/lib/mjs/utils/Evaluator.js +1 -1
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/lib/mjs/utils/formUtils.js +3 -3
- package/lib/mjs/utils/utils.js +2 -16
- package/lib/mjs/widgets/CalendarWidget.js +1 -1
- package/package.json +23 -22
- package/lib/cjs/components/html/fixtures/comp3.js +0 -31
- package/lib/cjs/components/resource/Resource.form.js +0 -16
- package/lib/cjs/components/resource/Resource.js +0 -39
- package/lib/cjs/components/resource/editForm/Resource.edit.display.js +0 -102
- package/lib/cjs/components/resource/fixtures/comp1.js +0 -30
- package/lib/cjs/components/resource/fixtures/comp2.js +0 -31
- package/lib/cjs/components/resource/fixtures/index.js +0 -10
- package/lib/mjs/components/html/fixtures/comp3.js +0 -29
- package/lib/mjs/components/resource/Resource.form.js +0 -10
- package/lib/mjs/components/resource/Resource.js +0 -33
- package/lib/mjs/components/resource/editForm/Resource.edit.display.js +0 -100
- package/lib/mjs/components/resource/fixtures/comp1.js +0 -28
- package/lib/mjs/components/resource/fixtures/comp2.js +0 -29
- package/lib/mjs/components/resource/fixtures/index.js +0 -3
@@ -14,7 +14,7 @@ export default {
|
|
14
14
|
required: '{{field}} is required',
|
15
15
|
unique: '{{field}} must be unique',
|
16
16
|
array: '{{field}} must be an array',
|
17
|
-
array_nonempty: '{{field}} must be a non-empty array',
|
17
|
+
array_nonempty: '{{field}} must be a non-empty array', // eslint-disable-line camelcase
|
18
18
|
nonarray: '{{field}} must not be an array',
|
19
19
|
select: '{{field}} contains an invalid selection',
|
20
20
|
pattern: '{{field}} does not match the pattern {{pattern}}',
|
@@ -30,11 +30,11 @@ export default {
|
|
30
30
|
minYear: '{{field}} should not contain year less than {{minYear}}',
|
31
31
|
minSelectedCount: 'You must select at least {{minCount}} items',
|
32
32
|
maxSelectedCount: 'You may only select up to {{maxCount}} items',
|
33
|
-
invalid_email: '{{field}} must be a valid email.',
|
34
|
-
invalid_url: '{{field}} must be a valid url.',
|
35
|
-
invalid_regex: '{{field}} does not match the pattern {{regex}}.',
|
36
|
-
invalid_date: '{{field}} is not a valid date.',
|
37
|
-
invalid_day: '{{field}} is not a valid day.',
|
33
|
+
invalid_email: '{{field}} must be a valid email.', // eslint-disable-line camelcase
|
34
|
+
invalid_url: '{{field}} must be a valid url.', // eslint-disable-line camelcase
|
35
|
+
invalid_regex: '{{field}} does not match the pattern {{regex}}.', // eslint-disable-line camelcase
|
36
|
+
invalid_date: '{{field}} is not a valid date.', // eslint-disable-line camelcase
|
37
|
+
invalid_day: '{{field}} is not a valid day.', // eslint-disable-line camelcase
|
38
38
|
invalidValueProperty: 'Invalid Value Property',
|
39
39
|
mask: '{{field}} does not match the mask.',
|
40
40
|
valueIsNotAvailable: '{{ field }} is an invalid value.',
|
@@ -62,9 +62,13 @@ export default {
|
|
62
62
|
saveDraftInstanceError: 'Cannot save draft because there is no formio instance.',
|
63
63
|
saveDraftAuthError: 'Cannot save draft unless a user is authenticated.',
|
64
64
|
restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.',
|
65
|
+
saveDraftError: 'Unable to save draft.',
|
66
|
+
restoreDraftError: 'Unable to restore draft.',
|
65
67
|
time: 'Invalid time',
|
66
68
|
cancelButtonAriaLabel: 'Cancel button. Click to reset the form',
|
67
69
|
previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab',
|
68
70
|
nextButtonAriaLabel: 'Next button. Click to go to the next tab',
|
69
71
|
submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
|
72
|
+
reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
|
73
|
+
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
70
74
|
};
|
@@ -3,7 +3,7 @@ import stringHash from 'string-hash';
|
|
3
3
|
import { Evaluator as CoreEvaluator } from '@formio/core/utils';
|
4
4
|
const Evaluator = {
|
5
5
|
noeval: false,
|
6
|
-
protectedEval: false,
|
6
|
+
protectedEval: false, // This property can be customized only by plugins
|
7
7
|
cache: {},
|
8
8
|
templateSettings: CoreEvaluator.templateSettings,
|
9
9
|
evaluator: CoreEvaluator.evaluator,
|
@@ -9,7 +9,7 @@ export default class IsEqualTo extends ConditionOperator {
|
|
9
9
|
return 'Is Equal To';
|
10
10
|
}
|
11
11
|
execute({ value, comparedValue, instance, conditionComponentPath }) {
|
12
|
-
if (value && comparedValue && typeof value !== typeof comparedValue && _.isString(comparedValue)) {
|
12
|
+
if ((value || value === false) && comparedValue && typeof value !== typeof comparedValue && _.isString(comparedValue)) {
|
13
13
|
try {
|
14
14
|
comparedValue = JSON.parse(comparedValue);
|
15
15
|
}
|
@@ -33,7 +33,7 @@ export default class IsEqualTo extends ConditionOperator {
|
|
33
33
|
}
|
34
34
|
}
|
35
35
|
//special check for select boxes
|
36
|
-
if (_.isObject(value) && comparedValue && _.
|
36
|
+
if (_.isObject(value) && comparedValue && _.isBoolean(value[comparedValue])) {
|
37
37
|
return value[comparedValue];
|
38
38
|
}
|
39
39
|
return _.isEqual(value, comparedValue);
|
@@ -257,9 +257,9 @@ export function generateFormChange(type, data) {
|
|
257
257
|
change = {
|
258
258
|
op: 'add',
|
259
259
|
key: data.component.key,
|
260
|
-
container: data.parent.key,
|
261
|
-
path: data.path,
|
262
|
-
index: data.index,
|
260
|
+
container: data.parent.key, // Parent component
|
261
|
+
path: data.path, // Path to container within parent component.
|
262
|
+
index: data.index, // Index of component in parent container.
|
263
263
|
component: data.component
|
264
264
|
};
|
265
265
|
break;
|
package/lib/mjs/utils/utils.js
CHANGED
@@ -394,21 +394,6 @@ export function unescapeHTML(str) {
|
|
394
394
|
const doc = new window.DOMParser().parseFromString(str, 'text/html');
|
395
395
|
return doc.documentElement.textContent;
|
396
396
|
}
|
397
|
-
/**
|
398
|
-
* Escape HTML characters like <, >, & and etc.
|
399
|
-
* @param str
|
400
|
-
* @returns {string}
|
401
|
-
*/
|
402
|
-
export function escapeHTML(html) {
|
403
|
-
if (html) {
|
404
|
-
return html.replace(/&/g, '&')
|
405
|
-
.replace(/</g, '<')
|
406
|
-
.replace(/>/g, '>')
|
407
|
-
.replace(/"/g, '"')
|
408
|
-
.replace(/'/g, ''');
|
409
|
-
}
|
410
|
-
return '';
|
411
|
-
}
|
412
397
|
/**
|
413
398
|
* Make HTML element from string
|
414
399
|
* @param str
|
@@ -1183,7 +1168,8 @@ export function sanitize(string, options) {
|
|
1183
1168
|
}
|
1184
1169
|
// Allowd URI Regex
|
1185
1170
|
if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {
|
1186
|
-
|
1171
|
+
const allowedUriRegex = options.sanitizeConfig.allowedUriRegex;
|
1172
|
+
sanitizeOptions.ALLOWED_URI_REGEXP = _.isString(allowedUriRegex) ? new RegExp(allowedUriRegex) : allowedUriRegex;
|
1187
1173
|
}
|
1188
1174
|
// Allow to extend the existing array of elements that are safe for URI-like values
|
1189
1175
|
if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {
|
@@ -436,7 +436,7 @@ export default class CalendarWidget extends InputWidget {
|
|
436
436
|
return (date, format) => {
|
437
437
|
// Only format this if this is the altFormat and the form is readOnly.
|
438
438
|
if (this.settings.readOnly && (format === this.settings.altFormat)) {
|
439
|
-
if (this.loadZones()) {
|
439
|
+
if (!this.settings.enableTime || this.loadZones()) {
|
440
440
|
return Flatpickr.formatDate(date, format);
|
441
441
|
}
|
442
442
|
const currentValue = new Date(this.getValue());
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.0.0-rc.
|
3
|
+
"version": "5.0.0-rc.41",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -84,21 +84,21 @@
|
|
84
84
|
},
|
85
85
|
"homepage": "https://github.com/formio/formio.js#readme",
|
86
86
|
"dependencies": {
|
87
|
-
"@formio/bootstrap": "^3.0.0-rc.
|
88
|
-
"@formio/choices.js": "^10.2.
|
89
|
-
"@formio/core": "^2.0.0-rc.
|
87
|
+
"@formio/bootstrap": "^3.0.0-rc.21",
|
88
|
+
"@formio/choices.js": "^10.2.1",
|
89
|
+
"@formio/core": "^2.0.0-rc.18",
|
90
90
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
91
91
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
92
92
|
"abortcontroller-polyfill": "^1.7.5",
|
93
93
|
"autocompleter": "^8.0.4",
|
94
|
-
"bootstrap": "^5.3.
|
94
|
+
"bootstrap": "^5.3.3",
|
95
95
|
"browser-cookies": "^1.2.0",
|
96
96
|
"browser-md5-file": "^1.1.1",
|
97
97
|
"compare-versions": "^6.0.0-rc.2",
|
98
|
-
"core-js": "^3.
|
98
|
+
"core-js": "^3.36.0",
|
99
99
|
"dialog-polyfill": "^0.5.6",
|
100
100
|
"dom-autoscroller": "^2.3.4",
|
101
|
-
"dompurify": "^3.0.
|
101
|
+
"dompurify": "^3.0.9",
|
102
102
|
"downloadjs": "^1.4.7",
|
103
103
|
"dragula": "^3.7.3",
|
104
104
|
"eventemitter3": "^5.0.1",
|
@@ -106,27 +106,28 @@
|
|
106
106
|
"fast-json-patch": "^3.1.1",
|
107
107
|
"fetch-ponyfill": "^7.1.0",
|
108
108
|
"idb": "^7.1.1",
|
109
|
+
"inputmask": "^5.0.8",
|
109
110
|
"ismobilejs": "^1.1.1",
|
110
111
|
"json-logic-js": "^2.0.2",
|
111
112
|
"jstimezonedetect": "^1.0.7",
|
112
113
|
"jwt-decode": "^3.1.2",
|
113
114
|
"lodash": "^4.17.21",
|
114
115
|
"moment": "^2.29.4",
|
115
|
-
"moment-timezone": "^0.5.
|
116
|
+
"moment-timezone": "^0.5.44",
|
116
117
|
"quill": "^2.0.0-dev.3",
|
117
|
-
"signature_pad": "^4.
|
118
|
+
"signature_pad": "^4.2.0",
|
118
119
|
"string-hash": "^1.1.3",
|
119
120
|
"tippy.js": "^6.3.7",
|
120
121
|
"uuid": "^9.0.0",
|
121
122
|
"vanilla-picker": "^2.12.2"
|
122
123
|
},
|
123
124
|
"devDependencies": {
|
124
|
-
"@typescript-eslint/eslint-plugin": "^
|
125
|
-
"@typescript-eslint/parser": "^
|
126
|
-
"ace-builds": "1.
|
125
|
+
"@typescript-eslint/eslint-plugin": "^7.3.0",
|
126
|
+
"@typescript-eslint/parser": "^7.3.0",
|
127
|
+
"ace-builds": "1.32.7",
|
127
128
|
"async-limiter": "^2.0.0",
|
128
129
|
"bootstrap-icons": "^1.10.5",
|
129
|
-
"bootswatch": "^5.3.
|
130
|
+
"bootswatch": "^5.3.3",
|
130
131
|
"browser-env": "^3.3.0",
|
131
132
|
"chai": "^4.3.7",
|
132
133
|
"chance": "^1.1.9",
|
@@ -135,7 +136,7 @@
|
|
135
136
|
"esdoc": "^1.1.0",
|
136
137
|
"esdoc-ecmascript-proposal-plugin": "^1.0.0",
|
137
138
|
"esdoc-standard-plugin": "^1.0.0",
|
138
|
-
"eslint": "^8.
|
139
|
+
"eslint": "^8.57.0",
|
139
140
|
"eslint-config-formio": "^1.1.4",
|
140
141
|
"fetch-mock": "^9.11.0",
|
141
142
|
"file-loader": "^6.2.0",
|
@@ -153,15 +154,15 @@
|
|
153
154
|
"gulp-sync": "^0.1.4",
|
154
155
|
"gulp-watch": "^5.0.1",
|
155
156
|
"hoek": "^6.1.3",
|
156
|
-
"jsdom": "^
|
157
|
+
"jsdom": "^24.0.0",
|
157
158
|
"jsdom-global": "^3.0.2",
|
158
|
-
"karma": "^6.4.
|
159
|
+
"karma": "^6.4.3",
|
159
160
|
"karma-chrome-launcher": "^3.2.0",
|
160
161
|
"karma-mocha": "^2.0.1",
|
161
162
|
"karma-mocha-reporter": "^2.2.5",
|
162
163
|
"karma-phantomjs-launcher": "^1.0.4",
|
163
|
-
"karma-webpack": "^5.0.
|
164
|
-
"mocha": "^10.
|
164
|
+
"karma-webpack": "^5.0.1",
|
165
|
+
"mocha": "^10.3.0",
|
165
166
|
"mock-local-storage": "^1.1.24",
|
166
167
|
"natives": "^1.1.6",
|
167
168
|
"power-assert": "^1.6.1",
|
@@ -169,14 +170,14 @@
|
|
169
170
|
"pretty": "^2.0.0",
|
170
171
|
"pygments-css": "^1.0.0",
|
171
172
|
"raw-loader": "^4.0.2",
|
172
|
-
"sass": "^1.
|
173
|
+
"sass": "^1.72.0",
|
173
174
|
"shortcut-buttons-flatpickr": "^0.4.0",
|
174
|
-
"sinon": "^
|
175
|
+
"sinon": "^17.0.1",
|
175
176
|
"string-replace-loader": "^3.1.0",
|
176
177
|
"ts-loader": "^9.4.4",
|
177
178
|
"ts-node": "^10.9.1",
|
178
|
-
"typescript": "
|
179
|
-
"webpack": "^5.
|
179
|
+
"typescript": "5.3.3",
|
180
|
+
"webpack": "^5.90.3",
|
180
181
|
"webpack-bundle-analyzer": "^4.9.0",
|
181
182
|
"webpack-cli": "^5.1.1",
|
182
183
|
"webpack-node-externals": "^3.0.0",
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = {
|
4
|
-
type: 'form',
|
5
|
-
display: 'form',
|
6
|
-
components: [
|
7
|
-
{
|
8
|
-
label: 'HTML',
|
9
|
-
attrs: [
|
10
|
-
{
|
11
|
-
attr: '',
|
12
|
-
value: '',
|
13
|
-
},
|
14
|
-
],
|
15
|
-
content: '<img src=1 onerror=alert("htmlContent")>',
|
16
|
-
refreshOnChange: false,
|
17
|
-
key: 'html',
|
18
|
-
type: 'htmlelement',
|
19
|
-
input: false,
|
20
|
-
tableView: false,
|
21
|
-
},
|
22
|
-
{
|
23
|
-
type: 'button',
|
24
|
-
label: 'Submit',
|
25
|
-
key: 'submit',
|
26
|
-
disableOnInvalid: true,
|
27
|
-
input: true,
|
28
|
-
tableView: false,
|
29
|
-
},
|
30
|
-
],
|
31
|
-
};
|
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Components_1 = __importDefault(require("../Components"));
|
7
|
-
const Resource_edit_display_1 = __importDefault(require("./editForm/Resource.edit.display"));
|
8
|
-
function default_1(...extend) {
|
9
|
-
return Components_1.default.baseEditForm([
|
10
|
-
{
|
11
|
-
key: 'display',
|
12
|
-
components: Resource_edit_display_1.default
|
13
|
-
},
|
14
|
-
], ...extend);
|
15
|
-
}
|
16
|
-
exports.default = default_1;
|
@@ -1,39 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Select_1 = __importDefault(require("../select/Select"));
|
7
|
-
class ResourceComponent extends Select_1.default {
|
8
|
-
static schema(...extend) {
|
9
|
-
return Select_1.default.schema({
|
10
|
-
type: 'resource',
|
11
|
-
label: 'Resource',
|
12
|
-
key: 'resource',
|
13
|
-
dataSrc: 'resource',
|
14
|
-
resource: '',
|
15
|
-
project: '',
|
16
|
-
template: '<span>{{ item.data }}</span>',
|
17
|
-
}, ...extend);
|
18
|
-
}
|
19
|
-
static get builderInfo() {
|
20
|
-
return {
|
21
|
-
title: 'Resource',
|
22
|
-
icon: 'files-o',
|
23
|
-
weight: 90,
|
24
|
-
documentation: '/userguide/form-building/form-components#resource',
|
25
|
-
schema: ResourceComponent.schema(),
|
26
|
-
};
|
27
|
-
}
|
28
|
-
init() {
|
29
|
-
super.init();
|
30
|
-
this.component.dataSrc = 'resource';
|
31
|
-
this.component.data = {
|
32
|
-
resource: this.component.resource,
|
33
|
-
};
|
34
|
-
}
|
35
|
-
get defaultSchema() {
|
36
|
-
return ResourceComponent.schema();
|
37
|
-
}
|
38
|
-
}
|
39
|
-
exports.default = ResourceComponent;
|
@@ -1,102 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = [
|
4
|
-
{
|
5
|
-
key: 'resourceInfo',
|
6
|
-
weight: -10,
|
7
|
-
type: 'htmlelement',
|
8
|
-
tag: 'div',
|
9
|
-
className: 'alert alert-danger',
|
10
|
-
content: 'This component has been deprecated and will be removed in a future version of Formio.js.',
|
11
|
-
},
|
12
|
-
{
|
13
|
-
type: 'select',
|
14
|
-
input: true,
|
15
|
-
dataSrc: 'url',
|
16
|
-
data: {
|
17
|
-
url: '/form?type=resource&limit=1000000&select=_id,title',
|
18
|
-
},
|
19
|
-
authenticate: true,
|
20
|
-
template: '<span>{{ item.title }}</span>',
|
21
|
-
valueProperty: '_id',
|
22
|
-
label: 'Resource',
|
23
|
-
key: 'resource',
|
24
|
-
weight: 50,
|
25
|
-
tooltip: 'The resource to be used with this field.',
|
26
|
-
},
|
27
|
-
{
|
28
|
-
type: 'tags',
|
29
|
-
input: true,
|
30
|
-
key: 'selectFields',
|
31
|
-
label: 'Select Fields',
|
32
|
-
tooltip: 'The properties on the resource to return as part of the options. If left blank, all properties will be returned.',
|
33
|
-
placeholder: 'Enter the fields to select.',
|
34
|
-
weight: 51,
|
35
|
-
},
|
36
|
-
{
|
37
|
-
type: 'tags',
|
38
|
-
input: true,
|
39
|
-
key: 'searchFields',
|
40
|
-
label: 'Search Fields',
|
41
|
-
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.',
|
42
|
-
placeholder: 'The fields to query on the server',
|
43
|
-
weight: 52,
|
44
|
-
},
|
45
|
-
{
|
46
|
-
type: 'textfield',
|
47
|
-
input: true,
|
48
|
-
key: 'filter',
|
49
|
-
label: 'Filter Query',
|
50
|
-
weight: 53,
|
51
|
-
description: 'The filter query for results.',
|
52
|
-
tooltip: 'Use this to provide additional filtering using query parameters.',
|
53
|
-
},
|
54
|
-
{
|
55
|
-
type: 'textfield',
|
56
|
-
input: true,
|
57
|
-
key: 'sort',
|
58
|
-
label: 'Sort Query',
|
59
|
-
weight: 53,
|
60
|
-
description: 'The sort query for results',
|
61
|
-
tooltip: 'Use this to provide additional sorting using query parameters',
|
62
|
-
},
|
63
|
-
{
|
64
|
-
type: 'textarea',
|
65
|
-
input: true,
|
66
|
-
key: 'template',
|
67
|
-
label: 'Item Template',
|
68
|
-
editor: 'ace',
|
69
|
-
as: 'html',
|
70
|
-
rows: 3,
|
71
|
-
weight: 53,
|
72
|
-
tooltip: 'The HTML template for the result data items.',
|
73
|
-
},
|
74
|
-
{
|
75
|
-
type: 'checkbox',
|
76
|
-
input: true,
|
77
|
-
weight: 54,
|
78
|
-
key: 'addResource',
|
79
|
-
label: 'Add Resource',
|
80
|
-
tooltip: 'Allows to create a new resource while entering a submission.',
|
81
|
-
conditional: {
|
82
|
-
json: { '===': [{ var: 'data.dataSrc' }, 'resource'] },
|
83
|
-
},
|
84
|
-
},
|
85
|
-
{
|
86
|
-
type: 'textfield',
|
87
|
-
label: 'Add Resource Label',
|
88
|
-
key: 'addResourceLabel',
|
89
|
-
tooltip: 'Set the text of the Add Resource button.',
|
90
|
-
placeholder: 'Add Resource',
|
91
|
-
weight: 55,
|
92
|
-
input: true,
|
93
|
-
conditional: {
|
94
|
-
json: {
|
95
|
-
and: [
|
96
|
-
{ '===': [{ var: 'data.dataSrc' }, 'resource'] },
|
97
|
-
{ '!!': { var: 'data.addResource' } },
|
98
|
-
],
|
99
|
-
},
|
100
|
-
},
|
101
|
-
},
|
102
|
-
];
|
@@ -1,30 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = {
|
4
|
-
'conditional': {
|
5
|
-
'eq': '',
|
6
|
-
'when': null,
|
7
|
-
'show': ''
|
8
|
-
},
|
9
|
-
'tags': [],
|
10
|
-
'type': 'resource',
|
11
|
-
'defaultPermission': '',
|
12
|
-
'validate': {
|
13
|
-
'required': false
|
14
|
-
},
|
15
|
-
'clearOnHide': true,
|
16
|
-
'persistent': true,
|
17
|
-
'protected': false,
|
18
|
-
'multiple': false,
|
19
|
-
'searchFields': '',
|
20
|
-
'selectFields': '',
|
21
|
-
'template': '<span>{{ item.data }}</span>',
|
22
|
-
'defaultValue': '',
|
23
|
-
'project': '58c21742e4d02b009660a6ee',
|
24
|
-
'resource': '58c21742e4d02b009660a6f2',
|
25
|
-
'placeholder': 'Select the user',
|
26
|
-
'key': 'user',
|
27
|
-
'label': 'User',
|
28
|
-
'tableView': true,
|
29
|
-
'input': true
|
30
|
-
};
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = {
|
4
|
-
title: 'FIO-3744',
|
5
|
-
name: 'fio3744',
|
6
|
-
path: 'fio3744',
|
7
|
-
type: 'form',
|
8
|
-
display: 'form',
|
9
|
-
components: [
|
10
|
-
{
|
11
|
-
label: 'Resource',
|
12
|
-
resource: '61377a53c202989e4ed9ff21',
|
13
|
-
template: '<span>{{ item.data.textField }}</span>',
|
14
|
-
tableView: true,
|
15
|
-
unique: true,
|
16
|
-
key: 'resource',
|
17
|
-
type: 'resource',
|
18
|
-
input: true,
|
19
|
-
data: { resource: '61377a53c202989e4ed9ff21' },
|
20
|
-
addResource: false,
|
21
|
-
},
|
22
|
-
{
|
23
|
-
type: 'button',
|
24
|
-
label: 'Submit',
|
25
|
-
key: 'submit',
|
26
|
-
disableOnInvalid: true,
|
27
|
-
input: true,
|
28
|
-
tableView: false,
|
29
|
-
},
|
30
|
-
],
|
31
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.comp2 = exports.comp1 = void 0;
|
7
|
-
const comp1_1 = __importDefault(require("./comp1"));
|
8
|
-
exports.comp1 = comp1_1.default;
|
9
|
-
const comp2_1 = __importDefault(require("./comp2"));
|
10
|
-
exports.comp2 = comp2_1.default;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
export default {
|
2
|
-
type: 'form',
|
3
|
-
display: 'form',
|
4
|
-
components: [
|
5
|
-
{
|
6
|
-
label: 'HTML',
|
7
|
-
attrs: [
|
8
|
-
{
|
9
|
-
attr: '',
|
10
|
-
value: '',
|
11
|
-
},
|
12
|
-
],
|
13
|
-
content: '<img src=1 onerror=alert("htmlContent")>',
|
14
|
-
refreshOnChange: false,
|
15
|
-
key: 'html',
|
16
|
-
type: 'htmlelement',
|
17
|
-
input: false,
|
18
|
-
tableView: false,
|
19
|
-
},
|
20
|
-
{
|
21
|
-
type: 'button',
|
22
|
-
label: 'Submit',
|
23
|
-
key: 'submit',
|
24
|
-
disableOnInvalid: true,
|
25
|
-
input: true,
|
26
|
-
tableView: false,
|
27
|
-
},
|
28
|
-
],
|
29
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import Components from '../Components';
|
2
|
-
import ResourceEditDisplay from './editForm/Resource.edit.display';
|
3
|
-
export default function (...extend) {
|
4
|
-
return Components.baseEditForm([
|
5
|
-
{
|
6
|
-
key: 'display',
|
7
|
-
components: ResourceEditDisplay
|
8
|
-
},
|
9
|
-
], ...extend);
|
10
|
-
}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import SelectComponent from '../select/Select';
|
2
|
-
export default class ResourceComponent extends SelectComponent {
|
3
|
-
static schema(...extend) {
|
4
|
-
return SelectComponent.schema({
|
5
|
-
type: 'resource',
|
6
|
-
label: 'Resource',
|
7
|
-
key: 'resource',
|
8
|
-
dataSrc: 'resource',
|
9
|
-
resource: '',
|
10
|
-
project: '',
|
11
|
-
template: '<span>{{ item.data }}</span>',
|
12
|
-
}, ...extend);
|
13
|
-
}
|
14
|
-
static get builderInfo() {
|
15
|
-
return {
|
16
|
-
title: 'Resource',
|
17
|
-
icon: 'files-o',
|
18
|
-
weight: 90,
|
19
|
-
documentation: '/userguide/form-building/form-components#resource',
|
20
|
-
schema: ResourceComponent.schema(),
|
21
|
-
};
|
22
|
-
}
|
23
|
-
init() {
|
24
|
-
super.init();
|
25
|
-
this.component.dataSrc = 'resource';
|
26
|
-
this.component.data = {
|
27
|
-
resource: this.component.resource,
|
28
|
-
};
|
29
|
-
}
|
30
|
-
get defaultSchema() {
|
31
|
-
return ResourceComponent.schema();
|
32
|
-
}
|
33
|
-
}
|