@formio/js 5.1.0-dev.6114.02b6d9c → 5.1.0-dev.6123.055aa35
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.builder.css +6 -0
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.css +1 -1
- package/dist/formio.embed.min.css +1 -1
- package/dist/formio.form.css +6 -0
- package/dist/formio.form.js +112 -123
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.css +6 -0
- package/dist/formio.full.js +119 -130
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +61 -50
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +72 -72
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Element.js +13 -36
- package/lib/cjs/EventEmitter.js +2 -25
- package/lib/cjs/Form.js +2 -25
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/PDFBuilder.js +4 -5
- package/lib/cjs/Webform.js +5 -6
- package/lib/cjs/WebformBuilder.js +9 -10
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/WizardBuilder.js +1 -1
- package/lib/cjs/components/_classes/component/Component.js +29 -52
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
- package/lib/cjs/components/_classes/componentModal/ComponentModal.js +1 -1
- package/lib/cjs/components/_classes/input/Input.js +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.js +1 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +6 -6
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
- package/lib/cjs/components/address/Address.js +1 -1
- package/lib/cjs/components/alert/Alert.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/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/container/Container.js +1 -1
- package/lib/cjs/components/currency/Currency.js +1 -1
- package/lib/cjs/components/datagrid/DataGrid.js +1 -1
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -1
- package/lib/cjs/components/datamap/DataMap.js +4 -4
- package/lib/cjs/components/datetime/DateTime.d.ts +1 -1
- package/lib/cjs/components/datetime/DateTime.js +15 -13
- package/lib/cjs/components/day/Day.js +1 -1
- package/lib/cjs/components/editgrid/EditGrid.js +1 -1
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
- package/lib/cjs/components/file/File.js +1 -1
- package/lib/cjs/components/form/Form.js +14 -2
- package/lib/cjs/components/form/editForm/Form.edit.form.js +4 -3
- package/lib/cjs/components/number/Number.js +1 -1
- package/lib/cjs/components/panel/Panel.js +1 -1
- package/lib/cjs/components/radio/Radio.js +1 -1
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.js +1 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.js +1 -1
- package/lib/cjs/components/signature/Signature.js +1 -1
- package/lib/cjs/components/survey/Survey.js +1 -1
- package/lib/cjs/components/tags/Tags.js +1 -1
- package/lib/cjs/components/textarea/TextArea.js +3 -3
- package/lib/cjs/components/textfield/TextField.js +7 -30
- package/lib/cjs/components/time/Time.js +1 -1
- package/lib/cjs/formio.form.js +3 -3
- package/lib/cjs/i18n.js +1 -1
- package/lib/cjs/providers/storage/uploadAdapter.js +1 -1
- package/lib/cjs/utils/Evaluator.d.ts +13 -6
- package/lib/cjs/utils/Evaluator.js +27 -15
- package/lib/cjs/utils/builder.js +5 -5
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
- package/lib/cjs/utils/i18n.js +3 -3
- package/lib/cjs/utils/index.d.ts +161 -2
- package/lib/cjs/utils/index.js +12 -2
- package/lib/cjs/utils/utils.d.ts +18 -33
- package/lib/cjs/utils/utils.js +52 -130
- package/lib/cjs/widgets/CalendarWidget.d.ts +0 -7
- package/lib/cjs/widgets/CalendarWidget.js +15 -39
- package/lib/mjs/Element.js +6 -6
- package/lib/mjs/EventEmitter.js +2 -2
- package/lib/mjs/Form.js +1 -1
- package/lib/mjs/PDF.js +1 -1
- package/lib/mjs/PDFBuilder.js +1 -2
- package/lib/mjs/Webform.js +3 -4
- package/lib/mjs/WebformBuilder.js +1 -2
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/WizardBuilder.js +1 -1
- package/lib/mjs/components/_classes/component/Component.js +2 -2
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
- package/lib/mjs/components/_classes/componentModal/ComponentModal.js +1 -1
- package/lib/mjs/components/_classes/input/Input.js +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.js +1 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +6 -6
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
- package/lib/mjs/components/address/Address.js +1 -1
- package/lib/mjs/components/alert/Alert.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/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/container/Container.js +1 -1
- package/lib/mjs/components/currency/Currency.js +1 -1
- package/lib/mjs/components/datagrid/DataGrid.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/components/datetime/DateTime.d.ts +1 -1
- package/lib/mjs/components/datetime/DateTime.js +15 -13
- package/lib/mjs/components/day/Day.js +1 -1
- package/lib/mjs/components/editgrid/EditGrid.js +1 -1
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
- package/lib/mjs/components/file/File.js +1 -1
- package/lib/mjs/components/form/Form.js +13 -2
- package/lib/mjs/components/form/editForm/Form.edit.form.js +3 -2
- package/lib/mjs/components/number/Number.js +1 -1
- package/lib/mjs/components/panel/Panel.js +1 -1
- package/lib/mjs/components/radio/Radio.js +1 -1
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
- package/lib/mjs/components/select/Select.js +1 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.js +1 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.js +1 -1
- package/lib/mjs/components/signature/Signature.js +1 -1
- package/lib/mjs/components/survey/Survey.js +1 -1
- package/lib/mjs/components/tags/Tags.js +1 -1
- package/lib/mjs/components/textarea/TextArea.js +3 -3
- package/lib/mjs/components/textfield/TextField.js +1 -1
- package/lib/mjs/components/time/Time.js +1 -1
- package/lib/mjs/formio.form.js +2 -2
- package/lib/mjs/i18n.js +1 -1
- package/lib/mjs/providers/storage/uploadAdapter.js +1 -1
- package/lib/mjs/utils/Evaluator.d.ts +13 -6
- package/lib/mjs/utils/Evaluator.js +21 -13
- package/lib/mjs/utils/builder.js +1 -1
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
- package/lib/mjs/utils/i18n.js +1 -1
- package/lib/mjs/utils/index.d.ts +161 -2
- package/lib/mjs/utils/index.js +11 -1
- package/lib/mjs/utils/utils.d.ts +18 -33
- package/lib/mjs/utils/utils.js +45 -105
- package/lib/mjs/widgets/CalendarWidget.d.ts +0 -7
- package/lib/mjs/widgets/CalendarWidget.js +15 -39
- package/package.json +3 -2
package/lib/cjs/Element.js
CHANGED
@@ -1,38 +1,15 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
4
|
};
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
const EventEmitter_1 = __importDefault(require("./EventEmitter"));
|
30
|
-
const Formio_1 = require("./Formio");
|
31
|
-
const FormioUtils = __importStar(require("./utils/utils"));
|
32
|
-
const i18n_1 = require("./utils/i18n");
|
33
6
|
const lodash_1 = __importDefault(require("lodash"));
|
34
7
|
const moment_1 = __importDefault(require("moment"));
|
35
8
|
const vanilla_text_mask_1 = __importDefault(require("@formio/vanilla-text-mask"));
|
9
|
+
const EventEmitter_1 = __importDefault(require("./EventEmitter"));
|
10
|
+
const Formio_1 = require("./Formio");
|
11
|
+
const i18n_1 = require("./utils/i18n");
|
12
|
+
const utils_1 = __importDefault(require("./utils"));
|
36
13
|
/**
|
37
14
|
* The root component for all elements within the Form.io renderer.
|
38
15
|
*/
|
@@ -56,7 +33,7 @@ class Element {
|
|
56
33
|
* can also be provided from the component.id value passed into the constructor.
|
57
34
|
* @type {string}
|
58
35
|
*/
|
59
|
-
this.id =
|
36
|
+
this.id = utils_1.default.getRandomComponentId();
|
60
37
|
/**
|
61
38
|
* An array of event handlers so that the destry command can deregister them.
|
62
39
|
* @type {Array}
|
@@ -385,7 +362,7 @@ class Element {
|
|
385
362
|
*/
|
386
363
|
setInputMask(input, inputMask, usePlaceholder) {
|
387
364
|
if (input && inputMask) {
|
388
|
-
const mask =
|
365
|
+
const mask = utils_1.default.getInputMask(inputMask, this.placeholderChar);
|
389
366
|
this.defaultMask = mask;
|
390
367
|
try {
|
391
368
|
//destroy previous mask
|
@@ -522,8 +499,8 @@ class Element {
|
|
522
499
|
var _a;
|
523
500
|
return Object.assign({
|
524
501
|
_: lodash_1.default,
|
525
|
-
utils:
|
526
|
-
util:
|
502
|
+
utils: utils_1.default,
|
503
|
+
util: utils_1.default,
|
527
504
|
user: Formio_1.Formio.getUser(),
|
528
505
|
moment: moment_1.default,
|
529
506
|
instance: this,
|
@@ -548,15 +525,15 @@ class Element {
|
|
548
525
|
*/
|
549
526
|
interpolate(string, data, options = {}) {
|
550
527
|
if (typeof string !== 'function' && (this.component.content || this.component.html)
|
551
|
-
&& !
|
552
|
-
string =
|
528
|
+
&& !utils_1.default.Evaluator.templateSettings.interpolate.test(string)) {
|
529
|
+
string = utils_1.default.translateHTMLTemplate(String(string), (value) => this.t(value));
|
553
530
|
}
|
554
531
|
if (this.component.filter === string && !this.options.building) {
|
555
532
|
const evalContext = this.evalContext(data);
|
556
533
|
evalContext.data = lodash_1.default.mapValues(evalContext.data, (val) => lodash_1.default.isString(val) ? encodeURIComponent(val) : val);
|
557
|
-
return
|
534
|
+
return utils_1.default.Evaluator.interpolate(string, evalContext, options);
|
558
535
|
}
|
559
|
-
return
|
536
|
+
return utils_1.default.Evaluator.interpolate(string, this.evalContext(data), options);
|
560
537
|
}
|
561
538
|
/**
|
562
539
|
* Performs an evaluation using the evaluation context of this component.
|
@@ -568,7 +545,7 @@ class Element {
|
|
568
545
|
* @returns {*} - The result of the evaluation.
|
569
546
|
*/
|
570
547
|
evaluate(func, args, ret, interpolate, options = {}) {
|
571
|
-
return
|
548
|
+
return utils_1.default.evaluate(func, this.evalContext(args), ret, interpolate, options);
|
572
549
|
}
|
573
550
|
/**
|
574
551
|
* Allow for options to hook into the functionality of this renderer.
|
package/lib/cjs/EventEmitter.js
CHANGED
@@ -1,30 +1,7 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
3
|
const eventemitter3_1 = require("eventemitter3");
|
27
|
-
const
|
4
|
+
const utils_1 = require("./utils");
|
28
5
|
class EventEmitter extends eventemitter3_1.EventEmitter {
|
29
6
|
constructor(conf = {}) {
|
30
7
|
const { loadLimit = 1000, eventsSafeInterval = 300 } = conf;
|
@@ -38,7 +15,7 @@ class EventEmitter extends eventemitter3_1.EventEmitter {
|
|
38
15
|
const overloadHandler = () => {
|
39
16
|
console.warn(`There were more than ${loadLimit} events emitted in ${eventsSafeInterval} ms. It might be caused by events' infinite loop`, this.id);
|
40
17
|
};
|
41
|
-
const dispatch =
|
18
|
+
const dispatch = (0, utils_1.observeOverload)(overloadHandler, {
|
42
19
|
limit: loadLimit,
|
43
20
|
delay: eventsSafeInterval
|
44
21
|
});
|
package/lib/cjs/Form.js
CHANGED
@@ -1,27 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
4
|
};
|
@@ -30,7 +7,7 @@ const Element_1 = __importDefault(require("./Element"));
|
|
30
7
|
const Formio_1 = require("./Formio");
|
31
8
|
const displays_1 = __importDefault(require("./displays"));
|
32
9
|
const templates_1 = __importDefault(require("./templates"));
|
33
|
-
const
|
10
|
+
const utils_1 = __importDefault(require("./utils"));
|
34
11
|
class Form extends Element_1.default {
|
35
12
|
constructor(elementOrForm, formOrOptions, options = {}) {
|
36
13
|
let element, form, formOptions;
|
@@ -324,7 +301,7 @@ class Form extends Element_1.default {
|
|
324
301
|
if (this.options.sanitize === false && !forceSanitize) {
|
325
302
|
return dirty;
|
326
303
|
}
|
327
|
-
return
|
304
|
+
return utils_1.default.sanitize(dirty, this.options);
|
328
305
|
}
|
329
306
|
setContent(element, content, forceSanitize) {
|
330
307
|
if (element instanceof HTMLElement) {
|
package/lib/cjs/PDF.js
CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const Formio_1 = require("./Formio");
|
7
7
|
const Webform_1 = __importDefault(require("./Webform"));
|
8
|
-
const utils_1 = require("./utils
|
8
|
+
const utils_1 = require("./utils");
|
9
9
|
class PDF extends Webform_1.default {
|
10
10
|
constructor(element, options) {
|
11
11
|
options.display = 'pdf';
|
package/lib/cjs/PDFBuilder.js
CHANGED
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
7
|
const Formio_1 = require("./Formio");
|
8
8
|
const WebformBuilder_1 = __importDefault(require("./WebformBuilder"));
|
9
|
-
const utils_1 = require("./utils
|
10
|
-
const formUtils_1 = require("./utils/formUtils");
|
9
|
+
const utils_1 = require("./utils");
|
11
10
|
const builder_1 = __importDefault(require("./utils/builder"));
|
12
11
|
const PDF_1 = __importDefault(require("./PDF"));
|
13
12
|
class PDFBuilder extends WebformBuilder_1.default {
|
@@ -272,7 +271,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
272
271
|
getParentContainer(component) {
|
273
272
|
let container = [];
|
274
273
|
let originalComponent = null;
|
275
|
-
(0,
|
274
|
+
(0, utils_1.eachComponent)(this.webform._form.components, (comp, path, components) => {
|
276
275
|
if (comp.id === component.component.id) {
|
277
276
|
container = components;
|
278
277
|
originalComponent = comp;
|
@@ -455,7 +454,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
455
454
|
const repeatablePaths = this.findRepeatablePaths();
|
456
455
|
// update elements which path was duplicated if any pathes have been changed
|
457
456
|
if (!lodash_1.default.isEqual(this.repeatablePaths, repeatablePaths)) {
|
458
|
-
(0,
|
457
|
+
(0, utils_1.eachComponent)(this.webform.getComponents(), (comp, path) => {
|
459
458
|
if (this.repeatablePaths.includes(path)) {
|
460
459
|
this.webform.postMessage({ name: 'updateElement', data: comp.component });
|
461
460
|
}
|
@@ -465,7 +464,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
465
464
|
if (!repeatablePaths.length) {
|
466
465
|
return;
|
467
466
|
}
|
468
|
-
(0,
|
467
|
+
(0, utils_1.eachComponent)(this.webform.getComponents(), (comp, path) => {
|
469
468
|
if (this.repeatablePaths.includes(path)) {
|
470
469
|
this.webform.postMessage({
|
471
470
|
name: 'showBuilderErrors',
|
package/lib/cjs/Webform.js
CHANGED
@@ -4,15 +4,14 @@ 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 moment_1 = __importDefault(require("moment"));
|
8
7
|
const compare_versions_1 = require("compare-versions");
|
9
8
|
const EventEmitter_1 = __importDefault(require("./EventEmitter"));
|
10
9
|
const i18n_1 = __importDefault(require("./i18n"));
|
11
10
|
const Formio_1 = require("./Formio");
|
12
11
|
const Components_1 = __importDefault(require("./components/Components"));
|
13
12
|
const NestedDataComponent_1 = __importDefault(require("./components/_classes/nesteddata/NestedDataComponent"));
|
14
|
-
const utils_1 = require("./utils
|
15
|
-
const
|
13
|
+
const utils_1 = require("./utils");
|
14
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
16
15
|
// We need this here because dragula pulls in CustomEvent class that requires global to exist.
|
17
16
|
if (typeof window !== 'undefined' && typeof window.global === 'undefined') {
|
18
17
|
window.global = window;
|
@@ -992,7 +991,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
992
991
|
}
|
993
992
|
hasRequiredFields() {
|
994
993
|
let result = false;
|
995
|
-
(0,
|
994
|
+
(0, utils_1.eachComponent)(this.form.components, (component) => {
|
996
995
|
if (component.validate.required) {
|
997
996
|
result = true;
|
998
997
|
return true;
|
@@ -1314,7 +1313,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
1314
1313
|
submission.metadata = submission.metadata || {};
|
1315
1314
|
lodash_1.default.defaults(submission.metadata, {
|
1316
1315
|
timezone: lodash_1.default.get(this, '_submission.metadata.timezone', (0, utils_1.currentTimezone)()),
|
1317
|
-
offset: parseInt(lodash_1.default.get(this, '_submission.metadata.offset', (0,
|
1316
|
+
offset: parseInt(lodash_1.default.get(this, '_submission.metadata.offset', (0, dayjs_1.default)().utcOffset()), 10),
|
1318
1317
|
origin: document.location.origin,
|
1319
1318
|
referrer: document.referrer,
|
1320
1319
|
browserName: navigator.appName,
|
@@ -1538,7 +1537,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
1538
1537
|
return;
|
1539
1538
|
}
|
1540
1539
|
const captchaComponent = [];
|
1541
|
-
(0,
|
1540
|
+
(0, utils_1.eachComponent)(components || this.components, (component) => {
|
1542
1541
|
if (/^(re)?captcha$/.test(component.type) && component.component.eventType === 'formLoad') {
|
1543
1542
|
captchaComponent.push(component);
|
1544
1543
|
}
|
@@ -8,8 +8,7 @@ const Component_1 = __importDefault(require("./components/_classes/component/Com
|
|
8
8
|
const tippy_js_1 = __importDefault(require("tippy.js"));
|
9
9
|
const Components_1 = __importDefault(require("./components/Components"));
|
10
10
|
const Formio_1 = require("./Formio");
|
11
|
-
const utils_1 = require("./utils
|
12
|
-
const formUtils_1 = require("./utils/formUtils");
|
11
|
+
const utils_1 = require("./utils");
|
13
12
|
const builder_1 = __importDefault(require("./utils/builder"));
|
14
13
|
const lodash_1 = __importDefault(require("lodash"));
|
15
14
|
const dom_autoscroller_1 = __importDefault(require("dom-autoscroller"));
|
@@ -284,7 +283,7 @@ class WebformBuilder extends Component_1.default {
|
|
284
283
|
componentOrder: [],
|
285
284
|
default: index === 0,
|
286
285
|
};
|
287
|
-
(0,
|
286
|
+
(0, utils_1.eachComponent)(resource.components, (component) => {
|
288
287
|
if (component.type === 'button')
|
289
288
|
return;
|
290
289
|
if (this.options &&
|
@@ -450,7 +449,7 @@ class WebformBuilder extends Component_1.default {
|
|
450
449
|
return [...componentSchema.components, componentSchema];
|
451
450
|
}
|
452
451
|
// Get the namespace component so we have the original object.
|
453
|
-
const namespaceComponent = (0,
|
452
|
+
const namespaceComponent = (0, utils_1.getComponent)(this.form.components, namespaceKey, true);
|
454
453
|
return namespaceComponent ? namespaceComponent.components : comp.components;
|
455
454
|
}
|
456
455
|
recurseNamespace(component) {
|
@@ -812,7 +811,7 @@ class WebformBuilder extends Component_1.default {
|
|
812
811
|
const draggableComponent = ((_a = this.groups[group]) === null || _a === void 0 ? void 0 : _a.components[compKey]) || {};
|
813
812
|
if (draggableComponent.disableSiblings || draggableComponent.uniqueComponent) {
|
814
813
|
let isCompAlreadyExists = false;
|
815
|
-
(0,
|
814
|
+
(0, utils_1.eachComponent)(this.webform.components, (component) => {
|
816
815
|
if ((draggableComponent.disableSiblings && component.type === draggableComponent.schema.type) ||
|
817
816
|
(draggableComponent.uniqueComponent && component.component.key === draggableComponent.schema.key)) {
|
818
817
|
isCompAlreadyExists = true;
|
@@ -947,7 +946,7 @@ class WebformBuilder extends Component_1.default {
|
|
947
946
|
//populate isEnabled for captcha form settings
|
948
947
|
let isCaptchaEnabled = false;
|
949
948
|
if (this.form.components) {
|
950
|
-
(0,
|
949
|
+
(0, utils_1.eachComponent)(form.components, component => {
|
951
950
|
if (isCaptchaEnabled) {
|
952
951
|
return;
|
953
952
|
}
|
@@ -1042,7 +1041,7 @@ class WebformBuilder extends Component_1.default {
|
|
1042
1041
|
}
|
1043
1042
|
}
|
1044
1043
|
// Change the "default value" field to be reflective of this component.
|
1045
|
-
const defaultValueComponent = (0,
|
1044
|
+
const defaultValueComponent = (0, utils_1.getComponent)(this.editForm.components, 'defaultValue', true);
|
1046
1045
|
if (defaultValueComponent && component.type !== 'hidden') {
|
1047
1046
|
const defaultChanged = changed && ((changed.component && changed.component.key === 'defaultValue')
|
1048
1047
|
|| (changed.instance && defaultValueComponent.hasComponent && defaultValueComponent.hasComponent(changed.instance)));
|
@@ -1074,7 +1073,7 @@ class WebformBuilder extends Component_1.default {
|
|
1074
1073
|
if (!this.originalDefaultValue) {
|
1075
1074
|
this.originalDefaultValue = (0, utils_1.fastCloneDeep)(defaultValueComponent.component);
|
1076
1075
|
}
|
1077
|
-
(0,
|
1076
|
+
(0, utils_1.eachComponent)(defaultValueComponent.component.components, (comp => {
|
1078
1077
|
var _a;
|
1079
1078
|
if ((_a = comp.validate) === null || _a === void 0 ? void 0 : _a.required) {
|
1080
1079
|
comp.validate.required = false;
|
@@ -1129,7 +1128,7 @@ class WebformBuilder extends Component_1.default {
|
|
1129
1128
|
findRepeatablePaths() {
|
1130
1129
|
const repeatablePaths = [];
|
1131
1130
|
const keys = new Map();
|
1132
|
-
(0,
|
1131
|
+
(0, utils_1.eachComponent)(this.form.components, (comp, path, components, parent, paths) => {
|
1133
1132
|
if (keys.has(paths.dataPath)) {
|
1134
1133
|
repeatablePaths.push(paths.dataPath);
|
1135
1134
|
}
|
@@ -1641,7 +1640,7 @@ class WebformBuilder extends Component_1.default {
|
|
1641
1640
|
if (!Components_1.default.components[type === 'custom' ? 'unknown' : type]) {
|
1642
1641
|
return false;
|
1643
1642
|
}
|
1644
|
-
const editTabs = (0,
|
1643
|
+
const editTabs = (0, utils_1.getComponent)(Components_1.default.components[type === 'custom' ? 'unknown' : type].editForm().components, 'tabs', true).components;
|
1645
1644
|
const hiddenEditTabs = lodash_1.default.filter(lodash_1.default.get(this.options, `editForm.${type}`, []), 'ignore');
|
1646
1645
|
return lodash_1.default.intersectionBy(editTabs, hiddenEditTabs, 'key').length !== editTabs.length;
|
1647
1646
|
}
|
package/lib/cjs/Wizard.js
CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
7
|
const Webform_1 = __importDefault(require("./Webform"));
|
8
8
|
const Formio_1 = require("./Formio");
|
9
|
-
const utils_1 = require("./utils
|
9
|
+
const utils_1 = require("./utils");
|
10
10
|
class Wizard extends Webform_1.default {
|
11
11
|
/**
|
12
12
|
* Constructor for wizard-based forms.
|
package/lib/cjs/WizardBuilder.js
CHANGED
@@ -7,7 +7,7 @@ const WebformBuilder_1 = __importDefault(require("./WebformBuilder"));
|
|
7
7
|
const Webform_1 = __importDefault(require("./Webform"));
|
8
8
|
const builder_1 = __importDefault(require("./utils/builder"));
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
10
|
-
const utils_1 = require("./utils
|
10
|
+
const utils_1 = require("./utils");
|
11
11
|
class WizardBuilder extends WebformBuilder_1.default {
|
12
12
|
constructor() {
|
13
13
|
let element, options;
|
@@ -1,27 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -42,8 +19,8 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
42
19
|
const ismobilejs_1 = __importDefault(require("ismobilejs"));
|
43
20
|
const process_1 = require("@formio/core/process");
|
44
21
|
const Formio_1 = require("../../../Formio");
|
45
|
-
const
|
46
|
-
const
|
22
|
+
const utils_1 = __importDefault(require("../../../utils"));
|
23
|
+
const utils_2 = require("../../../utils");
|
47
24
|
const Element_1 = __importDefault(require("../../../Element"));
|
48
25
|
const ComponentModal_1 = __importDefault(require("../componentModal/ComponentModal"));
|
49
26
|
const widgets_1 = __importDefault(require("../../../widgets"));
|
@@ -51,7 +28,7 @@ const addons_1 = __importDefault(require("../../../addons"));
|
|
51
28
|
const uploadAdapter_1 = require("../../../providers/storage/uploadAdapter");
|
52
29
|
const en_1 = __importDefault(require("../../../translations/en"));
|
53
30
|
const Templates_1 = __importDefault(require("../../../templates/Templates"));
|
54
|
-
const isIEBrowser =
|
31
|
+
const isIEBrowser = utils_1.default.getBrowserInfo().ie;
|
55
32
|
/**
|
56
33
|
* This is the Component class
|
57
34
|
which all elements within the FormioForm derive from.
|
@@ -225,7 +202,7 @@ class Component extends Element_1.default {
|
|
225
202
|
*/
|
226
203
|
static savedValueTypes(schema) {
|
227
204
|
schema = schema || {};
|
228
|
-
return
|
205
|
+
return utils_1.default.getComponentSavedTypes(schema) || [utils_1.default.componentValueTypes.any];
|
229
206
|
}
|
230
207
|
/**
|
231
208
|
* Provides a table view for this component. Override if you wish to do something different than using getView
|
@@ -292,7 +269,7 @@ class Component extends Element_1.default {
|
|
292
269
|
this.component.id = this.id;
|
293
270
|
this.afterComponentAssign();
|
294
271
|
// Save off the original component to be used in logic.
|
295
|
-
this.originalComponent = (0,
|
272
|
+
this.originalComponent = (0, utils_2.fastCloneDeep)(this.component);
|
296
273
|
/**
|
297
274
|
* If the component has been attached
|
298
275
|
*/
|
@@ -325,7 +302,7 @@ class Component extends Element_1.default {
|
|
325
302
|
* Determines if this component is disabled, or not.
|
326
303
|
* @type {boolean}
|
327
304
|
*/
|
328
|
-
this._disabled = (0,
|
305
|
+
this._disabled = (0, utils_2.boolValue)(this.component.disabled) ? this.component.disabled : false;
|
329
306
|
/**
|
330
307
|
* Points to the root component, usually the FormComponent.
|
331
308
|
* @type {Component}
|
@@ -346,7 +323,7 @@ class Component extends Element_1.default {
|
|
346
323
|
* The component paths for this component.
|
347
324
|
* @type {import('@formio/core').ComponentPaths} - The component paths.
|
348
325
|
*/
|
349
|
-
this.paths =
|
326
|
+
this.paths = utils_1.default.getComponentPaths(this.component, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.component, Object.assign(Object.assign({}, (_b = this.parent) === null || _b === void 0 ? void 0 : _b.paths), { dataIndex: this.options.rowIndex === undefined ? (_d = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.paths) === null || _d === void 0 ? void 0 : _d.dataIndex : this.options.rowIndex }));
|
350
327
|
this.options.name = this.options.name || 'data';
|
351
328
|
this._path = '';
|
352
329
|
// Needs for Nextgen Rules Engine
|
@@ -523,7 +500,7 @@ class Component extends Element_1.default {
|
|
523
500
|
label.labelPosition = this.component.labelPosition;
|
524
501
|
label.tooltipClass = `${this.iconClass('question-sign')} text-muted`;
|
525
502
|
const isPDFReadOnlyMode = this.isPDFReadOnlyMode;
|
526
|
-
if (this.hasInput && this.component.validate && (0,
|
503
|
+
if (this.hasInput && this.component.validate && (0, utils_2.boolValue)(this.component.validate.required) && !isPDFReadOnlyMode) {
|
527
504
|
label.className += ' field-required';
|
528
505
|
}
|
529
506
|
if (label.hidden) {
|
@@ -556,7 +533,7 @@ class Component extends Element_1.default {
|
|
556
533
|
*/
|
557
534
|
set rowIndex(value) {
|
558
535
|
var _a, _b;
|
559
|
-
this.paths =
|
536
|
+
this.paths = utils_1.default.getComponentPaths(this.component, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.component, Object.assign(Object.assign({}, (((_b = this.parent) === null || _b === void 0 ? void 0 : _b.paths) || {})), { dataIndex: value }));
|
560
537
|
this._rowIndex = value;
|
561
538
|
}
|
562
539
|
afterComponentAssign() {
|
@@ -876,7 +853,7 @@ class Component extends Element_1.default {
|
|
876
853
|
* @returns {object} - The JSON schema for this component.
|
877
854
|
*/
|
878
855
|
get schema() {
|
879
|
-
return (0,
|
856
|
+
return (0, utils_2.fastCloneDeep)(this.getModifiedSchema(lodash_1.default.omit(this.component, 'id'), this.defaultSchema));
|
880
857
|
}
|
881
858
|
/**
|
882
859
|
* Returns true if component is inside DataGrid
|
@@ -1028,7 +1005,7 @@ class Component extends Element_1.default {
|
|
1028
1005
|
if (!this.shouldSanitizeValue && !forceSanitize) {
|
1029
1006
|
return dirty;
|
1030
1007
|
}
|
1031
|
-
return
|
1008
|
+
return utils_1.default.sanitize(dirty, {
|
1032
1009
|
sanitizeConfig: lodash_1.default.merge(((_a = this.options) === null || _a === void 0 ? void 0 : _a.sanitizeConfig) || {}, options || {}),
|
1033
1010
|
});
|
1034
1011
|
}
|
@@ -1147,7 +1124,7 @@ class Component extends Element_1.default {
|
|
1147
1124
|
return submissionTimezone;
|
1148
1125
|
}
|
1149
1126
|
// Return current timezone if none are provided.
|
1150
|
-
return (0,
|
1127
|
+
return (0, utils_2.currentTimezone)();
|
1151
1128
|
}
|
1152
1129
|
/**
|
1153
1130
|
*
|
@@ -1452,7 +1429,7 @@ class Component extends Element_1.default {
|
|
1452
1429
|
else {
|
1453
1430
|
this.refreshOnChanged = true;
|
1454
1431
|
}
|
1455
|
-
this.refreshOnValue = (0,
|
1432
|
+
this.refreshOnValue = (0, utils_2.fastCloneDeep)(value);
|
1456
1433
|
if (this.refreshOnChanged) {
|
1457
1434
|
if (this.component.clearOnRefresh) {
|
1458
1435
|
this.setValue(null);
|
@@ -1694,7 +1671,7 @@ class Component extends Element_1.default {
|
|
1694
1671
|
if (this.component.customClass) {
|
1695
1672
|
className += this.component.customClass;
|
1696
1673
|
}
|
1697
|
-
if (this.hasInput && this.component.validate && (0,
|
1674
|
+
if (this.hasInput && this.component.validate && (0, utils_2.boolValue)(this.component.validate.required)) {
|
1698
1675
|
className += ' required';
|
1699
1676
|
}
|
1700
1677
|
if (this.labelIsHidden()) {
|
@@ -1982,7 +1959,7 @@ class Component extends Element_1.default {
|
|
1982
1959
|
if (this._hasCondition !== null) {
|
1983
1960
|
return this._hasCondition;
|
1984
1961
|
}
|
1985
|
-
this._hasCondition =
|
1962
|
+
this._hasCondition = utils_1.default.hasCondition(this.component);
|
1986
1963
|
return this._hasCondition;
|
1987
1964
|
}
|
1988
1965
|
/**
|
@@ -2009,7 +1986,7 @@ class Component extends Element_1.default {
|
|
2009
1986
|
* @returns {boolean} - True if the condition applies to this component.
|
2010
1987
|
*/
|
2011
1988
|
checkCondition(row, data) {
|
2012
|
-
return
|
1989
|
+
return utils_1.default.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);
|
2013
1990
|
}
|
2014
1991
|
/**
|
2015
1992
|
* Check for conditionals and hide/show the element based on those conditions.
|
@@ -2065,9 +2042,9 @@ class Component extends Element_1.default {
|
|
2065
2042
|
if (logics.length === 0) {
|
2066
2043
|
return;
|
2067
2044
|
}
|
2068
|
-
const newComponent = (0,
|
2045
|
+
const newComponent = (0, utils_2.fastCloneDeep)(this.originalComponent);
|
2069
2046
|
let changed = logics.reduce((changed, logic) => {
|
2070
|
-
const result =
|
2047
|
+
const result = utils_1.default.checkTrigger(newComponent, logic.trigger, row, data, this.root ? this.root._form : {}, this);
|
2071
2048
|
return (result ? this.applyActions(newComponent, logic.actions, result, row, data) : false) || changed;
|
2072
2049
|
}, false);
|
2073
2050
|
// If component definition changed, replace and mark as changed.
|
@@ -2134,7 +2111,7 @@ class Component extends Element_1.default {
|
|
2134
2111
|
return actions.reduce((changed, action) => {
|
2135
2112
|
switch (action.type) {
|
2136
2113
|
case 'property': {
|
2137
|
-
|
2114
|
+
utils_1.default.setActionProperty(newComponent, action, result, row, data, this);
|
2138
2115
|
const property = action.property.value;
|
2139
2116
|
if (!lodash_1.default.isEqual(lodash_1.default.get(this.component, property), lodash_1.default.get(newComponent, property))) {
|
2140
2117
|
// Advanced Logic can modify the component's hidden property; because we track conditionally hidden state
|
@@ -2647,7 +2624,7 @@ class Component extends Element_1.default {
|
|
2647
2624
|
if (this.component.type !== 'textfield') {
|
2648
2625
|
const placeholderChar = this.placeholderChar;
|
2649
2626
|
value = (0, vanilla_text_mask_1.conformToMask)(value, this.defaultMask, { placeholderChar }).conformedValue;
|
2650
|
-
if (!
|
2627
|
+
if (!utils_1.default.matchInputMask(value, this.defaultMask)) {
|
2651
2628
|
value = '';
|
2652
2629
|
}
|
2653
2630
|
}
|
@@ -2968,7 +2945,7 @@ class Component extends Element_1.default {
|
|
2968
2945
|
}
|
2969
2946
|
if (fromSubmission) {
|
2970
2947
|
// If we set value from submission and it differs from calculated one, set the calculated value to prevent overriding dataValue in the next pass
|
2971
|
-
this.calculatedValue = (0,
|
2948
|
+
this.calculatedValue = (0, utils_2.fastCloneDeep)(calculatedValue);
|
2972
2949
|
return false;
|
2973
2950
|
}
|
2974
2951
|
// If this is the firstPass, and the dataValue is different than to the calculatedValue.
|
@@ -2977,7 +2954,7 @@ class Component extends Element_1.default {
|
|
2977
2954
|
return true;
|
2978
2955
|
}
|
2979
2956
|
}
|
2980
|
-
this.calculatedValue = (0,
|
2957
|
+
this.calculatedValue = (0, utils_2.fastCloneDeep)(calculatedValue);
|
2981
2958
|
if (changed) {
|
2982
2959
|
if (!flags.noPristineChangeOnModified && this.root.initialized) {
|
2983
2960
|
this.pristine = false;
|
@@ -3038,7 +3015,7 @@ class Component extends Element_1.default {
|
|
3038
3015
|
var _a;
|
3039
3016
|
const { local } = options;
|
3040
3017
|
if (!row) {
|
3041
|
-
row = (0,
|
3018
|
+
row = (0, utils_2.getContextualRowData)(this.component, data, this.paths);
|
3042
3019
|
}
|
3043
3020
|
if (!ignoreCondition && !this.checkCondition(row, data)) {
|
3044
3021
|
return '';
|
@@ -3067,7 +3044,7 @@ class Component extends Element_1.default {
|
|
3067
3044
|
]
|
3068
3045
|
});
|
3069
3046
|
const errors = validationScope.errors;
|
3070
|
-
const interpolatedErrors =
|
3047
|
+
const interpolatedErrors = utils_1.default.interpolateErrors(this.component, errors, this.t.bind(this));
|
3071
3048
|
return lodash_1.default.map(interpolatedErrors, 'message').join('\n\n');
|
3072
3049
|
}
|
3073
3050
|
/**
|
@@ -3098,7 +3075,7 @@ class Component extends Element_1.default {
|
|
3098
3075
|
*/
|
3099
3076
|
interpolateErrors(errors) {
|
3100
3077
|
var _a;
|
3101
|
-
const interpolatedErrors =
|
3078
|
+
const interpolatedErrors = utils_1.default.interpolateErrors(this.component, errors, this.t.bind(this));
|
3102
3079
|
return ((_a = this.serverErrors) === null || _a === void 0 ? void 0 : _a.length) ? [...interpolatedErrors, ...this.serverErrors] : interpolatedErrors;
|
3103
3080
|
}
|
3104
3081
|
/**
|
@@ -3318,7 +3295,7 @@ class Component extends Element_1.default {
|
|
3318
3295
|
}
|
3319
3296
|
});
|
3320
3297
|
this.addEventListener(element, 'blur', () => {
|
3321
|
-
this.root.pendingBlur =
|
3298
|
+
this.root.pendingBlur = utils_1.default.delay(() => {
|
3322
3299
|
this.emit('blur', this);
|
3323
3300
|
if (this.component.validateOn === 'blur') {
|
3324
3301
|
this.root.triggerChange({ fromBlur: true }, {
|
@@ -3566,7 +3543,7 @@ class Component extends Element_1.default {
|
|
3566
3543
|
if (logic.trigger.type === 'event') {
|
3567
3544
|
const event = this.interpolate(logic.trigger.event);
|
3568
3545
|
this.on(event, (...args) => {
|
3569
|
-
const newComponent = (0,
|
3546
|
+
const newComponent = (0, utils_2.fastCloneDeep)(this.originalComponent);
|
3570
3547
|
if (this.applyActions(newComponent, logic.actions, args)) {
|
3571
3548
|
// If component definition changed, replace it.
|
3572
3549
|
if (!lodash_1.default.isEqual(this.component, newComponent)) {
|
@@ -3701,7 +3678,7 @@ Component.requireLibrary = function (name, property, src, polling) {
|
|
3701
3678
|
}.bind(Component.externalLibraries[name]);
|
3702
3679
|
}
|
3703
3680
|
// See if the plugin already exists.
|
3704
|
-
const plugin = (0,
|
3681
|
+
const plugin = (0, utils_2.getScriptPlugin)(property);
|
3705
3682
|
if (plugin) {
|
3706
3683
|
Component.externalLibraries[name].resolve(plugin);
|
3707
3684
|
}
|
@@ -3744,7 +3721,7 @@ Component.requireLibrary = function (name, property, src, polling) {
|
|
3744
3721
|
// if no callback is provided, then check periodically for the script.
|
3745
3722
|
if (polling) {
|
3746
3723
|
setTimeout(function checkLibrary() {
|
3747
|
-
const plugin = (0,
|
3724
|
+
const plugin = (0, utils_2.getScriptPlugin)(property);
|
3748
3725
|
if (plugin) {
|
3749
3726
|
Component.externalLibraries[name].resolve(plugin);
|
3750
3727
|
}
|