@formio/js 5.1.0-dev.5969.9a6e3f5 → 5.1.0-dev.5972.317ce89
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/formio.form.js +74 -52
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +77 -55
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +3 -3
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +3 -3
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Form.js +4 -4
- package/lib/cjs/PDFBuilder.js +4 -4
- package/lib/cjs/Webform.d.ts +12 -12
- package/lib/cjs/Webform.js +132 -131
- package/lib/cjs/WebformBuilder.js +10 -10
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/WizardBuilder.js +1 -1
- package/lib/cjs/components/_classes/component/Component.js +12 -11
- package/lib/cjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +2 -2
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +3 -3
- package/lib/cjs/components/address/Address.js +1 -1
- package/lib/cjs/components/button/Button.js +6 -6
- package/lib/cjs/components/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/datagrid/DataGrid.js +1 -1
- package/lib/cjs/components/datetime/DateTime.js +4 -0
- package/lib/cjs/components/day/Day.js +4 -20
- package/lib/cjs/components/editgrid/EditGrid.js +4 -4
- package/lib/cjs/components/file/File.js +15 -15
- package/lib/cjs/components/form/Form.js +4 -4
- package/lib/cjs/components/number/Number.js +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.js +2 -2
- package/lib/cjs/components/select/Select.js +5 -5
- package/lib/cjs/components/selectboxes/SelectBoxes.js +2 -2
- package/lib/cjs/components/signature/Signature.d.ts +1 -1
- package/lib/cjs/components/signature/Signature.js +2 -2
- package/lib/cjs/components/survey/Survey.js +2 -2
- package/lib/cjs/components/textarea/TextArea.js +6 -6
- package/lib/cjs/components/textfield/TextField.js +3 -0
- package/lib/cjs/formio.form.js +4 -0
- package/lib/cjs/translations/en.d.ts +234 -81
- package/lib/cjs/translations/en.js +8 -81
- package/lib/cjs/utils/i18n.d.ts +5 -2
- package/lib/cjs/utils/i18n.js +32 -5
- package/lib/mjs/Form.js +4 -4
- package/lib/mjs/PDFBuilder.js +4 -4
- package/lib/mjs/Webform.d.ts +12 -12
- package/lib/mjs/Webform.js +142 -141
- package/lib/mjs/WebformBuilder.js +10 -10
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/WizardBuilder.js +1 -1
- package/lib/mjs/components/_classes/component/Component.js +12 -11
- package/lib/mjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +2 -2
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +3 -3
- package/lib/mjs/components/address/Address.js +1 -1
- package/lib/mjs/components/button/Button.js +6 -6
- package/lib/mjs/components/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/datagrid/DataGrid.js +1 -1
- package/lib/mjs/components/datetime/DateTime.js +5 -1
- package/lib/mjs/components/day/Day.js +4 -20
- package/lib/mjs/components/editgrid/EditGrid.js +4 -4
- package/lib/mjs/components/file/File.js +15 -15
- package/lib/mjs/components/form/Form.js +4 -4
- package/lib/mjs/components/number/Number.js +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.js +2 -2
- package/lib/mjs/components/select/Select.js +7 -7
- package/lib/mjs/components/selectboxes/SelectBoxes.js +2 -2
- package/lib/mjs/components/signature/Signature.d.ts +1 -1
- package/lib/mjs/components/signature/Signature.js +2 -2
- package/lib/mjs/components/survey/Survey.js +2 -2
- package/lib/mjs/components/textarea/TextArea.js +6 -6
- package/lib/mjs/components/textfield/TextField.js +3 -0
- package/lib/mjs/formio.form.js +4 -0
- package/lib/mjs/translations/en.d.ts +234 -81
- package/lib/mjs/translations/en.js +89 -3
- package/lib/mjs/utils/i18n.d.ts +5 -2
- package/lib/mjs/utils/i18n.js +32 -5
- package/package.json +3 -3
package/lib/cjs/Form.js
CHANGED
@@ -337,10 +337,10 @@ class Form extends Element_1.default {
|
|
337
337
|
*/
|
338
338
|
build() {
|
339
339
|
if (!this.instance) {
|
340
|
-
return Promise.reject(
|
340
|
+
return Promise.reject(this.t('formNotReady'));
|
341
341
|
}
|
342
342
|
if (!this.element) {
|
343
|
-
return Promise.reject(
|
343
|
+
return Promise.reject(this.t('noFormElement'));
|
344
344
|
}
|
345
345
|
// Add temporary loader.
|
346
346
|
const template = (this.options && this.options.template) ? this.options.template : 'bootstrap';
|
@@ -357,7 +357,7 @@ class Form extends Element_1.default {
|
|
357
357
|
}
|
358
358
|
render() {
|
359
359
|
if (!this.instance) {
|
360
|
-
return Promise.reject(
|
360
|
+
return Promise.reject(this.t('formNotReady'));
|
361
361
|
}
|
362
362
|
return Promise.resolve(this.instance.render())
|
363
363
|
.then((param) => {
|
@@ -367,7 +367,7 @@ class Form extends Element_1.default {
|
|
367
367
|
}
|
368
368
|
attach(element) {
|
369
369
|
if (!this.instance) {
|
370
|
-
return Promise.reject(
|
370
|
+
return Promise.reject(this.t('formNotReady'));
|
371
371
|
}
|
372
372
|
if (this.element) {
|
373
373
|
delete this.element.component;
|
package/lib/cjs/PDFBuilder.js
CHANGED
@@ -201,10 +201,10 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
201
201
|
const progress = Math.floor((event.loaded / event.total) * 100);
|
202
202
|
this.refs.uploadProgress.style.width = `${progress}%`;
|
203
203
|
if (progress > 98) {
|
204
|
-
this.refs.uploadProgress.innerHTML = this.t('
|
204
|
+
this.refs.uploadProgress.innerHTML = this.t('waitPdfConverting');
|
205
205
|
}
|
206
206
|
else {
|
207
|
-
this.refs.uploadProgress.innerHTML = `${this.t('
|
207
|
+
this.refs.uploadProgress.innerHTML = `${this.t('uploading')} ${progress}%`;
|
208
208
|
}
|
209
209
|
}
|
210
210
|
}, `${this.projectUrl}/upload`, {}, 'file')
|
@@ -242,7 +242,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
242
242
|
return;
|
243
243
|
}
|
244
244
|
this.refs.uploadError.style.display = message ? '' : 'none';
|
245
|
-
this.refs.uploadError.innerHTML = message;
|
245
|
+
this.refs.uploadError.innerHTML = this.t(`${message}`);
|
246
246
|
}
|
247
247
|
createForm(options) {
|
248
248
|
// Instantiate the webform from the PDF class instead of Webform
|
@@ -471,7 +471,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
471
471
|
name: 'showBuilderErrors',
|
472
472
|
data: {
|
473
473
|
compId: comp.component.id,
|
474
|
-
errorMessage:
|
474
|
+
errorMessage: `${this.t('notUniqueKey')}: ${comp.key}`,
|
475
475
|
}
|
476
476
|
});
|
477
477
|
}
|
package/lib/cjs/Webform.d.ts
CHANGED
@@ -34,10 +34,10 @@
|
|
34
34
|
*/
|
35
35
|
/**
|
36
36
|
* @typedef {object} ButtonSettings
|
37
|
-
* @property {boolean} [showPrevious] - Show the
|
38
|
-
* @property {boolean} [showNext] - Show the
|
39
|
-
* @property {boolean} [showCancel] - Show the
|
40
|
-
* @property {boolean} [showSubmit] - Show the
|
37
|
+
* @property {boolean} [showPrevious] - Show the 'Previous' button.
|
38
|
+
* @property {boolean} [showNext] - Show the 'Next' button.
|
39
|
+
* @property {boolean} [showCancel] - Show the 'Cancel' button.
|
40
|
+
* @property {boolean} [showSubmit] - Show the 'Submit' button.
|
41
41
|
*/
|
42
42
|
/**
|
43
43
|
* @typedef {object} FormOptions
|
@@ -257,7 +257,7 @@ declare class Webform extends NestedDataComponent {
|
|
257
257
|
get ready(): Promise<any>;
|
258
258
|
/**
|
259
259
|
* Set the loading state for this form, and also show the loader spinner.
|
260
|
-
* @param {boolean} loading - If this form should be
|
260
|
+
* @param {boolean} loading - If this form should be 'loading' or not.
|
261
261
|
*/
|
262
262
|
set loading(loading: boolean);
|
263
263
|
/**
|
@@ -369,7 +369,7 @@ declare class Webform extends NestedDataComponent {
|
|
369
369
|
hasRequiredFields(): boolean;
|
370
370
|
/**
|
371
371
|
* Sets a new alert to display in the error dialog of the form.
|
372
|
-
* @param {string} type - The type of alert to display.
|
372
|
+
* @param {string} type - The type of alert to display. 'danger', 'success', 'warning', etc.
|
373
373
|
* @param {string} message - The message to show in the alert.
|
374
374
|
* @param {object} options - The options for the alert.
|
375
375
|
*/
|
@@ -547,19 +547,19 @@ export type SanitizeConfig = {
|
|
547
547
|
};
|
548
548
|
export type ButtonSettings = {
|
549
549
|
/**
|
550
|
-
* - Show the
|
550
|
+
* - Show the 'Previous' button.
|
551
551
|
*/
|
552
552
|
showPrevious?: boolean | undefined;
|
553
553
|
/**
|
554
|
-
* - Show the
|
554
|
+
* - Show the 'Next' button.
|
555
555
|
*/
|
556
556
|
showNext?: boolean | undefined;
|
557
557
|
/**
|
558
|
-
* - Show the
|
558
|
+
* - Show the 'Cancel' button.
|
559
559
|
*/
|
560
560
|
showCancel?: boolean | undefined;
|
561
561
|
/**
|
562
|
-
* - Show the
|
562
|
+
* - Show the 'Submit' button.
|
563
563
|
*/
|
564
564
|
showSubmit?: boolean | undefined;
|
565
565
|
};
|
@@ -739,5 +739,5 @@ export type FormOptions = {
|
|
739
739
|
*/
|
740
740
|
zoom?: number | undefined;
|
741
741
|
};
|
742
|
-
import NestedDataComponent from
|
743
|
-
import EventEmitter from
|
742
|
+
import NestedDataComponent from './components/_classes/nesteddata/NestedDataComponent';
|
743
|
+
import EventEmitter from './EventEmitter';
|