@formio/js 5.0.0-rc.28 → 5.0.0-rc.29
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 +730 -2064
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -1
- package/dist/formio.full.js +741 -1999
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -1
- package/dist/formio.js +98 -2358
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -3
- package/dist/formio.utils.js +131 -111
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +3 -1
- package/lib/cjs/CDN.d.ts +1 -1
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Embed.d.ts +15 -6
- package/lib/cjs/Embed.js +63 -19
- package/lib/cjs/Formio.d.ts +0 -1
- package/lib/cjs/Formio.js +27 -19
- package/lib/cjs/Webform.d.ts +3 -4
- package/lib/cjs/WebformBuilder.js +6 -6
- package/lib/cjs/Wizard.d.ts +3 -4
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/cjs/components/_classes/component/Component.js +6 -6
- package/lib/cjs/components/_classes/nested/NestedComponent.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.js +2 -2
- package/lib/cjs/formio.form.js +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/templates/Templates.d.ts +1 -11
- package/lib/cjs/templates/Templates.js +4 -41
- package/lib/cjs/utils/index.d.ts +1 -0
- package/lib/cjs/utils/index.js +2 -0
- package/lib/mjs/CDN.d.ts +1 -1
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Embed.d.ts +15 -6
- package/lib/mjs/Embed.js +62 -13
- package/lib/mjs/Formio.d.ts +0 -1
- package/lib/mjs/Formio.js +11 -3
- package/lib/mjs/Webform.d.ts +3 -4
- package/lib/mjs/WebformBuilder.js +3 -3
- package/lib/mjs/Wizard.d.ts +3 -4
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/mjs/components/_classes/component/Component.js +1 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +1 -1
- package/lib/mjs/components/editgrid/EditGrid.js +1 -1
- package/lib/mjs/formio.form.js +1 -0
- package/lib/mjs/index.js +1 -0
- package/lib/mjs/templates/Templates.d.ts +1 -11
- package/lib/mjs/templates/Templates.js +4 -40
- package/lib/mjs/utils/index.d.ts +1 -0
- package/lib/mjs/utils/index.js +1 -0
- package/package.json +10 -10
@@ -10,9 +10,11 @@
|
|
10
10
|
* MIT licensed
|
11
11
|
*/
|
12
12
|
|
13
|
+
/*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */
|
14
|
+
|
13
15
|
/*! @license DOMPurify 3.0.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.0.6/LICENSE */
|
14
16
|
|
15
|
-
/*! formiojs v5.0.0-rc.
|
17
|
+
/*! formiojs v5.0.0-rc.29 | https://unpkg.com/formiojs@5.0.0-rc.29/LICENSE.txt */
|
16
18
|
|
17
19
|
/**
|
18
20
|
* @license
|
package/lib/cjs/CDN.d.ts
CHANGED
package/lib/cjs/CDN.js
CHANGED
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
// like Formio.cdn.ace === 'http://cdn.form.io/ace/1.4.12'.
|
6
6
|
// For latest version use empty string
|
7
7
|
class CDN {
|
8
|
-
constructor(baseUrl) {
|
8
|
+
constructor(baseUrl, overrides = {}) {
|
9
9
|
this.baseUrl = baseUrl || 'https://cdn.form.io';
|
10
|
-
this.overrides =
|
10
|
+
this.overrides = overrides;
|
11
11
|
this.libs = {
|
12
12
|
'js': '',
|
13
13
|
'ace': '1.4.12',
|
package/lib/cjs/Embed.d.ts
CHANGED
@@ -1,18 +1,26 @@
|
|
1
1
|
export class Formio {
|
2
|
+
static FormioClass: null;
|
2
3
|
static baseUrl: any;
|
3
4
|
static projectUrl: any;
|
5
|
+
static pathType: any;
|
4
6
|
static language: any;
|
5
7
|
static config: {};
|
6
|
-
static cdn:
|
7
|
-
static
|
8
|
+
static cdn: CDN;
|
9
|
+
static modules: any[];
|
10
|
+
static icons: string;
|
11
|
+
static formioReady: Promise<any>;
|
8
12
|
static version: string;
|
9
|
-
static setBaseUrl(url: any):
|
10
|
-
static
|
13
|
+
static setBaseUrl(url: any, norecurse: any): void;
|
14
|
+
static setApiUrl(url: any, norecurse: any): void;
|
15
|
+
static setProjectUrl(url: any, norecurse: any): void;
|
16
|
+
static setAppUrl(url: any, norecurse: any): void;
|
17
|
+
static setPathType(type: any, norecurse: any): void;
|
11
18
|
static debug(...args: any[]): void;
|
12
19
|
static clearCache(): void;
|
13
|
-
static global(prop: any): any;
|
20
|
+
static global(prop: any, flag?: string): any;
|
21
|
+
static use(module: any): void;
|
14
22
|
static createElement(type: any, attrs: any, children: any): any;
|
15
|
-
static addScript(wrapper: any, src: any, name: any): Promise<any>;
|
23
|
+
static addScript(wrapper: any, src: any, name: any, flag?: string): Promise<any>;
|
16
24
|
static addStyles(wrapper: any, href: any): Promise<void>;
|
17
25
|
static submitDone(instance: any, submission: any): Promise<void>;
|
18
26
|
static formioScript(script: any, builder: any): any;
|
@@ -41,3 +49,4 @@ export class Form {
|
|
41
49
|
}
|
42
50
|
export class FormBuilder extends Form {
|
43
51
|
}
|
52
|
+
import CDN from './CDN.js';
|
package/lib/cjs/Embed.js
CHANGED
@@ -15,15 +15,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.FormBuilder = exports.Form = exports.Formio = void 0;
|
16
16
|
const CDN_js_1 = __importDefault(require("./CDN.js"));
|
17
17
|
class Formio {
|
18
|
-
static setBaseUrl(url) {
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
static setBaseUrl(url, norecurse) {
|
19
|
+
Formio.baseUrl = url;
|
20
|
+
if (!norecurse && Formio.FormioClass) {
|
21
|
+
Formio.FormioClass.setBaseUrl(url);
|
22
|
+
}
|
22
23
|
}
|
23
|
-
static
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
static setApiUrl(url, norecurse) {
|
25
|
+
Formio.baseUrl = url;
|
26
|
+
if (!norecurse && Formio.FormioClass) {
|
27
|
+
Formio.FormioClass.setApiUrl(url);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
static setProjectUrl(url, norecurse) {
|
31
|
+
Formio.projectUrl = url;
|
32
|
+
if (!norecurse && Formio.FormioClass) {
|
33
|
+
Formio.FormioClass.setProjectUrl(url);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
static setAppUrl(url, norecurse) {
|
37
|
+
Formio.projectUrl = url;
|
38
|
+
if (!norecurse && Formio.FormioClass) {
|
39
|
+
Formio.FormioClass.setAppUrl(url);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
static setPathType(type, norecurse) {
|
43
|
+
Formio.pathType = type;
|
44
|
+
if (!norecurse && Formio.FormioClass) {
|
45
|
+
Formio.FormioClass.setPathType(type);
|
46
|
+
}
|
27
47
|
}
|
28
48
|
static debug(...args) {
|
29
49
|
if (Formio.config.debug) {
|
@@ -35,14 +55,22 @@ class Formio {
|
|
35
55
|
Formio.FormioClass.clearCache();
|
36
56
|
}
|
37
57
|
}
|
38
|
-
static global(prop) {
|
58
|
+
static global(prop, flag = '') {
|
39
59
|
const globalValue = window[prop];
|
40
|
-
if (globalValue && globalValue
|
60
|
+
if (flag && globalValue && !globalValue[flag]) {
|
41
61
|
return null;
|
42
62
|
}
|
43
63
|
Formio.debug(`Getting global ${prop}`, globalValue);
|
44
64
|
return globalValue;
|
45
65
|
}
|
66
|
+
static use(module) {
|
67
|
+
if (Formio.FormioClass && Formio.FormioClass.isRenderer) {
|
68
|
+
Formio.FormioClass.use(module);
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
Formio.modules.push(module);
|
72
|
+
}
|
73
|
+
}
|
46
74
|
static createElement(type, attrs, children) {
|
47
75
|
const element = document.createElement(type);
|
48
76
|
Object.keys(attrs).forEach(key => {
|
@@ -53,7 +81,7 @@ class Formio {
|
|
53
81
|
});
|
54
82
|
return element;
|
55
83
|
}
|
56
|
-
static addScript(wrapper, src, name) {
|
84
|
+
static addScript(wrapper, src, name, flag = '') {
|
57
85
|
return __awaiter(this, void 0, void 0, function* () {
|
58
86
|
if (!src) {
|
59
87
|
return Promise.resolve();
|
@@ -61,7 +89,7 @@ class Formio {
|
|
61
89
|
if (typeof src !== 'string' && src.length) {
|
62
90
|
return Promise.all(src.map(ref => Formio.addScript(wrapper, ref)));
|
63
91
|
}
|
64
|
-
if (name && Formio.global(name)) {
|
92
|
+
if (name && Formio.global(name, flag)) {
|
65
93
|
Formio.debug(`${name} already loaded.`);
|
66
94
|
return Promise.resolve(Formio.global(name));
|
67
95
|
}
|
@@ -75,7 +103,7 @@ class Formio {
|
|
75
103
|
return new Promise((resolve) => {
|
76
104
|
Formio.debug(`Waiting to load ${name}`);
|
77
105
|
const wait = setInterval(() => {
|
78
|
-
if (Formio.global(name)) {
|
106
|
+
if (Formio.global(name, flag)) {
|
79
107
|
clearInterval(wait);
|
80
108
|
Formio.debug(`${name} loaded.`);
|
81
109
|
resolve(Formio.global(name));
|
@@ -145,7 +173,7 @@ class Formio {
|
|
145
173
|
// eslint-disable-next-line max-statements
|
146
174
|
static init(element, options = {}, builder = false) {
|
147
175
|
return __awaiter(this, void 0, void 0, function* () {
|
148
|
-
Formio.cdn = new CDN_js_1.default(Formio.config.cdn);
|
176
|
+
Formio.cdn = new CDN_js_1.default(Formio.config.cdn, Formio.config.cdnUrls || {});
|
149
177
|
Formio.config.libs = Formio.config.libs || {
|
150
178
|
uswds: {
|
151
179
|
fa: true,
|
@@ -192,10 +220,19 @@ class Formio {
|
|
192
220
|
}]
|
193
221
|
}]));
|
194
222
|
const renderer = Formio.config.debug ? 'formio.form' : 'formio.form.min';
|
195
|
-
Formio.FormioClass = yield Formio.addScript(wrapper, Formio.formioScript(Formio.config.script || `${Formio.cdn.js}/${renderer}.js`, builder), 'Formio');
|
196
|
-
Formio.FormioClass.setBaseUrl(Formio.baseUrl || Formio.config.base);
|
197
|
-
Formio.FormioClass.setProjectUrl(Formio.projectUrl || Formio.config.project);
|
223
|
+
Formio.FormioClass = yield Formio.addScript(wrapper, Formio.formioScript(Formio.config.script || `${Formio.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');
|
224
|
+
Formio.FormioClass.setBaseUrl(options.baseUrl || Formio.baseUrl || Formio.config.base);
|
225
|
+
Formio.FormioClass.setProjectUrl(options.projectUrl || Formio.projectUrl || Formio.config.project);
|
198
226
|
Formio.FormioClass.language = Formio.language;
|
227
|
+
Formio.modules.forEach((module) => {
|
228
|
+
Formio.FormioClass.use(module);
|
229
|
+
});
|
230
|
+
if (Formio.icons) {
|
231
|
+
Formio.FormioClass.icons = Formio.icons;
|
232
|
+
}
|
233
|
+
if (Formio.pathType) {
|
234
|
+
Formio.FormioClass.setPathType(Formio.pathType);
|
235
|
+
}
|
199
236
|
// Add premium modules
|
200
237
|
if (Formio.global('premium')) {
|
201
238
|
Formio.debug('Using premium module.');
|
@@ -239,6 +276,7 @@ class Formio {
|
|
239
276
|
yield Formio.config.before(Formio.FormioClass, element, Formio.config);
|
240
277
|
}
|
241
278
|
Formio.FormioClass.license = true;
|
279
|
+
Formio._formioReady(Formio.FormioClass);
|
242
280
|
return wrapper;
|
243
281
|
});
|
244
282
|
}
|
@@ -285,9 +323,15 @@ class Formio {
|
|
285
323
|
});
|
286
324
|
}
|
287
325
|
}
|
326
|
+
Formio.FormioClass = null;
|
288
327
|
Formio.config = {};
|
289
|
-
Formio.cdn =
|
290
|
-
Formio.
|
328
|
+
Formio.cdn = new CDN_js_1.default();
|
329
|
+
Formio.modules = [];
|
330
|
+
Formio.icons = '';
|
331
|
+
Formio.formioReady = new Promise((ready, reject) => {
|
332
|
+
Formio._formioReady = ready;
|
333
|
+
Formio._formioReadyReject = reject;
|
334
|
+
});
|
291
335
|
Formio.version = 'FORMIO_VERSION';
|
292
336
|
exports.Formio = Formio;
|
293
337
|
class Form {
|
package/lib/cjs/Formio.d.ts
CHANGED
package/lib/cjs/Formio.js
CHANGED
@@ -4,15 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.Formio = void 0;
|
7
|
-
const
|
8
|
-
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return
|
7
|
+
const sdk_1 = require("@formio/core/sdk");
|
8
|
+
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return sdk_1.Formio; } });
|
9
|
+
const Embed_1 = require("./Embed");
|
9
10
|
const CDN_1 = __importDefault(require("./CDN"));
|
10
11
|
const providers_1 = __importDefault(require("./providers"));
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
sdk_1.Formio.cdn = new CDN_1.default();
|
13
|
+
sdk_1.Formio.Providers = providers_1.default;
|
14
|
+
sdk_1.Formio.version = 'FORMIO_VERSION';
|
14
15
|
const isNil = (val) => val === null || val === undefined;
|
15
|
-
|
16
|
+
sdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
|
16
17
|
const requestArgs = {
|
17
18
|
provider: storage,
|
18
19
|
method: 'upload',
|
@@ -21,9 +22,9 @@ core_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, pro
|
|
21
22
|
dir: dir
|
22
23
|
};
|
23
24
|
fileKey = fileKey || 'file';
|
24
|
-
const request =
|
25
|
+
const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)
|
25
26
|
.then(() => {
|
26
|
-
return
|
27
|
+
return sdk_1.Formio.pluginGet('fileRequest', requestArgs)
|
27
28
|
.then((result) => {
|
28
29
|
if (storage && isNil(result)) {
|
29
30
|
const Provider = providers_1.default.getProvider('storage', storage);
|
@@ -32,7 +33,7 @@ core_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, pro
|
|
32
33
|
if (uploadStartCallback) {
|
33
34
|
uploadStartCallback();
|
34
35
|
}
|
35
|
-
return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback);
|
36
|
+
return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);
|
36
37
|
}
|
37
38
|
else {
|
38
39
|
throw ('Storage provider not found');
|
@@ -41,16 +42,16 @@ core_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, pro
|
|
41
42
|
return result || { url: '' };
|
42
43
|
});
|
43
44
|
});
|
44
|
-
return
|
45
|
+
return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);
|
45
46
|
};
|
46
|
-
|
47
|
+
sdk_1.Formio.prototype.downloadFile = function (file, options) {
|
47
48
|
const requestArgs = {
|
48
49
|
method: 'download',
|
49
50
|
file: file
|
50
51
|
};
|
51
|
-
const request =
|
52
|
+
const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)
|
52
53
|
.then(() => {
|
53
|
-
return
|
54
|
+
return sdk_1.Formio.pluginGet('fileRequest', requestArgs)
|
54
55
|
.then((result) => {
|
55
56
|
if (file.storage && isNil(result)) {
|
56
57
|
const Provider = providers_1.default.getProvider('storage', file.storage);
|
@@ -65,16 +66,16 @@ core_1.Formio.prototype.downloadFile = function (file, options) {
|
|
65
66
|
return result || { url: '' };
|
66
67
|
});
|
67
68
|
});
|
68
|
-
return
|
69
|
+
return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);
|
69
70
|
};
|
70
|
-
|
71
|
+
sdk_1.Formio.prototype.deleteFile = function (file, options) {
|
71
72
|
const requestArgs = {
|
72
73
|
method: 'delete',
|
73
74
|
file: file
|
74
75
|
};
|
75
|
-
const request =
|
76
|
+
const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)
|
76
77
|
.then(() => {
|
77
|
-
return
|
78
|
+
return sdk_1.Formio.pluginGet('fileRequest', requestArgs)
|
78
79
|
.then((result) => {
|
79
80
|
if (file.storage && isNil(result)) {
|
80
81
|
const Provider = providers_1.default.getProvider('storage', file.storage);
|
@@ -89,7 +90,14 @@ core_1.Formio.prototype.deleteFile = function (file, options) {
|
|
89
90
|
return result || { url: '' };
|
90
91
|
});
|
91
92
|
});
|
92
|
-
return
|
93
|
+
return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);
|
93
94
|
};
|
94
95
|
// For reverse compatability.
|
95
|
-
|
96
|
+
sdk_1.Formio.Promise = Promise;
|
97
|
+
sdk_1.Formio.formioReady = Embed_1.Formio.formioReady;
|
98
|
+
sdk_1.Formio.config = Embed_1.Formio.config;
|
99
|
+
sdk_1.Formio.builder = Embed_1.Formio.builder;
|
100
|
+
sdk_1.Formio.Form = Embed_1.Formio.Form;
|
101
|
+
sdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;
|
102
|
+
sdk_1.Formio.use = Embed_1.Formio.use;
|
103
|
+
sdk_1.Formio.createForm = Embed_1.Formio.createForm;
|
package/lib/cjs/Webform.d.ts
CHANGED
@@ -394,10 +394,9 @@ declare class Webform extends NestedDataComponent {
|
|
394
394
|
get variables(): any;
|
395
395
|
}
|
396
396
|
declare namespace Webform {
|
397
|
-
const setBaseUrl:
|
398
|
-
const setApiUrl:
|
399
|
-
const setAppUrl:
|
397
|
+
const setBaseUrl: any;
|
398
|
+
const setApiUrl: any;
|
399
|
+
const setAppUrl: any;
|
400
400
|
}
|
401
401
|
export default Webform;
|
402
402
|
import NestedDataComponent from './components/_classes/nesteddata/NestedDataComponent';
|
403
|
-
import { Formio } from './Formio';
|
@@ -19,7 +19,7 @@ require("./components/builder");
|
|
19
19
|
if (typeof window !== 'undefined' && typeof window.global === 'undefined') {
|
20
20
|
window.global = window;
|
21
21
|
}
|
22
|
-
const
|
22
|
+
const dragula_1 = __importDefault(require("dragula"));
|
23
23
|
class WebformBuilder extends Component_1.default {
|
24
24
|
// eslint-disable-next-line max-statements
|
25
25
|
constructor() {
|
@@ -51,7 +51,7 @@ class WebformBuilder extends Component_1.default {
|
|
51
51
|
}
|
52
52
|
};
|
53
53
|
this.setElement(element);
|
54
|
-
this.dragulaLib =
|
54
|
+
this.dragulaLib = dragula_1.default;
|
55
55
|
this.builderHeight = 0;
|
56
56
|
this.schemas = {};
|
57
57
|
this.repeatablePaths = [];
|
@@ -667,10 +667,10 @@ class WebformBuilder extends Component_1.default {
|
|
667
667
|
const containersArray = Array.prototype.slice.call(this.refs['sidebar-container']).filter(item => {
|
668
668
|
return item.id !== 'group-container-resource';
|
669
669
|
});
|
670
|
-
if (!
|
670
|
+
if (!dragula_1.default) {
|
671
671
|
return;
|
672
672
|
}
|
673
|
-
this.dragula = (0,
|
673
|
+
this.dragula = (0, dragula_1.default)(containersArray, {
|
674
674
|
moves(el) {
|
675
675
|
let moves = true;
|
676
676
|
const list = Array.from(el.classList).filter(item => item.indexOf('formio-component-') === 0);
|
@@ -1143,8 +1143,8 @@ class WebformBuilder extends Component_1.default {
|
|
1143
1143
|
comp = component;
|
1144
1144
|
}
|
1145
1145
|
});
|
1146
|
-
const originalComp = comp.component;
|
1147
|
-
const originalComponentSchema = comp.schema;
|
1146
|
+
const originalComp = comp === null || comp === void 0 ? void 0 : comp.component;
|
1147
|
+
const originalComponentSchema = comp === null || comp === void 0 ? void 0 : comp.schema;
|
1148
1148
|
const isParentSaveChildMethod = this.isParentSaveChildMethod(parent.formioComponent);
|
1149
1149
|
if (parentContainer && !isParentSaveChildMethod) {
|
1150
1150
|
parentContainer[index] = submissionData;
|
package/lib/cjs/Wizard.d.ts
CHANGED
@@ -89,10 +89,9 @@ declare class Wizard extends Webform {
|
|
89
89
|
focusOnComponent(key: any): any;
|
90
90
|
}
|
91
91
|
declare namespace Wizard {
|
92
|
-
const setBaseUrl:
|
93
|
-
const setApiUrl:
|
94
|
-
const setAppUrl:
|
92
|
+
const setBaseUrl: any;
|
93
|
+
const setApiUrl: any;
|
94
|
+
const setAppUrl: any;
|
95
95
|
}
|
96
96
|
export default Wizard;
|
97
97
|
import Webform from './Webform';
|
98
|
-
import { Formio } from './Formio';
|
@@ -725,7 +725,7 @@ declare class Component extends Element {
|
|
725
725
|
* @param {*} flags - The flags to control the behavior of the validation.
|
726
726
|
* @returns
|
727
727
|
*/
|
728
|
-
validateComponent(data: any, row: any, flags?: any): any
|
728
|
+
validateComponent(data: any, row: any, flags?: any): any;
|
729
729
|
/**
|
730
730
|
* Checks the validity of this component and sets the error message if it is invalid.
|
731
731
|
*
|
@@ -31,7 +31,7 @@ const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
|
|
31
31
|
const tippy_js_1 = __importDefault(require("tippy.js"));
|
32
32
|
const lodash_1 = __importDefault(require("lodash"));
|
33
33
|
const ismobilejs_1 = __importDefault(require("ismobilejs"));
|
34
|
-
const
|
34
|
+
const process_1 = require("@formio/core/process");
|
35
35
|
const Formio_1 = require("../../../Formio");
|
36
36
|
const FormioUtils = __importStar(require("../../../utils/utils"));
|
37
37
|
const utils_1 = require("../../../utils/utils");
|
@@ -2593,7 +2593,7 @@ class Component extends Element_1.default {
|
|
2593
2593
|
return '';
|
2594
2594
|
}
|
2595
2595
|
const validationScope = { errors: [] };
|
2596
|
-
(0,
|
2596
|
+
(0, process_1.processOneSync)({
|
2597
2597
|
component: this.component,
|
2598
2598
|
data,
|
2599
2599
|
row,
|
@@ -2601,7 +2601,7 @@ class Component extends Element_1.default {
|
|
2601
2601
|
scope: validationScope,
|
2602
2602
|
instance: this,
|
2603
2603
|
processors: [
|
2604
|
-
|
2604
|
+
process_1.validateProcessSync
|
2605
2605
|
]
|
2606
2606
|
});
|
2607
2607
|
const errors = validationScope.errors;
|
@@ -2683,16 +2683,16 @@ class Component extends Element_1.default {
|
|
2683
2683
|
instance: this,
|
2684
2684
|
scope: { errors: [] },
|
2685
2685
|
processors: [
|
2686
|
-
async ?
|
2686
|
+
async ? process_1.validateProcess : process_1.validateProcessSync
|
2687
2687
|
]
|
2688
2688
|
};
|
2689
2689
|
if (async) {
|
2690
|
-
return (0,
|
2690
|
+
return (0, process_1.processOne)(processContext).then(() => {
|
2691
2691
|
this._errors = this.interpolateErrors(processContext.scope.errors);
|
2692
2692
|
return this._errors;
|
2693
2693
|
});
|
2694
2694
|
}
|
2695
|
-
(0,
|
2695
|
+
(0, process_1.processOneSync)(processContext);
|
2696
2696
|
this._errors = this.interpolateErrors(processContext.scope.errors);
|
2697
2697
|
return this._errors;
|
2698
2698
|
}
|
@@ -7,7 +7,7 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
7
7
|
const Field_1 = __importDefault(require("../field/Field"));
|
8
8
|
const Components_1 = __importDefault(require("../../Components"));
|
9
9
|
const utils_1 = require("../../../utils/utils");
|
10
|
-
const
|
10
|
+
const process_1 = require("@formio/core/process");
|
11
11
|
class NestedComponent extends Field_1.default {
|
12
12
|
static schema(...extend) {
|
13
13
|
return Field_1.default.schema({
|
@@ -605,7 +605,7 @@ class NestedComponent extends Field_1.default {
|
|
605
605
|
}
|
606
606
|
]
|
607
607
|
};
|
608
|
-
return async ? (0,
|
608
|
+
return async ? (0, process_1.process)(processorContext).then((scope) => scope.errors) : (0, process_1.processSync)(processorContext).errors;
|
609
609
|
}
|
610
610
|
/**
|
611
611
|
* Validate a nested component with data, or its own internal data.
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
|
-
const
|
7
|
+
const process_1 = require("@formio/core/process");
|
8
8
|
const components_1 = require("@formio/bootstrap/components");
|
9
9
|
const NestedArrayComponent_1 = __importDefault(require("../_classes/nestedarray/NestedArrayComponent"));
|
10
10
|
const Component_1 = __importDefault(require("../_classes/component/Component"));
|
@@ -980,7 +980,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
980
980
|
const editGridValue = lodash_1.default.get(rootValue, this.path, []);
|
981
981
|
editGridValue[editRow.rowIndex] = editRow.data;
|
982
982
|
lodash_1.default.set(rootValue, this.path, editGridValue);
|
983
|
-
editRow.errors = (0,
|
983
|
+
editRow.errors = (0, process_1.processSync)({
|
984
984
|
components: (0, utils_1.fastCloneDeep)(this.component.components).map((component) => {
|
985
985
|
component.parentPath = `${this.path}[${editRow.rowIndex}]`;
|
986
986
|
return component;
|
package/lib/cjs/formio.form.js
CHANGED
@@ -32,6 +32,7 @@ Formio_1.Formio.loadModules = (path = `${Formio_1.Formio.getApiUrl()}/externalMo
|
|
32
32
|
});
|
33
33
|
};
|
34
34
|
// This is needed to maintain correct imports using the "dist" file.
|
35
|
+
Formio_1.Formio.isRenderer = true;
|
35
36
|
Formio_1.Formio.Components = Components_1.default;
|
36
37
|
Formio_1.Formio.Templates = Templates_1.default;
|
37
38
|
Formio_1.Formio.Utils = utils_1.default;
|
package/lib/cjs/index.js
CHANGED
@@ -25,6 +25,7 @@ exports.Builders = Builders_1.default;
|
|
25
25
|
const formio_form_1 = require("./formio.form");
|
26
26
|
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return formio_form_1.Formio; } });
|
27
27
|
formio_form_1.Formio.Builders = Builders_1.default;
|
28
|
+
formio_form_1.Formio.isBuilder = true;
|
28
29
|
formio_form_1.Formio.use = (0, formio_form_1.useModule)((key, mod) => {
|
29
30
|
if (key === 'builders') {
|
30
31
|
formio_form_1.Formio.Builders.addBuilders(mod.builders);
|
@@ -1,11 +1 @@
|
|
1
|
-
export default
|
2
|
-
static get templates(): any;
|
3
|
-
static addTemplate(name: any, template: any): void;
|
4
|
-
static extendTemplate(name: any, template: any): void;
|
5
|
-
static setTemplate(name: any, template: any): void;
|
6
|
-
static set current(arg: any);
|
7
|
-
static get current(): any;
|
8
|
-
static get defaultTemplates(): any;
|
9
|
-
static set framework(arg: any);
|
10
|
-
static get framework(): any;
|
11
|
-
}
|
1
|
+
export default Template;
|
@@ -3,45 +3,8 @@ 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
|
-
const lodash_1 = __importDefault(require("lodash"));
|
7
6
|
const index_1 = __importDefault(require("./index"));
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
13
|
-
return Templates._templates;
|
14
|
-
}
|
15
|
-
static addTemplate(name, template) {
|
16
|
-
Templates.templates[name] = template;
|
17
|
-
}
|
18
|
-
static extendTemplate(name, template) {
|
19
|
-
Templates.templates[name] = lodash_1.default.merge({}, Templates.templates[name], template);
|
20
|
-
}
|
21
|
-
static setTemplate(name, template) {
|
22
|
-
Templates.addTemplate(name, template);
|
23
|
-
}
|
24
|
-
static set current(templates) {
|
25
|
-
const defaultTemplates = Templates.current;
|
26
|
-
Templates._current = lodash_1.default.merge({}, defaultTemplates, templates);
|
27
|
-
}
|
28
|
-
static get current() {
|
29
|
-
if (Templates._current) {
|
30
|
-
return Templates._current;
|
31
|
-
}
|
32
|
-
return Templates.defaultTemplates;
|
33
|
-
}
|
34
|
-
static get defaultTemplates() {
|
35
|
-
return Templates.templates.hasOwnProperty('bootstrap') ? Templates.templates.bootstrap : {};
|
36
|
-
}
|
37
|
-
static set framework(framework) {
|
38
|
-
if (Templates.templates.hasOwnProperty(framework)) {
|
39
|
-
Templates._framework = framework;
|
40
|
-
Templates._current = Templates.templates[framework];
|
41
|
-
}
|
42
|
-
}
|
43
|
-
static get framework() {
|
44
|
-
return Templates._framework;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
exports.default = Templates;
|
7
|
+
const template_1 = require("@formio/core/template");
|
8
|
+
template_1.Template.addTemplates(index_1.default);
|
9
|
+
template_1.Template.defaultTemplates = index_1.default.bootstrap;
|
10
|
+
exports.default = template_1.Template;
|
package/lib/cjs/utils/index.d.ts
CHANGED
package/lib/cjs/utils/index.js
CHANGED
@@ -23,7 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.Utils = void 0;
|
26
27
|
const FormioUtils = __importStar(require("./utils"));
|
28
|
+
exports.Utils = FormioUtils;
|
27
29
|
if (typeof global === 'object') {
|
28
30
|
global.FormioUtils = FormioUtils;
|
29
31
|
}
|
package/lib/mjs/CDN.d.ts
CHANGED
package/lib/mjs/CDN.js
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
// like Formio.cdn.ace === 'http://cdn.form.io/ace/1.4.12'.
|
4
4
|
// For latest version use empty string
|
5
5
|
class CDN {
|
6
|
-
constructor(baseUrl) {
|
6
|
+
constructor(baseUrl, overrides = {}) {
|
7
7
|
this.baseUrl = baseUrl || 'https://cdn.form.io';
|
8
|
-
this.overrides =
|
8
|
+
this.overrides = overrides;
|
9
9
|
this.libs = {
|
10
10
|
'js': '',
|
11
11
|
'ace': '1.4.12',
|