@formio/js 5.0.0-rc.59 → 5.0.0-rc.60
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.builder.css +8 -8
- package/dist/formio.builder.min.css +1 -1
- 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.css +8 -8
- package/dist/formio.form.js +24 -24
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.css +8 -8
- package/dist/formio.full.js +64 -64
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +4 -4
- 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 +42 -3
- package/lib/cjs/InlineEmbed.js +2 -2
- package/lib/cjs/PDF.d.ts +1 -1
- package/lib/cjs/Webform.d.ts +4 -3
- package/lib/cjs/Webform.js +2 -1
- package/lib/cjs/WebformBuilder.d.ts +1 -1
- package/lib/cjs/WebformBuilder.js +8 -2
- 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/component/Component.js +2 -5
- package/lib/cjs/components/_classes/component/fixtures/comp6.d.ts +77 -0
- package/lib/cjs/components/_classes/component/fixtures/comp6.js +59 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/_classes/input/Input.js +6 -4
- 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/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.js +36 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +3 -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.d.ts +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/day/Day.js +1 -1
- package/lib/cjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/cjs/components/day/fixtures/comp7.js +109 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -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/file/File.js +1 -2
- 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/form/Form.js +7 -6
- 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/radio/Radio.js +3 -2
- 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/select/Select.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/textfield/TextField.js +3 -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/address/GoogleAddressProvider.js +1 -1
- package/lib/cjs/providers/storage/util.js +3 -4
- package/lib/cjs/templates/index.d.ts +14 -14
- package/lib/cjs/translations/en.d.ts +2 -0
- package/lib/cjs/translations/en.js +3 -1
- package/lib/cjs/utils/ChoicesWrapper.d.ts +1 -1
- package/lib/cjs/utils/ChoicesWrapper.js +13 -2
- 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 +20 -14
- package/lib/cjs/utils/utils.js +82 -72
- 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 +42 -3
- package/lib/mjs/PDF.d.ts +1 -1
- package/lib/mjs/Webform.d.ts +4 -3
- package/lib/mjs/Webform.js +2 -1
- package/lib/mjs/WebformBuilder.d.ts +1 -1
- package/lib/mjs/WebformBuilder.js +8 -2
- package/lib/mjs/components/_classes/component/Component.form.d.ts +1 -1
- package/lib/mjs/components/_classes/component/Component.js +2 -5
- package/lib/mjs/components/_classes/component/fixtures/comp6.d.ts +77 -0
- package/lib/mjs/components/_classes/component/fixtures/comp6.js +57 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/_classes/input/Input.js +6 -4
- 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/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.js +34 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +2 -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.d.ts +1 -1
- package/lib/mjs/components/day/Day.form.d.ts +1 -1
- package/lib/mjs/components/day/Day.js +1 -1
- package/lib/mjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/mjs/components/day/fixtures/comp7.js +107 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -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/file/File.js +1 -2
- package/lib/mjs/components/form/Form.form.d.ts +1 -1
- package/lib/mjs/components/form/Form.js +5 -4
- 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/radio/Radio.js +3 -2
- 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/select/Select.js +2 -2
- 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/textfield/TextField.js +3 -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/providers/address/GoogleAddressProvider.js +1 -1
- package/lib/mjs/templates/index.d.ts +14 -14
- package/lib/mjs/translations/en.d.ts +2 -0
- package/lib/mjs/translations/en.js +3 -1
- package/lib/mjs/utils/ChoicesWrapper.d.ts +1 -1
- package/lib/mjs/utils/ChoicesWrapper.js +13 -2
- package/lib/mjs/utils/formUtils.d.ts +3 -3
- package/lib/mjs/utils/utils.d.ts +20 -14
- package/lib/mjs/utils/utils.js +12 -2
- package/package.json +11 -11
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
/*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */
|
22
22
|
|
23
|
-
/*! formiojs v5.0.0-rc.
|
23
|
+
/*! formiojs v5.0.0-rc.60 | https://unpkg.com/formiojs@5.0.0-rc.60/LICENSE.txt */
|
24
24
|
|
25
25
|
/**
|
26
26
|
* @license
|
package/lib/cjs/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/cjs/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<void> | Promise<any> | undefined;
|
51
51
|
destroy: () => void;
|
52
52
|
};
|
53
53
|
init(): void;
|
54
|
-
ready: Promise<
|
54
|
+
ready: Promise<void> | Promise<any> | undefined;
|
55
55
|
create(): Promise<any>;
|
56
56
|
setForm(form: any): void;
|
57
57
|
setDisplay(display: any): Promise<any> | undefined;
|
package/lib/cjs/Embed.js
CHANGED
@@ -91,8 +91,8 @@ class Formio {
|
|
91
91
|
});
|
92
92
|
return element;
|
93
93
|
}
|
94
|
-
static addScript(
|
95
|
-
return __awaiter(this,
|
94
|
+
static addScript(wrapper_1, src_1, name_1) {
|
95
|
+
return __awaiter(this, arguments, void 0, function* (wrapper, src, name, flag = '') {
|
96
96
|
if (!src) {
|
97
97
|
return Promise.resolve();
|
98
98
|
}
|
@@ -242,8 +242,8 @@ class Formio {
|
|
242
242
|
});
|
243
243
|
}
|
244
244
|
// eslint-disable-next-line max-statements
|
245
|
-
static init(
|
246
|
-
return __awaiter(this,
|
245
|
+
static init(element_1) {
|
246
|
+
return __awaiter(this, arguments, void 0, function* (element, options = {}, builder = false) {
|
247
247
|
_a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});
|
248
248
|
_a.config.libs = _a.config.libs || {
|
249
249
|
uswds: {
|
@@ -374,8 +374,8 @@ class Formio {
|
|
374
374
|
});
|
375
375
|
}
|
376
376
|
// Create a new form.
|
377
|
-
static createForm(
|
378
|
-
return __awaiter(this,
|
377
|
+
static createForm(element_1, form_1) {
|
378
|
+
return __awaiter(this, arguments, void 0, function* (element, form, options = {}) {
|
379
379
|
if (_a.FormioClass) {
|
380
380
|
return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));
|
381
381
|
}
|
@@ -393,9 +393,9 @@ class Formio {
|
|
393
393
|
});
|
394
394
|
}
|
395
395
|
// Create a form builder.
|
396
|
-
static builder(
|
397
|
-
|
398
|
-
|
396
|
+
static builder(element_1, form_1) {
|
397
|
+
return __awaiter(this, arguments, void 0, function* (element, form, options = {}) {
|
398
|
+
var _b;
|
399
399
|
if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {
|
400
400
|
return _a.FormioClass.builder(element, form, options);
|
401
401
|
}
|
@@ -421,7 +421,7 @@ Formio.formioReady = new Promise((ready, reject) => {
|
|
421
421
|
Formio.version = 'FORMIO_VERSION';
|
422
422
|
// Create a report.
|
423
423
|
Formio.Report = {
|
424
|
-
create: (
|
424
|
+
create: (element_1, submission_1, ...args_1) => __awaiter(void 0, [element_1, submission_1, ...args_1], void 0, function* (element, submission, options = {}) {
|
425
425
|
var _b;
|
426
426
|
if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {
|
427
427
|
return _a.FormioClass.Report.create(element, submission, options);
|
package/lib/cjs/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: object);
|
371
|
+
set form(formParam: string | 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
|
/**
|
package/lib/cjs/FormBuilder.d.ts
CHANGED
@@ -17,26 +17,44 @@ export default class FormBuilder extends Form {
|
|
17
17
|
*/
|
18
18
|
/** @type {FormBuilderOptions} */
|
19
19
|
static options: {
|
20
|
+
/**
|
21
|
+
* - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
|
22
|
+
*/
|
20
23
|
/**
|
21
24
|
* - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
|
22
25
|
*/
|
23
26
|
disabled?: string[] | undefined;
|
27
|
+
/**
|
28
|
+
* - When set to TRUE no modal is shown when a component is dragged onto the form.
|
29
|
+
*/
|
24
30
|
/**
|
25
31
|
* - When set to TRUE no modal is shown when a component is dragged onto the form.
|
26
32
|
*/
|
27
33
|
noNewEdit?: boolean | undefined;
|
34
|
+
/**
|
35
|
+
* - Set to TRUE to not include the default submit button in Webforms.
|
36
|
+
*/
|
28
37
|
/**
|
29
38
|
* - Set to TRUE to not include the default submit button in Webforms.
|
30
39
|
*/
|
31
40
|
noDefaultSubmitButton?: boolean | undefined;
|
41
|
+
/**
|
42
|
+
* - Set to TRUE to always require confirmation before removing a component.
|
43
|
+
*/
|
32
44
|
/**
|
33
45
|
* - Set to TRUE to always require confirmation before removing a component.
|
34
46
|
*/
|
35
47
|
alwaysConfirmComponentRemoval?: boolean | undefined;
|
48
|
+
/**
|
49
|
+
* - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
|
50
|
+
*/
|
36
51
|
/**
|
37
52
|
* - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
|
38
53
|
*/
|
39
54
|
formConfig?: object | undefined;
|
55
|
+
/**
|
56
|
+
* - The tag to use to query for the "Existing Resource Fields" section of the builder.
|
57
|
+
*/
|
40
58
|
/**
|
41
59
|
* - The tag to use to query for the "Existing Resource Fields" section of the builder.
|
42
60
|
*/
|
@@ -44,27 +62,48 @@ export default class FormBuilder extends Form {
|
|
44
62
|
/**
|
45
63
|
* - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
46
64
|
*/
|
47
|
-
|
65
|
+
/**
|
66
|
+
* - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
67
|
+
*/
|
68
|
+
editForm?: import("./Form").FormOptions;
|
69
|
+
/**
|
70
|
+
* - The language to load into the form builder.
|
71
|
+
*/
|
48
72
|
/**
|
49
73
|
* - The language to load into the form builder.
|
50
74
|
*/
|
51
75
|
language?: string | undefined;
|
76
|
+
/**
|
77
|
+
* - The builder options to pass to the builder.
|
78
|
+
*/
|
52
79
|
/**
|
53
80
|
* - The builder options to pass to the builder.
|
54
81
|
*/
|
55
82
|
builder?: object | undefined;
|
83
|
+
/**
|
84
|
+
* - The display mode of the builder.
|
85
|
+
*/
|
56
86
|
/**
|
57
87
|
* - The display mode of the builder.
|
58
88
|
*/
|
59
89
|
display?: "form" | "pdf" | "wizard" | undefined;
|
90
|
+
/**
|
91
|
+
* - Filter applied to the resources that appear in the builder's Existing Resource Fields.
|
92
|
+
*/
|
60
93
|
/**
|
61
94
|
* - Filter applied to the resources that appear in the builder's Existing Resource Fields.
|
62
95
|
*/
|
63
96
|
resourceFilter?: string | undefined;
|
97
|
+
/**
|
98
|
+
* - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
|
99
|
+
*/
|
64
100
|
/**
|
65
101
|
* - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
|
66
102
|
*/
|
67
103
|
noSource?: boolean | undefined;
|
104
|
+
/**
|
105
|
+
* - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
|
106
|
+
*/
|
68
107
|
/**
|
69
108
|
* - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
|
70
109
|
*/
|
@@ -105,7 +144,7 @@ export default class FormBuilder extends Form {
|
|
105
144
|
/**
|
106
145
|
* - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
107
146
|
*/
|
108
|
-
editForm?:
|
147
|
+
editForm?: import("./Form").FormOptions;
|
109
148
|
/**
|
110
149
|
* - The language to load into the form builder.
|
111
150
|
*/
|
@@ -160,7 +199,7 @@ export default class FormBuilder extends Form {
|
|
160
199
|
/**
|
161
200
|
* - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
162
201
|
*/
|
163
|
-
editForm?:
|
202
|
+
editForm?: import("./Form").FormOptions;
|
164
203
|
/**
|
165
204
|
* - The language to load into the form builder.
|
166
205
|
*/
|
package/lib/cjs/InlineEmbed.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Formio =
|
3
|
+
exports.Formio = void 0;
|
4
|
+
exports.embed = embed;
|
4
5
|
const Embed_1 = require("./Embed");
|
5
6
|
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return Embed_1.Formio; } });
|
6
7
|
/**
|
@@ -113,4 +114,3 @@ function embed(config = {}) {
|
|
113
114
|
document.write('<span>Could not locate the Embedded form.</span>');
|
114
115
|
}
|
115
116
|
}
|
116
|
-
exports.embed = embed;
|
package/lib/cjs/PDF.d.ts
CHANGED
@@ -28,7 +28,7 @@ export default class PDF extends Webform {
|
|
28
28
|
* @param {any} flags - The flags to use when setting the submission.
|
29
29
|
* @returns {boolean} - If the value changed or not.
|
30
30
|
*/
|
31
|
-
setValue(submission: import(
|
31
|
+
setValue(submission: import("@formio/core").Submission, flags?: any): boolean;
|
32
32
|
postMessage(message: any): void;
|
33
33
|
iframeFormSetUp: boolean | undefined;
|
34
34
|
focusOnComponent(key: any): void;
|
package/lib/cjs/Webform.d.ts
CHANGED
@@ -89,11 +89,11 @@ declare class Webform extends NestedDataComponent {
|
|
89
89
|
* @param {HTMLElement | object | import('Form').FormOptions} [elementOrOptions] - The DOM element to render this form within or the options to create this form instance.
|
90
90
|
* @param {import('Form').FormOptions} [options] - The options to create a new form instance.
|
91
91
|
*/
|
92
|
-
constructor(elementOrOptions?: HTMLElement | object | import(
|
92
|
+
constructor(elementOrOptions?: HTMLElement | object | import("Form").FormOptions, options?: import("Form").FormOptions);
|
93
93
|
/**
|
94
94
|
* @type {import('Form').FormOptions} - the options for this Webform.
|
95
95
|
*/
|
96
|
-
options:
|
96
|
+
options: import("Form").FormOptions;
|
97
97
|
_src: string;
|
98
98
|
_loading: boolean;
|
99
99
|
_form: {};
|
@@ -459,7 +459,7 @@ export default Webform;
|
|
459
459
|
/**
|
460
460
|
* Represents a JSON value.
|
461
461
|
*/
|
462
|
-
export type JSON = (string | number | boolean | null |
|
462
|
+
export type JSON = (string | number | boolean | null | JSONArray | JSONObject);
|
463
463
|
/**
|
464
464
|
* Represents a JSON array.
|
465
465
|
*/
|
@@ -733,4 +733,5 @@ export type FormOptions = {
|
|
733
733
|
zoom?: number | undefined;
|
734
734
|
};
|
735
735
|
import NestedDataComponent from "./components/_classes/nesteddata/NestedDataComponent";
|
736
|
+
import { Formio } from "./Formio";
|
736
737
|
import EventEmitter from "./EventEmitter";
|
package/lib/cjs/Webform.js
CHANGED
@@ -59,7 +59,7 @@ export default class WebformBuilder extends Component {
|
|
59
59
|
* @param {import('@formio/core').Component} component - The component to find the namespace root for.
|
60
60
|
* @returns {import('@formio/core').Component[]} - The components root for this namespace.
|
61
61
|
*/
|
62
|
-
findNamespaceRoot(component: import(
|
62
|
+
findNamespaceRoot(component: import("@formio/core").Component): import("@formio/core").Component[];
|
63
63
|
recurseNamespace(component: any): any;
|
64
64
|
render(): any;
|
65
65
|
attach(element: any): Promise<any>;
|
@@ -986,8 +986,14 @@ class WebformBuilder extends Component_1.default {
|
|
986
986
|
else if (parent.formioComponent && parent.formioComponent.removeChildComponent) {
|
987
987
|
parent.formioComponent.removeChildComponent(component);
|
988
988
|
}
|
989
|
-
if (component.input && componentInstance &&
|
990
|
-
lodash_1.default.
|
989
|
+
if (component.input && componentInstance && parent.formioComponent) {
|
990
|
+
const parentDefaultValue = lodash_1.default.get(parent.formioComponent, 'component.defaultValue', null);
|
991
|
+
if (Array.isArray(parentDefaultValue)) {
|
992
|
+
parentDefaultValue.forEach(v => lodash_1.default.unset(v, componentInstance.key));
|
993
|
+
}
|
994
|
+
else if (typeof parentDefaultValue === 'object') {
|
995
|
+
lodash_1.default.unset(parentDefaultValue, componentInstance.key);
|
996
|
+
}
|
991
997
|
}
|
992
998
|
const rebuild = parent.formioComponent.rebuild() || Promise.resolve();
|
993
999
|
rebuild.then(() => {
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* @param {...any} extend - The components that extend the edit form.
|
4
4
|
* @returns {import('@formio/core').Component[]} - The edit form components.
|
5
5
|
*/
|
6
|
-
export default function _default(...extend: any[]): import(
|
6
|
+
export default function _default(...extend: any[]): import("@formio/core").Component[];
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.default = default_1;
|
6
7
|
const lodash_1 = __importDefault(require("lodash"));
|
7
8
|
const Component_edit_conditional_1 = __importDefault(require("./editForm/Component.edit.conditional"));
|
8
9
|
const Component_edit_data_1 = __importDefault(require("./editForm/Component.edit.data"));
|
@@ -79,4 +80,3 @@ function default_1(...extend) {
|
|
79
80
|
})
|
80
81
|
};
|
81
82
|
}
|
82
|
-
exports.default = default_1;
|
@@ -2081,9 +2081,6 @@ class Component extends Element_1.default {
|
|
2081
2081
|
messages = lodash_1.default.uniqBy(messages, message => message.message);
|
2082
2082
|
if (this.refs.messageContainer) {
|
2083
2083
|
this.setContent(this.refs.messageContainer, messages.map((message) => {
|
2084
|
-
if (message.message && typeof message.message === 'string') {
|
2085
|
-
message.message = message.message.replaceAll('<', '<').replaceAll('>', '>');
|
2086
|
-
}
|
2087
2084
|
return this.renderTemplate('message', Object.assign({}, message));
|
2088
2085
|
}).join(''));
|
2089
2086
|
}
|
@@ -2668,7 +2665,7 @@ class Component extends Element_1.default {
|
|
2668
2665
|
*/
|
2669
2666
|
resetValue() {
|
2670
2667
|
this.unset();
|
2671
|
-
this.setValue(this.emptyValue, {
|
2668
|
+
this.setValue(this.defaultValue || this.emptyValue, {
|
2672
2669
|
noUpdateEvent: true,
|
2673
2670
|
noValidate: true,
|
2674
2671
|
resetValue: true
|
@@ -2808,7 +2805,7 @@ class Component extends Element_1.default {
|
|
2808
2805
|
}
|
2809
2806
|
this.calculatedValue = (0, utils_1.fastCloneDeep)(calculatedValue);
|
2810
2807
|
if (changed) {
|
2811
|
-
if (!flags.noPristineChangeOnModified) {
|
2808
|
+
if (!flags.noPristineChangeOnModified && this.root.initialized) {
|
2812
2809
|
this.pristine = false;
|
2813
2810
|
}
|
2814
2811
|
flags.triggeredComponentId = this.id;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
let components: ({
|
3
|
+
label: string;
|
4
|
+
applyMaskOn: string;
|
5
|
+
tableView: boolean;
|
6
|
+
key: string;
|
7
|
+
type: string;
|
8
|
+
input: boolean;
|
9
|
+
defaultValue: string;
|
10
|
+
mask?: undefined;
|
11
|
+
delimiter?: undefined;
|
12
|
+
requireDecimal?: undefined;
|
13
|
+
inputFormat?: undefined;
|
14
|
+
truncateMultipleSpaces?: undefined;
|
15
|
+
widget?: undefined;
|
16
|
+
data?: undefined;
|
17
|
+
action?: undefined;
|
18
|
+
showValidations?: undefined;
|
19
|
+
} | {
|
20
|
+
label: string;
|
21
|
+
applyMaskOn: string;
|
22
|
+
mask: boolean;
|
23
|
+
tableView: boolean;
|
24
|
+
delimiter: boolean;
|
25
|
+
requireDecimal: boolean;
|
26
|
+
inputFormat: string;
|
27
|
+
truncateMultipleSpaces: boolean;
|
28
|
+
key: string;
|
29
|
+
type: string;
|
30
|
+
input: boolean;
|
31
|
+
defaultValue: number;
|
32
|
+
widget?: undefined;
|
33
|
+
data?: undefined;
|
34
|
+
action?: undefined;
|
35
|
+
showValidations?: undefined;
|
36
|
+
} | {
|
37
|
+
label: string;
|
38
|
+
widget: string;
|
39
|
+
tableView: boolean;
|
40
|
+
data: {
|
41
|
+
values: {
|
42
|
+
label: string;
|
43
|
+
value: string;
|
44
|
+
}[];
|
45
|
+
};
|
46
|
+
key: string;
|
47
|
+
type: string;
|
48
|
+
input: boolean;
|
49
|
+
defaultValue: string;
|
50
|
+
applyMaskOn?: undefined;
|
51
|
+
mask?: undefined;
|
52
|
+
delimiter?: undefined;
|
53
|
+
requireDecimal?: undefined;
|
54
|
+
inputFormat?: undefined;
|
55
|
+
truncateMultipleSpaces?: undefined;
|
56
|
+
action?: undefined;
|
57
|
+
showValidations?: undefined;
|
58
|
+
} | {
|
59
|
+
label: string;
|
60
|
+
action: string;
|
61
|
+
showValidations: boolean;
|
62
|
+
tableView: boolean;
|
63
|
+
key: string;
|
64
|
+
type: string;
|
65
|
+
input: boolean;
|
66
|
+
applyMaskOn?: undefined;
|
67
|
+
defaultValue?: undefined;
|
68
|
+
mask?: undefined;
|
69
|
+
delimiter?: undefined;
|
70
|
+
requireDecimal?: undefined;
|
71
|
+
inputFormat?: undefined;
|
72
|
+
truncateMultipleSpaces?: undefined;
|
73
|
+
widget?: undefined;
|
74
|
+
data?: undefined;
|
75
|
+
})[];
|
76
|
+
}
|
77
|
+
export default _default;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = {
|
4
|
+
"components": [
|
5
|
+
{
|
6
|
+
"label": "Text Field",
|
7
|
+
"applyMaskOn": "change",
|
8
|
+
"tableView": true,
|
9
|
+
"key": "textField",
|
10
|
+
"type": "textfield",
|
11
|
+
"input": true,
|
12
|
+
"defaultValue": "test"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"label": "Number",
|
16
|
+
"applyMaskOn": "change",
|
17
|
+
"mask": false,
|
18
|
+
"tableView": false,
|
19
|
+
"delimiter": false,
|
20
|
+
"requireDecimal": false,
|
21
|
+
"inputFormat": "plain",
|
22
|
+
"truncateMultipleSpaces": false,
|
23
|
+
"key": "number",
|
24
|
+
"type": "number",
|
25
|
+
"input": true,
|
26
|
+
"defaultValue": 123
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"label": "Select",
|
30
|
+
"widget": "choicesjs",
|
31
|
+
"tableView": true,
|
32
|
+
"data": {
|
33
|
+
"values": [
|
34
|
+
{
|
35
|
+
"label": "a",
|
36
|
+
"value": "a"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"label": "b",
|
40
|
+
"value": "b"
|
41
|
+
}
|
42
|
+
]
|
43
|
+
},
|
44
|
+
"key": "select",
|
45
|
+
"type": "select",
|
46
|
+
"input": true,
|
47
|
+
"defaultValue": "a"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"label": "Reset",
|
51
|
+
"action": "reset",
|
52
|
+
"showValidations": false,
|
53
|
+
"tableView": false,
|
54
|
+
"key": "reset",
|
55
|
+
"type": "button",
|
56
|
+
"input": true
|
57
|
+
},
|
58
|
+
]
|
59
|
+
};
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
6
|
+
exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
8
8
|
exports.comp1 = comp1_1.default;
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
@@ -14,3 +14,5 @@ const comp4_1 = __importDefault(require("./comp4"));
|
|
14
14
|
exports.comp4 = comp4_1.default;
|
15
15
|
const comp5_1 = __importDefault(require("./comp5"));
|
16
16
|
exports.comp5 = comp5_1.default;
|
17
|
+
const comp6_1 = __importDefault(require("./comp6"));
|
18
|
+
exports.comp6 = comp6_1.default;
|
@@ -151,13 +151,15 @@ class Input extends Multivalue_1.default {
|
|
151
151
|
else {
|
152
152
|
this.addClass(element, 'text-danger');
|
153
153
|
}
|
154
|
-
this.setContent(element, this.t(`
|
155
|
-
remaining: remaining
|
154
|
+
this.setContent(element, this.t(`typeRemaining`, {
|
155
|
+
remaining: remaining,
|
156
|
+
type: type
|
156
157
|
}));
|
157
158
|
}
|
158
159
|
else {
|
159
|
-
this.setContent(element, this.t(`
|
160
|
-
count: count
|
160
|
+
this.setContent(element, this.t(`typeCount`, {
|
161
|
+
count: count,
|
162
|
+
type: type
|
161
163
|
}));
|
162
164
|
}
|
163
165
|
}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* @param {...any} extend - The components that extend the edit form.
|
4
4
|
* @returns {import('@formio/core').Component[]} - The edit form components.
|
5
5
|
*/
|
6
|
-
export default function _default(...extend: any[]): import(
|
6
|
+
export default function _default(...extend: any[]): import("@formio/core").Component[];
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.default = default_1;
|
6
7
|
const Components_1 = __importDefault(require("../../Components"));
|
7
8
|
const ListComponent_edit_data_1 = __importDefault(require("./editForm/ListComponent.edit.data"));
|
8
9
|
/**
|
@@ -18,4 +19,3 @@ function default_1(...extend) {
|
|
18
19
|
},
|
19
20
|
], ...extend);
|
20
21
|
}
|
21
|
-
exports.default = default_1;
|
@@ -103,7 +103,7 @@ export default class NestedComponent extends Field {
|
|
103
103
|
* @param {import('@formio/core').Component} component - The component to check.
|
104
104
|
* @returns {boolean} - TRUE if the component has a component, FALSE otherwise.
|
105
105
|
*/
|
106
|
-
hasComponent(component: import(
|
106
|
+
hasComponent(component: import("@formio/core").Component): boolean;
|
107
107
|
/**
|
108
108
|
* Get the flattened components of this NestedComponent.
|
109
109
|
* @returns {object} - The flattened components of this NestedComponent.
|
@@ -139,7 +139,7 @@ export default class NestedComponent extends Field {
|
|
139
139
|
* @param {import('@formio/core').Component} [replacedComp] - The component to replace with this component.
|
140
140
|
* @returns {any} - The created component instance.
|
141
141
|
*/
|
142
|
-
createComponent(component: import(
|
142
|
+
createComponent(component: import("@formio/core").Component, options: object, data: import("@formio/core").DataObject, before?: import("@formio/core").Component | undefined, replacedComp?: import("@formio/core").Component | undefined): any;
|
143
143
|
getContainer(): any;
|
144
144
|
get componentComponents(): any;
|
145
145
|
get nestedKey(): string;
|
@@ -159,7 +159,7 @@ export default class NestedComponent extends Field {
|
|
159
159
|
* @param {boolean} [noAdd] - A possibly extraneous boolean flag.
|
160
160
|
* @returns {any} - The created component instance.
|
161
161
|
*/
|
162
|
-
addComponent(component: import(
|
162
|
+
addComponent(component: import("@formio/core").Component, data?: object, before?: HTMLElement, noAdd?: boolean | undefined): any;
|
163
163
|
beforeFocus(): void;
|
164
164
|
render(children: any): Field;
|
165
165
|
renderComponents(components: any): any;
|
@@ -168,7 +168,7 @@ export default class NestedComponent extends Field {
|
|
168
168
|
* Attach the logic to the components.
|
169
169
|
* @param {import('@formio/core').Component[]} components - The components to attach logic to.
|
170
170
|
*/
|
171
|
-
attachComponentsLogic(components: import(
|
171
|
+
attachComponentsLogic(components: import("@formio/core").Component[]): void;
|
172
172
|
attachComponents(element: any, components: any, container: any): Promise<any>;
|
173
173
|
/**
|
174
174
|
* Remove a component from the components array and from the children object
|
@@ -176,7 +176,7 @@ export default class NestedComponent extends Field {
|
|
176
176
|
* @param {import('@formio/core').Component[]} components - An array of components to remove this component from.
|
177
177
|
* @param {boolean} [all] - If set to TRUE will cascade remove all components.
|
178
178
|
*/
|
179
|
-
removeComponent(component: import(
|
179
|
+
removeComponent(component: import("@formio/core").Component, components: import("@formio/core").Component[], all?: boolean | undefined): void;
|
180
180
|
/**
|
181
181
|
* Removes a component provided the API key of that component.
|
182
182
|
* @param {string} key - The API key of the component to remove.
|
@@ -224,14 +224,14 @@ export default class NestedComponent extends Field {
|
|
224
224
|
* @param {object} flags - The flags to use when validating.
|
225
225
|
* @returns {Promise<Array>|Array} - The errors if any exist.
|
226
226
|
*/
|
227
|
-
validateComponents(components?: import(
|
227
|
+
validateComponents(components?: import("@formio/core").Component[], data?: import("@formio/core").DataObject, flags?: object): Promise<any[]> | any[];
|
228
228
|
/**
|
229
229
|
* Validate a nested component with data, or its own internal data.
|
230
230
|
* @param {import('@formio/core').DataObject} data - The data to validate.
|
231
231
|
* @param {object} flags - The flags to use when validating.
|
232
232
|
* @returns {Array} - The errors if any exist.
|
233
233
|
*/
|
234
|
-
validate(data?: import(
|
234
|
+
validate(data?: import("@formio/core").DataObject, flags?: object): any[];
|
235
235
|
checkComponentValidity(data?: null, dirty?: boolean, row?: null, flags?: {}, allErrors?: any[]): boolean;
|
236
236
|
checkAsyncValidity(data?: null, dirty?: boolean, row?: null, silentCheck?: boolean): Promise<any>;
|
237
237
|
setPristine(pristine: any): void;
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* @param {...any} extend - The components that extend the edit form.
|
4
4
|
* @returns {import('@formio/core').Component[]} - The edit form components.
|
5
5
|
*/
|
6
|
-
export default function _default(...extend: any[]): import(
|
6
|
+
export default function _default(...extend: any[]): import("@formio/core").Component[];
|