Comparing version 0.0.23 to 0.0.24
/*! | ||
* Eyzy v0.0.23 | ||
* Eyzy v0.0.24 | ||
* (c) 2022 amsik | ||
@@ -101,6 +101,11 @@ * Released under the MIT License. | ||
var Button = React__default.memo(function Button(props) { | ||
var Button = function (_a) { | ||
var variant = _a.variant, className = _a.className, children = _a.children, _b = _a.type, type = _b === void 0 ? 'button' : _b, rest = __rest(_a, ["variant", "className", "children", "type"]); | ||
var classNames = cn('e-btn', variant && "e-btn-" + variant, className); | ||
return (React__default.createElement("button", __assign({ type: type, className: classNames }, rest), children)); | ||
}; | ||
var aaa = React__default.memo(function Button(props) { | ||
var appearance = props.appearance, className = props.className, children = props.children, intent = props.intent, active = props.active, shape = props.shape, type = props.type, size = props.size, fit = props.fit, rest = __rest(props, ["appearance", "className", "children", "intent", "active", "shape", "type", "size", "fit"]); | ||
var classNames = cn('eyzy-btn', appearance && "eyzy-btn-" + appearance, intent && "eyzy-btn-" + intent, active && "eyzy-btn-active", shape && "eyzy-btn-" + shape, size && "eyzy-btn-" + size, fit && 'eyzy-btn-fit', className); | ||
return (React__default.createElement("button", __assign({ className: classNames }, rest), children)); | ||
return (React__default.createElement("button", __assign({ type: type, className: classNames }, rest), children)); | ||
}); | ||
@@ -191,5 +196,5 @@ | ||
function BaseInput(props, ref) { | ||
var className = props.className, width = props.width, required = props.required, fit = props.fit, type = props.type, style = props.style, error = props.error, helpText = props.helpText, label = props.label, onPressEnter = props.onPressEnter, onPressEsc = props.onPressEsc, onKeyDown = props.onKeyDown, onChange = props.onChange, rest = __rest(props, ["className", "width", "required", "fit", "type", "style", "error", "helpText", "label", "onPressEnter", "onPressEsc", "onKeyDown", "onChange"]); | ||
var processValue = props.processValue, className = props.className, width = props.width, fit = props.fit, type = props.type, style = props.style, onPressEnter = props.onPressEnter, onPressEsc = props.onPressEsc, onKeyDown = props.onKeyDown, onChange = props.onChange, rest = __rest(props, ["processValue", "className", "width", "fit", "type", "style", "onPressEnter", "onPressEsc", "onKeyDown", "onChange"]); | ||
var handleChange = function (e) { | ||
var val = e.target.value; | ||
var val = processValue ? processValue(e.target.value) : e.target.value; | ||
if (onChange) { | ||
@@ -217,4 +222,3 @@ onChange(val, e); | ||
var ElementType = type === 'textarea' ? 'textarea' : 'input'; | ||
var Component = (React__default.createElement(ElementType, __assign({}, rest, { ref: ref, type: type || 'text', className: classNames, style: elemStyle, onChange: handleChange, onKeyDown: handleKeyDown }))); | ||
return (React__default.createElement(Field, { label: label, helpText: helpText, fit: fit, required: required, error: error, component: Component })); | ||
return (React__default.createElement(ElementType, __assign({}, rest, { ref: ref, type: type || 'text', className: classNames, style: elemStyle, onChange: handleChange, onKeyDown: handleKeyDown }))); | ||
} | ||
@@ -251,3 +255,3 @@ var Input = React.forwardRef(BaseInput); | ||
var INT_MATCH = /^-?(\d)+/; | ||
var processValue = function (v, isInt) { | ||
var toNumber = function (v, isInt) { | ||
var _a; | ||
@@ -257,2 +261,5 @@ if (v === '-') { | ||
} | ||
v = v | ||
.replace(/\s/g, '') | ||
.replace(/,/g, '.'); | ||
if (isInt) { | ||
@@ -267,6 +274,5 @@ return ((_a = v.match(INT_MATCH)) === null || _a === void 0 ? void 0 : _a[0]) || ''; | ||
var NumberInput = React__default.memo(function NumberInput(props) { | ||
var value = undefined !== props.value | ||
? processValue(props.value, props.isInt) | ||
: ''; | ||
return (React__default.createElement(Input, __assign({}, props, { type: isMob() ? 'number' : 'text', value: value || '' }))); | ||
var isInt = props.isInt, rest = __rest(props, ["isInt"]); | ||
var processValue = function (val) { return toNumber(val, isInt); }; | ||
return (React__default.createElement(Input, __assign({}, rest, { type: 'text', inputMode: isMob() ? 'decimal' : 'text', processValue: processValue }))); | ||
}); | ||
@@ -500,4 +506,4 @@ | ||
}; | ||
var Component = (React__default.createElement("input", __assign({ type: "checkbox", onChange: handleChange, checked: checked, id: id }, rest))); | ||
return (React__default.createElement(Field, { label: label, ctrlClassName: 'e-checkbox', helpText: helpText, required: required, error: error, component: Component }, | ||
return (React__default.createElement("div", { className: 'e-checkbox' }, | ||
React__default.createElement("input", __assign({ type: "checkbox", onChange: handleChange, checked: checked, id: id }, rest)), | ||
React__default.createElement("span", { className: "e-outer" }, | ||
@@ -504,0 +510,0 @@ React__default.createElement("span", { className: "e-inner" }, checked && (React__default.createElement("svg", { focusable: "false", role: "img" }, |
/*! | ||
* Eyzy v0.0.23 | ||
* Eyzy v0.0.24 | ||
* (c) 2022 amsik | ||
@@ -95,6 +95,11 @@ * Released under the MIT License. | ||
var Button = React.memo(function Button(props) { | ||
var Button = function (_a) { | ||
var variant = _a.variant, className = _a.className, children = _a.children, _b = _a.type, type = _b === void 0 ? 'button' : _b, rest = __rest(_a, ["variant", "className", "children", "type"]); | ||
var classNames = cn('e-btn', variant && "e-btn-" + variant, className); | ||
return (React.createElement("button", __assign({ type: type, className: classNames }, rest), children)); | ||
}; | ||
var aaa = React.memo(function Button(props) { | ||
var appearance = props.appearance, className = props.className, children = props.children, intent = props.intent, active = props.active, shape = props.shape, type = props.type, size = props.size, fit = props.fit, rest = __rest(props, ["appearance", "className", "children", "intent", "active", "shape", "type", "size", "fit"]); | ||
var classNames = cn('eyzy-btn', appearance && "eyzy-btn-" + appearance, intent && "eyzy-btn-" + intent, active && "eyzy-btn-active", shape && "eyzy-btn-" + shape, size && "eyzy-btn-" + size, fit && 'eyzy-btn-fit', className); | ||
return (React.createElement("button", __assign({ className: classNames }, rest), children)); | ||
return (React.createElement("button", __assign({ type: type, className: classNames }, rest), children)); | ||
}); | ||
@@ -185,5 +190,5 @@ | ||
function BaseInput(props, ref) { | ||
var className = props.className, width = props.width, required = props.required, fit = props.fit, type = props.type, style = props.style, error = props.error, helpText = props.helpText, label = props.label, onPressEnter = props.onPressEnter, onPressEsc = props.onPressEsc, onKeyDown = props.onKeyDown, onChange = props.onChange, rest = __rest(props, ["className", "width", "required", "fit", "type", "style", "error", "helpText", "label", "onPressEnter", "onPressEsc", "onKeyDown", "onChange"]); | ||
var processValue = props.processValue, className = props.className, width = props.width, fit = props.fit, type = props.type, style = props.style, onPressEnter = props.onPressEnter, onPressEsc = props.onPressEsc, onKeyDown = props.onKeyDown, onChange = props.onChange, rest = __rest(props, ["processValue", "className", "width", "fit", "type", "style", "onPressEnter", "onPressEsc", "onKeyDown", "onChange"]); | ||
var handleChange = function (e) { | ||
var val = e.target.value; | ||
var val = processValue ? processValue(e.target.value) : e.target.value; | ||
if (onChange) { | ||
@@ -211,4 +216,3 @@ onChange(val, e); | ||
var ElementType = type === 'textarea' ? 'textarea' : 'input'; | ||
var Component = (React.createElement(ElementType, __assign({}, rest, { ref: ref, type: type || 'text', className: classNames, style: elemStyle, onChange: handleChange, onKeyDown: handleKeyDown }))); | ||
return (React.createElement(Field, { label: label, helpText: helpText, fit: fit, required: required, error: error, component: Component })); | ||
return (React.createElement(ElementType, __assign({}, rest, { ref: ref, type: type || 'text', className: classNames, style: elemStyle, onChange: handleChange, onKeyDown: handleKeyDown }))); | ||
} | ||
@@ -245,3 +249,3 @@ var Input = forwardRef(BaseInput); | ||
var INT_MATCH = /^-?(\d)+/; | ||
var processValue = function (v, isInt) { | ||
var toNumber = function (v, isInt) { | ||
var _a; | ||
@@ -251,2 +255,5 @@ if (v === '-') { | ||
} | ||
v = v | ||
.replace(/\s/g, '') | ||
.replace(/,/g, '.'); | ||
if (isInt) { | ||
@@ -261,6 +268,5 @@ return ((_a = v.match(INT_MATCH)) === null || _a === void 0 ? void 0 : _a[0]) || ''; | ||
var NumberInput = React.memo(function NumberInput(props) { | ||
var value = undefined !== props.value | ||
? processValue(props.value, props.isInt) | ||
: ''; | ||
return (React.createElement(Input, __assign({}, props, { type: isMob() ? 'number' : 'text', value: value || '' }))); | ||
var isInt = props.isInt, rest = __rest(props, ["isInt"]); | ||
var processValue = function (val) { return toNumber(val, isInt); }; | ||
return (React.createElement(Input, __assign({}, rest, { type: 'text', inputMode: isMob() ? 'decimal' : 'text', processValue: processValue }))); | ||
}); | ||
@@ -494,4 +500,4 @@ | ||
}; | ||
var Component = (React.createElement("input", __assign({ type: "checkbox", onChange: handleChange, checked: checked, id: id }, rest))); | ||
return (React.createElement(Field, { label: label, ctrlClassName: 'e-checkbox', helpText: helpText, required: required, error: error, component: Component }, | ||
return (React.createElement("div", { className: 'e-checkbox' }, | ||
React.createElement("input", __assign({ type: "checkbox", onChange: handleChange, checked: checked, id: id }, rest)), | ||
React.createElement("span", { className: "e-outer" }, | ||
@@ -498,0 +504,0 @@ React.createElement("span", { className: "e-inner" }, checked && (React.createElement("svg", { focusable: "false", role: "img" }, |
{ | ||
"name": "eyzy", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"author": "Kostiantyn", | ||
@@ -5,0 +5,0 @@ "description": "React UI Toolkit", |
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
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
172405
1684