@formio/js 5.0.0-dev.5695.024ad9c → 5.0.0-dev.5702.41702de
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/formio.builder.css +0 -1
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.form.css +0 -1
- package/dist/formio.form.js +61 -21
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.css +0 -1
- package/dist/formio.full.js +41 -21
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +57 -17
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Webform.js +4 -0
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
- package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -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/day/fixtures/comp8.d.ts +41 -0
- package/lib/cjs/components/day/fixtures/comp8.js +40 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.js +10 -0
- 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/index.d.ts +2 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/cjs/translations/en.d.ts +3 -0
- package/lib/cjs/translations/en.js +4 -1
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +4 -3
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
- package/lib/cjs/utils/utils.d.ts +1 -10
- package/lib/cjs/utils/utils.js +59 -7
- package/lib/mjs/Webform.js +4 -0
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
- package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -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/day/fixtures/comp8.d.ts +41 -0
- package/lib/mjs/components/day/fixtures/comp8.js +38 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.js +10 -0
- 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/index.d.ts +2 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +2 -1
- package/lib/mjs/translations/en.d.ts +3 -0
- package/lib/mjs/translations/en.js +4 -1
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +3 -3
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
- package/lib/mjs/utils/utils.d.ts +1 -10
- package/lib/mjs/utils/utils.js +58 -7
- package/package.json +2 -2
package/lib/cjs/utils/utils.d.ts
CHANGED
|
@@ -56,16 +56,7 @@ export function isMongoId(text: string): boolean;
|
|
|
56
56
|
* @param {*} rowData - The contextual row data for the component.
|
|
57
57
|
*/
|
|
58
58
|
export function checkCalculated(component: import('@formio/core').Component, submission: import('@formio/core').Submission, rowData: any): void;
|
|
59
|
-
|
|
60
|
-
* Check if a simple conditional evaluates to true.
|
|
61
|
-
* @param {import('@formio/core').Component} component - The component to check for the conditional.
|
|
62
|
-
* @param {import('@formio/core').SimpleConditional} condition - The condition to check.
|
|
63
|
-
* @param {*} row - The row data for the component.
|
|
64
|
-
* @param {*} data - The full submission data.
|
|
65
|
-
* @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
|
|
66
|
-
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
|
67
|
-
*/
|
|
68
|
-
export function checkSimpleConditional(component: import('@formio/core').Component, condition: import('@formio/core').SimpleConditional, row: any, data: any, instance: any): boolean;
|
|
59
|
+
export function checkSimpleConditional(component: any, condition: any, row: any, data: any, instance: any): boolean;
|
|
69
60
|
/**
|
|
70
61
|
* Returns a components normalized value.
|
|
71
62
|
* @param {string} compPath - The full path to the component.
|
package/lib/cjs/utils/utils.js
CHANGED
|
@@ -190,6 +190,44 @@ exports.checkCalculated = checkCalculated;
|
|
|
190
190
|
* @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
|
|
191
191
|
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
|
192
192
|
*/
|
|
193
|
+
function getConditionalPathsRecursive(conditionPaths, data) {
|
|
194
|
+
let currentGlobalIndex = 0;
|
|
195
|
+
const conditionalPathsArray = [];
|
|
196
|
+
const getConditionalPaths = (data, currentPath = '', localIndex = 0) => {
|
|
197
|
+
currentPath = currentPath.replace(/^\.+|\.+$/g, '');
|
|
198
|
+
const currentLocalIndex = localIndex;
|
|
199
|
+
const currentData = lodash_1.default.get(data, currentPath);
|
|
200
|
+
if (Array.isArray(currentData) && currentData.filter(Boolean).length > 0) {
|
|
201
|
+
if (currentData.some(element => typeof element !== 'object')) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const hasInnerDataArray = currentData.find(x => Array.isArray(x[conditionPaths[currentLocalIndex]]));
|
|
205
|
+
if (hasInnerDataArray) {
|
|
206
|
+
currentData.forEach((_, indexOutside) => {
|
|
207
|
+
const innerCompDataPath = `${currentPath}[${indexOutside}].${conditionPaths[currentLocalIndex]}`;
|
|
208
|
+
getConditionalPaths(data, innerCompDataPath, currentLocalIndex + 1);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
currentData.forEach((x, index) => {
|
|
213
|
+
if (!lodash_1.default.isNil(x[conditionPaths[currentLocalIndex]])) {
|
|
214
|
+
const compDataPath = `${currentPath}[${index}].${conditionPaths[currentLocalIndex]}`;
|
|
215
|
+
conditionalPathsArray.push(compDataPath);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
if (!conditionPaths[currentGlobalIndex]) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
currentGlobalIndex = currentGlobalIndex + 1;
|
|
225
|
+
getConditionalPaths(data, `${currentPath}.${conditionPaths[currentGlobalIndex - 1]}`, currentGlobalIndex);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
getConditionalPaths(data);
|
|
229
|
+
return conditionalPathsArray;
|
|
230
|
+
}
|
|
193
231
|
function checkSimpleConditional(component, condition, row, data, instance) {
|
|
194
232
|
if (condition.when) {
|
|
195
233
|
const value = getComponentActualValue(condition.when, data, row);
|
|
@@ -211,23 +249,37 @@ function checkSimpleConditional(component, condition, row, data, instance) {
|
|
|
211
249
|
return true;
|
|
212
250
|
}
|
|
213
251
|
const conditionsResult = lodash_1.default.map(conditions, (cond) => {
|
|
252
|
+
var _a, _b;
|
|
214
253
|
const { value: comparedValue, operator, component: conditionComponentPath } = cond;
|
|
215
254
|
if (!conditionComponentPath) {
|
|
216
255
|
return true;
|
|
217
256
|
}
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
257
|
+
const splittedConditionPath = conditionComponentPath.split('.');
|
|
258
|
+
const conditionalPaths = ((_a = instance === null || instance === void 0 ? void 0 : instance.parent) === null || _a === void 0 ? void 0 : _a.type) === 'datagrid' || ((_b = instance === null || instance === void 0 ? void 0 : instance.parent) === null || _b === void 0 ? void 0 : _b.type) === 'editgrid' ? [] : getConditionalPathsRecursive(splittedConditionPath, data);
|
|
259
|
+
if (conditionalPaths.length > 0) {
|
|
260
|
+
return conditionalPaths.map((path) => {
|
|
261
|
+
const value = getComponentActualValue(path, data, row);
|
|
262
|
+
const ConditionOperator = conditionOperators_1.default[operator];
|
|
263
|
+
return ConditionOperator
|
|
264
|
+
? new ConditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
|
|
265
|
+
: true;
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
const value = getComponentActualValue(conditionComponentPath, data, row);
|
|
270
|
+
const СonditionOperator = conditionOperators_1.default[operator];
|
|
271
|
+
return СonditionOperator
|
|
272
|
+
? new СonditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
|
|
273
|
+
: true;
|
|
274
|
+
}
|
|
223
275
|
});
|
|
224
276
|
let result = false;
|
|
225
277
|
switch (conjunction) {
|
|
226
278
|
case 'any':
|
|
227
|
-
result = lodash_1.default.some(conditionsResult, res => !!res);
|
|
279
|
+
result = lodash_1.default.some(conditionsResult.flat(), res => !!res);
|
|
228
280
|
break;
|
|
229
281
|
default:
|
|
230
|
-
result = lodash_1.default.every(conditionsResult, res => !!res);
|
|
282
|
+
result = lodash_1.default.every(conditionsResult.flat(), res => !!res);
|
|
231
283
|
}
|
|
232
284
|
return show ? result : !result;
|
|
233
285
|
}
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -8,6 +8,10 @@ import Components from "./components/Components";
|
|
|
8
8
|
import NestedDataComponent from "./components/_classes/nesteddata/NestedDataComponent";
|
|
9
9
|
import { fastCloneDeep, currentTimezone, unescapeHTML, getStringFromComponentPath, convertStringToHTMLElement, getArrayFromComponentPath, } from "./utils/utils";
|
|
10
10
|
import { eachComponent } from "./utils/formUtils";
|
|
11
|
+
// We need this here because dragula pulls in CustomEvent class that requires global to exist.
|
|
12
|
+
if (typeof window !== 'undefined' && typeof window.global === 'undefined') {
|
|
13
|
+
window.global = window;
|
|
14
|
+
}
|
|
11
15
|
import dragula from "dragula";
|
|
12
16
|
// Initialize the available forms.
|
|
13
17
|
Formio.forms = {};
|
|
@@ -43,7 +43,7 @@ export default class CheckBoxComponent extends Field {
|
|
|
43
43
|
attach(element: any): Promise<void>;
|
|
44
44
|
input: any;
|
|
45
45
|
detach(element: any): void;
|
|
46
|
-
get emptyValue(): false |
|
|
46
|
+
get emptyValue(): false | "";
|
|
47
47
|
getValueAt(index: any): any;
|
|
48
48
|
get checked(): boolean;
|
|
49
49
|
setCheckedState(value: any): any;
|
|
@@ -116,7 +116,7 @@ export default class CheckBoxComponent extends Field {
|
|
|
116
116
|
super.detach();
|
|
117
117
|
}
|
|
118
118
|
get emptyValue() {
|
|
119
|
-
return this.component.inputType === 'radio' ?
|
|
119
|
+
return this.component.inputType === 'radio' ? '' : false;
|
|
120
120
|
}
|
|
121
121
|
isEmpty(value = this.dataValue) {
|
|
122
122
|
return super.isEmpty(value) || value === false;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let name: string;
|
|
3
|
+
let path: string;
|
|
4
|
+
let type: string;
|
|
5
|
+
let display: string;
|
|
6
|
+
let components: ({
|
|
7
|
+
label: string;
|
|
8
|
+
inputType: string;
|
|
9
|
+
tableView: boolean;
|
|
10
|
+
defaultValue: boolean;
|
|
11
|
+
key: string;
|
|
12
|
+
type: string;
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
input: boolean;
|
|
16
|
+
'some name': boolean;
|
|
17
|
+
disableOnInvalid?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
type: string;
|
|
20
|
+
label: string;
|
|
21
|
+
key: string;
|
|
22
|
+
disableOnInvalid: boolean;
|
|
23
|
+
input: boolean;
|
|
24
|
+
tableView: boolean;
|
|
25
|
+
inputType?: undefined;
|
|
26
|
+
defaultValue?: undefined;
|
|
27
|
+
name?: undefined;
|
|
28
|
+
value?: undefined;
|
|
29
|
+
'some name'?: undefined;
|
|
30
|
+
})[];
|
|
31
|
+
}
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: 'ckeckbox',
|
|
3
|
+
path: 'ckeckbox',
|
|
4
|
+
type: 'form',
|
|
5
|
+
display: 'form',
|
|
6
|
+
components: [
|
|
7
|
+
{
|
|
8
|
+
label: 'Checkbox',
|
|
9
|
+
inputType: 'radio',
|
|
10
|
+
tableView: false,
|
|
11
|
+
defaultValue: false,
|
|
12
|
+
key: 'checkbox',
|
|
13
|
+
type: 'checkbox',
|
|
14
|
+
name: 'some name',
|
|
15
|
+
value: 'ok',
|
|
16
|
+
input: true,
|
|
17
|
+
'some name': false
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'button',
|
|
21
|
+
label: 'Submit',
|
|
22
|
+
key: 'submit',
|
|
23
|
+
disableOnInvalid: true,
|
|
24
|
+
input: true,
|
|
25
|
+
tableView: false
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
};
|
|
@@ -3,5 +3,6 @@ import comp2 from './comp2';
|
|
|
3
3
|
import comp3 from './comp3';
|
|
4
4
|
import comp4 from './comp4';
|
|
5
5
|
import comp5 from './comp5';
|
|
6
|
+
import comp6 from './comp6';
|
|
6
7
|
import customDefaultComponent from './customDefaultComponent';
|
|
7
|
-
export { comp1, comp2, comp3, comp4, comp5, customDefaultComponent };
|
|
8
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, customDefaultComponent };
|
|
@@ -4,4 +4,5 @@ import comp2 from './comp2';
|
|
|
4
4
|
import comp3 from './comp3';
|
|
5
5
|
import comp4 from './comp4';
|
|
6
6
|
import comp5 from './comp5';
|
|
7
|
-
|
|
7
|
+
import comp6 from './comp6';
|
|
8
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, customDefaultComponent };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let title: string;
|
|
3
|
+
let name: string;
|
|
4
|
+
let path: string;
|
|
5
|
+
let type: string;
|
|
6
|
+
let display: string;
|
|
7
|
+
let components: ({
|
|
8
|
+
label: string;
|
|
9
|
+
reorder: boolean;
|
|
10
|
+
addAnotherPosition: string;
|
|
11
|
+
layoutFixed: boolean;
|
|
12
|
+
enableRowGroups: boolean;
|
|
13
|
+
initEmpty: boolean;
|
|
14
|
+
tableView: boolean;
|
|
15
|
+
defaultValue: {}[];
|
|
16
|
+
validate: {
|
|
17
|
+
required: boolean;
|
|
18
|
+
};
|
|
19
|
+
key: string;
|
|
20
|
+
type: string;
|
|
21
|
+
input: boolean;
|
|
22
|
+
components: {
|
|
23
|
+
label: string;
|
|
24
|
+
columns: ({
|
|
25
|
+
components: {
|
|
26
|
+
label: string;
|
|
27
|
+
applyMaskOn: string;
|
|
28
|
+
tableView: boolean;
|
|
29
|
+
key: string;
|
|
30
|
+
type: string;
|
|
31
|
+
input: boolean;
|
|
32
|
+
}[];
|
|
33
|
+
width: number;
|
|
34
|
+
offset: number;
|
|
35
|
+
push: number;
|
|
36
|
+
pull: number;
|
|
37
|
+
size: string;
|
|
38
|
+
currentWidth: number;
|
|
39
|
+
} | {
|
|
40
|
+
components: {
|
|
41
|
+
label: string;
|
|
42
|
+
tableView: boolean;
|
|
43
|
+
key: string;
|
|
44
|
+
type: string;
|
|
45
|
+
input: boolean;
|
|
46
|
+
}[];
|
|
47
|
+
width: number;
|
|
48
|
+
offset: number;
|
|
49
|
+
push: number;
|
|
50
|
+
pull: number;
|
|
51
|
+
size: string;
|
|
52
|
+
currentWidth: number;
|
|
53
|
+
})[];
|
|
54
|
+
key: string;
|
|
55
|
+
type: string;
|
|
56
|
+
input: boolean;
|
|
57
|
+
tableView: boolean;
|
|
58
|
+
}[];
|
|
59
|
+
disableOnInvalid?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
type: string;
|
|
62
|
+
label: string;
|
|
63
|
+
key: string;
|
|
64
|
+
disableOnInvalid: boolean;
|
|
65
|
+
input: boolean;
|
|
66
|
+
tableView: boolean;
|
|
67
|
+
reorder?: undefined;
|
|
68
|
+
addAnotherPosition?: undefined;
|
|
69
|
+
layoutFixed?: undefined;
|
|
70
|
+
enableRowGroups?: undefined;
|
|
71
|
+
initEmpty?: undefined;
|
|
72
|
+
defaultValue?: undefined;
|
|
73
|
+
validate?: undefined;
|
|
74
|
+
components?: undefined;
|
|
75
|
+
})[];
|
|
76
|
+
let pdfComponents: never[];
|
|
77
|
+
namespace settings {
|
|
78
|
+
let logs: string;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'randomName',
|
|
3
|
+
name: 'randomName',
|
|
4
|
+
path: 'randomName',
|
|
5
|
+
type: 'form',
|
|
6
|
+
display: 'form',
|
|
7
|
+
components: [
|
|
8
|
+
{
|
|
9
|
+
label: 'Data Grid',
|
|
10
|
+
reorder: false,
|
|
11
|
+
addAnotherPosition: 'bottom',
|
|
12
|
+
layoutFixed: false,
|
|
13
|
+
enableRowGroups: false,
|
|
14
|
+
initEmpty: false,
|
|
15
|
+
tableView: false,
|
|
16
|
+
defaultValue: [
|
|
17
|
+
{}
|
|
18
|
+
],
|
|
19
|
+
validate: {
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
key: 'dataGrid',
|
|
23
|
+
type: 'datagrid',
|
|
24
|
+
input: true,
|
|
25
|
+
components: [
|
|
26
|
+
{
|
|
27
|
+
label: 'Columns',
|
|
28
|
+
columns: [
|
|
29
|
+
{
|
|
30
|
+
components: [
|
|
31
|
+
{
|
|
32
|
+
label: 'Text Field',
|
|
33
|
+
applyMaskOn: 'change',
|
|
34
|
+
tableView: true,
|
|
35
|
+
key: 'textField',
|
|
36
|
+
type: 'textfield',
|
|
37
|
+
input: true
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
width: 6,
|
|
41
|
+
offset: 0,
|
|
42
|
+
push: 0,
|
|
43
|
+
pull: 0,
|
|
44
|
+
size: 'md',
|
|
45
|
+
currentWidth: 6
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
components: [
|
|
49
|
+
{
|
|
50
|
+
label: 'Checkbox',
|
|
51
|
+
tableView: false,
|
|
52
|
+
key: 'checkbox',
|
|
53
|
+
type: 'checkbox',
|
|
54
|
+
input: true
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
width: 6,
|
|
58
|
+
offset: 0,
|
|
59
|
+
push: 0,
|
|
60
|
+
pull: 0,
|
|
61
|
+
size: 'md',
|
|
62
|
+
currentWidth: 6
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
key: 'columns',
|
|
66
|
+
type: 'columns',
|
|
67
|
+
input: false,
|
|
68
|
+
tableView: false
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'button',
|
|
74
|
+
label: 'Submit',
|
|
75
|
+
key: 'submit',
|
|
76
|
+
disableOnInvalid: true,
|
|
77
|
+
input: true,
|
|
78
|
+
tableView: false
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
pdfComponents: [],
|
|
82
|
+
settings: {
|
|
83
|
+
logs: 'true'
|
|
84
|
+
}
|
|
85
|
+
};
|
|
@@ -7,6 +7,7 @@ import comp6 from './comp6';
|
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
9
|
import comp9 from './comp9';
|
|
10
|
+
import comp10 from './comp10';
|
|
10
11
|
import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
|
11
12
|
import withConditionalFieldsAndValidations from './comp-with-conditional-components-and-validations';
|
|
12
13
|
import withDefValue from './comp-with-def-value';
|
|
@@ -17,4 +18,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
|
17
18
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
18
19
|
import withCheckboxes from './comp-with-checkboxes';
|
|
19
20
|
import withReorder from './comp-with-reorder';
|
|
20
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
21
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
@@ -7,6 +7,7 @@ import comp6 from './comp6';
|
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
9
|
import comp9 from './comp9';
|
|
10
|
+
import comp10 from './comp10';
|
|
10
11
|
import withDefValue from './comp-with-def-value';
|
|
11
12
|
import withRowGroupsAndDefValue from './comp-row-groups-with-def-value';
|
|
12
13
|
import modalWithRequiredFields from './comp-modal-with-required-fields';
|
|
@@ -17,4 +18,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
|
17
18
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
18
19
|
import withCheckboxes from './comp-with-checkboxes';
|
|
19
20
|
import withReorder from './comp-with-reorder';
|
|
20
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
21
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: ({
|
|
3
|
+
label: string;
|
|
4
|
+
hideInputLabels: boolean;
|
|
5
|
+
inputsLabelPosition: string;
|
|
6
|
+
useLocaleSettings: boolean;
|
|
7
|
+
alwaysEnabled: boolean;
|
|
8
|
+
tableView: boolean;
|
|
9
|
+
fields: {
|
|
10
|
+
day: {
|
|
11
|
+
hide: boolean;
|
|
12
|
+
required: boolean;
|
|
13
|
+
};
|
|
14
|
+
month: {
|
|
15
|
+
hide: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
};
|
|
18
|
+
year: {
|
|
19
|
+
hide: boolean;
|
|
20
|
+
required: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
key: string;
|
|
24
|
+
type: string;
|
|
25
|
+
input: boolean;
|
|
26
|
+
showValidations?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
label: string;
|
|
29
|
+
showValidations: boolean;
|
|
30
|
+
alwaysEnabled: boolean;
|
|
31
|
+
tableView: boolean;
|
|
32
|
+
key: string;
|
|
33
|
+
type: string;
|
|
34
|
+
input: boolean;
|
|
35
|
+
hideInputLabels?: undefined;
|
|
36
|
+
inputsLabelPosition?: undefined;
|
|
37
|
+
useLocaleSettings?: undefined;
|
|
38
|
+
fields?: undefined;
|
|
39
|
+
})[];
|
|
40
|
+
}
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"label": "Day - Table",
|
|
5
|
+
"hideInputLabels": false,
|
|
6
|
+
"inputsLabelPosition": "top",
|
|
7
|
+
"useLocaleSettings": false,
|
|
8
|
+
"alwaysEnabled": false,
|
|
9
|
+
"tableView": false,
|
|
10
|
+
"fields": {
|
|
11
|
+
"day": {
|
|
12
|
+
"hide": false,
|
|
13
|
+
"required": true
|
|
14
|
+
},
|
|
15
|
+
"month": {
|
|
16
|
+
"hide": false,
|
|
17
|
+
"required": true
|
|
18
|
+
},
|
|
19
|
+
"year": {
|
|
20
|
+
"hide": false,
|
|
21
|
+
"required": true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"key": "dayTable",
|
|
25
|
+
"type": "day",
|
|
26
|
+
"input": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "Submit",
|
|
30
|
+
"showValidations": false,
|
|
31
|
+
"alwaysEnabled": false,
|
|
32
|
+
"tableView": false,
|
|
33
|
+
"key": "submit",
|
|
34
|
+
"type": "button",
|
|
35
|
+
"input": true
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
@@ -5,4 +5,5 @@ import comp4 from './comp4';
|
|
|
5
5
|
import comp5 from './comp5';
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
|
-
|
|
8
|
+
import comp8 from './comp8';
|
|
9
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8 };
|
|
@@ -5,4 +5,5 @@ import comp4 from './comp4';
|
|
|
5
5
|
import comp5 from './comp5';
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
|
-
|
|
8
|
+
import comp8 from './comp8';
|
|
9
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8 };
|
|
@@ -672,6 +672,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
672
672
|
}
|
|
673
673
|
},
|
|
674
674
|
}, this.component.saveRow || 'Save'));
|
|
675
|
+
this.emit('editGridOpenModal', {
|
|
676
|
+
component: this.component,
|
|
677
|
+
row: editRow,
|
|
678
|
+
instance: this,
|
|
679
|
+
});
|
|
675
680
|
return this.attachComponents(modalContent, components);
|
|
676
681
|
}
|
|
677
682
|
showDialog(rowIndex) {
|
|
@@ -729,6 +734,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
729
734
|
editRow.data = dataSnapshot;
|
|
730
735
|
this.restoreRowContext(editRow);
|
|
731
736
|
}
|
|
737
|
+
this.emit('editGridEditRow', {
|
|
738
|
+
component: this.component,
|
|
739
|
+
row: editRow,
|
|
740
|
+
instance: this,
|
|
741
|
+
});
|
|
732
742
|
if (this.component.modal) {
|
|
733
743
|
return this.addRowModal(rowIndex);
|
|
734
744
|
}
|
|
@@ -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
|
+
};
|
|
@@ -16,4 +16,5 @@ import comp9 from './comp9';
|
|
|
16
16
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
17
17
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
18
18
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
19
|
-
|
|
19
|
+
import compTestEvents from './comp-test-events';
|
|
20
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -16,4 +16,5 @@ import comp15 from './comp15';
|
|
|
16
16
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
17
17
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
18
18
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
19
|
-
|
|
19
|
+
import compTestEvents from './comp-test-events';
|
|
20
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|