@formio/js 5.0.0-rc.60 → 5.0.0-rc.62
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +8 -8
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +47 -47
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +3 -3
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +2 -2
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Element.d.ts +1 -1
- package/lib/cjs/Embed.d.ts +2 -2
- package/lib/cjs/Embed.js +10 -10
- package/lib/cjs/Form.d.ts +3 -3
- package/lib/cjs/FormBuilder.d.ts +3 -42
- package/lib/cjs/InlineEmbed.js +2 -2
- package/lib/cjs/PDF.d.ts +1 -1
- package/lib/cjs/Webform.d.ts +3 -4
- package/lib/cjs/WebformBuilder.d.ts +1 -1
- package/lib/cjs/components/_classes/component/Component.form.d.ts +1 -1
- package/lib/cjs/components/_classes/component/Component.form.js +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +7 -7
- package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +1 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +1 -1
- package/lib/cjs/components/address/Address.form.d.ts +1 -1
- package/lib/cjs/components/address/Address.form.js +1 -1
- package/lib/cjs/components/button/Button.form.d.ts +1 -1
- package/lib/cjs/components/button/Button.form.js +1 -1
- package/lib/cjs/components/checkbox/Checkbox.form.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.form.js +1 -1
- package/lib/cjs/components/columns/Columns.form.d.ts +1 -1
- package/lib/cjs/components/columns/Columns.form.js +1 -1
- package/lib/cjs/components/container/Container.form.d.ts +1 -1
- package/lib/cjs/components/container/Container.form.js +1 -1
- package/lib/cjs/components/content/Content.form.d.ts +1 -1
- package/lib/cjs/components/content/Content.form.js +1 -1
- package/lib/cjs/components/currency/Currency.form.d.ts +1 -1
- package/lib/cjs/components/currency/Currency.form.js +1 -1
- package/lib/cjs/components/datagrid/DataGrid.form.d.ts +1 -1
- package/lib/cjs/components/datagrid/DataGrid.form.js +1 -1
- package/lib/cjs/components/datamap/DataMap.form.d.ts +1 -1
- package/lib/cjs/components/datamap/DataMap.form.js +1 -1
- package/lib/cjs/components/datetime/DateTime.form.d.ts +1 -1
- package/lib/cjs/components/datetime/DateTime.form.js +1 -1
- package/lib/cjs/components/day/Day.form.d.ts +1 -1
- package/lib/cjs/components/day/Day.form.js +1 -1
- package/lib/cjs/components/editgrid/EditGrid.form.d.ts +1 -1
- package/lib/cjs/components/editgrid/EditGrid.form.js +1 -1
- package/lib/cjs/components/email/Email.form.d.ts +1 -1
- package/lib/cjs/components/email/Email.form.js +1 -1
- package/lib/cjs/components/fieldset/Fieldset.form.d.ts +1 -1
- package/lib/cjs/components/fieldset/Fieldset.form.js +1 -1
- package/lib/cjs/components/file/File.form.d.ts +1 -1
- package/lib/cjs/components/file/File.form.js +1 -1
- package/lib/cjs/components/form/Form.form.d.ts +1 -1
- package/lib/cjs/components/form/Form.form.js +1 -1
- package/lib/cjs/components/hidden/Hidden.form.d.ts +1 -1
- package/lib/cjs/components/hidden/Hidden.form.js +1 -1
- package/lib/cjs/components/html/HTML.form.d.ts +1 -1
- package/lib/cjs/components/html/HTML.form.js +1 -1
- package/lib/cjs/components/number/Number.form.d.ts +1 -1
- package/lib/cjs/components/number/Number.form.js +1 -1
- package/lib/cjs/components/panel/Panel.form.d.ts +1 -1
- package/lib/cjs/components/panel/Panel.form.js +1 -1
- package/lib/cjs/components/password/Password.form.d.ts +1 -1
- package/lib/cjs/components/password/Password.form.js +1 -1
- package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +1 -1
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +1 -1
- package/lib/cjs/components/radio/Radio.form.d.ts +1 -1
- package/lib/cjs/components/radio/Radio.form.js +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +1 -1
- package/lib/cjs/components/select/Select.form.d.ts +1 -1
- package/lib/cjs/components/select/Select.form.js +1 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +1 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +1 -1
- package/lib/cjs/components/signature/Signature.form.d.ts +1 -1
- package/lib/cjs/components/signature/Signature.form.js +1 -1
- package/lib/cjs/components/survey/Survey.form.d.ts +1 -1
- package/lib/cjs/components/survey/Survey.form.js +1 -1
- package/lib/cjs/components/table/Table.form.d.ts +1 -1
- package/lib/cjs/components/table/Table.form.js +1 -1
- package/lib/cjs/components/tabs/Tabs.form.d.ts +1 -1
- package/lib/cjs/components/tabs/Tabs.form.js +1 -1
- package/lib/cjs/components/tags/Tags.form.d.ts +1 -1
- package/lib/cjs/components/tags/Tags.form.js +1 -1
- package/lib/cjs/components/textarea/TextArea.form.d.ts +1 -1
- package/lib/cjs/components/textarea/TextArea.form.js +1 -1
- package/lib/cjs/components/textfield/TextField.form.d.ts +1 -1
- package/lib/cjs/components/textfield/TextField.form.js +1 -1
- package/lib/cjs/components/time/Time.form.d.ts +1 -1
- package/lib/cjs/components/time/Time.form.js +1 -1
- package/lib/cjs/components/unknown/Unknown.form.js +1 -1
- package/lib/cjs/components/url/Url.form.d.ts +1 -1
- package/lib/cjs/components/url/Url.form.js +1 -1
- package/lib/cjs/components/well/Well.form.d.ts +1 -1
- package/lib/cjs/components/well/Well.form.js +1 -1
- package/lib/cjs/formio.form.js +3 -3
- package/lib/cjs/providers/address/AzureAddressProvider.d.ts +1 -1
- package/lib/cjs/providers/storage/util.js +4 -3
- package/lib/cjs/templates/index.d.ts +14 -14
- package/lib/cjs/utils/calendarUtils.js +3 -3
- package/lib/cjs/utils/formUtils.d.ts +3 -3
- package/lib/cjs/utils/formUtils.js +2 -2
- package/lib/cjs/utils/utils.d.ts +14 -14
- package/lib/cjs/utils/utils.js +71 -70
- package/lib/mjs/Element.d.ts +1 -1
- package/lib/mjs/Embed.d.ts +2 -2
- package/lib/mjs/Form.d.ts +3 -3
- package/lib/mjs/FormBuilder.d.ts +3 -42
- package/lib/mjs/PDF.d.ts +1 -1
- package/lib/mjs/Webform.d.ts +3 -4
- package/lib/mjs/WebformBuilder.d.ts +1 -1
- package/lib/mjs/components/_classes/component/Component.form.d.ts +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +1 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +7 -7
- package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +1 -1
- package/lib/mjs/components/address/Address.form.d.ts +1 -1
- package/lib/mjs/components/button/Button.form.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.form.d.ts +1 -1
- package/lib/mjs/components/columns/Columns.form.d.ts +1 -1
- package/lib/mjs/components/container/Container.form.d.ts +1 -1
- package/lib/mjs/components/content/Content.form.d.ts +1 -1
- package/lib/mjs/components/currency/Currency.form.d.ts +1 -1
- package/lib/mjs/components/datagrid/DataGrid.form.d.ts +1 -1
- package/lib/mjs/components/datamap/DataMap.form.d.ts +1 -1
- package/lib/mjs/components/datetime/DateTime.form.d.ts +1 -1
- package/lib/mjs/components/day/Day.form.d.ts +1 -1
- package/lib/mjs/components/editgrid/EditGrid.form.d.ts +1 -1
- package/lib/mjs/components/email/Email.form.d.ts +1 -1
- package/lib/mjs/components/fieldset/Fieldset.form.d.ts +1 -1
- package/lib/mjs/components/file/File.form.d.ts +1 -1
- package/lib/mjs/components/form/Form.form.d.ts +1 -1
- package/lib/mjs/components/hidden/Hidden.form.d.ts +1 -1
- package/lib/mjs/components/html/HTML.form.d.ts +1 -1
- package/lib/mjs/components/number/Number.form.d.ts +1 -1
- package/lib/mjs/components/panel/Panel.form.d.ts +1 -1
- package/lib/mjs/components/password/Password.form.d.ts +1 -1
- package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +1 -1
- package/lib/mjs/components/radio/Radio.form.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
- package/lib/mjs/components/select/Select.form.d.ts +1 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +1 -1
- package/lib/mjs/components/signature/Signature.form.d.ts +1 -1
- package/lib/mjs/components/survey/Survey.form.d.ts +1 -1
- package/lib/mjs/components/table/Table.form.d.ts +1 -1
- package/lib/mjs/components/tabs/Tabs.form.d.ts +1 -1
- package/lib/mjs/components/tags/Tags.form.d.ts +1 -1
- package/lib/mjs/components/textarea/TextArea.form.d.ts +1 -1
- package/lib/mjs/components/textfield/TextField.form.d.ts +1 -1
- package/lib/mjs/components/time/Time.form.d.ts +1 -1
- package/lib/mjs/components/url/Url.form.d.ts +1 -1
- package/lib/mjs/components/well/Well.form.d.ts +1 -1
- package/lib/mjs/providers/address/AzureAddressProvider.d.ts +1 -1
- package/lib/mjs/templates/index.d.ts +14 -14
- package/lib/mjs/utils/formUtils.d.ts +3 -3
- package/lib/mjs/utils/utils.d.ts +14 -14
- package/package.json +10 -10
package/lib/cjs/utils/utils.js
CHANGED
@@ -30,76 +30,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
31
31
|
};
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
33
|
-
exports.
|
34
|
-
exports.
|
35
|
-
exports.getRandomComponentId = getRandomComponentId;
|
36
|
-
exports.getPropertyValue = getPropertyValue;
|
37
|
-
exports.getElementRect = getElementRect;
|
38
|
-
exports.getScriptPlugin = getScriptPlugin;
|
39
|
-
exports.boolValue = boolValue;
|
40
|
-
exports.isMongoId = isMongoId;
|
41
|
-
exports.checkCalculated = checkCalculated;
|
42
|
-
exports.checkSimpleConditional = checkSimpleConditional;
|
43
|
-
exports.getComponentActualValue = getComponentActualValue;
|
44
|
-
exports.checkCustomConditional = checkCustomConditional;
|
45
|
-
exports.checkJsonConditional = checkJsonConditional;
|
46
|
-
exports.checkCondition = checkCondition;
|
47
|
-
exports.checkTrigger = checkTrigger;
|
48
|
-
exports.setActionProperty = setActionProperty;
|
49
|
-
exports.removeHTML = removeHTML;
|
50
|
-
exports.unescapeHTML = unescapeHTML;
|
51
|
-
exports.convertStringToHTMLElement = convertStringToHTMLElement;
|
52
|
-
exports.uniqueName = uniqueName;
|
53
|
-
exports.guid = guid;
|
54
|
-
exports.getDateSetting = getDateSetting;
|
55
|
-
exports.isValidDate = isValidDate;
|
56
|
-
exports.currentTimezone = currentTimezone;
|
57
|
-
exports.offsetDate = offsetDate;
|
58
|
-
exports.zonesLoaded = zonesLoaded;
|
59
|
-
exports.shouldLoadZones = shouldLoadZones;
|
60
|
-
exports.loadZones = loadZones;
|
61
|
-
exports.momentDate = momentDate;
|
62
|
-
exports.formatDate = formatDate;
|
63
|
-
exports.formatOffset = formatOffset;
|
64
|
-
exports.getLocaleDateFormatInfo = getLocaleDateFormatInfo;
|
65
|
-
exports.convertFormatToFlatpickr = convertFormatToFlatpickr;
|
66
|
-
exports.convertFormatToMoment = convertFormatToMoment;
|
67
|
-
exports.convertFormatToMask = convertFormatToMask;
|
68
|
-
exports.getInputMask = getInputMask;
|
69
|
-
exports.unmaskValue = unmaskValue;
|
70
|
-
exports.matchInputMask = matchInputMask;
|
71
|
-
exports.getNumberSeparators = getNumberSeparators;
|
72
|
-
exports.getNumberDecimalLimit = getNumberDecimalLimit;
|
73
|
-
exports.getCurrencyAffixes = getCurrencyAffixes;
|
74
|
-
exports.fieldData = fieldData;
|
75
|
-
exports.delay = delay;
|
76
|
-
exports.iterateKey = iterateKey;
|
77
|
-
exports.uniqueKey = uniqueKey;
|
78
|
-
exports.bootstrapVersion = bootstrapVersion;
|
79
|
-
exports.unfold = unfold;
|
80
|
-
exports.withSwitch = withSwitch;
|
81
|
-
exports.observeOverload = observeOverload;
|
82
|
-
exports.getContextComponents = getContextComponents;
|
83
|
-
exports.getContextButtons = getContextButtons;
|
84
|
-
exports.translateHTMLTemplate = translateHTMLTemplate;
|
85
|
-
exports.sanitize = sanitize;
|
86
|
-
exports.fastCloneDeep = fastCloneDeep;
|
87
|
-
exports.isInputComponent = isInputComponent;
|
88
|
-
exports.getArrayFromComponentPath = getArrayFromComponentPath;
|
89
|
-
exports.isChildOf = isChildOf;
|
90
|
-
exports.getStringFromComponentPath = getStringFromComponentPath;
|
91
|
-
exports.round = round;
|
92
|
-
exports.getIEBrowserVersion = getIEBrowserVersion;
|
93
|
-
exports.getBrowserInfo = getBrowserInfo;
|
94
|
-
exports.getComponentPathWithoutIndicies = getComponentPathWithoutIndicies;
|
95
|
-
exports.getComponentPath = getComponentPath;
|
96
|
-
exports.getDataParentComponent = getDataParentComponent;
|
97
|
-
exports.isPromise = isPromise;
|
98
|
-
exports.isInsideScopingComponent = isInsideScopingComponent;
|
99
|
-
exports.getFocusableElements = getFocusableElements;
|
100
|
-
exports.getComponentSavedTypes = getComponentSavedTypes;
|
101
|
-
exports.getItemTemplateKeys = getItemTemplateKeys;
|
102
|
-
exports.isSelectResourceWithObjectValue = isSelectResourceWithObjectValue;
|
33
|
+
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 = exports.moment = exports.ConditionOperators = exports.jsonLogic = void 0;
|
34
|
+
exports.isSelectResourceWithObjectValue = exports.getItemTemplateKeys = exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports._ = exports.getFocusableElements = exports.isInsideScopingComponent = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.interpolate = exports.Evaluator = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = exports.getContextComponents = exports.observeOverload = exports.withSwitch = void 0;
|
103
35
|
const lodash_1 = __importDefault(require("lodash"));
|
104
36
|
exports._ = lodash_1.default;
|
105
37
|
const fetch_ponyfill_1 = __importDefault(require("fetch-ponyfill"));
|
@@ -158,6 +90,7 @@ function setPathToComponentAndPerentSchema(component) {
|
|
158
90
|
function evaluate(func, args, ret, interpolate, options = {}) {
|
159
91
|
return Evaluator_1.Evaluator.evaluate(func, args, ret, interpolate, undefined, options);
|
160
92
|
}
|
93
|
+
exports.evaluate = evaluate;
|
161
94
|
/**
|
162
95
|
* Returns a random compoennt ID.
|
163
96
|
* @returns {string} - A random component ID.
|
@@ -165,6 +98,7 @@ function evaluate(func, args, ret, interpolate, options = {}) {
|
|
165
98
|
function getRandomComponentId() {
|
166
99
|
return `e${Math.random().toString(36).substring(7)}`;
|
167
100
|
}
|
101
|
+
exports.getRandomComponentId = getRandomComponentId;
|
168
102
|
/**
|
169
103
|
* Get a property value of an element.
|
170
104
|
* @param {CSSStyleDeclaration} style - The style element to get the property value from.
|
@@ -176,6 +110,7 @@ function getPropertyValue(style, prop) {
|
|
176
110
|
value = value ? value.replace(/[^0-9.]/g, '') : '0';
|
177
111
|
return parseFloat(value);
|
178
112
|
}
|
113
|
+
exports.getPropertyValue = getPropertyValue;
|
179
114
|
/**
|
180
115
|
* Get an elements bounding rectagle.
|
181
116
|
* @param {HTMLElement} element - A DOM element to get the bounding rectangle for.
|
@@ -190,6 +125,7 @@ function getElementRect(element) {
|
|
190
125
|
height: getPropertyValue(style, 'height')
|
191
126
|
};
|
192
127
|
}
|
128
|
+
exports.getElementRect = getElementRect;
|
193
129
|
/**
|
194
130
|
* Get non HTMLElement property in the window object
|
195
131
|
* @param {string} property - The window property to fetch the script plugin from.
|
@@ -203,6 +139,7 @@ function getScriptPlugin(property) {
|
|
203
139
|
}
|
204
140
|
return obj;
|
205
141
|
}
|
142
|
+
exports.getScriptPlugin = getScriptPlugin;
|
206
143
|
/**
|
207
144
|
* Determines the boolean value of a setting.
|
208
145
|
* @param {string|boolean} value - A string or boolean value to convert to boolean.
|
@@ -219,6 +156,7 @@ function boolValue(value) {
|
|
219
156
|
return !!value;
|
220
157
|
}
|
221
158
|
}
|
159
|
+
exports.boolValue = boolValue;
|
222
160
|
/**
|
223
161
|
* Check to see if an ID is a mongoID.
|
224
162
|
* @param {string} text - The text to check if it is a mongoID.
|
@@ -227,6 +165,7 @@ function boolValue(value) {
|
|
227
165
|
function isMongoId(text) {
|
228
166
|
return !!text.toString().match(/^[0-9a-fA-F]{24}$/);
|
229
167
|
}
|
168
|
+
exports.isMongoId = isMongoId;
|
230
169
|
/**
|
231
170
|
* Checks the calculated value for a provided component and data.
|
232
171
|
* @param {import('@formio/core').Component} component - The component to check for the calculated value.
|
@@ -245,6 +184,7 @@ function checkCalculated(component, submission, rowData) {
|
|
245
184
|
}, 'value'));
|
246
185
|
}
|
247
186
|
}
|
187
|
+
exports.checkCalculated = checkCalculated;
|
248
188
|
/**
|
249
189
|
* Check if a simple conditional evaluates to true.
|
250
190
|
* @param {import('@formio/core').Component} component - The component to check for the conditional.
|
@@ -296,6 +236,7 @@ function checkSimpleConditional(component, condition, row, data, instance) {
|
|
296
236
|
return show ? result : !result;
|
297
237
|
}
|
298
238
|
}
|
239
|
+
exports.checkSimpleConditional = checkSimpleConditional;
|
299
240
|
/**
|
300
241
|
* Returns a components normalized value.
|
301
242
|
* @param {string} compPath - The full path to the component.
|
@@ -317,6 +258,7 @@ function getComponentActualValue(compPath, data, row) {
|
|
317
258
|
}
|
318
259
|
return value;
|
319
260
|
}
|
261
|
+
exports.getComponentActualValue = getComponentActualValue;
|
320
262
|
/**
|
321
263
|
* Check custom javascript conditional.
|
322
264
|
* @param {import('@formio/core').Component} component - The component to check for the conditional.
|
@@ -341,6 +283,7 @@ function checkCustomConditional(component, custom, row, data, form, variable, on
|
|
341
283
|
}
|
342
284
|
return value;
|
343
285
|
}
|
286
|
+
exports.checkCustomConditional = checkCustomConditional;
|
344
287
|
/**
|
345
288
|
* Check a component for JSON conditionals.
|
346
289
|
* @param {import('@formio/core').Component} component - The component
|
@@ -365,6 +308,7 @@ function checkJsonConditional(component, json, row, data, form, onError) {
|
|
365
308
|
return onError;
|
366
309
|
}
|
367
310
|
}
|
311
|
+
exports.checkJsonConditional = checkJsonConditional;
|
368
312
|
/**
|
369
313
|
* Returns the contextual row data for a component.
|
370
314
|
* @param {import('@formio/core').Component} component - The component to get the row data for.
|
@@ -417,6 +361,7 @@ function checkCondition(component, row, data, form, instance) {
|
|
417
361
|
// Default to show.
|
418
362
|
return true;
|
419
363
|
}
|
364
|
+
exports.checkCondition = checkCondition;
|
420
365
|
/**
|
421
366
|
* Test a trigger on a component.
|
422
367
|
* @param {import('@formio/core').Component} component - The component to test the trigger against.
|
@@ -444,6 +389,7 @@ function checkTrigger(component, trigger, row, data, form, instance) {
|
|
444
389
|
// If none of the types matched, don't fire the trigger.
|
445
390
|
return false;
|
446
391
|
}
|
392
|
+
exports.checkTrigger = checkTrigger;
|
447
393
|
/**
|
448
394
|
* Sets a property on a component via an executed Logic action.
|
449
395
|
* @param {import('@formio/core').Component} component - The component to set the property on.
|
@@ -485,6 +431,7 @@ function setActionProperty(component, action, result, row, data, instance) {
|
|
485
431
|
}
|
486
432
|
return component;
|
487
433
|
}
|
434
|
+
exports.setActionProperty = setActionProperty;
|
488
435
|
/**
|
489
436
|
* Removes HTML tags from string e.g. <div>Hello World</div> => Hello World
|
490
437
|
* @param {string} str - The string to remove HTML tags from.
|
@@ -494,6 +441,7 @@ function removeHTML(str) {
|
|
494
441
|
const doc = new window.DOMParser().parseFromString(str, 'text/html');
|
495
442
|
return (doc.body.textContent || '').trim();
|
496
443
|
}
|
444
|
+
exports.removeHTML = removeHTML;
|
497
445
|
/**
|
498
446
|
* Unescape HTML characters like <, >, & and etc.
|
499
447
|
* @param {string} str - The string to unescape.
|
@@ -507,6 +455,7 @@ function unescapeHTML(str) {
|
|
507
455
|
elem.innerHTML = str;
|
508
456
|
return elem.value;
|
509
457
|
}
|
458
|
+
exports.unescapeHTML = unescapeHTML;
|
510
459
|
/**
|
511
460
|
* Make HTML element from string
|
512
461
|
* @param {string} str - The string to convert to an HTML element.
|
@@ -517,6 +466,7 @@ function convertStringToHTMLElement(str, selector) {
|
|
517
466
|
const doc = new window.DOMParser().parseFromString(str, 'text/html');
|
518
467
|
return doc.body.querySelector(selector);
|
519
468
|
}
|
469
|
+
exports.convertStringToHTMLElement = convertStringToHTMLElement;
|
520
470
|
/**
|
521
471
|
* Make a filename guaranteed to be unique.
|
522
472
|
* @param {string} name - The original name of the file.
|
@@ -545,6 +495,7 @@ function uniqueName(name, template, evalContext) {
|
|
545
495
|
const uniqueName = `${Evaluator_1.Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\-_ ]/g, '-');
|
546
496
|
return uniqueName;
|
547
497
|
}
|
498
|
+
exports.uniqueName = uniqueName;
|
548
499
|
/**
|
549
500
|
* Returns a GUID
|
550
501
|
* @returns {string} - A GUID.
|
@@ -558,6 +509,7 @@ function guid() {
|
|
558
509
|
return v.toString(16);
|
559
510
|
});
|
560
511
|
}
|
512
|
+
exports.guid = guid;
|
561
513
|
/**
|
562
514
|
* Return a translated date setting.
|
563
515
|
* @param {string|Date} date - The date to translate.
|
@@ -602,6 +554,7 @@ function getDateSetting(date) {
|
|
602
554
|
}
|
603
555
|
return dateSetting.toDate();
|
604
556
|
}
|
557
|
+
exports.getDateSetting = getDateSetting;
|
605
558
|
/**
|
606
559
|
* Returns true if the date is a valid date. False otherwise.
|
607
560
|
* @param {Date|string} date - The date to check for validity.
|
@@ -610,6 +563,7 @@ function getDateSetting(date) {
|
|
610
563
|
function isValidDate(date) {
|
611
564
|
return lodash_1.default.isDate(date) && !lodash_1.default.isNaN(date.getDate());
|
612
565
|
}
|
566
|
+
exports.isValidDate = isValidDate;
|
613
567
|
/**
|
614
568
|
* Get the current timezone string.
|
615
569
|
* @returns {string} - The current timezone.
|
@@ -621,6 +575,7 @@ function currentTimezone() {
|
|
621
575
|
moment_timezone_1.default.currentTimezone = jstimezonedetect_1.default.determine().name();
|
622
576
|
return moment_timezone_1.default.currentTimezone;
|
623
577
|
}
|
578
|
+
exports.currentTimezone = currentTimezone;
|
624
579
|
/**
|
625
580
|
* Get an offset date provided a date object and timezone object.
|
626
581
|
* @param {Date} date - The date to offset.
|
@@ -640,6 +595,7 @@ function offsetDate(date, timezone) {
|
|
640
595
|
abbr: dateMoment.format('z')
|
641
596
|
};
|
642
597
|
}
|
598
|
+
exports.offsetDate = offsetDate;
|
643
599
|
/**
|
644
600
|
* Returns if the zones are loaded.
|
645
601
|
* @returns {boolean} - TRUE if the zones are loaded; FALSE otherwise.
|
@@ -647,6 +603,7 @@ function offsetDate(date, timezone) {
|
|
647
603
|
function zonesLoaded() {
|
648
604
|
return moment_timezone_1.default.zonesLoaded;
|
649
605
|
}
|
606
|
+
exports.zonesLoaded = zonesLoaded;
|
650
607
|
/**
|
651
608
|
* Returns if we should load the zones.
|
652
609
|
* @param {string} timezone - The timezone to check if we should load the zones.
|
@@ -658,6 +615,7 @@ function shouldLoadZones(timezone) {
|
|
658
615
|
}
|
659
616
|
return true;
|
660
617
|
}
|
618
|
+
exports.shouldLoadZones = shouldLoadZones;
|
661
619
|
/**
|
662
620
|
* Externally load the timezone data.
|
663
621
|
* @param {string} url - The URL to load the timezone data from.
|
@@ -684,6 +642,7 @@ function loadZones(url, timezone) {
|
|
684
642
|
}
|
685
643
|
}));
|
686
644
|
}
|
645
|
+
exports.loadZones = loadZones;
|
687
646
|
/**
|
688
647
|
* Get the moment date object for translating dates with timezones.
|
689
648
|
* @param {string|Date} value - The value to convert into a moment date.
|
@@ -704,6 +663,7 @@ function momentDate(value, format, timezone) {
|
|
704
663
|
}
|
705
664
|
return momentDate;
|
706
665
|
}
|
666
|
+
exports.momentDate = momentDate;
|
707
667
|
/**
|
708
668
|
* Format a date provided a value, format, and timezone object.
|
709
669
|
* @param {string} timezonesUrl - The URL to load the timezone data from.
|
@@ -742,6 +702,7 @@ function formatDate(timezonesUrl, value, format, timezone, flatPickrInputFormat)
|
|
742
702
|
return momentDate.format(convertFormatToMoment(format));
|
743
703
|
}
|
744
704
|
}
|
705
|
+
exports.formatDate = formatDate;
|
745
706
|
/**
|
746
707
|
* Pass a format function to format within a timezone.
|
747
708
|
* @param {string} timezonesUrl - The URL to load the timezone data from.
|
@@ -768,6 +729,7 @@ function formatOffset(timezonesUrl, formatFn, date, format, timezone) {
|
|
768
729
|
return formatFn(date, format);
|
769
730
|
}
|
770
731
|
}
|
732
|
+
exports.formatOffset = formatOffset;
|
771
733
|
/**
|
772
734
|
* Returns the local date format information.
|
773
735
|
* @param {Intl.LocalesArgument} locale - The locale to get the date format for.
|
@@ -781,6 +743,7 @@ function getLocaleDateFormatInfo(locale) {
|
|
781
743
|
formatInfo.dayFirst = localDateString.slice(0, 2) === day.toString();
|
782
744
|
return formatInfo;
|
783
745
|
}
|
746
|
+
exports.getLocaleDateFormatInfo = getLocaleDateFormatInfo;
|
784
747
|
/**
|
785
748
|
* Convert the format from the angular-datepicker module to flatpickr format.
|
786
749
|
* @param {string} format - The format to convert.
|
@@ -812,6 +775,7 @@ function convertFormatToFlatpickr(format) {
|
|
812
775
|
.replace('ss', 'S')
|
813
776
|
.replace(/a/g, 'K');
|
814
777
|
}
|
778
|
+
exports.convertFormatToFlatpickr = convertFormatToFlatpickr;
|
815
779
|
/**
|
816
780
|
* Convert the format from the angular-datepicker module to moment format.
|
817
781
|
* @param {string} format - The format to convert.
|
@@ -830,6 +794,7 @@ function convertFormatToMoment(format) {
|
|
830
794
|
// Unix Timestamp
|
831
795
|
.replace(/U/g, 'X');
|
832
796
|
}
|
797
|
+
exports.convertFormatToMoment = convertFormatToMoment;
|
833
798
|
/**
|
834
799
|
* Convert the format from the angular-datepicker module to mask format.
|
835
800
|
* @param {string} format - The format to convert.
|
@@ -850,6 +815,7 @@ function convertFormatToMask(format) {
|
|
850
815
|
// AM/PM conversion.
|
851
816
|
.replace(/a/g, 'AA');
|
852
817
|
}
|
818
|
+
exports.convertFormatToMask = convertFormatToMask;
|
853
819
|
/**
|
854
820
|
* Returns an input mask that is compatible with the input mask library.
|
855
821
|
* @param {string} mask - The Form.io input mask.
|
@@ -892,6 +858,7 @@ function getInputMask(mask, placeholderChar) {
|
|
892
858
|
}
|
893
859
|
return maskArray;
|
894
860
|
}
|
861
|
+
exports.getInputMask = getInputMask;
|
895
862
|
/**
|
896
863
|
* Unmasks a value using the provided mask and placeholder characters.
|
897
864
|
* @param {string} value - The value to unmask.
|
@@ -914,6 +881,7 @@ function unmaskValue(value, mask, placeholderChar) {
|
|
914
881
|
unmaskedValue = unmaskedValue.join('').replace(placeholderChar, '');
|
915
882
|
return unmaskedValue;
|
916
883
|
}
|
884
|
+
exports.unmaskValue = unmaskValue;
|
917
885
|
/**
|
918
886
|
* Returns true if the value matches the input mask format.
|
919
887
|
* @param {string} value - The value to check.
|
@@ -937,6 +905,7 @@ function matchInputMask(value, inputMask) {
|
|
937
905
|
}
|
938
906
|
return true;
|
939
907
|
}
|
908
|
+
exports.matchInputMask = matchInputMask;
|
940
909
|
/**
|
941
910
|
* Returns the number separators (i.e. 1,000) for the provided language.
|
942
911
|
* @param {string} lang - The language code to get the number separators for.
|
@@ -956,6 +925,7 @@ function getNumberSeparators(lang = 'en') {
|
|
956
925
|
decimalSeparator: (delimeters.length > 2) ? delimeters[2] : '.',
|
957
926
|
};
|
958
927
|
}
|
928
|
+
exports.getNumberSeparators = getNumberSeparators;
|
959
929
|
/**
|
960
930
|
* Returns the number for the maximum amount of decimal places for a number.
|
961
931
|
* @param {import('@formio/core').Component} component - The component to check for decimal limits.
|
@@ -977,6 +947,7 @@ function getNumberDecimalLimit(component, defaultLimit) {
|
|
977
947
|
}
|
978
948
|
return decimalLimit;
|
979
949
|
}
|
950
|
+
exports.getNumberDecimalLimit = getNumberDecimalLimit;
|
980
951
|
/**
|
981
952
|
* Returns the currency affixes for a specific language.
|
982
953
|
* @param {object} arg0 - The arguments object.
|
@@ -1005,6 +976,7 @@ function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, lang, })
|
|
1005
976
|
suffix: (parts === null || parts === void 0 ? void 0 : parts[2]) || ''
|
1006
977
|
};
|
1007
978
|
}
|
979
|
+
exports.getCurrencyAffixes = getCurrencyAffixes;
|
1008
980
|
/**
|
1009
981
|
* Fetch the field data provided a component.
|
1010
982
|
* @param {import('@formio/core').DataObject} data - The data object to fetch the field data from.
|
@@ -1053,6 +1025,7 @@ function fieldData(data, component) {
|
|
1053
1025
|
return data[component.key];
|
1054
1026
|
}
|
1055
1027
|
}
|
1028
|
+
exports.fieldData = fieldData;
|
1056
1029
|
/**
|
1057
1030
|
* Delays function execution with possibility to execute function synchronously or cancel it.
|
1058
1031
|
* @param {Function} fn - Function to delay
|
@@ -1080,6 +1053,7 @@ function delay(fn, delay = 0, ...args) {
|
|
1080
1053
|
earlyCall.cancel = cancel;
|
1081
1054
|
return earlyCall;
|
1082
1055
|
}
|
1056
|
+
exports.delay = delay;
|
1083
1057
|
/**
|
1084
1058
|
* Iterate the given key to make it unique.
|
1085
1059
|
* @param {string} key
|
@@ -1095,6 +1069,7 @@ function iterateKey(key) {
|
|
1095
1069
|
return Number(suffix) + 1;
|
1096
1070
|
});
|
1097
1071
|
}
|
1072
|
+
exports.iterateKey = iterateKey;
|
1098
1073
|
/**
|
1099
1074
|
* Determines a unique key within a map provided the base key.
|
1100
1075
|
* @param {Record<string, string>} map - The map to check for uniqueness.
|
@@ -1108,6 +1083,7 @@ function uniqueKey(map, base) {
|
|
1108
1083
|
}
|
1109
1084
|
return newKey;
|
1110
1085
|
}
|
1086
|
+
exports.uniqueKey = uniqueKey;
|
1111
1087
|
/**
|
1112
1088
|
* Determines the major version number of bootstrap.
|
1113
1089
|
* @param {object} options - The options to check for bootstrap version.
|
@@ -1126,6 +1102,7 @@ function bootstrapVersion(options) {
|
|
1126
1102
|
}
|
1127
1103
|
return 0;
|
1128
1104
|
}
|
1105
|
+
exports.bootstrapVersion = bootstrapVersion;
|
1129
1106
|
/**
|
1130
1107
|
* Retrun provided argument.
|
1131
1108
|
* If argument is a function, returns the result of a function call.
|
@@ -1138,6 +1115,7 @@ function unfold(e) {
|
|
1138
1115
|
}
|
1139
1116
|
return e;
|
1140
1117
|
}
|
1118
|
+
exports.unfold = unfold;
|
1141
1119
|
/**
|
1142
1120
|
* Map values through unfold and return first non-nil value.
|
1143
1121
|
* @param {Array<T>} collection - The collection to map through unfold.;
|
@@ -1173,6 +1151,7 @@ function withSwitch(a, b) {
|
|
1173
1151
|
}
|
1174
1152
|
return [get, toggle];
|
1175
1153
|
}
|
1154
|
+
exports.withSwitch = withSwitch;
|
1176
1155
|
/**
|
1177
1156
|
* Create a function that will call the provided function only the provided limit.
|
1178
1157
|
* @param {Function} callback - The callback to call.
|
@@ -1200,6 +1179,7 @@ function observeOverload(callback, options = {}) {
|
|
1200
1179
|
}
|
1201
1180
|
};
|
1202
1181
|
}
|
1182
|
+
exports.observeOverload = observeOverload;
|
1203
1183
|
/**
|
1204
1184
|
* Returns the components that are provided within an evaluation context.
|
1205
1185
|
* @param {any} context - The evaluation context to get the components from.
|
@@ -1220,6 +1200,7 @@ function getContextComponents(context, excludeNested, excludedTypes = []) {
|
|
1220
1200
|
});
|
1221
1201
|
return values;
|
1222
1202
|
}
|
1203
|
+
exports.getContextComponents = getContextComponents;
|
1223
1204
|
/**
|
1224
1205
|
* Returns the button components that are within an evaluation context.
|
1225
1206
|
* @param {any} context - The evaluation context to get the components from.
|
@@ -1237,6 +1218,7 @@ function getContextButtons(context) {
|
|
1237
1218
|
});
|
1238
1219
|
return values;
|
1239
1220
|
}
|
1221
|
+
exports.getContextButtons = getContextButtons;
|
1240
1222
|
// Tags that could be in text, that should be ommited or handled in a special way
|
1241
1223
|
const inTextTags = ['#text', 'A', 'B', 'EM', 'I', 'SMALL', 'STRONG', 'SUB', 'SUP', 'INS', 'DEL', 'MARK', 'CODE'];
|
1242
1224
|
/**
|
@@ -1308,6 +1290,7 @@ function translateHTMLTemplate(template, translate) {
|
|
1308
1290
|
}
|
1309
1291
|
return template;
|
1310
1292
|
}
|
1293
|
+
exports.translateHTMLTemplate = translateHTMLTemplate;
|
1311
1294
|
/**
|
1312
1295
|
* Sanitize an html string.
|
1313
1296
|
* @param {string} string - The string to sanitize.
|
@@ -1358,6 +1341,7 @@ function sanitize(string, options) {
|
|
1358
1341
|
}
|
1359
1342
|
return dompurify_1.default.sanitize(string, sanitizeOptions);
|
1360
1343
|
}
|
1344
|
+
exports.sanitize = sanitize;
|
1361
1345
|
/**
|
1362
1346
|
* Fast cloneDeep for JSON objects only.
|
1363
1347
|
* @param {any} obj - The object to perform a fast clone deep against.
|
@@ -1366,6 +1350,7 @@ function sanitize(string, options) {
|
|
1366
1350
|
function fastCloneDeep(obj) {
|
1367
1351
|
return obj ? JSON.parse(JSON.stringify(obj)) : obj;
|
1368
1352
|
}
|
1353
|
+
exports.fastCloneDeep = fastCloneDeep;
|
1369
1354
|
/**
|
1370
1355
|
* Returns if the component is an input component.
|
1371
1356
|
* @param {import('@formio/core').Component} componentJson - The JSON of a component.
|
@@ -1390,6 +1375,7 @@ function isInputComponent(componentJson) {
|
|
1390
1375
|
return true;
|
1391
1376
|
}
|
1392
1377
|
}
|
1378
|
+
exports.isInputComponent = isInputComponent;
|
1393
1379
|
/**
|
1394
1380
|
* Takes a component path, and returns a component path array.
|
1395
1381
|
* @param {string} pathStr - The path string to convert to an array.
|
@@ -1408,6 +1394,7 @@ function getArrayFromComponentPath(pathStr) {
|
|
1408
1394
|
.split('.')
|
1409
1395
|
.map(part => lodash_1.default.defaultTo(lodash_1.default.toNumber(part), part));
|
1410
1396
|
}
|
1397
|
+
exports.getArrayFromComponentPath = getArrayFromComponentPath;
|
1411
1398
|
/**
|
1412
1399
|
* Returns true if the component is a child of the parent.
|
1413
1400
|
* @param {any} child - The child component to check.
|
@@ -1423,6 +1410,7 @@ function isChildOf(child, parent) {
|
|
1423
1410
|
}
|
1424
1411
|
return false;
|
1425
1412
|
}
|
1413
|
+
exports.isChildOf = isChildOf;
|
1426
1414
|
/**
|
1427
1415
|
* Takes an array of component path indexes, and returns a string version of that array.
|
1428
1416
|
* @param {Array<number>} path - The path array to convert to a string.
|
@@ -1443,6 +1431,7 @@ function getStringFromComponentPath(path) {
|
|
1443
1431
|
});
|
1444
1432
|
return strPath;
|
1445
1433
|
}
|
1434
|
+
exports.getStringFromComponentPath = getStringFromComponentPath;
|
1446
1435
|
/**
|
1447
1436
|
* Takes a number and rounds it to the provided precision amount.
|
1448
1437
|
* @param {number} number - The number to round.
|
@@ -1455,6 +1444,7 @@ function round(number, precision) {
|
|
1455
1444
|
}
|
1456
1445
|
return number.toString();
|
1457
1446
|
}
|
1447
|
+
exports.round = round;
|
1458
1448
|
/**
|
1459
1449
|
* Check for Internet Explorer browser version
|
1460
1450
|
* @returns {(number|null)} - The IE browser version or null if not IE
|
@@ -1463,6 +1453,7 @@ function getIEBrowserVersion() {
|
|
1463
1453
|
const { ie, version } = getBrowserInfo();
|
1464
1454
|
return ie ? version : null;
|
1465
1455
|
}
|
1456
|
+
exports.getIEBrowserVersion = getIEBrowserVersion;
|
1466
1457
|
/**
|
1467
1458
|
* Get browser name and version (modified from 'jquery-browser-plugin')
|
1468
1459
|
* @returns {object} -- {{browser name, version, isWebkit?}}
|
@@ -1513,6 +1504,7 @@ function getBrowserInfo() {
|
|
1513
1504
|
}
|
1514
1505
|
return browser;
|
1515
1506
|
}
|
1507
|
+
exports.getBrowserInfo = getBrowserInfo;
|
1516
1508
|
/**
|
1517
1509
|
* Takes a component path, which may include array indicies (i.e. [0][1]), and returns the compoennt path without the indicies.
|
1518
1510
|
* @param {string} path - The path to remove the indicies from.
|
@@ -1521,6 +1513,7 @@ function getBrowserInfo() {
|
|
1521
1513
|
function getComponentPathWithoutIndicies(path = '') {
|
1522
1514
|
return path.replace(/\[\d+\]/, '');
|
1523
1515
|
}
|
1516
|
+
exports.getComponentPathWithoutIndicies = getComponentPathWithoutIndicies;
|
1524
1517
|
/**
|
1525
1518
|
* Returns a path to the component which based on its schema
|
1526
1519
|
* @param {import('@formio/core').Component} component - Component containing link to its parent's schema in the 'parent' property
|
@@ -1535,6 +1528,7 @@ function getComponentPath(component, path = '') {
|
|
1535
1528
|
path = component.isInputComponent || component.input === true ? `${component.key}${path ? '.' : ''}${path}` : path;
|
1536
1529
|
return getComponentPath(component.parent, path);
|
1537
1530
|
}
|
1531
|
+
exports.getComponentPath = getComponentPath;
|
1538
1532
|
/**
|
1539
1533
|
* Returns a parent component of the passed component instance skipping all the Layout components
|
1540
1534
|
* @param {Component} componentInstance - The component to check for the parent.
|
@@ -1552,6 +1546,7 @@ function getDataParentComponent(componentInstance) {
|
|
1552
1546
|
return getDataParentComponent(parent);
|
1553
1547
|
}
|
1554
1548
|
}
|
1549
|
+
exports.getDataParentComponent = getDataParentComponent;
|
1555
1550
|
/**
|
1556
1551
|
* Returns whether the value is a promise
|
1557
1552
|
* @param {any} value - The value to check
|
@@ -1563,6 +1558,7 @@ function isPromise(value) {
|
|
1563
1558
|
&& typeof value.then === 'function'
|
1564
1559
|
&& Object.prototype.toString.call(value) === '[object Promise]';
|
1565
1560
|
}
|
1561
|
+
exports.isPromise = isPromise;
|
1566
1562
|
/**
|
1567
1563
|
* Determines if the component has a scoping parent in tree (a component which scopes its children and manages its
|
1568
1564
|
* changes by itself, e.g. EditGrid)
|
@@ -1583,6 +1579,7 @@ function isInsideScopingComponent(componentInstance, firstPass = true) {
|
|
1583
1579
|
}
|
1584
1580
|
return false;
|
1585
1581
|
}
|
1582
|
+
exports.isInsideScopingComponent = isInsideScopingComponent;
|
1586
1583
|
/**
|
1587
1584
|
* Returns all the focusable elements within the provided dom element.
|
1588
1585
|
* @param {HTMLElement} element - The element to get the focusable elements from.
|
@@ -1593,6 +1590,7 @@ function getFocusableElements(element) {
|
|
1593
1590
|
textarea:not([disabled]), button:not([disabled]), [href]`;
|
1594
1591
|
return element.querySelectorAll(focusableSelector);
|
1595
1592
|
}
|
1593
|
+
exports.getFocusableElements = getFocusableElements;
|
1596
1594
|
exports.componentValueTypes = {
|
1597
1595
|
number: 'number',
|
1598
1596
|
string: 'string',
|
@@ -1617,6 +1615,7 @@ function getComponentSavedTypes(fullSchema) {
|
|
1617
1615
|
}
|
1618
1616
|
return null;
|
1619
1617
|
}
|
1618
|
+
exports.getComponentSavedTypes = getComponentSavedTypes;
|
1620
1619
|
/**
|
1621
1620
|
* Interpolates @formio/core errors so that they are compatible with the renderer
|
1622
1621
|
* @param {Component} component - The component to interpolate the errors for
|
@@ -1654,6 +1653,7 @@ function getItemTemplateKeys(template) {
|
|
1654
1653
|
}
|
1655
1654
|
return templateKeys;
|
1656
1655
|
}
|
1656
|
+
exports.getItemTemplateKeys = getItemTemplateKeys;
|
1657
1657
|
/**
|
1658
1658
|
* Returns if the component is a select resource with an object for its value.
|
1659
1659
|
* @param {import('@formio/core').Component} comp - The component to check.
|
@@ -1663,3 +1663,4 @@ function isSelectResourceWithObjectValue(comp = {}) {
|
|
1663
1663
|
const { reference, dataSrc, valueProperty } = comp;
|
1664
1664
|
return reference || (dataSrc === 'resource' && (!valueProperty || valueProperty === 'data'));
|
1665
1665
|
}
|
1666
|
+
exports.isSelectResourceWithObjectValue = isSelectResourceWithObjectValue;
|
package/lib/mjs/Element.d.ts
CHANGED
@@ -237,7 +237,7 @@ export default class Element {
|
|
237
237
|
* @param {import('@formio/core').EvaluatorOptions} options - The options to pass to the evaluation.
|
238
238
|
* @returns {*} - The result of the evaluation.
|
239
239
|
*/
|
240
|
-
evaluate(func: string | Function | object, args: object, ret: string, interpolate: boolean, options?: import(
|
240
|
+
evaluate(func: string | Function | object, args: object, ret: string, interpolate: boolean, options?: import('@formio/core').EvaluatorOptions): any;
|
241
241
|
/**
|
242
242
|
* Allow for options to hook into the functionality of this renderer.
|
243
243
|
* @returns {*} - The result of the hook function.
|
package/lib/mjs/Embed.d.ts
CHANGED
@@ -47,11 +47,11 @@ export class Form {
|
|
47
47
|
options: any;
|
48
48
|
instance: {
|
49
49
|
proxy: boolean;
|
50
|
-
ready: Promise<
|
50
|
+
ready: Promise<any> | Promise<void> | undefined;
|
51
51
|
destroy: () => void;
|
52
52
|
};
|
53
53
|
init(): void;
|
54
|
-
ready: Promise<
|
54
|
+
ready: Promise<any> | Promise<void> | undefined;
|
55
55
|
create(): Promise<any>;
|
56
56
|
setForm(form: any): void;
|
57
57
|
setDisplay(display: any): Promise<any> | undefined;
|
package/lib/mjs/Form.d.ts
CHANGED
@@ -368,7 +368,7 @@ export default class Form extends Element {
|
|
368
368
|
* @param {string|object} formParam - Either the form JSON or the URL of the form json.
|
369
369
|
* @returns {void}
|
370
370
|
*/
|
371
|
-
set form(formParam:
|
371
|
+
set form(formParam: object);
|
372
372
|
/**
|
373
373
|
* Returns the loaded forms JSON.
|
374
374
|
* @returns {object} - The loaded form's JSON
|
@@ -395,13 +395,13 @@ export default class Form extends Element {
|
|
395
395
|
* @param {import('@formio/core').Form} form - The form json.
|
396
396
|
* @returns {object} The initial options with base and project.
|
397
397
|
*/
|
398
|
-
getFormInitOptions(url: string, form: import(
|
398
|
+
getFormInitOptions(url: string, form: import('@formio/core').Form): object;
|
399
399
|
/**
|
400
400
|
* Sets the form to the JSON schema of a form.
|
401
401
|
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
402
402
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
403
403
|
*/
|
404
|
-
setForm(formParam: import(
|
404
|
+
setForm(formParam: import('@formio/core').Form): Promise<Webform | Wizard | PDF>;
|
405
405
|
_form: any;
|
406
406
|
getSubmission(formio: any, opts: any): any;
|
407
407
|
/**
|