@vixoniccom/modules 2.11.0

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 +3 -0
  2. package/CHANGELOG.md +264 -0
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.js +31 -0
  5. package/dist/lib/base.d.ts +36 -0
  6. package/dist/lib/base.js +58 -0
  7. package/dist/lib/containers/dynamic-matrix.d.ts +48 -0
  8. package/dist/lib/containers/dynamic-matrix.js +76 -0
  9. package/dist/lib/containers/group.d.ts +21 -0
  10. package/dist/lib/containers/group.js +47 -0
  11. package/dist/lib/containers/index.d.ts +6 -0
  12. package/dist/lib/containers/index.js +13 -0
  13. package/dist/lib/containers/list.d.ts +66 -0
  14. package/dist/lib/containers/list.js +105 -0
  15. package/dist/lib/errors.d.ts +22 -0
  16. package/dist/lib/errors.js +23 -0
  17. package/dist/lib/index.d.ts +29 -0
  18. package/dist/lib/index.js +128 -0
  19. package/dist/lib/inputs/autocomplete.d.ts +31 -0
  20. package/dist/lib/inputs/autocomplete.js +49 -0
  21. package/dist/lib/inputs/color-picker.d.ts +23 -0
  22. package/dist/lib/inputs/color-picker.js +42 -0
  23. package/dist/lib/inputs/date-input.d.ts +35 -0
  24. package/dist/lib/inputs/date-input.js +78 -0
  25. package/dist/lib/inputs/index.d.ts +24 -0
  26. package/dist/lib/inputs/index.js +49 -0
  27. package/dist/lib/inputs/number-input.d.ts +29 -0
  28. package/dist/lib/inputs/number-input.js +53 -0
  29. package/dist/lib/inputs/select-asset-kna.d.ts +34 -0
  30. package/dist/lib/inputs/select-asset-kna.js +50 -0
  31. package/dist/lib/inputs/select-input.d.ts +18 -0
  32. package/dist/lib/inputs/select-input.js +29 -0
  33. package/dist/lib/inputs/service-input.d.ts +27 -0
  34. package/dist/lib/inputs/service-input.js +41 -0
  35. package/dist/lib/inputs/slider.d.ts +33 -0
  36. package/dist/lib/inputs/slider.js +51 -0
  37. package/dist/lib/inputs/switch.d.ts +21 -0
  38. package/dist/lib/inputs/switch.js +39 -0
  39. package/dist/lib/inputs/text-area.d.ts +20 -0
  40. package/dist/lib/inputs/text-area.js +37 -0
  41. package/dist/lib/inputs/text-format.d.ts +28 -0
  42. package/dist/lib/inputs/text-format.js +37 -0
  43. package/dist/lib/inputs/text-input.d.ts +34 -0
  44. package/dist/lib/inputs/text-input.js +64 -0
  45. package/dist/lib/ui/index.d.ts +4 -0
  46. package/dist/lib/ui/index.js +5 -0
  47. package/dist/lib/ui/label.d.ts +18 -0
  48. package/dist/lib/ui/label.js +30 -0
  49. package/dist/lib/utils/index.d.ts +1 -0
  50. package/dist/lib/utils/index.js +22 -0
  51. package/dist/lib/utils/typeDefs.d.ts +7 -0
  52. package/dist/lib/utils/typeDefs.js +18 -0
  53. package/dist/lib/utils/validation.d.ts +7 -0
  54. package/dist/lib/utils/validation.js +26 -0
  55. package/dist/lib/values.d.ts +21 -0
  56. package/dist/lib/values.js +86 -0
  57. package/dist/lib/visibility.d.ts +2 -0
  58. package/dist/lib/visibility.js +20 -0
  59. package/package.json +22 -0
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var text_area_1 = require("./text-area");
4
+ exports.TextArea = text_area_1.TextArea;
5
+ var text_format_1 = require("./text-format");
6
+ exports.TextFormat = text_format_1.TextFormat;
7
+ var text_input_1 = require("./text-input");
8
+ exports.TextInput = text_input_1.TextInput;
9
+ var autocomplete_1 = require("./autocomplete");
10
+ exports.Autocomplete = autocomplete_1.Autocomplete;
11
+ var select_input_1 = require("./select-input");
12
+ exports.SelectInput = select_input_1.SelectInput;
13
+ var switch_1 = require("./switch");
14
+ exports.Switch = switch_1.Switch;
15
+ var number_input_1 = require("./number-input");
16
+ exports.NumberInput = number_input_1.NumberInput;
17
+ var color_picker_1 = require("./color-picker");
18
+ exports.ColorPicker = color_picker_1.ColorPicker;
19
+ var date_input_1 = require("./date-input");
20
+ exports.DateInput = date_input_1.DateInput;
21
+ var select_asset_kna_1 = require("./select-asset-kna");
22
+ exports.SelectAssetKna = select_asset_kna_1.SelectAssetKna;
23
+ var slider_1 = require("./slider");
24
+ exports.Slider = slider_1.Slider;
25
+ var service_input_1 = require("./service-input");
26
+ exports.ServiceInput = service_input_1.ServiceInput;
27
+ exports.allInputs = [
28
+ text_format_1.TextFormat,
29
+ text_input_1.TextInput,
30
+ select_input_1.SelectInput,
31
+ switch_1.Switch,
32
+ text_area_1.TextArea,
33
+ autocomplete_1.Autocomplete,
34
+ number_input_1.NumberInput,
35
+ color_picker_1.ColorPicker,
36
+ date_input_1.DateInput,
37
+ select_asset_kna_1.SelectAssetKna,
38
+ slider_1.Slider,
39
+ service_input_1.ServiceInput
40
+ ];
41
+ exports.isInput = function (arg) {
42
+ return arg && arg.id !== undefined && arg.valueTypeDef !== undefined;
43
+ };
44
+ exports.isInputInstance = function (arg, type) {
45
+ if (typeof type === 'string')
46
+ return arg && arg.type === type;
47
+ else
48
+ return arg && type.indexOf(arg.type) !== -1;
49
+ };
@@ -0,0 +1,29 @@
1
+ import { Omit, Input, IInput } from '../base';
2
+ import { NumberRangeValue } from '../values';
3
+ import { ValueError } from '../errors';
4
+ export interface INumberInput extends IInput {
5
+ description?: string;
6
+ required?: boolean;
7
+ displayFormat?: string;
8
+ range?: NumberRangeValue;
9
+ }
10
+ export interface NumberInputJSON extends Omit<INumberInput, 'range'> {
11
+ range?: string;
12
+ }
13
+ export declare namespace NumberInput {
14
+ type Error = ValueError.Required | ValueError.Max | ValueError.Min | ValueError.InvalidValue;
15
+ type Value = number | string;
16
+ }
17
+ export declare class NumberInput extends Input<NumberInput.Value, NumberInput.Error> {
18
+ static type: string;
19
+ type: string;
20
+ readonly range?: NumberRangeValue;
21
+ readonly description?: string;
22
+ readonly required?: boolean;
23
+ readonly displayFormat?: string;
24
+ constructor(options: INumberInput);
25
+ validateInput(value?: number): NumberInput.Error[];
26
+ isValidValue(value: any): value is NumberInput.Value;
27
+ static fromJSON(value: NumberInputJSON): NumberInput;
28
+ valueTypeDef: () => string;
29
+ }
@@ -0,0 +1,53 @@
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 NumberInput = (function (_super) {
25
+ __extends(NumberInput, _super);
26
+ function NumberInput(options) {
27
+ var _this = _super.call(this, options) || this;
28
+ _this.type = NumberInput.type;
29
+ _this.valueTypeDef = function () { return 'number'; };
30
+ _this.range = options.range;
31
+ _this.description = options.description;
32
+ _this.required = options.required;
33
+ _this.displayFormat = options.displayFormat;
34
+ return _this;
35
+ }
36
+ NumberInput.prototype.validateInput = function (value) {
37
+ var errors = [];
38
+ errors = errors.concat(validation_1.Validator.required(value, this.required));
39
+ if (this.range && value) {
40
+ errors = errors.concat(validation_1.Validator.max(value, this.range.max), validation_1.Validator.min(value, this.range.min));
41
+ }
42
+ return errors;
43
+ };
44
+ NumberInput.prototype.isValidValue = function (value) {
45
+ return isNaN(value) === false;
46
+ };
47
+ NumberInput.fromJSON = function (value) {
48
+ return new NumberInput(__assign({}, value, { range: value.range && values_1.NumberRangeValue.fromJSON(value.range) || undefined }));
49
+ };
50
+ NumberInput.type = 'number-input';
51
+ return NumberInput;
52
+ }(base_1.Input));
53
+ exports.NumberInput = NumberInput;
@@ -0,0 +1,34 @@
1
+ import { Input, IInput } from '../base';
2
+ import { ValueError } from '../errors';
3
+ export interface ISelectAssetKna extends IInput {
4
+ description?: string;
5
+ required?: boolean;
6
+ extensions?: string[];
7
+ multiple?: boolean;
8
+ }
9
+ export declare namespace SelectAssetKna {
10
+ type Error = ValueError.Required | {
11
+ type: 'NotFound';
12
+ };
13
+ type Value = AssetValue | AssetValue[];
14
+ type AssetValue = {
15
+ id: string;
16
+ filename: string;
17
+ extension?: string;
18
+ __isAsset: true;
19
+ __notFound?: boolean;
20
+ };
21
+ }
22
+ export declare class SelectAssetKna extends Input<SelectAssetKna.Value, SelectAssetKna.Error> {
23
+ static type: string;
24
+ type: string;
25
+ readonly description?: string;
26
+ readonly required?: boolean;
27
+ readonly extensions?: string[];
28
+ readonly multiple: boolean;
29
+ constructor(options: ISelectAssetKna);
30
+ validateInput(value: SelectAssetKna.Value): SelectAssetKna.Error[];
31
+ isValidValue(v: any): v is SelectAssetKna.Value;
32
+ static fromJSON: (value: ISelectAssetKna) => SelectAssetKna;
33
+ valueTypeDef: () => string;
34
+ }
@@ -0,0 +1,50 @@
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 validation_1 = require("../utils/validation");
15
+ var SelectAssetKna = (function (_super) {
16
+ __extends(SelectAssetKna, _super);
17
+ function SelectAssetKna(options) {
18
+ var _this = _super.call(this, options) || this;
19
+ _this.type = SelectAssetKna.type;
20
+ _this.valueTypeDef = function () {
21
+ return "{id?: string, filename?: string, extension?: string}" + (_this.multiple ? '[]' : '');
22
+ };
23
+ _this.description = options.description;
24
+ _this.required = options.required;
25
+ _this.extensions = options.extensions;
26
+ _this.multiple = options.multiple === true;
27
+ return _this;
28
+ }
29
+ SelectAssetKna.prototype.validateInput = function (value) {
30
+ var errors = [];
31
+ errors = errors.concat(validation_1.Validator.required(value, this.required));
32
+ if (value) {
33
+ var values = Array.isArray(value) ? value : [value];
34
+ if (values.some(function (x) { return x.__notFound === true; })) {
35
+ errors = errors.concat({ type: 'NotFound' });
36
+ }
37
+ }
38
+ return errors;
39
+ };
40
+ SelectAssetKna.prototype.isValidValue = function (v) {
41
+ var values = Array.isArray(v) ? v : [v];
42
+ return values.some(function (x) { return x.__isAsset !== true; }) === false;
43
+ };
44
+ SelectAssetKna.type = 'select-asset-kna-input';
45
+ SelectAssetKna.fromJSON = function (value) {
46
+ return new SelectAssetKna(value);
47
+ };
48
+ return SelectAssetKna;
49
+ }(base_1.Input));
50
+ exports.SelectAssetKna = SelectAssetKna;
@@ -0,0 +1,18 @@
1
+ import { Autocomplete, IAutocomplete } from './autocomplete';
2
+ import { ValueError } from '../errors';
3
+ export interface ISelectInput<T extends number | string> extends IAutocomplete<T> {
4
+ multiple?: boolean;
5
+ searchEnabled?: boolean;
6
+ }
7
+ export declare namespace SelectInput {
8
+ type Error = ValueError.Required;
9
+ type Value = number | string | number[] | string[];
10
+ }
11
+ export declare class SelectInput<T extends number | string> extends Autocomplete<T> {
12
+ static type: string;
13
+ type: string;
14
+ readonly multiple?: boolean;
15
+ readonly searchEnabled?: boolean;
16
+ constructor(options: ISelectInput<T>);
17
+ static fromJSON(value: ISelectInput<any>): SelectInput<any>;
18
+ }
@@ -0,0 +1,29 @@
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 autocomplete_1 = require("./autocomplete");
14
+ var SelectInput = (function (_super) {
15
+ __extends(SelectInput, _super);
16
+ function SelectInput(options) {
17
+ var _this = _super.call(this, options) || this;
18
+ _this.type = SelectInput.type;
19
+ _this.multiple = options.multiple;
20
+ _this.searchEnabled = options.searchEnabled;
21
+ return _this;
22
+ }
23
+ SelectInput.fromJSON = function (value) {
24
+ return new SelectInput(value);
25
+ };
26
+ SelectInput.type = 'select-input';
27
+ return SelectInput;
28
+ }(autocomplete_1.Autocomplete));
29
+ exports.SelectInput = SelectInput;
@@ -0,0 +1,27 @@
1
+ import { Input, IInput } from '../base';
2
+ import { ValueError } from '../errors';
3
+ export declare type ServiceType = 'RSSService' | 'InstagramMediaService' | 'LinkedInCompanyMediaService' | 'FacebookPageService' | 'WeatherService';
4
+ export interface IServiceInput extends IInput {
5
+ serviceType: ServiceType;
6
+ required?: boolean;
7
+ }
8
+ export declare namespace ServiceInput {
9
+ type Error = ValueError.Required;
10
+ type Value = {
11
+ id: string;
12
+ __isService: true;
13
+ };
14
+ }
15
+ export declare class ServiceInput extends Input<ServiceInput.Value, ServiceInput.Error> {
16
+ static type: string;
17
+ type: string;
18
+ readonly serviceType: ServiceType;
19
+ readonly required?: boolean;
20
+ constructor(options: IServiceInput);
21
+ validateInput(value?: {
22
+ id: string;
23
+ }): ServiceInput.Error[];
24
+ isValidValue(v: any): v is ServiceInput.Value;
25
+ static fromJSON: (value: IServiceInput) => ServiceInput;
26
+ valueTypeDef: () => string;
27
+ }
@@ -0,0 +1,41 @@
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 validation_1 = require("../utils/validation");
15
+ var ServiceInput = (function (_super) {
16
+ __extends(ServiceInput, _super);
17
+ function ServiceInput(options) {
18
+ var _this = _super.call(this, options) || this;
19
+ _this.type = ServiceInput.type;
20
+ _this.valueTypeDef = function () {
21
+ return "{ id: string }";
22
+ };
23
+ _this.serviceType = options.serviceType;
24
+ _this.required = options.required;
25
+ return _this;
26
+ }
27
+ ServiceInput.prototype.validateInput = function (value) {
28
+ var errors = [];
29
+ errors = errors.concat(validation_1.Validator.required(value, this.required));
30
+ return errors;
31
+ };
32
+ ServiceInput.prototype.isValidValue = function (v) {
33
+ return v && v.__isService;
34
+ };
35
+ ServiceInput.type = 'service-input';
36
+ ServiceInput.fromJSON = function (value) {
37
+ return new ServiceInput(value);
38
+ };
39
+ return ServiceInput;
40
+ }(base_1.Input));
41
+ exports.ServiceInput = ServiceInput;
@@ -0,0 +1,33 @@
1
+ import { Input, IInput } from '../base';
2
+ import { ValueError } from '../errors';
3
+ export interface ISlider extends IInput {
4
+ required?: boolean;
5
+ min: number;
6
+ max: number;
7
+ step?: number;
8
+ defaultValue?: number;
9
+ description?: string;
10
+ leftTip?: string;
11
+ rightTip?: string;
12
+ }
13
+ export declare namespace Slider {
14
+ type Error = ValueError.Required | ValueError.Max | ValueError.Min;
15
+ type Value = number;
16
+ }
17
+ export declare class Slider extends Input<Slider.Value, Slider.Error> {
18
+ static type: string;
19
+ type: string;
20
+ readonly required?: boolean;
21
+ readonly min: number;
22
+ readonly max: number;
23
+ readonly step?: number;
24
+ readonly defaultValue?: number;
25
+ readonly leftTip?: string;
26
+ readonly rightTip?: string;
27
+ readonly description?: string;
28
+ constructor(options: ISlider);
29
+ validateInput(value: Slider.Value): Slider.Error[];
30
+ isValidValue(v: any): v is Slider.Value;
31
+ static fromJSON: (value: ISlider) => Slider;
32
+ valueTypeDef: () => string;
33
+ }
@@ -0,0 +1,51 @@
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 Slider = (function (_super) {
15
+ __extends(Slider, _super);
16
+ function Slider(options) {
17
+ var _this = _super.call(this, options) || this;
18
+ _this.type = Slider.type;
19
+ _this.valueTypeDef = function () {
20
+ return "number";
21
+ };
22
+ _this.required = options.required;
23
+ _this.min = options.min;
24
+ _this.max = options.max;
25
+ _this.step = options.step;
26
+ _this.defaultValue = options.defaultValue;
27
+ _this.leftTip = options.leftTip;
28
+ _this.rightTip = options.rightTip;
29
+ _this.description = options.description;
30
+ return _this;
31
+ }
32
+ Slider.prototype.validateInput = function (value) {
33
+ var errors = [];
34
+ if (value === undefined && this.required)
35
+ errors.push({ type: 'required' });
36
+ if (value > this.max)
37
+ errors.push({ type: 'max', payload: this.max });
38
+ if (value < this.min)
39
+ errors.push({ type: 'min', payload: this.min });
40
+ return errors;
41
+ };
42
+ Slider.prototype.isValidValue = function (v) {
43
+ return typeof v === 'number';
44
+ };
45
+ Slider.type = 'slider';
46
+ Slider.fromJSON = function (value) {
47
+ return new Slider(value);
48
+ };
49
+ return Slider;
50
+ }(base_1.Input));
51
+ exports.Slider = Slider;
@@ -0,0 +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
+ }
@@ -0,0 +1,39 @@
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 Switch = (function (_super) {
15
+ __extends(Switch, _super);
16
+ function Switch(options) {
17
+ var _this = _super.call(this, options) || this;
18
+ _this.type = Switch.type;
19
+ _this.valueTypeDef = function () {
20
+ return "boolean";
21
+ };
22
+ _this.defaultValue = options.defaultValue;
23
+ _this.displayOnTrue = options.displayOnTrue;
24
+ _this.displayOnFalse = options.displayOnFalse;
25
+ return _this;
26
+ }
27
+ Switch.prototype.validateInput = function () {
28
+ return [];
29
+ };
30
+ Switch.prototype.isValidValue = function (v) {
31
+ return typeof v === 'boolean';
32
+ };
33
+ Switch.type = 'switch';
34
+ Switch.fromJSON = function (value) {
35
+ return new Switch(value);
36
+ };
37
+ return Switch;
38
+ }(base_1.Input));
39
+ exports.Switch = Switch;
@@ -0,0 +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
+ }
@@ -0,0 +1,37 @@
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 text_input_1 = require("./text-input");
22
+ var TextArea = (function (_super) {
23
+ __extends(TextArea, _super);
24
+ function TextArea(options) {
25
+ var _this = _super.call(this, options) || this;
26
+ _this.type = TextArea.type;
27
+ _this.rows = options.rows;
28
+ return _this;
29
+ }
30
+ TextArea.fromJSON = function (value) {
31
+ var parsed = text_input_1.TextInput.parseJSON(value);
32
+ return new TextArea(__assign({}, parsed, { rows: value.rows }));
33
+ };
34
+ TextArea.type = 'text-area';
35
+ return TextArea;
36
+ }(text_input_1.TextInput));
37
+ exports.TextArea = TextArea;
@@ -0,0 +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
+ }
@@ -0,0 +1,37 @@
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 TextFormat = (function (_super) {
15
+ __extends(TextFormat, _super);
16
+ function TextFormat(options) {
17
+ var _this = _super.call(this, options) || this;
18
+ _this.type = TextFormat.type;
19
+ _this.valueTypeDef = function () {
20
+ return "{ fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }";
21
+ };
22
+ _this.description = options.description;
23
+ return _this;
24
+ }
25
+ TextFormat.prototype.validateInput = function () {
26
+ return [];
27
+ };
28
+ TextFormat.prototype.isValidValue = function (v) {
29
+ return typeof v === 'object';
30
+ };
31
+ TextFormat.type = 'text-format';
32
+ TextFormat.fromJSON = function (value) {
33
+ return new TextFormat(value);
34
+ };
35
+ return TextFormat;
36
+ }(base_1.Input));
37
+ exports.TextFormat = TextFormat;
@@ -0,0 +1,34 @@
1
+ import { Input, IInput, Omit } 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
+ }