react-hooks-library
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -6,2 +6,3 @@ import { Numeric } from './Numeric'; | ||
format: (formatString?: string | undefined) => string; | ||
clone: (value?: number | undefined) => Currency; | ||
} |
@@ -11,2 +11,9 @@ import * as tslib_1 from "tslib"; | ||
}; | ||
_this.clone = function (value) { | ||
return new Currency(value || _this.value, { | ||
decimals: _this.decimals, | ||
displayName: _this.field.displayName, | ||
isPercent: _this.isPercent, | ||
}); | ||
}; | ||
return _this; | ||
@@ -13,0 +20,0 @@ } |
@@ -9,2 +9,3 @@ import { Moment } from 'moment'; | ||
format: (formatString?: string) => string; | ||
clone: (value?: string | undefined) => Date; | ||
} |
@@ -12,2 +12,7 @@ import * as tslib_1 from "tslib"; | ||
}; | ||
_this.clone = function (value) { | ||
return new Date(value || _this.value, { | ||
displayName: _this.field.displayName, | ||
}); | ||
}; | ||
_this.moment = moment(value); | ||
@@ -14,0 +19,0 @@ return _this; |
@@ -12,4 +12,5 @@ /// <reference types="numeral" /> | ||
constructor(value: number, numericField: IFieldExcludeKind<INumericField>); | ||
calcTrend: (compare: number) => number | undefined; | ||
calcTrend: (compare?: number | undefined) => number | undefined; | ||
format: (formatString?: string | undefined) => string; | ||
clone: (value?: number | undefined) => Numeric; | ||
} |
@@ -9,3 +9,3 @@ import * as tslib_1 from "tslib"; | ||
_this.calcTrend = function (compare) { | ||
if (!compare || compare === 0) { | ||
if (compare == undefined || compare === 0 || Number.isNaN(compare)) { | ||
return undefined; | ||
@@ -21,2 +21,9 @@ } | ||
}; | ||
_this.clone = function (value) { | ||
return new Numeric(value || _this.value, { | ||
decimals: _this.decimals, | ||
displayName: _this.field.displayName, | ||
isPercent: _this.isPercent, | ||
}); | ||
}; | ||
_this.numeral = numeral(value); | ||
@@ -23,0 +30,0 @@ _this.decimals = numericField.decimals; |
import { IFieldExcludeKind, IPresentationField } from './types'; | ||
import { Value } from './Value'; | ||
export declare class Text extends Value<string> { | ||
valueMapper?: object; | ||
valueMapper?: IPresentationField['valueMapper']; | ||
readonly presentation: string; | ||
readonly valueDisplayName: string; | ||
constructor(value: string, presentationField: IFieldExcludeKind<IPresentationField>); | ||
clone: (value?: string | undefined) => Text; | ||
} |
@@ -7,2 +7,8 @@ import * as tslib_1 from "tslib"; | ||
var _this = _super.call(this, value, presentationField) || this; | ||
_this.clone = function (value) { | ||
return new Text(value || _this.value, { | ||
displayName: _this.field.displayName, | ||
valueMapper: _this.valueMapper, | ||
}); | ||
}; | ||
_this.valueMapper = presentationField.valueMapper; | ||
@@ -9,0 +15,0 @@ return _this; |
@@ -8,2 +8,3 @@ import { IFieldExcludeKind, IField } from './types'; | ||
constructor(value: P, field: IFieldExcludeKind<IField>); | ||
abstract clone(value: P): Value<P>; | ||
} |
{ | ||
"name": "react-hooks-library", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -19,2 +19,10 @@ import numeral from 'numeral' | ||
} | ||
public clone = (value?: number) => { | ||
return new Currency(value || this.value, { | ||
decimals: this.decimals, | ||
displayName: this.field.displayName, | ||
isPercent: this.isPercent, | ||
}) | ||
} | ||
} |
@@ -22,2 +22,8 @@ import moment, { Moment } from 'moment' | ||
} | ||
public clone = (value?: string) => { | ||
return new Date(value || this.value, { | ||
displayName: this.field.displayName, | ||
}) | ||
} | ||
} |
@@ -39,4 +39,4 @@ import numeral from 'numeral' | ||
public calcTrend = (compare: number) => { | ||
if (!compare || compare === 0) { | ||
public calcTrend = (compare?: number) => { | ||
if (compare == undefined || compare === 0 || Number.isNaN(compare)) { | ||
return undefined | ||
@@ -54,2 +54,10 @@ } | ||
} | ||
public clone = (value?: number) => { | ||
return new Numeric(value || this.value, { | ||
decimals: this.decimals, | ||
displayName: this.field.displayName, | ||
isPercent: this.isPercent, | ||
}) | ||
} | ||
} |
@@ -5,3 +5,3 @@ import { IFieldExcludeKind, IPresentationField } from './types' | ||
export class Text extends Value<string> { | ||
public valueMapper?: object | ||
public valueMapper?: IPresentationField['valueMapper'] | ||
@@ -28,2 +28,9 @@ public get presentation() { | ||
} | ||
public clone = (value?: string) => { | ||
return new Text(value || this.value, { | ||
displayName: this.field.displayName, | ||
valueMapper: this.valueMapper, | ||
}) | ||
} | ||
} |
@@ -14,2 +14,4 @@ import { IFieldExcludeKind, IField } from './types' | ||
} | ||
public abstract clone(value: P): Value<P> | ||
} |
@@ -316,3 +316,3 @@ { | ||
"strict-boolean-expressions": false, | ||
"strict-type-predicates": true, | ||
"strict-type-predicates": false, | ||
"switch-default": true, | ||
@@ -324,3 +324,3 @@ "switch-final-break": true, | ||
], | ||
"triple-equals": true, | ||
"triple-equals": false, | ||
"type-literal-delimiter": false, | ||
@@ -327,0 +327,0 @@ "typedef": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304797
2053