@vixoniccom/modules 2.11.0 → 2.12.0-dev.2
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/.vscode/settings.json +2 -2
- package/CHANGELOG.md +289 -264
- package/dist/index.d.ts +6 -6
- package/dist/index.js +32 -31
- package/dist/lib/base.d.ts +28 -36
- package/dist/lib/base.js +63 -58
- package/dist/lib/containers/dynamic-matrix.d.ts +48 -48
- package/dist/lib/containers/dynamic-matrix.js +85 -76
- package/dist/lib/containers/group.d.ts +21 -21
- package/dist/lib/containers/group.js +56 -47
- package/dist/lib/containers/index.d.ts +6 -6
- package/dist/lib/containers/index.js +14 -13
- package/dist/lib/containers/list.d.ts +66 -66
- package/dist/lib/containers/list.js +114 -105
- package/dist/lib/errors.d.ts +22 -22
- package/dist/lib/errors.js +24 -23
- package/dist/lib/index.d.ts +29 -29
- package/dist/lib/index.js +136 -128
- package/dist/lib/inputs/autocomplete.d.ts +31 -31
- package/dist/lib/inputs/autocomplete.js +55 -49
- package/dist/lib/inputs/color-picker.d.ts +23 -23
- package/dist/lib/inputs/color-picker.js +48 -42
- package/dist/lib/inputs/date-input.d.ts +35 -35
- package/dist/lib/inputs/date-input.js +87 -78
- package/dist/lib/inputs/index.d.ts +24 -24
- package/dist/lib/inputs/index.js +52 -49
- package/dist/lib/inputs/number-input.d.ts +29 -29
- package/dist/lib/inputs/number-input.js +62 -53
- package/dist/lib/inputs/select-asset-kna.d.ts +34 -34
- package/dist/lib/inputs/select-asset-kna.js +56 -50
- package/dist/lib/inputs/select-input.d.ts +18 -18
- package/dist/lib/inputs/select-input.js +35 -29
- package/dist/lib/inputs/service-input.d.ts +27 -27
- package/dist/lib/inputs/service-input.js +47 -41
- package/dist/lib/inputs/slider.d.ts +33 -33
- package/dist/lib/inputs/slider.js +57 -51
- package/dist/lib/inputs/switch.d.ts +21 -21
- package/dist/lib/inputs/switch.js +45 -39
- package/dist/lib/inputs/text-area.d.ts +20 -20
- package/dist/lib/inputs/text-area.js +46 -37
- package/dist/lib/inputs/text-format.d.ts +28 -28
- package/dist/lib/inputs/text-format.js +43 -37
- package/dist/lib/inputs/text-input.d.ts +34 -34
- package/dist/lib/inputs/text-input.js +73 -64
- package/dist/lib/ui/index.d.ts +4 -4
- package/dist/lib/ui/index.js +6 -5
- package/dist/lib/ui/label.d.ts +18 -18
- package/dist/lib/ui/label.js +36 -30
- package/dist/lib/utils/index.d.ts +2 -1
- package/dist/lib/utils/index.js +28 -22
- package/dist/lib/utils/typeDefs.d.ts +7 -7
- package/dist/lib/utils/typeDefs.js +19 -18
- package/dist/lib/utils/validation.d.ts +7 -7
- package/dist/lib/utils/validation.js +27 -26
- package/dist/lib/values.d.ts +21 -21
- package/dist/lib/values.js +92 -86
- package/dist/lib/visibility.d.ts +2 -2
- package/dist/lib/visibility.js +21 -20
- package/package.json +23 -22
package/dist/lib/values.js
CHANGED
|
@@ -1,86 +1,92 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
extendStatics(d, b);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
NumberRangeValue
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.DateRangeValue = exports.NumberRangeValue = exports.RangeValue = void 0;
|
|
19
|
+
var RangeValue = /** @class */ (function () {
|
|
20
|
+
function RangeValue(min, max) {
|
|
21
|
+
this.min = min;
|
|
22
|
+
this.max = max;
|
|
23
|
+
}
|
|
24
|
+
RangeValue.fromJSON = function (value) {
|
|
25
|
+
var reg = new RegExp(/\[(.*):(.*)]/g);
|
|
26
|
+
var match = reg.exec(value);
|
|
27
|
+
var min;
|
|
28
|
+
var max;
|
|
29
|
+
if (match && match.length > 1) {
|
|
30
|
+
min = this.parseNumber(match[1]);
|
|
31
|
+
max = this.parseNumber(match[2]);
|
|
32
|
+
}
|
|
33
|
+
return new RangeValue(min, max);
|
|
34
|
+
};
|
|
35
|
+
RangeValue.parseNumber = function (value) {
|
|
36
|
+
var p = value !== '' ? Number(value) : undefined;
|
|
37
|
+
return p !== undefined && !isNaN(p) ? p : undefined;
|
|
38
|
+
};
|
|
39
|
+
RangeValue.prototype.toJSON = function () {
|
|
40
|
+
return "[" + (this.min !== undefined ? this.min : '') + ":" + (this.max !== undefined ? this.max : '') + "]";
|
|
41
|
+
};
|
|
42
|
+
return RangeValue;
|
|
43
|
+
}());
|
|
44
|
+
exports.RangeValue = RangeValue;
|
|
45
|
+
var NumberRangeValue = /** @class */ (function (_super) {
|
|
46
|
+
__extends(NumberRangeValue, _super);
|
|
47
|
+
function NumberRangeValue(min, max, step) {
|
|
48
|
+
var _this = _super.call(this, min, max) || this;
|
|
49
|
+
_this.step = step;
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
NumberRangeValue.fromJSON = function (value) {
|
|
53
|
+
var reg = new RegExp(/\[(.*):(.*):(.*)]/g);
|
|
54
|
+
var match = reg.exec(value);
|
|
55
|
+
var min;
|
|
56
|
+
var max;
|
|
57
|
+
var step;
|
|
58
|
+
if (match && match.length > 2) {
|
|
59
|
+
min = this.parseNumber(match[1]);
|
|
60
|
+
max = this.parseNumber(match[2]);
|
|
61
|
+
step = this.parseNumber(match[3]);
|
|
62
|
+
}
|
|
63
|
+
return new NumberRangeValue(min, max, step);
|
|
64
|
+
};
|
|
65
|
+
NumberRangeValue.prototype.toJSON = function () {
|
|
66
|
+
return "[" + (this.min !== undefined ? this.min : '') + ":" + (this.max !== undefined ? this.max : '') + ":" + (this.step !== undefined ? this.step : '') + "]";
|
|
67
|
+
};
|
|
68
|
+
return NumberRangeValue;
|
|
69
|
+
}(RangeValue));
|
|
70
|
+
exports.NumberRangeValue = NumberRangeValue;
|
|
71
|
+
var DateRangeValue = /** @class */ (function () {
|
|
72
|
+
function DateRangeValue(min, max) {
|
|
73
|
+
this.min = min;
|
|
74
|
+
this.max = max;
|
|
75
|
+
}
|
|
76
|
+
DateRangeValue.fromJSON = function (value) {
|
|
77
|
+
var reg = new RegExp(/\[(.*):(.*)]/g);
|
|
78
|
+
var match = reg.exec(value);
|
|
79
|
+
var min;
|
|
80
|
+
var max;
|
|
81
|
+
if (match && match.length > 2) {
|
|
82
|
+
min = match[1];
|
|
83
|
+
max = match[2];
|
|
84
|
+
}
|
|
85
|
+
return new DateRangeValue(min, max);
|
|
86
|
+
};
|
|
87
|
+
DateRangeValue.prototype.toJSON = function () {
|
|
88
|
+
return "[" + (this.min !== undefined ? this.min : '') + ":" + (this.max !== undefined ? this.max : '') + "]";
|
|
89
|
+
};
|
|
90
|
+
return DateRangeValue;
|
|
91
|
+
}());
|
|
92
|
+
exports.DateRangeValue = DateRangeValue;
|
package/dist/lib/visibility.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Configuration } from ".";
|
|
2
|
-
export declare function shouldBeVisible(item: any, _values: Configuration.Value): boolean;
|
|
1
|
+
import { Configuration } from ".";
|
|
2
|
+
export declare function shouldBeVisible(item: any, _values: Configuration.Value): boolean;
|
package/dist/lib/visibility.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
console.warn(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shouldBeVisible = void 0;
|
|
4
|
+
function shouldBeVisible(item, _values) {
|
|
5
|
+
if (!item.show)
|
|
6
|
+
return true;
|
|
7
|
+
var jsEval = item.show;
|
|
8
|
+
try {
|
|
9
|
+
var regexp = new RegExp('{{(.*?)}}', 'ig');
|
|
10
|
+
jsEval = jsEval.replace(regexp, "_values.$1");
|
|
11
|
+
// tslint:disable-next-line
|
|
12
|
+
var show = eval(jsEval);
|
|
13
|
+
return show === true;
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
console.warn('Unable to parse expression:', jsEval);
|
|
17
|
+
console.warn(e);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.shouldBeVisible = shouldBeVisible;
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vixoniccom/modules",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"prepublishOnly": "npm run build",
|
|
9
|
-
"build": "tsc",
|
|
10
|
-
"release": "standard-version",
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@vixoniccom/modules",
|
|
3
|
+
"version": "2.12.0-dev.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepublishOnly": "npm run build",
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"release": "standard-version",
|
|
11
|
+
"prerelease-dev": "standard-version --prerelease dev",
|
|
12
|
+
"test": "ts-node ./test/index.ts"
|
|
13
|
+
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^14.17.10",
|
|
18
|
+
"jest": "^27.0.6",
|
|
19
|
+
"standard-version": "^9.3.1",
|
|
20
|
+
"ts-node": "^10.2.1",
|
|
21
|
+
"typescript": "^4.3.5"
|
|
22
|
+
}
|
|
23
|
+
}
|