Comparing version 1.13.0 to 1.14.0
@@ -5,3 +5,3 @@ import React, { ReactNode } from 'react'; | ||
hint?: ReactNode; | ||
errorMessage?: string; | ||
errorMessage?: string | (string | undefined)[]; | ||
className?: string; | ||
@@ -8,0 +8,0 @@ children: ReactNode; |
@@ -16,6 +16,13 @@ "use strict"; | ||
_b)); | ||
var errorMessages = []; | ||
if (Array.isArray(errorMessage)) { | ||
errorMessages = errorMessage.filter(Boolean); | ||
} | ||
else if (errorMessage) { | ||
errorMessages = [errorMessage]; | ||
} | ||
return (react_1.default.createElement("div", { className: mergedClassNames }, | ||
Boolean(label) && react_1.default.createElement("span", { className: FormField_module_css_1.default.label }, label), | ||
children, | ||
Boolean(errorMessage) && react_1.default.createElement("span", { className: FormField_module_css_1.default.errorMessage }, errorMessage), | ||
errorMessages.map(function (err) { return (react_1.default.createElement("span", { key: err, className: FormField_module_css_1.default.errorMessage }, err)); }), | ||
Boolean(hint) && react_1.default.createElement("div", { className: FormField_module_css_1.default.hint }, hint))); | ||
@@ -22,0 +29,0 @@ }; |
@@ -9,3 +9,3 @@ import React, { ChangeEventHandler, FocusEventHandler } from 'react'; | ||
placeholder?: string; | ||
type?: 'text' | 'email' | 'password'; | ||
type?: 'text' | 'email' | 'password' | 'number'; | ||
spellCheck?: boolean; | ||
@@ -12,0 +12,0 @@ autoComplete?: boolean; |
import React from 'react'; | ||
declare type Props = { | ||
value: number; | ||
onChange: (value: number) => void; | ||
onChange?: (value: number) => void; | ||
valueBoundaries: [number, number]; | ||
textBoundaries?: [string, string]; | ||
textBoundaries?: [string | undefined, string | undefined]; | ||
stepSize?: number; | ||
@@ -8,0 +8,0 @@ numberOfDecimals?: number; |
@@ -12,2 +12,3 @@ "use strict"; | ||
var Tick_1 = require("./Tick/Tick"); | ||
var math_1 = require("../../utils/math"); | ||
var css_reset_module_css_1 = __importDefault(require("../../css-reset.module.css")); | ||
@@ -17,8 +18,10 @@ var Slider_module_css_1 = __importDefault(require("./Slider.module.css")); | ||
var _b; | ||
var value = _a.value, onChange = _a.onChange, valueBoundaries = _a.valueBoundaries, textBoundaries = _a.textBoundaries, stepSize = _a.stepSize, _c = _a.numberOfDecimals, numberOfDecimals = _c === void 0 ? 0 : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.showTooltip, showTooltip = _e === void 0 ? true : _e, className = _a.className; | ||
var value = _a.value, onChange = _a.onChange, valueBoundaries = _a.valueBoundaries, textBoundaries = _a.textBoundaries, defaultStepSize = _a.stepSize, defaultNumberOfDecimals = _a.numberOfDecimals, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.showTooltip, showTooltip = _d === void 0 ? true : _d, className = _a.className; | ||
var minValue = valueBoundaries[0]; | ||
var maxValue = valueBoundaries[1]; | ||
var numberOfDecimals = defaultNumberOfDecimals !== null && defaultNumberOfDecimals !== void 0 ? defaultNumberOfDecimals : Math.max.apply(Math, valueBoundaries.map(math_1.countDecimals)); | ||
var stepSize = (defaultStepSize !== null && defaultStepSize !== void 0 ? defaultStepSize : valueBoundaries[1] <= 100) ? 1 : (maxValue - minValue) / 100; | ||
var formatValue = function (val) { | ||
return (Math.round(val * (Math.pow(10, numberOfDecimals) || 1)) / (Math.pow(10, numberOfDecimals) || 1)).toFixed(numberOfDecimals); | ||
}; | ||
var minValue = valueBoundaries[0]; | ||
var maxValue = valueBoundaries[1]; | ||
var classNames = classnames_1.default(css_reset_module_css_1.default.ventura, Slider_module_css_1.default.sliderWrapper, (_b = {}, | ||
@@ -28,3 +31,3 @@ _b[Slider_module_css_1.default.disabled] = isDisabled, | ||
return (react_1.default.createElement("div", { className: classNames }, | ||
react_1.default.createElement(react_compound_slider_1.Slider, { step: stepSize !== null && stepSize !== void 0 ? stepSize : (maxValue - minValue) / 100, domain: valueBoundaries, className: Slider_module_css_1.default.slider, onChange: function (values) { return onChange(values[0]); }, values: [value], disabled: isDisabled }, | ||
react_1.default.createElement(react_compound_slider_1.Slider, { step: stepSize, domain: valueBoundaries, className: Slider_module_css_1.default.slider, onChange: function (values) { return onChange && onChange(values[0]); }, values: [value], disabled: isDisabled }, | ||
react_1.default.createElement(react_compound_slider_1.Rail, null, function (_a) { | ||
@@ -31,0 +34,0 @@ var getRailProps = _a.getRailProps; |
{ | ||
"name": "ventura", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"repository": "git@github.com:kodiak-packages/ventura.git", | ||
@@ -5,0 +5,0 @@ "author": "Kodiak", |
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
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
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
132116
147
1981
1