@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.
Files changed (59) hide show
  1. package/.vscode/settings.json +2 -2
  2. package/CHANGELOG.md +289 -264
  3. package/dist/index.d.ts +6 -6
  4. package/dist/index.js +32 -31
  5. package/dist/lib/base.d.ts +28 -36
  6. package/dist/lib/base.js +63 -58
  7. package/dist/lib/containers/dynamic-matrix.d.ts +48 -48
  8. package/dist/lib/containers/dynamic-matrix.js +85 -76
  9. package/dist/lib/containers/group.d.ts +21 -21
  10. package/dist/lib/containers/group.js +56 -47
  11. package/dist/lib/containers/index.d.ts +6 -6
  12. package/dist/lib/containers/index.js +14 -13
  13. package/dist/lib/containers/list.d.ts +66 -66
  14. package/dist/lib/containers/list.js +114 -105
  15. package/dist/lib/errors.d.ts +22 -22
  16. package/dist/lib/errors.js +24 -23
  17. package/dist/lib/index.d.ts +29 -29
  18. package/dist/lib/index.js +136 -128
  19. package/dist/lib/inputs/autocomplete.d.ts +31 -31
  20. package/dist/lib/inputs/autocomplete.js +55 -49
  21. package/dist/lib/inputs/color-picker.d.ts +23 -23
  22. package/dist/lib/inputs/color-picker.js +48 -42
  23. package/dist/lib/inputs/date-input.d.ts +35 -35
  24. package/dist/lib/inputs/date-input.js +87 -78
  25. package/dist/lib/inputs/index.d.ts +24 -24
  26. package/dist/lib/inputs/index.js +52 -49
  27. package/dist/lib/inputs/number-input.d.ts +29 -29
  28. package/dist/lib/inputs/number-input.js +62 -53
  29. package/dist/lib/inputs/select-asset-kna.d.ts +34 -34
  30. package/dist/lib/inputs/select-asset-kna.js +56 -50
  31. package/dist/lib/inputs/select-input.d.ts +18 -18
  32. package/dist/lib/inputs/select-input.js +35 -29
  33. package/dist/lib/inputs/service-input.d.ts +27 -27
  34. package/dist/lib/inputs/service-input.js +47 -41
  35. package/dist/lib/inputs/slider.d.ts +33 -33
  36. package/dist/lib/inputs/slider.js +57 -51
  37. package/dist/lib/inputs/switch.d.ts +21 -21
  38. package/dist/lib/inputs/switch.js +45 -39
  39. package/dist/lib/inputs/text-area.d.ts +20 -20
  40. package/dist/lib/inputs/text-area.js +46 -37
  41. package/dist/lib/inputs/text-format.d.ts +28 -28
  42. package/dist/lib/inputs/text-format.js +43 -37
  43. package/dist/lib/inputs/text-input.d.ts +34 -34
  44. package/dist/lib/inputs/text-input.js +73 -64
  45. package/dist/lib/ui/index.d.ts +4 -4
  46. package/dist/lib/ui/index.js +6 -5
  47. package/dist/lib/ui/label.d.ts +18 -18
  48. package/dist/lib/ui/label.js +36 -30
  49. package/dist/lib/utils/index.d.ts +2 -1
  50. package/dist/lib/utils/index.js +28 -22
  51. package/dist/lib/utils/typeDefs.d.ts +7 -7
  52. package/dist/lib/utils/typeDefs.js +19 -18
  53. package/dist/lib/utils/validation.d.ts +7 -7
  54. package/dist/lib/utils/validation.js +27 -26
  55. package/dist/lib/values.d.ts +21 -21
  56. package/dist/lib/values.js +92 -86
  57. package/dist/lib/visibility.d.ts +2 -2
  58. package/dist/lib/visibility.js +21 -20
  59. package/package.json +23 -22
@@ -1,64 +1,73 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return function (d, b) {
7
- extendStatics(d, b);
8
- function __() { this.constructor = d; }
9
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10
- };
11
- })();
12
- var __assign = (this && this.__assign) || Object.assign || function(t) {
13
- for (var s, i = 1, n = arguments.length; i < n; i++) {
14
- s = arguments[i];
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
16
- t[p] = s[p];
17
- }
18
- return t;
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- var base_1 = require("../base");
22
- var values_1 = require("../values");
23
- var validation_1 = require("../utils/validation");
24
- var TextInput = (function (_super) {
25
- __extends(TextInput, _super);
26
- function TextInput(options) {
27
- var _this = _super.call(this, options) || this;
28
- _this.type = TextInput.type;
29
- _this.valueTypeDef = function () { return 'string'; };
30
- _this.description = options.description;
31
- _this.required = options.required;
32
- _this.pattern = options.pattern;
33
- _this.displayFormat = options.displayFormat;
34
- _this.range = options.range;
35
- return _this;
36
- }
37
- TextInput.prototype.validateInput = function (value) {
38
- var errors = [];
39
- errors = errors.concat(validation_1.Validator.required(value, this.required));
40
- if (this.pattern && value) {
41
- var reg = new RegExp(this.pattern);
42
- if (!reg.exec(value))
43
- errors = errors.concat({ type: 'pattern' });
44
- }
45
- if (this.range) {
46
- var length = value && value.length || 0;
47
- errors = errors.concat(validation_1.Validator.min(length, this.range.min));
48
- errors = errors.concat(validation_1.Validator.max(length, this.range.max));
49
- }
50
- return errors;
51
- };
52
- TextInput.prototype.isValidValue = function (v) {
53
- return typeof v === 'string';
54
- };
55
- TextInput.fromJSON = function (value) {
56
- return new TextInput(this.parseJSON(value));
57
- };
58
- TextInput.parseJSON = function (value) {
59
- return __assign({}, value, { range: value.range && values_1.RangeValue.fromJSON(value.range) || undefined });
60
- };
61
- TextInput.type = 'text-input';
62
- return TextInput;
63
- }(base_1.Input));
64
- exports.TextInput = TextInput;
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
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.TextInput = void 0;
30
+ var base_1 = require("../base");
31
+ var values_1 = require("../values");
32
+ var validation_1 = require("../utils/validation");
33
+ var TextInput = /** @class */ (function (_super) {
34
+ __extends(TextInput, _super);
35
+ function TextInput(options) {
36
+ var _this = _super.call(this, options) || this;
37
+ _this.type = TextInput.type;
38
+ _this.valueTypeDef = function () { return 'string'; };
39
+ _this.description = options.description;
40
+ _this.required = options.required;
41
+ _this.pattern = options.pattern;
42
+ _this.displayFormat = options.displayFormat;
43
+ _this.range = options.range;
44
+ return _this;
45
+ }
46
+ TextInput.prototype.validateInput = function (value) {
47
+ var errors = [];
48
+ errors = errors.concat(validation_1.Validator.required(value, this.required));
49
+ if (this.pattern && value) {
50
+ var reg = new RegExp(this.pattern);
51
+ if (!reg.exec(value))
52
+ errors = errors.concat({ type: 'pattern' });
53
+ }
54
+ if (this.range) {
55
+ var length = value && value.length || 0;
56
+ errors = errors.concat(validation_1.Validator.min(length, this.range.min));
57
+ errors = errors.concat(validation_1.Validator.max(length, this.range.max));
58
+ }
59
+ return errors;
60
+ };
61
+ TextInput.prototype.isValidValue = function (v) {
62
+ return typeof v === 'string';
63
+ };
64
+ TextInput.fromJSON = function (value) {
65
+ return new TextInput(this.parseJSON(value));
66
+ };
67
+ TextInput.parseJSON = function (value) {
68
+ return __assign(__assign({}, value), { range: value.range && values_1.RangeValue.fromJSON(value.range) || undefined });
69
+ };
70
+ TextInput.type = 'text-input';
71
+ return TextInput;
72
+ }(base_1.Input));
73
+ exports.TextInput = TextInput;
@@ -1,4 +1,4 @@
1
- import { Label } from './label';
2
- export declare const allUIComponents: typeof Label[];
3
- export declare type UIComponent = Label;
4
- export { Label };
1
+ import { Label } from './label';
2
+ export declare const allUIComponents: (typeof Label)[];
3
+ export declare type UIComponent = Label;
4
+ export { Label };
@@ -1,5 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var label_1 = require("./label");
4
- exports.Label = label_1.Label;
5
- exports.allUIComponents = [label_1.Label];
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Label = exports.allUIComponents = void 0;
4
+ var label_1 = require("./label");
5
+ Object.defineProperty(exports, "Label", { enumerable: true, get: function () { return label_1.Label; } });
6
+ exports.allUIComponents = [label_1.Label];
@@ -1,18 +1,18 @@
1
- import { ConfigurationElement } from '../base';
2
- export declare class Label extends ConfigurationElement {
3
- static type: string;
4
- type: string;
5
- readonly label: string;
6
- readonly description?: string;
7
- readonly show?: string;
8
- constructor(options: {
9
- label: string;
10
- description?: string;
11
- show?: string;
12
- });
13
- static fromJSON(value: {
14
- label: string;
15
- description?: string;
16
- show?: string;
17
- }): Label;
18
- }
1
+ import { ConfigurationElement } from '../base';
2
+ export declare class Label extends ConfigurationElement {
3
+ static type: string;
4
+ type: string;
5
+ readonly label: string;
6
+ readonly description?: string;
7
+ readonly show?: string;
8
+ constructor(options: {
9
+ label: string;
10
+ description?: string;
11
+ show?: string;
12
+ });
13
+ static fromJSON(value: {
14
+ label: string;
15
+ description?: string;
16
+ show?: string;
17
+ }): Label;
18
+ }
@@ -1,30 +1,36 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return function (d, b) {
7
- extendStatics(d, b);
8
- function __() { this.constructor = d; }
9
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10
- };
11
- })();
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- var base_1 = require("../base");
14
- var Label = (function (_super) {
15
- __extends(Label, _super);
16
- function Label(options) {
17
- var _this = _super.call(this) || this;
18
- _this.type = Label.type;
19
- _this.label = options.label;
20
- _this.description = options.description;
21
- _this.show = options.show;
22
- return _this;
23
- }
24
- Label.fromJSON = function (value) {
25
- return new Label(value);
26
- };
27
- Label.type = 'label';
28
- return Label;
29
- }(base_1.ConfigurationElement));
30
- exports.Label = Label;
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.Label = void 0;
19
+ var base_1 = require("../base");
20
+ var Label = /** @class */ (function (_super) {
21
+ __extends(Label, _super);
22
+ function Label(options) {
23
+ var _this = _super.call(this) || this;
24
+ _this.type = Label.type;
25
+ _this.label = options.label;
26
+ _this.description = options.description;
27
+ _this.show = options.show;
28
+ return _this;
29
+ }
30
+ Label.fromJSON = function (value) {
31
+ return new Label(value);
32
+ };
33
+ Label.type = 'label';
34
+ return Label;
35
+ }(base_1.ConfigurationElement));
36
+ exports.Label = Label;
@@ -1 +1,2 @@
1
- export declare const createComponentFromJSON: (type: string, value: any) => any;
1
+ declare const createComponentFromJSON: (type: string, value: any) => any | undefined;
2
+ export default createComponentFromJSON;
@@ -1,22 +1,28 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var ui_1 = require("../ui");
4
- var inputs_1 = require("../inputs");
5
- var containers_1 = require("../containers");
6
- var allComponents = inputs_1.allInputs.concat(ui_1.allUIComponents, containers_1.allContainer);
7
- exports.createComponentFromJSON = function (type, value) {
8
- var component = allComponents.find(function (i) {
9
- return (i.type === type);
10
- });
11
- if (component) {
12
- if (component.fromJSON) {
13
- return component.fromJSON(value);
14
- }
15
- else {
16
- throw new Error("Component \"" + type + "\" does not implement fromJSON");
17
- }
18
- }
19
- else {
20
- throw new Error("Invalid component \"" + type + "\"");
21
- }
22
- };
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
3
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4
+ to[j] = from[i];
5
+ return to;
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ var ui_1 = require("../ui");
9
+ var inputs_1 = require("../inputs");
10
+ var containers_1 = require("../containers");
11
+ var allComponents = __spreadArray(__spreadArray(__spreadArray([], inputs_1.allInputs), ui_1.allUIComponents), containers_1.allContainer);
12
+ var createComponentFromJSON = function (type, value) {
13
+ var component = allComponents.find(function (i) {
14
+ return (i.type === type);
15
+ });
16
+ if (component) {
17
+ if (value && component.fromJSON) {
18
+ return component.fromJSON(value);
19
+ }
20
+ else {
21
+ throw new Error("Component \"" + type + "\" does not implement fromJSON");
22
+ }
23
+ }
24
+ else {
25
+ throw new Error("Invalid component \"" + type + "\"");
26
+ }
27
+ };
28
+ exports.default = createComponentFromJSON;
@@ -1,7 +1,7 @@
1
- import { InputComponent } from "../index";
2
- export declare type TypeDefMap = {
3
- id: string;
4
- typeDef: string;
5
- };
6
- export declare function getDefsFromInputs(inputs: InputComponent[]): TypeDefMap[];
7
- export declare function defsMapToString(defsMap: TypeDefMap[]): string;
1
+ import { InputComponent } from "../index";
2
+ export declare type TypeDefMap = {
3
+ id: string;
4
+ typeDef: string;
5
+ };
6
+ export declare function getDefsFromInputs(inputs: InputComponent[]): TypeDefMap[];
7
+ export declare function defsMapToString(defsMap: TypeDefMap[]): string;
@@ -1,18 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function getDefsFromInputs(inputs) {
4
- return inputs.map(function (i) { return ({ id: i.id, typeDef: i.valueTypeDef() }); });
5
- }
6
- exports.getDefsFromInputs = getDefsFromInputs;
7
- function defsMapToString(defsMap) {
8
- var reduced = [];
9
- return defsMap.reduce(function (pV, e) {
10
- var exist = pV.findIndex(function (iE) { return iE.id === e.id; });
11
- if (exist !== -1) {
12
- pV[exist].typeDef = pV[exist].typeDef + " | " + e.typeDef;
13
- return pV;
14
- }
15
- return pV.concat(e);
16
- }, reduced).map(function (e) { return e.id + ": " + e.typeDef; }).join(', ');
17
- }
18
- exports.defsMapToString = defsMapToString;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defsMapToString = exports.getDefsFromInputs = void 0;
4
+ function getDefsFromInputs(inputs) {
5
+ return inputs.map(function (i) { return ({ id: i.id, typeDef: i.valueTypeDef() }); });
6
+ }
7
+ exports.getDefsFromInputs = getDefsFromInputs;
8
+ function defsMapToString(defsMap) {
9
+ var reduced = [];
10
+ return defsMap.reduce(function (pV, e) {
11
+ var exist = pV.findIndex(function (iE) { return iE.id === e.id; });
12
+ if (exist !== -1) {
13
+ pV[exist].typeDef = pV[exist].typeDef + " | " + e.typeDef;
14
+ return pV;
15
+ }
16
+ return pV.concat(e);
17
+ }, reduced).map(function (e) { return e.id + ": " + e.typeDef; }).join(', ');
18
+ }
19
+ exports.defsMapToString = defsMapToString;
@@ -1,7 +1,7 @@
1
- import { SimpleValueError, PayloadValueError } from "../errors";
2
- export declare namespace Validator {
3
- const required: (value: any, required: boolean | undefined, onlyUndefined?: boolean) => SimpleValueError<"required">[];
4
- const min: (value: number, min: number | undefined) => PayloadValueError<"min", number>[];
5
- const max: (value: number, max: number | undefined) => PayloadValueError<"max", number>[];
6
- const invalidValue: () => SimpleValueError<"invalidValue">[];
7
- }
1
+ import { ValueError } from "../errors";
2
+ export declare namespace Validator {
3
+ const required: (value: any, required: boolean | undefined, onlyUndefined?: boolean) => Array<ValueError.Required>;
4
+ const min: (value: number, min: number | undefined) => Array<ValueError.Min>;
5
+ const max: (value: number, max: number | undefined) => Array<ValueError.Max>;
6
+ const invalidValue: () => Array<ValueError.InvalidValue>;
7
+ }
@@ -1,26 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var Validator;
4
- (function (Validator) {
5
- Validator.required = function (value, required, onlyUndefined) {
6
- if (onlyUndefined === void 0) { onlyUndefined = false; }
7
- if ((value === undefined
8
- || (!onlyUndefined && (typeof value === 'string' && value === '')))
9
- && required)
10
- return [{ type: 'required' }];
11
- return [];
12
- };
13
- Validator.min = function (value, min) {
14
- if (min && value < min)
15
- return [{ type: 'min', payload: min }];
16
- return [];
17
- };
18
- Validator.max = function (value, max) {
19
- if (max && value > max)
20
- return [{ type: 'max', payload: max }];
21
- return [];
22
- };
23
- Validator.invalidValue = function () {
24
- return [{ type: 'invalidValue' }];
25
- };
26
- })(Validator = exports.Validator || (exports.Validator = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Validator = void 0;
4
+ var Validator;
5
+ (function (Validator) {
6
+ Validator.required = function (value, required, onlyUndefined) {
7
+ if (onlyUndefined === void 0) { onlyUndefined = false; }
8
+ if ((value === undefined
9
+ || (!onlyUndefined && (typeof value === 'string' && value === '')))
10
+ && required)
11
+ return [{ type: 'required' }];
12
+ return [];
13
+ };
14
+ Validator.min = function (value, min) {
15
+ if (min && value < min)
16
+ return [{ type: 'min', payload: min }];
17
+ return [];
18
+ };
19
+ Validator.max = function (value, max) {
20
+ if (max && value > max)
21
+ return [{ type: 'max', payload: max }];
22
+ return [];
23
+ };
24
+ Validator.invalidValue = function () {
25
+ return [{ type: 'invalidValue' }];
26
+ };
27
+ })(Validator = exports.Validator || (exports.Validator = {}));
@@ -1,21 +1,21 @@
1
- export declare class RangeValue {
2
- readonly min: number | undefined;
3
- readonly max: number | undefined;
4
- constructor(min?: number | undefined, max?: number | undefined);
5
- static fromJSON(value: string): RangeValue;
6
- protected static parseNumber(value: string): number | undefined;
7
- toJSON(): string;
8
- }
9
- export declare class NumberRangeValue extends RangeValue {
10
- readonly step: number | undefined;
11
- constructor(min?: number, max?: number, step?: number | undefined);
12
- static fromJSON(value: string): NumberRangeValue;
13
- toJSON(): string;
14
- }
15
- export declare class DateRangeValue {
16
- readonly min: string | undefined;
17
- readonly max: string | undefined;
18
- constructor(min?: string | undefined, max?: string | undefined);
19
- static fromJSON(value: string): DateRangeValue;
20
- toJSON(): string;
21
- }
1
+ export declare class RangeValue {
2
+ readonly min?: number | undefined;
3
+ readonly max?: number | undefined;
4
+ constructor(min?: number | undefined, max?: number | undefined);
5
+ static fromJSON(value: string): RangeValue;
6
+ protected static parseNumber(value: string): number | undefined;
7
+ toJSON(): string;
8
+ }
9
+ export declare class NumberRangeValue extends RangeValue {
10
+ readonly step?: number | undefined;
11
+ constructor(min?: number, max?: number, step?: number | undefined);
12
+ static fromJSON(value: string): NumberRangeValue;
13
+ toJSON(): string;
14
+ }
15
+ export declare class DateRangeValue {
16
+ readonly min?: string | undefined;
17
+ readonly max?: string | undefined;
18
+ constructor(min?: string | undefined, max?: string | undefined);
19
+ static fromJSON(value: string): DateRangeValue;
20
+ toJSON(): string;
21
+ }