@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
- (event) => {
173
- const evt = event.nativeEvent;
174
- if (evt.isComposing)
174
+ (ev) => {
175
+ if (ev.nativeEvent.isComposing)
175
176
  return;
176
- const parsedInput = parse(event.currentTarget.value);
177
+ const parsedInput = parse(ev.currentTarget.value);
177
178
  update(sanitize(parsedInput));
178
179
  inputSelectionRef.current = {
179
- start: event.currentTarget.selectionStart,
180
- end: event.currentTarget.selectionEnd
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
- (event) => {
176
- const evt = event.nativeEvent;
177
- if (evt.isComposing)
176
+ (ev) => {
177
+ if (ev.nativeEvent.isComposing)
178
178
  return;
179
- const parsedInput = parse(event.currentTarget.value);
179
+ const parsedInput = parse(ev.currentTarget.value);
180
180
  update(sanitize(parsedInput));
181
181
  inputSelectionRef.current = {
182
- start: event.currentTarget.selectionStart,
183
- end: event.currentTarget.selectionEnd
182
+ start: ev.currentTarget.selectionStart,
183
+ end: ev.currentTarget.selectionEnd
184
184
  };
185
185
  },
186
186
  [parse, update, sanitize]
package/dist/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
+ "use client"
1
2
  import {
2
3
  NumberInput,
3
4
  useNumberInput
4
- } from "./chunk-XXBH2BPE.mjs";
5
+ } from "./chunk-MKZU3TH2.mjs";
5
6
  export {
6
7
  NumberInput,
7
8
  useNumberInput
@@ -40,6 +40,8 @@ type UseNumberInputProps = UseFormControlProps<HTMLInputElement> & UseCounterPro
40
40
  clampValueOnBlur?: boolean;
41
41
  /**
42
42
  * If `true`, the input's value will change based on mouse wheel.
43
+ *
44
+ * @default false
43
45
  */
44
46
  allowMouseWheel?: boolean;
45
47
  /**
@@ -40,6 +40,8 @@ type UseNumberInputProps = UseFormControlProps<HTMLInputElement> & UseCounterPro
40
40
  clampValueOnBlur?: boolean;
41
41
  /**
42
42
  * If `true`, the input's value will change based on mouse wheel.
43
+ *
44
+ * @default false
43
45
  */
44
46
  allowMouseWheel?: boolean;
45
47
  /**
@@ -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
- (event) => {
174
- const evt = event.nativeEvent;
175
- if (evt.isComposing)
174
+ (ev) => {
175
+ if (ev.nativeEvent.isComposing)
176
176
  return;
177
- const parsedInput = parse(event.currentTarget.value);
177
+ const parsedInput = parse(ev.currentTarget.value);
178
178
  update(sanitize(parsedInput));
179
179
  inputSelectionRef.current = {
180
- start: event.currentTarget.selectionStart,
181
- end: event.currentTarget.selectionEnd
180
+ start: ev.currentTarget.selectionStart,
181
+ end: ev.currentTarget.selectionEnd
182
182
  };
183
183
  },
184
184
  [parse, update, sanitize]
@@ -1,7 +1,8 @@
1
+ "use client"
1
2
  import {
2
3
  NumberInput,
3
4
  useNumberInput
4
- } from "./chunk-XXBH2BPE.mjs";
5
+ } from "./chunk-MKZU3TH2.mjs";
5
6
  export {
6
7
  NumberInput,
7
8
  useNumberInput
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/number-input",
3
- "version": "0.2.17",
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.8.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/form-control": "0.2.17",
41
- "@yamada-ui/icon": "0.2.17",
42
- "@yamada-ui/use-counter": "0.2.5",
43
- "@yamada-ui/use-interval": "0.1.7",
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",