@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
@@ -99,10 +99,21 @@ class ChoicesWrapper extends Choices {
|
|
99
99
|
this._selectHighlightedChoice(activeItems);
|
100
100
|
}
|
101
101
|
}
|
102
|
-
_selectHighlightedChoice(
|
102
|
+
_selectHighlightedChoice() {
|
103
103
|
const highlightedChoice = this.dropdown.getChild(`.${this.config.classNames.highlightedState}`);
|
104
104
|
if (highlightedChoice) {
|
105
|
-
|
105
|
+
const id = highlightedChoice.dataset.id;
|
106
|
+
const choice = id && this._store.getChoiceById(id);
|
107
|
+
this._addItem({
|
108
|
+
value: choice.value,
|
109
|
+
label: choice.label,
|
110
|
+
choiceId: choice.id,
|
111
|
+
groupId: choice.groupId,
|
112
|
+
customProperties: choice.customProperties,
|
113
|
+
placeholder: choice.placeholder,
|
114
|
+
keyCode: choice.keyCode
|
115
|
+
});
|
116
|
+
this._triggerChange(choice.value);
|
106
117
|
}
|
107
118
|
event.preventDefault();
|
108
119
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* @param {object} query - The query to use when searching for the components.
|
5
5
|
* @returns {import('@formio/core').Component[]} - The result of the component that is found.
|
6
6
|
*/
|
7
|
-
export function findComponents(components: import(
|
7
|
+
export function findComponents(components: import("@formio/core").Component[], query: object): import("@formio/core").Component[];
|
8
8
|
export const flattenComponents: typeof Utils.flattenComponents;
|
9
9
|
export const guid: typeof Utils.guid;
|
10
10
|
export const uniqueName: typeof Utils.uniqueName;
|
@@ -16,8 +16,8 @@ export const isComponentModelType: typeof Utils.isComponentModelType;
|
|
16
16
|
export const isComponentNestedDataType: typeof Utils.isComponentNestedDataType;
|
17
17
|
export const componentPath: typeof Utils.componentPath;
|
18
18
|
export const componentChildPath: any;
|
19
|
-
export const eachComponentDataAsync: (components: Component[], data: DataObject, fn: AsyncComponentDataCallback, path?: string
|
20
|
-
export const eachComponentData: (components: Component[], data: DataObject, fn: ComponentDataCallback, path?: string
|
19
|
+
export const eachComponentDataAsync: (components: Component[], data: DataObject, fn: AsyncComponentDataCallback, path?: string, index?: number, parent?: any, includeAll?: boolean) => Promise<void>;
|
20
|
+
export const eachComponentData: (components: Component[], data: DataObject, fn: ComponentDataCallback, path?: string, index?: number, parent?: any, includeAll?: boolean) => void;
|
21
21
|
export const getComponentKey: typeof Utils.getComponentKey;
|
22
22
|
export const getContextualRowPath: typeof Utils.getContextualRowPath;
|
23
23
|
export const getContextualRowData: typeof Utils.getContextualRowData;
|
package/lib/mjs/utils/utils.d.ts
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
* @param {import('@formio/core').EvaluatorOptions} options - The evaluator options.
|
8
8
|
* @returns {*} - The result of the evaluation.
|
9
9
|
*/
|
10
|
-
export function evaluate(func: Function | string | object, args: any, ret: string, interpolate: boolean, options?: import(
|
10
|
+
export function evaluate(func: Function | string | object, args: any, ret: string, interpolate: boolean, options?: import("@formio/core").EvaluatorOptions): any;
|
11
11
|
/**
|
12
12
|
* Returns a random compoennt ID.
|
13
13
|
* @returns {string} - A random component ID.
|
@@ -55,7 +55,7 @@ export function isMongoId(text: string): boolean;
|
|
55
55
|
* @param {import('@formio/core').Submission} submission - A submission object.
|
56
56
|
* @param {*} rowData - The contextual row data for the component.
|
57
57
|
*/
|
58
|
-
export function checkCalculated(component: import(
|
58
|
+
export function checkCalculated(component: import("@formio/core").Component, submission: import("@formio/core").Submission, rowData: any): void;
|
59
59
|
/**
|
60
60
|
* Check if a simple conditional evaluates to true.
|
61
61
|
* @param {import('@formio/core').Component} component - The component to check for the conditional.
|
@@ -65,7 +65,7 @@ export function checkCalculated(component: import('@formio/core').Component, sub
|
|
65
65
|
* @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
|
66
66
|
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
67
67
|
*/
|
68
|
-
export function checkSimpleConditional(component: import(
|
68
|
+
export function checkSimpleConditional(component: import("@formio/core").Component, condition: import("@formio/core").SimpleConditional, row: any, data: any, instance: import("../../src/components/_classes/component/Component").Component): boolean;
|
69
69
|
/**
|
70
70
|
* Returns a components normalized value.
|
71
71
|
* @param {string} compPath - The full path to the component.
|
@@ -86,7 +86,7 @@ export function getComponentActualValue(compPath: string, data: any, row: any):
|
|
86
86
|
* @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
|
87
87
|
* @returns {*} - The result of the evaulation.
|
88
88
|
*/
|
89
|
-
export function checkCustomConditional(component: import(
|
89
|
+
export function checkCustomConditional(component: import("@formio/core").Component, custom: string, row: any, data: any, form: import("@formio/core").Form, variable: string, onError: any, instance: import("../../src/components/_classes/component/Component").Component): any;
|
90
90
|
/**
|
91
91
|
* Check a component for JSON conditionals.
|
92
92
|
* @param {import('@formio/core').Component} component - The component
|
@@ -97,7 +97,7 @@ export function checkCustomConditional(component: import('@formio/core').Compone
|
|
97
97
|
* @param {*} onError - Custom return value if there is an error.
|
98
98
|
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
99
99
|
*/
|
100
|
-
export function checkJsonConditional(component: import(
|
100
|
+
export function checkJsonConditional(component: import("@formio/core").Component, json: import("@formio/core").JSONConditional, row: any, data: any, form: import("@formio/core").Form, onError: any): boolean;
|
101
101
|
/**
|
102
102
|
* Checks the conditions for a provided component and data.
|
103
103
|
* @param {import('@formio/core').Component} component - The component to check for the condition.
|
@@ -107,7 +107,7 @@ export function checkJsonConditional(component: import('@formio/core').Component
|
|
107
107
|
* @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
|
108
108
|
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
109
109
|
*/
|
110
|
-
export function checkCondition(component: import(
|
110
|
+
export function checkCondition(component: import("@formio/core").Component, row: any, data: any, form: import("@formio/core").Form, instance: import("../../src/components/_classes/component/Component").Component): boolean;
|
111
111
|
/**
|
112
112
|
* Test a trigger on a component.
|
113
113
|
* @param {import('@formio/core').Component} component - The component to test the trigger against.
|
@@ -118,7 +118,7 @@ export function checkCondition(component: import('@formio/core').Component, row:
|
|
118
118
|
* @param {any} instance - The component that is performing the trigger.
|
119
119
|
* @returns {boolean} - TRUE if the trigger should fire; FALSE otherwise.
|
120
120
|
*/
|
121
|
-
export function checkTrigger(component: import(
|
121
|
+
export function checkTrigger(component: import("@formio/core").Component, trigger: import("@formio/core").LogicTrigger, row: import("@formio/core").DataObject, data: import("@formio/core").DataObject, form: import("@formio/core").Form, instance: any): boolean;
|
122
122
|
/**
|
123
123
|
* Sets a property on a component via an executed Logic action.
|
124
124
|
* @param {import('@formio/core').Component} component - The component to set the property on.
|
@@ -129,7 +129,13 @@ export function checkTrigger(component: import('@formio/core').Component, trigge
|
|
129
129
|
* @param {any} instance - The component instance.
|
130
130
|
* @returns {import('@formio/core').Component} - The modified component.
|
131
131
|
*/
|
132
|
-
export function setActionProperty(component: import(
|
132
|
+
export function setActionProperty(component: import("@formio/core").Component, action: import("@formio/core").LogicAction, result: string, row: import("@formio/core").DataObject, data: import("@formio/core").DataObject, instance: any): import("@formio/core").Component;
|
133
|
+
/**
|
134
|
+
* Removes HTML tags from string e.g. <div>Hello World</div> => Hello World
|
135
|
+
* @param {string} str - The string to remove HTML tags from.
|
136
|
+
* @returns {string} - The string without HTML tags.
|
137
|
+
*/
|
138
|
+
export function removeHTML(str: string): string;
|
133
139
|
/**
|
134
140
|
* Unescape HTML characters like <, >, & and etc.
|
135
141
|
* @param {string} str - The string to unescape.
|
@@ -287,7 +293,7 @@ export function getNumberSeparators(lang?: string): {
|
|
287
293
|
* @param {number} defaultLimit - The default limit to use if none is provided in the component.
|
288
294
|
* @returns {number} - The number of decimal places allowed.
|
289
295
|
*/
|
290
|
-
export function getNumberDecimalLimit(component: import(
|
296
|
+
export function getNumberDecimalLimit(component: import("@formio/core").Component, defaultLimit: number): number;
|
291
297
|
/**
|
292
298
|
* Returns the currency affixes for a specific language.
|
293
299
|
* @param {object} arg0 - The arguments object.
|
@@ -312,7 +318,7 @@ export function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, l
|
|
312
318
|
* @param {import('@formio/core').Component} component - The component to fetch the field data for.
|
313
319
|
* @returns {*} - The field data.
|
314
320
|
*/
|
315
|
-
export function fieldData(data: import(
|
321
|
+
export function fieldData(data: import("@formio/core").DataObject, component: import("@formio/core").Component): any;
|
316
322
|
/**
|
317
323
|
* Delays function execution with possibility to execute function synchronously or cancel it.
|
318
324
|
* @param {Function} fn - Function to delay
|
@@ -410,7 +416,7 @@ export function fastCloneDeep(obj: any): any;
|
|
410
416
|
* @param {import('@formio/core').Component} componentJson - The JSON of a component.
|
411
417
|
* @returns {bool} - TRUE if the component is an input component; FALSE otherwise.
|
412
418
|
*/
|
413
|
-
export function isInputComponent(componentJson: import(
|
419
|
+
export function isInputComponent(componentJson: import("@formio/core").Component): bool;
|
414
420
|
/**
|
415
421
|
* Takes a component path, and returns a component path array.
|
416
422
|
* @param {string} pathStr - The path string to convert to an array.
|
@@ -460,7 +466,7 @@ export function getComponentPathWithoutIndicies(path?: string): string;
|
|
460
466
|
* @param {string} path - Path to the component
|
461
467
|
* @returns {string} - Path to the component
|
462
468
|
*/
|
463
|
-
export function getComponentPath(component: import(
|
469
|
+
export function getComponentPath(component: import("@formio/core").Component, path?: string): string;
|
464
470
|
/**
|
465
471
|
* Returns a parent component of the passed component instance skipping all the Layout components
|
466
472
|
* @param {Component} componentInstance - The component to check for the parent.
|
@@ -492,7 +498,7 @@ export function getFocusableElements(element: HTMLElement): NodeList<HTMLElement
|
|
492
498
|
* @param {import('@formio/core').Component} fullSchema - The component schema
|
493
499
|
* @returns {Array<string>|null} - The saved types for the component
|
494
500
|
*/
|
495
|
-
export function getComponentSavedTypes(fullSchema: import(
|
501
|
+
export function getComponentSavedTypes(fullSchema: import("@formio/core").Component): Array<string> | null;
|
496
502
|
/**
|
497
503
|
* Returns the template keys inside the template code.
|
498
504
|
* @param {string} template - The template to get the keys from.
|
@@ -504,7 +510,7 @@ export function getItemTemplateKeys(template: string): Array<string>;
|
|
504
510
|
* @param {import('@formio/core').Component} comp - The component to check.
|
505
511
|
* @returns {boolean} - TRUE if the component is a select resource with an object for its value; FALSE otherwise.
|
506
512
|
*/
|
507
|
-
export function isSelectResourceWithObjectValue(comp?: import(
|
513
|
+
export function isSelectResourceWithObjectValue(comp?: import("@formio/core").Component): boolean;
|
508
514
|
export * from "./formUtils";
|
509
515
|
/**
|
510
516
|
* Map values through unfold and return first non-nil value.
|
package/lib/mjs/utils/utils.js
CHANGED
@@ -379,6 +379,15 @@ export function setActionProperty(component, action, result, row, data, instance
|
|
379
379
|
}
|
380
380
|
return component;
|
381
381
|
}
|
382
|
+
/**
|
383
|
+
* Removes HTML tags from string e.g. <div>Hello World</div> => Hello World
|
384
|
+
* @param {string} str - The string to remove HTML tags from.
|
385
|
+
* @returns {string} - The string without HTML tags.
|
386
|
+
*/
|
387
|
+
export function removeHTML(str) {
|
388
|
+
const doc = new window.DOMParser().parseFromString(str, 'text/html');
|
389
|
+
return (doc.body.textContent || '').trim();
|
390
|
+
}
|
382
391
|
/**
|
383
392
|
* Unescape HTML characters like <, >, & and etc.
|
384
393
|
* @param {string} str - The string to unescape.
|
@@ -388,8 +397,9 @@ export function unescapeHTML(str) {
|
|
388
397
|
if (typeof window === 'undefined' || !('DOMParser' in window)) {
|
389
398
|
return str;
|
390
399
|
}
|
391
|
-
const
|
392
|
-
|
400
|
+
const elem = document.createElement('textarea');
|
401
|
+
elem.innerHTML = str;
|
402
|
+
return elem.value;
|
393
403
|
}
|
394
404
|
/**
|
395
405
|
* Make HTML element from string
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.0.0-rc.
|
3
|
+
"version": "5.0.0-rc.60",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -79,9 +79,9 @@
|
|
79
79
|
},
|
80
80
|
"homepage": "https://github.com/formio/formio.js#readme",
|
81
81
|
"dependencies": {
|
82
|
-
"@formio/bootstrap": "
|
82
|
+
"@formio/bootstrap": "3.0.0-dev.98.17ba6ea",
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
84
|
-
"@formio/core": "
|
84
|
+
"@formio/core": "2.1.0-dev.104.42720ba",
|
85
85
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|
@@ -117,9 +117,9 @@
|
|
117
117
|
"vanilla-picker": "^2.12.3"
|
118
118
|
},
|
119
119
|
"devDependencies": {
|
120
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
121
|
-
"@typescript-eslint/parser": "^7.
|
122
|
-
"ace-builds": "1.
|
120
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
121
|
+
"@typescript-eslint/parser": "^7.14.1",
|
122
|
+
"ace-builds": "1.35.1",
|
123
123
|
"async-limiter": "^2.0.0",
|
124
124
|
"bootstrap-icons": "^1.10.5",
|
125
125
|
"bootswatch": "^5.3.3",
|
@@ -129,7 +129,7 @@
|
|
129
129
|
"ejs-loader": "^0.5.0",
|
130
130
|
"escape-string-regexp": "^5.0.0",
|
131
131
|
"eslint": "^8.57.0",
|
132
|
-
"eslint-plugin-jsdoc": "^48.
|
132
|
+
"eslint-plugin-jsdoc": "^48.5.0",
|
133
133
|
"fetch-mock": "^9.11.0",
|
134
134
|
"file-loader": "^6.2.0",
|
135
135
|
"flatpickr": "^4.6.13",
|
@@ -153,7 +153,7 @@
|
|
153
153
|
"karma-mocha-reporter": "^2.2.5",
|
154
154
|
"karma-phantomjs-launcher": "^1.0.4",
|
155
155
|
"karma-webpack": "^5.0.1",
|
156
|
-
"mocha": "^10.
|
156
|
+
"mocha": "^10.5.2",
|
157
157
|
"mock-local-storage": "^1.1.24",
|
158
158
|
"natives": "^1.1.6",
|
159
159
|
"power-assert": "^1.6.1",
|
@@ -161,7 +161,7 @@
|
|
161
161
|
"pretty": "^2.0.0",
|
162
162
|
"pygments-css": "^1.0.0",
|
163
163
|
"raw-loader": "^4.0.2",
|
164
|
-
"sass": "^1.77.
|
164
|
+
"sass": "^1.77.6",
|
165
165
|
"shortcut-buttons-flatpickr": "^0.4.0",
|
166
166
|
"sinon": "^17.0.1",
|
167
167
|
"string-replace-loader": "^3.1.0",
|
@@ -169,8 +169,8 @@
|
|
169
169
|
"ts-node": "^10.9.1",
|
170
170
|
"tsc": "^2.0.4",
|
171
171
|
"typedoc": "^0.25.13",
|
172
|
-
"typescript": "5.
|
173
|
-
"webpack": "^5.
|
172
|
+
"typescript": "5.5.2",
|
173
|
+
"webpack": "^5.92.1",
|
174
174
|
"webpack-bundle-analyzer": "^4.10.2",
|
175
175
|
"webpack-cli": "^5.1.1",
|
176
176
|
"webpack-node-externals": "^3.0.0",
|