@yamada-ui/number-input 0.2.17 → 0.3.0
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.
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
// src/number-input.tsx
|
|
2
4
|
import {
|
|
3
5
|
ui,
|
|
@@ -169,15 +171,14 @@ var useNumberInput = (props = {}) => {
|
|
|
169
171
|
}
|
|
170
172
|
}, [cast, max, min, setValue, value, valueAsNumber]);
|
|
171
173
|
const onChange = useCallback(
|
|
172
|
-
(
|
|
173
|
-
|
|
174
|
-
if (evt.isComposing)
|
|
174
|
+
(ev) => {
|
|
175
|
+
if (ev.nativeEvent.isComposing)
|
|
175
176
|
return;
|
|
176
|
-
const parsedInput = parse(
|
|
177
|
+
const parsedInput = parse(ev.currentTarget.value);
|
|
177
178
|
update(sanitize(parsedInput));
|
|
178
179
|
inputSelectionRef.current = {
|
|
179
|
-
start:
|
|
180
|
-
end:
|
|
180
|
+
start: ev.currentTarget.selectionStart,
|
|
181
|
+
end: ev.currentTarget.selectionEnd
|
|
181
182
|
};
|
|
182
183
|
},
|
|
183
184
|
[parse, update, sanitize]
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client"
|
|
1
2
|
"use strict";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -172,15 +173,14 @@ var useNumberInput = (props = {}) => {
|
|
|
172
173
|
}
|
|
173
174
|
}, [cast, max, min, setValue, value, valueAsNumber]);
|
|
174
175
|
const onChange = (0, import_react.useCallback)(
|
|
175
|
-
(
|
|
176
|
-
|
|
177
|
-
if (evt.isComposing)
|
|
176
|
+
(ev) => {
|
|
177
|
+
if (ev.nativeEvent.isComposing)
|
|
178
178
|
return;
|
|
179
|
-
const parsedInput = parse(
|
|
179
|
+
const parsedInput = parse(ev.currentTarget.value);
|
|
180
180
|
update(sanitize(parsedInput));
|
|
181
181
|
inputSelectionRef.current = {
|
|
182
|
-
start:
|
|
183
|
-
end:
|
|
182
|
+
start: ev.currentTarget.selectionStart,
|
|
183
|
+
end: ev.currentTarget.selectionEnd
|
|
184
184
|
};
|
|
185
185
|
},
|
|
186
186
|
[parse, update, sanitize]
|
package/dist/index.mjs
CHANGED
package/dist/number-input.d.mts
CHANGED
package/dist/number-input.d.ts
CHANGED
package/dist/number-input.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client"
|
|
1
2
|
"use strict";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -170,15 +171,14 @@ var useNumberInput = (props = {}) => {
|
|
|
170
171
|
}
|
|
171
172
|
}, [cast, max, min, setValue, value, valueAsNumber]);
|
|
172
173
|
const onChange = (0, import_react.useCallback)(
|
|
173
|
-
(
|
|
174
|
-
|
|
175
|
-
if (evt.isComposing)
|
|
174
|
+
(ev) => {
|
|
175
|
+
if (ev.nativeEvent.isComposing)
|
|
176
176
|
return;
|
|
177
|
-
const parsedInput = parse(
|
|
177
|
+
const parsedInput = parse(ev.currentTarget.value);
|
|
178
178
|
update(sanitize(parsedInput));
|
|
179
179
|
inputSelectionRef.current = {
|
|
180
|
-
start:
|
|
181
|
-
end:
|
|
180
|
+
start: ev.currentTarget.selectionStart,
|
|
181
|
+
end: ev.currentTarget.selectionEnd
|
|
182
182
|
};
|
|
183
183
|
},
|
|
184
184
|
[parse, update, sanitize]
|
package/dist/number-input.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/number-input",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Yamada UI number input component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.
|
|
38
|
+
"@yamada-ui/core": "0.9.0",
|
|
39
|
+
"@yamada-ui/form-control": "0.3.0",
|
|
39
40
|
"@yamada-ui/utils": "0.2.0",
|
|
40
|
-
"@yamada-ui/
|
|
41
|
-
"@yamada-ui/
|
|
42
|
-
"@yamada-ui/use-
|
|
43
|
-
"@yamada-ui/use-
|
|
44
|
-
"@yamada-ui/use-event-listener": "0.1.6"
|
|
41
|
+
"@yamada-ui/icon": "0.3.0",
|
|
42
|
+
"@yamada-ui/use-counter": "0.3.0",
|
|
43
|
+
"@yamada-ui/use-interval": "0.2.0",
|
|
44
|
+
"@yamada-ui/use-event-listener": "0.2.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"react": "^18.0.0",
|
|
@@ -57,7 +57,10 @@
|
|
|
57
57
|
"format": [
|
|
58
58
|
"cjs",
|
|
59
59
|
"esm"
|
|
60
|
-
]
|
|
60
|
+
],
|
|
61
|
+
"banner": {
|
|
62
|
+
"js": "\"use client\""
|
|
63
|
+
}
|
|
61
64
|
},
|
|
62
65
|
"module": "dist/index.mjs",
|
|
63
66
|
"types": "dist/index.d.ts",
|