react-credit-calculator
Advanced tools
Comparing version 3.1.3 to 3.2.0
@@ -339,2 +339,17 @@ 'use strict'; | ||
var Range = function Range(props) { | ||
var context = React.useContext(ControlContext); | ||
var handleChange = React.useCallback(function (e) { | ||
context.onChange(Number(e.target.value)); | ||
}, [context.onChange]); | ||
return React.createElement("input", _extends({}, props, { | ||
type: "range", | ||
min: context.min, | ||
max: context.max, | ||
step: context.step, | ||
value: context.value, | ||
onChange: handleChange | ||
})); | ||
}; | ||
exports.Button = Button; | ||
@@ -349,2 +364,3 @@ exports.Context = Context; | ||
exports.Label = Label; | ||
exports.Range = Range; | ||
exports.SummaryButton = SummaryButton; |
@@ -339,2 +339,17 @@ import { createContext, useState, useCallback, createElement, useContext, useRef, useEffect } from 'react'; | ||
export { Button, Context, ContextDefaultValue, ControlContext, ControlTypes, ControlWrapper, Controller, DateLabel, Input, Label, LabelType, SummaryButton }; | ||
var Range = function Range(props) { | ||
var context = useContext(ControlContext); | ||
var handleChange = useCallback(function (e) { | ||
context.onChange(Number(e.target.value)); | ||
}, [context.onChange]); | ||
return createElement("input", _extends({}, props, { | ||
type: "range", | ||
min: context.min, | ||
max: context.max, | ||
step: context.step, | ||
value: context.value, | ||
onChange: handleChange | ||
})); | ||
}; | ||
export { Button, Context, ContextDefaultValue, ControlContext, ControlTypes, ControlWrapper, Controller, DateLabel, Input, Label, LabelType, Range, SummaryButton }; |
@@ -10,1 +10,2 @@ export * from "./Controller"; | ||
export * from "./SummaryButton"; | ||
export * from "./Range"; |
{ | ||
"name": "react-credit-calculator", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"description": "Simple credit calculator", | ||
@@ -47,2 +47,3 @@ "main": "dist/react-credit-calculator.cjs.js", | ||
"@types/react": "^16.8.22", | ||
"@types/sinon": "^7.0.13", | ||
"codecov": "^3.1.0", | ||
@@ -60,4 +61,5 @@ "cross-env": "^5.0.5", | ||
"rollup-plugin-node-resolve": "^5.0.2", | ||
"sinon": "^7.3.2", | ||
"source-map-support": "^0.4.18", | ||
"ts-jest": "^23.10.5", | ||
"ts-jest": "^24.0.2", | ||
"ts-node": "^3.3.0", | ||
@@ -71,3 +73,4 @@ "tslint": "^5.7.0", | ||
"pre-commit": [ | ||
"lint" | ||
"lint", | ||
"test" | ||
], | ||
@@ -74,0 +77,0 @@ "jest": { |
@@ -10,1 +10,2 @@ export * from "./Controller"; | ||
export * from "./SummaryButton"; | ||
export * from "./Range"; |
@@ -17,3 +17,2 @@ { | ||
"triple-equals": true, | ||
"typeof-compare": true, | ||
"max-classes-per-file": [ | ||
@@ -20,0 +19,0 @@ true, |
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
40995
33
1137
30