@formio/js 5.0.0-rc.84 → 5.0.0-rc.85
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 +8 -8
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +8 -8
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +3 -3
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +2 -2
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/cjs/components/_classes/component/Component.js +2 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +4 -1
- package/lib/cjs/components/radio/Radio.js +7 -6
- package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
- package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/mjs/components/_classes/component/Component.js +2 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +3 -1
- package/lib/mjs/components/radio/Radio.js +7 -6
- package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
- package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/package.json +2 -2
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
|
22
22
|
|
23
|
-
/*! formiojs v5.0.0-rc.
|
23
|
+
/*! formiojs v5.0.0-rc.85 | https://unpkg.com/formiojs@5.0.0-rc.85/LICENSE.txt */
|
24
24
|
|
25
25
|
/**
|
26
26
|
* @license
|
package/lib/cjs/Wizard.js
CHANGED
@@ -715,7 +715,7 @@ class Wizard extends Webform_1.default {
|
|
715
715
|
}
|
716
716
|
else {
|
717
717
|
this.currentPage.components.forEach((comp) => comp.setPristine(false));
|
718
|
-
this.scrollIntoView(this.element);
|
718
|
+
this.scrollIntoView(this.element, true);
|
719
719
|
return Promise.reject(this.showErrors(errors, true));
|
720
720
|
}
|
721
721
|
}
|
@@ -1061,7 +1061,7 @@ declare class Component extends Element {
|
|
1061
1061
|
*/
|
1062
1062
|
elementInfo(): any;
|
1063
1063
|
autofocus(): void;
|
1064
|
-
scrollIntoView(element
|
1064
|
+
scrollIntoView(element: any, verticalOnly: any): void;
|
1065
1065
|
focus(index?: number): void;
|
1066
1066
|
/**
|
1067
1067
|
* Get `Formio` instance for working with files
|
@@ -3421,12 +3421,12 @@ class Component extends Element_1.default {
|
|
3421
3421
|
this.on('render', () => this.focus(), true);
|
3422
3422
|
}
|
3423
3423
|
}
|
3424
|
-
scrollIntoView(element = this.element) {
|
3424
|
+
scrollIntoView(element = this.element, verticalOnly) {
|
3425
3425
|
if (!element) {
|
3426
3426
|
return;
|
3427
3427
|
}
|
3428
3428
|
const { left, top } = element.getBoundingClientRect();
|
3429
|
-
window.scrollTo(left + window.scrollX, top + window.scrollY);
|
3429
|
+
window.scrollTo(verticalOnly ? window.scrollX : left + window.scrollX, top + window.scrollY);
|
3430
3430
|
}
|
3431
3431
|
focus(index = (this.refs.input.length - 1)) {
|
3432
3432
|
var _a, _b;
|
@@ -683,9 +683,12 @@ class NestedComponent extends Field_1.default {
|
|
683
683
|
return this.getComponents().reduce((valid, comp) => comp.isValid(data, dirty) && valid, super.isValid(data, dirty));
|
684
684
|
}
|
685
685
|
validationProcessor({ scope, data, row, instance, component }, flags) {
|
686
|
+
var _a;
|
686
687
|
const { dirty } = flags;
|
687
688
|
if (this.root.hasExtraPages && this.page !== this.root.page) {
|
688
|
-
instance = this.
|
689
|
+
instance = ((_a = this.childComponentsMap) === null || _a === void 0 ? void 0 : _a.hasOwnProperty(component.path))
|
690
|
+
? this.childComponentsMap[component.path]
|
691
|
+
: this.getComponent(component.path);
|
689
692
|
}
|
690
693
|
if (!instance) {
|
691
694
|
return;
|
@@ -286,14 +286,15 @@ class RadioComponent extends ListComponent_1.default {
|
|
286
286
|
setItems(items) {
|
287
287
|
const listData = [];
|
288
288
|
items === null || items === void 0 ? void 0 : items.forEach((item, i) => {
|
289
|
+
const valueAtProperty = lodash_1.default.get(item, this.component.valueProperty);
|
289
290
|
this.loadedOptions[i] = {
|
290
|
-
value: this.component.valueProperty ?
|
291
|
-
label: this.component.valueProperty ? this.itemTemplate(item,
|
291
|
+
value: this.component.valueProperty ? valueAtProperty : item,
|
292
|
+
label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
|
292
293
|
};
|
293
|
-
listData.push(this.templateData[this.component.valueProperty ?
|
294
|
-
if ((this.component.valueProperty || !this.isRadio) && (lodash_1.default.isUndefined(
|
295
|
-
(!this.isRadio && lodash_1.default.isObject(
|
296
|
-
(!this.isRadio && lodash_1.default.isBoolean(
|
294
|
+
listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
|
295
|
+
if ((this.component.valueProperty || !this.isRadio) && (lodash_1.default.isUndefined(valueAtProperty) ||
|
296
|
+
(!this.isRadio && lodash_1.default.isObject(valueAtProperty)) ||
|
297
|
+
(!this.isRadio && lodash_1.default.isBoolean(valueAtProperty)))) {
|
297
298
|
this.loadedOptions[i].invalid = true;
|
298
299
|
}
|
299
300
|
});
|
@@ -0,0 +1,29 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
let components: {
|
3
|
+
label: string;
|
4
|
+
optionsLabelPosition: string;
|
5
|
+
tableView: boolean;
|
6
|
+
dataSrc: string;
|
7
|
+
values: {
|
8
|
+
label: string;
|
9
|
+
value: string;
|
10
|
+
shortcut: string;
|
11
|
+
}[];
|
12
|
+
valueProperty: string;
|
13
|
+
validateWhenHidden: boolean;
|
14
|
+
key: string;
|
15
|
+
type: string;
|
16
|
+
data: {
|
17
|
+
url: string;
|
18
|
+
headers: {
|
19
|
+
key: string;
|
20
|
+
value: string;
|
21
|
+
}[];
|
22
|
+
};
|
23
|
+
template: string;
|
24
|
+
authenticate: boolean;
|
25
|
+
input: boolean;
|
26
|
+
inputType: string;
|
27
|
+
}[];
|
28
|
+
}
|
29
|
+
export default _default;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = {
|
4
|
+
components: [
|
5
|
+
{
|
6
|
+
"label": "Select Boxes",
|
7
|
+
"optionsLabelPosition": "right",
|
8
|
+
"tableView": false,
|
9
|
+
"dataSrc": "url",
|
10
|
+
"values": [
|
11
|
+
{
|
12
|
+
"label": "",
|
13
|
+
"value": "",
|
14
|
+
"shortcut": ""
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"valueProperty": "data.name",
|
18
|
+
"validateWhenHidden": false,
|
19
|
+
"key": "selectBoxes",
|
20
|
+
"type": "selectboxes",
|
21
|
+
"data": {
|
22
|
+
"url": "https://remote-dev.form.io/projectId/name/submission",
|
23
|
+
"headers": [
|
24
|
+
{
|
25
|
+
"key": "",
|
26
|
+
"value": ""
|
27
|
+
}
|
28
|
+
]
|
29
|
+
},
|
30
|
+
"template": "<span>{{ item.data.name }}</span>",
|
31
|
+
"authenticate": true,
|
32
|
+
"input": true,
|
33
|
+
"inputType": "checkbox"
|
34
|
+
}
|
35
|
+
]
|
36
|
+
};
|
@@ -9,4 +9,5 @@ import comp8 from './comp8';
|
|
9
9
|
import comp9 from './comp9';
|
10
10
|
import comp10 from './comp10';
|
11
11
|
import comp11 from './comp11';
|
12
|
-
|
12
|
+
import comp12 from './comp12';
|
13
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
6
|
+
exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
8
8
|
exports.comp1 = comp1_1.default;
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
@@ -26,3 +26,5 @@ const comp10_1 = __importDefault(require("./comp10"));
|
|
26
26
|
exports.comp10 = comp10_1.default;
|
27
27
|
const comp11_1 = __importDefault(require("./comp11"));
|
28
28
|
exports.comp11 = comp11_1.default;
|
29
|
+
const comp12_1 = __importDefault(require("./comp12"));
|
30
|
+
exports.comp12 = comp12_1.default;
|
package/lib/mjs/Wizard.js
CHANGED
@@ -705,7 +705,7 @@ export default class Wizard extends Webform {
|
|
705
705
|
}
|
706
706
|
else {
|
707
707
|
this.currentPage.components.forEach((comp) => comp.setPristine(false));
|
708
|
-
this.scrollIntoView(this.element);
|
708
|
+
this.scrollIntoView(this.element, true);
|
709
709
|
return Promise.reject(this.showErrors(errors, true));
|
710
710
|
}
|
711
711
|
}
|
@@ -1061,7 +1061,7 @@ declare class Component extends Element {
|
|
1061
1061
|
*/
|
1062
1062
|
elementInfo(): any;
|
1063
1063
|
autofocus(): void;
|
1064
|
-
scrollIntoView(element
|
1064
|
+
scrollIntoView(element: any, verticalOnly: any): void;
|
1065
1065
|
focus(index?: number): void;
|
1066
1066
|
/**
|
1067
1067
|
* Get `Formio` instance for working with files
|
@@ -3386,12 +3386,12 @@ export default class Component extends Element {
|
|
3386
3386
|
this.on('render', () => this.focus(), true);
|
3387
3387
|
}
|
3388
3388
|
}
|
3389
|
-
scrollIntoView(element = this.element) {
|
3389
|
+
scrollIntoView(element = this.element, verticalOnly) {
|
3390
3390
|
if (!element) {
|
3391
3391
|
return;
|
3392
3392
|
}
|
3393
3393
|
const { left, top } = element.getBoundingClientRect();
|
3394
|
-
window.scrollTo(left + window.scrollX, top + window.scrollY);
|
3394
|
+
window.scrollTo(verticalOnly ? window.scrollX : left + window.scrollX, top + window.scrollY);
|
3395
3395
|
}
|
3396
3396
|
focus(index = (this.refs.input.length - 1)) {
|
3397
3397
|
if ('beforeFocus' in this.parent) {
|
@@ -681,7 +681,9 @@ export default class NestedComponent extends Field {
|
|
681
681
|
validationProcessor({ scope, data, row, instance, component }, flags) {
|
682
682
|
const { dirty } = flags;
|
683
683
|
if (this.root.hasExtraPages && this.page !== this.root.page) {
|
684
|
-
instance = this.
|
684
|
+
instance = this.childComponentsMap?.hasOwnProperty(component.path)
|
685
|
+
? this.childComponentsMap[component.path]
|
686
|
+
: this.getComponent(component.path);
|
685
687
|
}
|
686
688
|
if (!instance) {
|
687
689
|
return;
|
@@ -286,14 +286,15 @@ export default class RadioComponent extends ListComponent {
|
|
286
286
|
setItems(items) {
|
287
287
|
const listData = [];
|
288
288
|
items?.forEach((item, i) => {
|
289
|
+
const valueAtProperty = _.get(item, this.component.valueProperty);
|
289
290
|
this.loadedOptions[i] = {
|
290
|
-
value: this.component.valueProperty ?
|
291
|
-
label: this.component.valueProperty ? this.itemTemplate(item,
|
291
|
+
value: this.component.valueProperty ? valueAtProperty : item,
|
292
|
+
label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
|
292
293
|
};
|
293
|
-
listData.push(this.templateData[this.component.valueProperty ?
|
294
|
-
if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(
|
295
|
-
(!this.isRadio && _.isObject(
|
296
|
-
(!this.isRadio && _.isBoolean(
|
294
|
+
listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
|
295
|
+
if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(valueAtProperty) ||
|
296
|
+
(!this.isRadio && _.isObject(valueAtProperty)) ||
|
297
|
+
(!this.isRadio && _.isBoolean(valueAtProperty)))) {
|
297
298
|
this.loadedOptions[i].invalid = true;
|
298
299
|
}
|
299
300
|
});
|
@@ -0,0 +1,29 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
let components: {
|
3
|
+
label: string;
|
4
|
+
optionsLabelPosition: string;
|
5
|
+
tableView: boolean;
|
6
|
+
dataSrc: string;
|
7
|
+
values: {
|
8
|
+
label: string;
|
9
|
+
value: string;
|
10
|
+
shortcut: string;
|
11
|
+
}[];
|
12
|
+
valueProperty: string;
|
13
|
+
validateWhenHidden: boolean;
|
14
|
+
key: string;
|
15
|
+
type: string;
|
16
|
+
data: {
|
17
|
+
url: string;
|
18
|
+
headers: {
|
19
|
+
key: string;
|
20
|
+
value: string;
|
21
|
+
}[];
|
22
|
+
};
|
23
|
+
template: string;
|
24
|
+
authenticate: boolean;
|
25
|
+
input: boolean;
|
26
|
+
inputType: string;
|
27
|
+
}[];
|
28
|
+
}
|
29
|
+
export default _default;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
export default {
|
2
|
+
components: [
|
3
|
+
{
|
4
|
+
"label": "Select Boxes",
|
5
|
+
"optionsLabelPosition": "right",
|
6
|
+
"tableView": false,
|
7
|
+
"dataSrc": "url",
|
8
|
+
"values": [
|
9
|
+
{
|
10
|
+
"label": "",
|
11
|
+
"value": "",
|
12
|
+
"shortcut": ""
|
13
|
+
}
|
14
|
+
],
|
15
|
+
"valueProperty": "data.name",
|
16
|
+
"validateWhenHidden": false,
|
17
|
+
"key": "selectBoxes",
|
18
|
+
"type": "selectboxes",
|
19
|
+
"data": {
|
20
|
+
"url": "https://remote-dev.form.io/projectId/name/submission",
|
21
|
+
"headers": [
|
22
|
+
{
|
23
|
+
"key": "",
|
24
|
+
"value": ""
|
25
|
+
}
|
26
|
+
]
|
27
|
+
},
|
28
|
+
"template": "<span>{{ item.data.name }}</span>",
|
29
|
+
"authenticate": true,
|
30
|
+
"input": true,
|
31
|
+
"inputType": "checkbox"
|
32
|
+
}
|
33
|
+
]
|
34
|
+
};
|
@@ -9,4 +9,5 @@ import comp8 from './comp8';
|
|
9
9
|
import comp9 from './comp9';
|
10
10
|
import comp10 from './comp10';
|
11
11
|
import comp11 from './comp11';
|
12
|
-
|
12
|
+
import comp12 from './comp12';
|
13
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
|
@@ -9,4 +9,5 @@ import comp8 from './comp8';
|
|
9
9
|
import comp9 from './comp9';
|
10
10
|
import comp10 from './comp10';
|
11
11
|
import comp11 from './comp11';
|
12
|
-
|
12
|
+
import comp12 from './comp12';
|
13
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
|
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.85",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"dependencies": {
|
82
82
|
"@formio/bootstrap": "3.0.0-rc.37",
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
84
|
-
"@formio/core": "2.3.0-rc.
|
84
|
+
"@formio/core": "2.3.0-rc.4",
|
85
85
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|