@formio/js 5.0.0-dev.5725.1c71137 → 5.0.0-dev.5729.48085f7
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 +3 -0
- package/dist/formio.form.js +5 -5
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +6 -6
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/WebformBuilder.js +11 -2
- package/lib/cjs/components/_classes/component/Component.js +1 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +50 -29
- package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +59 -29
- package/lib/cjs/components/editgrid/fixtures/comp17.js +86 -36
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +7 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +1 -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.js +7 -6
- 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/mjs/PDF.js +1 -1
- package/lib/mjs/WebformBuilder.js +10 -2
- package/lib/mjs/components/_classes/component/Component.js +1 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +51 -29
- package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +59 -29
- package/lib/mjs/components/editgrid/fixtures/comp17.js +86 -36
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +7 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +1 -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.js +7 -6
- 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/package.json +1 -1
package/lib/cjs/PDF.js
CHANGED
|
@@ -70,7 +70,7 @@ class PDF extends Webform_1.default {
|
|
|
70
70
|
super.destroy(all);
|
|
71
71
|
}
|
|
72
72
|
rebuild() {
|
|
73
|
-
if (this.
|
|
73
|
+
if (this.builderMode && this.component.components) {
|
|
74
74
|
this.destroyComponents();
|
|
75
75
|
this.addComponents();
|
|
76
76
|
return Promise.resolve();
|
|
@@ -908,7 +908,11 @@ class WebformBuilder extends Component_1.default {
|
|
|
908
908
|
if (form && form.properties) {
|
|
909
909
|
this.options.properties = form.properties;
|
|
910
910
|
}
|
|
911
|
-
|
|
911
|
+
let keyboardActionsEnabled = lodash_1.default.get(this.options, 'keyboardBuilder', false) || ((_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.keyboardBuilder);
|
|
912
|
+
if (typeof keyboardActionsEnabled === 'string') {
|
|
913
|
+
keyboardActionsEnabled = keyboardActionsEnabled === 'true';
|
|
914
|
+
}
|
|
915
|
+
this.keyboardActionsEnabled = keyboardActionsEnabled;
|
|
912
916
|
const isShowSubmitButton = !this.options.noDefaultSubmitButton
|
|
913
917
|
&& (!form.components.length || !form.components.find(comp => comp.key === 'submit'));
|
|
914
918
|
// Ensure there is at least a submit button.
|
|
@@ -1060,7 +1064,10 @@ class WebformBuilder extends Component_1.default {
|
|
|
1060
1064
|
'calculateValue',
|
|
1061
1065
|
'conditional',
|
|
1062
1066
|
'customConditional',
|
|
1063
|
-
'id'
|
|
1067
|
+
'id',
|
|
1068
|
+
'fields.day.required',
|
|
1069
|
+
'fields.month.required',
|
|
1070
|
+
'fields.year.required',
|
|
1064
1071
|
]));
|
|
1065
1072
|
const parentComponent = defaultValueComponent.parent;
|
|
1066
1073
|
let tabIndex = -1;
|
|
@@ -1236,6 +1243,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1236
1243
|
const previewButtons = this.componentEdit.querySelectorAll(`[${this._referenceAttributeName}="previewButton"]`);
|
|
1237
1244
|
previewButtons.forEach((previewButton) => {
|
|
1238
1245
|
this.editForm.addEventListener(previewButton, 'click', (event) => {
|
|
1246
|
+
var _a;
|
|
1239
1247
|
event.preventDefault();
|
|
1240
1248
|
this.showPreview = !this.showPreview;
|
|
1241
1249
|
this.editForm.detach();
|
|
@@ -1247,6 +1255,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1247
1255
|
helplinks: this.helplinks,
|
|
1248
1256
|
}));
|
|
1249
1257
|
this.editForm.attach(this.componentEdit.querySelector(`[${this._referenceAttributeName}="editForm"]`));
|
|
1258
|
+
this.updateComponent((_a = this.editForm.submission.data) !== null && _a !== void 0 ? _a : component);
|
|
1250
1259
|
this.attachEditComponentControls(component, parent, isNew, original, ComponentClass);
|
|
1251
1260
|
});
|
|
1252
1261
|
});
|
|
@@ -12,6 +12,8 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
|
12
12
|
hasAddButton(): any;
|
|
13
13
|
getComponent(path: any, fn: any, originalPath: any): any;
|
|
14
14
|
everyComponent(fn: any, rowIndex: any, options?: {}): void;
|
|
15
|
+
_getEmailTableHeader(options: any): string;
|
|
16
|
+
_getEmailTableBody(options: any): string;
|
|
15
17
|
getComponents(rowIndex: any): any;
|
|
16
18
|
}
|
|
17
19
|
import NestedDataComponent from '../nesteddata/NestedDataComponent';
|
|
@@ -149,39 +149,60 @@ class NestedArrayComponent extends NestedDataComponent_1.default {
|
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
+
_getEmailTableHeader(options) {
|
|
153
|
+
let row = '';
|
|
154
|
+
const getHeaderCell = (component) => {
|
|
155
|
+
if (!component.isInputComponent || !component.visible || component.skipInEmail) {
|
|
156
|
+
return '';
|
|
157
|
+
}
|
|
158
|
+
const label = component.label || component.key;
|
|
159
|
+
return `<th style="padding: 5px 10px;">${label}</th>`;
|
|
160
|
+
};
|
|
161
|
+
const components = this.getComponents(0);
|
|
162
|
+
for (const component of components) {
|
|
163
|
+
if (component.isInputComponent) {
|
|
164
|
+
row += getHeaderCell(component);
|
|
165
|
+
}
|
|
166
|
+
else if ((0, utils_1.isLayoutComponent)(component) && typeof component.everyComponent === 'function') {
|
|
167
|
+
component.everyComponent((comp) => {
|
|
168
|
+
row += getHeaderCell(comp);
|
|
169
|
+
}, options);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return `<thead><tr>${row}</tr></thead>`;
|
|
173
|
+
}
|
|
174
|
+
_getEmailTableBody(options) {
|
|
175
|
+
const getBodyCell = (component) => {
|
|
176
|
+
if (!component.isInputComponent || !component.visible || component.skipInEmail) {
|
|
177
|
+
return '';
|
|
178
|
+
}
|
|
179
|
+
return `<td style="padding: 5px 10px;">${component.getView(component.dataValue, options)}</td>`;
|
|
180
|
+
};
|
|
181
|
+
const rows = [];
|
|
182
|
+
for (const { components } of this.iteratableRows) {
|
|
183
|
+
let row = '';
|
|
184
|
+
for (const component of components) {
|
|
185
|
+
if (component.isInputComponent) {
|
|
186
|
+
row += getBodyCell(component);
|
|
187
|
+
}
|
|
188
|
+
else if ((0, utils_1.isLayoutComponent)(component) && typeof component.everyComponent === 'function') {
|
|
189
|
+
component.everyComponent((comp) => {
|
|
190
|
+
row += getBodyCell(comp);
|
|
191
|
+
}, options);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
rows.push(`<tr>${row}</tr>`);
|
|
195
|
+
}
|
|
196
|
+
return `<tbody>${rows.join('')}</tbody>`;
|
|
197
|
+
}
|
|
152
198
|
getValueAsString(value, options) {
|
|
153
|
-
var _a;
|
|
154
199
|
if (options === null || options === void 0 ? void 0 : options.email) {
|
|
155
|
-
|
|
200
|
+
return `
|
|
156
201
|
<table border="1" style="width:100%">
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
`);
|
|
160
|
-
(_a = this.component.components) === null || _a === void 0 ? void 0 : _a.forEach((component) => {
|
|
161
|
-
const label = component.label || component.key;
|
|
162
|
-
result += `<th style="padding: 5px 10px;">${label}</th>`;
|
|
163
|
-
});
|
|
164
|
-
result += (`
|
|
165
|
-
</tr>
|
|
166
|
-
</thead>
|
|
167
|
-
<tbody>
|
|
168
|
-
`);
|
|
169
|
-
this.iteratableRows.forEach(({ components }) => {
|
|
170
|
-
result += '<tr>';
|
|
171
|
-
lodash_1.default.each(components, (component) => {
|
|
172
|
-
result += '<td style="padding:5px 10px;">';
|
|
173
|
-
if (component.isInputComponent && component.visible && !component.skipInEmail) {
|
|
174
|
-
result += component.getView(component.dataValue, options);
|
|
175
|
-
}
|
|
176
|
-
result += '</td>';
|
|
177
|
-
});
|
|
178
|
-
result += '</tr>';
|
|
179
|
-
});
|
|
180
|
-
result += (`
|
|
181
|
-
</tbody>
|
|
202
|
+
${this._getEmailTableHeader(options)}
|
|
203
|
+
${this._getEmailTableBody(options)}
|
|
182
204
|
</table>
|
|
183
|
-
|
|
184
|
-
return result;
|
|
205
|
+
`;
|
|
185
206
|
}
|
|
186
207
|
if (!value || !value.length) {
|
|
187
208
|
return '';
|
|
@@ -1,49 +1,79 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
+
let type: string;
|
|
3
|
+
let display: string;
|
|
2
4
|
let components: ({
|
|
3
5
|
label: string;
|
|
4
6
|
tableView: boolean;
|
|
5
|
-
modalEdit: boolean;
|
|
6
|
-
validateWhenHidden: boolean;
|
|
7
7
|
rowDrafts: boolean;
|
|
8
8
|
key: string;
|
|
9
9
|
type: string;
|
|
10
|
-
displayAsTable: boolean;
|
|
11
10
|
input: boolean;
|
|
12
|
-
components:
|
|
13
|
-
|
|
14
|
-
applyMaskOn: string;
|
|
15
|
-
tableView: boolean;
|
|
16
|
-
validate: {
|
|
17
|
-
required: boolean;
|
|
18
|
-
};
|
|
19
|
-
validateWhenHidden: boolean;
|
|
11
|
+
components: {
|
|
12
|
+
collapsible: boolean;
|
|
20
13
|
key: string;
|
|
21
14
|
type: string;
|
|
22
|
-
input: boolean;
|
|
23
|
-
} | {
|
|
24
15
|
label: string;
|
|
25
|
-
applyMaskOn: string;
|
|
26
|
-
tableView: boolean;
|
|
27
|
-
validateWhenHidden: boolean;
|
|
28
|
-
key: string;
|
|
29
|
-
type: string;
|
|
30
16
|
input: boolean;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
|
35
69
|
} | {
|
|
70
|
+
type: string;
|
|
36
71
|
label: string;
|
|
37
|
-
showValidations: boolean;
|
|
38
|
-
tableView: boolean;
|
|
39
72
|
key: string;
|
|
40
|
-
|
|
73
|
+
disableOnInvalid: boolean;
|
|
41
74
|
input: boolean;
|
|
42
|
-
|
|
43
|
-
modalEdit?: undefined;
|
|
44
|
-
validateWhenHidden?: undefined;
|
|
75
|
+
tableView: boolean;
|
|
45
76
|
rowDrafts?: undefined;
|
|
46
|
-
displayAsTable?: undefined;
|
|
47
77
|
components?: undefined;
|
|
48
78
|
})[];
|
|
49
79
|
}
|
|
@@ -1,49 +1,99 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
|
+
type: 'form',
|
|
5
|
+
display: 'form',
|
|
4
6
|
components: [
|
|
5
7
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"displayAsTable": false,
|
|
14
|
-
"input": true,
|
|
15
|
-
"components": [
|
|
8
|
+
label: 'Edit Grid',
|
|
9
|
+
tableView: false,
|
|
10
|
+
rowDrafts: false,
|
|
11
|
+
key: 'editGrid',
|
|
12
|
+
type: 'editgrid',
|
|
13
|
+
input: true,
|
|
14
|
+
components: [
|
|
16
15
|
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
collapsible: false,
|
|
17
|
+
key: 'panel',
|
|
18
|
+
type: 'panel',
|
|
19
|
+
label: 'Panel',
|
|
20
|
+
input: false,
|
|
21
|
+
tableView: false,
|
|
22
|
+
components: [
|
|
23
|
+
{
|
|
24
|
+
label: 'Columns',
|
|
25
|
+
columns: [
|
|
26
|
+
{
|
|
27
|
+
components: [
|
|
28
|
+
{
|
|
29
|
+
label: 'Radio',
|
|
30
|
+
optionsLabelPosition: 'right',
|
|
31
|
+
inline: false,
|
|
32
|
+
tableView: true,
|
|
33
|
+
values: [
|
|
34
|
+
{
|
|
35
|
+
label: 'yes',
|
|
36
|
+
value: 'yes',
|
|
37
|
+
shortcut: ''
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'no',
|
|
41
|
+
value: 'no',
|
|
42
|
+
shortcut: ''
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
key: 'radio',
|
|
46
|
+
type: 'radio',
|
|
47
|
+
input: true
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
width: 6,
|
|
51
|
+
offset: 0,
|
|
52
|
+
push: 0,
|
|
53
|
+
pull: 0,
|
|
54
|
+
size: 'md',
|
|
55
|
+
currentWidth: 6
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
components: [
|
|
59
|
+
{
|
|
60
|
+
label: 'Text Area',
|
|
61
|
+
applyMaskOn: 'change',
|
|
62
|
+
autoExpand: false,
|
|
63
|
+
tableView: true,
|
|
64
|
+
key: 'textArea',
|
|
65
|
+
conditional: {
|
|
66
|
+
show: true,
|
|
67
|
+
conjunction: 'all'
|
|
68
|
+
},
|
|
69
|
+
type: 'textarea',
|
|
70
|
+
input: true
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
width: 6,
|
|
74
|
+
offset: 0,
|
|
75
|
+
push: 0,
|
|
76
|
+
pull: 0,
|
|
77
|
+
size: 'md',
|
|
78
|
+
currentWidth: 6
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
key: 'columns',
|
|
82
|
+
type: 'columns',
|
|
83
|
+
input: false,
|
|
84
|
+
tableView: false
|
|
85
|
+
}
|
|
86
|
+
]
|
|
36
87
|
}
|
|
37
88
|
]
|
|
38
89
|
},
|
|
39
90
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"saveOnEnter": false
|
|
91
|
+
type: 'button',
|
|
92
|
+
label: 'Submit',
|
|
93
|
+
key: 'submit',
|
|
94
|
+
disableOnInvalid: true,
|
|
95
|
+
input: true,
|
|
96
|
+
tableView: false
|
|
47
97
|
}
|
|
48
98
|
]
|
|
49
99
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import comp1 from './comp1';
|
|
2
2
|
import comp2 from './comp2';
|
|
3
3
|
import comp3 from './comp3';
|
|
4
|
-
import comp4 from './comp4';
|
|
5
|
-
import comp5 from './comp5';
|
|
6
|
-
import comp6 from './comp6';
|
|
7
|
-
import comp7 from './comp7';
|
|
8
|
-
import comp8 from './comp8';
|
|
9
|
-
import comp9 from './comp9';
|
|
10
4
|
import comp10 from './comp10';
|
|
11
5
|
import comp11 from './comp11';
|
|
12
6
|
import comp12 from './comp12';
|
|
13
7
|
import comp13 from './comp13';
|
|
14
8
|
import comp14 from './comp14';
|
|
15
9
|
import comp15 from './comp15';
|
|
10
|
+
import comp4 from './comp4';
|
|
11
|
+
import comp5 from './comp5';
|
|
12
|
+
import comp6 from './comp6';
|
|
13
|
+
import comp7 from './comp7';
|
|
14
|
+
import comp8 from './comp8';
|
|
15
|
+
import comp9 from './comp9';
|
|
16
16
|
import comp16 from './comp16';
|
|
17
17
|
import comp17 from './comp17';
|
|
18
18
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
19
19
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
20
20
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
21
21
|
import compTestEvents from './comp-test-events';
|
|
22
|
-
export { comp1, comp2, comp3,
|
|
22
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp17 = exports.comp16 = exports.
|
|
6
|
+
exports.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp17 = exports.comp16 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
8
8
|
exports.comp1 = comp1_1.default;
|
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
|
@@ -295,14 +295,15 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
295
295
|
setItems(items) {
|
|
296
296
|
const listData = [];
|
|
297
297
|
items === null || items === void 0 ? void 0 : items.forEach((item, i) => {
|
|
298
|
+
const valueAtProperty = lodash_1.default.get(item, this.component.valueProperty);
|
|
298
299
|
this.loadedOptions[i] = {
|
|
299
|
-
value: this.component.valueProperty ?
|
|
300
|
-
label: this.component.valueProperty ? this.itemTemplate(item,
|
|
300
|
+
value: this.component.valueProperty ? valueAtProperty : item,
|
|
301
|
+
label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
|
|
301
302
|
};
|
|
302
|
-
listData.push(this.templateData[this.component.valueProperty ?
|
|
303
|
-
if ((this.component.valueProperty || !this.isRadio) && (lodash_1.default.isUndefined(
|
|
304
|
-
(!this.isRadio && lodash_1.default.isObject(
|
|
305
|
-
(!this.isRadio && lodash_1.default.isBoolean(
|
|
303
|
+
listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
|
|
304
|
+
if ((this.component.valueProperty || !this.isRadio) && (lodash_1.default.isUndefined(valueAtProperty) ||
|
|
305
|
+
(!this.isRadio && lodash_1.default.isObject(valueAtProperty)) ||
|
|
306
|
+
(!this.isRadio && lodash_1.default.isBoolean(valueAtProperty)))) {
|
|
306
307
|
this.loadedOptions[i].invalid = true;
|
|
307
308
|
}
|
|
308
309
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: {
|
|
3
|
+
label: string;
|
|
4
|
+
optionsLabelPosition: string;
|
|
5
|
+
tableView: boolean;
|
|
6
|
+
dataSrc: string;
|
|
7
|
+
values: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
shortcut: string;
|
|
11
|
+
}[];
|
|
12
|
+
valueProperty: string;
|
|
13
|
+
validateWhenHidden: boolean;
|
|
14
|
+
key: string;
|
|
15
|
+
type: string;
|
|
16
|
+
data: {
|
|
17
|
+
url: string;
|
|
18
|
+
headers: {
|
|
19
|
+
key: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
template: string;
|
|
24
|
+
authenticate: boolean;
|
|
25
|
+
input: boolean;
|
|
26
|
+
inputType: string;
|
|
27
|
+
}[];
|
|
28
|
+
}
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
"label": "Select Boxes",
|
|
7
|
+
"optionsLabelPosition": "right",
|
|
8
|
+
"tableView": false,
|
|
9
|
+
"dataSrc": "url",
|
|
10
|
+
"values": [
|
|
11
|
+
{
|
|
12
|
+
"label": "",
|
|
13
|
+
"value": "",
|
|
14
|
+
"shortcut": ""
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"valueProperty": "data.name",
|
|
18
|
+
"validateWhenHidden": false,
|
|
19
|
+
"key": "selectBoxes",
|
|
20
|
+
"type": "selectboxes",
|
|
21
|
+
"data": {
|
|
22
|
+
"url": "https://remote-dev.form.io/projectId/name/submission",
|
|
23
|
+
"headers": [
|
|
24
|
+
{
|
|
25
|
+
"key": "",
|
|
26
|
+
"value": ""
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"template": "<span>{{ item.data.name }}</span>",
|
|
31
|
+
"authenticate": true,
|
|
32
|
+
"input": true,
|
|
33
|
+
"inputType": "checkbox"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
@@ -9,4 +9,5 @@ import comp8 from './comp8';
|
|
|
9
9
|
import comp9 from './comp9';
|
|
10
10
|
import comp10 from './comp10';
|
|
11
11
|
import comp11 from './comp11';
|
|
12
|
-
|
|
12
|
+
import comp12 from './comp12';
|
|
13
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
8
8
|
exports.comp1 = comp1_1.default;
|
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
|
@@ -26,3 +26,5 @@ const comp10_1 = __importDefault(require("./comp10"));
|
|
|
26
26
|
exports.comp10 = comp10_1.default;
|
|
27
27
|
const comp11_1 = __importDefault(require("./comp11"));
|
|
28
28
|
exports.comp11 = comp11_1.default;
|
|
29
|
+
const comp12_1 = __importDefault(require("./comp12"));
|
|
30
|
+
exports.comp12 = comp12_1.default;
|
package/lib/mjs/PDF.js
CHANGED
|
@@ -65,7 +65,7 @@ export default class PDF extends Webform {
|
|
|
65
65
|
super.destroy(all);
|
|
66
66
|
}
|
|
67
67
|
rebuild() {
|
|
68
|
-
if (this.
|
|
68
|
+
if (this.builderMode && this.component.components) {
|
|
69
69
|
this.destroyComponents();
|
|
70
70
|
this.addComponents();
|
|
71
71
|
return Promise.resolve();
|
|
@@ -892,7 +892,11 @@ export default class WebformBuilder extends Component {
|
|
|
892
892
|
if (form && form.properties) {
|
|
893
893
|
this.options.properties = form.properties;
|
|
894
894
|
}
|
|
895
|
-
|
|
895
|
+
let keyboardActionsEnabled = _.get(this.options, 'keyboardBuilder', false) || this.options.properties?.keyboardBuilder;
|
|
896
|
+
if (typeof keyboardActionsEnabled === 'string') {
|
|
897
|
+
keyboardActionsEnabled = keyboardActionsEnabled === 'true';
|
|
898
|
+
}
|
|
899
|
+
this.keyboardActionsEnabled = keyboardActionsEnabled;
|
|
896
900
|
const isShowSubmitButton = !this.options.noDefaultSubmitButton
|
|
897
901
|
&& (!form.components.length || !form.components.find(comp => comp.key === 'submit'));
|
|
898
902
|
// Ensure there is at least a submit button.
|
|
@@ -1044,7 +1048,10 @@ export default class WebformBuilder extends Component {
|
|
|
1044
1048
|
'calculateValue',
|
|
1045
1049
|
'conditional',
|
|
1046
1050
|
'customConditional',
|
|
1047
|
-
'id'
|
|
1051
|
+
'id',
|
|
1052
|
+
'fields.day.required',
|
|
1053
|
+
'fields.month.required',
|
|
1054
|
+
'fields.year.required',
|
|
1048
1055
|
]));
|
|
1049
1056
|
const parentComponent = defaultValueComponent.parent;
|
|
1050
1057
|
let tabIndex = -1;
|
|
@@ -1231,6 +1238,7 @@ export default class WebformBuilder extends Component {
|
|
|
1231
1238
|
helplinks: this.helplinks,
|
|
1232
1239
|
}));
|
|
1233
1240
|
this.editForm.attach(this.componentEdit.querySelector(`[${this._referenceAttributeName}="editForm"]`));
|
|
1241
|
+
this.updateComponent(this.editForm.submission.data ?? component);
|
|
1234
1242
|
this.attachEditComponentControls(component, parent, isNew, original, ComponentClass);
|
|
1235
1243
|
});
|
|
1236
1244
|
});
|
|
@@ -12,6 +12,8 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
|
12
12
|
hasAddButton(): any;
|
|
13
13
|
getComponent(path: any, fn: any, originalPath: any): any;
|
|
14
14
|
everyComponent(fn: any, rowIndex: any, options?: {}): void;
|
|
15
|
+
_getEmailTableHeader(options: any): string;
|
|
16
|
+
_getEmailTableBody(options: any): string;
|
|
15
17
|
getComponents(rowIndex: any): any;
|
|
16
18
|
}
|
|
17
19
|
import NestedDataComponent from '../nesteddata/NestedDataComponent';
|