@vixoniccom/modules 2.11.0 → 2.12.0-dev.1
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 +282 -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
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Input, IInput } from '../base';
|
|
2
|
-
export interface ISwitch extends IInput {
|
|
3
|
-
defaultValue?: boolean;
|
|
4
|
-
displayOnTrue?: string;
|
|
5
|
-
displayOnFalse?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare namespace Switch {
|
|
8
|
-
type Value = boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare class Switch extends Input<Switch.Value> {
|
|
11
|
-
static type: string;
|
|
12
|
-
type: string;
|
|
13
|
-
readonly defaultValue?: boolean;
|
|
14
|
-
readonly displayOnTrue?: string;
|
|
15
|
-
readonly displayOnFalse?: string;
|
|
16
|
-
constructor(options: ISwitch);
|
|
17
|
-
validateInput(): never[];
|
|
18
|
-
isValidValue(v: any): v is Switch.Value;
|
|
19
|
-
static fromJSON: (value: ISwitch) => Switch;
|
|
20
|
-
valueTypeDef: () => string;
|
|
21
|
-
}
|
|
1
|
+
import { Input, IInput } from '../base';
|
|
2
|
+
export interface ISwitch extends IInput {
|
|
3
|
+
defaultValue?: boolean;
|
|
4
|
+
displayOnTrue?: string;
|
|
5
|
+
displayOnFalse?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Switch {
|
|
8
|
+
type Value = boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class Switch extends Input<Switch.Value> {
|
|
11
|
+
static type: string;
|
|
12
|
+
type: string;
|
|
13
|
+
readonly defaultValue?: boolean;
|
|
14
|
+
readonly displayOnTrue?: string;
|
|
15
|
+
readonly displayOnFalse?: string;
|
|
16
|
+
constructor(options: ISwitch);
|
|
17
|
+
validateInput(): never[];
|
|
18
|
+
isValidValue(v: any): v is Switch.Value;
|
|
19
|
+
static fromJSON: (value: ISwitch) => Switch;
|
|
20
|
+
valueTypeDef: () => string;
|
|
21
|
+
}
|
|
@@ -1,39 +1,45 @@
|
|
|
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
|
-
_this
|
|
24
|
-
_this.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
Switch.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
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.Switch = void 0;
|
|
19
|
+
var base_1 = require("../base");
|
|
20
|
+
var Switch = /** @class */ (function (_super) {
|
|
21
|
+
__extends(Switch, _super);
|
|
22
|
+
function Switch(options) {
|
|
23
|
+
var _this = _super.call(this, options) || this;
|
|
24
|
+
_this.type = Switch.type;
|
|
25
|
+
_this.valueTypeDef = function () {
|
|
26
|
+
return "boolean";
|
|
27
|
+
};
|
|
28
|
+
_this.defaultValue = options.defaultValue;
|
|
29
|
+
_this.displayOnTrue = options.displayOnTrue;
|
|
30
|
+
_this.displayOnFalse = options.displayOnFalse;
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
Switch.prototype.validateInput = function () {
|
|
34
|
+
return [];
|
|
35
|
+
};
|
|
36
|
+
Switch.prototype.isValidValue = function (v) {
|
|
37
|
+
return typeof v === 'boolean';
|
|
38
|
+
};
|
|
39
|
+
Switch.type = 'switch';
|
|
40
|
+
Switch.fromJSON = function (value) {
|
|
41
|
+
return new Switch(value);
|
|
42
|
+
};
|
|
43
|
+
return Switch;
|
|
44
|
+
}(base_1.Input));
|
|
45
|
+
exports.Switch = Switch;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { TextInput, ITextInput, TextInputJSON } from './text-input';
|
|
2
|
-
import { ValueError } from '../errors';
|
|
3
|
-
export interface ITextArea {
|
|
4
|
-
rows?: number;
|
|
5
|
-
}
|
|
6
|
-
export interface TextAreaJSON extends ITextArea, TextInputJSON {
|
|
7
|
-
}
|
|
8
|
-
export declare namespace TextArea {
|
|
9
|
-
type Error = ValueError.Required | ValueError.Max | ValueError.Min | {
|
|
10
|
-
type: 'pattern';
|
|
11
|
-
};
|
|
12
|
-
type Value = string;
|
|
13
|
-
}
|
|
14
|
-
export declare class TextArea extends TextInput {
|
|
15
|
-
static type: string;
|
|
16
|
-
type: string;
|
|
17
|
-
readonly rows?: number;
|
|
18
|
-
constructor(options: ITextArea & ITextInput);
|
|
19
|
-
static fromJSON(value: TextAreaJSON): TextArea;
|
|
20
|
-
}
|
|
1
|
+
import { TextInput, ITextInput, TextInputJSON } from './text-input';
|
|
2
|
+
import { ValueError } from '../errors';
|
|
3
|
+
export interface ITextArea {
|
|
4
|
+
rows?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface TextAreaJSON extends ITextArea, TextInputJSON {
|
|
7
|
+
}
|
|
8
|
+
export declare namespace TextArea {
|
|
9
|
+
type Error = ValueError.Required | ValueError.Max | ValueError.Min | {
|
|
10
|
+
type: 'pattern';
|
|
11
|
+
};
|
|
12
|
+
type Value = string;
|
|
13
|
+
}
|
|
14
|
+
export declare class TextArea extends TextInput {
|
|
15
|
+
static type: string;
|
|
16
|
+
type: string;
|
|
17
|
+
readonly rows?: number;
|
|
18
|
+
constructor(options: ITextArea & ITextInput);
|
|
19
|
+
static fromJSON(value: TextAreaJSON): TextArea;
|
|
20
|
+
}
|
|
@@ -1,37 +1,46 @@
|
|
|
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
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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.TextArea = void 0;
|
|
30
|
+
var text_input_1 = require("./text-input");
|
|
31
|
+
var TextArea = /** @class */ (function (_super) {
|
|
32
|
+
__extends(TextArea, _super);
|
|
33
|
+
function TextArea(options) {
|
|
34
|
+
var _this = _super.call(this, options) || this;
|
|
35
|
+
_this.type = TextArea.type;
|
|
36
|
+
_this.rows = options.rows;
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
TextArea.fromJSON = function (value) {
|
|
40
|
+
var parsed = text_input_1.TextInput.parseJSON(value);
|
|
41
|
+
return new TextArea(__assign(__assign({}, parsed), { rows: value.rows }));
|
|
42
|
+
};
|
|
43
|
+
TextArea.type = 'text-area';
|
|
44
|
+
return TextArea;
|
|
45
|
+
}(text_input_1.TextInput));
|
|
46
|
+
exports.TextArea = TextArea;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Input, IInput } from '../base';
|
|
2
|
-
export interface ITextFormat extends IInput {
|
|
3
|
-
description?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare namespace TextFormat {
|
|
6
|
-
type Value = {
|
|
7
|
-
fontSize?: number;
|
|
8
|
-
fontColor?: string;
|
|
9
|
-
alignment?: {
|
|
10
|
-
horizontal?: 'left' | 'right' | 'center';
|
|
11
|
-
};
|
|
12
|
-
font?: {
|
|
13
|
-
filename: string;
|
|
14
|
-
id: string;
|
|
15
|
-
__isAsset: true;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare class TextFormat extends Input<TextFormat.Value> {
|
|
20
|
-
static type: string;
|
|
21
|
-
type: string;
|
|
22
|
-
readonly description?: string;
|
|
23
|
-
constructor(options: ITextFormat);
|
|
24
|
-
validateInput(): never[];
|
|
25
|
-
isValidValue(v: any): v is TextFormat.Value;
|
|
26
|
-
static fromJSON: (value: ITextFormat) => TextFormat;
|
|
27
|
-
valueTypeDef: () => string;
|
|
28
|
-
}
|
|
1
|
+
import { Input, IInput } from '../base';
|
|
2
|
+
export interface ITextFormat extends IInput {
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare namespace TextFormat {
|
|
6
|
+
type Value = {
|
|
7
|
+
fontSize?: number;
|
|
8
|
+
fontColor?: string;
|
|
9
|
+
alignment?: {
|
|
10
|
+
horizontal?: 'left' | 'right' | 'center';
|
|
11
|
+
};
|
|
12
|
+
font?: {
|
|
13
|
+
filename: string;
|
|
14
|
+
id: string;
|
|
15
|
+
__isAsset: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare class TextFormat extends Input<TextFormat.Value> {
|
|
20
|
+
static type: string;
|
|
21
|
+
type: string;
|
|
22
|
+
readonly description?: string;
|
|
23
|
+
constructor(options: ITextFormat);
|
|
24
|
+
validateInput(): never[];
|
|
25
|
+
isValidValue(v: any): v is TextFormat.Value;
|
|
26
|
+
static fromJSON: (value: ITextFormat) => TextFormat;
|
|
27
|
+
valueTypeDef: () => string;
|
|
28
|
+
}
|
|
@@ -1,37 +1,43 @@
|
|
|
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
|
-
return
|
|
30
|
-
}
|
|
31
|
-
TextFormat.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
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.TextFormat = void 0;
|
|
19
|
+
var base_1 = require("../base");
|
|
20
|
+
var TextFormat = /** @class */ (function (_super) {
|
|
21
|
+
__extends(TextFormat, _super);
|
|
22
|
+
function TextFormat(options) {
|
|
23
|
+
var _this = _super.call(this, options) || this;
|
|
24
|
+
_this.type = TextFormat.type;
|
|
25
|
+
_this.valueTypeDef = function () {
|
|
26
|
+
return "{ fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }";
|
|
27
|
+
};
|
|
28
|
+
_this.description = options.description;
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
TextFormat.prototype.validateInput = function () {
|
|
32
|
+
return [];
|
|
33
|
+
};
|
|
34
|
+
TextFormat.prototype.isValidValue = function (v) {
|
|
35
|
+
return typeof v === 'object';
|
|
36
|
+
};
|
|
37
|
+
TextFormat.type = 'text-format';
|
|
38
|
+
TextFormat.fromJSON = function (value) {
|
|
39
|
+
return new TextFormat(value);
|
|
40
|
+
};
|
|
41
|
+
return TextFormat;
|
|
42
|
+
}(base_1.Input));
|
|
43
|
+
exports.TextFormat = TextFormat;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { Input, IInput
|
|
2
|
-
import { RangeValue } from '../values';
|
|
3
|
-
import { ValueError } from '../errors';
|
|
4
|
-
export interface ITextInput extends IInput {
|
|
5
|
-
description?: string;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
pattern?: string;
|
|
8
|
-
displayFormat?: string;
|
|
9
|
-
range?: RangeValue;
|
|
10
|
-
}
|
|
11
|
-
export interface TextInputJSON extends Omit<ITextInput, 'range'> {
|
|
12
|
-
range?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare namespace TextInput {
|
|
15
|
-
type Error = ValueError.Required | ValueError.Max | ValueError.Min | {
|
|
16
|
-
type: 'pattern';
|
|
17
|
-
};
|
|
18
|
-
type Value = string;
|
|
19
|
-
}
|
|
20
|
-
export declare class TextInput extends Input<TextInput.Value, TextInput.Error> {
|
|
21
|
-
static type: string;
|
|
22
|
-
type: string;
|
|
23
|
-
readonly description?: string;
|
|
24
|
-
readonly required?: boolean;
|
|
25
|
-
readonly pattern?: string;
|
|
26
|
-
readonly displayFormat?: string;
|
|
27
|
-
readonly range?: RangeValue | undefined;
|
|
28
|
-
constructor(options: ITextInput);
|
|
29
|
-
validateInput(value?: string): TextInput.Error[];
|
|
30
|
-
isValidValue(v: any): v is TextInput.Value;
|
|
31
|
-
static fromJSON(value: TextInputJSON): TextInput;
|
|
32
|
-
protected static parseJSON(value: TextInputJSON): ITextInput;
|
|
33
|
-
valueTypeDef: () => string;
|
|
34
|
-
}
|
|
1
|
+
import { Input, IInput } from '../base';
|
|
2
|
+
import { RangeValue } from '../values';
|
|
3
|
+
import { ValueError } from '../errors';
|
|
4
|
+
export interface ITextInput extends IInput {
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
pattern?: string;
|
|
8
|
+
displayFormat?: string;
|
|
9
|
+
range?: RangeValue;
|
|
10
|
+
}
|
|
11
|
+
export interface TextInputJSON extends Omit<ITextInput, 'range'> {
|
|
12
|
+
range?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace TextInput {
|
|
15
|
+
type Error = ValueError.Required | ValueError.Max | ValueError.Min | {
|
|
16
|
+
type: 'pattern';
|
|
17
|
+
};
|
|
18
|
+
type Value = string;
|
|
19
|
+
}
|
|
20
|
+
export declare class TextInput extends Input<TextInput.Value, TextInput.Error> {
|
|
21
|
+
static type: string;
|
|
22
|
+
type: string;
|
|
23
|
+
readonly description?: string;
|
|
24
|
+
readonly required?: boolean;
|
|
25
|
+
readonly pattern?: string;
|
|
26
|
+
readonly displayFormat?: string;
|
|
27
|
+
readonly range?: RangeValue | undefined;
|
|
28
|
+
constructor(options: ITextInput);
|
|
29
|
+
validateInput(value?: string): TextInput.Error[];
|
|
30
|
+
isValidValue(v: any): v is TextInput.Value;
|
|
31
|
+
static fromJSON(value: TextInputJSON): TextInput;
|
|
32
|
+
protected static parseJSON(value: TextInputJSON): ITextInput;
|
|
33
|
+
valueTypeDef: () => string;
|
|
34
|
+
}
|
|
@@ -1,64 +1,73 @@
|
|
|
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
|
-
var
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return
|
|
60
|
-
};
|
|
61
|
-
TextInput.
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
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;
|
package/dist/lib/ui/index.d.ts
CHANGED
|
@@ -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 };
|
package/dist/lib/ui/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports
|
|
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];
|