@semcore/input-number 17.0.0-prerelease.36 → 17.0.0-prerelease.37
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.
- package/CHANGELOG.md +1 -1
- package/lib/esm/InputNumber.mjs +6 -12
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/lib/esm/InputNumber.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
3
3
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
4
4
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
5
5
|
import { forkRef } from "@semcore/core/lib/utils/ref";
|
|
@@ -7,7 +7,6 @@ import Input from "@semcore/input";
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { IncrementIcon, DecrementIcon } from "./buttons.mjs";
|
|
9
9
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
10
|
-
/*!__reshadow-styles__:"./style/input-number.shadow.css"*/
|
|
11
10
|
const style = (
|
|
12
11
|
/*__reshadow_css_start__*/
|
|
13
12
|
(sstyled.insert(
|
|
@@ -35,12 +34,10 @@ class InputNumber extends Component {
|
|
|
35
34
|
super(...args);
|
|
36
35
|
_defineProperty(this, "inputRef", /* @__PURE__ */ React.createRef());
|
|
37
36
|
_defineProperty(this, "increment", (event) => {
|
|
38
|
-
|
|
39
|
-
(_b = (_a = this.inputRef.current) == null ? void 0 : _a.stepUp) == null ? void 0 : _b.call(_a, event);
|
|
37
|
+
this.inputRef.current?.stepUp?.(event);
|
|
40
38
|
});
|
|
41
39
|
_defineProperty(this, "decrement", (event) => {
|
|
42
|
-
|
|
43
|
-
(_b = (_a = this.inputRef.current) == null ? void 0 : _a.stepDown) == null ? void 0 : _b.call(_a, event);
|
|
40
|
+
this.inputRef.current?.stepDown?.(event);
|
|
44
41
|
});
|
|
45
42
|
}
|
|
46
43
|
getValueProps() {
|
|
@@ -357,8 +354,7 @@ class Value extends Component {
|
|
|
357
354
|
}
|
|
358
355
|
// https://stackoverflow.com/questions/57358640/cancel-wheel-event-with-e-preventdefault-in-react-event-bubbling
|
|
359
356
|
componentDidMount() {
|
|
360
|
-
|
|
361
|
-
(_a = this.valueInputRef.current) == null ? void 0 : _a.addEventListener("wheel", this.onWheel);
|
|
357
|
+
this.valueInputRef.current?.addEventListener("wheel", this.onWheel);
|
|
362
358
|
const {
|
|
363
359
|
inputRef,
|
|
364
360
|
value,
|
|
@@ -366,8 +362,7 @@ class Value extends Component {
|
|
|
366
362
|
} = this.asProps;
|
|
367
363
|
if (autoFocus) {
|
|
368
364
|
setTimeout(() => {
|
|
369
|
-
|
|
370
|
-
(_a2 = this.valueInputRef.current) == null ? void 0 : _a2.focus();
|
|
365
|
+
this.valueInputRef.current?.focus();
|
|
371
366
|
});
|
|
372
367
|
}
|
|
373
368
|
if (inputRef.current) {
|
|
@@ -390,8 +385,7 @@ class Value extends Component {
|
|
|
390
385
|
}
|
|
391
386
|
}
|
|
392
387
|
componentWillUnmount() {
|
|
393
|
-
|
|
394
|
-
(_a = this.valueInputRef.current) == null ? void 0 : _a.removeEventListener("wheel", this.onWheel);
|
|
388
|
+
this.valueInputRef.current?.removeEventListener("wheel", this.onWheel);
|
|
395
389
|
}
|
|
396
390
|
render() {
|
|
397
391
|
var _ref2 = this.asProps, _ref5;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/input-number",
|
|
3
3
|
"description": "Semrush InputNumber Component",
|
|
4
|
-
"version": "17.0.0-prerelease.
|
|
4
|
+
"version": "17.0.0-prerelease.37",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/input": "^17.0.0-prerelease.
|
|
17
|
+
"@semcore/input": "^17.0.0-prerelease.37"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@semcore/base-components": "^17.0.0 || ^17.0.0-0"
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"directory": "semcore/input-number"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@semcore/core": "17.0.0-prerelease.
|
|
29
|
-
"@semcore/
|
|
30
|
-
"@semcore/
|
|
28
|
+
"@semcore/core": "17.0.0-prerelease.37",
|
|
29
|
+
"@semcore/base-components": "17.0.0-prerelease.37",
|
|
30
|
+
"@semcore/testing-utils": "1.0.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "pnpm semcore-builder --source=js && pnpm vite build"
|