px-react-ui-components 1.0.19 → 1.0.21
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.
|
@@ -204,8 +204,12 @@ function MyInput({
|
|
|
204
204
|
|
|
205
205
|
// Eğer değer değişmediyse güncelleme yapma
|
|
206
206
|
if (newValue === myValue) return;
|
|
207
|
-
if (type
|
|
208
|
-
|
|
207
|
+
if (type === MyInputType.NUMBER && newValue) {
|
|
208
|
+
// Sadece 0-9 arası rakamlara izin ver
|
|
209
|
+
newValue = newValue.replace(/[^0-9]/g, '');
|
|
210
|
+
|
|
211
|
+
// min ve max kontrolü
|
|
212
|
+
if (min && newValue < min) newValue = min;else if (max && newValue > max) newValue = max;
|
|
209
213
|
}
|
|
210
214
|
if (type === MyInputType.TEXT || type === MyInputType.TEXTAREA) {
|
|
211
215
|
newValue = newValue.trim();
|
|
@@ -499,7 +503,7 @@ function MyInput({
|
|
|
499
503
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
500
504
|
ref: ref,
|
|
501
505
|
id: id,
|
|
502
|
-
type: "
|
|
506
|
+
type: "text",
|
|
503
507
|
value: myValue,
|
|
504
508
|
onChange: handleChange,
|
|
505
509
|
placeholder: placeholder,
|