@formio/js 5.0.0-rc.22 → 5.0.0-rc.24
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/README.md +24 -30
- package/dist/formio.builder.css +2 -0
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +2 -0
- package/dist/formio.form.js +14 -25
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.css +2 -0
- package/dist/formio.full.js +15 -26
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Embed.d.ts +4 -2
- package/lib/cjs/Embed.js +55 -42
- package/lib/cjs/WebformBuilder.js +1 -1
- package/lib/cjs/components/_classes/component/Component.js +3 -3
- package/lib/cjs/components/_classes/field/Field.d.ts +1 -0
- package/lib/cjs/components/_classes/field/Field.js +14 -0
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.js +6 -3
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +0 -14
- package/lib/cjs/components/day/Day.d.ts +0 -1
- package/lib/cjs/components/day/Day.js +34 -14
- package/lib/cjs/components/day/fixtures/comp6.d.ts +81 -0
- package/lib/cjs/components/day/fixtures/comp6.js +76 -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/radio/Radio.js +22 -12
- package/lib/cjs/components/select/Select.d.ts +2 -0
- package/lib/cjs/components/select/Select.js +6 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.js +9 -0
- package/lib/cjs/components/selectboxes/fixtures/comp7.d.ts +18 -0
- package/lib/cjs/components/selectboxes/fixtures/comp7.js +31 -0
- package/lib/cjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/selectboxes/fixtures/index.js +3 -1
- package/lib/cjs/components/signature/Signature.d.ts +1 -2
- package/lib/cjs/components/signature/Signature.js +1 -2
- package/lib/cjs/utils/ChoicesWrapper.d.ts +1 -0
- package/lib/cjs/utils/ChoicesWrapper.js +19 -0
- package/lib/cjs/utils/utils.js +3 -3
- package/lib/mjs/Embed.d.ts +4 -2
- package/lib/mjs/Embed.js +54 -43
- package/lib/mjs/WebformBuilder.js +1 -1
- package/lib/mjs/components/_classes/component/Component.js +3 -3
- package/lib/mjs/components/_classes/field/Field.d.ts +1 -0
- package/lib/mjs/components/_classes/field/Field.js +13 -0
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.js +6 -3
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +0 -13
- package/lib/mjs/components/day/Day.d.ts +0 -1
- package/lib/mjs/components/day/Day.js +33 -14
- package/lib/mjs/components/day/fixtures/comp6.d.ts +81 -0
- package/lib/mjs/components/day/fixtures/comp6.js +74 -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/radio/Radio.js +22 -12
- package/lib/mjs/components/select/Select.d.ts +2 -0
- package/lib/mjs/components/select/Select.js +6 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.js +10 -1
- package/lib/mjs/components/selectboxes/fixtures/comp7.d.ts +18 -0
- package/lib/mjs/components/selectboxes/fixtures/comp7.js +29 -0
- package/lib/mjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/selectboxes/fixtures/index.js +2 -1
- package/lib/mjs/components/signature/Signature.d.ts +1 -2
- package/lib/mjs/components/signature/Signature.js +1 -2
- package/lib/mjs/utils/ChoicesWrapper.d.ts +1 -0
- package/lib/mjs/utils/ChoicesWrapper.js +19 -0
- package/lib/mjs/utils/utils.js +3 -3
- package/package.json +3 -4
@@ -1,5 +1,5 @@
|
|
1
1
|
import _ from 'lodash';
|
2
|
-
import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
|
2
|
+
import { componentValueTypes, getComponentSavedTypes, boolValue } from '../../utils/utils';
|
3
3
|
import RadioComponent from '../radio/Radio';
|
4
4
|
export default class SelectBoxesComponent extends RadioComponent {
|
5
5
|
static schema(...extend) {
|
@@ -243,4 +243,13 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
243
243
|
}
|
244
244
|
return super.checkComponentValidity(data, dirty, rowData, options);
|
245
245
|
}
|
246
|
+
validateValueAvailability(setting, value) {
|
247
|
+
if (!boolValue(setting) || !value) {
|
248
|
+
return true;
|
249
|
+
}
|
250
|
+
const values = this.component.values;
|
251
|
+
const availableValueKeys = (values || []).map(({ value: optionValue }) => optionValue);
|
252
|
+
const valueKeys = Object.keys(value);
|
253
|
+
return valueKeys.every((key) => availableValueKeys.includes(key));
|
254
|
+
}
|
246
255
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
const label: string;
|
3
|
+
const optionsLabelPosition: string;
|
4
|
+
const tableView: boolean;
|
5
|
+
const values: {
|
6
|
+
label: string;
|
7
|
+
value: string;
|
8
|
+
shortcut: string;
|
9
|
+
}[];
|
10
|
+
namespace validate {
|
11
|
+
const onlyAvailableItems: boolean;
|
12
|
+
}
|
13
|
+
const key: string;
|
14
|
+
const type: string;
|
15
|
+
const input: boolean;
|
16
|
+
const inputType: string;
|
17
|
+
}
|
18
|
+
export default _default;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export default {
|
2
|
+
label: 'Select Boxes',
|
3
|
+
optionsLabelPosition: 'right',
|
4
|
+
tableView: false,
|
5
|
+
values: [
|
6
|
+
{
|
7
|
+
label: 'a',
|
8
|
+
value: 'a',
|
9
|
+
shortcut: '',
|
10
|
+
},
|
11
|
+
{
|
12
|
+
label: 'b',
|
13
|
+
value: 'b',
|
14
|
+
shortcut: '',
|
15
|
+
},
|
16
|
+
{
|
17
|
+
label: 'c',
|
18
|
+
value: 'c',
|
19
|
+
shortcut: '',
|
20
|
+
},
|
21
|
+
],
|
22
|
+
validate: {
|
23
|
+
onlyAvailableItems: true,
|
24
|
+
},
|
25
|
+
key: 'selectBoxes',
|
26
|
+
type: 'selectboxes',
|
27
|
+
input: true,
|
28
|
+
inputType: 'checkbox',
|
29
|
+
};
|
@@ -37,11 +37,10 @@ export default class SignatureComponent extends Input {
|
|
37
37
|
onDisabled(): void;
|
38
38
|
checkSize(force: any, scale: any): void;
|
39
39
|
signaturePad: SignaturePad | null | undefined;
|
40
|
-
observer:
|
40
|
+
observer: any;
|
41
41
|
getValueAsString(value: any): "" | "Yes" | "No";
|
42
42
|
focus(): void;
|
43
43
|
setDataToSigaturePad(): void;
|
44
44
|
}
|
45
45
|
import Input from '../_classes/input/Input';
|
46
46
|
import SignaturePad from 'signature_pad';
|
47
|
-
import _ResizeObserver from 'resize-observer-polyfill';
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import SignaturePad from 'signature_pad';
|
2
|
-
import _ResizeObserver from 'resize-observer-polyfill';
|
3
2
|
import Input from '../_classes/input/Input';
|
4
3
|
import _ from 'lodash';
|
5
4
|
import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
|
@@ -199,7 +198,7 @@ export default class SignatureComponent extends Input {
|
|
199
198
|
this.refs.padBody.style.maxWidth = '100%';
|
200
199
|
}
|
201
200
|
if (!this.builderMode && !this.options.preview) {
|
202
|
-
this.observer = new
|
201
|
+
this.observer = new ResizeObserver(() => {
|
203
202
|
this.checkSize();
|
204
203
|
});
|
205
204
|
this.observer.observe(this.refs.padBody);
|
@@ -19,6 +19,7 @@ declare class ChoicesWrapper extends Choices {
|
|
19
19
|
}): void;
|
20
20
|
isDirectionUsing: boolean;
|
21
21
|
shouldOpenDropDown: boolean;
|
22
|
+
_onTouchEnd(event: any): void;
|
22
23
|
_handleButtonAction(activeItems: any, element: any): void;
|
23
24
|
_onEnterKey(args: any): void;
|
24
25
|
_onDirectionKey(...args: any[]): void;
|
@@ -44,6 +44,25 @@ class ChoicesWrapper extends Choices {
|
|
44
44
|
this.isDirectionUsing = false;
|
45
45
|
this.shouldOpenDropDown = true;
|
46
46
|
}
|
47
|
+
_onTouchEnd(event) {
|
48
|
+
var target = (event || event.touches[0]).target;
|
49
|
+
var touchWasWithinContainer = this._wasTap && this.containerOuter.element.contains(target);
|
50
|
+
if (touchWasWithinContainer) {
|
51
|
+
var containerWasExactTarget = target === this.containerOuter.element || target === this.containerInner.element;
|
52
|
+
if (containerWasExactTarget) {
|
53
|
+
if (this._isTextElement) {
|
54
|
+
this.input.focus();
|
55
|
+
}
|
56
|
+
else if (this._isSelectMultipleElement) {
|
57
|
+
this.input.focus();
|
58
|
+
this.showDropdown();
|
59
|
+
}
|
60
|
+
}
|
61
|
+
// Prevents focus event firing
|
62
|
+
event.stopPropagation();
|
63
|
+
}
|
64
|
+
this._wasTap = true;
|
65
|
+
}
|
47
66
|
_handleButtonAction(activeItems, element) {
|
48
67
|
if (!this._isSelectOneElement) {
|
49
68
|
return super._handleButtonAction(activeItems, element);
|
package/lib/mjs/utils/utils.js
CHANGED
@@ -214,9 +214,9 @@ export function checkSimpleConditional(component, condition, row, data, instance
|
|
214
214
|
return true;
|
215
215
|
}
|
216
216
|
const value = getComponentActualValue(conditionComponentPath, data, row);
|
217
|
-
const
|
218
|
-
return
|
219
|
-
? new
|
217
|
+
const ConditionOperator = ConditionOperators[operator];
|
218
|
+
return ConditionOperator
|
219
|
+
? new ConditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
|
220
220
|
: true;
|
221
221
|
});
|
222
222
|
let result = false;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.0.0-rc.
|
3
|
+
"version": "5.0.0-rc.24",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"module": "lib/mjs/index.js",
|
@@ -51,7 +51,7 @@
|
|
51
51
|
"invalidate": "VERSION=$(yarn version);aws cloudfront create-invalidation --distribution-id E1MXNA5A4ZKRMZ --paths \"/$VERSION/*\"",
|
52
52
|
"release": "yarn build-app && yarn deploy-s3",
|
53
53
|
"tag": "VERSION=$(yarn version);git add -A; git commit -m \"Build $Version\";git push origin master;git tag v$VERSION;git push origin --tags;",
|
54
|
-
"dopublish": "npm
|
54
|
+
"dopublish": "npm run build && npm run tag && npm publish",
|
55
55
|
"lint": "gulp eslint",
|
56
56
|
"serve": "jekyll serve --config _config.yml,_config.dev.yml",
|
57
57
|
"test": "mocha 'src/**/*.unit.js'",
|
@@ -106,7 +106,6 @@
|
|
106
106
|
"moment": "^2.29.4",
|
107
107
|
"moment-timezone": "^0.5.43",
|
108
108
|
"quill": "^2.0.0-dev.3",
|
109
|
-
"resize-observer-polyfill": "^1.5.1",
|
110
109
|
"signature_pad": "^4.1.4",
|
111
110
|
"string-hash": "^1.1.3",
|
112
111
|
"tippy.js": "^6.3.7",
|
@@ -116,7 +115,7 @@
|
|
116
115
|
"devDependencies": {
|
117
116
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
118
117
|
"@typescript-eslint/parser": "^5.60.1",
|
119
|
-
"ace-builds": "
|
118
|
+
"ace-builds": "1.23.4",
|
120
119
|
"async-limiter": "^2.0.0",
|
121
120
|
"bootstrap-icons": "^1.10.5",
|
122
121
|
"bootswatch": "^5.3.0",
|