@formio/js 5.0.0-bb.dev.6 → 5.0.0-dev.5543.201e658
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fonts/bootstrap-icons.woff +0 -0
- package/dist/fonts/bootstrap-icons.woff2 +0 -0
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +4089 -4088
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +5 -5
- package/dist/formio.full.css +101 -4
- package/dist/formio.full.js +5080 -5079
- package/dist/formio.full.min.css +3 -3
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +5 -5
- package/dist/formio.js +1091 -1090
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -2
- package/dist/formio.utils.js +7 -7
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +3 -3
- package/lib/cjs/Form.js +16 -3
- package/lib/cjs/Webform.d.ts +1 -0
- package/lib/cjs/Webform.js +28 -8
- package/lib/cjs/WebformBuilder.js +4 -2
- package/lib/cjs/components/address/fixtures/comp3.js +1 -1
- package/lib/cjs/components/button/Button.js +7 -1
- package/lib/cjs/components/datagrid/fixtures/comp6.js +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +4 -3
- package/lib/cjs/components/recaptcha/ReCaptcha.js +44 -44
- package/lib/cjs/formio.form.d.ts +1 -2
- package/lib/cjs/formio.form.js +1 -17
- package/lib/cjs/providers/storage/s3.d.ts +4 -1
- package/lib/cjs/providers/storage/s3.js +1 -29
- package/lib/cjs/translations/en.d.ts +2 -0
- package/lib/cjs/translations/en.js +2 -0
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +1 -1
- package/lib/cjs/utils/utils.js +2 -1
- package/lib/cjs/validator/Validator.d.ts +1 -1
- package/lib/cjs/validator/rules/Select.d.ts +1 -1
- package/lib/mjs/Form.js +16 -3
- package/lib/mjs/Webform.d.ts +1 -0
- package/lib/mjs/Webform.js +28 -8
- package/lib/mjs/WebformBuilder.js +4 -2
- package/lib/mjs/components/address/fixtures/comp3.js +1 -1
- package/lib/mjs/components/button/Button.js +7 -1
- package/lib/mjs/components/datagrid/fixtures/comp6.js +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +4 -3
- package/lib/mjs/components/recaptcha/ReCaptcha.js +30 -41
- package/lib/mjs/formio.form.d.ts +1 -2
- package/lib/mjs/formio.form.js +1 -16
- package/lib/mjs/providers/storage/s3.d.ts +4 -1
- package/lib/mjs/providers/storage/s3.js +1 -6
- package/lib/mjs/translations/en.d.ts +2 -0
- package/lib/mjs/translations/en.js +2 -0
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
- package/lib/mjs/utils/utils.js +2 -1
- package/lib/mjs/validator/Validator.d.ts +1 -1
- package/lib/mjs/validator/rules/Select.d.ts +1 -1
- package/package.json +5 -4
- package/types/builders.d.ts +7 -0
- package/types/components/_classes/component/component.d.ts +174 -0
- package/types/components/_classes/componentmodal/componentmodal.d.ts +31 -0
- package/types/components/_classes/field/field.d.ts +5 -0
- package/types/components/_classes/input/input.d.ts +30 -0
- package/types/components/_classes/multivalue/multivalue.d.ts +16 -0
- package/types/components/_classes/nested/nestedComponent.d.ts +61 -0
- package/types/components/_classes/widgetcomponent/widgetComponent.d.ts +6 -0
- package/types/components/components.d.ts +69 -0
- package/types/components/schema.d.ts +240 -0
- package/types/displays.d.ts +7 -0
- package/types/element.d.ts +45 -0
- package/types/eventEmitter.d.ts +3 -0
- package/types/form.d.ts +18 -0
- package/types/formbuilder.d.ts +6 -0
- package/types/formio.d.ts +121 -0
- package/types/index.d.ts +18 -0
- package/types/licenses.d.ts +7 -0
- package/types/providers.d.ts +8 -0
- package/types/rulesEngine/conjunctions.d.ts +7 -0
- package/types/rulesEngine/operators.d.ts +7 -0
- package/types/rulesEngine/quckRules.d.ts +7 -0
- package/types/rulesEngine/rules.d.ts +7 -0
- package/types/rulesEngine/transformers.d.ts +7 -0
- package/types/rulesEngine/valueSources.d.ts +7 -0
- package/types/templates.d.ts +8 -0
- package/types/utils.d.ts +157 -0
- package/types/widgets.d.ts +4 -0
|
@@ -976,6 +976,7 @@ export default class WebformBuilder extends Component {
|
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
updateComponent(component, changed) {
|
|
979
|
+
const sanitizeConfig = _.get(this.webform, 'form.settings.sanitizeConfig') || _.get(this.webform, 'form.globalSettings.sanitizeConfig');
|
|
979
980
|
// Update the preview.
|
|
980
981
|
if (this.preview) {
|
|
981
982
|
this.preview.form = {
|
|
@@ -987,13 +988,14 @@ export default class WebformBuilder extends Component {
|
|
|
987
988
|
'autofocus',
|
|
988
989
|
'customConditional',
|
|
989
990
|
])],
|
|
990
|
-
config: this.options.formConfig || {}
|
|
991
|
+
config: this.options.formConfig || {},
|
|
992
|
+
sanitizeConfig,
|
|
991
993
|
};
|
|
992
994
|
const fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];
|
|
993
995
|
this.preview.form.components.forEach(component => this.replaceDoubleQuotes(component, fieldsToRemoveDoubleQuotes));
|
|
994
996
|
const previewElement = this.componentEdit.querySelector('[ref="preview"]');
|
|
995
997
|
if (previewElement) {
|
|
996
|
-
this.setContent(previewElement, this.preview.render());
|
|
998
|
+
this.setContent(previewElement, this.preview.render(), null, sanitizeConfig);
|
|
997
999
|
this.preview.attach(previewElement);
|
|
998
1000
|
}
|
|
999
1001
|
}
|
|
@@ -357,9 +357,15 @@ export default class ButtonComponent extends Field {
|
|
|
357
357
|
response_type: 'code',
|
|
358
358
|
client_id: settings.clientId,
|
|
359
359
|
redirect_uri: (settings.redirectURI && this.interpolate(settings.redirectURI)) || window.location.origin || `${window.location.protocol}//${window.location.host}`,
|
|
360
|
-
state: settings.state,
|
|
361
360
|
scope: settings.scope
|
|
362
361
|
};
|
|
362
|
+
if (settings.state) {
|
|
363
|
+
params.state = settings.state;
|
|
364
|
+
}
|
|
365
|
+
else if (settings.code_challenge) {
|
|
366
|
+
params.code_challenge = settings.code_challenge;
|
|
367
|
+
params.code_challenge_method = 'S256';
|
|
368
|
+
}
|
|
363
369
|
/*eslint-enable camelcase */
|
|
364
370
|
// Needs for the correct redirection URI for the OpenID
|
|
365
371
|
const originalRedirectUri = params.redirect_uri;
|
|
@@ -13,11 +13,12 @@ export default class ReCaptchaComponent extends Component {
|
|
|
13
13
|
createInput(): void;
|
|
14
14
|
recaptchaApiReady: any;
|
|
15
15
|
createLabel(): void;
|
|
16
|
-
verify(actionName: any): void
|
|
17
|
-
recaptchaVerifiedPromise: Promise<
|
|
16
|
+
verify(actionName: any): Promise<void>;
|
|
17
|
+
recaptchaVerifiedPromise: Promise<any> | undefined;
|
|
18
18
|
isLoading: boolean | undefined;
|
|
19
|
+
loading: boolean | undefined;
|
|
19
20
|
sendVerificationRequest(token: any): any;
|
|
20
|
-
checkComponentValidity(data: any, dirty: any, row: any, options?: {}):
|
|
21
|
+
checkComponentValidity(data: any, dirty: any, row: any, options?: {}): boolean | Promise<boolean>;
|
|
21
22
|
normalizeValue(newValue: any): any;
|
|
22
23
|
}
|
|
23
24
|
import Component from '../_classes/component/Component';
|
|
@@ -55,7 +55,7 @@ export default class ReCaptchaComponent extends Component {
|
|
|
55
55
|
get skipInEmail() {
|
|
56
56
|
return true;
|
|
57
57
|
}
|
|
58
|
-
verify(actionName) {
|
|
58
|
+
async verify(actionName) {
|
|
59
59
|
const siteKey = _get(this.root.form, 'settings.recaptcha.siteKey');
|
|
60
60
|
if (!siteKey) {
|
|
61
61
|
console.warn('There is no Site Key specified in settings in form JSON');
|
|
@@ -65,40 +65,34 @@ export default class ReCaptchaComponent extends Component {
|
|
|
65
65
|
const recaptchaApiScriptUrl = `https://www.google.com/recaptcha/api.js?render=${_get(this.root.form, 'settings.recaptcha.siteKey')}`;
|
|
66
66
|
this.recaptchaApiReady = Formio.requireLibrary('googleRecaptcha', 'grecaptcha', recaptchaApiScriptUrl, true);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
try {
|
|
69
|
+
await this.recaptchaApiReady;
|
|
69
70
|
this.recaptchaVerifiedPromise = new Promise((resolve, reject) => {
|
|
70
|
-
this.
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.isLoading = false;
|
|
91
|
-
});
|
|
92
|
-
}, 1000));
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
.catch(() => {
|
|
96
|
-
return reject();
|
|
97
|
-
});
|
|
98
|
-
}).then(() => {
|
|
99
|
-
this.isLoading = false;
|
|
71
|
+
if (!this.isLoading) {
|
|
72
|
+
this.isLoading = true;
|
|
73
|
+
grecaptcha.ready(_debounce(async () => {
|
|
74
|
+
try {
|
|
75
|
+
const token = await grecaptcha.execute(siteKey, { action: actionName });
|
|
76
|
+
const verificationResult = await this.sendVerificationRequest(token);
|
|
77
|
+
this.recaptchaResult = {
|
|
78
|
+
...verificationResult,
|
|
79
|
+
token,
|
|
80
|
+
};
|
|
81
|
+
this.updateValue(this.recaptchaResult);
|
|
82
|
+
this.isLoading = false;
|
|
83
|
+
return resolve(verificationResult);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
this.isLoading = false;
|
|
87
|
+
reject(err);
|
|
88
|
+
}
|
|
89
|
+
}, 1000));
|
|
90
|
+
}
|
|
100
91
|
});
|
|
101
92
|
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
this.loading = false;
|
|
95
|
+
}
|
|
102
96
|
}
|
|
103
97
|
beforeSubmit() {
|
|
104
98
|
if (this.recaptchaVerifiedPromise) {
|
|
@@ -108,14 +102,13 @@ export default class ReCaptchaComponent extends Component {
|
|
|
108
102
|
return super.beforeSubmit();
|
|
109
103
|
}
|
|
110
104
|
sendVerificationRequest(token) {
|
|
111
|
-
return Formio.makeStaticRequest(`${Formio.projectUrl}/recaptcha?recaptchaToken=${token}`)
|
|
112
|
-
.then((verificationResult) => ({ verificationResult, token }));
|
|
105
|
+
return Formio.makeStaticRequest(`${Formio.projectUrl}/recaptcha?recaptchaToken=${token}`);
|
|
113
106
|
}
|
|
114
107
|
checkComponentValidity(data, dirty, row, options = {}) {
|
|
115
108
|
data = data || this.rootValue;
|
|
116
109
|
row = row || this.data;
|
|
117
110
|
const { async = false } = options;
|
|
118
|
-
// Verification could be async only
|
|
111
|
+
// Verification could be async only (which for now is only the case for server-side validation)
|
|
119
112
|
if (!async) {
|
|
120
113
|
return super.checkComponentValidity(data, dirty, row, options);
|
|
121
114
|
}
|
|
@@ -128,12 +121,8 @@ export default class ReCaptchaComponent extends Component {
|
|
|
128
121
|
this.setCustomValidity(this.t('reCaptchaTokenValidationError'));
|
|
129
122
|
return Promise.resolve(false);
|
|
130
123
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
.catch((err) => {
|
|
134
|
-
this.setCustomValidity(this.t(err.message || err));
|
|
135
|
-
return false;
|
|
136
|
-
});
|
|
124
|
+
// Any further validation will 100% not run on the client
|
|
125
|
+
return Promise.resolve(true);
|
|
137
126
|
}
|
|
138
127
|
normalizeValue(newValue) {
|
|
139
128
|
// If a recaptcha result has already been established, then do not allow it to be reset.
|
package/lib/mjs/formio.form.d.ts
CHANGED
|
@@ -20,5 +20,4 @@ import Utils from './utils';
|
|
|
20
20
|
import Form from './Form';
|
|
21
21
|
import { Formio } from './Formio';
|
|
22
22
|
import Licenses from './licenses';
|
|
23
|
-
|
|
24
|
-
export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, Formio, Licenses, EventEmitter };
|
|
23
|
+
export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, Formio, Licenses };
|
package/lib/mjs/formio.form.js
CHANGED
|
@@ -16,7 +16,6 @@ import Form from './Form';
|
|
|
16
16
|
import Utils from './utils';
|
|
17
17
|
import Evaluator from './utils/Evaluator';
|
|
18
18
|
import Licenses from './licenses';
|
|
19
|
-
import EventEmitter from './EventEmitter';
|
|
20
19
|
Formio.loadModules = (path = `${Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {
|
|
21
20
|
Formio.requireLibrary(name, name, path, true)
|
|
22
21
|
.then((modules) => {
|
|
@@ -143,19 +142,5 @@ export function useModule(defaultFn = null) {
|
|
|
143
142
|
* Formio.plugins([plugin1, plugin2, etc], options);
|
|
144
143
|
*/
|
|
145
144
|
Formio.use = useModule();
|
|
146
|
-
// Allow simple embedding.
|
|
147
|
-
Formio.embedForm = (embed) => Form.embed(embed);
|
|
148
|
-
/**
|
|
149
|
-
* Factory that creates a new form based on the form parameters.
|
|
150
|
-
*
|
|
151
|
-
* @param element {HMTLElement} - The HTML Element to add this form to.
|
|
152
|
-
* @param form {string|Object} - The src of the form, or a form object.
|
|
153
|
-
* @param options {Object} - The options to create this form.
|
|
154
|
-
*
|
|
155
|
-
* @return {Promise} - When the form is instance is ready.
|
|
156
|
-
*/
|
|
157
|
-
Formio.createForm = (...args) => {
|
|
158
|
-
return (new Form(...args)).ready;
|
|
159
|
-
};
|
|
160
145
|
// Export the components.
|
|
161
|
-
export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, Formio, Licenses
|
|
146
|
+
export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, Formio, Licenses };
|
|
@@ -12,7 +12,10 @@ declare function s3(formio: any): {
|
|
|
12
12
|
}>;
|
|
13
13
|
completeMultipartUpload(serverResponse: any, parts: any, multipart: any): Promise<void>;
|
|
14
14
|
abortMultipartUpload(serverResponse: any): void;
|
|
15
|
-
uploadParts(file: any, urls: any, headers: any, partSize: any, multipart: any, abortSignal: any): Promise<
|
|
15
|
+
uploadParts(file: any, urls: any, headers: any, partSize: any, multipart: any, abortSignal: any): Promise<{
|
|
16
|
+
ETag: string;
|
|
17
|
+
PartNumber: number;
|
|
18
|
+
}[]>;
|
|
16
19
|
downloadFile(file: any): any;
|
|
17
20
|
deleteFile(fileInfo: any): any;
|
|
18
21
|
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import XHR from './xhr';
|
|
2
2
|
import { withRetries } from './util';
|
|
3
|
-
const
|
|
4
|
-
if (typeof AbortController === 'undefined') {
|
|
5
|
-
await import('abortcontroller-polyfill/dist/polyfill-patch-fetch');
|
|
6
|
-
}
|
|
7
|
-
};
|
|
3
|
+
const AbortController = window.AbortController || require('abortcontroller-polyfill/dist/cjs-ponyfill');
|
|
8
4
|
function s3(formio) {
|
|
9
5
|
return {
|
|
10
6
|
async uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions) {
|
|
@@ -14,7 +10,6 @@ function s3(formio) {
|
|
|
14
10
|
if (response.signed) {
|
|
15
11
|
if (multipartOptions && Array.isArray(response.signed)) {
|
|
16
12
|
// patch abort callback
|
|
17
|
-
await loadAbortControllerPolyfill();
|
|
18
13
|
const abortController = new AbortController();
|
|
19
14
|
const abortSignal = abortController.signal;
|
|
20
15
|
if (typeof abortCallback === 'function') {
|
|
@@ -57,6 +57,8 @@ declare namespace _default {
|
|
|
57
57
|
const saveDraftInstanceError: string;
|
|
58
58
|
const saveDraftAuthError: string;
|
|
59
59
|
const restoreDraftInstanceError: string;
|
|
60
|
+
const saveDraftError: string;
|
|
61
|
+
const restoreDraftError: string;
|
|
60
62
|
const time: string;
|
|
61
63
|
const cancelButtonAriaLabel: string;
|
|
62
64
|
const previousButtonAriaLabel: string;
|
|
@@ -57,6 +57,8 @@ export default {
|
|
|
57
57
|
saveDraftInstanceError: 'Cannot save draft because there is no formio instance.',
|
|
58
58
|
saveDraftAuthError: 'Cannot save draft unless a user is authenticated.',
|
|
59
59
|
restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.',
|
|
60
|
+
saveDraftError: 'Unable to save draft.',
|
|
61
|
+
restoreDraftError: 'Unable to restore draft.',
|
|
60
62
|
time: 'Invalid time',
|
|
61
63
|
cancelButtonAriaLabel: 'Cancel button. Click to reset the form',
|
|
62
64
|
previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab',
|
|
@@ -9,7 +9,7 @@ export default class IsEqualTo extends ConditionOperator {
|
|
|
9
9
|
return 'Is Equal To';
|
|
10
10
|
}
|
|
11
11
|
execute({ value, comparedValue, instance, conditionComponentPath }) {
|
|
12
|
-
if (value && comparedValue && typeof value !== typeof comparedValue && _.isString(comparedValue)) {
|
|
12
|
+
if ((value || value === false) && comparedValue && typeof value !== typeof comparedValue && _.isString(comparedValue)) {
|
|
13
13
|
try {
|
|
14
14
|
comparedValue = JSON.parse(comparedValue);
|
|
15
15
|
}
|
package/lib/mjs/utils/utils.js
CHANGED
|
@@ -1168,7 +1168,8 @@ export function sanitize(string, options) {
|
|
|
1168
1168
|
}
|
|
1169
1169
|
// Allowd URI Regex
|
|
1170
1170
|
if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {
|
|
1171
|
-
|
|
1171
|
+
const allowedUriRegex = options.sanitizeConfig.allowedUriRegex;
|
|
1172
|
+
sanitizeOptions.ALLOWED_URI_REGEXP = _.isString(allowedUriRegex) ? new RegExp(allowedUriRegex) : allowedUriRegex;
|
|
1172
1173
|
}
|
|
1173
1174
|
// Allow to extend the existing array of elements that are safe for URI-like values
|
|
1174
1175
|
if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {
|
|
@@ -33,7 +33,7 @@ export class ValidationChecker {
|
|
|
33
33
|
key: string;
|
|
34
34
|
hasLabel: boolean;
|
|
35
35
|
message(component: any): any;
|
|
36
|
-
check(component: any, setting: any, value: any, data: any, index: any, row: any, async: any): any
|
|
36
|
+
check(component: any, setting: any, value: any, data: any, index: any, row: any, async: any): true | Promise<any>;
|
|
37
37
|
};
|
|
38
38
|
min: {
|
|
39
39
|
key: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formio/js",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-dev.5543.201e658",
|
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"require": "./lib/cjs/formio.embed.js"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
"types": "index.d.ts",
|
|
29
30
|
"files": [
|
|
30
31
|
"dist",
|
|
31
32
|
"lib",
|
|
@@ -78,8 +79,8 @@
|
|
|
78
79
|
"homepage": "https://github.com/formio/formio.js#readme",
|
|
79
80
|
"dependencies": {
|
|
80
81
|
"@formio/bootstrap": "^3.0.0-rc.20",
|
|
81
|
-
"@formio/choices.js": "^10.2.
|
|
82
|
-
"@formio/core": "
|
|
82
|
+
"@formio/choices.js": "^10.2.1",
|
|
83
|
+
"@formio/core": "1.3.0-rc.16",
|
|
83
84
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
|
84
85
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
|
85
86
|
"abortcontroller-polyfill": "^1.7.5",
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
"jwt-decode": "^3.1.2",
|
|
107
108
|
"lodash": "^4.17.21",
|
|
108
109
|
"moment": "^2.29.4",
|
|
109
|
-
"moment-timezone": "^0.5.
|
|
110
|
+
"moment-timezone": "^0.5.44",
|
|
110
111
|
"quill": "^2.0.0-dev.3",
|
|
111
112
|
"signature_pad": "^4.1.4",
|
|
112
113
|
"string-hash": "^1.1.3",
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Element } from '../../../element';
|
|
2
|
+
import { ComponentSchema, ElementInfo, ExtendedComponentSchema, ValidateOptions } from './../../schema.d';
|
|
3
|
+
|
|
4
|
+
export class Component extends Element {
|
|
5
|
+
static schema(sources: ExtendedComponentSchema): ExtendedComponentSchema;
|
|
6
|
+
static tableView(value: any, options: any): void;
|
|
7
|
+
constructor(component: any, options: Object, data: Object);
|
|
8
|
+
public originalComponent: any | Component;
|
|
9
|
+
public refs: Object;
|
|
10
|
+
public attached: boolean;
|
|
11
|
+
public rendered: boolean;
|
|
12
|
+
public data: Object;
|
|
13
|
+
public component: any;
|
|
14
|
+
public error: string;
|
|
15
|
+
public tooltip: string;
|
|
16
|
+
public row: any;
|
|
17
|
+
public pristine: boolean;
|
|
18
|
+
public parent: any;
|
|
19
|
+
public root: any;
|
|
20
|
+
public lastChanged: any;
|
|
21
|
+
public triggerRedraw: Function;
|
|
22
|
+
public tooltips: any[];
|
|
23
|
+
public invalid: boolean;
|
|
24
|
+
public isBuilt: boolean;
|
|
25
|
+
readonly ready: any;
|
|
26
|
+
readonly labelInfo: any;
|
|
27
|
+
init(): void;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
readonly shouldDisabled: any | boolean;
|
|
30
|
+
readonly isInputComponent: boolean;
|
|
31
|
+
readonly defaultSchema: ComponentSchema;
|
|
32
|
+
readonly hasInput: boolean;
|
|
33
|
+
readonly key: any;
|
|
34
|
+
public parentVisible: any | boolean;
|
|
35
|
+
public parentDisabled: any | boolean;
|
|
36
|
+
public visible: any | boolean;
|
|
37
|
+
public currentForm: any;
|
|
38
|
+
readonly fullMode: boolean;
|
|
39
|
+
readonly builderMode: boolean;
|
|
40
|
+
getModifiedSchema(
|
|
41
|
+
schema: ExtendedComponentSchema,
|
|
42
|
+
defaultSchema: ComponentSchema,
|
|
43
|
+
recursion: boolean,
|
|
44
|
+
): ExtendedComponentSchema;
|
|
45
|
+
readonly schema: ExtendedComponentSchema;
|
|
46
|
+
t(text: string, params?: Object): any;
|
|
47
|
+
labelIsHidden(): boolean;
|
|
48
|
+
readonly transform: any;
|
|
49
|
+
getTemplate(names: any, modes: any): any;
|
|
50
|
+
checkTemplate(templates: any, names: any, modes: any): any;
|
|
51
|
+
checkTemplateMode(templatesByName: any, modes: any): any;
|
|
52
|
+
renderTemplate(name: any, data: any, modeOption?: any[]): any;
|
|
53
|
+
sanitize(dirty: string): any;
|
|
54
|
+
renderString(template: any, data: any): HTMLElement;
|
|
55
|
+
performInputMapping(input: any): any;
|
|
56
|
+
getBrowserLanguage(): string | null;
|
|
57
|
+
beforeNext(): any;
|
|
58
|
+
beforePage(): any;
|
|
59
|
+
beforeSubmit(): any;
|
|
60
|
+
readonly submissionTimezone: string | any;
|
|
61
|
+
readonly canDisable: boolean;
|
|
62
|
+
loadRefs(element: any, refs: any): any;
|
|
63
|
+
build(element: any): any;
|
|
64
|
+
render(children: any, topLevel?: boolean): any;
|
|
65
|
+
attach(element: any): any;
|
|
66
|
+
addShortcut(element: any, shortcut: any): void;
|
|
67
|
+
removeShortcut(element: any, shortcut: any): void;
|
|
68
|
+
detach(): void;
|
|
69
|
+
attachRefreshEvent(refreshData: any): void;
|
|
70
|
+
attachRefreshOn(): void;
|
|
71
|
+
refresh(value: any): void;
|
|
72
|
+
inContext(component: any): boolean;
|
|
73
|
+
readonly viewOnly: boolean | any;
|
|
74
|
+
createViewOnlyElement(): HTMLElement;
|
|
75
|
+
readonly defaultViewOnlyValue: '-';
|
|
76
|
+
getValueAsString(value: any): string;
|
|
77
|
+
getView(value: any): string;
|
|
78
|
+
updateItems(...args: any[]): void;
|
|
79
|
+
createModal(): HTMLElement;
|
|
80
|
+
readonly className: string;
|
|
81
|
+
readonly customStyle: string;
|
|
82
|
+
getElement(): HTMLElement;
|
|
83
|
+
evalContext(additional: any): any;
|
|
84
|
+
setPristine(pristine: boolean): void;
|
|
85
|
+
removeValue(index: number): void;
|
|
86
|
+
iconClass(name: any, spinning: any): any;
|
|
87
|
+
readonly name: string;
|
|
88
|
+
readonly errorLabel: string;
|
|
89
|
+
errorMessage(type: any): any;
|
|
90
|
+
setContent(element: any, content: any): boolean;
|
|
91
|
+
redraw(): any;
|
|
92
|
+
rebuild(): any;
|
|
93
|
+
removeEventListeners(): void;
|
|
94
|
+
hasClass(element: any, className: string): any;
|
|
95
|
+
addClass(element: any, className: string): any;
|
|
96
|
+
removeClass(element: any, className: string): any;
|
|
97
|
+
hasCondition(): boolean;
|
|
98
|
+
conditionallyVisible(data: any): boolean;
|
|
99
|
+
checkCondition(row: any, data: Object): boolean;
|
|
100
|
+
checkConditions(data: any): any;
|
|
101
|
+
readonly logic: any[];
|
|
102
|
+
fieldLogic(data: any): any;
|
|
103
|
+
applyActions(actions: any[], result: any, data: any, newComponent: any): boolean;
|
|
104
|
+
addInputError(message: any, dirty: boolean): void;
|
|
105
|
+
clearOnHide(show: boolean): void;
|
|
106
|
+
onChange(flags: Object, fromRoot: boolean): void;
|
|
107
|
+
readonly wysiwygDefault: {
|
|
108
|
+
theme: string;
|
|
109
|
+
placeholder: any | string;
|
|
110
|
+
modules: {
|
|
111
|
+
clipboard: {
|
|
112
|
+
matchVisual: boolean;
|
|
113
|
+
};
|
|
114
|
+
toolbar: any[];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
addCKE(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any;
|
|
118
|
+
addQuill(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any;
|
|
119
|
+
addAce(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any;
|
|
120
|
+
readonly emptyValue: null;
|
|
121
|
+
hasValue(data: Object): boolean;
|
|
122
|
+
readonly rootValue: any;
|
|
123
|
+
readonly rootPristine: any;
|
|
124
|
+
public dataValue: any;
|
|
125
|
+
splice(index: number | string): void;
|
|
126
|
+
deleteValue(): void;
|
|
127
|
+
readonly defaultValue: any;
|
|
128
|
+
getValue(): any;
|
|
129
|
+
getValueAt(index: number): any;
|
|
130
|
+
setValue(value: any, flags: any): boolean;
|
|
131
|
+
setValueAt(index: number, value: any, flags: any): void;
|
|
132
|
+
readonly hasSetValue: boolean;
|
|
133
|
+
restoreValue(): void;
|
|
134
|
+
normalizeValue(value: any): any;
|
|
135
|
+
getIcon(name: any | string, content: any, styles: any, ref?: string): any | HTMLElement;
|
|
136
|
+
resetValue(): void;
|
|
137
|
+
hasChanged(before: any, after: any): boolean;
|
|
138
|
+
updateOnChange(flags: any, changed: boolean | any): boolean;
|
|
139
|
+
calculateValue(data: Object, flags: any): boolean;
|
|
140
|
+
public label: any | string;
|
|
141
|
+
getRoot(): Component;
|
|
142
|
+
invalidMessage(data: any, dirty: boolean, ignoreCondition?: boolean): any;
|
|
143
|
+
isValid(data: any, dirty: boolean): boolean;
|
|
144
|
+
checkValidity(data: any, dirty: any | boolean, rowData: any): boolean;
|
|
145
|
+
readonly validationValue: any;
|
|
146
|
+
isEmpty(value: any): boolean;
|
|
147
|
+
validateMultiple(): boolean;
|
|
148
|
+
readonly errors: any[];
|
|
149
|
+
setCustomValidity(message: any, dirty: any): void;
|
|
150
|
+
shouldSkipValidation(data: any, dirty: any, rowData: any): boolean;
|
|
151
|
+
whenReady(): any | Promise<any>;
|
|
152
|
+
readonly dataReady: any | Promise<any>;
|
|
153
|
+
asString(value: any): string;
|
|
154
|
+
public disabled: boolean;
|
|
155
|
+
setDisabled(element: any, disabled: any | boolean): void;
|
|
156
|
+
setLoading(element: any, loading: any | boolean): void;
|
|
157
|
+
selectOptions(select: any, tag: any, options: any, defaultValue: any): void;
|
|
158
|
+
setSelectValue(select: any, value: any): void;
|
|
159
|
+
clear(): any;
|
|
160
|
+
append(element: HTMLElement): void;
|
|
161
|
+
prepend(element: HTMLElement): void;
|
|
162
|
+
removeChild(element: HTMLElement): void;
|
|
163
|
+
attachLogic(): void;
|
|
164
|
+
elementInfo(): ElementInfo;
|
|
165
|
+
autofocus(): void;
|
|
166
|
+
focus(): void;
|
|
167
|
+
readonly shouldDisable: boolean;
|
|
168
|
+
readonly info: ElementInfo;
|
|
169
|
+
public element: any;
|
|
170
|
+
public validators: (keyof ValidateOptions)[];
|
|
171
|
+
public calculatedValue: any;
|
|
172
|
+
public options: any;
|
|
173
|
+
public labelElement: any;
|
|
174
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component } from '../component/component';
|
|
2
|
+
|
|
3
|
+
export class ComponentModal {
|
|
4
|
+
constructor(component: Component | any, element: any, isOpened: boolean, currentValue: any);
|
|
5
|
+
public isOpened: boolean;
|
|
6
|
+
public component: Component | any;
|
|
7
|
+
public element: any;
|
|
8
|
+
public currentValue: any;
|
|
9
|
+
public dataLoaded: boolean;
|
|
10
|
+
static render(component: Component | any, data: any, topLevel: boolean): any;
|
|
11
|
+
readonly refs: any;
|
|
12
|
+
init(): void;
|
|
13
|
+
setValue(value: any): any;
|
|
14
|
+
setOpenModalElement(template: string): void;
|
|
15
|
+
readonly templateRefs: any;
|
|
16
|
+
loadRefs(): void;
|
|
17
|
+
removeEventListeners(): void;
|
|
18
|
+
setEventListeners(): void;
|
|
19
|
+
isValueChanged(): boolean;
|
|
20
|
+
setOpenEventListener(): void;
|
|
21
|
+
openModalHandler(event: Event): void;
|
|
22
|
+
positionOverElement(): void;
|
|
23
|
+
openModal(): void;
|
|
24
|
+
updateView(): void;
|
|
25
|
+
closeModal(): void;
|
|
26
|
+
closeModalHandler(event: Event): void;
|
|
27
|
+
showDialog(): void;
|
|
28
|
+
closeDialog(event: Event): void;
|
|
29
|
+
saveDialog(event: Event): void;
|
|
30
|
+
saveModalValueHandler(event: Event): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component } from '../component/component';
|
|
2
|
+
import { Multivalue } from '../multivalue/multivalue';
|
|
3
|
+
import { Element } from './../../../element.d';
|
|
4
|
+
|
|
5
|
+
export class Input extends Multivalue {
|
|
6
|
+
constructor(component: Component | any, options: Object, data: any);
|
|
7
|
+
readonly inputInfo: {
|
|
8
|
+
id: string | number;
|
|
9
|
+
type: string;
|
|
10
|
+
changeEvent: string;
|
|
11
|
+
content?: any;
|
|
12
|
+
attr: any;
|
|
13
|
+
};
|
|
14
|
+
readonly maskOptions: { label: any; value: any }[];
|
|
15
|
+
readonly isMultipleMasksField: boolean;
|
|
16
|
+
getMaskByName(maskName: string): any;
|
|
17
|
+
setInputMask(input: any, inputMask: any): any;
|
|
18
|
+
getMaskOptions(): { label: any; value: any }[];
|
|
19
|
+
readonly remainingWords: number;
|
|
20
|
+
renderElement(value: any, index: string | number): any;
|
|
21
|
+
setCounter(type: string, element: any | Element, count: number, max: number): void;
|
|
22
|
+
updateValueAt(value: any, flags: any, index: string | number): void;
|
|
23
|
+
getValueAt(index: string | number): any;
|
|
24
|
+
updateValue(value: any, flags: any, index: string | number): any;
|
|
25
|
+
attach(element: any): any;
|
|
26
|
+
attachElement(element: any | Element, index: string | number): void;
|
|
27
|
+
readonly widget: any;
|
|
28
|
+
createWidget(index: string | number): any;
|
|
29
|
+
addFocusBlurEvents(element: any | Element): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Field } from '../field/field';
|
|
2
|
+
|
|
3
|
+
export class Multivalue extends Field {
|
|
4
|
+
public dataValue: any;
|
|
5
|
+
readonly defaultValue: any;
|
|
6
|
+
readonly addAnother: any;
|
|
7
|
+
useWrapper(): boolean;
|
|
8
|
+
renderRow(value: any, index: any): any;
|
|
9
|
+
attach(dom: any): any;
|
|
10
|
+
attachElement(element: any, index: number | string): any;
|
|
11
|
+
onSelectMaskHandler(event: any): void;
|
|
12
|
+
tryAttachMultipleMasksInput(): boolean;
|
|
13
|
+
updateMask(input: any, mask: any): void;
|
|
14
|
+
addNewValue(value: any): void;
|
|
15
|
+
addValue(): void;
|
|
16
|
+
}
|