@formio/js 5.0.0-dev.5680.d459cf5 → 5.0.0-dev.5682.2fe896c
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.form.js +98 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/Webform.js +2 -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 +2 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.js +2 -2
- package/lib/mjs/Webform.js +2 -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 +2 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.js +2 -2
- package/package.json +1 -1
package/lib/cjs/Webform.js
CHANGED
|
@@ -13,6 +13,7 @@ const Components_1 = __importDefault(require("./components/Components"));
|
|
|
13
13
|
const NestedDataComponent_1 = __importDefault(require("./components/_classes/nesteddata/NestedDataComponent"));
|
|
14
14
|
const utils_1 = require("./utils/utils");
|
|
15
15
|
const formUtils_1 = require("./utils/formUtils");
|
|
16
|
+
const dragula_1 = __importDefault(require("dragula"));
|
|
16
17
|
// Initialize the available forms.
|
|
17
18
|
Formio_1.Formio.forms = {};
|
|
18
19
|
// Allow people to register components.
|
|
@@ -309,6 +310,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
309
310
|
// Ensure the root is set to this component.
|
|
310
311
|
this.root = this;
|
|
311
312
|
this.localRoot = this;
|
|
313
|
+
this.root.dragulaLib = dragula_1.default;
|
|
312
314
|
}
|
|
313
315
|
/* eslint-enable max-statements */
|
|
314
316
|
get language() {
|
|
@@ -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,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"components": [
|
|
5
|
+
{
|
|
6
|
+
"label": "Data Grid",
|
|
7
|
+
"reorder": true,
|
|
8
|
+
"addAnotherPosition": "bottom",
|
|
9
|
+
"layoutFixed": false,
|
|
10
|
+
"enableRowGroups": false,
|
|
11
|
+
"initEmpty": false,
|
|
12
|
+
"tableView": false,
|
|
13
|
+
"defaultValue": [
|
|
14
|
+
{}
|
|
15
|
+
],
|
|
16
|
+
"key": "dataGrid",
|
|
17
|
+
"type": "datagrid",
|
|
18
|
+
"input": true,
|
|
19
|
+
"components": [
|
|
20
|
+
{
|
|
21
|
+
"label": "Text Field",
|
|
22
|
+
"applyMaskOn": "change",
|
|
23
|
+
"tableView": true,
|
|
24
|
+
"key": "textField",
|
|
25
|
+
"type": "textfield",
|
|
26
|
+
"input": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "Number",
|
|
30
|
+
"applyMaskOn": "change",
|
|
31
|
+
"mask": false,
|
|
32
|
+
"tableView": false,
|
|
33
|
+
"delimiter": false,
|
|
34
|
+
"requireDecimal": false,
|
|
35
|
+
"inputFormat": "plain",
|
|
36
|
+
"truncateMultipleSpaces": false,
|
|
37
|
+
"key": "number",
|
|
38
|
+
"type": "number",
|
|
39
|
+
"input": true
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
};
|
|
@@ -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,4 @@ 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
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
19
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
@@ -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.withCheckboxes = exports.twoWithAllowCalculatedOverride = exports.withAllowCalculateOverride = exports.modalWithRequiredFields = exports.withRowGroupsAndDefValue = exports.withLogic = exports.withDefValue = exports.withConditionalFieldsAndValidations = exports.withCollapsibleRowGroups = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.withCheckboxes = exports.twoWithAllowCalculatedOverride = exports.withAllowCalculateOverride = exports.modalWithRequiredFields = exports.withRowGroupsAndDefValue = exports.withLogic = exports.withDefValue = exports.withConditionalFieldsAndValidations = exports.withCollapsibleRowGroups = 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"));
|
|
@@ -20,6 +20,8 @@ const comp7_1 = __importDefault(require("./comp7"));
|
|
|
20
20
|
exports.comp7 = comp7_1.default;
|
|
21
21
|
const comp8_1 = __importDefault(require("./comp8"));
|
|
22
22
|
exports.comp8 = comp8_1.default;
|
|
23
|
+
const comp9_1 = __importDefault(require("./comp9"));
|
|
24
|
+
exports.comp9 = comp9_1.default;
|
|
23
25
|
const comp_with_def_value_1 = __importDefault(require("./comp-with-def-value"));
|
|
24
26
|
exports.withDefValue = comp_with_def_value_1.default;
|
|
25
27
|
const comp_row_groups_with_def_value_1 = __importDefault(require("./comp-row-groups-with-def-value"));
|
|
@@ -88,7 +88,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
88
88
|
{% if (!instance.options.readOnly && !instance.disabled) { %}
|
|
89
89
|
<div class="col-sm-2">
|
|
90
90
|
<div class="btn-group pull-right">
|
|
91
|
-
<button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('
|
|
91
|
+
<button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('pen-fill') }}"></i></button>
|
|
92
92
|
{% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
|
|
93
93
|
<button class="btn btn-danger btn-sm removeRow"><i class="{{ iconClass('trash') }}"></i></button>
|
|
94
94
|
{% } %}
|
|
@@ -109,7 +109,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
109
109
|
{% if (!instance.options.readOnly && !instance.disabled) { %}
|
|
110
110
|
<td class="editgrid-table-column">
|
|
111
111
|
<div class="btn-group">
|
|
112
|
-
<button class="btn btn-default btn-light btn-sm editRow" aria-label="{{ t('Edit row') }}"><i class="{{ iconClass('
|
|
112
|
+
<button class="btn btn-default btn-light btn-sm editRow" aria-label="{{ t('Edit row') }}"><i class="{{ iconClass('pen-fill') }}"></i></button>
|
|
113
113
|
{% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
|
|
114
114
|
<button class="btn btn-danger btn-sm removeRow" aria-label="{{ t('Remove row') }}"><i class="{{ iconClass('trash') }}"></i></button>
|
|
115
115
|
{% } %}
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -8,6 +8,7 @@ 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
|
+
import dragula from "dragula";
|
|
11
12
|
// Initialize the available forms.
|
|
12
13
|
Formio.forms = {};
|
|
13
14
|
// Allow people to register components.
|
|
@@ -281,6 +282,7 @@ export default class Webform extends NestedDataComponent {
|
|
|
281
282
|
// Ensure the root is set to this component.
|
|
282
283
|
this.root = this;
|
|
283
284
|
this.localRoot = this;
|
|
285
|
+
this.root.dragulaLib = dragula;
|
|
284
286
|
}
|
|
285
287
|
/* eslint-enable max-statements */
|
|
286
288
|
get language() {
|
|
@@ -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,4 @@ 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
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
19
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
@@ -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,4 @@ 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
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
19
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
@@ -83,7 +83,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
83
83
|
{% if (!instance.options.readOnly && !instance.disabled) { %}
|
|
84
84
|
<div class="col-sm-2">
|
|
85
85
|
<div class="btn-group pull-right">
|
|
86
|
-
<button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('
|
|
86
|
+
<button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('pen-fill') }}"></i></button>
|
|
87
87
|
{% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
|
|
88
88
|
<button class="btn btn-danger btn-sm removeRow"><i class="{{ iconClass('trash') }}"></i></button>
|
|
89
89
|
{% } %}
|
|
@@ -104,7 +104,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
104
104
|
{% if (!instance.options.readOnly && !instance.disabled) { %}
|
|
105
105
|
<td class="editgrid-table-column">
|
|
106
106
|
<div class="btn-group">
|
|
107
|
-
<button class="btn btn-default btn-light btn-sm editRow" aria-label="{{ t('Edit row') }}"><i class="{{ iconClass('
|
|
107
|
+
<button class="btn btn-default btn-light btn-sm editRow" aria-label="{{ t('Edit row') }}"><i class="{{ iconClass('pen-fill') }}"></i></button>
|
|
108
108
|
{% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
|
|
109
109
|
<button class="btn btn-danger btn-sm removeRow" aria-label="{{ t('Remove row') }}"><i class="{{ iconClass('trash') }}"></i></button>
|
|
110
110
|
{% } %}
|