@formio/js 5.0.0-rc.88 → 5.0.0-rc.89
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +17 -17
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +17 -17
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +3 -3
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +8 -8
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/components/Components.js +4 -2
- package/lib/cjs/components/_classes/component/Component.js +8 -4
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/cjs/components/_classes/list/ListComponent.js +17 -0
- package/lib/cjs/components/_classes/nested/fixtures/comp4.d.ts +4 -0
- package/lib/cjs/components/_classes/nested/fixtures/comp4.js +12 -0
- package/lib/cjs/components/_classes/nested/fixtures/index.d.ts +1 -0
- package/lib/cjs/components/_classes/nested/fixtures/index.js +3 -1
- package/lib/cjs/components/address/Address.js +10 -0
- package/lib/cjs/components/day/Day.js +13 -6
- package/lib/cjs/components/radio/Radio.d.ts +1 -1
- package/lib/cjs/components/radio/Radio.js +32 -1
- package/lib/cjs/components/radio/fixtures/comp13.d.ts +49 -0
- package/lib/cjs/components/radio/fixtures/comp13.js +49 -0
- package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/cjs/components/select/Select.d.ts +0 -4
- package/lib/cjs/components/select/Select.js +0 -16
- package/lib/cjs/components/selectboxes/fixtures/comp8.d.ts +49 -0
- package/lib/cjs/components/selectboxes/fixtures/comp8.js +49 -0
- package/lib/cjs/components/tags/fixtures/index.d.ts +1 -1
- package/lib/cjs/components/tags/fixtures/index.js +5 -1
- package/lib/cjs/utils/utils.d.ts +1 -1
- package/lib/cjs/utils/utils.js +1 -13
- package/lib/mjs/components/Components.js +4 -2
- package/lib/mjs/components/_classes/component/Component.js +5 -1
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/mjs/components/_classes/list/ListComponent.js +17 -0
- package/lib/mjs/components/_classes/nested/fixtures/comp4.d.ts +4 -0
- package/lib/mjs/components/_classes/nested/fixtures/comp4.js +7 -0
- package/lib/mjs/components/_classes/nested/fixtures/index.d.ts +1 -0
- package/lib/mjs/components/_classes/nested/fixtures/index.js +1 -0
- package/lib/mjs/components/address/Address.js +10 -0
- package/lib/mjs/components/day/Day.js +13 -6
- package/lib/mjs/components/radio/Radio.d.ts +1 -1
- package/lib/mjs/components/radio/Radio.js +32 -1
- package/lib/mjs/components/radio/fixtures/comp13.d.ts +49 -0
- package/lib/mjs/components/radio/fixtures/comp13.js +47 -0
- package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/lib/mjs/components/select/Select.d.ts +0 -4
- package/lib/mjs/components/select/Select.js +0 -16
- package/lib/mjs/components/selectboxes/fixtures/comp8.d.ts +49 -0
- package/lib/mjs/components/selectboxes/fixtures/comp8.js +47 -0
- package/lib/mjs/components/tags/fixtures/index.d.ts +1 -1
- package/lib/mjs/components/tags/fixtures/index.js +3 -1
- package/lib/mjs/utils/utils.d.ts +1 -1
- package/lib/mjs/utils/utils.js +1 -2
- package/package.json +2 -2
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
|
22
22
|
|
23
|
-
/*! formiojs v5.0.0-rc.
|
23
|
+
/*! formiojs v5.0.0-rc.89 | https://unpkg.com/formiojs@5.0.0-rc.89/LICENSE.txt */
|
24
24
|
|
25
25
|
/**
|
26
26
|
* @license
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Component_1 = __importDefault(require("./_classes/component/Component"));
|
7
7
|
const utils_1 = __importDefault(require("./_classes/component/editForm/utils"));
|
8
8
|
const Component_form_1 = __importDefault(require("./_classes/component/Component.form"));
|
9
|
+
const utils_2 = require("../utils/utils");
|
9
10
|
const lodash_1 = __importDefault(require("lodash"));
|
10
11
|
class Components {
|
11
12
|
static set EditFormUtils(value) {
|
@@ -56,7 +57,8 @@ class Components {
|
|
56
57
|
static getComponentPath(component) {
|
57
58
|
var _a;
|
58
59
|
let path = '';
|
59
|
-
|
60
|
+
const componentKey = (0, utils_2.getComponentKey)(component.component);
|
61
|
+
if (componentKey) {
|
60
62
|
let thisPath = ((_a = component.options) === null || _a === void 0 ? void 0 : _a.parent) || component;
|
61
63
|
while (thisPath && !thisPath.allowData && thisPath.parent) {
|
62
64
|
thisPath = thisPath.parent;
|
@@ -68,7 +70,7 @@ class Components {
|
|
68
70
|
const rowIndex = component.row;
|
69
71
|
const rowIndexPath = rowIndex && !['container'].includes(thisPath.component.type) ? `[${Number.parseInt(rowIndex)}]` : '';
|
70
72
|
path = `${thisPath.path}${rowIndexPath}.`;
|
71
|
-
path +=
|
73
|
+
path += componentKey;
|
72
74
|
return lodash_1.default.trim(path, '.');
|
73
75
|
}
|
74
76
|
return path;
|
@@ -2937,7 +2937,7 @@ class Component extends Element_1.default {
|
|
2937
2937
|
if (this.options.alwaysDirty) {
|
2938
2938
|
flags.dirty = true;
|
2939
2939
|
}
|
2940
|
-
if (flags.fromSubmission && this.hasValue(data)) {
|
2940
|
+
if (flags.fromSubmission && this.hasValue(data) && !(this.pristine && this.protected)) {
|
2941
2941
|
flags.dirty = true;
|
2942
2942
|
}
|
2943
2943
|
this.setDirty(flags.dirty);
|
@@ -2964,6 +2964,7 @@ class Component extends Element_1.default {
|
|
2964
2964
|
value: this.validationValue,
|
2965
2965
|
path: this.path || this.component.key,
|
2966
2966
|
instance: this,
|
2967
|
+
form: this.root ? this.root._form : {},
|
2967
2968
|
scope: { errors: [] },
|
2968
2969
|
processors: [
|
2969
2970
|
process_1.validateProcessInfo
|
@@ -3436,13 +3437,16 @@ class Component extends Element_1.default {
|
|
3436
3437
|
window.scrollTo(verticalOnly ? window.scrollX : left + window.scrollX, top + window.scrollY);
|
3437
3438
|
}
|
3438
3439
|
focus(index = (this.refs.input.length - 1)) {
|
3439
|
-
var _a, _b;
|
3440
|
+
var _a, _b, _c, _d;
|
3440
3441
|
if ('beforeFocus' in this.parent) {
|
3441
3442
|
this.parent.beforeFocus(this);
|
3442
3443
|
}
|
3443
|
-
if ((_a = this.refs
|
3444
|
+
if (!index && !lodash_1.default.isNumber(index) && ((_b = (_a = this.refs) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.length)) {
|
3445
|
+
index = this.refs.input.length - 1;
|
3446
|
+
}
|
3447
|
+
if ((_c = this.refs.input) === null || _c === void 0 ? void 0 : _c.length) {
|
3444
3448
|
const focusingInput = this.refs.input[index];
|
3445
|
-
if (((
|
3449
|
+
if (((_d = this.component.widget) === null || _d === void 0 ? void 0 : _d.type) === 'calendar') {
|
3446
3450
|
const sibling = focusingInput.nextSibling;
|
3447
3451
|
if (sibling) {
|
3448
3452
|
sibling.focus();
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export default class ListComponent extends Field {
|
2
2
|
get isSelectURL(): boolean;
|
3
3
|
get selectData(): any;
|
4
|
+
get dataReady(): any;
|
4
5
|
get shouldLoad(): boolean;
|
5
6
|
getTemplateKeys(): void;
|
6
7
|
templateKeys: string[] | undefined;
|
@@ -10,6 +11,9 @@ export default class ListComponent extends Field {
|
|
10
11
|
loadItems(): void;
|
11
12
|
getOptionTemplate(data: any, value: any, index: any): any;
|
12
13
|
itemTemplate(data: any, value: any, index: any): any;
|
14
|
+
set itemsLoaded(promise: any);
|
15
|
+
get itemsLoaded(): any;
|
16
|
+
_itemsLoaded: any;
|
13
17
|
handleLoadingError(err: any): void;
|
14
18
|
loading: boolean | undefined;
|
15
19
|
networkError: boolean | undefined;
|
@@ -26,6 +26,16 @@ class ListComponent extends Field_1.default {
|
|
26
26
|
const selectData = lodash_1.default.get(this.root, 'submission.metadata.selectData', {});
|
27
27
|
return lodash_1.default.get(selectData, this.path);
|
28
28
|
}
|
29
|
+
get dataReady() {
|
30
|
+
// If the root submission has been set, and we are still not attached, then assume
|
31
|
+
// that our data is ready.
|
32
|
+
if (this.root &&
|
33
|
+
this.root.submissionSet &&
|
34
|
+
!this.attached) {
|
35
|
+
return Promise.resolve();
|
36
|
+
}
|
37
|
+
return this.itemsLoaded;
|
38
|
+
}
|
29
39
|
get shouldLoad() {
|
30
40
|
if (this.loadingError) {
|
31
41
|
return false;
|
@@ -112,6 +122,12 @@ class ListComponent extends Field_1.default {
|
|
112
122
|
return this.sanitize(JSON.stringify(data), this.shouldSanitizeValue);
|
113
123
|
}
|
114
124
|
}
|
125
|
+
get itemsLoaded() {
|
126
|
+
return this._itemsLoaded || Promise.resolve();
|
127
|
+
}
|
128
|
+
set itemsLoaded(promise) {
|
129
|
+
this._itemsLoaded = promise;
|
130
|
+
}
|
115
131
|
handleLoadingError(err) {
|
116
132
|
this.loading = false;
|
117
133
|
if (err.networkError) {
|
@@ -174,6 +190,7 @@ class ListComponent extends Field_1.default {
|
|
174
190
|
return;
|
175
191
|
}
|
176
192
|
let { url } = this.component.data;
|
193
|
+
url = lodash_1.default.trim(url);
|
177
194
|
let method;
|
178
195
|
let body;
|
179
196
|
if (url.startsWith('/')) {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const comp2_1 = __importDefault(require("../checkbox/comp2"));
|
7
|
+
exports.default = {
|
8
|
+
components: [
|
9
|
+
Object.assign({}, comp2_1.default),
|
10
|
+
Object.assign(Object.assign({}, comp2_1.default), { value: 'false' })
|
11
|
+
]
|
12
|
+
};
|
@@ -3,10 +3,12 @@ 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.comp3 = exports.comp2 = exports.comp1 = void 0;
|
6
|
+
exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
7
7
|
var comp1_1 = require("./comp1");
|
8
8
|
Object.defineProperty(exports, "comp1", { enumerable: true, get: function () { return __importDefault(comp1_1).default; } });
|
9
9
|
var comp2_1 = require("./comp2");
|
10
10
|
Object.defineProperty(exports, "comp2", { enumerable: true, get: function () { return __importDefault(comp2_1).default; } });
|
11
11
|
var comp3_1 = require("./comp3");
|
12
12
|
Object.defineProperty(exports, "comp3", { enumerable: true, get: function () { return __importDefault(comp3_1).default; } });
|
13
|
+
var comp4_1 = require("./comp4");
|
14
|
+
Object.defineProperty(exports, "comp4", { enumerable: true, get: function () { return __importDefault(comp4_1).default; } });
|
@@ -214,6 +214,16 @@ class AddressComponent extends Container_1.default {
|
|
214
214
|
isValueInLegacyFormat(value) {
|
215
215
|
return value && !value.mode;
|
216
216
|
}
|
217
|
+
set dataValue(value) {
|
218
|
+
super.dataValue = value;
|
219
|
+
}
|
220
|
+
get dataValue() {
|
221
|
+
const resultValue = lodash_1.default.get(this._data, this.component.path);
|
222
|
+
if (!lodash_1.default.isArray(resultValue) && this.component.multiple) {
|
223
|
+
return [resultValue];
|
224
|
+
}
|
225
|
+
return super.dataValue;
|
226
|
+
}
|
217
227
|
normalizeValue(value) {
|
218
228
|
return (this.manualModeEnabled && this.isValueInLegacyFormat(value))
|
219
229
|
? {
|
@@ -497,26 +497,33 @@ class DayComponent extends Field_1.default {
|
|
497
497
|
defaults = defaultValue.split('/').map(x => parseInt(x, 10));
|
498
498
|
}
|
499
499
|
if (this.showDay && this.refs.day) {
|
500
|
-
day = parseInt(this.refs.day.value, 10);
|
500
|
+
day = this.refs.day.value === '' ? '' : parseInt(this.refs.day.value, 10);
|
501
501
|
}
|
502
502
|
if (day === undefined || lodash_1.default.isNaN(day)) {
|
503
|
-
day = defaults
|
503
|
+
day = (defaults.length !== 3 && value)
|
504
|
+
? this.getDayWithHiddenFields(defaults).day
|
505
|
+
: (defaults[DAY] && !lodash_1.default.isNaN(defaults[DAY]) ? defaults[DAY] : 0);
|
504
506
|
}
|
505
507
|
if (this.showMonth && this.refs.month) {
|
506
508
|
// Months are 0 indexed.
|
507
|
-
month = parseInt(this.refs.month.value, 10);
|
509
|
+
month = this.refs.month.value === '' ? '' : parseInt(this.refs.month.value, 10);
|
508
510
|
}
|
509
511
|
if (month === undefined || lodash_1.default.isNaN(month)) {
|
510
|
-
month = defaults
|
512
|
+
month = (defaults.length !== 3 && value)
|
513
|
+
? this.getDayWithHiddenFields(defaults).month
|
514
|
+
: (defaults[MONTH] && !lodash_1.default.isNaN(defaults[MONTH]) ? defaults[MONTH] : 0);
|
511
515
|
}
|
512
516
|
if (this.showYear && this.refs.year) {
|
513
|
-
year = parseInt(this.refs.year.value);
|
517
|
+
year = this.refs.year.value === '' ? '' : parseInt(this.refs.year.value);
|
514
518
|
}
|
515
519
|
if (year === undefined || lodash_1.default.isNaN(year)) {
|
516
|
-
year = defaults
|
520
|
+
year = (defaults.length !== 3 && value)
|
521
|
+
? this.getDayWithHiddenFields(defaults).year
|
522
|
+
: (defaults[YEAR] && !lodash_1.default.isNaN(defaults[YEAR]) ? defaults[YEAR] : 0);
|
517
523
|
}
|
518
524
|
let result;
|
519
525
|
if (!day && !month && !year) {
|
526
|
+
this.dataValue = this.emptyValue;
|
520
527
|
return null;
|
521
528
|
}
|
522
529
|
// add trailing zeros if the data is showed
|
@@ -23,10 +23,10 @@ export default class RadioComponent extends ListComponent {
|
|
23
23
|
get listData(): any;
|
24
24
|
templateData: {} | undefined;
|
25
25
|
triggerUpdate: ((...args: any[]) => any) | undefined;
|
26
|
-
itemsLoaded: Promise<any> | undefined;
|
27
26
|
itemsLoadedResolve: ((value: any) => void) | undefined;
|
28
27
|
optionsLoaded: boolean | undefined;
|
29
28
|
loadedOptions: any[] | undefined;
|
29
|
+
beforeSubmit(): Promise<any>;
|
30
30
|
render(): import("../_classes/field/Field").default;
|
31
31
|
attach(element: any): Promise<void>;
|
32
32
|
detach(element: any): void;
|
@@ -79,6 +79,14 @@ class RadioComponent extends ListComponent_1.default {
|
|
79
79
|
}
|
80
80
|
return defaultValue;
|
81
81
|
}
|
82
|
+
resetValue() {
|
83
|
+
this.unset();
|
84
|
+
this.setValue(this.emptyValue, {
|
85
|
+
noUpdateEvent: true,
|
86
|
+
noValidate: true,
|
87
|
+
resetValue: true
|
88
|
+
});
|
89
|
+
}
|
82
90
|
get inputInfo() {
|
83
91
|
var _a;
|
84
92
|
const info = super.elementInfo();
|
@@ -126,12 +134,23 @@ class RadioComponent extends ListComponent_1.default {
|
|
126
134
|
this.itemsLoaded = new Promise((resolve) => {
|
127
135
|
this.itemsLoadedResolve = resolve;
|
128
136
|
});
|
129
|
-
this.optionsLoaded =
|
137
|
+
this.optionsLoaded = !this.component.dataSrc || this.component.dataSrc === 'values';
|
130
138
|
this.loadedOptions = [];
|
139
|
+
if (!this.visible) {
|
140
|
+
this.itemsLoadedResolve();
|
141
|
+
}
|
131
142
|
// Get the template keys for this radio component.
|
132
143
|
this.getTemplateKeys();
|
133
144
|
}
|
145
|
+
beforeSubmit() {
|
146
|
+
return new Promise(res => {
|
147
|
+
this.dataReady.then(() => res(true));
|
148
|
+
});
|
149
|
+
}
|
134
150
|
render() {
|
151
|
+
if (!this.optionsLoaded) {
|
152
|
+
return super.render(this.renderTemplate('loader'));
|
153
|
+
}
|
135
154
|
return super.render(this.renderTemplate('radio', {
|
136
155
|
input: this.inputInfo,
|
137
156
|
inline: this.component.inline,
|
@@ -242,12 +261,22 @@ class RadioComponent extends ListComponent_1.default {
|
|
242
261
|
this.refs.input[index].checked = (inputValue === value.toString());
|
243
262
|
}
|
244
263
|
}
|
264
|
+
get shouldLoad() {
|
265
|
+
// do not load options if the value is empty in readOnly and we have options available in metadata
|
266
|
+
if (this.options.readOnly && this.isEmpty() && this.listData) {
|
267
|
+
return false;
|
268
|
+
}
|
269
|
+
return super.shouldLoad;
|
270
|
+
}
|
245
271
|
loadItems(url, search, headers, options, method, body) {
|
246
272
|
if (this.optionsLoaded) {
|
273
|
+
this.itemsLoadedResolve();
|
247
274
|
return;
|
248
275
|
}
|
249
276
|
if (!this.shouldLoad && this.listData) {
|
250
277
|
this.loadItemsFromMetadata();
|
278
|
+
this.itemsLoadedResolve();
|
279
|
+
this.optionsLoaded = true;
|
251
280
|
return;
|
252
281
|
}
|
253
282
|
// Ensure we have a method and remove any body if method is get
|
@@ -268,6 +297,7 @@ class RadioComponent extends ListComponent_1.default {
|
|
268
297
|
this.redraw();
|
269
298
|
})
|
270
299
|
.catch((err) => {
|
300
|
+
this.optionsLoaded = true;
|
271
301
|
this.handleLoadingError(err);
|
272
302
|
});
|
273
303
|
}
|
@@ -308,6 +338,7 @@ class RadioComponent extends ListComponent_1.default {
|
|
308
338
|
}
|
309
339
|
lodash_1.default.set(submission.metadata.listData, this.path, listData);
|
310
340
|
}
|
341
|
+
this.itemsLoadedResolve();
|
311
342
|
}
|
312
343
|
setSelectedClasses() {
|
313
344
|
if (this.refs.wrapper) {
|
@@ -0,0 +1,49 @@
|
|
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 components: ({
|
9
|
+
label: string;
|
10
|
+
optionsLabelPosition: string;
|
11
|
+
inline: boolean;
|
12
|
+
tableView: boolean;
|
13
|
+
dataSrc: string;
|
14
|
+
values: {
|
15
|
+
label: string;
|
16
|
+
value: string;
|
17
|
+
shortcut: string;
|
18
|
+
}[];
|
19
|
+
valueProperty: string;
|
20
|
+
validateWhenHidden: boolean;
|
21
|
+
key: string;
|
22
|
+
type: string;
|
23
|
+
data: {
|
24
|
+
url: string;
|
25
|
+
headers: {
|
26
|
+
key: string;
|
27
|
+
value: string;
|
28
|
+
}[];
|
29
|
+
};
|
30
|
+
input: boolean;
|
31
|
+
disableOnInvalid?: undefined;
|
32
|
+
} | {
|
33
|
+
type: string;
|
34
|
+
label: string;
|
35
|
+
key: string;
|
36
|
+
disableOnInvalid: boolean;
|
37
|
+
input: boolean;
|
38
|
+
tableView: boolean;
|
39
|
+
optionsLabelPosition?: undefined;
|
40
|
+
inline?: undefined;
|
41
|
+
dataSrc?: undefined;
|
42
|
+
values?: undefined;
|
43
|
+
valueProperty?: undefined;
|
44
|
+
validateWhenHidden?: undefined;
|
45
|
+
data?: undefined;
|
46
|
+
})[];
|
47
|
+
let project: string;
|
48
|
+
}
|
49
|
+
export default _default;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = {
|
4
|
+
_id: '66ebe22841267c275a4cb34e',
|
5
|
+
title: 'test radio url 1',
|
6
|
+
name: 'testRadioUrl1',
|
7
|
+
path: 'testradiourl1',
|
8
|
+
type: 'form',
|
9
|
+
display: 'form',
|
10
|
+
components: [
|
11
|
+
{
|
12
|
+
label: 'Radio',
|
13
|
+
optionsLabelPosition: 'right',
|
14
|
+
inline: false,
|
15
|
+
tableView: false,
|
16
|
+
dataSrc: 'url',
|
17
|
+
values: [
|
18
|
+
{
|
19
|
+
label: '',
|
20
|
+
value: '',
|
21
|
+
shortcut: '',
|
22
|
+
},
|
23
|
+
],
|
24
|
+
valueProperty: 'identifier',
|
25
|
+
validateWhenHidden: false,
|
26
|
+
key: 'radio',
|
27
|
+
type: 'radio',
|
28
|
+
data: {
|
29
|
+
url: 'https://test.test/options',
|
30
|
+
headers: [
|
31
|
+
{
|
32
|
+
key: '',
|
33
|
+
value: '',
|
34
|
+
},
|
35
|
+
],
|
36
|
+
},
|
37
|
+
input: true,
|
38
|
+
},
|
39
|
+
{
|
40
|
+
type: 'button',
|
41
|
+
label: 'Submit',
|
42
|
+
key: 'submit',
|
43
|
+
disableOnInvalid: true,
|
44
|
+
input: true,
|
45
|
+
tableView: false,
|
46
|
+
},
|
47
|
+
],
|
48
|
+
project: '66e930e238963ab0230de6df',
|
49
|
+
};
|
@@ -10,4 +10,5 @@ import comp9 from './comp9';
|
|
10
10
|
import comp10 from './comp10';
|
11
11
|
import comp11 from './comp11';
|
12
12
|
import comp12 from './comp12';
|
13
|
-
|
13
|
+
import comp13 from './comp13';
|
14
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13 };
|
@@ -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.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
6
|
+
exports.comp13 = exports.comp12 = exports.comp11 = 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"));
|
@@ -28,3 +28,5 @@ const comp11_1 = __importDefault(require("./comp11"));
|
|
28
28
|
exports.comp11 = comp11_1.default;
|
29
29
|
const comp12_1 = __importDefault(require("./comp12"));
|
30
30
|
exports.comp12 = comp12_1.default;
|
31
|
+
const comp13_1 = __importDefault(require("./comp13"));
|
32
|
+
exports.comp13 = comp13_1.default;
|
@@ -54,8 +54,6 @@ export default class SelectComponent extends ListComponent {
|
|
54
54
|
static savedValueTypes(schema: any): any[];
|
55
55
|
templateData: {} | undefined;
|
56
56
|
triggerUpdate: ((...args: any[]) => any) | undefined;
|
57
|
-
set itemsLoaded(promise: any);
|
58
|
-
get itemsLoaded(): any;
|
59
57
|
itemsLoadedResolve: ((value: any) => void) | undefined;
|
60
58
|
isFromSearch: boolean | undefined;
|
61
59
|
searchServerCount: any;
|
@@ -65,7 +63,6 @@ export default class SelectComponent extends ListComponent {
|
|
65
63
|
defaultDownloadedResources: any;
|
66
64
|
activated: boolean | undefined;
|
67
65
|
shouldPositionDropdown: any;
|
68
|
-
get dataReady(): any;
|
69
66
|
get emptyValue(): {};
|
70
67
|
get valueProperty(): any;
|
71
68
|
get inputInfo(): any;
|
@@ -141,7 +138,6 @@ export default class SelectComponent extends ListComponent {
|
|
141
138
|
lazyLoadInit: boolean | undefined;
|
142
139
|
isInitApiCallNeeded(hasValue: any): any;
|
143
140
|
setChoicesValue(value: any, hasPreviousValue: any, flags?: {}): void;
|
144
|
-
_itemsLoaded: any;
|
145
141
|
validateValueAvailability(setting: any, value: any): boolean;
|
146
142
|
/**
|
147
143
|
* Performs required transformations on the initial value to use in selectOptions
|
@@ -151,16 +151,6 @@ class SelectComponent extends ListComponent_1.default {
|
|
151
151
|
// Get the template keys for this select component.
|
152
152
|
this.getTemplateKeys();
|
153
153
|
}
|
154
|
-
get dataReady() {
|
155
|
-
// If the root submission has been set, and we are still not attached, then assume
|
156
|
-
// that our data is ready.
|
157
|
-
if (this.root &&
|
158
|
-
this.root.submissionSet &&
|
159
|
-
!this.attached) {
|
160
|
-
return Promise.resolve();
|
161
|
-
}
|
162
|
-
return this.itemsLoaded;
|
163
|
-
}
|
164
154
|
get defaultSchema() {
|
165
155
|
return SelectComponent.schema();
|
166
156
|
}
|
@@ -1370,12 +1360,6 @@ class SelectComponent extends ListComponent_1.default {
|
|
1370
1360
|
}
|
1371
1361
|
}
|
1372
1362
|
}
|
1373
|
-
get itemsLoaded() {
|
1374
|
-
return this._itemsLoaded || Promise.resolve();
|
1375
|
-
}
|
1376
|
-
set itemsLoaded(promise) {
|
1377
|
-
this._itemsLoaded = promise;
|
1378
|
-
}
|
1379
1363
|
validateValueAvailability(setting, value) {
|
1380
1364
|
if (!(0, utils_1.boolValue)(setting) || !value) {
|
1381
1365
|
return true;
|
@@ -0,0 +1,49 @@
|
|
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 components: ({
|
9
|
+
label: string;
|
10
|
+
optionsLabelPosition: string;
|
11
|
+
tableView: boolean;
|
12
|
+
dataSrc: string;
|
13
|
+
values: {
|
14
|
+
label: string;
|
15
|
+
value: string;
|
16
|
+
shortcut: string;
|
17
|
+
}[];
|
18
|
+
valueProperty: string;
|
19
|
+
validateWhenHidden: boolean;
|
20
|
+
key: string;
|
21
|
+
type: string;
|
22
|
+
data: {
|
23
|
+
url: string;
|
24
|
+
headers: {
|
25
|
+
key: string;
|
26
|
+
value: string;
|
27
|
+
}[];
|
28
|
+
};
|
29
|
+
input: boolean;
|
30
|
+
inputType: string;
|
31
|
+
disableOnInvalid?: undefined;
|
32
|
+
} | {
|
33
|
+
type: string;
|
34
|
+
label: string;
|
35
|
+
key: string;
|
36
|
+
disableOnInvalid: boolean;
|
37
|
+
input: boolean;
|
38
|
+
tableView: boolean;
|
39
|
+
optionsLabelPosition?: undefined;
|
40
|
+
dataSrc?: undefined;
|
41
|
+
values?: undefined;
|
42
|
+
valueProperty?: undefined;
|
43
|
+
validateWhenHidden?: undefined;
|
44
|
+
data?: undefined;
|
45
|
+
inputType?: undefined;
|
46
|
+
})[];
|
47
|
+
let project: string;
|
48
|
+
}
|
49
|
+
export default _default;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = {
|
4
|
+
_id: '66ebfb1141267c275a4cce11',
|
5
|
+
title: 'test selectboxes url',
|
6
|
+
name: 'testSelectboxesUrl',
|
7
|
+
path: 'testselectboxesurl',
|
8
|
+
type: 'form',
|
9
|
+
display: 'form',
|
10
|
+
components: [
|
11
|
+
{
|
12
|
+
label: 'Select Boxes',
|
13
|
+
optionsLabelPosition: 'right',
|
14
|
+
tableView: false,
|
15
|
+
dataSrc: 'url',
|
16
|
+
values: [
|
17
|
+
{
|
18
|
+
label: '',
|
19
|
+
value: '',
|
20
|
+
shortcut: '',
|
21
|
+
},
|
22
|
+
],
|
23
|
+
valueProperty: 'identifier',
|
24
|
+
validateWhenHidden: false,
|
25
|
+
key: 'selectBoxes',
|
26
|
+
type: 'selectboxes',
|
27
|
+
data: {
|
28
|
+
url: 'https://test.test/options',
|
29
|
+
headers: [
|
30
|
+
{
|
31
|
+
key: '',
|
32
|
+
value: '',
|
33
|
+
},
|
34
|
+
],
|
35
|
+
},
|
36
|
+
input: true,
|
37
|
+
inputType: 'checkbox',
|
38
|
+
},
|
39
|
+
{
|
40
|
+
type: 'button',
|
41
|
+
label: 'Submit',
|
42
|
+
key: 'submit',
|
43
|
+
disableOnInvalid: true,
|
44
|
+
input: true,
|
45
|
+
tableView: false,
|
46
|
+
},
|
47
|
+
],
|
48
|
+
project: '66e930e238963ab0230de6df',
|
49
|
+
};
|
@@ -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.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
6
|
+
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"));
|
@@ -16,3 +16,7 @@ const comp5_1 = __importDefault(require("./comp5"));
|
|
16
16
|
exports.comp5 = comp5_1.default;
|
17
17
|
const comp6_1 = __importDefault(require("./comp6"));
|
18
18
|
exports.comp6 = comp6_1.default;
|
19
|
+
const comp7_1 = __importDefault(require("./comp7"));
|
20
|
+
exports.comp7 = comp7_1.default;
|
21
|
+
const comp8_1 = __importDefault(require("./comp8"));
|
22
|
+
exports.comp8 = comp8_1.default;
|
package/lib/cjs/utils/utils.d.ts
CHANGED
@@ -531,4 +531,4 @@ import jsonLogic from 'json-logic-js';
|
|
531
531
|
import ConditionOperators from './conditionOperators';
|
532
532
|
import { Evaluator } from './Evaluator';
|
533
533
|
export const interpolate: typeof Evaluator.interpolate;
|
534
|
-
export { jsonLogic, ConditionOperators, Evaluator, _ };
|
534
|
+
export { jsonLogic, ConditionOperators, moment, Evaluator, _ };
|