@formio/js 5.1.2 → 5.2.0-dev.6141.ebbe6dc
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/Changelog.md +6876 -0
- 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 +110 -121
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +116 -127
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +59 -48
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +68 -68
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Element.js +13 -36
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/EventEmitter.js +2 -25
- package/lib/cjs/Form.js +2 -25
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/PDFBuilder.js +4 -5
- package/lib/cjs/Webform.js +3 -4
- 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.d.ts +4 -0
- package/lib/cjs/components/_classes/component/Component.js +33 -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.js +1 -1
- 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 +1 -1
- 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 +10 -2
- 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 +20 -6
- package/lib/cjs/utils/Evaluator.js +38 -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 +167 -2
- package/lib/cjs/utils/index.js +22 -2
- package/lib/cjs/utils/utils.d.ts +0 -5
- package/lib/cjs/utils/utils.js +4 -42
- package/lib/cjs/widgets/CalendarWidget.js +1 -1
- package/lib/mjs/Element.js +6 -6
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/EventEmitter.js +2 -2
- package/lib/mjs/Form.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/PDF.js +1 -1
- package/lib/mjs/PDFBuilder.js +1 -2
- package/lib/mjs/Webform.js +1 -2
- 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.d.ts +4 -0
- package/lib/mjs/components/_classes/component/Component.js +6 -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.js +1 -1
- 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 +1 -1
- 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 +10 -2
- 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 +20 -6
- package/lib/mjs/utils/Evaluator.js +31 -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 +167 -2
- package/lib/mjs/utils/index.js +18 -1
- package/lib/mjs/utils/utils.d.ts +0 -5
- package/lib/mjs/utils/utils.js +1 -23
- package/lib/mjs/widgets/CalendarWidget.js +1 -1
- package/package.json +2 -2
package/lib/cjs/utils/index.js
CHANGED
@@ -22,11 +22,31 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
22
|
__setModuleDefault(result, mod);
|
23
23
|
return result;
|
24
24
|
};
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
27
|
+
};
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
30
|
+
};
|
25
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.Utils = void 0;
|
27
|
-
const
|
32
|
+
exports.registerEvaluator = exports.Evaluator = exports.Utils = void 0;
|
33
|
+
const utils = __importStar(require("./utils"));
|
34
|
+
const formUtils = __importStar(require("./formUtils"));
|
35
|
+
const Evaluator_1 = require("./Evaluator");
|
36
|
+
Object.defineProperty(exports, "Evaluator", { enumerable: true, get: function () { return Evaluator_1.Evaluator; } });
|
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"));
|
41
|
+
const FormioUtils = Object.assign(Object.assign(Object.assign({}, utils), formUtils), { Evaluator: Evaluator_1.Evaluator,
|
42
|
+
interpolate: Evaluator_1.interpolate,
|
43
|
+
ConditionOperators: conditionOperators_1.default,
|
44
|
+
_: lodash_1.default,
|
45
|
+
moment: moment_1.default });
|
28
46
|
exports.Utils = FormioUtils;
|
29
47
|
if (typeof global === 'object') {
|
30
48
|
global.FormioUtils = FormioUtils;
|
31
49
|
}
|
50
|
+
__exportStar(require("./utils"), exports);
|
51
|
+
__exportStar(require("./formUtils"), exports);
|
32
52
|
exports.default = FormioUtils;
|
package/lib/cjs/utils/utils.d.ts
CHANGED
@@ -490,7 +490,6 @@ export function getFocusableElements(element: HTMLElement): NodeList<HTMLElement
|
|
490
490
|
* @returns {Array<string>|null} - The saved types for the component
|
491
491
|
*/
|
492
492
|
export function getComponentSavedTypes(fullSchema: import('@formio/core').Component): Array<string> | null;
|
493
|
-
export * from "./formUtils";
|
494
493
|
/**
|
495
494
|
* Map values through unfold and return first non-nil value.
|
496
495
|
* @param {Array<T>} collection - The collection to map through unfold.;
|
@@ -507,7 +506,3 @@ export namespace componentValueTypes {
|
|
507
506
|
let any: string;
|
508
507
|
}
|
509
508
|
export function interpolateErrors(component: Component, errors: FieldError[], interpolateFn: Function): [];
|
510
|
-
import ConditionOperators from './conditionOperators';
|
511
|
-
import { Evaluator } from './Evaluator';
|
512
|
-
export const interpolate: typeof Evaluator.interpolate;
|
513
|
-
export { jsonLogic, ConditionOperators, moment, Evaluator, _ };
|
package/lib/cjs/utils/utils.js
CHANGED
@@ -1,57 +1,19 @@
|
|
1
1
|
"use strict";
|
2
|
-
/* global jQuery */
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
-
if (k2 === undefined) k2 = k;
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
-
}
|
9
|
-
Object.defineProperty(o, k2, desc);
|
10
|
-
}) : (function(o, m, k, k2) {
|
11
|
-
if (k2 === undefined) k2 = k;
|
12
|
-
o[k2] = m[k];
|
13
|
-
}));
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
16
|
-
};
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
19
4
|
};
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
21
|
-
exports.firstNonNil = exports.unfold = exports.bootstrapVersion = exports.uniqueKey = exports.iterateKey = exports.delay = exports.fieldData = exports.getCurrencyAffixes = exports.getNumberDecimalLimit = exports.getNumberSeparators = exports.matchInputMask = exports.unmaskValue = exports.getInputMask = exports.convertFormatToMask = exports.convertFormatToMoment = exports.convertFormatToFlatpickr = exports.getLocaleDateFormatInfo = exports.formatOffset = exports.formatDate = exports.momentDate = exports.loadZones = exports.shouldLoadZones = exports.zonesLoaded = exports.offsetDate = exports.currentTimezone = exports.isValidDate = exports.getDateSetting = exports.guid = exports.uniqueName = exports.convertStringToHTMLElement = exports.unescapeHTML = exports.removeHTML = exports.setActionProperty = exports.checkTrigger = exports.checkCondition = exports.checkJsonConditional = exports.checkCustomConditional = exports.getComponentActualValue = exports.checkSimpleConditional = exports.checkCalculated = exports.isMongoId = exports.boolValue = exports.getScriptPlugin = exports.getElementRect = exports.getPropertyValue = exports.getRandomComponentId = exports.evaluate =
|
22
|
-
exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports.
|
6
|
+
exports.getContextComponents = exports.observeOverload = exports.withSwitch = exports.firstNonNil = exports.unfold = exports.bootstrapVersion = exports.uniqueKey = exports.iterateKey = exports.delay = exports.fieldData = exports.getCurrencyAffixes = exports.getNumberDecimalLimit = exports.getNumberSeparators = exports.matchInputMask = exports.unmaskValue = exports.getInputMask = exports.convertFormatToMask = exports.convertFormatToMoment = exports.convertFormatToFlatpickr = exports.getLocaleDateFormatInfo = exports.formatOffset = exports.formatDate = exports.momentDate = exports.loadZones = exports.shouldLoadZones = exports.zonesLoaded = exports.offsetDate = exports.currentTimezone = exports.isValidDate = exports.getDateSetting = exports.guid = exports.uniqueName = exports.convertStringToHTMLElement = exports.unescapeHTML = exports.removeHTML = exports.setActionProperty = exports.checkTrigger = exports.checkCondition = exports.checkJsonConditional = exports.checkCustomConditional = exports.getComponentActualValue = exports.checkSimpleConditional = exports.checkCalculated = exports.isMongoId = exports.boolValue = exports.getScriptPlugin = exports.getElementRect = exports.getPropertyValue = exports.getRandomComponentId = exports.evaluate = void 0;
|
7
|
+
exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports.getFocusableElements = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = void 0;
|
8
|
+
/* global jQuery */
|
23
9
|
const lodash_1 = __importDefault(require("lodash"));
|
24
|
-
exports._ = lodash_1.default;
|
25
|
-
const json_logic_js_1 = __importDefault(require("json-logic-js"));
|
26
|
-
exports.jsonLogic = json_logic_js_1.default;
|
27
10
|
const moment_timezone_1 = __importDefault(require("moment-timezone/moment-timezone"));
|
28
|
-
exports.moment = moment_timezone_1.default;
|
29
11
|
const jstimezonedetect_1 = __importDefault(require("jstimezonedetect"));
|
30
|
-
const operators_1 = require("./jsonlogic/operators");
|
31
12
|
const dompurify_1 = __importDefault(require("dompurify"));
|
32
13
|
const formUtils_1 = require("./formUtils");
|
33
14
|
const Evaluator_1 = require("./Evaluator");
|
34
|
-
Object.defineProperty(exports, "Evaluator", { enumerable: true, get: function () { return Evaluator_1.Evaluator; } });
|
35
15
|
const conditionOperators_1 = __importDefault(require("./conditionOperators"));
|
36
|
-
exports.ConditionOperators = conditionOperators_1.default;
|
37
16
|
const core_1 = require("@formio/core");
|
38
|
-
const interpolate = Evaluator_1.Evaluator.interpolate;
|
39
|
-
exports.interpolate = interpolate;
|
40
|
-
__exportStar(require("./formUtils"), exports);
|
41
|
-
// Configure JsonLogic
|
42
|
-
operators_1.lodashOperators.forEach((name) => json_logic_js_1.default.add_operation(`_${name}`, lodash_1.default[name]));
|
43
|
-
// Retrieve Any Date
|
44
|
-
json_logic_js_1.default.add_operation('getDate', (date) => {
|
45
|
-
return (0, moment_timezone_1.default)(date).toISOString();
|
46
|
-
});
|
47
|
-
// Set Relative Minimum Date
|
48
|
-
json_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {
|
49
|
-
return (0, moment_timezone_1.default)().subtract(relativeMinDate, 'days').toISOString();
|
50
|
-
});
|
51
|
-
// Set Relative Maximum Date
|
52
|
-
json_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {
|
53
|
-
return (0, moment_timezone_1.default)().add(relativeMaxDate, 'days').toISOString();
|
54
|
-
});
|
55
17
|
/**
|
56
18
|
* Evaluate a method.
|
57
19
|
* @param {Function|string|object} func - The function to evaluate.
|
@@ -335,7 +297,7 @@ exports.checkCustomConditional = checkCustomConditional;
|
|
335
297
|
*/
|
336
298
|
function checkJsonConditional(component, json, row, data, form, onError) {
|
337
299
|
try {
|
338
|
-
return
|
300
|
+
return core_1.jsonLogic.apply(json, {
|
339
301
|
data,
|
340
302
|
row,
|
341
303
|
form,
|
@@ -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 InputWidget_1 = __importDefault(require("./InputWidget"));
|
8
|
-
const utils_1 = require("../utils
|
8
|
+
const utils_1 = require("../utils");
|
9
9
|
const moment_1 = __importDefault(require("moment"));
|
10
10
|
const lodash_1 = __importDefault(require("lodash"));
|
11
11
|
const DEFAULT_FORMAT = 'yyyy-MM-dd hh:mm a';
|
package/lib/mjs/Element.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import EventEmitter from './EventEmitter';
|
2
|
-
import { Formio } from './Formio';
|
3
|
-
import * as FormioUtils from './utils/utils';
|
4
|
-
import { I18n } from './utils/i18n';
|
5
1
|
import _ from 'lodash';
|
6
2
|
import moment from 'moment';
|
7
3
|
import maskInput from '@formio/vanilla-text-mask';
|
4
|
+
import EventEmitter from './EventEmitter';
|
5
|
+
import { Formio } from './Formio';
|
6
|
+
import { I18n } from './utils/i18n';
|
7
|
+
import FormioUtils from './utils';
|
8
8
|
/**
|
9
9
|
* The root component for all elements within the Form.io renderer.
|
10
10
|
*/
|
@@ -523,9 +523,9 @@ export default class Element {
|
|
523
523
|
if (this.component.filter === string && !this.options.building) {
|
524
524
|
const evalContext = this.evalContext(data);
|
525
525
|
evalContext.data = _.mapValues(evalContext.data, (val) => _.isString(val) ? encodeURIComponent(val) : val);
|
526
|
-
return FormioUtils.interpolate(string, evalContext, options);
|
526
|
+
return FormioUtils.Evaluator.interpolate(string, evalContext, options);
|
527
527
|
}
|
528
|
-
return FormioUtils.interpolate(string, this.evalContext(data), options);
|
528
|
+
return FormioUtils.Evaluator.interpolate(string, this.evalContext(data), options);
|
529
529
|
}
|
530
530
|
/**
|
531
531
|
* Performs an evaluation using the evaluation context of this component.
|
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.
|
17
|
+
static version = '5.2.0-rc.5';
|
18
18
|
static setLicense(license, norecurse = false) {
|
19
19
|
Formio.license = license;
|
20
20
|
if (!norecurse && Formio.FormioClass) {
|
package/lib/mjs/EventEmitter.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { EventEmitter as EventEmitter3 } from 'eventemitter3';
|
2
|
-
import
|
2
|
+
import { observeOverload } from './utils';
|
3
3
|
export default class EventEmitter extends EventEmitter3 {
|
4
4
|
constructor(conf = {}) {
|
5
5
|
const { loadLimit = 1000, eventsSafeInterval = 300 } = conf;
|
@@ -7,7 +7,7 @@ export default class EventEmitter extends EventEmitter3 {
|
|
7
7
|
const overloadHandler = () => {
|
8
8
|
console.warn(`There were more than ${loadLimit} events emitted in ${eventsSafeInterval} ms. It might be caused by events' infinite loop`, this.id);
|
9
9
|
};
|
10
|
-
const dispatch =
|
10
|
+
const dispatch = observeOverload(overloadHandler, {
|
11
11
|
limit: loadLimit,
|
12
12
|
delay: eventsSafeInterval
|
13
13
|
});
|
package/lib/mjs/Form.js
CHANGED
@@ -2,7 +2,7 @@ import Element from './Element';
|
|
2
2
|
import { Formio } from './Formio';
|
3
3
|
import Displays from './displays';
|
4
4
|
import templates from './templates';
|
5
|
-
import
|
5
|
+
import FormioUtils from './utils';
|
6
6
|
export default class Form extends Element {
|
7
7
|
/**
|
8
8
|
* Represents a JSON value.
|
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.
|
7
|
+
FormioCore.version = '5.2.0-rc.5';
|
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) {
|
package/lib/mjs/PDF.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Formio } from './Formio';
|
2
2
|
import Webform from './Webform';
|
3
|
-
import { fastCloneDeep, eachComponent } from './utils
|
3
|
+
import { fastCloneDeep, eachComponent } from './utils';
|
4
4
|
export default class PDF extends Webform {
|
5
5
|
constructor(element, options) {
|
6
6
|
options.display = 'pdf';
|
package/lib/mjs/PDFBuilder.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import { Formio } from './Formio';
|
3
3
|
import WebformBuilder from './WebformBuilder';
|
4
|
-
import { fastCloneDeep, getElementRect, getBrowserInfo } from './utils
|
5
|
-
import { eachComponent } from './utils/formUtils';
|
4
|
+
import { fastCloneDeep, getElementRect, getBrowserInfo, eachComponent } from './utils';
|
6
5
|
import BuilderUtils from './utils/builder';
|
7
6
|
import PDF from './PDF';
|
8
7
|
export default class PDFBuilder extends WebformBuilder {
|
package/lib/mjs/Webform.js
CHANGED
@@ -6,8 +6,7 @@ import i18nDefaults from "./i18n";
|
|
6
6
|
import { Formio } from "./Formio";
|
7
7
|
import Components from "./components/Components";
|
8
8
|
import NestedDataComponent from "./components/_classes/nesteddata/NestedDataComponent";
|
9
|
-
import { fastCloneDeep, currentTimezone, unescapeHTML, getStringFromComponentPath, convertStringToHTMLElement, getArrayFromComponentPath, } from
|
10
|
-
import { eachComponent } from "./utils/formUtils";
|
9
|
+
import { fastCloneDeep, currentTimezone, unescapeHTML, getStringFromComponentPath, convertStringToHTMLElement, getArrayFromComponentPath, eachComponent } from './utils';
|
11
10
|
// We need this here because dragula pulls in CustomEvent class that requires global to exist.
|
12
11
|
if (typeof window !== 'undefined' && typeof window.global === 'undefined') {
|
13
12
|
window.global = window;
|
@@ -3,8 +3,7 @@ import Component from './components/_classes/component/Component';
|
|
3
3
|
import tippy from 'tippy.js';
|
4
4
|
import Components from './components/Components';
|
5
5
|
import { Formio } from './Formio';
|
6
|
-
import { fastCloneDeep, bootstrapVersion, getArrayFromComponentPath, getStringFromComponentPath } from './utils
|
7
|
-
import { eachComponent, getComponent } from './utils/formUtils';
|
6
|
+
import { fastCloneDeep, bootstrapVersion, getArrayFromComponentPath, getStringFromComponentPath, eachComponent, getComponent, } from './utils';
|
8
7
|
import BuilderUtils from './utils/builder';
|
9
8
|
import _ from 'lodash';
|
10
9
|
import autoScroll from 'dom-autoscroller';
|
package/lib/mjs/Wizard.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import Webform from './Webform';
|
3
3
|
import { Formio } from './Formio';
|
4
|
-
import { fastCloneDeep, checkCondition, firstNonNil, uniqueKey, eachComponent, } from './utils
|
4
|
+
import { fastCloneDeep, checkCondition, firstNonNil, uniqueKey, eachComponent, } from './utils';
|
5
5
|
export default class Wizard extends Webform {
|
6
6
|
/**
|
7
7
|
* Constructor for wizard-based forms.
|
package/lib/mjs/WizardBuilder.js
CHANGED
@@ -2,7 +2,7 @@ import WebformBuilder from './WebformBuilder';
|
|
2
2
|
import Webform from './Webform';
|
3
3
|
import BuilderUtils from './utils/builder';
|
4
4
|
import _ from 'lodash';
|
5
|
-
import { fastCloneDeep } from './utils
|
5
|
+
import { fastCloneDeep } from './utils';
|
6
6
|
export default class WizardBuilder extends WebformBuilder {
|
7
7
|
constructor() {
|
8
8
|
let element, options;
|
@@ -163,6 +163,10 @@ declare class Component extends Element {
|
|
163
163
|
*/
|
164
164
|
info: any;
|
165
165
|
get componentsMap(): object;
|
166
|
+
/**
|
167
|
+
* Returns if the parent should conditionally clear.
|
168
|
+
* @returns {boolean} - If the parent should conditionally clear.
|
169
|
+
*/
|
166
170
|
parentShouldConditionallyClear(): boolean;
|
167
171
|
parentConditionallyHidden(): boolean;
|
168
172
|
set data(value: any);
|
@@ -5,8 +5,8 @@ import _ from 'lodash';
|
|
5
5
|
import isMobile from 'ismobilejs';
|
6
6
|
import { processOne, processOneSync, validateProcessInfo } from '@formio/core/process';
|
7
7
|
import { Formio } from '../../../Formio';
|
8
|
-
import
|
9
|
-
import { fastCloneDeep, boolValue, currentTimezone, getScriptPlugin, getContextualRowData } from '../../../utils
|
8
|
+
import FormioUtils from '../../../utils';
|
9
|
+
import { fastCloneDeep, boolValue, currentTimezone, getScriptPlugin, getContextualRowData } from '../../../utils';
|
10
10
|
import Element from '../../../Element';
|
11
11
|
import ComponentModal from '../componentModal/ComponentModal';
|
12
12
|
import Widgets from '../../../widgets';
|
@@ -418,6 +418,10 @@ export default class Component extends Element {
|
|
418
418
|
get componentsMap() {
|
419
419
|
return this.root?.childComponentsMap || {};
|
420
420
|
}
|
421
|
+
/**
|
422
|
+
* Returns if the parent should conditionally clear.
|
423
|
+
* @returns {boolean} - If the parent should conditionally clear.
|
424
|
+
*/
|
421
425
|
parentShouldConditionallyClear() {
|
422
426
|
let currentParent = this.parent;
|
423
427
|
while (currentParent) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import _ from 'lodash';
|
2
|
-
import { fastCloneDeep } from '../../../utils
|
2
|
+
import { fastCloneDeep } from '../../../utils';
|
3
3
|
export default class ComponentModal {
|
4
4
|
static render(component, data, topLevel) {
|
5
5
|
const children = component.renderTemplate('component', data, topLevel);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import Multivalue from '../multivalue/Multivalue';
|
2
|
-
import { convertStringToHTMLElement } from '../../../utils
|
2
|
+
import { convertStringToHTMLElement } from '../../../utils';
|
3
3
|
import Widgets from '../../../widgets';
|
4
4
|
import _ from 'lodash';
|
5
5
|
export default class Input extends Multivalue {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import Field from '../field/Field';
|
2
2
|
import { Formio } from '../../../Formio';
|
3
3
|
import _ from 'lodash';
|
4
|
-
import { getItemTemplateKeys } from '../../../utils
|
4
|
+
import { getItemTemplateKeys } from '../../../utils';
|
5
5
|
export default class ListComponent extends Field {
|
6
6
|
static schema(...extend) {
|
7
7
|
return Field.schema({
|
@@ -3,7 +3,7 @@ import _ from 'lodash';
|
|
3
3
|
import Field from '../field/Field';
|
4
4
|
import Components from '../../Components';
|
5
5
|
'';
|
6
|
-
import
|
6
|
+
import FormioUtils from '../../../utils';
|
7
7
|
import { process as processAsync, processSync } from '@formio/core/process';
|
8
8
|
/**
|
9
9
|
* NestedComponent class.
|
@@ -204,7 +204,7 @@ export default class NestedComponent extends Field {
|
|
204
204
|
*/
|
205
205
|
set rowIndex(value) {
|
206
206
|
this._rowIndex = value;
|
207
|
-
this.paths = getComponentPaths(this.component, this.parent?.component, {
|
207
|
+
this.paths = FormioUtils.getComponentPaths(this.component, this.parent?.component, {
|
208
208
|
...(this.parent?.paths || {}),
|
209
209
|
...{ dataIndex: value }
|
210
210
|
});
|
@@ -308,7 +308,7 @@ export default class NestedComponent extends Field {
|
|
308
308
|
* @returns {any} - The component that is located.
|
309
309
|
*/
|
310
310
|
getComponent(path) {
|
311
|
-
path = getStringFromComponentPath(path);
|
311
|
+
path = FormioUtils.getStringFromComponentPath(path);
|
312
312
|
const matches = {
|
313
313
|
path: undefined,
|
314
314
|
fullPath: undefined,
|
@@ -320,7 +320,7 @@ export default class NestedComponent extends Field {
|
|
320
320
|
};
|
321
321
|
this.everyComponent((component) => {
|
322
322
|
// All searches are relative to this component so replace this path from the child paths.
|
323
|
-
componentMatches(component.component, {
|
323
|
+
FormioUtils.componentMatches(component.component, {
|
324
324
|
path: component.paths?.path?.replace(new RegExp(`^${this.paths?.path}\\.?`), ''),
|
325
325
|
fullPath: component.paths?.fullPath?.replace(new RegExp(`^${this.paths?.fullPath}\\.?`), ''),
|
326
326
|
localPath: component.paths?.localPath?.replace(new RegExp(`^${this.paths?.localPath}\\.?`), ''),
|
@@ -332,7 +332,7 @@ export default class NestedComponent extends Field {
|
|
332
332
|
return match;
|
333
333
|
});
|
334
334
|
});
|
335
|
-
return getBestMatch(matches)?.instance;
|
335
|
+
return FormioUtils.getBestMatch(matches)?.instance;
|
336
336
|
}
|
337
337
|
/**
|
338
338
|
* Return a component provided the Id of the component.
|
@@ -374,7 +374,7 @@ export default class NestedComponent extends Field {
|
|
374
374
|
options.localRoot = this.localRoot;
|
375
375
|
options.skipInit = true;
|
376
376
|
if (!(options.display === 'pdf' && this.builderMode)) {
|
377
|
-
component.id = getRandomComponentId();
|
377
|
+
component.id = FormioUtils.getRandomComponentId();
|
378
378
|
}
|
379
379
|
const comp = Components.create(component, options, data, true);
|
380
380
|
comp.init();
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import _ from 'lodash';
|
3
3
|
import { Utils } from '@formio/core/utils';
|
4
4
|
const { getComponentPaths } = Utils;
|
5
|
-
import { componentValueTypes } from '../../../utils
|
5
|
+
import { componentValueTypes } from '../../../utils';
|
6
6
|
import Component from '../component/Component';
|
7
7
|
import NestedDataComponent from '../nesteddata/NestedDataComponent';
|
8
8
|
export default class NestedArrayComponent extends NestedDataComponent {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import Component from '../component/Component';
|
3
3
|
import NestedComponent from '../nested/NestedComponent';
|
4
4
|
import _ from 'lodash';
|
5
|
-
import { componentValueTypes, getComponentSavedTypes } from '../../../utils
|
5
|
+
import { componentValueTypes, getComponentSavedTypes } from '../../../utils';
|
6
6
|
export default class NestedDataComponent extends NestedComponent {
|
7
7
|
hasChanged(newValue, oldValue) {
|
8
8
|
// If we do not have a value and are getting set to anything other than undefined or null, then we changed.
|
@@ -5,7 +5,7 @@ import { GoogleAddressProvider } from '../../providers/address/GoogleAddressProv
|
|
5
5
|
import Field from '../_classes/field/Field';
|
6
6
|
import NestedComponent from '../_classes/nested/NestedComponent';
|
7
7
|
import ContainerComponent from '../container/Container';
|
8
|
-
import { componentValueTypes, getComponentSavedTypes } from '../../utils
|
8
|
+
import { componentValueTypes, getComponentSavedTypes } from '../../utils';
|
9
9
|
export const AddressComponentMode = {
|
10
10
|
Autocomplete: 'autocomplete',
|
11
11
|
Manual: 'manual',
|
@@ -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): any;
|
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/formUtils';
|
5
5
|
export default class ButtonComponent extends Field {
|
6
6
|
static schema(...extend) {
|
7
7
|
return Input.schema({
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import _ from 'lodash';
|
2
|
-
import { componentValueTypes, getComponentSavedTypes } from '../../utils
|
2
|
+
import { componentValueTypes, getComponentSavedTypes } from '../../utils';
|
3
3
|
import Field from '../_classes/field/Field';
|
4
4
|
export default class CheckBoxComponent extends Field {
|
5
5
|
static schema(...extend) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import _ from 'lodash';
|
2
|
-
import { componentValueTypes, getComponentSavedTypes, getFocusableElements } from '../../utils
|
2
|
+
import { componentValueTypes, getComponentSavedTypes, getFocusableElements } from '../../utils';
|
3
3
|
import Component from '../_classes/component/Component';
|
4
4
|
import Field from '../_classes/field/Field';
|
5
5
|
import NestedDataComponent from '../_classes/nesteddata/NestedDataComponent';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createNumberMask } from '@formio/text-mask-addons';
|
2
2
|
import { maskInput } from '@formio/vanilla-text-mask';
|
3
3
|
import _ from 'lodash';
|
4
|
-
import { getCurrencyAffixes } from '../../utils
|
4
|
+
import { getCurrencyAffixes } from '../../utils';
|
5
5
|
import NumberComponent from '../number/Number';
|
6
6
|
export default class CurrencyComponent extends NumberComponent {
|
7
7
|
static schema(...extend) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
|
3
|
-
import { fastCloneDeep, getFocusableElements, getComponent } from '../../utils
|
3
|
+
import { fastCloneDeep, getFocusableElements, getComponent } from '../../utils';
|
4
4
|
import dragula from 'dragula';
|
5
5
|
export default class DataGridComponent extends NestedArrayComponent {
|
6
6
|
static schema(...extend) {
|
@@ -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/formUtils';
|
6
6
|
export default class DataMapComponent extends DataGridComponent {
|
7
7
|
static schema(...extend) {
|
8
8
|
return Component.schema({
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import moment from 'moment';
|
3
3
|
import FormioUtils from '../../utils';
|
4
|
-
import { componentValueTypes, fastCloneDeep, getComponentSavedTypes } from '../../utils
|
4
|
+
import { componentValueTypes, fastCloneDeep, getComponentSavedTypes } from '../../utils';
|
5
5
|
import Input from '../_classes/input/Input';
|
6
6
|
export default class DateTimeComponent extends Input {
|
7
7
|
static schema(...extend) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import moment from 'moment';
|
3
3
|
import Field from '../_classes/field/Field';
|
4
|
-
import { boolValue, componentValueTypes, getComponentSavedTypes, getLocaleDateFormatInfo } from '../../utils
|
4
|
+
import { boolValue, componentValueTypes, getComponentSavedTypes, getLocaleDateFormatInfo } from '../../utils';
|
5
5
|
import { getDayFormat } from '@formio/core';
|
6
6
|
export default class DayComponent extends Field {
|
7
7
|
static schema(...extend) {
|
@@ -4,7 +4,7 @@ import { editgrid as templates } from '@formio/bootstrap/components';
|
|
4
4
|
import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
|
5
5
|
import Component from '../_classes/component/Component';
|
6
6
|
import Alert from '../alert/Alert';
|
7
|
-
import { fastCloneDeep, Evaluator, getArrayFromComponentPath, eachComponent } from '../../utils
|
7
|
+
import { fastCloneDeep, Evaluator, getArrayFromComponentPath, eachComponent } from '../../utils';
|
8
8
|
const EditRowState = {
|
9
9
|
New: 'new',
|
10
10
|
Editing: 'editing',
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import Field from '../_classes/field/Field';
|
2
|
-
import { componentValueTypes, getComponentSavedTypes, uniqueName } from '../../utils
|
2
|
+
import { componentValueTypes, getComponentSavedTypes, uniqueName } from '../../utils';
|
3
3
|
import download from 'downloadjs';
|
4
4
|
import _ from 'lodash';
|
5
5
|
import fileProcessor from '../../providers/processor/fileProcessor';
|
@@ -3,7 +3,7 @@ import _ from 'lodash';
|
|
3
3
|
import Component from '../_classes/component/Component';
|
4
4
|
import ComponentModal from '../_classes/componentModal/ComponentModal';
|
5
5
|
import EventEmitter from 'eventemitter3';
|
6
|
-
import { isMongoId, eachComponent, componentValueTypes } from '../../utils
|
6
|
+
import { isMongoId, eachComponent, componentValueTypes } from '../../utils';
|
7
7
|
import { Formio } from '../../Formio';
|
8
8
|
import Form from '../../Form';
|
9
9
|
export default class FormComponent extends Component {
|
@@ -2,7 +2,7 @@ import { createNumberMask } from '@formio/text-mask-addons';
|
|
2
2
|
import { conformToMask, maskInput } from '@formio/vanilla-text-mask';
|
3
3
|
import _ from 'lodash';
|
4
4
|
import Input from '../_classes/input/Input';
|
5
|
-
import { getNumberSeparators, getNumberDecimalLimit, componentValueTypes, getComponentSavedTypes } from '../../utils/
|
5
|
+
import { getNumberSeparators, getNumberDecimalLimit, componentValueTypes, getComponentSavedTypes } from '../../utils/';
|
6
6
|
export default class NumberComponent extends Input {
|
7
7
|
static schema(...extend) {
|
8
8
|
return Input.schema({
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import NestedComponent from '../_classes/nested/NestedComponent';
|
2
|
-
import { isChildOf } from '../../utils
|
2
|
+
import { isChildOf } from '../../utils';
|
3
3
|
export default class PanelComponent extends NestedComponent {
|
4
4
|
static schema(...extend) {
|
5
5
|
return NestedComponent.schema({
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import ListComponent from '../_classes/list/ListComponent';
|
3
3
|
import { Formio } from '../../Formio';
|
4
|
-
import { boolValue, componentValueTypes, getComponentSavedTypes } from '../../utils
|
4
|
+
import { boolValue, componentValueTypes, getComponentSavedTypes } from '../../utils';
|
5
5
|
export default class RadioComponent extends ListComponent {
|
6
6
|
static schema(...extend) {
|
7
7
|
return ListComponent.schema({
|