react-credit-calculator
Advanced tools
Comparing version 1.0.0-rc1.6 to 1.1.0
@@ -10,3 +10,3 @@ /// <reference types="react" /> | ||
} | ||
export declare class Calculator extends React.Component<CalculatorProps, any> { | ||
export declare class Calculator extends React.Component<CalculatorProps> { | ||
static readonly propTypes: { | ||
@@ -13,0 +13,0 @@ interest: PropTypes.Validator<any>; |
@@ -5,3 +5,3 @@ /// <reference types="react" /> | ||
import { CalculatorControlWrapperContext } from "../CalculatorControlWrapper/CalculatorControlWrapperContext"; | ||
export declare class CalculatorInput extends React.Component<React.HTMLProps<HTMLInputElement>, undefined> { | ||
export declare class CalculatorInput extends React.Component<React.HTMLProps<HTMLInputElement>> { | ||
static readonly contextTypes: { | ||
@@ -8,0 +8,0 @@ Conditions: PropTypes.Validator<any>; |
@@ -6,5 +6,6 @@ /// <reference types="react" /> | ||
import { CalculatorLabelContext } from "./CalculatorLabelContext"; | ||
export declare class CalculatorLabel extends React.Component<CalculatorLabelProps, undefined> { | ||
export declare class CalculatorLabel extends React.Component<CalculatorLabelProps> { | ||
static readonly propTypes: { | ||
labelType: PropTypes.Requireable<any>; | ||
returnDateFormat: PropTypes.Requireable<any>; | ||
}; | ||
@@ -16,3 +17,4 @@ static readonly contextTypes: { | ||
render(): JSX.Element; | ||
protected readonly children: number; | ||
protected readonly children: number | string; | ||
protected readonly returnDate: Date; | ||
} |
import * as React from "react"; | ||
import * as PropTypes from "prop-types"; | ||
export declare enum CalculatorLabelTypes { | ||
term = "term", | ||
total = "total", | ||
amount = "amount", | ||
term = "term", | ||
interest = "interest", | ||
total = "total", | ||
returnDate = "returnDate", | ||
} | ||
export interface CalculatorLabelProps extends React.HTMLProps<HTMLSpanElement> { | ||
labelType: CalculatorLabelTypes; | ||
returnDateFormat?: (date: Date) => string; | ||
} | ||
export declare const CalculatorLabelPropTypes: { | ||
labelType: PropTypes.Requireable<any>; | ||
returnDateFormat: PropTypes.Requireable<any>; | ||
}; |
@@ -793,3 +793,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
labelType = _a.labelType, | ||
childContext = __rest(_a, ["labelType"]); | ||
returnDateFormat = _a.returnDateFormat, | ||
childContext = __rest(_a, ["labelType", "returnDateFormat"]); | ||
return React.createElement("span", Object.assign({}, childContext), this.children); | ||
@@ -809,2 +810,4 @@ } | ||
return Math.round(this.context.Credit.amount + this.context.Credit.interest); | ||
case _CalculatorLabelProps.CalculatorLabelTypes.returnDate: | ||
return this.props.returnDateFormat ? this.props.returnDateFormat(this.returnDate) : this.context.Credit.term; | ||
default: | ||
@@ -814,2 +817,9 @@ return 0; | ||
} | ||
}, { | ||
key: "returnDate", | ||
get: function get() { | ||
var currentDate = new Date(); | ||
currentDate.setDate(currentDate.getDate() + this.context.Credit.term); | ||
return currentDate; | ||
} | ||
}]); | ||
@@ -871,9 +881,11 @@ | ||
(function (CalculatorLabelTypes) { | ||
CalculatorLabelTypes["term"] = "term"; | ||
CalculatorLabelTypes["total"] = "total"; | ||
CalculatorLabelTypes["amount"] = "amount"; | ||
CalculatorLabelTypes["term"] = "term"; | ||
CalculatorLabelTypes["interest"] = "interest"; | ||
CalculatorLabelTypes["total"] = "total"; | ||
CalculatorLabelTypes["returnDate"] = "returnDate"; | ||
})(CalculatorLabelTypes || (exports.CalculatorLabelTypes = CalculatorLabelTypes = {})); | ||
var CalculatorLabelPropTypes = exports.CalculatorLabelPropTypes = { | ||
labelType: PropTypes.oneOf(Object.keys(CalculatorLabelTypes)) | ||
labelType: PropTypes.oneOf(Object.keys(CalculatorLabelTypes)), | ||
returnDateFormat: PropTypes.func | ||
}; | ||
@@ -880,0 +892,0 @@ |
{ | ||
"name": "react-credit-calculator", | ||
"version": "1.0.0-rc1.6", | ||
"version": "1.1.0", | ||
"description": "Credit calculator based on rc-slider", | ||
@@ -12,3 +12,3 @@ "main": "build/index.js", | ||
"coverage": "./node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && codecov", | ||
"lint": "./node_modules/.bin/tslint --project . --exclude ./node_modules/* --exclude ./build/**.ts", | ||
"lint": "./node_modules/.bin/tslint --project .", | ||
"prepublishOnly": "npm run build" | ||
@@ -15,0 +15,0 @@ }, |
@@ -5,10 +5,12 @@ import * as React from "react"; | ||
export enum CalculatorLabelTypes { | ||
term = "term", | ||
total = "total", | ||
amount = "amount", | ||
term = "term", | ||
interest = "interest", | ||
total = "total", | ||
returnDate = "returnDate" | ||
} | ||
export interface CalculatorLabelProps extends React.HTMLProps<HTMLSpanElement> { | ||
labelType: CalculatorLabelTypes, | ||
labelType: CalculatorLabelTypes; | ||
returnDateFormat?: (date: Date) => string; | ||
} | ||
@@ -18,2 +20,3 @@ | ||
labelType: PropTypes.oneOf(Object.keys(CalculatorLabelTypes)), | ||
returnDateFormat: PropTypes.func | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
103481
2194
0
1