px-react-ui-components 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -229,9 +229,6 @@ function MyInput({
229
229
  // min ve max kontrolü
230
230
  if (min && newValue < min) newValue = min;else if (max && newValue > max) newValue = max;
231
231
  }
232
- if (type === MyInputType.MONEY && newValue) {
233
- newValue = newValue.replace(/[^0-9.]/g, '');
234
- }
235
232
  if (type === MyInputType.TEXT || type === MyInputType.TEXTAREA) {
236
233
  newValue = newValue.trim();
237
234
  if (uppercase) newValue = newValue.toLocaleUpperCase("TR");else if (lowercase) newValue = newValue.toLocaleLowerCase("TR");else if (firstUppercase) newValue = newValue.split(' ').map(word => word.charAt(0).toLocaleUpperCase("TR") + word.slice(1).toLocaleLowerCase("TR")).join(' ');
@@ -249,6 +246,9 @@ function MyInput({
249
246
  typingTimeoutRef.current = setTimeout(() => {
250
247
  setIsTyping(false);
251
248
  if (onChange) {
249
+ if (type === MyInputType.MONEY && newValue) {
250
+ newValue = parseFloat(newValue.replace(/,/g, '')).toFixed(decimalCount);
251
+ }
252
252
  onChange({
253
253
  value: newValue,
254
254
  target: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "px-react-ui-components",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "commonjs",