@faststore/components
Advanced tools
Comparing version 3.0.141 to 3.0.144
@@ -49,7 +49,11 @@ "use strict"; | ||
const changeInputValue = (e) => { | ||
setQuantity(Number(e.currentTarget.value)); | ||
const numericValue = e.target.value.replace(/\D/g, ''); | ||
setQuantity(Number(numericValue)); | ||
}; | ||
return (react_1.default.createElement("div", { "data-fs-quantity-selector": disabled ? 'disabled' : 'true', "data-testid": testId, ...otherProps }, | ||
react_1.default.createElement(__1.IconButton, { "data-quantity-selector-button": "left", icon: react_1.default.createElement(__1.Icon, { name: "Minus", width: 16, height: 16, weight: "bold" }), "aria-label": "Decrement Quantity", "aria-controls": "quantity-selector-input", disabled: isLeftDisabled || disabled, onClick: decrease, testId: `${testId}-left-button`, size: "small" }), | ||
react_1.default.createElement(__1.Input, { "data-quantity-selector-input": true, id: "quantity-selector-input", "aria-label": "Quantity", value: useUnitMultiplier ? multipliedUnit : quantity, onChange: changeInputValue, onBlur: validateBlur, disabled: disabled }), | ||
react_1.default.createElement(__1.Input, { "data-quantity-selector-input": true, id: "quantity-selector-input", "aria-label": "Quantity", value: useUnitMultiplier ? multipliedUnit : quantity, onChange: changeInputValue, onBlur: validateBlur, onInput: (event) => { | ||
const input = event.currentTarget; | ||
input.value = input.value.replace(/\D/g, ''); | ||
}, disabled: disabled }), | ||
react_1.default.createElement(__1.IconButton, { "data-quantity-selector-button": "right", "aria-controls": "quantity-selector-input", "aria-label": "Increment Quantity", disabled: isRightDisabled || disabled, icon: react_1.default.createElement(__1.Icon, { name: "Plus", width: 16, height: 16, weight: "bold" }), onClick: increase, testId: `${testId}-right-button`, size: "small" }))); | ||
@@ -56,0 +60,0 @@ }; |
@@ -46,7 +46,11 @@ import React, { useEffect, useState } from 'react'; | ||
const changeInputValue = (e) => { | ||
setQuantity(Number(e.currentTarget.value)); | ||
const numericValue = e.target.value.replace(/\D/g, ''); | ||
setQuantity(Number(numericValue)); | ||
}; | ||
return (React.createElement("div", { "data-fs-quantity-selector": disabled ? 'disabled' : 'true', "data-testid": testId, ...otherProps }, | ||
React.createElement(IconButton, { "data-quantity-selector-button": "left", icon: React.createElement(Icon, { name: "Minus", width: 16, height: 16, weight: "bold" }), "aria-label": "Decrement Quantity", "aria-controls": "quantity-selector-input", disabled: isLeftDisabled || disabled, onClick: decrease, testId: `${testId}-left-button`, size: "small" }), | ||
React.createElement(Input, { "data-quantity-selector-input": true, id: "quantity-selector-input", "aria-label": "Quantity", value: useUnitMultiplier ? multipliedUnit : quantity, onChange: changeInputValue, onBlur: validateBlur, disabled: disabled }), | ||
React.createElement(Input, { "data-quantity-selector-input": true, id: "quantity-selector-input", "aria-label": "Quantity", value: useUnitMultiplier ? multipliedUnit : quantity, onChange: changeInputValue, onBlur: validateBlur, onInput: (event) => { | ||
const input = event.currentTarget; | ||
input.value = input.value.replace(/\D/g, ''); | ||
}, disabled: disabled }), | ||
React.createElement(IconButton, { "data-quantity-selector-button": "right", "aria-controls": "quantity-selector-input", "aria-label": "Increment Quantity", disabled: isRightDisabled || disabled, icon: React.createElement(Icon, { name: "Plus", width: 16, height: 16, weight: "bold" }), onClick: increase, testId: `${testId}-right-button`, size: "small" }))); | ||
@@ -53,0 +57,0 @@ }; |
{ | ||
"name": "@faststore/components", | ||
"version": "3.0.141", | ||
"version": "3.0.144", | ||
"main": "dist/cjs/index.js", | ||
@@ -55,3 +55,3 @@ "module": "dist/esm/index.js", | ||
}, | ||
"gitHead": "f972d71664e32d3e5b3d74a140e966cd34d73fd7" | ||
"gitHead": "90c18b6ff88534e99b479e2ece4e156af16b011d" | ||
} |
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
1286689
23572