@formio/js 5.0.0-dev.5695.024ad9c → 5.0.0-dev.5703.20a26ed
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 +11 -0
- package/dist/formio.builder.css +0 -1
- 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.form.css +0 -1
- package/dist/formio.form.js +64 -120
- 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 +45 -25
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +2 -2
- 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/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +1 -0
- package/lib/cjs/Webform.js +4 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/cjs/components/_classes/component/Component.js +18 -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/DataGrid.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.js +38 -26
- 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/datamap/DataMap.js +2 -2
- 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 +12 -1
- 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/index.d.ts +3 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +5 -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/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +1 -0
- package/lib/mjs/Webform.js +4 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/mjs/components/_classes/component/Component.js +7 -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/DataGrid.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.js +37 -25
- 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/datamap/DataMap.js +1 -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 +12 -1
- 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/index.d.ts +3 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +3 -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
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
|
|
3
3
|
import { fastCloneDeep, getFocusableElements } from '../../utils/utils';
|
|
4
|
-
import
|
|
5
|
-
import dragula from 'dragula';
|
|
4
|
+
import Components from '../Components';
|
|
6
5
|
export default class DataGridComponent extends NestedArrayComponent {
|
|
7
6
|
static schema(...extend) {
|
|
8
7
|
return NestedArrayComponent.schema({
|
|
@@ -39,6 +38,9 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
39
38
|
if (this.initRows || !_.isEqual(this.dataValue, this.emptyValue)) {
|
|
40
39
|
this.createRows(true);
|
|
41
40
|
}
|
|
41
|
+
if (this.allowReorder) {
|
|
42
|
+
this.dragulaReady = this.getDragula();
|
|
43
|
+
}
|
|
42
44
|
this.visibleColumns = {};
|
|
43
45
|
this.prevHasAddButton = this.hasAddButton();
|
|
44
46
|
this.checkColumns();
|
|
@@ -279,31 +281,25 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
279
281
|
this.refs[`${this.datagridKey}-row`].forEach((row, index) => {
|
|
280
282
|
row.dragInfo = { index };
|
|
281
283
|
});
|
|
282
|
-
this.dragula
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
284
|
+
this.dragulaReady.then((dragula) => {
|
|
285
|
+
// The drop event may call redraw twice which calls attach twice and because this block of code is asynchronous
|
|
286
|
+
// BOTH redraws may be called before this block of code runs (which causes this block of code to run twice sequentially).
|
|
287
|
+
// This causes two dragula() calls on the same container which breaks dragula. To fix this the return value must
|
|
288
|
+
// be saved in this.dragula and have its container contents reset if it exists
|
|
289
|
+
if (this.dragula && this.dragula.containers) {
|
|
290
|
+
this.dragula.containers = [];
|
|
290
291
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (
|
|
297
|
-
|
|
292
|
+
this.dragula = dragula([this.refs[`${this.datagridKey}-tbody`]], {
|
|
293
|
+
moves: (_draggedElement, _oldParent, clickedElement) => {
|
|
294
|
+
const clickedElementKey = clickedElement.getAttribute('data-key');
|
|
295
|
+
const oldParentKey = _oldParent.getAttribute('data-key');
|
|
296
|
+
//Check if the clicked button belongs to that container, if false, it belongs to the nested container
|
|
297
|
+
if (oldParentKey === clickedElementKey) {
|
|
298
|
+
return clickedElement.classList.contains('formio-drag-button');
|
|
298
299
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}, '');
|
|
303
|
-
el.children[index].style.cssText = cssText;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
}
|
|
300
|
+
}
|
|
301
|
+
}).on('drop', this.onReorder.bind(this))
|
|
302
|
+
.on('cloned', this.onCloned.bind(this));
|
|
307
303
|
});
|
|
308
304
|
}
|
|
309
305
|
this.refs[`${this.datagridKey}-addRow`].forEach((addButton) => {
|
|
@@ -370,6 +366,22 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
370
366
|
this.setValue(dataValue, { isReordered: true });
|
|
371
367
|
this.rebuild();
|
|
372
368
|
}
|
|
369
|
+
onCloned(el, original) {
|
|
370
|
+
if (el && el.children && original && original.children) {
|
|
371
|
+
_.each(original.children, (child, index) => {
|
|
372
|
+
const styles = getComputedStyle(child, null);
|
|
373
|
+
if (styles.cssText !== '') {
|
|
374
|
+
el.children[index].style.cssText = styles.cssText;
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
const cssText = Object.values(styles).reduce((css, propertyName) => {
|
|
378
|
+
return `${css}${propertyName}:${styles.getPropertyValue(propertyName)};`;
|
|
379
|
+
}, '');
|
|
380
|
+
el.children[index].style.cssText = cssText;
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
373
385
|
focusOnNewRowElement(row) {
|
|
374
386
|
Object.keys(row).find((key) => {
|
|
375
387
|
const element = row[key].element;
|
|
@@ -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 };
|
|
@@ -3,7 +3,7 @@ import DataGridComponent from '../datagrid/DataGrid';
|
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import EventEmitter from 'eventemitter3';
|
|
5
5
|
import { componentValueTypes, getComponentSavedTypes, uniqueKey } from '../../utils/utils';
|
|
6
|
-
import
|
|
6
|
+
import Components from '../Components';
|
|
7
7
|
export default class DataMapComponent extends DataGridComponent {
|
|
8
8
|
static schema(...extend) {
|
|
9
9
|
return Component.schema({
|
|
@@ -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
|
}
|
|
@@ -1079,7 +1089,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1079
1089
|
return false;
|
|
1080
1090
|
}
|
|
1081
1091
|
else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {
|
|
1082
|
-
this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1092
|
+
this._errors = this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1093
|
+
errors.push(...this._errors);
|
|
1083
1094
|
return false;
|
|
1084
1095
|
}
|
|
1085
1096
|
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
|
+
};
|
|
@@ -13,7 +13,9 @@ import comp6 from './comp6';
|
|
|
13
13
|
import comp7 from './comp7';
|
|
14
14
|
import comp8 from './comp8';
|
|
15
15
|
import comp9 from './comp9';
|
|
16
|
+
import comp16 from './comp16';
|
|
16
17
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
17
18
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
18
19
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
19
|
-
|
|
20
|
+
import compTestEvents from './comp-test-events';
|
|
21
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|