@formio/js 5.0.0-dev.5661.22d0f16 → 5.0.0-dev.5664.50b8944
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 +21 -2
- package/dist/formio.form.js +111 -15
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +15 -15
- 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 +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Formio.js +1 -0
- package/lib/cjs/Webform.d.ts +7 -0
- package/lib/cjs/Webform.js +18 -5
- package/lib/cjs/components/_classes/component/Component.d.ts +13 -0
- package/lib/cjs/components/_classes/component/Component.js +27 -13
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.js +86 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/_classes/input/Input.js +23 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +8 -1
- package/lib/cjs/components/datagrid/DataGrid.d.ts +9 -0
- package/lib/cjs/components/datagrid/DataGrid.js +50 -32
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +139 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.js +44 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +5 -1
- package/lib/cjs/components/day/Day.d.ts +1 -1
- package/lib/cjs/components/day/Day.js +1 -1
- package/lib/cjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/cjs/components/day/fixtures/comp7.js +109 -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 +2 -2
- package/lib/cjs/components/form/Form.d.ts +7 -0
- package/lib/cjs/components/form/Form.js +10 -1
- package/lib/cjs/components/number/Number.js +1 -1
- package/lib/cjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/cjs/components/number/fixtures/comp8.js +28 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/number/fixtures/index.js +3 -1
- package/lib/cjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/cjs/components/phonenumber/fixtures/comp2.js +25 -0
- package/lib/cjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/phonenumber/fixtures/index.js +3 -1
- package/lib/cjs/components/select/Select.js +1 -2
- package/lib/cjs/components/signature/Signature.d.ts +0 -1
- package/lib/cjs/components/signature/Signature.js +1 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/cjs/providers/address/GoogleAddressProvider.js +23 -1
- package/lib/cjs/utils/utils.js +0 -4
- package/lib/mjs/Formio.js +1 -0
- package/lib/mjs/Webform.d.ts +7 -0
- package/lib/mjs/Webform.js +18 -5
- package/lib/mjs/components/_classes/component/Component.d.ts +13 -0
- package/lib/mjs/components/_classes/component/Component.js +35 -13
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.js +84 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/_classes/input/Input.js +22 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +8 -1
- package/lib/mjs/components/datagrid/DataGrid.d.ts +9 -0
- package/lib/mjs/components/datagrid/DataGrid.js +50 -32
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +137 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.js +42 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +3 -1
- package/lib/mjs/components/day/Day.d.ts +1 -1
- package/lib/mjs/components/day/Day.js +1 -1
- package/lib/mjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/mjs/components/day/fixtures/comp7.js +107 -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 +2 -2
- package/lib/mjs/components/form/Form.d.ts +7 -0
- package/lib/mjs/components/form/Form.js +10 -1
- package/lib/mjs/components/number/Number.js +1 -1
- package/lib/mjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/mjs/components/number/fixtures/comp8.js +26 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/number/fixtures/index.js +2 -1
- package/lib/mjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/mjs/components/phonenumber/fixtures/comp2.js +23 -0
- package/lib/mjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/phonenumber/fixtures/index.js +2 -1
- package/lib/mjs/components/select/Select.js +1 -2
- package/lib/mjs/components/signature/Signature.d.ts +0 -1
- package/lib/mjs/components/signature/Signature.js +1 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/mjs/providers/address/GoogleAddressProvider.js +22 -1
- package/lib/mjs/utils/utils.js +0 -4
- package/package.json +1 -2
|
@@ -233,7 +233,28 @@ export default class Input extends Multivalue {
|
|
|
233
233
|
if (key === 13) {
|
|
234
234
|
event.preventDefault();
|
|
235
235
|
event.stopPropagation();
|
|
236
|
-
|
|
236
|
+
let submitButton = null;
|
|
237
|
+
if (this.root?.everyComponent) {
|
|
238
|
+
this.root.everyComponent((component) => {
|
|
239
|
+
if (component?.component.type === 'button' &&
|
|
240
|
+
component?.component.action === 'submit') {
|
|
241
|
+
submitButton = component;
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
const options = {};
|
|
247
|
+
if (submitButton) {
|
|
248
|
+
options.instance = submitButton;
|
|
249
|
+
options.component = submitButton.component;
|
|
250
|
+
options.noValidate = this.component.state === 'draft';
|
|
251
|
+
options.state = this.component.state || 'submitted';
|
|
252
|
+
submitButton.loading = true;
|
|
253
|
+
this.emit('submitButton', options);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
this.emit('submitButton', options);
|
|
257
|
+
}
|
|
237
258
|
}
|
|
238
259
|
});
|
|
239
260
|
}
|
|
@@ -44,7 +44,7 @@ export default class Multivalue extends Field {
|
|
|
44
44
|
attachMultiMask(index: number): boolean;
|
|
45
45
|
/**
|
|
46
46
|
* @param {any} input - The input element on which the mask is to be applied.
|
|
47
|
-
* @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
|
|
47
|
+
* @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
|
|
48
48
|
*/
|
|
49
49
|
updateMask(input: any, mask: string): void;
|
|
50
50
|
/**
|
|
@@ -232,10 +232,17 @@ export default class Multivalue extends Field {
|
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
234
|
* @param {any} input - The input element on which the mask is to be applied.
|
|
235
|
-
* @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
|
|
235
|
+
* @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
|
|
236
236
|
*/
|
|
237
237
|
updateMask(input, mask) {
|
|
238
238
|
if (!mask) {
|
|
239
|
+
if (input.mask) {
|
|
240
|
+
input.mask.destroy();
|
|
241
|
+
}
|
|
242
|
+
if (!this.component.placeholder) {
|
|
243
|
+
input.removeAttribute('placeholder');
|
|
244
|
+
}
|
|
245
|
+
input.value = '';
|
|
239
246
|
return;
|
|
240
247
|
}
|
|
241
248
|
this.setInputMask(input, mask, !this.component.placeholder);
|
|
@@ -61,6 +61,15 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
61
61
|
loadRefs(element: any, refs: any): void;
|
|
62
62
|
dragula: any;
|
|
63
63
|
getComponentsContainer(): any;
|
|
64
|
+
/**
|
|
65
|
+
* Reorder values in array based on the old and new position
|
|
66
|
+
* @param {any} valuesArr - An array of values.
|
|
67
|
+
* @param {number} oldPosition - The index of the value in array before reordering.
|
|
68
|
+
* @param {number} newPosition - The index of the value in array after reordering.
|
|
69
|
+
* @param {boolean|any} movedBelow - Whether or not the value is moved below.
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
reorderValues(valuesArr: any, oldPosition: number, newPosition: number, movedBelow: boolean | any): void;
|
|
64
73
|
onReorder(element: any, _target: any, _source: any, sibling: any): void;
|
|
65
74
|
focusOnNewRowElement(row: any): void;
|
|
66
75
|
addRow(): void;
|
|
@@ -2,6 +2,7 @@ import _ from 'lodash';
|
|
|
2
2
|
import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
|
|
3
3
|
import { fastCloneDeep, getFocusableElements } from '../../utils/utils';
|
|
4
4
|
import { Components } from '../Components';
|
|
5
|
+
import dragula from 'dragula';
|
|
5
6
|
export default class DataGridComponent extends NestedArrayComponent {
|
|
6
7
|
static schema(...extend) {
|
|
7
8
|
return NestedArrayComponent.schema({
|
|
@@ -278,34 +279,32 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
278
279
|
this.refs[`${this.datagridKey}-row`].forEach((row, index) => {
|
|
279
280
|
row.dragInfo = { index };
|
|
280
281
|
});
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return clickedElement.classList.contains('formio-drag-button');
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}).on('drop', this.onReorder.bind(this));
|
|
292
|
-
this.dragula.on('cloned', (el, original) => {
|
|
293
|
-
if (el && el.children && original && original.children) {
|
|
294
|
-
_.each(original.children, (child, index) => {
|
|
295
|
-
const styles = getComputedStyle(child, null);
|
|
296
|
-
if (styles.cssText !== '') {
|
|
297
|
-
el.children[index].style.cssText = styles.cssText;
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
const cssText = Object.values(styles).reduce((css, propertyName) => {
|
|
301
|
-
return `${css}${propertyName}:${styles.getPropertyValue(propertyName)};`;
|
|
302
|
-
}, '');
|
|
303
|
-
el.children[index].style.cssText = cssText;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
282
|
+
this.dragula = dragula([this.refs[`${this.datagridKey}-tbody`]], {
|
|
283
|
+
moves: (_draggedElement, _oldParent, clickedElement) => {
|
|
284
|
+
const clickedElementKey = clickedElement.getAttribute('data-key');
|
|
285
|
+
const oldParentKey = _oldParent.getAttribute('data-key');
|
|
286
|
+
//Check if the clicked button belongs to that container, if false, it belongs to the nested container
|
|
287
|
+
if (oldParentKey === clickedElementKey) {
|
|
288
|
+
return clickedElement.classList.contains('formio-drag-button');
|
|
306
289
|
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
290
|
+
}
|
|
291
|
+
}).on('drop', this.onReorder.bind(this));
|
|
292
|
+
this.dragula.on('cloned', (el, original) => {
|
|
293
|
+
if (el && el.children && original && original.children) {
|
|
294
|
+
_.each(original.children, (child, index) => {
|
|
295
|
+
const styles = getComputedStyle(child, null);
|
|
296
|
+
if (styles.cssText !== '') {
|
|
297
|
+
el.children[index].style.cssText = styles.cssText;
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
const cssText = Object.values(styles).reduce((css, propertyName) => {
|
|
301
|
+
return `${css}${propertyName}:${styles.getPropertyValue(propertyName)};`;
|
|
302
|
+
}, '');
|
|
303
|
+
el.children[index].style.cssText = cssText;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
});
|
|
309
308
|
}
|
|
310
309
|
this.refs[`${this.datagridKey}-addRow`].forEach((addButton) => {
|
|
311
310
|
this.addEventListener(addButton, 'click', this.addRow.bind(this));
|
|
@@ -333,6 +332,24 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
333
332
|
getComponentsContainer() {
|
|
334
333
|
return this.component.components;
|
|
335
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Reorder values in array based on the old and new position
|
|
337
|
+
* @param {any} valuesArr - An array of values.
|
|
338
|
+
* @param {number} oldPosition - The index of the value in array before reordering.
|
|
339
|
+
* @param {number} newPosition - The index of the value in array after reordering.
|
|
340
|
+
* @param {boolean|any} movedBelow - Whether or not the value is moved below.
|
|
341
|
+
* @returns {void}
|
|
342
|
+
*/
|
|
343
|
+
reorderValues(valuesArr, oldPosition, newPosition, movedBelow) {
|
|
344
|
+
if (!_.isArray(valuesArr) || _.isEmpty(valuesArr)) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const draggedRowData = valuesArr[oldPosition];
|
|
348
|
+
//insert element at new position
|
|
349
|
+
valuesArr.splice(newPosition, 0, draggedRowData);
|
|
350
|
+
//remove element from old position (if was moved above, after insertion it's at +1 index)
|
|
351
|
+
valuesArr.splice(movedBelow ? oldPosition : oldPosition + 1, 1);
|
|
352
|
+
}
|
|
336
353
|
onReorder(element, _target, _source, sibling) {
|
|
337
354
|
if (!element.dragInfo || (sibling && !sibling.dragInfo)) {
|
|
338
355
|
console.warn('There is no Drag Info available for either dragged or sibling element');
|
|
@@ -343,11 +360,12 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
343
360
|
const newPosition = sibling ? sibling.dragInfo.index : this.dataValue.length;
|
|
344
361
|
const movedBelow = newPosition > oldPosition;
|
|
345
362
|
const dataValue = fastCloneDeep(this.dataValue);
|
|
346
|
-
|
|
347
|
-
//
|
|
348
|
-
|
|
349
|
-
//
|
|
350
|
-
|
|
363
|
+
this.reorderValues(dataValue, oldPosition, newPosition, movedBelow);
|
|
364
|
+
//reorder select data
|
|
365
|
+
this.reorderValues(_.get(this.root, `submission.metadata.selectData.${this.path}`, []), oldPosition, newPosition, movedBelow);
|
|
366
|
+
// When components are reordered we need to set the dataGrid and form pristine properties to false
|
|
367
|
+
this.root.pristine = false;
|
|
368
|
+
this.pristine = false;
|
|
351
369
|
//need to re-build rows to re-calculate indexes and other indexed fields for component instance (like rows for ex.)
|
|
352
370
|
this.setValue(dataValue, { isReordered: true });
|
|
353
371
|
this.rebuild();
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { form };
|
|
3
|
+
export { submission };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
declare namespace form {
|
|
7
|
+
let _id: string;
|
|
8
|
+
let title: string;
|
|
9
|
+
let name: string;
|
|
10
|
+
let path: string;
|
|
11
|
+
let type: string;
|
|
12
|
+
let display: string;
|
|
13
|
+
let components: ({
|
|
14
|
+
label: string;
|
|
15
|
+
reorder: boolean;
|
|
16
|
+
addAnotherPosition: string;
|
|
17
|
+
layoutFixed: boolean;
|
|
18
|
+
enableRowGroups: boolean;
|
|
19
|
+
initEmpty: boolean;
|
|
20
|
+
tableView: boolean;
|
|
21
|
+
defaultValue: {
|
|
22
|
+
select: string;
|
|
23
|
+
}[];
|
|
24
|
+
key: string;
|
|
25
|
+
type: string;
|
|
26
|
+
input: boolean;
|
|
27
|
+
components: {
|
|
28
|
+
label: string;
|
|
29
|
+
widget: string;
|
|
30
|
+
tableView: boolean;
|
|
31
|
+
dataSrc: string;
|
|
32
|
+
data: {
|
|
33
|
+
resource: string;
|
|
34
|
+
};
|
|
35
|
+
dataType: string;
|
|
36
|
+
valueProperty: string;
|
|
37
|
+
template: string;
|
|
38
|
+
validate: {
|
|
39
|
+
select: boolean;
|
|
40
|
+
};
|
|
41
|
+
key: string;
|
|
42
|
+
type: string;
|
|
43
|
+
searchField: string;
|
|
44
|
+
limit: number;
|
|
45
|
+
noRefreshOnScroll: boolean;
|
|
46
|
+
addResource: boolean;
|
|
47
|
+
reference: boolean;
|
|
48
|
+
input: boolean;
|
|
49
|
+
}[];
|
|
50
|
+
disableOnInvalid?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
type: string;
|
|
53
|
+
label: string;
|
|
54
|
+
key: string;
|
|
55
|
+
disableOnInvalid: boolean;
|
|
56
|
+
input: boolean;
|
|
57
|
+
tableView: boolean;
|
|
58
|
+
reorder?: undefined;
|
|
59
|
+
addAnotherPosition?: undefined;
|
|
60
|
+
layoutFixed?: undefined;
|
|
61
|
+
enableRowGroups?: undefined;
|
|
62
|
+
initEmpty?: undefined;
|
|
63
|
+
defaultValue?: undefined;
|
|
64
|
+
components?: undefined;
|
|
65
|
+
})[];
|
|
66
|
+
let created: string;
|
|
67
|
+
let modified: string;
|
|
68
|
+
let machineName: string;
|
|
69
|
+
}
|
|
70
|
+
declare namespace submission {
|
|
71
|
+
let form_1: string;
|
|
72
|
+
export { form_1 as form };
|
|
73
|
+
export namespace metadata {
|
|
74
|
+
namespace selectData {
|
|
75
|
+
let dataGrid: {
|
|
76
|
+
select: {
|
|
77
|
+
data: {
|
|
78
|
+
number: number;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
}[];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export namespace data {
|
|
85
|
+
let dataGrid_1: {
|
|
86
|
+
select: string;
|
|
87
|
+
}[];
|
|
88
|
+
export { dataGrid_1 as dataGrid };
|
|
89
|
+
export let dataTable: never[];
|
|
90
|
+
export let submit: boolean;
|
|
91
|
+
}
|
|
92
|
+
let _id_1: string;
|
|
93
|
+
export { _id_1 as _id };
|
|
94
|
+
export let project: string;
|
|
95
|
+
export let state: string;
|
|
96
|
+
let created_1: string;
|
|
97
|
+
export { created_1 as created };
|
|
98
|
+
let modified_1: string;
|
|
99
|
+
export { modified_1 as modified };
|
|
100
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
const form = {
|
|
2
|
+
_id: '66742f4146717b98a9fa280f',
|
|
3
|
+
title: 'test reorder',
|
|
4
|
+
name: 'testReorder',
|
|
5
|
+
path: 'testreorder',
|
|
6
|
+
type: 'form',
|
|
7
|
+
display: 'form',
|
|
8
|
+
components: [
|
|
9
|
+
{
|
|
10
|
+
label: 'Data Grid',
|
|
11
|
+
reorder: true,
|
|
12
|
+
addAnotherPosition: 'bottom',
|
|
13
|
+
layoutFixed: false,
|
|
14
|
+
enableRowGroups: false,
|
|
15
|
+
initEmpty: false,
|
|
16
|
+
tableView: false,
|
|
17
|
+
defaultValue: [
|
|
18
|
+
{
|
|
19
|
+
select: '',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
key: 'dataGrid',
|
|
23
|
+
type: 'datagrid',
|
|
24
|
+
input: true,
|
|
25
|
+
components: [
|
|
26
|
+
{
|
|
27
|
+
label: 'Select',
|
|
28
|
+
widget: 'choicesjs',
|
|
29
|
+
tableView: true,
|
|
30
|
+
dataSrc: 'resource',
|
|
31
|
+
data: {
|
|
32
|
+
resource: '66742ee946717b98a9fa1b0b',
|
|
33
|
+
},
|
|
34
|
+
dataType: 'string',
|
|
35
|
+
valueProperty: 'data.textField',
|
|
36
|
+
template: '<span>{{ item.data.number }}</span>',
|
|
37
|
+
validate: {
|
|
38
|
+
select: false,
|
|
39
|
+
},
|
|
40
|
+
key: 'select',
|
|
41
|
+
type: 'select',
|
|
42
|
+
searchField: 'data.textField__regex',
|
|
43
|
+
limit: 10,
|
|
44
|
+
noRefreshOnScroll: false,
|
|
45
|
+
addResource: false,
|
|
46
|
+
reference: false,
|
|
47
|
+
input: true,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'button',
|
|
53
|
+
label: 'Submit',
|
|
54
|
+
key: 'submit',
|
|
55
|
+
disableOnInvalid: true,
|
|
56
|
+
input: true,
|
|
57
|
+
tableView: false,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
created: '2024-06-20T13:31:45.177Z',
|
|
61
|
+
modified: '2024-06-25T10:32:46.577Z',
|
|
62
|
+
machineName: 'tifwklexhyrgxbr:testReorder',
|
|
63
|
+
};
|
|
64
|
+
const submission = {
|
|
65
|
+
form: '66742f4146717b98a9fa280f',
|
|
66
|
+
metadata: {
|
|
67
|
+
selectData: {
|
|
68
|
+
dataGrid: [
|
|
69
|
+
{
|
|
70
|
+
select: {
|
|
71
|
+
data: {
|
|
72
|
+
number: 1,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
select: {
|
|
78
|
+
data: {
|
|
79
|
+
number: 2,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
select: {
|
|
85
|
+
data: {
|
|
86
|
+
number: 3,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
select: {
|
|
92
|
+
data: {
|
|
93
|
+
number: 4,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
select: {
|
|
99
|
+
data: {
|
|
100
|
+
number: 5,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
data: {
|
|
108
|
+
dataGrid: [
|
|
109
|
+
{
|
|
110
|
+
select: '11',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
select: '22',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
select: '33',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
select: '44',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
select: '55',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
dataTable: [],
|
|
126
|
+
submit: true,
|
|
127
|
+
},
|
|
128
|
+
_id: '667ab5ee6a69739703d30def',
|
|
129
|
+
project: '65df46bc93bcfaa231f3db1c',
|
|
130
|
+
state: 'submitted',
|
|
131
|
+
created: '2024-06-25T12:19:58.626Z',
|
|
132
|
+
modified: '2024-06-25T12:19:58.627Z',
|
|
133
|
+
};
|
|
134
|
+
export default {
|
|
135
|
+
form,
|
|
136
|
+
submission,
|
|
137
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: {
|
|
3
|
+
label: string;
|
|
4
|
+
reorder: boolean;
|
|
5
|
+
addAnotherPosition: string;
|
|
6
|
+
layoutFixed: boolean;
|
|
7
|
+
enableRowGroups: boolean;
|
|
8
|
+
initEmpty: boolean;
|
|
9
|
+
tableView: boolean;
|
|
10
|
+
defaultValue: {}[];
|
|
11
|
+
key: string;
|
|
12
|
+
type: string;
|
|
13
|
+
input: boolean;
|
|
14
|
+
components: ({
|
|
15
|
+
label: string;
|
|
16
|
+
applyMaskOn: string;
|
|
17
|
+
tableView: boolean;
|
|
18
|
+
key: string;
|
|
19
|
+
type: string;
|
|
20
|
+
input: boolean;
|
|
21
|
+
mask?: undefined;
|
|
22
|
+
delimiter?: undefined;
|
|
23
|
+
requireDecimal?: undefined;
|
|
24
|
+
inputFormat?: undefined;
|
|
25
|
+
truncateMultipleSpaces?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
label: string;
|
|
28
|
+
applyMaskOn: string;
|
|
29
|
+
mask: boolean;
|
|
30
|
+
tableView: boolean;
|
|
31
|
+
delimiter: boolean;
|
|
32
|
+
requireDecimal: boolean;
|
|
33
|
+
inputFormat: string;
|
|
34
|
+
truncateMultipleSpaces: boolean;
|
|
35
|
+
key: string;
|
|
36
|
+
type: string;
|
|
37
|
+
input: boolean;
|
|
38
|
+
})[];
|
|
39
|
+
}[];
|
|
40
|
+
}
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"label": "Data Grid",
|
|
5
|
+
"reorder": true,
|
|
6
|
+
"addAnotherPosition": "bottom",
|
|
7
|
+
"layoutFixed": false,
|
|
8
|
+
"enableRowGroups": false,
|
|
9
|
+
"initEmpty": false,
|
|
10
|
+
"tableView": false,
|
|
11
|
+
"defaultValue": [
|
|
12
|
+
{}
|
|
13
|
+
],
|
|
14
|
+
"key": "dataGrid",
|
|
15
|
+
"type": "datagrid",
|
|
16
|
+
"input": true,
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"label": "Text Field",
|
|
20
|
+
"applyMaskOn": "change",
|
|
21
|
+
"tableView": true,
|
|
22
|
+
"key": "textField",
|
|
23
|
+
"type": "textfield",
|
|
24
|
+
"input": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"label": "Number",
|
|
28
|
+
"applyMaskOn": "change",
|
|
29
|
+
"mask": false,
|
|
30
|
+
"tableView": false,
|
|
31
|
+
"delimiter": false,
|
|
32
|
+
"requireDecimal": false,
|
|
33
|
+
"inputFormat": "plain",
|
|
34
|
+
"truncateMultipleSpaces": false,
|
|
35
|
+
"key": "number",
|
|
36
|
+
"type": "number",
|
|
37
|
+
"input": true
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
};
|
|
@@ -6,6 +6,7 @@ import comp5 from './comp5';
|
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
|
+
import comp9 from './comp9';
|
|
9
10
|
import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
|
10
11
|
import withConditionalFieldsAndValidations from './comp-with-conditional-components-and-validations';
|
|
11
12
|
import withDefValue from './comp-with-def-value';
|
|
@@ -15,4 +16,5 @@ import modalWithRequiredFields from './comp-modal-with-required-fields';
|
|
|
15
16
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
17
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
18
|
import withCheckboxes from './comp-with-checkboxes';
|
|
18
|
-
|
|
19
|
+
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 };
|
|
@@ -6,6 +6,7 @@ import comp5 from './comp5';
|
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
|
+
import comp9 from './comp9';
|
|
9
10
|
import withDefValue from './comp-with-def-value';
|
|
10
11
|
import withRowGroupsAndDefValue from './comp-row-groups-with-def-value';
|
|
11
12
|
import modalWithRequiredFields from './comp-modal-with-required-fields';
|
|
@@ -15,4 +16,5 @@ import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
|
|
15
16
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
17
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
18
|
import withCheckboxes from './comp-with-checkboxes';
|
|
18
|
-
|
|
19
|
+
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 };
|
|
@@ -122,7 +122,7 @@ export default class DayComponent extends Field {
|
|
|
122
122
|
id: `${this.component.key}-${name}`,
|
|
123
123
|
class: `form-control ${this.transform('class', `formio-day-component-${name}`)}`,
|
|
124
124
|
type: this.component.fields[name].type === 'select' ? 'select' : 'number',
|
|
125
|
-
placeholder: this.component.fields[name].placeholder,
|
|
125
|
+
placeholder: this.t(this.component.fields[name].placeholder),
|
|
126
126
|
step: 1,
|
|
127
127
|
min,
|
|
128
128
|
max,
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: ({
|
|
3
|
+
type: string;
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
input: boolean;
|
|
8
|
+
applyMaskOn?: undefined;
|
|
9
|
+
tableView?: undefined;
|
|
10
|
+
hideInputLabels?: undefined;
|
|
11
|
+
inputsLabelPosition?: undefined;
|
|
12
|
+
useLocaleSettings?: undefined;
|
|
13
|
+
fields?: undefined;
|
|
14
|
+
defaultValue?: undefined;
|
|
15
|
+
values?: undefined;
|
|
16
|
+
questions?: undefined;
|
|
17
|
+
action?: undefined;
|
|
18
|
+
theme?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
label: string;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
applyMaskOn: string;
|
|
23
|
+
tableView: boolean;
|
|
24
|
+
key: string;
|
|
25
|
+
type: string;
|
|
26
|
+
input: boolean;
|
|
27
|
+
hideInputLabels?: undefined;
|
|
28
|
+
inputsLabelPosition?: undefined;
|
|
29
|
+
useLocaleSettings?: undefined;
|
|
30
|
+
fields?: undefined;
|
|
31
|
+
defaultValue?: undefined;
|
|
32
|
+
values?: undefined;
|
|
33
|
+
questions?: undefined;
|
|
34
|
+
action?: undefined;
|
|
35
|
+
theme?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
label: string;
|
|
38
|
+
hideInputLabels: boolean;
|
|
39
|
+
inputsLabelPosition: string;
|
|
40
|
+
useLocaleSettings: boolean;
|
|
41
|
+
tableView: boolean;
|
|
42
|
+
fields: {
|
|
43
|
+
day: {
|
|
44
|
+
placeholder: string;
|
|
45
|
+
hide: boolean;
|
|
46
|
+
};
|
|
47
|
+
month: {
|
|
48
|
+
type: string;
|
|
49
|
+
placeholder: string;
|
|
50
|
+
hide: boolean;
|
|
51
|
+
};
|
|
52
|
+
year: {
|
|
53
|
+
placeholder: string;
|
|
54
|
+
hide: boolean;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
key: string;
|
|
58
|
+
type: string;
|
|
59
|
+
input: boolean;
|
|
60
|
+
defaultValue: string;
|
|
61
|
+
placeholder?: undefined;
|
|
62
|
+
applyMaskOn?: undefined;
|
|
63
|
+
values?: undefined;
|
|
64
|
+
questions?: undefined;
|
|
65
|
+
action?: undefined;
|
|
66
|
+
theme?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
type: string;
|
|
69
|
+
key: string;
|
|
70
|
+
label: string;
|
|
71
|
+
values: {
|
|
72
|
+
label: string;
|
|
73
|
+
value: string;
|
|
74
|
+
}[];
|
|
75
|
+
questions: {
|
|
76
|
+
label: string;
|
|
77
|
+
value: string;
|
|
78
|
+
}[];
|
|
79
|
+
placeholder?: undefined;
|
|
80
|
+
input?: undefined;
|
|
81
|
+
applyMaskOn?: undefined;
|
|
82
|
+
tableView?: undefined;
|
|
83
|
+
hideInputLabels?: undefined;
|
|
84
|
+
inputsLabelPosition?: undefined;
|
|
85
|
+
useLocaleSettings?: undefined;
|
|
86
|
+
fields?: undefined;
|
|
87
|
+
defaultValue?: undefined;
|
|
88
|
+
action?: undefined;
|
|
89
|
+
theme?: undefined;
|
|
90
|
+
} | {
|
|
91
|
+
type: string;
|
|
92
|
+
action: string;
|
|
93
|
+
label: string;
|
|
94
|
+
theme: string;
|
|
95
|
+
key?: undefined;
|
|
96
|
+
placeholder?: undefined;
|
|
97
|
+
input?: undefined;
|
|
98
|
+
applyMaskOn?: undefined;
|
|
99
|
+
tableView?: undefined;
|
|
100
|
+
hideInputLabels?: undefined;
|
|
101
|
+
inputsLabelPosition?: undefined;
|
|
102
|
+
useLocaleSettings?: undefined;
|
|
103
|
+
fields?: undefined;
|
|
104
|
+
defaultValue?: undefined;
|
|
105
|
+
values?: undefined;
|
|
106
|
+
questions?: undefined;
|
|
107
|
+
})[];
|
|
108
|
+
}
|
|
109
|
+
export default _default;
|