@formio/js 5.0.0-dev.5710.e2e8388 → 5.0.0-dev.5712.d53f35e
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 +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/WebformBuilder.d.ts +0 -5
- package/lib/cjs/WebformBuilder.js +15 -22
- package/lib/cjs/components/currency/Currency.d.ts +1 -0
- package/lib/cjs/components/number/Number.d.ts +7 -1
- package/lib/cjs/components/number/Number.js +11 -0
- package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp10.js +21 -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/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.js +3 -2
- package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/cjs/components/time/fixtures/comp4.js +171 -0
- package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/time/fixtures/index.js +3 -1
- package/lib/mjs/WebformBuilder.d.ts +0 -5
- package/lib/mjs/WebformBuilder.js +15 -22
- package/lib/mjs/components/currency/Currency.d.ts +1 -0
- package/lib/mjs/components/number/Number.d.ts +7 -1
- package/lib/mjs/components/number/Number.js +11 -0
- package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp10.js +19 -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/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.js +3 -2
- package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/mjs/components/time/fixtures/comp4.js +169 -0
- package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/time/fixtures/index.js +2 -1
- package/package.json +1 -1
|
@@ -15,11 +15,6 @@ export default class WebformBuilder extends Component {
|
|
|
15
15
|
arrayDataComponentPaths: any[];
|
|
16
16
|
nestedDataComponents: any[];
|
|
17
17
|
arrayDataComponents: any[];
|
|
18
|
-
/**
|
|
19
|
-
* Returns the query parameters for the builder existing resources request
|
|
20
|
-
* @returns {object} - The object with query parameters.
|
|
21
|
-
*/
|
|
22
|
-
getExistingResourcesQuery(): object;
|
|
23
18
|
allowDrop(): boolean;
|
|
24
19
|
addExistingResourceFields(resources: any): void;
|
|
25
20
|
attachTooltip(component: any, title: any): import("tippy.js").Instance<import("tippy.js").Props>[];
|
|
@@ -203,6 +203,20 @@ class WebformBuilder extends Component_1.default {
|
|
|
203
203
|
// Need to set up horizontal rearrangement of fields.
|
|
204
204
|
};
|
|
205
205
|
this.options.hooks.attachComponent = this.attachComponent.bind(this);
|
|
206
|
+
// Load resources tagged as 'builder'
|
|
207
|
+
const query = {
|
|
208
|
+
params: {
|
|
209
|
+
type: 'resource',
|
|
210
|
+
limit: 1000000,
|
|
211
|
+
select: '_id,title,name,components'
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
if (this.options && this.options.resourceTag) {
|
|
215
|
+
query.params.tags = [this.options.resourceTag];
|
|
216
|
+
}
|
|
217
|
+
else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
|
|
218
|
+
query.params.tags = ['builder'];
|
|
219
|
+
}
|
|
206
220
|
const formio = new Formio_1.Formio(Formio_1.Formio.projectUrl);
|
|
207
221
|
const isResourcesDisabled = this.options.builder && this.options.builder.resource === false;
|
|
208
222
|
formio.loadProject().then((project) => {
|
|
@@ -220,7 +234,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
220
234
|
});
|
|
221
235
|
if (!formio.noProject && !isResourcesDisabled && formio.formsUrl) {
|
|
222
236
|
const resourceOptions = this.options.builder && this.options.builder.resource;
|
|
223
|
-
formio.loadForms(
|
|
237
|
+
formio.loadForms(query)
|
|
224
238
|
.then((resources) => {
|
|
225
239
|
if (resources.length) {
|
|
226
240
|
this.builder.resource = {
|
|
@@ -254,27 +268,6 @@ class WebformBuilder extends Component_1.default {
|
|
|
254
268
|
this.nestedDataComponents = [];
|
|
255
269
|
this.arrayDataComponents = [];
|
|
256
270
|
}
|
|
257
|
-
/**
|
|
258
|
-
* Returns the query parameters for the builder existing resources request
|
|
259
|
-
* @returns {object} - The object with query parameters.
|
|
260
|
-
*/
|
|
261
|
-
getExistingResourcesQuery() {
|
|
262
|
-
// Load resources tagged as 'builder'
|
|
263
|
-
const query = {
|
|
264
|
-
params: {
|
|
265
|
-
type: 'resource',
|
|
266
|
-
limit: 1000000,
|
|
267
|
-
select: '_id,title,name,components'
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
if (this.options && this.options.resourceTag) {
|
|
271
|
-
query.params.tags = [this.options.resourceTag];
|
|
272
|
-
}
|
|
273
|
-
else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
|
|
274
|
-
query.params.tags = ['builder'];
|
|
275
|
-
}
|
|
276
|
-
return query;
|
|
277
|
-
}
|
|
278
271
|
allowDrop() {
|
|
279
272
|
return true;
|
|
280
273
|
}
|
|
@@ -2,6 +2,7 @@ export default class CurrencyComponent extends NumberComponent {
|
|
|
2
2
|
constructor(component: any, options: any, data: any);
|
|
3
3
|
currencyPrefix: any;
|
|
4
4
|
currencySuffix: any;
|
|
5
|
+
parseNumber(value: any): number;
|
|
5
6
|
parseValue(value: any): string | null;
|
|
6
7
|
addZerosAndFormatValue(value: any): any;
|
|
7
8
|
stripPrefixSuffix(value: any): any;
|
|
@@ -27,7 +27,13 @@ export default class NumberComponent extends Input {
|
|
|
27
27
|
*/
|
|
28
28
|
createNumberMask(): any;
|
|
29
29
|
isDecimalAllowed(): any;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
|
|
32
|
+
* be processed by either parseInt or parseFloat
|
|
33
|
+
* @param {string} value the value to be parsed
|
|
34
|
+
* @returns {number} a parsed number
|
|
35
|
+
*/
|
|
36
|
+
parseNumber(value: string): number;
|
|
31
37
|
setInputMask(input: any): void;
|
|
32
38
|
getValueAt(index: any): number | null;
|
|
33
39
|
setValueAt(index: any, value: any, flags?: {}): void;
|
|
@@ -91,6 +91,11 @@ class NumberComponent extends Input_1.default {
|
|
|
91
91
|
}
|
|
92
92
|
get defaultValue() {
|
|
93
93
|
let defaultValue = super.defaultValue;
|
|
94
|
+
if (typeof defaultValue === 'string') {
|
|
95
|
+
// Default value may be a string or have custom thousands separators or decimal symbols, so we need to call
|
|
96
|
+
// parseNumber on it
|
|
97
|
+
defaultValue = this.parseNumber(defaultValue);
|
|
98
|
+
}
|
|
94
99
|
if (!defaultValue && this.component.defaultValue === 0) {
|
|
95
100
|
defaultValue = this.component.defaultValue;
|
|
96
101
|
}
|
|
@@ -102,6 +107,12 @@ class NumberComponent extends Input_1.default {
|
|
|
102
107
|
isDecimalAllowed() {
|
|
103
108
|
return lodash_1.default.get(this.component, 'allowDecimal', !(this.component.validate && this.component.validate.integer));
|
|
104
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
|
|
112
|
+
* be processed by either parseInt or parseFloat
|
|
113
|
+
* @param {string} value the value to be parsed
|
|
114
|
+
* @returns {number} a parsed number
|
|
115
|
+
*/
|
|
105
116
|
parseNumber(value) {
|
|
106
117
|
// Remove delimiters and convert decimal separator to dot.
|
|
107
118
|
value = value.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: {
|
|
3
|
+
label: string;
|
|
4
|
+
applyMaskOn: string;
|
|
5
|
+
mask: boolean;
|
|
6
|
+
tableView: boolean;
|
|
7
|
+
delimiter: boolean;
|
|
8
|
+
requireDecimal: boolean;
|
|
9
|
+
inputFormat: string;
|
|
10
|
+
truncateMultipleSpaces: boolean;
|
|
11
|
+
validateWhenHidden: boolean;
|
|
12
|
+
key: string;
|
|
13
|
+
type: string;
|
|
14
|
+
input: boolean;
|
|
15
|
+
defaultValue: string;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
"label": "Number",
|
|
7
|
+
"applyMaskOn": "change",
|
|
8
|
+
"mask": false,
|
|
9
|
+
"tableView": false,
|
|
10
|
+
"delimiter": false,
|
|
11
|
+
"requireDecimal": false,
|
|
12
|
+
"inputFormat": "plain",
|
|
13
|
+
"truncateMultipleSpaces": false,
|
|
14
|
+
"validateWhenHidden": false,
|
|
15
|
+
"key": "number",
|
|
16
|
+
"type": "number",
|
|
17
|
+
"input": true,
|
|
18
|
+
"defaultValue": "123.23"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
@@ -7,4 +7,5 @@ import comp6 from './comp6';
|
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
9
|
import comp9 from './comp9';
|
|
10
|
-
|
|
10
|
+
import comp10 from './comp10';
|
|
11
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 };
|
|
@@ -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.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
8
8
|
exports.comp1 = comp1_1.default;
|
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
|
@@ -22,3 +22,5 @@ const comp8_1 = __importDefault(require("./comp8"));
|
|
|
22
22
|
exports.comp8 = comp8_1.default;
|
|
23
23
|
const comp9_1 = __importDefault(require("./comp9"));
|
|
24
24
|
exports.comp9 = comp9_1.default;
|
|
25
|
+
const comp10_1 = __importDefault(require("./comp10"));
|
|
26
|
+
exports.comp10 = comp10_1.default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default class TimeComponent extends TextFieldComponent {
|
|
2
|
-
rawData:
|
|
2
|
+
rawData: any;
|
|
3
3
|
get dataFormat(): any;
|
|
4
4
|
get skipMaskValidation(): boolean;
|
|
5
5
|
isNotCompleteInput(value: any): any;
|
|
6
6
|
removeValue(index: any): void;
|
|
7
7
|
resetRawData(index: any): void;
|
|
8
8
|
setRawValue(value: any, index: any): void;
|
|
9
|
-
getRawValue(index: any):
|
|
9
|
+
getRawValue(index: any): any;
|
|
10
10
|
getValueAt(index: any): any;
|
|
11
11
|
setValueAt(index: any, value: any): void;
|
|
12
12
|
getStringAsValue(view: any): any;
|
|
@@ -30,7 +30,8 @@ class TimeComponent extends TextField_1.default {
|
|
|
30
30
|
this.component.inputType = isEdgeBrowser && edgeVersion <= 18
|
|
31
31
|
? 'text'
|
|
32
32
|
: (this.component.inputType || 'time');
|
|
33
|
-
|
|
33
|
+
// If default value is given then the raw data needs to be set
|
|
34
|
+
this.rawData = this.component.multiple ? [] : this.getValueAsString(this.defaultValue) || this.emptyValue;
|
|
34
35
|
}
|
|
35
36
|
static get builderInfo() {
|
|
36
37
|
return {
|
|
@@ -61,7 +62,7 @@ class TimeComponent extends TextField_1.default {
|
|
|
61
62
|
return value;
|
|
62
63
|
}
|
|
63
64
|
get validationValue() {
|
|
64
|
-
if (Array.isArray(this.rawData) && !this.rawData.length || !this.rawData) {
|
|
65
|
+
if ((Array.isArray(this.rawData) && !this.rawData.length) || !this.rawData) {
|
|
65
66
|
return this.dataValue;
|
|
66
67
|
}
|
|
67
68
|
return this.rawData;
|
|
@@ -0,0 +1,166 @@
|
|
|
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
|
+
navigateOnEnter: boolean;
|
|
13
|
+
saveOnEnter: boolean;
|
|
14
|
+
scrollToTop: boolean;
|
|
15
|
+
collapsible: boolean;
|
|
16
|
+
key: string;
|
|
17
|
+
type: string;
|
|
18
|
+
label: string;
|
|
19
|
+
components: {
|
|
20
|
+
label: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
alwaysEnabled: boolean;
|
|
23
|
+
tableView: boolean;
|
|
24
|
+
defaultValue: string;
|
|
25
|
+
key: string;
|
|
26
|
+
type: string;
|
|
27
|
+
input: boolean;
|
|
28
|
+
inputMask: string;
|
|
29
|
+
hideOnChildrenHidden: boolean;
|
|
30
|
+
id: string;
|
|
31
|
+
placeholder: string;
|
|
32
|
+
prefix: string;
|
|
33
|
+
customClass: string;
|
|
34
|
+
suffix: string;
|
|
35
|
+
multiple: boolean;
|
|
36
|
+
protected: boolean;
|
|
37
|
+
unique: boolean;
|
|
38
|
+
persistent: boolean;
|
|
39
|
+
hidden: boolean;
|
|
40
|
+
clearOnHide: boolean;
|
|
41
|
+
refreshOn: string;
|
|
42
|
+
redrawOn: string;
|
|
43
|
+
modalEdit: boolean;
|
|
44
|
+
dataGridLabel: boolean;
|
|
45
|
+
labelPosition: string;
|
|
46
|
+
description: string;
|
|
47
|
+
errorLabel: string;
|
|
48
|
+
tooltip: string;
|
|
49
|
+
hideLabel: boolean;
|
|
50
|
+
tabindex: string;
|
|
51
|
+
autofocus: boolean;
|
|
52
|
+
dbIndex: boolean;
|
|
53
|
+
customDefaultValue: string;
|
|
54
|
+
calculateValue: string;
|
|
55
|
+
calculateServer: boolean;
|
|
56
|
+
widget: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
attributes: {};
|
|
60
|
+
validateOn: string;
|
|
61
|
+
validate: {
|
|
62
|
+
required: boolean;
|
|
63
|
+
custom: string;
|
|
64
|
+
customPrivate: boolean;
|
|
65
|
+
strictDateValidation: boolean;
|
|
66
|
+
multiple: boolean;
|
|
67
|
+
unique: boolean;
|
|
68
|
+
minLength: string;
|
|
69
|
+
maxLength: string;
|
|
70
|
+
pattern: string;
|
|
71
|
+
};
|
|
72
|
+
conditional: {
|
|
73
|
+
show: null;
|
|
74
|
+
when: null;
|
|
75
|
+
eq: string;
|
|
76
|
+
};
|
|
77
|
+
overlay: {
|
|
78
|
+
style: string;
|
|
79
|
+
left: string;
|
|
80
|
+
top: string;
|
|
81
|
+
width: string;
|
|
82
|
+
height: string;
|
|
83
|
+
};
|
|
84
|
+
allowCalculateOverride: boolean;
|
|
85
|
+
encrypted: boolean;
|
|
86
|
+
showCharCount: boolean;
|
|
87
|
+
showWordCount: boolean;
|
|
88
|
+
properties: {};
|
|
89
|
+
allowMultipleMasks: boolean;
|
|
90
|
+
addons: never[];
|
|
91
|
+
mask: boolean;
|
|
92
|
+
inputType: string;
|
|
93
|
+
inputFormat: string;
|
|
94
|
+
displayMask: string;
|
|
95
|
+
spellcheck: boolean;
|
|
96
|
+
truncateMultipleSpaces: boolean;
|
|
97
|
+
format: string;
|
|
98
|
+
dataFormat: string;
|
|
99
|
+
}[];
|
|
100
|
+
input: boolean;
|
|
101
|
+
tableView: boolean;
|
|
102
|
+
id: string;
|
|
103
|
+
placeholder: string;
|
|
104
|
+
prefix: string;
|
|
105
|
+
customClass: string;
|
|
106
|
+
suffix: string;
|
|
107
|
+
multiple: boolean;
|
|
108
|
+
defaultValue: null;
|
|
109
|
+
protected: boolean;
|
|
110
|
+
unique: boolean;
|
|
111
|
+
persistent: boolean;
|
|
112
|
+
hidden: boolean;
|
|
113
|
+
clearOnHide: boolean;
|
|
114
|
+
refreshOn: string;
|
|
115
|
+
redrawOn: string;
|
|
116
|
+
modalEdit: boolean;
|
|
117
|
+
dataGridLabel: boolean;
|
|
118
|
+
labelPosition: string;
|
|
119
|
+
description: string;
|
|
120
|
+
errorLabel: string;
|
|
121
|
+
tooltip: string;
|
|
122
|
+
hideLabel: boolean;
|
|
123
|
+
tabindex: string;
|
|
124
|
+
disabled: boolean;
|
|
125
|
+
autofocus: boolean;
|
|
126
|
+
dbIndex: boolean;
|
|
127
|
+
customDefaultValue: string;
|
|
128
|
+
calculateValue: string;
|
|
129
|
+
calculateServer: boolean;
|
|
130
|
+
widget: null;
|
|
131
|
+
attributes: {};
|
|
132
|
+
validateOn: string;
|
|
133
|
+
validate: {
|
|
134
|
+
required: boolean;
|
|
135
|
+
custom: string;
|
|
136
|
+
customPrivate: boolean;
|
|
137
|
+
strictDateValidation: boolean;
|
|
138
|
+
multiple: boolean;
|
|
139
|
+
unique: boolean;
|
|
140
|
+
};
|
|
141
|
+
conditional: {
|
|
142
|
+
show: null;
|
|
143
|
+
when: null;
|
|
144
|
+
eq: string;
|
|
145
|
+
};
|
|
146
|
+
overlay: {
|
|
147
|
+
style: string;
|
|
148
|
+
left: string;
|
|
149
|
+
top: string;
|
|
150
|
+
width: string;
|
|
151
|
+
height: string;
|
|
152
|
+
};
|
|
153
|
+
allowCalculateOverride: boolean;
|
|
154
|
+
encrypted: boolean;
|
|
155
|
+
showCharCount: boolean;
|
|
156
|
+
showWordCount: boolean;
|
|
157
|
+
properties: {};
|
|
158
|
+
allowMultipleMasks: boolean;
|
|
159
|
+
addons: never[];
|
|
160
|
+
tree: boolean;
|
|
161
|
+
lazyLoad: boolean;
|
|
162
|
+
theme: string;
|
|
163
|
+
breadcrumb: string;
|
|
164
|
+
}[];
|
|
165
|
+
}
|
|
166
|
+
export default _default;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"type": "form",
|
|
5
|
+
"display": "wizard",
|
|
6
|
+
"components": [
|
|
7
|
+
{
|
|
8
|
+
"title": "Page 1",
|
|
9
|
+
"breadcrumbClickable": true,
|
|
10
|
+
"buttonSettings": {
|
|
11
|
+
"previous": true,
|
|
12
|
+
"cancel": true,
|
|
13
|
+
"next": true
|
|
14
|
+
},
|
|
15
|
+
"navigateOnEnter": false,
|
|
16
|
+
"saveOnEnter": false,
|
|
17
|
+
"scrollToTop": false,
|
|
18
|
+
"collapsible": false,
|
|
19
|
+
"key": "page1",
|
|
20
|
+
"type": "panel",
|
|
21
|
+
"label": "Page 1",
|
|
22
|
+
"components": [
|
|
23
|
+
{
|
|
24
|
+
"label": "Time",
|
|
25
|
+
"disabled": true,
|
|
26
|
+
"alwaysEnabled": false,
|
|
27
|
+
"tableView": true,
|
|
28
|
+
"defaultValue": "03:03 PM",
|
|
29
|
+
"key": "time1",
|
|
30
|
+
"type": "time",
|
|
31
|
+
"input": true,
|
|
32
|
+
"inputMask": "99:99",
|
|
33
|
+
"hideOnChildrenHidden": false,
|
|
34
|
+
"id": "efw9yyq",
|
|
35
|
+
"placeholder": "",
|
|
36
|
+
"prefix": "",
|
|
37
|
+
"customClass": "",
|
|
38
|
+
"suffix": "",
|
|
39
|
+
"multiple": false,
|
|
40
|
+
"protected": false,
|
|
41
|
+
"unique": false,
|
|
42
|
+
"persistent": true,
|
|
43
|
+
"hidden": false,
|
|
44
|
+
"clearOnHide": true,
|
|
45
|
+
"refreshOn": "",
|
|
46
|
+
"redrawOn": "",
|
|
47
|
+
"modalEdit": false,
|
|
48
|
+
"dataGridLabel": false,
|
|
49
|
+
"labelPosition": "top",
|
|
50
|
+
"description": "",
|
|
51
|
+
"errorLabel": "",
|
|
52
|
+
"tooltip": "",
|
|
53
|
+
"hideLabel": false,
|
|
54
|
+
"tabindex": "",
|
|
55
|
+
"autofocus": false,
|
|
56
|
+
"dbIndex": false,
|
|
57
|
+
"customDefaultValue": "",
|
|
58
|
+
"calculateValue": "",
|
|
59
|
+
"calculateServer": false,
|
|
60
|
+
"widget": {
|
|
61
|
+
"type": "input"
|
|
62
|
+
},
|
|
63
|
+
"attributes": {},
|
|
64
|
+
"validateOn": "change",
|
|
65
|
+
"validate": {
|
|
66
|
+
"required": false,
|
|
67
|
+
"custom": "",
|
|
68
|
+
"customPrivate": false,
|
|
69
|
+
"strictDateValidation": false,
|
|
70
|
+
"multiple": false,
|
|
71
|
+
"unique": false,
|
|
72
|
+
"minLength": "",
|
|
73
|
+
"maxLength": "",
|
|
74
|
+
"pattern": ""
|
|
75
|
+
},
|
|
76
|
+
"conditional": {
|
|
77
|
+
"show": null,
|
|
78
|
+
"when": null,
|
|
79
|
+
"eq": ""
|
|
80
|
+
},
|
|
81
|
+
"overlay": {
|
|
82
|
+
"style": "",
|
|
83
|
+
"left": "",
|
|
84
|
+
"top": "",
|
|
85
|
+
"width": "",
|
|
86
|
+
"height": ""
|
|
87
|
+
},
|
|
88
|
+
"allowCalculateOverride": false,
|
|
89
|
+
"encrypted": false,
|
|
90
|
+
"showCharCount": false,
|
|
91
|
+
"showWordCount": false,
|
|
92
|
+
"properties": {},
|
|
93
|
+
"allowMultipleMasks": false,
|
|
94
|
+
"addons": [],
|
|
95
|
+
"mask": false,
|
|
96
|
+
"inputType": "time",
|
|
97
|
+
"inputFormat": "plain",
|
|
98
|
+
"displayMask": "",
|
|
99
|
+
"spellcheck": true,
|
|
100
|
+
"truncateMultipleSpaces": false,
|
|
101
|
+
"format": "HH:mm",
|
|
102
|
+
"dataFormat": "HH:mm:ss"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"input": false,
|
|
106
|
+
"tableView": false,
|
|
107
|
+
"id": "e7vej1d",
|
|
108
|
+
"placeholder": "",
|
|
109
|
+
"prefix": "",
|
|
110
|
+
"customClass": "",
|
|
111
|
+
"suffix": "",
|
|
112
|
+
"multiple": false,
|
|
113
|
+
"defaultValue": null,
|
|
114
|
+
"protected": false,
|
|
115
|
+
"unique": false,
|
|
116
|
+
"persistent": false,
|
|
117
|
+
"hidden": false,
|
|
118
|
+
"clearOnHide": false,
|
|
119
|
+
"refreshOn": "",
|
|
120
|
+
"redrawOn": "",
|
|
121
|
+
"modalEdit": false,
|
|
122
|
+
"dataGridLabel": false,
|
|
123
|
+
"labelPosition": "top",
|
|
124
|
+
"description": "",
|
|
125
|
+
"errorLabel": "",
|
|
126
|
+
"tooltip": "",
|
|
127
|
+
"hideLabel": false,
|
|
128
|
+
"tabindex": "",
|
|
129
|
+
"disabled": false,
|
|
130
|
+
"autofocus": false,
|
|
131
|
+
"dbIndex": false,
|
|
132
|
+
"customDefaultValue": "",
|
|
133
|
+
"calculateValue": "",
|
|
134
|
+
"calculateServer": false,
|
|
135
|
+
"widget": null,
|
|
136
|
+
"attributes": {},
|
|
137
|
+
"validateOn": "change",
|
|
138
|
+
"validate": {
|
|
139
|
+
"required": false,
|
|
140
|
+
"custom": "",
|
|
141
|
+
"customPrivate": false,
|
|
142
|
+
"strictDateValidation": false,
|
|
143
|
+
"multiple": false,
|
|
144
|
+
"unique": false
|
|
145
|
+
},
|
|
146
|
+
"conditional": {
|
|
147
|
+
"show": null,
|
|
148
|
+
"when": null,
|
|
149
|
+
"eq": ""
|
|
150
|
+
},
|
|
151
|
+
"overlay": {
|
|
152
|
+
"style": "",
|
|
153
|
+
"left": "",
|
|
154
|
+
"top": "",
|
|
155
|
+
"width": "",
|
|
156
|
+
"height": ""
|
|
157
|
+
},
|
|
158
|
+
"allowCalculateOverride": false,
|
|
159
|
+
"encrypted": false,
|
|
160
|
+
"showCharCount": false,
|
|
161
|
+
"showWordCount": false,
|
|
162
|
+
"properties": {},
|
|
163
|
+
"allowMultipleMasks": false,
|
|
164
|
+
"addons": [],
|
|
165
|
+
"tree": false,
|
|
166
|
+
"lazyLoad": false,
|
|
167
|
+
"theme": "default",
|
|
168
|
+
"breadcrumb": "default"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import comp1 from './comp1';
|
|
2
2
|
import comp2 from './comp2';
|
|
3
3
|
import comp3 from './comp3';
|
|
4
|
+
import comp4 from './comp4';
|
|
4
5
|
import timeForm from './timeForm';
|
|
5
6
|
import timeForm2 from './timeForm2';
|
|
6
|
-
export { comp1, comp2, comp3, timeForm, timeForm2 };
|
|
7
|
+
export { comp1, comp2, comp3, comp4, timeForm, timeForm2 };
|
|
@@ -3,13 +3,15 @@ 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.timeForm2 = exports.timeForm = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.timeForm2 = exports.timeForm = 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"));
|
|
10
10
|
exports.comp2 = comp2_1.default;
|
|
11
11
|
const comp3_1 = __importDefault(require("./comp3"));
|
|
12
12
|
exports.comp3 = comp3_1.default;
|
|
13
|
+
const comp4_1 = __importDefault(require("./comp4"));
|
|
14
|
+
exports.comp4 = comp4_1.default;
|
|
13
15
|
const timeForm_1 = __importDefault(require("./timeForm"));
|
|
14
16
|
exports.timeForm = timeForm_1.default;
|
|
15
17
|
const timeForm2_1 = __importDefault(require("./timeForm2"));
|
|
@@ -15,11 +15,6 @@ export default class WebformBuilder extends Component {
|
|
|
15
15
|
arrayDataComponentPaths: any[];
|
|
16
16
|
nestedDataComponents: any[];
|
|
17
17
|
arrayDataComponents: any[];
|
|
18
|
-
/**
|
|
19
|
-
* Returns the query parameters for the builder existing resources request
|
|
20
|
-
* @returns {object} - The object with query parameters.
|
|
21
|
-
*/
|
|
22
|
-
getExistingResourcesQuery(): object;
|
|
23
18
|
allowDrop(): boolean;
|
|
24
19
|
addExistingResourceFields(resources: any): void;
|
|
25
20
|
attachTooltip(component: any, title: any): import("tippy.js").Instance<import("tippy.js").Props>[];
|
|
@@ -182,6 +182,20 @@ export default class WebformBuilder extends Component {
|
|
|
182
182
|
// Need to set up horizontal rearrangement of fields.
|
|
183
183
|
};
|
|
184
184
|
this.options.hooks.attachComponent = this.attachComponent.bind(this);
|
|
185
|
+
// Load resources tagged as 'builder'
|
|
186
|
+
const query = {
|
|
187
|
+
params: {
|
|
188
|
+
type: 'resource',
|
|
189
|
+
limit: 1000000,
|
|
190
|
+
select: '_id,title,name,components'
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
if (this.options && this.options.resourceTag) {
|
|
194
|
+
query.params.tags = [this.options.resourceTag];
|
|
195
|
+
}
|
|
196
|
+
else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
|
|
197
|
+
query.params.tags = ['builder'];
|
|
198
|
+
}
|
|
185
199
|
const formio = new Formio(Formio.projectUrl);
|
|
186
200
|
const isResourcesDisabled = this.options.builder && this.options.builder.resource === false;
|
|
187
201
|
formio.loadProject().then((project) => {
|
|
@@ -199,7 +213,7 @@ export default class WebformBuilder extends Component {
|
|
|
199
213
|
});
|
|
200
214
|
if (!formio.noProject && !isResourcesDisabled && formio.formsUrl) {
|
|
201
215
|
const resourceOptions = this.options.builder && this.options.builder.resource;
|
|
202
|
-
formio.loadForms(
|
|
216
|
+
formio.loadForms(query)
|
|
203
217
|
.then((resources) => {
|
|
204
218
|
if (resources.length) {
|
|
205
219
|
this.builder.resource = {
|
|
@@ -233,27 +247,6 @@ export default class WebformBuilder extends Component {
|
|
|
233
247
|
this.nestedDataComponents = [];
|
|
234
248
|
this.arrayDataComponents = [];
|
|
235
249
|
}
|
|
236
|
-
/**
|
|
237
|
-
* Returns the query parameters for the builder existing resources request
|
|
238
|
-
* @returns {object} - The object with query parameters.
|
|
239
|
-
*/
|
|
240
|
-
getExistingResourcesQuery() {
|
|
241
|
-
// Load resources tagged as 'builder'
|
|
242
|
-
const query = {
|
|
243
|
-
params: {
|
|
244
|
-
type: 'resource',
|
|
245
|
-
limit: 1000000,
|
|
246
|
-
select: '_id,title,name,components'
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
if (this.options && this.options.resourceTag) {
|
|
250
|
-
query.params.tags = [this.options.resourceTag];
|
|
251
|
-
}
|
|
252
|
-
else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
|
|
253
|
-
query.params.tags = ['builder'];
|
|
254
|
-
}
|
|
255
|
-
return query;
|
|
256
|
-
}
|
|
257
250
|
allowDrop() {
|
|
258
251
|
return true;
|
|
259
252
|
}
|
|
@@ -2,6 +2,7 @@ export default class CurrencyComponent extends NumberComponent {
|
|
|
2
2
|
constructor(component: any, options: any, data: any);
|
|
3
3
|
currencyPrefix: any;
|
|
4
4
|
currencySuffix: any;
|
|
5
|
+
parseNumber(value: any): number;
|
|
5
6
|
parseValue(value: any): string | null;
|
|
6
7
|
addZerosAndFormatValue(value: any): any;
|
|
7
8
|
stripPrefixSuffix(value: any): any;
|