@formio/js 5.2.0-rc.5 → 5.2.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +7 -7
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +7 -7
- 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 +3 -3
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/components/button/Button.d.ts +1 -1
- package/lib/cjs/components/button/Button.js +4 -4
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -1
- package/lib/cjs/components/datamap/DataMap.js +4 -4
- package/lib/cjs/utils/Evaluator.d.ts +7 -1
- package/lib/cjs/utils/Evaluator.js +10 -1
- package/lib/cjs/utils/index.d.ts +8 -1
- package/lib/cjs/utils/index.js +10 -1
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/components/button/Button.d.ts +1 -1
- package/lib/mjs/components/button/Button.js +1 -1
- package/lib/mjs/components/datamap/DataMap.d.ts +1 -1
- package/lib/mjs/components/datamap/DataMap.js +1 -1
- package/lib/mjs/utils/Evaluator.d.ts +7 -1
- package/lib/mjs/utils/Evaluator.js +9 -1
- package/lib/mjs/utils/index.d.ts +8 -1
- package/lib/mjs/utils/index.js +7 -1
- package/package.json +2 -2
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
|
22
22
|
|
23
|
-
/*! formiojs v5.2.0-rc.
|
23
|
+
/*! formiojs v5.2.0-rc.7 | https://unpkg.com/formiojs@5.2.0-rc.7/LICENSE.txt */
|
24
24
|
|
25
25
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
26
26
|
|
package/lib/cjs/Embed.js
CHANGED
@@ -418,7 +418,7 @@ Formio.formioReady = new Promise((ready, reject) => {
|
|
418
418
|
_a._formioReady = ready;
|
419
419
|
_a._formioReadyReject = reject;
|
420
420
|
});
|
421
|
-
Formio.version = '5.2.0-rc.
|
421
|
+
Formio.version = '5.2.0-rc.7';
|
422
422
|
// Create a report.
|
423
423
|
Formio.Report = {
|
424
424
|
create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
package/lib/cjs/Formio.js
CHANGED
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
|
|
11
11
|
const providers_1 = __importDefault(require("./providers"));
|
12
12
|
sdk_1.Formio.cdn = new CDN_1.default();
|
13
13
|
sdk_1.Formio.Providers = providers_1.default;
|
14
|
-
sdk_1.Formio.version = '5.2.0-rc.
|
14
|
+
sdk_1.Formio.version = '5.2.0-rc.7';
|
15
15
|
CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
|
16
16
|
const isNil = (val) => val === null || val === undefined;
|
17
17
|
sdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
|
@@ -7,7 +7,7 @@ export default class ButtonComponent extends Field {
|
|
7
7
|
weight: number;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
-
static savedValueTypes(schema: any):
|
10
|
+
static savedValueTypes(schema: any): string[];
|
11
11
|
constructor(component: any, options: any, data: any);
|
12
12
|
filesUploading: number;
|
13
13
|
get inputInfo(): any;
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
7
|
const Field_1 = __importDefault(require("../_classes/field/Field"));
|
8
8
|
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
9
|
-
const
|
9
|
+
const utils_1 = require("../../utils");
|
10
10
|
class ButtonComponent extends Field_1.default {
|
11
11
|
static schema(...extend) {
|
12
12
|
return Input_1.default.schema({
|
@@ -35,7 +35,7 @@ class ButtonComponent extends Field_1.default {
|
|
35
35
|
};
|
36
36
|
}
|
37
37
|
static savedValueTypes(schema) {
|
38
|
-
return (0,
|
38
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.boolean];
|
39
39
|
}
|
40
40
|
constructor(component, options, data) {
|
41
41
|
super(component, options, data);
|
@@ -306,7 +306,7 @@ class ButtonComponent extends Field_1.default {
|
|
306
306
|
const form = this.getRoot();
|
307
307
|
const flattened = {};
|
308
308
|
const components = {};
|
309
|
-
(0,
|
309
|
+
(0, utils_1.eachComponent)(form.components, (componentWrapper, path) => {
|
310
310
|
const component = componentWrapper.component || componentWrapper;
|
311
311
|
flattened[path] = component;
|
312
312
|
components[component.key] = component;
|
@@ -447,7 +447,7 @@ class ButtonComponent extends Field_1.default {
|
|
447
447
|
}, 100);
|
448
448
|
}
|
449
449
|
get oauthComponentPath() {
|
450
|
-
const pathArray = (0,
|
450
|
+
const pathArray = (0, utils_1.getArrayFromComponentPath)(this.path);
|
451
451
|
return lodash_1.default.chain(pathArray).filter(pathPart => !lodash_1.default.isNumber(pathPart)).join('.').value();
|
452
452
|
}
|
453
453
|
focus() {
|
@@ -7,7 +7,7 @@ const Component_1 = __importDefault(require("../_classes/component/Component"));
|
|
7
7
|
const DataGrid_1 = __importDefault(require("../datagrid/DataGrid"));
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
9
9
|
const eventemitter3_1 = __importDefault(require("eventemitter3"));
|
10
|
-
const
|
10
|
+
const utils_1 = require("../../utils/utils");
|
11
11
|
class DataMapComponent extends DataGrid_1.default {
|
12
12
|
static schema(...extend) {
|
13
13
|
return Component_1.default.schema({
|
@@ -50,7 +50,7 @@ class DataMapComponent extends DataGrid_1.default {
|
|
50
50
|
return lodash_1.default.omit(schema, 'components');
|
51
51
|
}
|
52
52
|
static savedValueTypes(schema) {
|
53
|
-
return (0,
|
53
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
|
54
54
|
}
|
55
55
|
constructor(component, options, data) {
|
56
56
|
super(component, options, data);
|
@@ -149,7 +149,7 @@ class DataMapComponent extends DataGrid_1.default {
|
|
149
149
|
getRowKey(rowIndex) {
|
150
150
|
const keys = Object.keys(this.dataValue);
|
151
151
|
if (!keys[rowIndex]) {
|
152
|
-
keys[rowIndex] = (0,
|
152
|
+
keys[rowIndex] = (0, utils_1.uniqueKey)(this.dataValue, this.defaultRowKey);
|
153
153
|
}
|
154
154
|
return keys[rowIndex];
|
155
155
|
}
|
@@ -232,7 +232,7 @@ class DataMapComponent extends DataGrid_1.default {
|
|
232
232
|
components['__key'] = this.createComponent(this.keySchema, options, { __key: this.builderMode ? this.defaultRowKey : key });
|
233
233
|
components['__key'].on('componentChange', (event) => {
|
234
234
|
const dataValue = this.dataValue;
|
235
|
-
const newKey = (0,
|
235
|
+
const newKey = (0, utils_1.uniqueKey)(dataValue, event.value);
|
236
236
|
dataValue[newKey] = dataValue[key];
|
237
237
|
delete dataValue[key];
|
238
238
|
const comp = components[this.valueKey];
|
@@ -1,3 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* For backwards compatibility we a standalone interpolate function. This merely calls the
|
3
|
+
* global mutable Evaluator instance's interpolate function.
|
4
|
+
* @param {...any} args - interpolate arguments, typically "rawTemplate", "data", and "options"
|
5
|
+
* @returns {any} the interpolation result.
|
6
|
+
*/
|
7
|
+
export function interpolate(...args: any[]): any;
|
1
8
|
/**
|
2
9
|
* Set the evaluator to use for evaluating expressions.
|
3
10
|
* @param {CoreEvaluator} override - The new evaluator instance to use.
|
@@ -11,5 +18,4 @@ export class DefaultEvaluator extends CoreEvaluator {
|
|
11
18
|
interpolate(rawTemplate: any, data: any, _options: any): any;
|
12
19
|
}
|
13
20
|
export let Evaluator: DefaultEvaluator;
|
14
|
-
export function interpolate(rawTemplate: any, data: any, _options: any): any;
|
15
21
|
import { DefaultEvaluator as CoreEvaluator } from '@formio/core';
|
@@ -62,7 +62,16 @@ class DefaultEvaluator extends core_1.DefaultEvaluator {
|
|
62
62
|
exports.DefaultEvaluator = DefaultEvaluator;
|
63
63
|
exports.Evaluator = new DefaultEvaluator();
|
64
64
|
// preserve the standalone interpolate function for backwards compatibility
|
65
|
-
|
65
|
+
/**
|
66
|
+
* For backwards compatibility we a standalone interpolate function. This merely calls the
|
67
|
+
* global mutable Evaluator instance's interpolate function.
|
68
|
+
* @param {...any} args - interpolate arguments, typically "rawTemplate", "data", and "options"
|
69
|
+
* @returns {any} the interpolation result.
|
70
|
+
*/
|
71
|
+
function interpolate(...args) {
|
72
|
+
return exports.Evaluator.interpolate(...args);
|
73
|
+
}
|
74
|
+
exports.interpolate = interpolate;
|
66
75
|
/**
|
67
76
|
* Set the evaluator to use for evaluating expressions.
|
68
77
|
* @param {CoreEvaluator} override - The new evaluator instance to use.
|
package/lib/cjs/utils/index.d.ts
CHANGED
@@ -3,7 +3,12 @@ export * from "./formUtils";
|
|
3
3
|
export default FormioUtils;
|
4
4
|
declare const FormioUtils: {
|
5
5
|
Evaluator: import("./Evaluator").DefaultEvaluator;
|
6
|
-
interpolate:
|
6
|
+
interpolate: typeof interpolate;
|
7
|
+
ConditionOperators: {
|
8
|
+
[x: string]: typeof import("./conditionOperators/IsEqualTo").default | typeof import("./conditionOperators/DateGreaterThan").default;
|
9
|
+
};
|
10
|
+
_: any;
|
11
|
+
moment: typeof moment;
|
7
12
|
flattenComponents: typeof import("@formio/core/lib/utils/formUtil").flattenComponents;
|
8
13
|
guid: typeof import("@formio/core/lib/utils/formUtil").guid;
|
9
14
|
uniqueName: typeof import("@formio/core/lib/utils/formUtil").uniqueName;
|
@@ -158,4 +163,6 @@ declare const FormioUtils: {
|
|
158
163
|
};
|
159
164
|
import { Evaluator } from './Evaluator';
|
160
165
|
import { registerEvaluator } from './Evaluator';
|
166
|
+
import { interpolate } from './Evaluator';
|
167
|
+
import moment from 'moment';
|
161
168
|
export { FormioUtils as Utils, Evaluator, registerEvaluator };
|
package/lib/cjs/utils/index.js
CHANGED
@@ -25,6 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
27
27
|
};
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
30
|
+
};
|
28
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
32
|
exports.registerEvaluator = exports.Evaluator = exports.Utils = void 0;
|
30
33
|
const utils = __importStar(require("./utils"));
|
@@ -32,8 +35,14 @@ const formUtils = __importStar(require("./formUtils"));
|
|
32
35
|
const Evaluator_1 = require("./Evaluator");
|
33
36
|
Object.defineProperty(exports, "Evaluator", { enumerable: true, get: function () { return Evaluator_1.Evaluator; } });
|
34
37
|
Object.defineProperty(exports, "registerEvaluator", { enumerable: true, get: function () { return Evaluator_1.registerEvaluator; } });
|
38
|
+
const conditionOperators_1 = __importDefault(require("./conditionOperators"));
|
39
|
+
const lodash_1 = __importDefault(require("lodash"));
|
40
|
+
const moment_1 = __importDefault(require("moment"));
|
35
41
|
const FormioUtils = Object.assign(Object.assign(Object.assign({}, utils), formUtils), { Evaluator: Evaluator_1.Evaluator,
|
36
|
-
interpolate: Evaluator_1.interpolate
|
42
|
+
interpolate: Evaluator_1.interpolate,
|
43
|
+
ConditionOperators: conditionOperators_1.default,
|
44
|
+
_: lodash_1.default,
|
45
|
+
moment: moment_1.default });
|
37
46
|
exports.Utils = FormioUtils;
|
38
47
|
if (typeof global === 'object') {
|
39
48
|
global.FormioUtils = FormioUtils;
|
package/lib/mjs/Embed.js
CHANGED
@@ -14,7 +14,7 @@ export class Formio {
|
|
14
14
|
Formio._formioReady = ready;
|
15
15
|
Formio._formioReadyReject = reject;
|
16
16
|
});
|
17
|
-
static version = '5.2.0-rc.
|
17
|
+
static version = '5.2.0-rc.7';
|
18
18
|
static setLicense(license, norecurse = false) {
|
19
19
|
Formio.license = license;
|
20
20
|
if (!norecurse && Formio.FormioClass) {
|
package/lib/mjs/Formio.js
CHANGED
@@ -4,7 +4,7 @@ import CDN from './CDN';
|
|
4
4
|
import Providers from './providers';
|
5
5
|
FormioCore.cdn = new CDN();
|
6
6
|
FormioCore.Providers = Providers;
|
7
|
-
FormioCore.version = '5.2.0-rc.
|
7
|
+
FormioCore.version = '5.2.0-rc.7';
|
8
8
|
CDN.defaultCDN = FormioCore.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
|
9
9
|
const isNil = (val) => val === null || val === undefined;
|
10
10
|
FormioCore.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
|
@@ -7,7 +7,7 @@ export default class ButtonComponent extends Field {
|
|
7
7
|
weight: number;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
-
static savedValueTypes(schema: any):
|
10
|
+
static savedValueTypes(schema: any): string[];
|
11
11
|
constructor(component: any, options: any, data: any);
|
12
12
|
filesUploading: number;
|
13
13
|
get inputInfo(): any;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import Field from '../_classes/field/Field';
|
3
3
|
import Input from '../_classes/input/Input';
|
4
|
-
import { componentValueTypes, eachComponent, getArrayFromComponentPath, getComponentSavedTypes } from '../../utils
|
4
|
+
import { componentValueTypes, eachComponent, getArrayFromComponentPath, getComponentSavedTypes } from '../../utils';
|
5
5
|
export default class ButtonComponent extends Field {
|
6
6
|
static schema(...extend) {
|
7
7
|
return Input.schema({
|
@@ -2,7 +2,7 @@ import Component from '../_classes/component/Component';
|
|
2
2
|
import DataGridComponent from '../datagrid/DataGrid';
|
3
3
|
import _ from 'lodash';
|
4
4
|
import EventEmitter from 'eventemitter3';
|
5
|
-
import { componentValueTypes, getComponentSavedTypes, uniqueKey } from '../../utils/
|
5
|
+
import { componentValueTypes, getComponentSavedTypes, uniqueKey } from '../../utils/utils';
|
6
6
|
export default class DataMapComponent extends DataGridComponent {
|
7
7
|
static schema(...extend) {
|
8
8
|
return Component.schema({
|
@@ -1,3 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* For backwards compatibility we a standalone interpolate function. This merely calls the
|
3
|
+
* global mutable Evaluator instance's interpolate function.
|
4
|
+
* @param {...any} args - interpolate arguments, typically "rawTemplate", "data", and "options"
|
5
|
+
* @returns {any} the interpolation result.
|
6
|
+
*/
|
7
|
+
export function interpolate(...args: any[]): any;
|
1
8
|
/**
|
2
9
|
* Set the evaluator to use for evaluating expressions.
|
3
10
|
* @param {CoreEvaluator} override - The new evaluator instance to use.
|
@@ -11,5 +18,4 @@ export class DefaultEvaluator extends CoreEvaluator {
|
|
11
18
|
interpolate(rawTemplate: any, data: any, _options: any): any;
|
12
19
|
}
|
13
20
|
export let Evaluator: DefaultEvaluator;
|
14
|
-
export function interpolate(rawTemplate: any, data: any, _options: any): any;
|
15
21
|
import { DefaultEvaluator as CoreEvaluator } from '@formio/core';
|
@@ -52,7 +52,15 @@ export class DefaultEvaluator extends CoreEvaluator {
|
|
52
52
|
}
|
53
53
|
export let Evaluator = new DefaultEvaluator();
|
54
54
|
// preserve the standalone interpolate function for backwards compatibility
|
55
|
-
|
55
|
+
/**
|
56
|
+
* For backwards compatibility we a standalone interpolate function. This merely calls the
|
57
|
+
* global mutable Evaluator instance's interpolate function.
|
58
|
+
* @param {...any} args - interpolate arguments, typically "rawTemplate", "data", and "options"
|
59
|
+
* @returns {any} the interpolation result.
|
60
|
+
*/
|
61
|
+
export function interpolate(...args) {
|
62
|
+
return Evaluator.interpolate(...args);
|
63
|
+
}
|
56
64
|
/**
|
57
65
|
* Set the evaluator to use for evaluating expressions.
|
58
66
|
* @param {CoreEvaluator} override - The new evaluator instance to use.
|
package/lib/mjs/utils/index.d.ts
CHANGED
@@ -3,7 +3,12 @@ export * from "./formUtils";
|
|
3
3
|
export default FormioUtils;
|
4
4
|
declare const FormioUtils: {
|
5
5
|
Evaluator: import("./Evaluator").DefaultEvaluator;
|
6
|
-
interpolate:
|
6
|
+
interpolate: typeof interpolate;
|
7
|
+
ConditionOperators: {
|
8
|
+
[x: string]: typeof import("./conditionOperators/IsEqualTo").default | typeof import("./conditionOperators/DateGreaterThan").default;
|
9
|
+
};
|
10
|
+
_: any;
|
11
|
+
moment: typeof moment;
|
7
12
|
flattenComponents: typeof import("@formio/core/lib/utils/formUtil").flattenComponents;
|
8
13
|
guid: typeof import("@formio/core/lib/utils/formUtil").guid;
|
9
14
|
uniqueName: typeof import("@formio/core/lib/utils/formUtil").uniqueName;
|
@@ -158,4 +163,6 @@ declare const FormioUtils: {
|
|
158
163
|
};
|
159
164
|
import { Evaluator } from './Evaluator';
|
160
165
|
import { registerEvaluator } from './Evaluator';
|
166
|
+
import { interpolate } from './Evaluator';
|
167
|
+
import moment from 'moment';
|
161
168
|
export { FormioUtils as Utils, Evaluator, registerEvaluator };
|
package/lib/mjs/utils/index.js
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
import * as utils from './utils';
|
2
2
|
import * as formUtils from './formUtils';
|
3
3
|
import { Evaluator, registerEvaluator, interpolate } from './Evaluator';
|
4
|
+
import ConditionOperators from './conditionOperators';
|
5
|
+
import _ from 'lodash';
|
6
|
+
import moment from 'moment';
|
4
7
|
const FormioUtils = {
|
5
8
|
...utils,
|
6
9
|
...formUtils,
|
7
10
|
Evaluator,
|
8
|
-
interpolate
|
11
|
+
interpolate,
|
12
|
+
ConditionOperators,
|
13
|
+
_,
|
14
|
+
moment
|
9
15
|
};
|
10
16
|
if (typeof global === 'object') {
|
11
17
|
global.FormioUtils = FormioUtils;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.2.0-rc.
|
3
|
+
"version": "5.2.0-rc.7",
|
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.1.1",
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
84
|
-
"@formio/core": "2.5.0-rc.
|
84
|
+
"@formio/core": "2.5.0-rc.4",
|
85
85
|
"@formio/text-mask-addons": "^3.8.0-formio.4",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|