@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,29 +1,29 @@
1
- import { List, Group, DynamicMatrix } from './containers';
2
- export { Group, List, DynamicMatrix };
3
- import { InputValue } from './inputs';
4
- import { ErrorsMap } from './errors';
5
- export declare namespace Configuration {
6
- type Value = {
7
- [key: string]: InputValue;
8
- };
9
- type Options = {
10
- schema: (Group | List | DynamicMatrix)[];
11
- durationFormula?: string;
12
- };
13
- }
14
- export declare class Configuration {
15
- readonly schema: (Group | List | DynamicMatrix)[];
16
- readonly durationFormula: string | undefined;
17
- constructor(options: Configuration.Options);
18
- validate(state: Configuration.Value): ErrorsMap;
19
- toJSON(): {
20
- durationFormula: string | undefined;
21
- schema: (Group | List | DynamicMatrix)[];
22
- };
23
- getDuration(_values: Configuration.Value): number | undefined;
24
- static fromJSON(input: any): Configuration;
25
- readonly declarationFileString: string;
26
- }
27
- export * from './inputs';
28
- export * from './ui';
29
- export * from './values';
1
+ import { List, Group, DynamicMatrix } from './containers';
2
+ export { Group, List, DynamicMatrix };
3
+ import { InputValue } from './inputs';
4
+ import { ErrorsMap } from './errors';
5
+ export declare namespace Configuration {
6
+ type Value = {
7
+ [key: string]: InputValue;
8
+ };
9
+ type Options = {
10
+ schema: (Group | List | DynamicMatrix)[];
11
+ durationFormula?: string;
12
+ };
13
+ }
14
+ export declare class Configuration {
15
+ readonly schema: (Group | List | DynamicMatrix)[];
16
+ readonly durationFormula: string | undefined;
17
+ constructor(options: Configuration.Options);
18
+ validate(state: Configuration.Value): ErrorsMap;
19
+ toJSON(): {
20
+ durationFormula: string | undefined;
21
+ schema: (Group | List | DynamicMatrix)[];
22
+ };
23
+ getDuration(_values: Configuration.Value): number | undefined;
24
+ static fromJSON(input: any): Configuration;
25
+ get declarationFileString(): string;
26
+ }
27
+ export * from './inputs';
28
+ export * from './ui';
29
+ export * from './values';
package/dist/lib/index.js CHANGED
@@ -1,128 +1,136 @@
1
- "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var containers_1 = require("./containers");
7
- exports.List = containers_1.List;
8
- exports.Group = containers_1.Group;
9
- exports.DynamicMatrix = containers_1.DynamicMatrix;
10
- var typeDefs_1 = require("./utils/typeDefs");
11
- var inputs_1 = require("./inputs");
12
- var Configuration = (function () {
13
- function Configuration(options) {
14
- this.schema = options.schema;
15
- this.durationFormula = options.durationFormula;
16
- }
17
- Configuration.prototype.validate = function (state) {
18
- var errors = {};
19
- this.schema.forEach(function (container) {
20
- var visible = container.shouldShow(state);
21
- if (visible === false)
22
- return;
23
- if (containers_1.Group.isInstance(container)) {
24
- var groupErrors_1 = {};
25
- // Validate each input in a group.
26
- container.items.forEach(function (input) {
27
- if (inputs_1.isInput(input)) {
28
- var inputErrors = input.validate(state[input.id], state);
29
- groupErrors_1[input.id] = inputErrors;
30
- }
31
- });
32
- errors[container.id] = groupErrors_1;
33
- }
34
- else if (containers_1.List.isInstance(container)) {
35
- // Validate the list.
36
- errors[container.id] = container.validate(state[container.id], state);
37
- }
38
- else {
39
- // Validate the dynamic matrix.
40
- errors[container.id] = container.validate(state[container.id], state);
41
- }
42
- });
43
- return errors;
44
- };
45
- Configuration.prototype.toJSON = function () {
46
- var allIds = [];
47
- this.schema.forEach(function (cont) {
48
- allIds.push(cont.id);
49
- if (containers_1.Group.isInstance(cont)) {
50
- cont.items.forEach(function (item) {
51
- if (item.hasOwnProperty('id'))
52
- allIds.push(item.id);
53
- });
54
- }
55
- });
56
- var duplicatedIds = allIds.filter(function (e, i, s) { return s.indexOf(e) !== i; });
57
- if (duplicatedIds.length > 0)
58
- console.warn("Attention, your configuration has duplicated ids [\"" + duplicatedIds.join('", "') + "\"]. If it is not intentional please check it.");
59
- return {
60
- durationFormula: this.durationFormula,
61
- schema: this.schema
62
- };
63
- };
64
- Configuration.prototype.getDuration = function (_values) {
65
- if (!this.durationFormula)
66
- return undefined;
67
- var jsEval = this.durationFormula;
68
- try {
69
- var regexp = new RegExp('{{(.*?)}}', 'ig');
70
- jsEval = jsEval.replace(regexp, "_values.$1");
71
- // tslint:disable-next-line
72
- var time = eval(jsEval);
73
- if (typeof time === 'number') {
74
- // validate number
75
- if (isNaN(time) || time < 4 || time >= 86400) {
76
- console.warn("Computed time error: Number is not valid [" + time + "]");
77
- return undefined;
78
- }
79
- return time;
80
- }
81
- else {
82
- console.warn("Computed time error: Time expression result is not a number [\"" + typeof time + "\"]");
83
- return undefined;
84
- }
85
- }
86
- catch (e) {
87
- console.warn('Computed time error: Unable to parse time expression:', jsEval, e);
88
- return undefined;
89
- }
90
- };
91
- Configuration.fromJSON = function (input) {
92
- var schema = input.schema;
93
- var durationFormula = input.durationFormula;
94
- return new Configuration({
95
- durationFormula: durationFormula,
96
- schema: schema.map(function (i) {
97
- switch (i.type) {
98
- case containers_1.List.type:
99
- return containers_1.List.fromJSON(i);
100
- case containers_1.Group.type:
101
- return containers_1.Group.fromJSON(i);
102
- case containers_1.DynamicMatrix.type:
103
- return containers_1.DynamicMatrix.fromJSON(i);
104
- }
105
- throw new Error("Invalid component type \"" + i.type + "\" in root configuration.");
106
- })
107
- });
108
- };
109
- Object.defineProperty(Configuration.prototype, "declarationFileString", {
110
- get: function () {
111
- var declarations = [];
112
- this.schema.forEach(function (g) {
113
- declarations = declarations.concat(g.valueTypeDef());
114
- });
115
- return "declare type VixonicData = {\n downloadsPath: string\n services: { [key: string]: { data?: any, updatedAt?: number } }\n parameters: VixonicParameters\n}\n\ndeclare type VixonicParameters = Partial<{\n " + typeDefs_1.defsMapToString(declarations) + "\n}>";
116
- },
117
- enumerable: true,
118
- configurable: true
119
- });
120
- return Configuration;
121
- }());
122
- exports.Configuration = Configuration;
123
- // Input components
124
- __export(require("./inputs"));
125
- // UI components
126
- __export(require("./ui"));
127
- // Values
128
- __export(require("./values"));
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.Configuration = exports.DynamicMatrix = exports.List = exports.Group = void 0;
14
+ var containers_1 = require("./containers");
15
+ Object.defineProperty(exports, "List", { enumerable: true, get: function () { return containers_1.List; } });
16
+ Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return containers_1.Group; } });
17
+ Object.defineProperty(exports, "DynamicMatrix", { enumerable: true, get: function () { return containers_1.DynamicMatrix; } });
18
+ var typeDefs_1 = require("./utils/typeDefs");
19
+ var inputs_1 = require("./inputs");
20
+ var Configuration = /** @class */ (function () {
21
+ function Configuration(options) {
22
+ this.schema = options.schema;
23
+ this.durationFormula = options.durationFormula;
24
+ }
25
+ Configuration.prototype.validate = function (state) {
26
+ var errors = {};
27
+ this.schema.forEach(function (container) {
28
+ var visible = container.shouldShow(state);
29
+ if (visible === false)
30
+ return;
31
+ if (containers_1.Group.isInstance(container)) {
32
+ var groupErrors_1 = {};
33
+ // Validate each input in a group.
34
+ container.items.forEach(function (input) {
35
+ if (inputs_1.isInput(input)) {
36
+ var inputErrors = input.validate(state[input.id], state);
37
+ groupErrors_1[input.id] = inputErrors;
38
+ }
39
+ });
40
+ errors[container.id] = groupErrors_1;
41
+ }
42
+ else if (containers_1.List.isInstance(container)) {
43
+ // Validate the list.
44
+ errors[container.id] = container.validate(state[container.id], state);
45
+ }
46
+ else {
47
+ // Validate the dynamic matrix.
48
+ errors[container.id] = container.validate(state[container.id], state);
49
+ }
50
+ });
51
+ return errors;
52
+ };
53
+ Configuration.prototype.toJSON = function () {
54
+ var allIds = [];
55
+ this.schema.forEach(function (cont) {
56
+ allIds.push(cont.id);
57
+ if (containers_1.Group.isInstance(cont)) {
58
+ cont.items.forEach(function (item) {
59
+ if (item.hasOwnProperty('id'))
60
+ allIds.push(item.id);
61
+ });
62
+ }
63
+ });
64
+ var duplicatedIds = allIds.filter(function (e, i, s) { return s.indexOf(e) !== i; });
65
+ if (duplicatedIds.length > 0)
66
+ console.warn("Attention, your configuration has duplicated ids [\"" + duplicatedIds.join('", "') + "\"]. If it is not intentional please check it.");
67
+ return {
68
+ durationFormula: this.durationFormula,
69
+ schema: this.schema
70
+ };
71
+ };
72
+ Configuration.prototype.getDuration = function (_values) {
73
+ if (!this.durationFormula)
74
+ return undefined;
75
+ var jsEval = this.durationFormula;
76
+ try {
77
+ var regexp = new RegExp('{{(.*?)}}', 'ig');
78
+ jsEval = jsEval.replace(regexp, "_values.$1");
79
+ // tslint:disable-next-line
80
+ var time = eval(jsEval);
81
+ if (typeof time === 'number') {
82
+ // validate number
83
+ if (isNaN(time) || time < 4 || time >= 86400) {
84
+ console.warn("Computed time error: Number is not valid [" + time + "]");
85
+ return undefined;
86
+ }
87
+ return time;
88
+ }
89
+ else {
90
+ console.warn("Computed time error: Time expression result is not a number [\"" + typeof time + "\"]");
91
+ return undefined;
92
+ }
93
+ }
94
+ catch (e) {
95
+ console.warn('Computed time error: Unable to parse time expression:', jsEval, e);
96
+ return undefined;
97
+ }
98
+ };
99
+ Configuration.fromJSON = function (input) {
100
+ var schema = input.schema;
101
+ var durationFormula = input.durationFormula;
102
+ return new Configuration({
103
+ durationFormula: durationFormula,
104
+ schema: schema.map(function (i) {
105
+ switch (i.type) {
106
+ case containers_1.List.type:
107
+ return containers_1.List.fromJSON(i);
108
+ case containers_1.Group.type:
109
+ return containers_1.Group.fromJSON(i);
110
+ case containers_1.DynamicMatrix.type:
111
+ return containers_1.DynamicMatrix.fromJSON(i);
112
+ }
113
+ throw new Error("Invalid component type \"" + i.type + "\" in root configuration.");
114
+ })
115
+ });
116
+ };
117
+ Object.defineProperty(Configuration.prototype, "declarationFileString", {
118
+ get: function () {
119
+ var declarations = [];
120
+ this.schema.forEach(function (g) {
121
+ declarations = declarations.concat(g.valueTypeDef());
122
+ });
123
+ return "declare type VixonicData = {\n downloadsPath: string\n services: { [key: string]: { data?: any, updatedAt?: number } }\n parameters: VixonicParameters\n}\n\ndeclare type VixonicParameters = Partial<{\n " + typeDefs_1.defsMapToString(declarations) + "\n}>";
124
+ },
125
+ enumerable: false,
126
+ configurable: true
127
+ });
128
+ return Configuration;
129
+ }());
130
+ exports.Configuration = Configuration;
131
+ // Input components
132
+ __exportStar(require("./inputs"), exports);
133
+ // UI components
134
+ __exportStar(require("./ui"), exports);
135
+ // Values
136
+ __exportStar(require("./values"), exports);
@@ -1,31 +1,31 @@
1
- import { Input, IInput } from '../base';
2
- import { ValueError } from '../errors';
3
- export interface IAutocomplete<T extends Autocomplete.Value> extends IInput {
4
- items: AutocompleteItem<T>[];
5
- description?: string;
6
- required?: boolean;
7
- defaultValue?: T;
8
- }
9
- export declare type AutocompleteItem<T> = {
10
- label: string;
11
- value: T;
12
- };
13
- export declare namespace Autocomplete {
14
- type Error = ValueError.Required | ValueError.InvalidValue;
15
- type Value = number | string;
16
- }
17
- export declare class Autocomplete<T extends Autocomplete.Value> extends Input<Autocomplete.Value, Autocomplete.Error> {
18
- static type: string;
19
- type: string;
20
- readonly items: AutocompleteItem<T>[];
21
- readonly description?: string;
22
- readonly required?: boolean;
23
- readonly multiple?: boolean;
24
- readonly searchEnabled?: boolean;
25
- readonly defaultValue?: T;
26
- constructor(options: IAutocomplete<T>);
27
- validateInput(value: T): Autocomplete.Error[];
28
- isValidValue(value: any): value is T;
29
- static fromJSON(value: IAutocomplete<any>): Autocomplete<any>;
30
- valueTypeDef: () => string;
31
- }
1
+ import { Input, IInput } from '../base';
2
+ import { ValueError } from '../errors';
3
+ export interface IAutocomplete<T extends Autocomplete.Value> extends IInput {
4
+ items: AutocompleteItem<T>[];
5
+ description?: string;
6
+ required?: boolean;
7
+ defaultValue?: T;
8
+ }
9
+ export declare type AutocompleteItem<T> = {
10
+ label: string;
11
+ value: T;
12
+ };
13
+ export declare namespace Autocomplete {
14
+ type Error = ValueError.Required | ValueError.InvalidValue;
15
+ type Value = number | string;
16
+ }
17
+ export declare class Autocomplete<T extends Autocomplete.Value> extends Input<Autocomplete.Value, Autocomplete.Error> {
18
+ static type: string;
19
+ type: string;
20
+ readonly items: AutocompleteItem<T>[];
21
+ readonly description?: string;
22
+ readonly required?: boolean;
23
+ readonly multiple?: boolean;
24
+ readonly searchEnabled?: boolean;
25
+ readonly defaultValue?: T;
26
+ constructor(options: IAutocomplete<T>);
27
+ validateInput(value: T): Autocomplete.Error[];
28
+ isValidValue(value: any): value is T;
29
+ static fromJSON(value: IAutocomplete<any>): Autocomplete<any>;
30
+ valueTypeDef: () => string;
31
+ }
@@ -1,49 +1,55 @@
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 Autocomplete = (function (_super) {
16
- __extends(Autocomplete, _super);
17
- function Autocomplete(options) {
18
- var _this = _super.call(this, options) || this;
19
- _this.type = Autocomplete.type;
20
- _this.valueTypeDef = function () {
21
- var options = _this.items.map(function (i) {
22
- if (typeof i.value === 'string')
23
- return "'" + i.value + "'";
24
- else
25
- return i.value.toString();
26
- }).join(' | ');
27
- return _this.multiple ? "(" + options + ")[]" : options;
28
- };
29
- _this.description = options.description;
30
- _this.items = options.items;
31
- _this.required = options.required;
32
- _this.defaultValue = options.defaultValue;
33
- return _this;
34
- }
35
- Autocomplete.prototype.validateInput = function (value) {
36
- var errors = [];
37
- errors = errors.concat(validation_1.Validator.required(value, this.required, true));
38
- return errors;
39
- };
40
- Autocomplete.prototype.isValidValue = function (value) {
41
- return Array.isArray(value) || typeof value === 'string' || typeof value === 'number';
42
- };
43
- Autocomplete.fromJSON = function (value) {
44
- return new Autocomplete(value);
45
- };
46
- Autocomplete.type = 'autocomplete';
47
- return Autocomplete;
48
- }(base_1.Input));
49
- exports.Autocomplete = Autocomplete;
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.Autocomplete = void 0;
19
+ var base_1 = require("../base");
20
+ var validation_1 = require("../utils/validation");
21
+ var Autocomplete = /** @class */ (function (_super) {
22
+ __extends(Autocomplete, _super);
23
+ function Autocomplete(options) {
24
+ var _this = _super.call(this, options) || this;
25
+ _this.type = Autocomplete.type;
26
+ _this.valueTypeDef = function () {
27
+ var options = _this.items.map(function (i) {
28
+ if (typeof i.value === 'string')
29
+ return "'" + i.value + "'";
30
+ else
31
+ return i.value.toString();
32
+ }).join(' | ');
33
+ return _this.multiple ? "(" + options + ")[]" : options;
34
+ };
35
+ _this.description = options.description;
36
+ _this.items = options.items;
37
+ _this.required = options.required;
38
+ _this.defaultValue = options.defaultValue;
39
+ return _this;
40
+ }
41
+ Autocomplete.prototype.validateInput = function (value) {
42
+ var errors = [];
43
+ errors = errors.concat(validation_1.Validator.required(value, this.required, true));
44
+ return errors;
45
+ };
46
+ Autocomplete.prototype.isValidValue = function (value) {
47
+ return Array.isArray(value) || typeof value === 'string' || typeof value === 'number';
48
+ };
49
+ Autocomplete.fromJSON = function (value) {
50
+ return new Autocomplete(value);
51
+ };
52
+ Autocomplete.type = 'autocomplete';
53
+ return Autocomplete;
54
+ }(base_1.Input));
55
+ exports.Autocomplete = Autocomplete;
@@ -1,23 +1,23 @@
1
- import { Input, IInput } from '../base';
2
- import { ValueError, SimpleValueError } from '../errors';
3
- export interface IColorPicker extends IInput {
4
- description?: string;
5
- required?: boolean;
6
- output?: 'hex' | 'rgba';
7
- }
8
- export declare namespace ColorPicker {
9
- type Error = ValueError.Required | ValueError.InvalidValue;
10
- type Value = string;
11
- }
12
- export declare class ColorPicker extends Input<ColorPicker.Value, ColorPicker.Error> {
13
- static type: string;
14
- type: string;
15
- readonly description?: string;
16
- readonly required?: boolean;
17
- readonly output: 'hex' | 'rgba' | 'auto';
18
- constructor(options: IColorPicker);
19
- validateInput(value: string): (SimpleValueError<"required"> | SimpleValueError<"invalidValue">)[];
20
- isValidValue(value: any): value is ColorPicker.Value;
21
- static fromJSON: (value: IColorPicker) => ColorPicker;
22
- valueTypeDef: () => string;
23
- }
1
+ import { Input, IInput } from '../base';
2
+ import { ValueError } from '../errors';
3
+ export interface IColorPicker extends IInput {
4
+ description?: string;
5
+ required?: boolean;
6
+ output?: 'hex' | 'rgba';
7
+ }
8
+ export declare namespace ColorPicker {
9
+ type Error = ValueError.Required | ValueError.InvalidValue;
10
+ type Value = string;
11
+ }
12
+ export declare class ColorPicker extends Input<ColorPicker.Value, ColorPicker.Error> {
13
+ static type: string;
14
+ type: string;
15
+ readonly description?: string;
16
+ readonly required?: boolean;
17
+ readonly output: 'hex' | 'rgba' | 'auto';
18
+ constructor(options: IColorPicker);
19
+ validateInput(value: string): ColorPicker.Error[];
20
+ isValidValue(value: any): value is ColorPicker.Value;
21
+ static fromJSON: (value: IColorPicker) => ColorPicker;
22
+ valueTypeDef: () => string;
23
+ }