@formio/js 5.0.0-dev.5704.492ccdf → 5.0.0-dev.5704.50db01f
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/Changelog.md +47 -0
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.form.js +55 -131
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -0
- package/dist/formio.full.js +61 -41
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -0
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +25 -5
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -0
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Form.d.ts +2 -2
- package/lib/cjs/Form.js +11 -5
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/PDFBuilder.js +2 -1
- package/lib/cjs/Webform.js +3 -6
- package/lib/cjs/WebformBuilder.js +13 -3
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +2 -1
- package/lib/cjs/components/_classes/component/Component.js +25 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +43 -25
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
- package/lib/cjs/components/address/Address.d.ts +6 -0
- package/lib/cjs/components/address/Address.js +7 -1
- package/lib/cjs/components/currency/Currency.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +2 -1
- package/lib/cjs/components/datagrid/DataGrid.js +40 -35
- package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -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.js +2 -2
- package/lib/cjs/components/day/Day.d.ts +3 -4
- package/lib/cjs/components/day/Day.js +31 -10
- package/lib/cjs/components/editgrid/EditGrid.js +14 -6
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.js +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.js +71 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
- package/lib/cjs/components/file/File.d.ts +2 -2
- package/lib/cjs/components/file/File.js +13 -2
- package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/form/fixtures/index.js +3 -1
- package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
- package/lib/cjs/components/number/Number.d.ts +17 -2
- package/lib/cjs/components/number/Number.js +26 -6
- package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp10.js +21 -0
- package/lib/cjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp9.js +21 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/number/fixtures/index.js +5 -1
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +1 -0
- package/lib/cjs/components/radio/Radio.d.ts +2 -18
- package/lib/cjs/components/radio/Radio.js +29 -27
- package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
- package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
- package/lib/cjs/components/select/Select.d.ts +38 -0
- package/lib/cjs/components/select/Select.js +13 -3
- package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/cjs/components/select/fixtures/comp25.js +66 -0
- package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp26.js +59 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
- package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/cjs/components/tags/Tags.js +3 -3
- package/lib/cjs/components/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.form.js +2 -2
- package/lib/cjs/components/time/Time.js +3 -7
- package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/cjs/components/time/fixtures/comp4.js +171 -0
- package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/time/fixtures/index.js +3 -1
- package/lib/cjs/templates/Templates.js +1 -1
- package/lib/cjs/translations/en.d.ts +1 -0
- package/lib/cjs/translations/en.js +1 -0
- package/lib/cjs/utils/utils.d.ts +9 -1
- package/lib/cjs/utils/utils.js +14 -13
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Form.d.ts +2 -2
- package/lib/mjs/Form.js +11 -5
- package/lib/mjs/PDF.js +1 -1
- package/lib/mjs/PDFBuilder.js +1 -1
- package/lib/mjs/Webform.js +7 -6
- package/lib/mjs/WebformBuilder.js +12 -3
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +2 -1
- package/lib/mjs/components/_classes/component/Component.js +11 -3
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +43 -25
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
- package/lib/mjs/components/address/Address.d.ts +6 -0
- package/lib/mjs/components/address/Address.js +10 -1
- package/lib/mjs/components/currency/Currency.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +2 -1
- package/lib/mjs/components/datagrid/DataGrid.js +39 -34
- package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -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.js +2 -2
- package/lib/mjs/components/day/Day.d.ts +3 -4
- package/lib/mjs/components/day/Day.js +30 -10
- package/lib/mjs/components/editgrid/EditGrid.js +14 -6
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.js +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.js +69 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
- package/lib/mjs/components/file/File.d.ts +2 -2
- package/lib/mjs/components/file/File.js +13 -2
- package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/form/fixtures/index.js +2 -1
- package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
- package/lib/mjs/components/number/Number.d.ts +17 -2
- package/lib/mjs/components/number/Number.js +25 -5
- package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp10.js +19 -0
- package/lib/mjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp9.js +19 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/number/fixtures/index.js +3 -1
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +1 -0
- package/lib/mjs/components/radio/Radio.d.ts +2 -18
- package/lib/mjs/components/radio/Radio.js +32 -30
- package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
- package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
- package/lib/mjs/components/select/Select.d.ts +38 -0
- package/lib/mjs/components/select/Select.js +16 -4
- package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/mjs/components/select/fixtures/comp25.js +64 -0
- package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp26.js +57 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
- package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/mjs/components/tags/Tags.js +3 -3
- package/lib/mjs/components/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.form.js +2 -2
- package/lib/mjs/components/time/Time.js +3 -13
- package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/mjs/components/time/fixtures/comp4.js +169 -0
- package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/time/fixtures/index.js +2 -1
- package/lib/mjs/templates/Templates.js +1 -1
- package/lib/mjs/translations/en.d.ts +1 -0
- package/lib/mjs/translations/en.js +1 -0
- package/lib/mjs/utils/utils.d.ts +9 -1
- package/lib/mjs/utils/utils.js +14 -2
- package/package.json +4 -4
|
@@ -25,7 +25,8 @@ export default class DayComponent extends Field {
|
|
|
25
25
|
required: false
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
dayFirst: false
|
|
28
|
+
dayFirst: false,
|
|
29
|
+
defaultValue: ''
|
|
29
30
|
}, ...extend);
|
|
30
31
|
}
|
|
31
32
|
static get builderInfo() {
|
|
@@ -62,10 +63,10 @@ export default class DayComponent extends Field {
|
|
|
62
63
|
}
|
|
63
64
|
/**
|
|
64
65
|
* The empty value for day component.
|
|
65
|
-
* @returns {'
|
|
66
|
+
* @returns {''} - The empty value of the day component.
|
|
66
67
|
*/
|
|
67
68
|
get emptyValue() {
|
|
68
|
-
return '
|
|
69
|
+
return '';
|
|
69
70
|
}
|
|
70
71
|
get valueMask() {
|
|
71
72
|
return /^\d{2}\/\d{2}\/\d{4}$/;
|
|
@@ -341,15 +342,21 @@ export default class DayComponent extends Field {
|
|
|
341
342
|
const valueParts = value.split('/');
|
|
342
343
|
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
343
344
|
const defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';
|
|
344
|
-
const getNextPart = (shouldTake, defaultValue) =>
|
|
345
|
+
const getNextPart = (shouldTake, defaultValue) => {
|
|
346
|
+
// Only push the part if it's not an empty string
|
|
347
|
+
const part = shouldTake ? valueParts.shift() : defaultValue;
|
|
348
|
+
if (part !== '') {
|
|
349
|
+
dateParts.push(part);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
345
352
|
if (this.dayFirst) {
|
|
346
|
-
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '
|
|
353
|
+
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
|
|
347
354
|
}
|
|
348
|
-
getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '
|
|
355
|
+
getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '');
|
|
349
356
|
if (!this.dayFirst) {
|
|
350
|
-
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '
|
|
357
|
+
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
|
|
351
358
|
}
|
|
352
|
-
getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '
|
|
359
|
+
getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '');
|
|
353
360
|
return dateParts.join('/');
|
|
354
361
|
}
|
|
355
362
|
/**
|
|
@@ -361,7 +368,7 @@ export default class DayComponent extends Field {
|
|
|
361
368
|
setValueAt(index, value) {
|
|
362
369
|
// temporary solution to avoid input reset
|
|
363
370
|
// on invalid date.
|
|
364
|
-
if (
|
|
371
|
+
if (value === 'Invalid date') {
|
|
365
372
|
return null;
|
|
366
373
|
}
|
|
367
374
|
const parts = value.split('/');
|
|
@@ -554,9 +561,22 @@ export default class DayComponent extends Field {
|
|
|
554
561
|
}
|
|
555
562
|
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
556
563
|
const values = value.split('/');
|
|
564
|
+
if (values.length < 3) {
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
557
567
|
return (values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000');
|
|
558
568
|
}
|
|
559
569
|
getValidationFormat() {
|
|
560
|
-
|
|
570
|
+
let validationFormat = this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';
|
|
571
|
+
if (this.fields?.day?.hide) {
|
|
572
|
+
validationFormat = validationFormat.replace('DD-', '');
|
|
573
|
+
}
|
|
574
|
+
if (this.fields?.month?.hide) {
|
|
575
|
+
validationFormat = validationFormat.replace('MM-', '');
|
|
576
|
+
}
|
|
577
|
+
if (this.fields?.year?.hide) {
|
|
578
|
+
validationFormat = validationFormat.replace('-YYYY', '');
|
|
579
|
+
}
|
|
580
|
+
return validationFormat;
|
|
561
581
|
}
|
|
562
582
|
}
|
|
@@ -484,11 +484,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
484
484
|
else {
|
|
485
485
|
this.removeClass(this.refs.component, `formio-component-${this.component.type}-row-open`);
|
|
486
486
|
}
|
|
487
|
-
|
|
488
|
-
this.loadRefs(element, {
|
|
489
|
-
messageContainer: 'single-scope',
|
|
490
|
-
});
|
|
491
|
-
return superAttach;
|
|
487
|
+
return super.attach(element);
|
|
492
488
|
}
|
|
493
489
|
flattenRowDataValue(dataValue) {
|
|
494
490
|
const flattened = {};
|
|
@@ -672,6 +668,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
672
668
|
}
|
|
673
669
|
},
|
|
674
670
|
}, this.component.saveRow || 'Save'));
|
|
671
|
+
this.emit('editGridOpenModal', {
|
|
672
|
+
component: this.component,
|
|
673
|
+
row: editRow,
|
|
674
|
+
instance: this,
|
|
675
|
+
});
|
|
675
676
|
return this.attachComponents(modalContent, components);
|
|
676
677
|
}
|
|
677
678
|
showDialog(rowIndex) {
|
|
@@ -729,6 +730,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
729
730
|
editRow.data = dataSnapshot;
|
|
730
731
|
this.restoreRowContext(editRow);
|
|
731
732
|
}
|
|
733
|
+
this.emit('editGridEditRow', {
|
|
734
|
+
component: this.component,
|
|
735
|
+
row: editRow,
|
|
736
|
+
instance: this,
|
|
737
|
+
});
|
|
732
738
|
if (this.component.modal) {
|
|
733
739
|
return this.addRowModal(rowIndex);
|
|
734
740
|
}
|
|
@@ -879,6 +885,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
879
885
|
}
|
|
880
886
|
this.clearErrors(rowIndex);
|
|
881
887
|
this.baseRemoveRow(rowIndex);
|
|
888
|
+
this.removeSubmissionMetadataRow(rowIndex);
|
|
882
889
|
this.splice(rowIndex);
|
|
883
890
|
this.emit('editGridDeleteRow', {
|
|
884
891
|
index: rowIndex
|
|
@@ -1079,7 +1086,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1079
1086
|
return false;
|
|
1080
1087
|
}
|
|
1081
1088
|
else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {
|
|
1082
|
-
this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1089
|
+
this._errors = this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1090
|
+
errors.push(...this._errors);
|
|
1083
1091
|
return false;
|
|
1084
1092
|
}
|
|
1085
1093
|
const message = this.invalid || this.invalidMessage(data, dirty, false, row);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let _id: string;
|
|
3
|
+
let title: string;
|
|
4
|
+
let name: string;
|
|
5
|
+
let path: string;
|
|
6
|
+
let type: string;
|
|
7
|
+
let display: string;
|
|
8
|
+
let owner: string;
|
|
9
|
+
let components: ({
|
|
10
|
+
label: string;
|
|
11
|
+
tableView: boolean;
|
|
12
|
+
modal: boolean;
|
|
13
|
+
validateWhenHidden: boolean;
|
|
14
|
+
rowDrafts: boolean;
|
|
15
|
+
key: string;
|
|
16
|
+
type: string;
|
|
17
|
+
displayAsTable: boolean;
|
|
18
|
+
input: boolean;
|
|
19
|
+
components: {
|
|
20
|
+
label: string;
|
|
21
|
+
applyMaskOn: string;
|
|
22
|
+
tableView: boolean;
|
|
23
|
+
validateWhenHidden: boolean;
|
|
24
|
+
key: string;
|
|
25
|
+
type: string;
|
|
26
|
+
input: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
disableOnInvalid?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
type: string;
|
|
31
|
+
label: string;
|
|
32
|
+
key: string;
|
|
33
|
+
disableOnInvalid: boolean;
|
|
34
|
+
input: boolean;
|
|
35
|
+
tableView: boolean;
|
|
36
|
+
modal?: undefined;
|
|
37
|
+
validateWhenHidden?: undefined;
|
|
38
|
+
rowDrafts?: undefined;
|
|
39
|
+
displayAsTable?: undefined;
|
|
40
|
+
components?: undefined;
|
|
41
|
+
})[];
|
|
42
|
+
let pdfComponents: never[];
|
|
43
|
+
let settings: {};
|
|
44
|
+
let properties: {};
|
|
45
|
+
let project: string;
|
|
46
|
+
let controller: string;
|
|
47
|
+
let revisions: string;
|
|
48
|
+
let submissionRevisions: string;
|
|
49
|
+
let _vid: number;
|
|
50
|
+
let created: string;
|
|
51
|
+
let modified: string;
|
|
52
|
+
let machineName: string;
|
|
53
|
+
}
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
_id: '669e1c88a40e327e67e7d1c5',
|
|
3
|
+
title: 'editGrid test',
|
|
4
|
+
name: 'editGridTest',
|
|
5
|
+
path: 'editgridtest',
|
|
6
|
+
type: 'form',
|
|
7
|
+
display: 'form',
|
|
8
|
+
owner: '637b2e6b48c1227e60b1f910',
|
|
9
|
+
components: [
|
|
10
|
+
{
|
|
11
|
+
label: 'Edit Grid',
|
|
12
|
+
tableView: false,
|
|
13
|
+
modal: false,
|
|
14
|
+
validateWhenHidden: false,
|
|
15
|
+
rowDrafts: false,
|
|
16
|
+
key: 'editGrid',
|
|
17
|
+
type: 'editgrid',
|
|
18
|
+
displayAsTable: false,
|
|
19
|
+
input: true,
|
|
20
|
+
components: [
|
|
21
|
+
{
|
|
22
|
+
label: 'Text Field',
|
|
23
|
+
applyMaskOn: 'change',
|
|
24
|
+
tableView: true,
|
|
25
|
+
validateWhenHidden: false,
|
|
26
|
+
key: 'textField',
|
|
27
|
+
type: 'textfield',
|
|
28
|
+
input: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'button',
|
|
34
|
+
label: 'Submit',
|
|
35
|
+
key: 'submit',
|
|
36
|
+
disableOnInvalid: true,
|
|
37
|
+
input: true,
|
|
38
|
+
tableView: false,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
pdfComponents: [],
|
|
42
|
+
settings: {},
|
|
43
|
+
properties: {},
|
|
44
|
+
project: '669e1c68a40e327e67e7cedd',
|
|
45
|
+
controller: '',
|
|
46
|
+
revisions: '',
|
|
47
|
+
submissionRevisions: '',
|
|
48
|
+
_vid: 0,
|
|
49
|
+
created: '2024-07-22T08:47:04.399Z',
|
|
50
|
+
modified: '2024-07-22T10:04:23.474Z',
|
|
51
|
+
machineName: 'authoring-qzdhayddccjauyr:editGridTest',
|
|
52
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let type: string;
|
|
3
|
+
let display: string;
|
|
4
|
+
let components: ({
|
|
5
|
+
title: string;
|
|
6
|
+
breadcrumbClickable: boolean;
|
|
7
|
+
buttonSettings: {
|
|
8
|
+
previous: boolean;
|
|
9
|
+
cancel: boolean;
|
|
10
|
+
next: boolean;
|
|
11
|
+
};
|
|
12
|
+
collapsible: boolean;
|
|
13
|
+
tableView: boolean;
|
|
14
|
+
key: string;
|
|
15
|
+
type: string;
|
|
16
|
+
label: string;
|
|
17
|
+
input: boolean;
|
|
18
|
+
components: {
|
|
19
|
+
label: string;
|
|
20
|
+
tableView: boolean;
|
|
21
|
+
rowDrafts: boolean;
|
|
22
|
+
key: string;
|
|
23
|
+
type: string;
|
|
24
|
+
input: boolean;
|
|
25
|
+
components: {
|
|
26
|
+
label: string;
|
|
27
|
+
tableView: boolean;
|
|
28
|
+
key: string;
|
|
29
|
+
type: string;
|
|
30
|
+
input: boolean;
|
|
31
|
+
alwaysEnabled: boolean;
|
|
32
|
+
}[];
|
|
33
|
+
alwaysEnabled: boolean;
|
|
34
|
+
}[];
|
|
35
|
+
alwaysEnabled: boolean;
|
|
36
|
+
showValidations?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
label: string;
|
|
39
|
+
showValidations: boolean;
|
|
40
|
+
alwaysEnabled: boolean;
|
|
41
|
+
tableView: boolean;
|
|
42
|
+
key: string;
|
|
43
|
+
type: string;
|
|
44
|
+
input: boolean;
|
|
45
|
+
title?: undefined;
|
|
46
|
+
breadcrumbClickable?: undefined;
|
|
47
|
+
buttonSettings?: undefined;
|
|
48
|
+
collapsible?: undefined;
|
|
49
|
+
components?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
}
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: 'form',
|
|
3
|
+
display: 'wizard',
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
title: 'Page 1',
|
|
7
|
+
breadcrumbClickable: true,
|
|
8
|
+
buttonSettings: {
|
|
9
|
+
previous: true,
|
|
10
|
+
cancel: true,
|
|
11
|
+
next: true
|
|
12
|
+
},
|
|
13
|
+
collapsible: false,
|
|
14
|
+
tableView: false,
|
|
15
|
+
key: 'page3',
|
|
16
|
+
type: 'panel',
|
|
17
|
+
label: 'Page 2',
|
|
18
|
+
input: false,
|
|
19
|
+
components: [
|
|
20
|
+
{
|
|
21
|
+
label: 'Edit Grid',
|
|
22
|
+
tableView: true,
|
|
23
|
+
rowDrafts: false,
|
|
24
|
+
key: 'editGrid',
|
|
25
|
+
type: 'editgrid',
|
|
26
|
+
input: true,
|
|
27
|
+
components: [
|
|
28
|
+
{
|
|
29
|
+
label: 'Text Field',
|
|
30
|
+
tableView: true,
|
|
31
|
+
key: 'textField',
|
|
32
|
+
type: 'textfield',
|
|
33
|
+
input: true,
|
|
34
|
+
alwaysEnabled: false
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
alwaysEnabled: false
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
alwaysEnabled: false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: 'Page 2',
|
|
44
|
+
breadcrumbClickable: true,
|
|
45
|
+
buttonSettings: {
|
|
46
|
+
previous: true,
|
|
47
|
+
cancel: true,
|
|
48
|
+
next: true
|
|
49
|
+
},
|
|
50
|
+
collapsible: false,
|
|
51
|
+
tableView: false,
|
|
52
|
+
key: 'page2',
|
|
53
|
+
type: 'panel',
|
|
54
|
+
label: 'Page 1',
|
|
55
|
+
input: false,
|
|
56
|
+
alwaysEnabled: false,
|
|
57
|
+
components: []
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Submit',
|
|
61
|
+
showValidations: false,
|
|
62
|
+
alwaysEnabled: false,
|
|
63
|
+
tableView: false,
|
|
64
|
+
key: 'submit',
|
|
65
|
+
type: 'button',
|
|
66
|
+
input: true
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let type: string;
|
|
3
|
+
let display: string;
|
|
4
|
+
let components: ({
|
|
5
|
+
label: string;
|
|
6
|
+
tableView: boolean;
|
|
7
|
+
rowDrafts: boolean;
|
|
8
|
+
key: string;
|
|
9
|
+
type: string;
|
|
10
|
+
input: boolean;
|
|
11
|
+
components: {
|
|
12
|
+
collapsible: boolean;
|
|
13
|
+
key: string;
|
|
14
|
+
type: string;
|
|
15
|
+
label: string;
|
|
16
|
+
input: boolean;
|
|
17
|
+
tableView: boolean;
|
|
18
|
+
components: {
|
|
19
|
+
label: string;
|
|
20
|
+
columns: ({
|
|
21
|
+
components: {
|
|
22
|
+
label: string;
|
|
23
|
+
optionsLabelPosition: string;
|
|
24
|
+
inline: boolean;
|
|
25
|
+
tableView: boolean;
|
|
26
|
+
values: {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
shortcut: string;
|
|
30
|
+
}[];
|
|
31
|
+
key: string;
|
|
32
|
+
type: string;
|
|
33
|
+
input: boolean;
|
|
34
|
+
}[];
|
|
35
|
+
width: number;
|
|
36
|
+
offset: number;
|
|
37
|
+
push: number;
|
|
38
|
+
pull: number;
|
|
39
|
+
size: string;
|
|
40
|
+
currentWidth: number;
|
|
41
|
+
} | {
|
|
42
|
+
components: {
|
|
43
|
+
label: string;
|
|
44
|
+
applyMaskOn: string;
|
|
45
|
+
autoExpand: boolean;
|
|
46
|
+
tableView: boolean;
|
|
47
|
+
key: string;
|
|
48
|
+
conditional: {
|
|
49
|
+
show: boolean;
|
|
50
|
+
conjunction: string;
|
|
51
|
+
};
|
|
52
|
+
type: string;
|
|
53
|
+
input: boolean;
|
|
54
|
+
}[];
|
|
55
|
+
width: number;
|
|
56
|
+
offset: number;
|
|
57
|
+
push: number;
|
|
58
|
+
pull: number;
|
|
59
|
+
size: string;
|
|
60
|
+
currentWidth: number;
|
|
61
|
+
})[];
|
|
62
|
+
key: string;
|
|
63
|
+
type: string;
|
|
64
|
+
input: boolean;
|
|
65
|
+
tableView: boolean;
|
|
66
|
+
}[];
|
|
67
|
+
}[];
|
|
68
|
+
disableOnInvalid?: undefined;
|
|
69
|
+
} | {
|
|
70
|
+
type: string;
|
|
71
|
+
label: string;
|
|
72
|
+
key: string;
|
|
73
|
+
disableOnInvalid: boolean;
|
|
74
|
+
input: boolean;
|
|
75
|
+
tableView: boolean;
|
|
76
|
+
rowDrafts?: undefined;
|
|
77
|
+
components?: undefined;
|
|
78
|
+
})[];
|
|
79
|
+
}
|
|
80
|
+
export default _default;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: 'form',
|
|
3
|
+
display: 'form',
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
label: 'Edit Grid',
|
|
7
|
+
tableView: false,
|
|
8
|
+
rowDrafts: false,
|
|
9
|
+
key: 'editGrid',
|
|
10
|
+
type: 'editgrid',
|
|
11
|
+
input: true,
|
|
12
|
+
components: [
|
|
13
|
+
{
|
|
14
|
+
collapsible: false,
|
|
15
|
+
key: 'panel',
|
|
16
|
+
type: 'panel',
|
|
17
|
+
label: 'Panel',
|
|
18
|
+
input: false,
|
|
19
|
+
tableView: false,
|
|
20
|
+
components: [
|
|
21
|
+
{
|
|
22
|
+
label: 'Columns',
|
|
23
|
+
columns: [
|
|
24
|
+
{
|
|
25
|
+
components: [
|
|
26
|
+
{
|
|
27
|
+
label: 'Radio',
|
|
28
|
+
optionsLabelPosition: 'right',
|
|
29
|
+
inline: false,
|
|
30
|
+
tableView: true,
|
|
31
|
+
values: [
|
|
32
|
+
{
|
|
33
|
+
label: 'yes',
|
|
34
|
+
value: 'yes',
|
|
35
|
+
shortcut: ''
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'no',
|
|
39
|
+
value: 'no',
|
|
40
|
+
shortcut: ''
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
key: 'radio',
|
|
44
|
+
type: 'radio',
|
|
45
|
+
input: true
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
width: 6,
|
|
49
|
+
offset: 0,
|
|
50
|
+
push: 0,
|
|
51
|
+
pull: 0,
|
|
52
|
+
size: 'md',
|
|
53
|
+
currentWidth: 6
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
components: [
|
|
57
|
+
{
|
|
58
|
+
label: 'Text Area',
|
|
59
|
+
applyMaskOn: 'change',
|
|
60
|
+
autoExpand: false,
|
|
61
|
+
tableView: true,
|
|
62
|
+
key: 'textArea',
|
|
63
|
+
conditional: {
|
|
64
|
+
show: true,
|
|
65
|
+
conjunction: 'all'
|
|
66
|
+
},
|
|
67
|
+
type: 'textarea',
|
|
68
|
+
input: true
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
width: 6,
|
|
72
|
+
offset: 0,
|
|
73
|
+
push: 0,
|
|
74
|
+
pull: 0,
|
|
75
|
+
size: 'md',
|
|
76
|
+
currentWidth: 6
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
key: 'columns',
|
|
80
|
+
type: 'columns',
|
|
81
|
+
input: false,
|
|
82
|
+
tableView: false
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: 'button',
|
|
90
|
+
label: 'Submit',
|
|
91
|
+
key: 'submit',
|
|
92
|
+
disableOnInvalid: true,
|
|
93
|
+
input: true,
|
|
94
|
+
tableView: false
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
};
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import comp1 from './comp1';
|
|
2
2
|
import comp2 from './comp2';
|
|
3
3
|
import comp3 from './comp3';
|
|
4
|
-
import comp10 from './comp10';
|
|
5
|
-
import comp11 from './comp11';
|
|
6
|
-
import comp12 from './comp12';
|
|
7
|
-
import comp13 from './comp13';
|
|
8
|
-
import comp14 from './comp14';
|
|
9
|
-
import comp15 from './comp15';
|
|
10
4
|
import comp4 from './comp4';
|
|
11
5
|
import comp5 from './comp5';
|
|
12
6
|
import comp6 from './comp6';
|
|
13
7
|
import comp7 from './comp7';
|
|
14
8
|
import comp8 from './comp8';
|
|
15
9
|
import comp9 from './comp9';
|
|
10
|
+
import comp10 from './comp10';
|
|
11
|
+
import comp11 from './comp11';
|
|
12
|
+
import comp12 from './comp12';
|
|
13
|
+
import comp13 from './comp13';
|
|
14
|
+
import comp14 from './comp14';
|
|
15
|
+
import comp15 from './comp15';
|
|
16
|
+
import comp16 from './comp16';
|
|
17
|
+
import comp17 from './comp17';
|
|
16
18
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
17
19
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
18
20
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
19
|
-
|
|
21
|
+
import compTestEvents from './comp-test-events';
|
|
22
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -13,7 +13,10 @@ import comp12 from './comp12';
|
|
|
13
13
|
import comp13 from './comp13';
|
|
14
14
|
import comp14 from './comp14';
|
|
15
15
|
import comp15 from './comp15';
|
|
16
|
+
import comp16 from './comp16';
|
|
17
|
+
import comp17 from './comp17';
|
|
16
18
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
17
19
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
18
20
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
19
|
-
|
|
21
|
+
import compTestEvents from './comp-test-events';
|
|
22
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -33,12 +33,12 @@ export default class FileComponent extends Field {
|
|
|
33
33
|
get dataReady(): Promise<any>;
|
|
34
34
|
loadImage(fileInfo: any): any;
|
|
35
35
|
get emptyValue(): never[];
|
|
36
|
-
getValueAsString(value: any): any;
|
|
36
|
+
getValueAsString(value: any, options: any): any;
|
|
37
37
|
get defaultValue(): any[];
|
|
38
38
|
get hasTypes(): any;
|
|
39
39
|
_fileBrowseHidden: any;
|
|
40
40
|
get shouldSyncFiles(): boolean;
|
|
41
|
-
get autoSync():
|
|
41
|
+
get autoSync(): boolean;
|
|
42
42
|
get columnsSize(): {
|
|
43
43
|
name: number;
|
|
44
44
|
size: number;
|
|
@@ -103,7 +103,12 @@ export default class FileComponent extends Field {
|
|
|
103
103
|
get emptyValue() {
|
|
104
104
|
return [];
|
|
105
105
|
}
|
|
106
|
-
getValueAsString(value) {
|
|
106
|
+
getValueAsString(value, options) {
|
|
107
|
+
if (options?.review && !this.component.uploadOnly) {
|
|
108
|
+
return _.map(value, (val, index) => {
|
|
109
|
+
return `<a href="${val.url || '#'}" target="_blank" data-path='${this.path}' data-fileindex='${index}'>${val.originalName}</a>`;
|
|
110
|
+
}).join(', ');
|
|
111
|
+
}
|
|
107
112
|
if (_.isArray(value)) {
|
|
108
113
|
return _.map(value, 'originalName').join(', ');
|
|
109
114
|
}
|
|
@@ -135,7 +140,9 @@ export default class FileComponent extends Field {
|
|
|
135
140
|
return Boolean(this.filesToSync.filesToDelete.length || this.filesToSync.filesToUpload.length);
|
|
136
141
|
}
|
|
137
142
|
get autoSync() {
|
|
138
|
-
|
|
143
|
+
// Disable autoSync for now
|
|
144
|
+
return false;
|
|
145
|
+
// return _.get(this, 'component.autoSync', false);
|
|
139
146
|
}
|
|
140
147
|
get columnsSize() {
|
|
141
148
|
const actionsColumn = this.disabled ? 0 : this.autoSync ? 2 : 1;
|
|
@@ -931,6 +938,10 @@ export default class FileComponent extends Field {
|
|
|
931
938
|
: response.type === 'abort'
|
|
932
939
|
? this.t('Request was aborted')
|
|
933
940
|
: response.toString();
|
|
941
|
+
this.emit('fileUploadError', {
|
|
942
|
+
fileToSync,
|
|
943
|
+
response,
|
|
944
|
+
});
|
|
934
945
|
}
|
|
935
946
|
finally {
|
|
936
947
|
delete fileToSync.progress;
|
|
@@ -7,4 +7,5 @@ import comp5 from './comp5';
|
|
|
7
7
|
import comp6 from './comp6';
|
|
8
8
|
import comp7 from './comp7';
|
|
9
9
|
import comp8 from './comp8';
|
|
10
|
-
|
|
10
|
+
import nestedWizardForm from './nestedWizardForm';
|
|
11
|
+
export { formModalEdit, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, nestedWizardForm };
|
|
@@ -7,4 +7,5 @@ import comp5 from './comp5';
|
|
|
7
7
|
import comp6 from './comp6';
|
|
8
8
|
import comp7 from './comp7';
|
|
9
9
|
import comp8 from './comp8';
|
|
10
|
-
|
|
10
|
+
import nestedWizardForm from './nestedWizardForm';
|
|
11
|
+
export { formModalEdit, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, nestedWizardForm };
|