@vixoniccom/modules 2.13.0-dev.2 → 2.13.0-rc.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.13.0-rc.0](https://gitlab.com/mandomedio/vixonic/modules/compare/v2.13.0-dev.3...v2.13.0-rc.0) (2022-03-10)
6
+
7
+ ## [2.13.0-dev.3](https://gitlab.com/mandomedio/vixonic/modules/compare/v2.13.0-dev.2...v2.13.0-dev.3) (2022-03-01)
8
+
9
+
10
+ ### Features
11
+
12
+ * **Release:** bitly-input was modified ([9ea3b98](https://gitlab.com/mandomedio/vixonic/modules/commit/9ea3b9849a1bc14695d57d4df51949ff4cbef3e5))
13
+
5
14
  ## [2.13.0-dev.2](https://gitlab.com/mandomedio/vixonic/modules/compare/v2.13.0-dev.1...v2.13.0-dev.2) (2022-03-01)
6
15
 
7
16
 
@@ -1,6 +1,13 @@
1
- import { TextInput, ITextInput, TextInputJSON } from './text-input';
1
+ import { ITextInput } from './text-input';
2
2
  import { ValueError } from '../errors';
3
- export interface BitlyInputJSON extends TextInputJSON {
3
+ import { Input, IInput } from '../base';
4
+ export interface IBitlyInput extends IInput {
5
+ description?: string;
6
+ required?: boolean;
7
+ pattern?: string;
8
+ displayFormat?: string;
9
+ }
10
+ export interface BitlyInputJSON extends ITextInput {
4
11
  }
5
12
  export declare namespace BitlyInput {
6
13
  type Error = ValueError.Required | ValueError.Max | ValueError.Min | {
@@ -8,12 +15,23 @@ export declare namespace BitlyInput {
8
15
  };
9
16
  type Value = {
10
17
  value: string;
11
- bitlyUrl: string;
18
+ bitlyLink: string;
12
19
  };
13
20
  }
14
- export declare class BitlyInput extends TextInput {
21
+ export declare class BitlyInput extends Input<BitlyInput.Value, BitlyInput.Error> {
15
22
  static type: string;
16
23
  type: string;
24
+ readonly description?: string;
25
+ readonly required?: boolean;
26
+ readonly pattern?: string;
27
+ readonly displayFormat?: string;
17
28
  constructor(options: ITextInput);
29
+ validateInput(value?: {
30
+ value: string;
31
+ bitlyLink: string;
32
+ }): BitlyInput.Error[];
33
+ isValidValue(v: any): v is BitlyInput.Value;
34
+ protected static parseJSON(value: BitlyInputJSON): IBitlyInput;
18
35
  static fromJSON(value: BitlyInputJSON): BitlyInput;
36
+ valueTypeDef: () => string;
19
37
  }
@@ -27,19 +27,40 @@ var __assign = (this && this.__assign) || function () {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.BitlyInput = void 0;
30
- var text_input_1 = require("./text-input");
30
+ var validation_1 = require("../utils/validation");
31
+ var base_1 = require("../base");
31
32
  var BitlyInput = /** @class */ (function (_super) {
32
33
  __extends(BitlyInput, _super);
33
34
  function BitlyInput(options) {
34
35
  var _this = _super.call(this, options) || this;
35
36
  _this.type = BitlyInput.type;
37
+ _this.valueTypeDef = function () { return '{ value: string, bitlyLink: string }'; };
38
+ _this.description = options.description;
39
+ _this.required = options.required;
40
+ _this.pattern = options.pattern;
41
+ _this.displayFormat = options.displayFormat;
36
42
  return _this;
37
43
  }
44
+ BitlyInput.prototype.validateInput = function (value) {
45
+ var errors = [];
46
+ errors = errors.concat(validation_1.Validator.required(value, this.required));
47
+ if (this.pattern && value) {
48
+ var reg = new RegExp(this.pattern);
49
+ if (!reg.exec(value.bitlyLink))
50
+ errors = errors.concat({ type: 'pattern' });
51
+ }
52
+ return errors;
53
+ };
54
+ BitlyInput.prototype.isValidValue = function (v) {
55
+ return typeof v === 'object';
56
+ };
57
+ BitlyInput.parseJSON = function (value) {
58
+ return __assign({}, value);
59
+ };
38
60
  BitlyInput.fromJSON = function (value) {
39
- var parsed = text_input_1.TextInput.parseJSON(value);
40
- return new BitlyInput(__assign({}, parsed));
61
+ return new BitlyInput(this.parseJSON(value));
41
62
  };
42
63
  BitlyInput.type = 'bitly-input';
43
64
  return BitlyInput;
44
- }(text_input_1.TextInput));
65
+ }(base_1.Input));
45
66
  exports.BitlyInput = BitlyInput;
@@ -20,6 +20,6 @@ export interface JsonArray extends Array<AnyJson> {
20
20
  }
21
21
  export declare type InputValue = AnyJson;
22
22
  export declare type InputComponent = TextInput | TextFormat | BitlyInput | SelectInput<string | number> | TextArea | Switch | Autocomplete<string | number> | NumberInput | ColorPicker | DateInput | SelectAssetKna | Slider | ServiceInput;
23
- export declare const allInputs: (typeof TextInput | typeof TextFormat | typeof Autocomplete | typeof Switch | typeof NumberInput | typeof ColorPicker | typeof DateInput | typeof SelectAssetKna | typeof Slider | typeof ServiceInput)[];
23
+ export declare const allInputs: (typeof TextInput | typeof BitlyInput | typeof TextFormat | typeof Autocomplete | typeof Switch | typeof NumberInput | typeof ColorPicker | typeof DateInput | typeof SelectAssetKna | typeof Slider | typeof ServiceInput)[];
24
24
  export declare const isInput: (arg: any) => arg is InputComponent;
25
25
  export declare const isInputInstance: <T>(arg: any, type: string | string[]) => arg is T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vixoniccom/modules",
3
- "version": "2.13.0-dev.2",
3
+ "version": "2.13.0-rc.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",