@formio/js 5.4.1 → 5.4.2
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/README.md +11 -5
- package/dist/formio.builder.css +1 -0
- 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 +1 -0
- package/dist/formio.form.js +131 -109
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -2
- package/dist/formio.full.css +1 -0
- package/dist/formio.full.js +155 -133
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -2
- package/dist/formio.js +26 -26
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -2
- package/dist/formio.utils.js +19 -19
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -2
- package/lib/cjs/Embed.js +8 -16
- package/lib/cjs/Form.js +4 -4
- package/lib/cjs/Formio.js +2 -9
- package/lib/cjs/InlineEmbed.js +1 -4
- package/lib/cjs/PDF.js +28 -8
- package/lib/cjs/PDFBuilder.js +6 -10
- package/lib/cjs/Webform.d.ts +1 -0
- package/lib/cjs/Webform.js +19 -34
- package/lib/cjs/WebformBuilder.js +27 -68
- package/lib/cjs/Wizard.d.ts +1 -0
- package/lib/cjs/Wizard.js +44 -31
- package/lib/cjs/WizardBuilder.js +5 -15
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +2 -6
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -9
- package/lib/cjs/addons/index.js +1 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +5 -5
- package/lib/cjs/components/_classes/component/Component.js +60 -132
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +2 -4
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +4 -16
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +1 -4
- package/lib/cjs/components/_classes/field/Field.js +1 -4
- package/lib/cjs/components/_classes/input/Input.js +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +6 -28
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +8 -26
- package/lib/cjs/components/_classes/nested/NestedComponent.js +1 -4
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +5 -9
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -3
- package/lib/cjs/components/address/Address.js +10 -30
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +8 -32
- package/lib/cjs/components/alert/Alert.js +3 -6
- package/lib/cjs/components/button/Button.js +10 -17
- package/lib/cjs/components/button/editForm/Button.edit.display.js +8 -32
- package/lib/cjs/components/checkbox/Checkbox.js +4 -10
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +2 -8
- package/lib/cjs/components/columns/Columns.js +5 -17
- package/lib/cjs/components/container/Container.js +1 -3
- package/lib/cjs/components/currency/Currency.js +2 -7
- package/lib/cjs/components/datagrid/DataGrid.js +23 -63
- package/lib/cjs/components/datamap/DataMap.js +4 -16
- package/lib/cjs/components/datetime/DateTime.js +2 -6
- package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +1 -4
- package/lib/cjs/components/day/Day.js +12 -70
- package/lib/cjs/components/day/editForm/Day.edit.day.js +1 -3
- package/lib/cjs/components/day/editForm/Day.edit.month.js +1 -3
- package/lib/cjs/components/editgrid/EditGrid.d.ts +1 -0
- package/lib/cjs/components/editgrid/EditGrid.js +18 -44
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -4
- package/lib/cjs/components/file/File.js +40 -70
- package/lib/cjs/components/file/editForm/File.edit.display.js +1 -5
- package/lib/cjs/components/file/editForm/File.edit.file.js +8 -30
- package/lib/cjs/components/form/Form.js +5 -7
- package/lib/cjs/components/html/HTML.js +1 -5
- package/lib/cjs/components/number/Number.js +2 -4
- package/lib/cjs/components/panel/editForm/Panel.edit.display.js +3 -12
- package/lib/cjs/components/password/Password.js +1 -4
- package/lib/cjs/components/radio/Radio.js +7 -17
- package/lib/cjs/components/radio/editForm/Radio.edit.data.js +4 -14
- package/lib/cjs/components/recaptcha/ReCaptcha.js +3 -6
- package/lib/cjs/components/select/Select.js +48 -92
- package/lib/cjs/components/select/editForm/Select.edit.data.js +37 -182
- package/lib/cjs/components/select/editForm/Select.edit.validation.js +1 -9
- package/lib/cjs/components/selectboxes/SelectBoxes.js +3 -6
- package/lib/cjs/components/signature/Signature.d.ts +1 -1
- package/lib/cjs/components/signature/Signature.js +5 -10
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +2 -6
- package/lib/cjs/components/survey/Survey.js +6 -17
- package/lib/cjs/components/survey/editForm/Survey.edit.data.js +4 -12
- package/lib/cjs/components/table/editForm/Table.edit.display.js +3 -3
- package/lib/cjs/components/tabs/Tabs.js +4 -19
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +1 -3
- package/lib/cjs/components/tags/Tags.js +4 -14
- package/lib/cjs/components/textarea/TextArea.js +8 -15
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +14 -56
- package/lib/cjs/components/textfield/TextField.js +4 -4
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +2 -8
- package/lib/cjs/components/time/Time.js +1 -4
- package/lib/cjs/components/time/editForm/Time.edit.display.js +1 -4
- package/lib/cjs/formio.form.js +5 -5
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/providers/address/AddressProvider.js +1 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.js +1 -3
- package/lib/cjs/providers/processor/fileProcessor.js +1 -3
- package/lib/cjs/providers/storage/azure.js +5 -6
- package/lib/cjs/providers/storage/indexeddb.js +5 -15
- package/lib/cjs/providers/storage/s3.js +3 -14
- package/lib/cjs/providers/storage/xhr.js +19 -28
- package/lib/cjs/templates/Templates.js +1 -0
- package/lib/cjs/translations/en.d.ts +237 -82
- package/lib/cjs/translations/en.js +9 -82
- package/lib/cjs/utils/ChoicesWrapper.js +1 -1
- package/lib/cjs/utils/builder.js +5 -26
- package/lib/cjs/utils/i18n.d.ts +5 -2
- package/lib/cjs/utils/i18n.js +33 -12
- package/lib/cjs/utils/utils.js +37 -47
- package/lib/cjs/widgets/CalendarWidget.js +2 -6
- package/lib/mjs/Embed.js +8 -16
- package/lib/mjs/Form.js +4 -4
- package/lib/mjs/Formio.js +2 -9
- package/lib/mjs/InlineEmbed.js +1 -4
- package/lib/mjs/PDF.js +27 -8
- package/lib/mjs/PDFBuilder.js +6 -10
- package/lib/mjs/Webform.d.ts +1 -0
- package/lib/mjs/Webform.js +19 -31
- package/lib/mjs/WebformBuilder.js +27 -68
- package/lib/mjs/Wizard.d.ts +1 -0
- package/lib/mjs/Wizard.js +39 -27
- package/lib/mjs/WizardBuilder.js +5 -15
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +2 -6
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -9
- package/lib/mjs/addons/index.js +1 -3
- package/lib/mjs/components/_classes/component/Component.d.ts +5 -5
- package/lib/mjs/components/_classes/component/Component.js +59 -132
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +2 -4
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +4 -16
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -4
- package/lib/mjs/components/_classes/field/Field.js +1 -4
- package/lib/mjs/components/_classes/input/Input.js +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +6 -28
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +8 -26
- package/lib/mjs/components/_classes/nested/NestedComponent.js +1 -4
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +5 -9
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -3
- package/lib/mjs/components/address/Address.js +10 -30
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +8 -32
- package/lib/mjs/components/alert/Alert.js +3 -6
- package/lib/mjs/components/button/Button.js +9 -16
- package/lib/mjs/components/button/editForm/Button.edit.display.js +8 -32
- package/lib/mjs/components/checkbox/Checkbox.js +4 -10
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +2 -8
- package/lib/mjs/components/columns/Columns.js +5 -17
- package/lib/mjs/components/container/Container.js +1 -3
- package/lib/mjs/components/currency/Currency.js +2 -7
- package/lib/mjs/components/datagrid/DataGrid.js +23 -63
- package/lib/mjs/components/datamap/DataMap.js +12 -18
- package/lib/mjs/components/datetime/DateTime.js +2 -6
- package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +1 -4
- package/lib/mjs/components/day/Day.js +12 -70
- package/lib/mjs/components/day/editForm/Day.edit.day.js +1 -3
- package/lib/mjs/components/day/editForm/Day.edit.month.js +1 -3
- package/lib/mjs/components/editgrid/EditGrid.d.ts +1 -0
- package/lib/mjs/components/editgrid/EditGrid.js +18 -44
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -4
- package/lib/mjs/components/file/File.js +40 -70
- package/lib/mjs/components/file/editForm/File.edit.display.js +1 -5
- package/lib/mjs/components/file/editForm/File.edit.file.js +8 -30
- package/lib/mjs/components/form/Form.js +5 -7
- package/lib/mjs/components/html/HTML.js +1 -5
- package/lib/mjs/components/number/Number.js +2 -4
- package/lib/mjs/components/panel/editForm/Panel.edit.display.js +3 -12
- package/lib/mjs/components/password/Password.js +1 -4
- package/lib/mjs/components/radio/Radio.js +7 -17
- package/lib/mjs/components/radio/editForm/Radio.edit.data.js +4 -14
- package/lib/mjs/components/recaptcha/ReCaptcha.js +3 -6
- package/lib/mjs/components/select/Select.js +51 -95
- package/lib/mjs/components/select/editForm/Select.edit.data.js +37 -182
- package/lib/mjs/components/select/editForm/Select.edit.validation.js +1 -9
- package/lib/mjs/components/selectboxes/SelectBoxes.js +3 -6
- package/lib/mjs/components/signature/Signature.d.ts +1 -1
- package/lib/mjs/components/signature/Signature.js +5 -10
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +2 -6
- package/lib/mjs/components/survey/Survey.js +6 -17
- package/lib/mjs/components/survey/editForm/Survey.edit.data.js +4 -12
- package/lib/mjs/components/table/editForm/Table.edit.display.js +3 -3
- package/lib/mjs/components/tabs/Tabs.js +4 -19
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +1 -3
- package/lib/mjs/components/tags/Tags.js +4 -14
- package/lib/mjs/components/textarea/TextArea.js +8 -15
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +14 -56
- package/lib/mjs/components/textfield/TextField.js +4 -4
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +2 -8
- package/lib/mjs/components/time/Time.js +1 -4
- package/lib/mjs/components/time/editForm/Time.edit.display.js +1 -4
- package/lib/mjs/formio.form.js +6 -6
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/providers/address/AddressProvider.js +1 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.js +1 -3
- package/lib/mjs/providers/processor/fileProcessor.js +1 -3
- package/lib/mjs/providers/storage/azure.js +5 -6
- package/lib/mjs/providers/storage/indexeddb.js +5 -15
- package/lib/mjs/providers/storage/s3.js +3 -14
- package/lib/mjs/providers/storage/xhr.js +19 -32
- package/lib/mjs/templates/Templates.js +1 -0
- package/lib/mjs/translations/en.d.ts +237 -82
- package/lib/mjs/translations/en.js +88 -0
- package/lib/mjs/utils/ChoicesWrapper.js +1 -1
- package/lib/mjs/utils/builder.js +5 -26
- package/lib/mjs/utils/i18n.d.ts +5 -2
- package/lib/mjs/utils/i18n.js +33 -12
- package/lib/mjs/utils/utils.js +37 -47
- package/lib/mjs/widgets/CalendarWidget.js +2 -6
- package/package.json +6 -4
|
@@ -223,14 +223,10 @@ class WebformBuilder extends Component_1.default {
|
|
|
223
223
|
},
|
|
224
224
|
};
|
|
225
225
|
if (this.options && this.options.resourceTag) {
|
|
226
|
-
query.params.tags = [
|
|
227
|
-
this.options.resourceTag,
|
|
228
|
-
];
|
|
226
|
+
query.params.tags = [this.options.resourceTag];
|
|
229
227
|
}
|
|
230
228
|
else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
|
|
231
|
-
query.params.tags = [
|
|
232
|
-
'builder',
|
|
233
|
-
];
|
|
229
|
+
query.params.tags = ['builder'];
|
|
234
230
|
}
|
|
235
231
|
const formio = new Formio_1.Formio(Formio_1.Formio.projectUrl);
|
|
236
232
|
const isResourcesDisabled = this.options.builder && this.options.builder.resource === false;
|
|
@@ -250,7 +246,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
250
246
|
}
|
|
251
247
|
})
|
|
252
248
|
.catch((err) => {
|
|
253
|
-
console.warn(
|
|
249
|
+
console.warn(`${this.t('loadingProjectSettingsError')}: ${err.message || err}`);
|
|
254
250
|
});
|
|
255
251
|
if (!formio.noProject && !isResourcesDisabled && formio.formsUrl) {
|
|
256
252
|
const resourceOptions = this.options.builder && this.options.builder.resource;
|
|
@@ -333,10 +329,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
333
329
|
allowHTML: true,
|
|
334
330
|
trigger: 'mouseenter focus',
|
|
335
331
|
placement: 'top',
|
|
336
|
-
delay: [
|
|
337
|
-
200,
|
|
338
|
-
0,
|
|
339
|
-
],
|
|
332
|
+
delay: [200, 0],
|
|
340
333
|
zIndex: 10000,
|
|
341
334
|
content: title,
|
|
342
335
|
});
|
|
@@ -356,18 +349,18 @@ class WebformBuilder extends Component_1.default {
|
|
|
356
349
|
editJson: 'single',
|
|
357
350
|
});
|
|
358
351
|
if (component.refs.copyComponent) {
|
|
359
|
-
this.attachTooltip(component.refs.copyComponent, this.t('
|
|
352
|
+
this.attachTooltip(component.refs.copyComponent, this.t('copy'));
|
|
360
353
|
component.addEventListener(component.refs.copyComponent, 'click', () => this.copyComponent(component));
|
|
361
354
|
}
|
|
362
355
|
if (component.refs.pasteComponent) {
|
|
363
|
-
const pasteToolTip = this.attachTooltip(component.refs.pasteComponent, this.t('
|
|
356
|
+
const pasteToolTip = this.attachTooltip(component.refs.pasteComponent, this.t('pasteBelow'));
|
|
364
357
|
component.addEventListener(component.refs.pasteComponent, 'click', () => {
|
|
365
358
|
pasteToolTip.hide();
|
|
366
359
|
this.pasteComponent(component);
|
|
367
360
|
});
|
|
368
361
|
}
|
|
369
362
|
if (component.refs.moveComponent) {
|
|
370
|
-
this.attachTooltip(component.refs.moveComponent, this.t('
|
|
363
|
+
this.attachTooltip(component.refs.moveComponent, this.t('move'));
|
|
371
364
|
if (this.keyboardActionsEnabled) {
|
|
372
365
|
component.addEventListener(component.refs.moveComponent, 'click', () => {
|
|
373
366
|
this.moveComponent(component);
|
|
@@ -376,20 +369,20 @@ class WebformBuilder extends Component_1.default {
|
|
|
376
369
|
}
|
|
377
370
|
const parent = this.getParentElement(element);
|
|
378
371
|
if (component.refs.editComponent) {
|
|
379
|
-
this.attachTooltip(component.refs.editComponent, this.t('
|
|
372
|
+
this.attachTooltip(component.refs.editComponent, this.t('edit'));
|
|
380
373
|
component.addEventListener(component.refs.editComponent, 'click', () => this.editComponent(component.schema, parent, false, false, component.component, {
|
|
381
374
|
inDataGrid: component.isInDataGrid,
|
|
382
375
|
editComponentPath: component.path,
|
|
383
376
|
}));
|
|
384
377
|
}
|
|
385
378
|
if (component.refs.editJson) {
|
|
386
|
-
this.attachTooltip(component.refs.editJson, this.t('
|
|
379
|
+
this.attachTooltip(component.refs.editJson, this.t('editJson'));
|
|
387
380
|
component.addEventListener(component.refs.editJson, 'click', () => this.editComponent(component.schema, parent, false, true, component.component, {
|
|
388
381
|
editComponentPath: component.path,
|
|
389
382
|
}));
|
|
390
383
|
}
|
|
391
384
|
if (component.refs.removeComponent) {
|
|
392
|
-
this.attachTooltip(component.refs.removeComponent, this.t('
|
|
385
|
+
this.attachTooltip(component.refs.removeComponent, this.t('remove'));
|
|
393
386
|
component.addEventListener(component.refs.removeComponent, 'click', () => this.removeComponent(component.schema, parent, component.component, component));
|
|
394
387
|
}
|
|
395
388
|
return element;
|
|
@@ -472,10 +465,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
472
465
|
const componentSchema = component.component;
|
|
473
466
|
// If the current component is the namespace, we don't need to find it again.
|
|
474
467
|
if (namespaceKey === component.key) {
|
|
475
|
-
return [
|
|
476
|
-
...componentSchema.components,
|
|
477
|
-
componentSchema,
|
|
478
|
-
];
|
|
468
|
+
return [...componentSchema.components, componentSchema];
|
|
479
469
|
}
|
|
480
470
|
// Get the namespace component so we have the original object.
|
|
481
471
|
const namespaceComponent = (0, utils_1.getComponent)(this.form.components, namespaceKey, true);
|
|
@@ -487,14 +477,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
487
477
|
return null;
|
|
488
478
|
}
|
|
489
479
|
// Some components are their own namespace.
|
|
490
|
-
if ([
|
|
491
|
-
'address',
|
|
492
|
-
'container',
|
|
493
|
-
'datagrid',
|
|
494
|
-
'editgrid',
|
|
495
|
-
'dynamicWizard',
|
|
496
|
-
'tree',
|
|
497
|
-
].includes(component.type) ||
|
|
480
|
+
if (['address', 'container', 'datagrid', 'editgrid', 'dynamicWizard', 'tree'].includes(component.type) ||
|
|
498
481
|
component.tree ||
|
|
499
482
|
component.arrayTree) {
|
|
500
483
|
return component.key;
|
|
@@ -561,15 +544,11 @@ class WebformBuilder extends Component_1.default {
|
|
|
561
544
|
};
|
|
562
545
|
const hideShow = (group, forceShow, toggle = false) => {
|
|
563
546
|
if (forceShow || (toggle && !Array.from(group.classList).includes('show'))) {
|
|
564
|
-
group.classList.add([
|
|
565
|
-
'show',
|
|
566
|
-
]);
|
|
547
|
+
group.classList.add(['show']);
|
|
567
548
|
group.style.display = 'inherit';
|
|
568
549
|
}
|
|
569
550
|
else {
|
|
570
|
-
group.classList.remove([
|
|
571
|
-
'show',
|
|
572
|
-
]);
|
|
551
|
+
group.classList.remove(['show']);
|
|
573
552
|
group.style.display = 'none';
|
|
574
553
|
}
|
|
575
554
|
};
|
|
@@ -613,9 +592,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
613
592
|
}
|
|
614
593
|
const drake = this.dragula;
|
|
615
594
|
if (this.refs.form) {
|
|
616
|
-
(0, dom_autoscroller_1.default)([
|
|
617
|
-
window,
|
|
618
|
-
], {
|
|
595
|
+
(0, dom_autoscroller_1.default)([window], {
|
|
619
596
|
margin: 20,
|
|
620
597
|
maxSpeed: 6,
|
|
621
598
|
scrollWhenOutside: true,
|
|
@@ -869,7 +846,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
869
846
|
}, true);
|
|
870
847
|
if (isCompAlreadyExists) {
|
|
871
848
|
this.webform.redraw();
|
|
872
|
-
this.webform.setAlert('danger',
|
|
849
|
+
this.webform.setAlert('danger', this.t('builderUniqueError', { componentKeyOrTitle: draggableComponent.key }));
|
|
873
850
|
return;
|
|
874
851
|
}
|
|
875
852
|
}
|
|
@@ -883,7 +860,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
883
860
|
}, true);
|
|
884
861
|
if (isCompAlreadyExists) {
|
|
885
862
|
this.webform.redraw();
|
|
886
|
-
this.webform.setAlert('danger',
|
|
863
|
+
this.webform.setAlert('danger', this.t('builderUniqueError', { componentKeyOrTitle: draggableComponent.title }));
|
|
887
864
|
return;
|
|
888
865
|
}
|
|
889
866
|
}
|
|
@@ -963,7 +940,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
963
940
|
path,
|
|
964
941
|
fromIndex: index,
|
|
965
942
|
toIndex,
|
|
966
|
-
timestamp: new Date()
|
|
943
|
+
timestamp: new Date(),
|
|
967
944
|
};
|
|
968
945
|
// New event that allows explicit tracking of reordering
|
|
969
946
|
this.emit('moveComponent', payload);
|
|
@@ -1054,8 +1031,8 @@ class WebformBuilder extends Component_1.default {
|
|
|
1054
1031
|
(Array.isArray(component.columns) && component.columns.length));
|
|
1055
1032
|
if (this.options.alwaysConfirmComponentRemoval || removingComponentsGroup) {
|
|
1056
1033
|
const message = removingComponentsGroup
|
|
1057
|
-
? '
|
|
1058
|
-
: '
|
|
1034
|
+
? 'confirmComponentRemoveWithChildren'
|
|
1035
|
+
: 'confirmComponentRemove';
|
|
1059
1036
|
remove = window.confirm(this.t(message));
|
|
1060
1037
|
}
|
|
1061
1038
|
if (!original) {
|
|
@@ -1125,10 +1102,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1125
1102
|
config: this.options.formConfig || {},
|
|
1126
1103
|
sanitizeConfig,
|
|
1127
1104
|
};
|
|
1128
|
-
const fieldsToRemoveDoubleQuotes = [
|
|
1129
|
-
'label',
|
|
1130
|
-
'tooltip',
|
|
1131
|
-
];
|
|
1105
|
+
const fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];
|
|
1132
1106
|
this.preview.form.components.forEach((component) => this.replaceDoubleQuotes(component, fieldsToRemoveDoubleQuotes));
|
|
1133
1107
|
const previewElement = this.componentEdit.querySelector(`[${this._referenceAttributeName}="preview"]`);
|
|
1134
1108
|
if (previewElement) {
|
|
@@ -1300,10 +1274,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1300
1274
|
submissionData.components = this.originalDefaultValue.components;
|
|
1301
1275
|
this.originalDefaultValue = null;
|
|
1302
1276
|
}
|
|
1303
|
-
const fieldsToRemoveDoubleQuotes = [
|
|
1304
|
-
'label',
|
|
1305
|
-
'tooltip',
|
|
1306
|
-
];
|
|
1277
|
+
const fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];
|
|
1307
1278
|
this.replaceDoubleQuotes(submissionData, fieldsToRemoveDoubleQuotes);
|
|
1308
1279
|
this.hook('beforeSaveComponentSettings', submissionData);
|
|
1309
1280
|
let comp = null;
|
|
@@ -1433,13 +1404,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1433
1404
|
editFormOptions.editComponentPath = flags.editComponentPath;
|
|
1434
1405
|
editFormOptions.flags = flags;
|
|
1435
1406
|
this.hook('editComponentParentInstance', editFormOptions, parent);
|
|
1436
|
-
this.editForm = new Webform_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, lodash_1.default.omit(this.options, [
|
|
1437
|
-
'hooks',
|
|
1438
|
-
'builder',
|
|
1439
|
-
'events',
|
|
1440
|
-
'attachMode',
|
|
1441
|
-
'skipInit',
|
|
1442
|
-
])), { language: this.options.language }), editFormOptions), { evalContext: Object.assign(Object.assign({}, ((editFormOptions === null || editFormOptions === void 0 ? void 0 : editFormOptions.evalContext) || ((_a = this.options) === null || _a === void 0 ? void 0 : _a.evalContext) || {})), { buildingForm: this.form }) }));
|
|
1407
|
+
this.editForm = new Webform_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, lodash_1.default.omit(this.options, ['hooks', 'builder', 'events', 'attachMode', 'skipInit'])), { language: this.options.language }), editFormOptions), { evalContext: Object.assign(Object.assign({}, ((editFormOptions === null || editFormOptions === void 0 ? void 0 : editFormOptions.evalContext) || ((_a = this.options) === null || _a === void 0 ? void 0 : _a.evalContext) || {})), { buildingForm: this.form }) }));
|
|
1443
1408
|
this.hook('editFormProperties', parent);
|
|
1444
1409
|
this.editForm.form =
|
|
1445
1410
|
isJsonEdit && !isCustom
|
|
@@ -1525,16 +1490,10 @@ class WebformBuilder extends Component_1.default {
|
|
|
1525
1490
|
}
|
|
1526
1491
|
let isComponentLabelChanged = false;
|
|
1527
1492
|
if (event.changed.instance) {
|
|
1528
|
-
isComponentLabelChanged = [
|
|
1529
|
-
'label',
|
|
1530
|
-
'title',
|
|
1531
|
-
].includes(event.changed.instance.path);
|
|
1493
|
+
isComponentLabelChanged = ['label', 'title'].includes(event.changed.instance.path);
|
|
1532
1494
|
}
|
|
1533
1495
|
else if (event.changed.component) {
|
|
1534
|
-
isComponentLabelChanged = [
|
|
1535
|
-
'label',
|
|
1536
|
-
'title',
|
|
1537
|
-
].includes(event.changed.component.key);
|
|
1496
|
+
isComponentLabelChanged = ['label', 'title'].includes(event.changed.component.key);
|
|
1538
1497
|
}
|
|
1539
1498
|
if (isComponentLabelChanged) {
|
|
1540
1499
|
// Ensure this component has a key.
|
|
@@ -1682,7 +1641,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1682
1641
|
*/
|
|
1683
1642
|
copyComponent(component) {
|
|
1684
1643
|
if (!window.sessionStorage) {
|
|
1685
|
-
return console.warn(
|
|
1644
|
+
return console.warn(this.t('sessionStorageSupportError'));
|
|
1686
1645
|
}
|
|
1687
1646
|
this.addClass(this.refs.form, 'builder-paste-mode');
|
|
1688
1647
|
window.sessionStorage.setItem('formio.clipboard', JSON.stringify(component.schema));
|
|
@@ -1694,7 +1653,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1694
1653
|
*/
|
|
1695
1654
|
pasteComponent(component) {
|
|
1696
1655
|
if (!window.sessionStorage) {
|
|
1697
|
-
return console.warn(
|
|
1656
|
+
return console.warn(this.t('sessionStorageSupportError'));
|
|
1698
1657
|
}
|
|
1699
1658
|
this.removeClass(this.refs.form, 'builder-paste-mode');
|
|
1700
1659
|
if (window.sessionStorage) {
|
package/lib/cjs/Wizard.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ declare class Wizard extends Webform {
|
|
|
84
84
|
get currentPage(): any;
|
|
85
85
|
getNextPage(): number | null;
|
|
86
86
|
getPreviousPage(): number;
|
|
87
|
+
mergeDefaultsFromSchema(data: any): void;
|
|
87
88
|
beforeSubmit(): Promise<any[]>;
|
|
88
89
|
beforePage(next: any): Promise<any>;
|
|
89
90
|
emitNextPage(): void;
|
package/lib/cjs/Wizard.js
CHANGED
|
@@ -35,9 +35,7 @@ class Wizard extends Webform_1.default {
|
|
|
35
35
|
this.page = 0;
|
|
36
36
|
this.currentPanel = null;
|
|
37
37
|
this.currentNextPage = 0;
|
|
38
|
-
this._seenPages = [
|
|
39
|
-
0,
|
|
40
|
-
];
|
|
38
|
+
this._seenPages = [0];
|
|
41
39
|
this.subWizards = [];
|
|
42
40
|
this.allPages = [];
|
|
43
41
|
this.lastPromise = Promise.resolve();
|
|
@@ -108,6 +106,7 @@ class Wizard extends Webform_1.default {
|
|
|
108
106
|
this.on('subWizardsUpdated', (subForm) => {
|
|
109
107
|
const subWizard = this.subWizards.find((subWizard) => { var _a; return (subForm === null || subForm === void 0 ? void 0 : subForm.id) && ((_a = subWizard.subForm) === null || _a === void 0 ? void 0 : _a.id) === (subForm === null || subForm === void 0 ? void 0 : subForm.id); });
|
|
110
108
|
if (this.subWizards.length && subWizard) {
|
|
109
|
+
// GOTCHA(G-FJS01)
|
|
111
110
|
subWizard.subForm.setValue(subForm._submission, {}, true);
|
|
112
111
|
this.establishPages();
|
|
113
112
|
this.redraw();
|
|
@@ -139,14 +138,9 @@ class Wizard extends Webform_1.default {
|
|
|
139
138
|
return buttons;
|
|
140
139
|
}
|
|
141
140
|
get buttonOrder() {
|
|
142
|
-
var _a, _b,
|
|
143
|
-
const defaultButtonOrder = [
|
|
144
|
-
|
|
145
|
-
'previous',
|
|
146
|
-
'next',
|
|
147
|
-
'submit',
|
|
148
|
-
];
|
|
149
|
-
return ((_c = (_b = (_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.wizardButtonOrder) === null || _b === void 0 ? void 0 : _b.toLowerCase().split(', ')) !== null && _c !== void 0 ? _c : defaultButtonOrder);
|
|
141
|
+
var _a, _b, _d;
|
|
142
|
+
const defaultButtonOrder = ['cancel', 'previous', 'next', 'submit'];
|
|
143
|
+
return ((_d = (_b = (_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.wizardButtonOrder) === null || _b === void 0 ? void 0 : _b.toLowerCase().split(', ')) !== null && _d !== void 0 ? _d : defaultButtonOrder);
|
|
150
144
|
}
|
|
151
145
|
get renderContext() {
|
|
152
146
|
var _a, _b;
|
|
@@ -207,7 +201,7 @@ class Wizard extends Webform_1.default {
|
|
|
207
201
|
wizardHeaderLocation,
|
|
208
202
|
wizardNav, components: this.renderComponents([
|
|
209
203
|
...this.prefixComps,
|
|
210
|
-
...((_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.components) || [],
|
|
204
|
+
...(((_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.components) || []),
|
|
211
205
|
...this.suffixComps,
|
|
212
206
|
]) }), this.builderMode ? 'builder' : 'form');
|
|
213
207
|
}
|
|
@@ -269,7 +263,7 @@ class Wizard extends Webform_1.default {
|
|
|
269
263
|
this.hook('attachWebform', element, this);
|
|
270
264
|
const promises = this.attachComponents(this.refs[this.wizardKey], [
|
|
271
265
|
...this.prefixComps,
|
|
272
|
-
...((_b = this.currentPage) === null || _b === void 0 ? void 0 : _b.components) || [],
|
|
266
|
+
...(((_b = this.currentPage) === null || _b === void 0 ? void 0 : _b.components) || []),
|
|
273
267
|
...this.suffixComps,
|
|
274
268
|
]);
|
|
275
269
|
this.attachNav();
|
|
@@ -425,11 +419,7 @@ class Wizard extends Webform_1.default {
|
|
|
425
419
|
// Get all components including all nested components and line up in the correct order
|
|
426
420
|
const getAllComponents = (nestedComp, compsArr, pushAllowed = true) => {
|
|
427
421
|
const nestedPages = [];
|
|
428
|
-
const dataArrayComponents = [
|
|
429
|
-
'datagrid',
|
|
430
|
-
'editgrid',
|
|
431
|
-
'dynamicWizard',
|
|
432
|
-
];
|
|
422
|
+
const dataArrayComponents = ['datagrid', 'editgrid', 'dynamicWizard'];
|
|
433
423
|
const currentComponents = (nestedComp === null || nestedComp === void 0 ? void 0 : nestedComp.subForm)
|
|
434
424
|
? this.getSortedComponents(nestedComp.subForm)
|
|
435
425
|
: (nestedComp === null || nestedComp === void 0 ? void 0 : nestedComp.components) || [];
|
|
@@ -547,7 +537,7 @@ class Wizard extends Webform_1.default {
|
|
|
547
537
|
const forceShow = this.shouldForceShow(item);
|
|
548
538
|
const forceHide = this.shouldForceHide(item);
|
|
549
539
|
let isVisible = !page
|
|
550
|
-
? (
|
|
540
|
+
? (0, utils_1.checkCondition)(item, data, data, this.component, this) && !item.hidden
|
|
551
541
|
: page.visible;
|
|
552
542
|
if (forceShow) {
|
|
553
543
|
isVisible = true;
|
|
@@ -633,7 +623,7 @@ class Wizard extends Webform_1.default {
|
|
|
633
623
|
this.redraw();
|
|
634
624
|
return Promise.resolve();
|
|
635
625
|
}
|
|
636
|
-
return Promise.reject('
|
|
626
|
+
return Promise.reject(this.t('pageNotFound'));
|
|
637
627
|
}
|
|
638
628
|
pageFieldLogic(page) {
|
|
639
629
|
var _a;
|
|
@@ -688,7 +678,34 @@ class Wizard extends Webform_1.default {
|
|
|
688
678
|
getPreviousPage() {
|
|
689
679
|
return this.page - 1;
|
|
690
680
|
}
|
|
681
|
+
mergeDefaultsFromSchema(data) {
|
|
682
|
+
var _a, _b;
|
|
683
|
+
const components = (_a = this.form) === null || _a === void 0 ? void 0 : _a.components;
|
|
684
|
+
if (!components || !data || ((_b = this.options) === null || _b === void 0 ? void 0 : _b.readOnly)) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
(0, utils_1.eachComponent)(components, (component, _path, _c, _parent, compPaths) => {
|
|
688
|
+
if (!(component === null || component === void 0 ? void 0 : component.key) ||
|
|
689
|
+
component.type === 'button' ||
|
|
690
|
+
component.persistent === 'client-only' ||
|
|
691
|
+
!component.hasOwnProperty('clearOnHide') ||
|
|
692
|
+
component.clearOnHide !== false ||
|
|
693
|
+
!component.hasOwnProperty('defaultValue')) {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const modelType = (0, utils_1.getModelType)(component);
|
|
697
|
+
if (modelType === 'none' || modelType === 'content' || component.input === false) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
const dataPath = (compPaths === null || compPaths === void 0 ? void 0 : compPaths.dataPath) || component.key;
|
|
701
|
+
if (!dataPath || lodash_1.default.get(data, dataPath) != null) {
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
lodash_1.default.set(data, dataPath, component.defaultValue);
|
|
705
|
+
}, true);
|
|
706
|
+
}
|
|
691
707
|
beforeSubmit() {
|
|
708
|
+
this.mergeDefaultsFromSchema(this.data);
|
|
692
709
|
const pages = this.getPages({ all: true });
|
|
693
710
|
return Promise.all(pages.map((page) => {
|
|
694
711
|
this.triggerButtonCaptcha(page);
|
|
@@ -751,13 +768,13 @@ class Wizard extends Webform_1.default {
|
|
|
751
768
|
}
|
|
752
769
|
}
|
|
753
770
|
validateCurrentPage(flags = {}) {
|
|
754
|
-
var _a, _b,
|
|
771
|
+
var _a, _b, _d, _e, _f;
|
|
755
772
|
const components = (_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.components.map((component) => component.component);
|
|
756
773
|
// Accessing the parent ensures the right instance (whether it's the parent Wizard or a nested Wizard) performs its validation
|
|
757
774
|
if ((_b = this.currentPage) === null || _b === void 0 ? void 0 : _b.parent) {
|
|
758
|
-
return (
|
|
775
|
+
return (_d = this.currentPage) === null || _d === void 0 ? void 0 : _d.parent.validateComponents(components, (_e = this.root) === null || _e === void 0 ? void 0 : _e.data, flags);
|
|
759
776
|
}
|
|
760
|
-
return (
|
|
777
|
+
return (_f = this.currentPage) === null || _f === void 0 ? void 0 : _f.validateComponents(components, this.root ? this.root.data : this.data, flags);
|
|
761
778
|
}
|
|
762
779
|
emitPrevPage() {
|
|
763
780
|
this.emit('prevPage', { page: this.page, submission: this.submission });
|
|
@@ -835,9 +852,7 @@ class Wizard extends Webform_1.default {
|
|
|
835
852
|
key: 'page1',
|
|
836
853
|
components: this.component.components,
|
|
837
854
|
};
|
|
838
|
-
this.component.components = [
|
|
839
|
-
newPage,
|
|
840
|
-
];
|
|
855
|
+
this.component.components = [newPage];
|
|
841
856
|
this.originalComponents.push(lodash_1.default.clone(newPage));
|
|
842
857
|
}
|
|
843
858
|
}
|
|
@@ -848,7 +863,8 @@ class Wizard extends Webform_1.default {
|
|
|
848
863
|
return super.setForm(form, flags);
|
|
849
864
|
}
|
|
850
865
|
onSetForm(clonedForm, initialForm) {
|
|
851
|
-
this.component.components =
|
|
866
|
+
this.component.components =
|
|
867
|
+
(this.parent ? initialForm.components : clonedForm.components) || [];
|
|
852
868
|
this.setComponentSchema();
|
|
853
869
|
}
|
|
854
870
|
setEditMode(submission) {
|
|
@@ -880,10 +896,7 @@ class Wizard extends Webform_1.default {
|
|
|
880
896
|
}
|
|
881
897
|
isClickable(page, index) {
|
|
882
898
|
return (this.page !== index &&
|
|
883
|
-
(0, utils_1.firstNonNil)([
|
|
884
|
-
lodash_1.default.get(page, 'breadcrumbClickable'),
|
|
885
|
-
this.options.breadcrumbSettings.clickable,
|
|
886
|
-
]));
|
|
899
|
+
(0, utils_1.firstNonNil)([lodash_1.default.get(page, 'breadcrumbClickable'), this.options.breadcrumbSettings.clickable]));
|
|
887
900
|
}
|
|
888
901
|
hasButton(name, nextPage = this.getNextPage()) {
|
|
889
902
|
// get page options with global options as default values
|
package/lib/cjs/WizardBuilder.js
CHANGED
|
@@ -23,9 +23,7 @@ class WizardBuilder extends WebformBuilder_1.default {
|
|
|
23
23
|
options.display = 'wizard';
|
|
24
24
|
super(element, options);
|
|
25
25
|
this._form = {
|
|
26
|
-
components: [
|
|
27
|
-
this.getPageConfig(1),
|
|
28
|
-
],
|
|
26
|
+
components: [this.getPageConfig(1)],
|
|
29
27
|
};
|
|
30
28
|
this.page = 0;
|
|
31
29
|
// Need to create a component order for each group.
|
|
@@ -106,9 +104,7 @@ class WizardBuilder extends WebformBuilder_1.default {
|
|
|
106
104
|
}
|
|
107
105
|
if (this.pages.length === 0) {
|
|
108
106
|
const components = this._form.components.filter((component) => component.type !== 'button');
|
|
109
|
-
this._form.components = [
|
|
110
|
-
this.getPageConfig(1, components),
|
|
111
|
-
];
|
|
107
|
+
this._form.components = [this.getPageConfig(1, components)];
|
|
112
108
|
}
|
|
113
109
|
else {
|
|
114
110
|
const components = this._form.components.filter((component) => component.type !== 'button' || component.action !== 'submit');
|
|
@@ -159,9 +155,7 @@ class WizardBuilder extends WebformBuilder_1.default {
|
|
|
159
155
|
page.parentNode.dragInfo = { index };
|
|
160
156
|
});
|
|
161
157
|
if (this.dragulaLib) {
|
|
162
|
-
this.navigationDragula = this.dragulaLib([
|
|
163
|
-
this.element.querySelector('.wizard-pages'),
|
|
164
|
-
], {
|
|
158
|
+
this.navigationDragula = this.dragulaLib([this.element.querySelector('.wizard-pages')], {
|
|
165
159
|
moves: (el) => !el.classList.contains('wizard-add-page'),
|
|
166
160
|
accepts: (el, target, source, sibling) => (sibling ? true : false),
|
|
167
161
|
}).on('drop', this.onReorder.bind(this));
|
|
@@ -193,11 +187,7 @@ class WizardBuilder extends WebformBuilder_1.default {
|
|
|
193
187
|
this.webform.setForm({
|
|
194
188
|
display: 'form',
|
|
195
189
|
type: 'form',
|
|
196
|
-
components: page
|
|
197
|
-
? [
|
|
198
|
-
page,
|
|
199
|
-
]
|
|
200
|
-
: [],
|
|
190
|
+
components: page ? [page] : [],
|
|
201
191
|
controller: ((_a = this._form) === null || _a === void 0 ? void 0 : _a.controller) || '',
|
|
202
192
|
}, { keepAsReference: true });
|
|
203
193
|
return this.redraw();
|
|
@@ -231,7 +221,7 @@ class WizardBuilder extends WebformBuilder_1.default {
|
|
|
231
221
|
const isSiblingAnAddPageButton = sibling === null || sibling === void 0 ? void 0 : sibling.classList.contains('wizard-add-page');
|
|
232
222
|
// We still can paste before Add Page button
|
|
233
223
|
if (!element.dragInfo || (sibling && !sibling.dragInfo && !isSiblingAnAddPageButton)) {
|
|
234
|
-
console.warn('
|
|
224
|
+
console.warn(this.t('noDragInfoError'));
|
|
235
225
|
return;
|
|
236
226
|
}
|
|
237
227
|
const oldPosition = element.dragInfo.index;
|
|
@@ -13,9 +13,7 @@ exports.default = [
|
|
|
13
13
|
enableRowGroups: false,
|
|
14
14
|
initEmpty: false,
|
|
15
15
|
tableView: false,
|
|
16
|
-
defaultValue: [
|
|
17
|
-
{},
|
|
18
|
-
],
|
|
16
|
+
defaultValue: [{}],
|
|
19
17
|
key: 'levels',
|
|
20
18
|
type: 'editgrid',
|
|
21
19
|
input: true,
|
|
@@ -126,9 +124,7 @@ exports.default = [
|
|
|
126
124
|
enableRowGroups: false,
|
|
127
125
|
initEmpty: false,
|
|
128
126
|
tableView: false,
|
|
129
|
-
defaultValue: [
|
|
130
|
-
{},
|
|
131
|
-
],
|
|
127
|
+
defaultValue: [{}],
|
|
132
128
|
key: 'rulesSettings',
|
|
133
129
|
type: 'datagrid',
|
|
134
130
|
input: true,
|
|
@@ -9,9 +9,7 @@ const PasswordStrengthAddon_form_1 = __importDefault(require("./PasswordStrength
|
|
|
9
9
|
class PasswordStrengthAddon extends FormioAddon_1.default {
|
|
10
10
|
static get info() {
|
|
11
11
|
return {
|
|
12
|
-
supportedComponents: [
|
|
13
|
-
'password',
|
|
14
|
-
],
|
|
12
|
+
supportedComponents: ['password'],
|
|
15
13
|
name: 'passwordStrength',
|
|
16
14
|
components: PasswordStrengthAddon_form_1.default,
|
|
17
15
|
label: 'Password Strength',
|
|
@@ -172,9 +170,7 @@ class PasswordStrengthAddon extends FormioAddon_1.default {
|
|
|
172
170
|
return this.component.sanitize(view);
|
|
173
171
|
}
|
|
174
172
|
checkBlackList(value) {
|
|
175
|
-
const blackList = [
|
|
176
|
-
...this.settings.blackList,
|
|
177
|
-
];
|
|
173
|
+
const blackList = [...this.settings.blackList];
|
|
178
174
|
let customBlacklistedWords = this.settings.customBlacklistedWords;
|
|
179
175
|
if (customBlacklistedWords && typeof customBlacklistedWords === 'string') {
|
|
180
176
|
customBlacklistedWords = this.evaluate(customBlacklistedWords, this.component.evalContext({ value }), 'values');
|
|
@@ -311,9 +307,7 @@ class PasswordStrengthAddon extends FormioAddon_1.default {
|
|
|
311
307
|
constructor(settings, componentInstance) {
|
|
312
308
|
super(settings, componentInstance);
|
|
313
309
|
this._entropy = 0; // Set initial value of entropy
|
|
314
|
-
this.levels = [
|
|
315
|
-
...(this.settings.levels || this.defaultSettings.levels),
|
|
316
|
-
];
|
|
310
|
+
this.levels = [...(this.settings.levels || this.defaultSettings.levels)];
|
|
317
311
|
this.levels.sort((a, b) => a.maxEntropy - b.maxEntropy); // Sort levels from the lowest one to the highest
|
|
318
312
|
this.level = this.levels[0]; // Set currnt level to the lowest one
|
|
319
313
|
this.maxEntropy = this.levels[this.levels.length - 1].maxEntropy; // Set maximal amount of security points based on the highest level
|
package/lib/cjs/addons/index.js
CHANGED
|
@@ -5,9 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.editForms = void 0;
|
|
7
7
|
const PasswordStrengthAddon_1 = __importDefault(require("./PasswordStrength/PasswordStrengthAddon"));
|
|
8
|
-
exports.editForms = [
|
|
9
|
-
PasswordStrengthAddon_1.default.info,
|
|
10
|
-
].map(({ components, name, defaultSettings }) => ({
|
|
8
|
+
exports.editForms = [PasswordStrengthAddon_1.default.info].map(({ components, name, defaultSettings }) => ({
|
|
11
9
|
type: 'form',
|
|
12
10
|
key: 'settings',
|
|
13
11
|
display: 'form',
|
|
@@ -539,10 +539,10 @@ declare class Component extends Element {
|
|
|
539
539
|
/**
|
|
540
540
|
* Uses the widget to determine the output string.
|
|
541
541
|
* @param {any} value - The current value of the component.
|
|
542
|
-
* @param {any}
|
|
542
|
+
* @param {any} _options - The options for getValueAsString.
|
|
543
543
|
* @returns {any|Array<any>} - The value as a string.
|
|
544
544
|
*/
|
|
545
|
-
getWidgetValueAsString(value: any,
|
|
545
|
+
getWidgetValueAsString(value: any, _options: any): any | Array<any>;
|
|
546
546
|
/**
|
|
547
547
|
* Returns the value of the component as a string.
|
|
548
548
|
* @param {any} value - The value for this component.
|
|
@@ -942,9 +942,9 @@ declare class Component extends Element {
|
|
|
942
942
|
*/
|
|
943
943
|
get hasDefaultValue(): boolean;
|
|
944
944
|
/**
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
945
|
+
* Determine if we should add a default value for this component.
|
|
946
|
+
* @returns {boolean} - TRUE if a default value should be set
|
|
947
|
+
*/
|
|
948
948
|
get shouldAddDefaultValue(): boolean;
|
|
949
949
|
/**
|
|
950
950
|
* Get the default value of this component.
|