@formio/js 5.0.0-rc.43 → 5.0.0-rc.44
Sign up to get free protection for your applications and to get access to all the features.
- 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.js +602 -580
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -11
- package/dist/formio.full.js +605 -583
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -11
- package/dist/formio.js +10 -11
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Element.js +2 -0
- package/lib/cjs/Form.js +3 -1
- package/lib/cjs/Webform.js +93 -15
- package/lib/cjs/WebformBuilder.js +8 -8
- package/lib/cjs/components/_classes/component/Component.js +25 -8
- package/lib/cjs/components/_classes/componentModal/ComponentModal.js +5 -4
- package/lib/cjs/components/_classes/input/Input.js +1 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +1 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +4 -2
- package/lib/cjs/components/datagrid/DataGrid.js +1 -1
- package/lib/cjs/components/editgrid/EditGrid.js +3 -3
- package/lib/cjs/components/form/Form.js +1 -1
- package/lib/cjs/components/html/HTML.js +2 -2
- package/lib/cjs/components/html/fixtures/comp3.js +40 -0
- package/lib/cjs/components/html/fixtures/index.js +3 -1
- package/lib/cjs/components/radio/Radio.js +29 -10
- package/lib/cjs/components/radio/editForm/Radio.edit.data.js +20 -0
- package/lib/cjs/components/radio/fixtures/comp11.js +85 -0
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/cjs/components/select/Select.js +3 -0
- package/lib/cjs/components/select/editForm/Select.edit.data.js +63 -1
- package/lib/cjs/components/signature/Signature.js +1 -1
- package/lib/cjs/components/textarea/TextArea.js +1 -1
- package/lib/cjs/formio.form.js +5 -1
- package/lib/cjs/providers/storage/s3.js +29 -1
- package/lib/mjs/Element.js +2 -0
- package/lib/mjs/Form.js +3 -1
- package/lib/mjs/Webform.js +98 -16
- package/lib/mjs/WebformBuilder.js +8 -8
- package/lib/mjs/components/_classes/component/Component.js +25 -8
- package/lib/mjs/components/_classes/componentModal/ComponentModal.js +5 -4
- package/lib/mjs/components/_classes/input/Input.js +1 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +1 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +4 -2
- package/lib/mjs/components/datagrid/DataGrid.js +1 -1
- package/lib/mjs/components/editgrid/EditGrid.js +3 -3
- package/lib/mjs/components/form/Form.js +1 -1
- package/lib/mjs/components/html/HTML.js +2 -2
- package/lib/mjs/components/html/fixtures/comp3.js +38 -0
- package/lib/mjs/components/html/fixtures/index.js +2 -1
- package/lib/mjs/components/radio/Radio.js +29 -10
- package/lib/mjs/components/radio/editForm/Radio.edit.data.js +20 -0
- package/lib/mjs/components/radio/fixtures/comp11.js +83 -0
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/lib/mjs/components/select/Select.js +3 -0
- package/lib/mjs/components/select/editForm/Select.edit.data.js +59 -1
- package/lib/mjs/components/signature/Signature.js +1 -1
- package/lib/mjs/components/textarea/TextArea.js +1 -1
- package/lib/mjs/formio.form.js +3 -1
- package/lib/mjs/providers/storage/s3.js +6 -1
- package/package.json +7 -8
- package/types/builders.d.ts +0 -7
- package/types/components/_classes/component/component.d.ts +0 -175
- package/types/components/_classes/componentmodal/componentmodal.d.ts +0 -31
- package/types/components/_classes/field/field.d.ts +0 -5
- package/types/components/_classes/input/input.d.ts +0 -30
- package/types/components/_classes/multivalue/multivalue.d.ts +0 -16
- package/types/components/_classes/nested/nestedComponent.d.ts +0 -61
- package/types/components/_classes/widgetcomponent/widgetComponent.d.ts +0 -6
- package/types/components/components.d.ts +0 -69
- package/types/components/schema.d.ts +0 -174
- package/types/displays.d.ts +0 -7
- package/types/element.d.ts +0 -45
- package/types/eventEmitter.d.ts +0 -3
- package/types/form.d.ts +0 -18
- package/types/formbuilder.d.ts +0 -6
- package/types/formio.d.ts +0 -1236
- package/types/index.d.ts +0 -18
- package/types/licenses.d.ts +0 -7
- package/types/providers.d.ts +0 -8
- package/types/rulesEngine/conjunctions.d.ts +0 -7
- package/types/rulesEngine/operators.d.ts +0 -7
- package/types/rulesEngine/quckRules.d.ts +0 -7
- package/types/rulesEngine/rules.d.ts +0 -7
- package/types/rulesEngine/transformers.d.ts +0 -7
- package/types/rulesEngine/valueSources.d.ts +0 -7
- package/types/templates.d.ts +0 -8
- package/types/utils.d.ts +0 -157
- package/types/widgets.d.ts +0 -4
@@ -3,6 +3,7 @@ import _ from 'lodash';
|
|
3
3
|
import Field from '../field/Field';
|
4
4
|
import Components from '../../Components';
|
5
5
|
import { getArrayFromComponentPath, getStringFromComponentPath, getRandomComponentId } from '../../../utils/utils';
|
6
|
+
import Component from '../component/Component';
|
6
7
|
import { process as processAsync, processSync } from '@formio/core/process';
|
7
8
|
export default class NestedComponent extends Field {
|
8
9
|
static schema(...extend) {
|
@@ -184,8 +185,9 @@ export default class NestedComponent extends Field {
|
|
184
185
|
* component tree.
|
185
186
|
*
|
186
187
|
* @param {string} key - The key of the component to retrieve.
|
187
|
-
* @param {function} fn - Called with the component once found.
|
188
|
-
* @
|
188
|
+
* @param {function} [fn] - Called with the component once found.
|
189
|
+
* @param {string} [originalPath] - The original path to the component.
|
190
|
+
* @return {Component} - The component that is located.
|
189
191
|
*/
|
190
192
|
getComponent(path, fn, originalPath) {
|
191
193
|
originalPath = originalPath || getStringFromComponentPath(path);
|
@@ -260,7 +260,7 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
260
260
|
loadRefs(element, refs) {
|
261
261
|
super.loadRefs(element, refs);
|
262
262
|
if (refs['messageContainer'] === 'single') {
|
263
|
-
const container = _.last(element.querySelectorAll(
|
263
|
+
const container = _.last(element.querySelectorAll(`[${this._referenceAttributeName}=messageContainer]`));
|
264
264
|
this.refs['messageContainer'] = container || this.refs['messageContainer'];
|
265
265
|
}
|
266
266
|
}
|
@@ -115,10 +115,10 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
115
115
|
}
|
116
116
|
get defaultDialogTemplate() {
|
117
117
|
return `
|
118
|
-
<h3
|
118
|
+
<h3 ${this._referenceAttributeName}="dialogHeader">${this.t('Do you want to clear data?')}</h3>
|
119
119
|
<div style="display:flex; justify-content: flex-end;">
|
120
|
-
<button
|
121
|
-
<button
|
120
|
+
<button ${this._referenceAttributeName}="dialogCancelButton" class="btn btn-secondary" aria-label="${this.t('Cancel')}">${this.t('Cancel')}</button>
|
121
|
+
<button ${this._referenceAttributeName}="dialogYesButton" class="btn btn-danger" aria-label="${this.t('Yes, delete it')}">${this.t('Yes, delete it')}</button>
|
122
122
|
</div>
|
123
123
|
`;
|
124
124
|
}
|
@@ -290,7 +290,7 @@ export default class FormComponent extends Component {
|
|
290
290
|
if (!this.builderMode && this.component.modalEdit) {
|
291
291
|
const modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;
|
292
292
|
const currentValue = modalShouldBeOpened ? this.componentModal.currentValue : this.dataValue;
|
293
|
-
this.componentModal = new ComponentModal(this, element, modalShouldBeOpened, currentValue);
|
293
|
+
this.componentModal = new ComponentModal(this, element, modalShouldBeOpened, currentValue, this._referenceAttributeName);
|
294
294
|
this.setOpenModalElement();
|
295
295
|
}
|
296
296
|
this.calculateValue();
|
@@ -38,13 +38,13 @@ export default class HTMLComponent extends Component {
|
|
38
38
|
return ` ${this.component.content} `;
|
39
39
|
}
|
40
40
|
const submission = _.get(this.root, 'submission', {});
|
41
|
-
const content = this.component.content ? this.interpolate(this.component.content, {
|
41
|
+
const content = this.component.content ? this.interpolate(this.sanitize(this.component.content, this.shouldSanitizeValue), {
|
42
42
|
metadata: submission.metadata || {},
|
43
43
|
submission: submission,
|
44
44
|
data: this.rootValue,
|
45
45
|
row: this.data
|
46
46
|
}) : '';
|
47
|
-
return
|
47
|
+
return content;
|
48
48
|
}
|
49
49
|
get singleTags() {
|
50
50
|
return ['br', 'img', 'hr'];
|
@@ -0,0 +1,38 @@
|
|
1
|
+
export default {
|
2
|
+
type: 'form',
|
3
|
+
display: 'form',
|
4
|
+
components: [
|
5
|
+
{
|
6
|
+
label: 'Text Field',
|
7
|
+
applyMaskOn: 'change',
|
8
|
+
tableView: true,
|
9
|
+
key: 'textField',
|
10
|
+
type: 'textfield',
|
11
|
+
input: true,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
label: 'HTML',
|
15
|
+
attrs: [
|
16
|
+
{
|
17
|
+
attr: '',
|
18
|
+
value: '',
|
19
|
+
},
|
20
|
+
],
|
21
|
+
content: '<img src=1 onerror=alert("htmlContent")>\n<div class="myClass {{data.textField + \'-class\'}}">{{' +
|
22
|
+
' data.textField ? data.textField : \'No Text\'}}</div>',
|
23
|
+
refreshOnChange: true,
|
24
|
+
key: 'html',
|
25
|
+
type: 'htmlelement',
|
26
|
+
input: false,
|
27
|
+
tableView: false,
|
28
|
+
},
|
29
|
+
{
|
30
|
+
type: 'button',
|
31
|
+
label: 'Submit',
|
32
|
+
key: 'submit',
|
33
|
+
disableOnInvalid: true,
|
34
|
+
input: true,
|
35
|
+
tableView: false,
|
36
|
+
},
|
37
|
+
],
|
38
|
+
};
|
@@ -166,7 +166,8 @@ export default class RadioComponent extends ListComponent {
|
|
166
166
|
dataValue = _.toString(this.dataValue);
|
167
167
|
}
|
168
168
|
if (this.isSelectURL && _.isObject(this.loadedOptions[index].value)) {
|
169
|
-
|
169
|
+
const optionValue = this.component.dataType === 'string' ? JSON.stringify(this.loadedOptions[index].value) : this.loadedOptions[index].value;
|
170
|
+
input.checked = _.isEqual(optionValue, this.dataValue);
|
170
171
|
}
|
171
172
|
else {
|
172
173
|
input.checked = (dataValue === input.value && (input.value || this.component.dataSrc !== 'url'));
|
@@ -362,18 +363,36 @@ export default class RadioComponent extends ListComponent {
|
|
362
363
|
* @return {*}
|
363
364
|
*/
|
364
365
|
normalizeValue(value) {
|
366
|
+
const dataType = this.component.dataType || 'auto';
|
365
367
|
if (value === this.emptyValue) {
|
366
368
|
return value;
|
367
369
|
}
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
370
|
+
switch (dataType) {
|
371
|
+
case 'auto':
|
372
|
+
if (!isNaN(parseFloat(value)) && isFinite(value) && _.toString(value) === Number(value).toString()) {
|
373
|
+
value = +value;
|
374
|
+
}
|
375
|
+
if (value === 'true') {
|
376
|
+
value = true;
|
377
|
+
}
|
378
|
+
if (value === 'false') {
|
379
|
+
value = false;
|
380
|
+
}
|
381
|
+
break;
|
382
|
+
case 'number':
|
383
|
+
value = +value;
|
384
|
+
break;
|
385
|
+
case 'string':
|
386
|
+
if (typeof value === 'object') {
|
387
|
+
value = JSON.stringify(value);
|
388
|
+
}
|
389
|
+
else {
|
390
|
+
value = String(value);
|
391
|
+
}
|
392
|
+
break;
|
393
|
+
case 'boolean':
|
394
|
+
value = !(!value || value.toString() === 'false');
|
395
|
+
break;
|
377
396
|
}
|
378
397
|
if (this.isSelectURL && this.templateData && this.templateData[value]) {
|
379
398
|
const submission = this.root.submission;
|
@@ -71,6 +71,26 @@ export default [
|
|
71
71
|
json: { '===': [{ var: 'data.dataSrc' }, 'values'] },
|
72
72
|
},
|
73
73
|
},
|
74
|
+
{
|
75
|
+
type: 'select',
|
76
|
+
input: true,
|
77
|
+
label: 'Storage Type',
|
78
|
+
key: 'dataType',
|
79
|
+
clearOnHide: true,
|
80
|
+
tooltip: 'The type to store the data. If you select something other than autotype, it will force it to that type.',
|
81
|
+
weight: 12,
|
82
|
+
template: '<span>{{ item.label }}</span>',
|
83
|
+
dataSrc: 'values',
|
84
|
+
data: {
|
85
|
+
values: [
|
86
|
+
{ label: 'Autotype', value: 'auto' },
|
87
|
+
{ label: 'String', value: 'string' },
|
88
|
+
{ label: 'Number', value: 'number' },
|
89
|
+
{ label: 'Boolean', value: 'boolean' },
|
90
|
+
{ label: 'Object', value: 'object' },
|
91
|
+
],
|
92
|
+
},
|
93
|
+
},
|
74
94
|
{
|
75
95
|
key: 'template',
|
76
96
|
conditional: {
|
@@ -0,0 +1,83 @@
|
|
1
|
+
export default {
|
2
|
+
title: 'Test',
|
3
|
+
name: 'test',
|
4
|
+
path: 'test',
|
5
|
+
type: 'form',
|
6
|
+
display: 'form',
|
7
|
+
components: [
|
8
|
+
{
|
9
|
+
label: 'Radio',
|
10
|
+
optionsLabelPosition: 'right',
|
11
|
+
inline: false,
|
12
|
+
tableView: false,
|
13
|
+
values: [
|
14
|
+
{
|
15
|
+
label: '0',
|
16
|
+
value: '0',
|
17
|
+
shortcut: ''
|
18
|
+
},
|
19
|
+
{
|
20
|
+
label: '1',
|
21
|
+
value: '1',
|
22
|
+
shortcut: ''
|
23
|
+
}
|
24
|
+
],
|
25
|
+
key: 'radioNumber',
|
26
|
+
type: 'radio',
|
27
|
+
dataType: 'number',
|
28
|
+
input: true
|
29
|
+
},
|
30
|
+
{
|
31
|
+
label: 'Radio',
|
32
|
+
optionsLabelPosition: 'right',
|
33
|
+
inline: false,
|
34
|
+
tableView: false,
|
35
|
+
values: [
|
36
|
+
{
|
37
|
+
label: '0',
|
38
|
+
value: '0',
|
39
|
+
shortcut: ''
|
40
|
+
},
|
41
|
+
{
|
42
|
+
label: '1',
|
43
|
+
value: '1',
|
44
|
+
shortcut: ''
|
45
|
+
}
|
46
|
+
],
|
47
|
+
key: 'radioString',
|
48
|
+
dataType: 'string',
|
49
|
+
type: 'radio',
|
50
|
+
input: true
|
51
|
+
},
|
52
|
+
{
|
53
|
+
label: 'Radio',
|
54
|
+
optionsLabelPosition: 'right',
|
55
|
+
inline: false,
|
56
|
+
tableView: false,
|
57
|
+
values: [
|
58
|
+
{
|
59
|
+
label: 'true',
|
60
|
+
value: 'true',
|
61
|
+
shortcut: ''
|
62
|
+
},
|
63
|
+
{
|
64
|
+
label: 'false',
|
65
|
+
value: 'false',
|
66
|
+
shortcut: ''
|
67
|
+
}
|
68
|
+
],
|
69
|
+
key: 'radioBoolean',
|
70
|
+
dataType: 'boolean',
|
71
|
+
type: 'radio',
|
72
|
+
input: true
|
73
|
+
},
|
74
|
+
{
|
75
|
+
type: 'button',
|
76
|
+
label: 'Submit',
|
77
|
+
key: 'submit',
|
78
|
+
disableOnInvalid: true,
|
79
|
+
input: true,
|
80
|
+
tableView: false
|
81
|
+
}
|
82
|
+
]
|
83
|
+
};
|
@@ -8,4 +8,5 @@ import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
9
9
|
import comp9 from './comp9';
|
10
10
|
import comp10 from './comp10';
|
11
|
-
|
11
|
+
import comp11 from './comp11';
|
12
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11 };
|
@@ -215,6 +215,9 @@ export default class SelectComponent extends ListComponent {
|
|
215
215
|
}
|
216
216
|
return super.shouldLoad;
|
217
217
|
}
|
218
|
+
get selectData() {
|
219
|
+
return this.component.selectData || super.selectData;
|
220
|
+
}
|
218
221
|
isEntireObjectDisplay() {
|
219
222
|
return this.component.dataSrc === 'resource' && this.valueProperty === 'data';
|
220
223
|
}
|
@@ -1,4 +1,30 @@
|
|
1
|
+
import _ from 'lodash';
|
1
2
|
import { eachComponent } from '../../../utils/utils';
|
3
|
+
const calculateSelectData = (context) => {
|
4
|
+
const { instance, data } = context;
|
5
|
+
const rawDefaultValue = instance.downloadedResources.find(resource => _.get(resource, data.valueProperty) === instance.getValue());
|
6
|
+
const options = { data: {}, noeval: true };
|
7
|
+
instance.interpolate(data.template, {
|
8
|
+
item: rawDefaultValue,
|
9
|
+
}, options);
|
10
|
+
return options.data.item;
|
11
|
+
};
|
12
|
+
const setSelectData = (context) => {
|
13
|
+
// Wait before downloadedResources will be set
|
14
|
+
setTimeout(() => {
|
15
|
+
const { instance, data } = context;
|
16
|
+
const selectDataComponent = instance?.root.getComponent('selectData');
|
17
|
+
// nothing can set if don't have downloaded resources
|
18
|
+
if (!selectDataComponent || !instance.getValue() || !instance.downloadedResources?.length) {
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
// if valueProperty is not provided, we have entire object
|
22
|
+
const shouldCalculateUrlData = data.dataSrc === 'url' && data.data.url && data.valueProperty;
|
23
|
+
const shouldCalculateResourceData = data.dataSrc === 'resource' && data.data.resource && data.valueProperty;
|
24
|
+
const newValue = shouldCalculateUrlData || shouldCalculateResourceData ? calculateSelectData(context) : undefined;
|
25
|
+
selectDataComponent.setValue(newValue);
|
26
|
+
}, 0);
|
27
|
+
};
|
2
28
|
export default [
|
3
29
|
{
|
4
30
|
key: 'dataSrc',
|
@@ -623,5 +649,37 @@ export default [
|
|
623
649
|
key: 'useExactSearch',
|
624
650
|
label: 'Use exact search',
|
625
651
|
tooltip: 'Disables search algorithm threshold.',
|
626
|
-
}
|
652
|
+
},
|
653
|
+
{
|
654
|
+
key: 'defaultValue',
|
655
|
+
onSetItems(component) {
|
656
|
+
setSelectData(component.evalContext());
|
657
|
+
},
|
658
|
+
onChange(context) {
|
659
|
+
if (context && context.flags && context.flags.modified) {
|
660
|
+
setSelectData(context);
|
661
|
+
}
|
662
|
+
},
|
663
|
+
},
|
664
|
+
{
|
665
|
+
key: 'selectData',
|
666
|
+
conditional: {
|
667
|
+
json: { 'and': [
|
668
|
+
{ '!==': [{ var: 'data.valueProperty' }, null] },
|
669
|
+
{ '!==': [{ var: 'data.valueProperty' }, ''] },
|
670
|
+
] },
|
671
|
+
},
|
672
|
+
},
|
673
|
+
{
|
674
|
+
key: 'template',
|
675
|
+
onChange(context) {
|
676
|
+
if (context && context.flags && context.flags.modified) {
|
677
|
+
const defaultValueComponent = context.instance.root.getComponent('defaultValue');
|
678
|
+
if (!defaultValueComponent) {
|
679
|
+
return;
|
680
|
+
}
|
681
|
+
setSelectData(defaultValueComponent.evalContext());
|
682
|
+
}
|
683
|
+
},
|
684
|
+
},
|
627
685
|
];
|
@@ -171,7 +171,7 @@ export default class SignatureComponent extends Input {
|
|
171
171
|
getModalPreviewTemplate() {
|
172
172
|
return this.renderTemplate('modalPreview', {
|
173
173
|
previewText: this.dataValue ?
|
174
|
-
`<img src=${this.dataValue}
|
174
|
+
`<img src=${this.dataValue} ${this._referenceAttributeName}='openModal' style="width: 100%;height: 100%;" />` :
|
175
175
|
this.t('Click to Sign')
|
176
176
|
});
|
177
177
|
}
|
@@ -57,7 +57,7 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
57
57
|
info.content = value;
|
58
58
|
if ((this.options.readOnly || this.disabled) && !this.isHtmlRenderMode()) {
|
59
59
|
const elementStyle = this.info.attr.style || '';
|
60
|
-
const children = `<div
|
60
|
+
const children = `<div ${this._referenceAttributeName}="input" class="formio-editor-read-only-content" ${elementStyle ? `style='${elementStyle}'` : ''}></div>`;
|
61
61
|
return this.renderTemplate('well', {
|
62
62
|
children,
|
63
63
|
nestedKey: this.key,
|
package/lib/mjs/formio.form.js
CHANGED
@@ -10,6 +10,8 @@ import Form from './Form';
|
|
10
10
|
import Utils from './utils';
|
11
11
|
import Evaluator from './utils/Evaluator';
|
12
12
|
import Licenses from './licenses';
|
13
|
+
import EventEmitter from './EventEmitter';
|
14
|
+
import Webform from './Webform';
|
13
15
|
Formio.loadModules = (path = `${Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {
|
14
16
|
Formio.requireLibrary(name, name, path, true)
|
15
17
|
.then((modules) => {
|
@@ -116,4 +118,4 @@ export function useModule(defaultFn = null) {
|
|
116
118
|
*/
|
117
119
|
Formio.use = useModule();
|
118
120
|
// Export the components.
|
119
|
-
export { Components, Displays, Providers, Widgets, Templates, Utils, Form, Formio, Licenses };
|
121
|
+
export { Components, Displays, Providers, Widgets, Templates, Utils, Form, Formio, Licenses, EventEmitter, Webform };
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import XHR from './xhr';
|
2
2
|
import { withRetries } from './util';
|
3
|
-
const
|
3
|
+
const loadAbortControllerPolyfill = async () => {
|
4
|
+
if (typeof AbortController === 'undefined') {
|
5
|
+
await import('abortcontroller-polyfill/dist/polyfill-patch-fetch');
|
6
|
+
}
|
7
|
+
};
|
4
8
|
function s3(formio) {
|
5
9
|
return {
|
6
10
|
async uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions) {
|
@@ -10,6 +14,7 @@ function s3(formio) {
|
|
10
14
|
if (response.signed) {
|
11
15
|
if (multipartOptions && Array.isArray(response.signed)) {
|
12
16
|
// patch abort callback
|
17
|
+
await loadAbortControllerPolyfill();
|
13
18
|
const abortController = new AbortController();
|
14
19
|
const abortSignal = abortController.signal;
|
15
20
|
if (typeof abortCallback === 'function') {
|
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.44",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -29,7 +29,6 @@
|
|
29
29
|
},
|
30
30
|
"./dist/*": "./dist/*"
|
31
31
|
},
|
32
|
-
"types": "index.d.ts",
|
33
32
|
"files": [
|
34
33
|
"dist",
|
35
34
|
"lib",
|
@@ -84,9 +83,9 @@
|
|
84
83
|
},
|
85
84
|
"homepage": "https://github.com/formio/formio.js#readme",
|
86
85
|
"dependencies": {
|
87
|
-
"@formio/bootstrap": "^3.0.0-rc.
|
86
|
+
"@formio/bootstrap": "^3.0.0-rc.24",
|
88
87
|
"@formio/choices.js": "^10.2.1",
|
89
|
-
"@formio/core": "^2.1.0-dev.tt.
|
88
|
+
"@formio/core": "^2.1.0-dev.tt.3",
|
90
89
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
91
90
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
92
91
|
"abortcontroller-polyfill": "^1.7.5",
|
@@ -114,7 +113,7 @@
|
|
114
113
|
"lodash": "^4.17.21",
|
115
114
|
"moment": "^2.29.4",
|
116
115
|
"moment-timezone": "^0.5.44",
|
117
|
-
"quill": "^2.0.0
|
116
|
+
"quill": "^2.0.0",
|
118
117
|
"signature_pad": "^4.2.0",
|
119
118
|
"string-hash": "^1.1.3",
|
120
119
|
"tippy.js": "^6.3.7",
|
@@ -122,9 +121,9 @@
|
|
122
121
|
"vanilla-picker": "^2.12.3"
|
123
122
|
},
|
124
123
|
"devDependencies": {
|
125
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
126
|
-
"@typescript-eslint/parser": "^7.
|
127
|
-
"ace-builds": "1.33.
|
124
|
+
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
125
|
+
"@typescript-eslint/parser": "^7.7.1",
|
126
|
+
"ace-builds": "1.33.1",
|
128
127
|
"async-limiter": "^2.0.0",
|
129
128
|
"bootstrap-icons": "^1.10.5",
|
130
129
|
"bootswatch": "^5.3.3",
|
package/types/builders.d.ts
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
import { Element } from '../../../element';
|
2
|
-
import { ValidateOptions } from '../../../formio';
|
3
|
-
import { ComponentSchema, ElementInfo, ExtendedComponentSchema } from './../../schema.d';
|
4
|
-
|
5
|
-
export class Component extends Element {
|
6
|
-
static schema(sources: ExtendedComponentSchema): ExtendedComponentSchema;
|
7
|
-
static tableView(value: any, options: any): void;
|
8
|
-
constructor(component: any, options: Object, data: Object);
|
9
|
-
public originalComponent: any | Component;
|
10
|
-
public refs: Object;
|
11
|
-
public attached: boolean;
|
12
|
-
public rendered: boolean;
|
13
|
-
public data: Object;
|
14
|
-
public component: any;
|
15
|
-
public error: string;
|
16
|
-
public tooltip: string;
|
17
|
-
public row: any;
|
18
|
-
public pristine: boolean;
|
19
|
-
public parent: any;
|
20
|
-
public root: any;
|
21
|
-
public lastChanged: any;
|
22
|
-
public triggerRedraw: Function;
|
23
|
-
public tooltips: any[];
|
24
|
-
public invalid: boolean;
|
25
|
-
public isBuilt: boolean;
|
26
|
-
readonly ready: any;
|
27
|
-
readonly labelInfo: any;
|
28
|
-
init(): void;
|
29
|
-
destroy(): void;
|
30
|
-
readonly shouldDisabled: any | boolean;
|
31
|
-
readonly isInputComponent: boolean;
|
32
|
-
readonly defaultSchema: ComponentSchema;
|
33
|
-
readonly hasInput: boolean;
|
34
|
-
readonly key: any;
|
35
|
-
public parentVisible: any | boolean;
|
36
|
-
public parentDisabled: any | boolean;
|
37
|
-
public visible: any | boolean;
|
38
|
-
public currentForm: any;
|
39
|
-
readonly fullMode: boolean;
|
40
|
-
readonly builderMode: boolean;
|
41
|
-
getModifiedSchema(
|
42
|
-
schema: ExtendedComponentSchema,
|
43
|
-
defaultSchema: ComponentSchema,
|
44
|
-
recursion: boolean,
|
45
|
-
): ExtendedComponentSchema;
|
46
|
-
readonly schema: ExtendedComponentSchema;
|
47
|
-
t(text: string, params?: Object): any;
|
48
|
-
labelIsHidden(): boolean;
|
49
|
-
readonly transform: any;
|
50
|
-
getTemplate(names: any, modes: any): any;
|
51
|
-
checkTemplate(templates: any, names: any, modes: any): any;
|
52
|
-
checkTemplateMode(templatesByName: any, modes: any): any;
|
53
|
-
renderTemplate(name: any, data: any, modeOption?: any[]): any;
|
54
|
-
sanitize(dirty: string): any;
|
55
|
-
renderString(template: any, data: any): HTMLElement;
|
56
|
-
performInputMapping(input: any): any;
|
57
|
-
getBrowserLanguage(): string | null;
|
58
|
-
beforeNext(): any;
|
59
|
-
beforePage(): any;
|
60
|
-
beforeSubmit(): any;
|
61
|
-
readonly submissionTimezone: string | any;
|
62
|
-
readonly canDisable: boolean;
|
63
|
-
loadRefs(element: any, refs: any): any;
|
64
|
-
build(element: any): any;
|
65
|
-
render(children: any, topLevel?: boolean): any;
|
66
|
-
attach(element: any): any;
|
67
|
-
addShortcut(element: any, shortcut: any): void;
|
68
|
-
removeShortcut(element: any, shortcut: any): void;
|
69
|
-
detach(): void;
|
70
|
-
attachRefreshEvent(refreshData: any): void;
|
71
|
-
attachRefreshOn(): void;
|
72
|
-
refresh(value: any): void;
|
73
|
-
inContext(component: any): boolean;
|
74
|
-
readonly viewOnly: boolean | any;
|
75
|
-
createViewOnlyElement(): HTMLElement;
|
76
|
-
readonly defaultViewOnlyValue: '-';
|
77
|
-
getValueAsString(value: any): string;
|
78
|
-
getView(value: any): string;
|
79
|
-
updateItems(...args: any[]): void;
|
80
|
-
createModal(): HTMLElement;
|
81
|
-
readonly className: string;
|
82
|
-
readonly customStyle: string;
|
83
|
-
getElement(): HTMLElement;
|
84
|
-
evalContext(additional: any): any;
|
85
|
-
setPristine(pristine: boolean): void;
|
86
|
-
removeValue(index: number): void;
|
87
|
-
iconClass(name: any, spinning: any): any;
|
88
|
-
readonly name: string;
|
89
|
-
readonly errorLabel: string;
|
90
|
-
errorMessage(type: any): any;
|
91
|
-
setContent(element: any, content: any): boolean;
|
92
|
-
redraw(): any;
|
93
|
-
rebuild(): any;
|
94
|
-
removeEventListeners(): void;
|
95
|
-
hasClass(element: any, className: string): any;
|
96
|
-
addClass(element: any, className: string): any;
|
97
|
-
removeClass(element: any, className: string): any;
|
98
|
-
hasCondition(): boolean;
|
99
|
-
conditionallyVisible(data: any): boolean;
|
100
|
-
checkCondition(row: any, data: Object): boolean;
|
101
|
-
checkConditions(data: any): any;
|
102
|
-
readonly logic: any[];
|
103
|
-
fieldLogic(data: any): any;
|
104
|
-
applyActions(actions: any[], result: any, data: any, newComponent: any): boolean;
|
105
|
-
addInputError(message: any, dirty: boolean): void;
|
106
|
-
clearOnHide(show: boolean): void;
|
107
|
-
onChange(flags: Object, fromRoot: boolean): void;
|
108
|
-
readonly wysiwygDefault: {
|
109
|
-
theme: string;
|
110
|
-
placeholder: any | string;
|
111
|
-
modules: {
|
112
|
-
clipboard: {
|
113
|
-
matchVisual: boolean;
|
114
|
-
};
|
115
|
-
toolbar: any[];
|
116
|
-
};
|
117
|
-
};
|
118
|
-
addCKE(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any;
|
119
|
-
addQuill(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any;
|
120
|
-
addAce(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any;
|
121
|
-
readonly emptyValue: null;
|
122
|
-
hasValue(data: Object): boolean;
|
123
|
-
readonly rootValue: any;
|
124
|
-
readonly rootPristine: any;
|
125
|
-
public dataValue: any;
|
126
|
-
splice(index: number | string): void;
|
127
|
-
deleteValue(): void;
|
128
|
-
readonly defaultValue: any;
|
129
|
-
getValue(): any;
|
130
|
-
getValueAt(index: number): any;
|
131
|
-
setValue(value: any, flags: any): boolean;
|
132
|
-
setValueAt(index: number, value: any, flags: any): void;
|
133
|
-
readonly hasSetValue: boolean;
|
134
|
-
restoreValue(): void;
|
135
|
-
normalizeValue(value: any): any;
|
136
|
-
getIcon(name: any | string, content: any, styles: any, ref?: string): any | HTMLElement;
|
137
|
-
resetValue(): void;
|
138
|
-
hasChanged(before: any, after: any): boolean;
|
139
|
-
updateOnChange(flags: any, changed: boolean | any): boolean;
|
140
|
-
calculateValue(data: Object, flags: any): boolean;
|
141
|
-
public label: any | string;
|
142
|
-
getRoot(): Component;
|
143
|
-
invalidMessage(data: any, dirty: boolean, ignoreCondition?: boolean): any;
|
144
|
-
isValid(data: any, dirty: boolean): boolean;
|
145
|
-
checkValidity(data: any, dirty: any | boolean, rowData: any): boolean;
|
146
|
-
readonly validationValue: any;
|
147
|
-
isEmpty(value: any): boolean;
|
148
|
-
validateMultiple(): boolean;
|
149
|
-
readonly errors: any[];
|
150
|
-
setCustomValidity(message: any, dirty: any): void;
|
151
|
-
shouldSkipValidation(data: any, dirty: any, rowData: any): boolean;
|
152
|
-
whenReady(): any | Promise<any>;
|
153
|
-
readonly dataReady: any | Promise<any>;
|
154
|
-
asString(value: any): string;
|
155
|
-
public disabled: boolean;
|
156
|
-
setDisabled(element: any, disabled: any | boolean): void;
|
157
|
-
setLoading(element: any, loading: any | boolean): void;
|
158
|
-
selectOptions(select: any, tag: any, options: any, defaultValue: any): void;
|
159
|
-
setSelectValue(select: any, value: any): void;
|
160
|
-
clear(): any;
|
161
|
-
append(element: HTMLElement): void;
|
162
|
-
prepend(element: HTMLElement): void;
|
163
|
-
removeChild(element: HTMLElement): void;
|
164
|
-
attachLogic(): void;
|
165
|
-
elementInfo(): ElementInfo;
|
166
|
-
autofocus(): void;
|
167
|
-
focus(): void;
|
168
|
-
readonly shouldDisable: boolean;
|
169
|
-
readonly info: ElementInfo;
|
170
|
-
public element: any;
|
171
|
-
public validators: (keyof ValidateOptions)[];
|
172
|
-
public calculatedValue: any;
|
173
|
-
public options: any;
|
174
|
-
public labelElement: any;
|
175
|
-
}
|