@semcore/input-number 16.0.0-prerelease.6 → 16.0.0-prerelease.9
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/lib/esm/InputNumber.mjs +350 -221
- package/lib/esm/buttons.mjs +10 -9
- package/lib/esm/index.mjs +6 -6
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +30 -30
- package/lib/esm/translations/de.json.mjs +8 -6
- package/lib/esm/translations/en.json.mjs +8 -6
- package/lib/esm/translations/es.json.mjs +8 -6
- package/lib/esm/translations/fr.json.mjs +8 -6
- package/lib/esm/translations/it.json.mjs +8 -6
- package/lib/esm/translations/ja.json.mjs +8 -6
- package/lib/esm/translations/ko.json.mjs +8 -6
- package/lib/esm/translations/nl.json.mjs +8 -6
- package/lib/esm/translations/pl.json.mjs +8 -6
- package/lib/esm/translations/pt.json.mjs +8 -6
- package/lib/esm/translations/sv.json.mjs +8 -6
- package/lib/esm/translations/tr.json.mjs +8 -6
- package/lib/esm/translations/vi.json.mjs +8 -6
- package/lib/esm/translations/zh.json.mjs +8 -6
- package/package.json +4 -4
package/lib/esm/InputNumber.mjs
CHANGED
|
@@ -1,321 +1,450 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { createComponent
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { IncrementIcon
|
|
13
|
-
import { localizedMessages
|
|
14
|
-
import
|
|
15
|
-
import { forkRef
|
|
16
|
-
import { callAllEventHandlers
|
|
17
|
-
var
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
+
import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
|
|
10
|
+
import React from "react";
|
|
11
|
+
import Input from "@semcore/input";
|
|
12
|
+
import { IncrementIcon, DecrementIcon } from "./buttons.mjs";
|
|
13
|
+
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
14
|
+
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
15
|
+
import { forkRef } from "@semcore/core/lib/utils/ref";
|
|
16
|
+
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
17
|
+
var style = (
|
|
18
18
|
/*__reshadow_css_start__*/
|
|
19
|
-
(
|
|
19
|
+
(sstyled.insert(
|
|
20
20
|
/*__inner_css_start__*/
|
|
21
21
|
".___SValue_1l7h4_gg_:focus~.___SControls_1l7h4_gg_{display:flex}.___SControls_1l7h4_gg_{display:none;flex-flow:column;justify-content:center;height:100%;box-sizing:border-box}.___SControls_1l7h4_gg_.__showControls_1l7h4_gg_{display:flex}.___SDown_1l7h4_gg_,.___SUp_1l7h4_gg_{padding:0;width:16px;color:var(--intergalactic-icon-secondary-neutral, #a9abb6);box-sizing:border-box;display:inline-flex;justify-content:center;border:0;background:0 0;cursor:pointer}.___SDown_1l7h4_gg_:focus,.___SUp_1l7h4_gg_:focus{outline:0}@media (hover:hover){.___SDown_1l7h4_gg_:hover,.___SUp_1l7h4_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SUp_1l7h4_gg_{padding-bottom:1px}.___SDown_1l7h4_gg_{padding-top:1px}.___SValue_1l7h4_gg_::-webkit-inner-spin-button,.___SValue_1l7h4_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SValue_1l7h4_gg_._type_number_1l7h4_gg_{-moz-appearance:textfield}.___SValue_1l7h4_gg_.__disabled_1l7h4_gg_~.___SControls_1l7h4_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SValueHidden_1l7h4_gg_{position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden}",
|
|
22
22
|
"1l7h4_gg_"
|
|
23
23
|
), {
|
|
24
|
-
__SValue: "___SValue_1l7h4_gg_",
|
|
25
|
-
__SControls: "___SControls_1l7h4_gg_",
|
|
26
|
-
_showControls: "__showControls_1l7h4_gg_",
|
|
27
|
-
__SUp: "___SUp_1l7h4_gg_",
|
|
28
|
-
__SDown: "___SDown_1l7h4_gg_",
|
|
29
|
-
_disabled: "__disabled_1l7h4_gg_",
|
|
30
|
-
__SValueHidden: "___SValueHidden_1l7h4_gg_",
|
|
31
|
-
_type_number: "_type_number_1l7h4_gg_"
|
|
24
|
+
"__SValue": "___SValue_1l7h4_gg_",
|
|
25
|
+
"__SControls": "___SControls_1l7h4_gg_",
|
|
26
|
+
"_showControls": "__showControls_1l7h4_gg_",
|
|
27
|
+
"__SUp": "___SUp_1l7h4_gg_",
|
|
28
|
+
"__SDown": "___SDown_1l7h4_gg_",
|
|
29
|
+
"_disabled": "__disabled_1l7h4_gg_",
|
|
30
|
+
"__SValueHidden": "___SValueHidden_1l7h4_gg_",
|
|
31
|
+
"_type_number": "_type_number_1l7h4_gg_"
|
|
32
32
|
})
|
|
33
33
|
);
|
|
34
|
-
function
|
|
35
|
-
var
|
|
36
|
-
|
|
34
|
+
function parseValueWithMinMax(value) {
|
|
35
|
+
var min = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MIN_SAFE_INTEGER;
|
|
36
|
+
var max = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Number.MAX_SAFE_INTEGER;
|
|
37
|
+
return Math.max(min, Math.min(max, value));
|
|
37
38
|
}
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
for (var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
(
|
|
52
|
-
})
|
|
39
|
+
var InputNumber = /* @__PURE__ */ function(_Component) {
|
|
40
|
+
_inherits(InputNumber2, _Component);
|
|
41
|
+
var _super = _createSuper(InputNumber2);
|
|
42
|
+
function InputNumber2() {
|
|
43
|
+
var _this;
|
|
44
|
+
_classCallCheck(this, InputNumber2);
|
|
45
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
46
|
+
args[_key] = arguments[_key];
|
|
47
|
+
}
|
|
48
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "inputRef", /* @__PURE__ */ React.createRef());
|
|
50
|
+
_defineProperty(_assertThisInitialized(_this), "increment", function(event) {
|
|
51
|
+
var _this$inputRef$curren, _this$inputRef$curren2;
|
|
52
|
+
(_this$inputRef$curren = _this.inputRef.current) === null || _this$inputRef$curren === void 0 ? void 0 : (_this$inputRef$curren2 = _this$inputRef$curren.stepUp) === null || _this$inputRef$curren2 === void 0 ? void 0 : _this$inputRef$curren2.call(_this$inputRef$curren, event);
|
|
53
|
+
});
|
|
54
|
+
_defineProperty(_assertThisInitialized(_this), "decrement", function(event) {
|
|
55
|
+
var _this$inputRef$curren3, _this$inputRef$curren4;
|
|
56
|
+
(_this$inputRef$curren3 = _this.inputRef.current) === null || _this$inputRef$curren3 === void 0 ? void 0 : (_this$inputRef$curren4 = _this$inputRef$curren3.stepDown) === null || _this$inputRef$curren4 === void 0 ? void 0 : _this$inputRef$curren4.call(_this$inputRef$curren3, event);
|
|
57
|
+
});
|
|
58
|
+
return _this;
|
|
53
59
|
}
|
|
54
|
-
|
|
60
|
+
_createClass(InputNumber2, [{
|
|
55
61
|
key: "getValueProps",
|
|
56
|
-
value: function() {
|
|
57
|
-
var
|
|
62
|
+
value: function getValueProps() {
|
|
63
|
+
var numberFormatter = new Intl.NumberFormat(this.asProps.locale, {
|
|
58
64
|
style: "decimal"
|
|
59
65
|
});
|
|
60
66
|
return {
|
|
61
67
|
inputRef: this.inputRef,
|
|
62
68
|
increment: this.increment,
|
|
63
69
|
decrement: this.decrement,
|
|
64
|
-
numberFormatter
|
|
70
|
+
numberFormatter
|
|
65
71
|
};
|
|
66
72
|
}
|
|
67
73
|
}, {
|
|
68
74
|
key: "getControlsProps",
|
|
69
|
-
value: function() {
|
|
70
|
-
var
|
|
75
|
+
value: function getControlsProps() {
|
|
76
|
+
var _this$asProps = this.asProps, size = _this$asProps.size, getI18nText = _this$asProps.getI18nText;
|
|
71
77
|
return {
|
|
72
|
-
size
|
|
78
|
+
size,
|
|
73
79
|
increment: this.increment,
|
|
74
80
|
decrement: this.decrement,
|
|
75
|
-
getI18nText
|
|
81
|
+
getI18nText
|
|
76
82
|
};
|
|
77
83
|
}
|
|
78
84
|
}, {
|
|
79
85
|
key: "render",
|
|
80
|
-
value: function() {
|
|
81
|
-
var
|
|
82
|
-
|
|
86
|
+
value: function render() {
|
|
87
|
+
var _ref = this.asProps, _ref4;
|
|
88
|
+
var SInputNumber = Input;
|
|
89
|
+
return _ref4 = sstyled(this.asProps.style), /* @__PURE__ */ React.createElement(SInputNumber, _ref4.cn("SInputNumber", _objectSpread({}, assignProps({}, _ref))));
|
|
83
90
|
}
|
|
84
|
-
}])
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
}]);
|
|
92
|
+
return InputNumber2;
|
|
93
|
+
}(Component);
|
|
94
|
+
_defineProperty(InputNumber, "displayName", "InputNumber");
|
|
95
|
+
_defineProperty(InputNumber, "style", style);
|
|
96
|
+
_defineProperty(InputNumber, "enhance", [i18nEnhance(localizedMessages)]);
|
|
97
|
+
_defineProperty(InputNumber, "defaultProps", {
|
|
90
98
|
size: "m",
|
|
91
|
-
i18n:
|
|
99
|
+
i18n: localizedMessages,
|
|
92
100
|
locale: "en"
|
|
93
101
|
});
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
for (var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
var Value = /* @__PURE__ */ function(_Component2) {
|
|
103
|
+
_inherits(Value2, _Component2);
|
|
104
|
+
var _super2 = _createSuper(Value2);
|
|
105
|
+
function Value2() {
|
|
106
|
+
var _this2;
|
|
107
|
+
_classCallCheck(this, Value2);
|
|
108
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
109
|
+
args[_key2] = arguments[_key2];
|
|
110
|
+
}
|
|
111
|
+
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this2), "valueInputRef", /* @__PURE__ */ React.createRef());
|
|
113
|
+
_defineProperty(_assertThisInitialized(_this2), "cursorPosition", -1);
|
|
114
|
+
_defineProperty(_assertThisInitialized(_this2), "getFormattedValue", function(value) {
|
|
115
|
+
return value.replace(new RegExp("[".concat(_this2.separatorThousands, "]"), "g"), "").replace(_this2.separatorDecimal, ".");
|
|
116
|
+
});
|
|
117
|
+
_defineProperty(_assertThisInitialized(_this2), "valueParser", function(value, prevValue, prevDisplayValue) {
|
|
118
|
+
var numberFormatter = _this2.props.numberFormatter;
|
|
119
|
+
var stringNumber = _this2.getFormattedValue(String(value));
|
|
120
|
+
if (Number.isNaN(Number(stringNumber))) {
|
|
107
121
|
return {
|
|
108
|
-
parsedValue:
|
|
109
|
-
displayValue:
|
|
122
|
+
parsedValue: prevValue,
|
|
123
|
+
displayValue: prevDisplayValue
|
|
110
124
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
125
|
+
}
|
|
126
|
+
var displayValue = "";
|
|
127
|
+
if (/\.[0-9]*0$/.test(stringNumber)) {
|
|
128
|
+
var _stringNumber$split = stringNumber.split(_this2.separatorDecimal), _stringNumber$split2 = _slicedToArray(_stringNumber$split, 2), _int = _stringNumber$split2[0], decimal = _stringNumber$split2[1];
|
|
129
|
+
displayValue = numberFormatter.format(_int) + _this2.separatorDecimal + decimal;
|
|
130
|
+
} else if (stringNumber !== "") {
|
|
131
|
+
displayValue = numberFormatter.format(stringNumber);
|
|
132
|
+
}
|
|
116
133
|
return {
|
|
117
|
-
parsedValue:
|
|
118
|
-
displayValue
|
|
134
|
+
parsedValue: stringNumber,
|
|
135
|
+
displayValue
|
|
119
136
|
};
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
137
|
+
});
|
|
138
|
+
_defineProperty(_assertThisInitialized(_this2), "handleValidation", function(event) {
|
|
139
|
+
var _this2$asProps = _this2.asProps, value = _this2$asProps.value, displayValue = _this2$asProps.displayValue, min = _this2$asProps.min, max = _this2$asProps.max, step = _this2$asProps.step;
|
|
140
|
+
var _this2$valueParser = _this2.valueParser(event.currentTarget.value, value, displayValue), parsedValue = _this2$valueParser.parsedValue;
|
|
141
|
+
var roundCoefficient = step < 1 ? step.toString().split(".")[1].length : 1;
|
|
142
|
+
if (Number.isNaN(value) || Number.isNaN(Number.parseFloat(parsedValue))) {
|
|
143
|
+
event.currentTarget.value = "";
|
|
144
|
+
_this2.handlers.value("", event);
|
|
145
|
+
} else {
|
|
146
|
+
var numberValue = parseValueWithMinMax(Number.parseFloat(parsedValue), min, max);
|
|
147
|
+
var rounded = _this2.round(numberValue % step, step);
|
|
148
|
+
if (rounded !== 0) {
|
|
149
|
+
if (rounded >= step / 2) {
|
|
150
|
+
numberValue += step - rounded;
|
|
151
|
+
} else if (Math.abs(rounded) < step) {
|
|
152
|
+
numberValue -= rounded;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
var numberValueRounded = Number(numberValue.toFixed(roundCoefficient));
|
|
156
|
+
_this2.handlers.value(String(numberValueRounded), event);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
_defineProperty(_assertThisInitialized(_this2), "onWheel", function(event) {
|
|
160
|
+
callAllEventHandlers(_this2.asProps.onWheel, _this2.handleWheel)(event);
|
|
161
|
+
});
|
|
162
|
+
_defineProperty(_assertThisInitialized(_this2), "handleWheel", function(event) {
|
|
163
|
+
if (event.target !== _this2.valueInputRef.current) return;
|
|
164
|
+
if (document.activeElement !== _this2.valueInputRef.current) return;
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
if (event.wheelDelta > 0) {
|
|
167
|
+
_this2.stepUp(event);
|
|
168
|
+
} else if (event.wheelDelta < 0) {
|
|
169
|
+
_this2.stepDown(event);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
_defineProperty(_assertThisInitialized(_this2), "handleChange", function(event) {
|
|
173
|
+
var value = _this2.getFormattedValue(event.currentTarget.value);
|
|
174
|
+
var _this2$asProps2 = _this2.asProps, numberFormatter = _this2$asProps2.numberFormatter, prevValue = _this2$asProps2.value;
|
|
175
|
+
if (value === "." || value === "-") {
|
|
176
|
+
_this2.handlers.displayValue(value);
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
if (value.endsWith("-")) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
if (value.endsWith(".")) {
|
|
183
|
+
if (value.length > prevValue.length) {
|
|
184
|
+
_this2.handlers.displayValue(numberFormatter.format(value) + _this2.separatorDecimal);
|
|
185
|
+
return false;
|
|
186
|
+
} else {
|
|
187
|
+
_this2.handlers.value(value.slice(0, -1), event);
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
var digits = /[0-9.-]+/.test(value);
|
|
192
|
+
if (digits || value === "") {
|
|
193
|
+
_this2.handlers.value(value, event);
|
|
129
194
|
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var t = e.currentTarget, a = t.value, u = a.length, i = r.asProps.displayValue;
|
|
148
|
-
if (e.key === "." || e.key === ",") {
|
|
149
|
-
if (a.indexOf(r.separatorDecimal) === -1 && e.key === ",")
|
|
150
|
-
e.currentTarget.value = a + ".";
|
|
151
|
-
else if (a.indexOf(r.separatorDecimal) !== -1) {
|
|
152
|
-
e.preventDefault(), e.stopPropagation();
|
|
195
|
+
});
|
|
196
|
+
_defineProperty(_assertThisInitialized(_this2), "handleKeyUp", function(event) {
|
|
197
|
+
if (event.key === "Shift") {
|
|
198
|
+
_this2.cursorPosition = -1;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
_defineProperty(_assertThisInitialized(_this2), "handleKeyDown", function(event) {
|
|
202
|
+
var element = event.currentTarget;
|
|
203
|
+
var value = element.value;
|
|
204
|
+
var length = value.length;
|
|
205
|
+
var displayValue = _this2.asProps.displayValue;
|
|
206
|
+
if (event.key === "." || event.key === ",") {
|
|
207
|
+
if (value.indexOf(_this2.separatorDecimal) === -1 && event.key === ",") {
|
|
208
|
+
event.currentTarget.value = value + ".";
|
|
209
|
+
} else if (value.indexOf(_this2.separatorDecimal) !== -1) {
|
|
210
|
+
event.preventDefault();
|
|
211
|
+
event.stopPropagation();
|
|
153
212
|
return;
|
|
154
213
|
}
|
|
155
214
|
}
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
215
|
+
if (event.key === "Backspace" && value.endsWith(_this2.separatorDecimal)) {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
event.stopPropagation();
|
|
218
|
+
_this2.handlers.displayValue(displayValue.slice(0, -1));
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
if (element.selectionStart !== length && (event.key === "Backspace" || event.key === _this2.separatorDecimal || ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"].includes(event.key))) {
|
|
222
|
+
var afterSelection = value.slice(element.selectionEnd);
|
|
160
223
|
requestAnimationFrame(function() {
|
|
161
|
-
var
|
|
162
|
-
|
|
224
|
+
var newValue = _this2.state.displayValue;
|
|
225
|
+
var index = newValue.lastIndexOf(afterSelection);
|
|
226
|
+
var selectionStart = index;
|
|
227
|
+
var selectionEnd = index;
|
|
228
|
+
element.setSelectionRange(selectionStart, selectionEnd);
|
|
163
229
|
});
|
|
164
230
|
}
|
|
165
|
-
var
|
|
166
|
-
|
|
231
|
+
var cursorIndex = 2;
|
|
232
|
+
if (event.shiftKey && _this2.cursorPosition === -1) {
|
|
233
|
+
_this2.cursorPosition = element.selectionStart;
|
|
234
|
+
}
|
|
235
|
+
switch (event.key) {
|
|
167
236
|
case "ArrowLeft": {
|
|
168
|
-
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
_this2.moveSelectionLeft(element, cursorIndex);
|
|
169
239
|
break;
|
|
170
240
|
}
|
|
171
241
|
case "ArrowRight": {
|
|
172
|
-
|
|
242
|
+
event.preventDefault();
|
|
243
|
+
_this2.moveSelectionRight(element, cursorIndex);
|
|
173
244
|
break;
|
|
174
245
|
}
|
|
175
246
|
case "ArrowDown": {
|
|
176
|
-
|
|
247
|
+
event.preventDefault();
|
|
248
|
+
_this2.stepDown(event);
|
|
177
249
|
break;
|
|
178
250
|
}
|
|
179
251
|
case "ArrowUp": {
|
|
180
|
-
|
|
252
|
+
event.preventDefault();
|
|
253
|
+
_this2.stepUp(event);
|
|
181
254
|
break;
|
|
182
255
|
}
|
|
183
256
|
}
|
|
184
|
-
})
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
257
|
+
});
|
|
258
|
+
_defineProperty(_assertThisInitialized(_this2), "moveSelectionLeft", function(element, cursorIndex) {
|
|
259
|
+
var value = element.value;
|
|
260
|
+
var nextPosition = element.selectionStart - 1 >= 0 ? element.selectionStart - 1 : 0;
|
|
261
|
+
var cursorPosition = value[element.selectionStart - cursorIndex] === _this2.separatorThousands ? element.selectionStart - cursorIndex : nextPosition;
|
|
262
|
+
if (_this2.cursorPosition === -1) {
|
|
263
|
+
element.setSelectionRange(cursorPosition, cursorPosition);
|
|
264
|
+
} else {
|
|
265
|
+
if (element.selectionStart <= _this2.cursorPosition && element.selectionEnd === _this2.cursorPosition) {
|
|
266
|
+
element.setSelectionRange(cursorPosition, element.selectionEnd);
|
|
267
|
+
} else {
|
|
268
|
+
element.setSelectionRange(element.selectionStart, value[element.selectionEnd - cursorIndex] === _this2.separatorThousands ? element.selectionEnd - cursorIndex : element.selectionEnd - 1);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
_defineProperty(_assertThisInitialized(_this2), "moveSelectionRight", function(element, cursorIndex) {
|
|
273
|
+
var value = element.value;
|
|
274
|
+
var nextPosition = element.selectionEnd + 1;
|
|
275
|
+
var cursorPosition = value[element.selectionEnd] === _this2.separatorThousands ? element.selectionEnd + cursorIndex : nextPosition;
|
|
276
|
+
if (_this2.cursorPosition === -1) {
|
|
277
|
+
element.setSelectionRange(cursorPosition, cursorPosition);
|
|
278
|
+
} else {
|
|
279
|
+
if (element.selectionEnd >= _this2.cursorPosition && element.selectionStart === _this2.cursorPosition) {
|
|
280
|
+
element.setSelectionRange(element.selectionStart, cursorPosition);
|
|
281
|
+
} else {
|
|
282
|
+
element.setSelectionRange(value[element.selectionStart] === _this2.separatorThousands ? element.selectionStart + cursorIndex : element.selectionStart + 1, element.selectionEnd);
|
|
283
|
+
}
|
|
200
284
|
}
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
285
|
+
});
|
|
286
|
+
_defineProperty(_assertThisInitialized(_this2), "handleClick", function(event) {
|
|
287
|
+
var element = event.target;
|
|
288
|
+
var value = element.value;
|
|
289
|
+
if (value[element.selectionStart - 1] === _this2.separatorThousands) {
|
|
290
|
+
element.setSelectionRange(element.selectionStart - 1, element.selectionEnd - 1);
|
|
206
291
|
}
|
|
207
|
-
})
|
|
292
|
+
});
|
|
293
|
+
_defineProperty(_assertThisInitialized(_this2), "handleBlur", function(event) {
|
|
294
|
+
_this2.cursorPosition = -1;
|
|
295
|
+
_this2.handleValidation(event);
|
|
296
|
+
});
|
|
297
|
+
_defineProperty(_assertThisInitialized(_this2), "stepUp", function(event) {
|
|
298
|
+
var _this2$asProps3 = _this2.asProps, _this2$asProps3$max = _this2$asProps3.max, max = _this2$asProps3$max === void 0 ? Number.MAX_SAFE_INTEGER : _this2$asProps3$max, min = _this2$asProps3.min, step = _this2$asProps3.step, value = _this2$asProps3.value;
|
|
299
|
+
var numberValue;
|
|
300
|
+
if (value === "") {
|
|
301
|
+
numberValue = min !== null && min !== void 0 ? min : 0;
|
|
302
|
+
} else {
|
|
303
|
+
numberValue = Number.parseFloat(value);
|
|
304
|
+
}
|
|
305
|
+
if (!Number.isNaN(numberValue)) {
|
|
306
|
+
var newValue = numberValue + step <= max ? numberValue + step : max;
|
|
307
|
+
_this2.handlers.value(newValue.toString(), event);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
_defineProperty(_assertThisInitialized(_this2), "stepDown", function(event) {
|
|
311
|
+
var _this2$asProps4 = _this2.asProps, max = _this2$asProps4.max, _this2$asProps4$min = _this2$asProps4.min, min = _this2$asProps4$min === void 0 ? Number.MIN_SAFE_INTEGER : _this2$asProps4$min, step = _this2$asProps4.step, value = _this2$asProps4.value;
|
|
312
|
+
var numberValue;
|
|
313
|
+
if (value === "") {
|
|
314
|
+
numberValue = max !== null && max !== void 0 ? max : 0;
|
|
315
|
+
} else {
|
|
316
|
+
numberValue = Number.parseFloat(value);
|
|
317
|
+
}
|
|
318
|
+
if (!Number.isNaN(numberValue)) {
|
|
319
|
+
var newValue = numberValue - step >= min ? numberValue - step : min;
|
|
320
|
+
_this2.handlers.value(newValue.toString(), event);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
return _this2;
|
|
208
324
|
}
|
|
209
|
-
|
|
325
|
+
_createClass(Value2, [{
|
|
210
326
|
key: "uncontrolledProps",
|
|
211
|
-
value: function() {
|
|
212
|
-
var
|
|
327
|
+
value: function uncontrolledProps() {
|
|
328
|
+
var _this3 = this;
|
|
213
329
|
return {
|
|
214
330
|
displayValue: null,
|
|
215
|
-
value: [null, function(
|
|
216
|
-
var
|
|
217
|
-
|
|
331
|
+
value: [null, function(newValue) {
|
|
332
|
+
var _this3$asProps = _this3.asProps, prevValue = _this3$asProps.value, prevDisplayValue = _this3$asProps.displayValue;
|
|
333
|
+
var _this3$valueParser = _this3.valueParser(newValue, prevValue, prevDisplayValue), parsedValue = _this3$valueParser.parsedValue, displayValue = _this3$valueParser.displayValue;
|
|
334
|
+
_this3.handlers.displayValue(displayValue);
|
|
335
|
+
return parsedValue;
|
|
218
336
|
}]
|
|
219
337
|
};
|
|
220
338
|
}
|
|
221
339
|
}, {
|
|
222
340
|
key: "separatorDecimal",
|
|
223
|
-
get: function() {
|
|
224
|
-
var
|
|
225
|
-
return
|
|
341
|
+
get: function get() {
|
|
342
|
+
var numberFormatter = this.props.numberFormatter;
|
|
343
|
+
return numberFormatter.format(11.11).replace(/\d/g, "");
|
|
226
344
|
}
|
|
227
345
|
}, {
|
|
228
346
|
key: "separatorThousands",
|
|
229
|
-
get: function() {
|
|
230
|
-
var
|
|
231
|
-
return
|
|
347
|
+
get: function get() {
|
|
348
|
+
var numberFormatter = this.props.numberFormatter;
|
|
349
|
+
return numberFormatter.format(1111).replace(/\d/g, "");
|
|
232
350
|
}
|
|
233
351
|
}, {
|
|
234
352
|
key: "round",
|
|
235
|
-
value: function(
|
|
236
|
-
var
|
|
237
|
-
return
|
|
353
|
+
value: function round(value, step) {
|
|
354
|
+
var countDecimals = Math.floor(step) === step ? 0 : step.toString().split(".")[1].length || 0;
|
|
355
|
+
return countDecimals === 0 ? Number.parseFloat(value) : Number.parseFloat(value).toPrecision(countDecimals);
|
|
238
356
|
}
|
|
239
357
|
}, {
|
|
240
358
|
key: "componentDidMount",
|
|
241
359
|
value: (
|
|
242
360
|
// https://stackoverflow.com/questions/57358640/cancel-wheel-event-with-e-preventdefault-in-react-event-bubbling
|
|
243
|
-
function() {
|
|
244
|
-
var
|
|
245
|
-
(
|
|
246
|
-
var
|
|
247
|
-
if (
|
|
248
|
-
|
|
249
|
-
this.
|
|
361
|
+
function componentDidMount() {
|
|
362
|
+
var _this$valueInputRef$c;
|
|
363
|
+
(_this$valueInputRef$c = this.valueInputRef.current) === null || _this$valueInputRef$c === void 0 ? void 0 : _this$valueInputRef$c.addEventListener("wheel", this.onWheel);
|
|
364
|
+
var _this$asProps2 = this.asProps, inputRef = _this$asProps2.inputRef, value = _this$asProps2.value;
|
|
365
|
+
if (inputRef.current) {
|
|
366
|
+
inputRef.current.stepUp = this.stepUp;
|
|
367
|
+
inputRef.current.stepDown = this.stepDown;
|
|
368
|
+
}
|
|
369
|
+
if (value !== "") {
|
|
370
|
+
var _this$valueParser = this.valueParser(value, "", ""), displayValue = _this$valueParser.displayValue;
|
|
371
|
+
this.handlers.displayValue(displayValue);
|
|
250
372
|
}
|
|
251
373
|
}
|
|
252
374
|
)
|
|
253
375
|
}, {
|
|
254
376
|
key: "componentDidUpdate",
|
|
255
|
-
value: function(
|
|
256
|
-
if (
|
|
257
|
-
var
|
|
258
|
-
this.handlers.displayValue(
|
|
377
|
+
value: function componentDidUpdate(prevProps) {
|
|
378
|
+
if (prevProps.value !== this.props.value) {
|
|
379
|
+
var _this$valueParser2 = this.valueParser(this.props.value, prevProps.value, prevProps.displayValue), displayValue = _this$valueParser2.displayValue;
|
|
380
|
+
this.handlers.displayValue(displayValue);
|
|
259
381
|
}
|
|
260
382
|
}
|
|
261
383
|
}, {
|
|
262
384
|
key: "componentWillUnmount",
|
|
263
|
-
value: function() {
|
|
264
|
-
var
|
|
265
|
-
(
|
|
385
|
+
value: function componentWillUnmount() {
|
|
386
|
+
var _this$valueInputRef$c2;
|
|
387
|
+
(_this$valueInputRef$c2 = this.valueInputRef.current) === null || _this$valueInputRef$c2 === void 0 ? void 0 : _this$valueInputRef$c2.removeEventListener("wheel", this.onWheel);
|
|
266
388
|
}
|
|
267
389
|
}, {
|
|
268
390
|
key: "render",
|
|
269
|
-
value: function() {
|
|
270
|
-
var
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
391
|
+
value: function render() {
|
|
392
|
+
var _ref2 = this.asProps, _ref5;
|
|
393
|
+
var SValue = Input.Value;
|
|
394
|
+
var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, min = _this$asProps3.min, max = _this$asProps3.max, step = _this$asProps3.step, forwardRef = _this$asProps3.forwardRef, inputRef = _this$asProps3.inputRef, displayValue = _this$asProps3.displayValue;
|
|
395
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SValue, _ref5.cn("SValue", _objectSpread({}, assignProps({
|
|
396
|
+
"autoComplete": "off",
|
|
397
|
+
"onBlur": this.handleValidation,
|
|
274
398
|
"use:onChange": this.handleChange,
|
|
275
|
-
onKeyDown: this.handleKeyDown,
|
|
276
|
-
onKeyUp: this.handleKeyUp,
|
|
277
|
-
onClick: this.handleClick,
|
|
278
|
-
"use:ref":
|
|
279
|
-
"use:value":
|
|
280
|
-
inputMode: Number.isInteger(
|
|
281
|
-
min:
|
|
282
|
-
max:
|
|
283
|
-
step:
|
|
284
|
-
},
|
|
399
|
+
"onKeyDown": this.handleKeyDown,
|
|
400
|
+
"onKeyUp": this.handleKeyUp,
|
|
401
|
+
"onClick": this.handleClick,
|
|
402
|
+
"use:ref": forkRef(this.valueInputRef, inputRef, forwardRef),
|
|
403
|
+
"use:value": displayValue,
|
|
404
|
+
"inputMode": Number.isInteger(step) ? "numeric" : "decimal",
|
|
405
|
+
"min": min,
|
|
406
|
+
"max": max,
|
|
407
|
+
"step": step
|
|
408
|
+
}, _ref2)))));
|
|
285
409
|
}
|
|
286
|
-
}])
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
410
|
+
}]);
|
|
411
|
+
return Value2;
|
|
412
|
+
}(Component);
|
|
413
|
+
_defineProperty(Value, "style", style);
|
|
414
|
+
_defineProperty(Value, "defaultProps", {
|
|
290
415
|
defaultValue: "",
|
|
291
416
|
defaultDisplayValue: "",
|
|
292
417
|
step: 1
|
|
293
418
|
});
|
|
294
|
-
function
|
|
295
|
-
var
|
|
296
|
-
|
|
419
|
+
function Controls(props) {
|
|
420
|
+
var _ref3 = arguments[0], _ref6;
|
|
421
|
+
var Children = props.Children, increment = props.increment, decrement = props.decrement, size = props.size, styles = props.styles, getI18nText = props.getI18nText;
|
|
422
|
+
var SControls = Input.Addon;
|
|
423
|
+
var SUp = "button";
|
|
424
|
+
var SDown = "button";
|
|
425
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SControls, _ref6.cn("SControls", _objectSpread({}, assignProps({
|
|
297
426
|
"aria-hidden": "true"
|
|
298
|
-
},
|
|
299
|
-
onClick:
|
|
300
|
-
tabIndex: -1,
|
|
301
|
-
type: "button",
|
|
302
|
-
size:
|
|
303
|
-
"aria-label":
|
|
304
|
-
}), /* @__PURE__ */
|
|
305
|
-
onClick:
|
|
306
|
-
tabIndex: -1,
|
|
307
|
-
type: "button",
|
|
308
|
-
size:
|
|
309
|
-
"aria-label":
|
|
310
|
-
}), /* @__PURE__ */
|
|
427
|
+
}, _ref3))), /* @__PURE__ */ React.createElement(SUp, _ref6.cn("SUp", {
|
|
428
|
+
"onClick": increment,
|
|
429
|
+
"tabIndex": -1,
|
|
430
|
+
"type": "button",
|
|
431
|
+
"size": size,
|
|
432
|
+
"aria-label": getI18nText("increment")
|
|
433
|
+
}), /* @__PURE__ */ React.createElement(IncrementIcon, _ref6.cn("IncrementIcon", {}))), /* @__PURE__ */ React.createElement(SDown, _ref6.cn("SDown", {
|
|
434
|
+
"onClick": decrement,
|
|
435
|
+
"tabIndex": -1,
|
|
436
|
+
"type": "button",
|
|
437
|
+
"size": size,
|
|
438
|
+
"aria-label": getI18nText("decrement")
|
|
439
|
+
}), /* @__PURE__ */ React.createElement(DecrementIcon, _ref6.cn("DecrementIcon", {}))), /* @__PURE__ */ React.createElement(Children, _ref6.cn("Children", {})));
|
|
311
440
|
}
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
Value
|
|
315
|
-
Controls
|
|
316
|
-
Addon:
|
|
441
|
+
Controls.style = style;
|
|
442
|
+
const InputNumber$1 = createComponent(InputNumber, {
|
|
443
|
+
Value,
|
|
444
|
+
Controls,
|
|
445
|
+
Addon: Input.Addon
|
|
317
446
|
});
|
|
318
447
|
export {
|
|
319
|
-
|
|
320
|
-
|
|
448
|
+
InputNumber$1 as default,
|
|
449
|
+
parseValueWithMinMax
|
|
321
450
|
};
|
package/lib/esm/buttons.mjs
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
return /* @__PURE__ */
|
|
1
|
+
import React from "react";
|
|
2
|
+
var IncrementIcon = function IncrementIcon2() {
|
|
3
|
+
return /* @__PURE__ */ React.createElement("svg", {
|
|
4
4
|
fill: "currentColor",
|
|
5
5
|
width: "10",
|
|
6
6
|
height: "5",
|
|
7
7
|
viewBox: "0 0 10 5"
|
|
8
|
-
}, /* @__PURE__ */
|
|
8
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
9
9
|
d: "M0,5l5,-5l5,5Z"
|
|
10
10
|
}));
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
};
|
|
12
|
+
var DecrementIcon = function DecrementIcon2() {
|
|
13
|
+
return /* @__PURE__ */ React.createElement("svg", {
|
|
13
14
|
fill: "currentColor",
|
|
14
15
|
width: "10",
|
|
15
16
|
height: "5",
|
|
16
17
|
viewBox: "0 0 10 5"
|
|
17
|
-
}, /* @__PURE__ */
|
|
18
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
18
19
|
d: "M0,0l10,0l-5,5Z"
|
|
19
20
|
}));
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
DecrementIcon,
|
|
24
|
+
IncrementIcon
|
|
24
25
|
};
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { DecrementIcon
|
|
1
|
+
import { default as default2, parseValueWithMinMax } from "./InputNumber.mjs";
|
|
2
|
+
import { DecrementIcon, IncrementIcon } from "./buttons.mjs";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
DecrementIcon,
|
|
5
|
+
IncrementIcon,
|
|
6
|
+
default2 as default,
|
|
7
|
+
parseValueWithMinMax
|
|
8
8
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
var
|
|
16
|
-
de
|
|
17
|
-
en
|
|
18
|
-
es
|
|
19
|
-
fr
|
|
20
|
-
it
|
|
21
|
-
ja
|
|
22
|
-
ko
|
|
23
|
-
nl
|
|
24
|
-
pt
|
|
25
|
-
tr
|
|
26
|
-
vi
|
|
27
|
-
zh
|
|
28
|
-
pl
|
|
29
|
-
sv
|
|
1
|
+
import de from "./de.json.mjs";
|
|
2
|
+
import en from "./en.json.mjs";
|
|
3
|
+
import es from "./es.json.mjs";
|
|
4
|
+
import fr from "./fr.json.mjs";
|
|
5
|
+
import it from "./it.json.mjs";
|
|
6
|
+
import ja from "./ja.json.mjs";
|
|
7
|
+
import ko from "./ko.json.mjs";
|
|
8
|
+
import nl from "./nl.json.mjs";
|
|
9
|
+
import pt from "./pt.json.mjs";
|
|
10
|
+
import tr from "./tr.json.mjs";
|
|
11
|
+
import vi from "./vi.json.mjs";
|
|
12
|
+
import zh from "./zh.json.mjs";
|
|
13
|
+
import pl from "./pl.json.mjs";
|
|
14
|
+
import sv from "./sv.json.mjs";
|
|
15
|
+
var localizedMessages = {
|
|
16
|
+
de,
|
|
17
|
+
en,
|
|
18
|
+
es,
|
|
19
|
+
fr,
|
|
20
|
+
it,
|
|
21
|
+
ja,
|
|
22
|
+
ko,
|
|
23
|
+
nl,
|
|
24
|
+
pt,
|
|
25
|
+
tr,
|
|
26
|
+
vi,
|
|
27
|
+
zh,
|
|
28
|
+
pl,
|
|
29
|
+
sv
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
localizedMessages
|
|
33
33
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Zahl erhöhen";
|
|
2
|
+
const decrement = "Zahl verringern";
|
|
3
|
+
const de = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
de as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Increment number";
|
|
2
|
+
const decrement = "Decrement number";
|
|
3
|
+
const en = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
en as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Incrementar número";
|
|
2
|
+
const decrement = "Descenso de número";
|
|
3
|
+
const es = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
es as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Incrémenter le nombre";
|
|
2
|
+
const decrement = "Décrémenter le nombre";
|
|
3
|
+
const fr = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
fr as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Aumenta il numero";
|
|
2
|
+
const decrement = "Riduci il numero";
|
|
3
|
+
const it = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
it as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "上昇番号";
|
|
2
|
+
const decrement = "下降番号";
|
|
3
|
+
const ja = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
ja as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "더 큰 숫자 입력";
|
|
2
|
+
const decrement = "더 작은 숫자 입력";
|
|
3
|
+
const ko = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
ko as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Nummer verhogen";
|
|
2
|
+
const decrement = "Nummer verlagen";
|
|
3
|
+
const nl = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
nl as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Zwiększ liczbę";
|
|
2
|
+
const decrement = "Zmniejsz liczbę";
|
|
3
|
+
const pl = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
pl as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Aumentar número";
|
|
2
|
+
const decrement = "Diminuir número";
|
|
3
|
+
const pt = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
pt as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Ökning av antal";
|
|
2
|
+
const decrement = "Minskning av antal";
|
|
3
|
+
const sv = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
sv as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Sayıyı artır";
|
|
2
|
+
const decrement = "Sayıyı azalt";
|
|
3
|
+
const tr = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
tr as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "Tăng số";
|
|
2
|
+
const decrement = "Giảm số";
|
|
3
|
+
const vi = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
vi as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const increment = "增量";
|
|
2
|
+
const decrement = "减量";
|
|
3
|
+
const zh = {
|
|
4
|
+
increment,
|
|
5
|
+
decrement
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decrement,
|
|
9
|
+
zh as default,
|
|
10
|
+
increment
|
|
9
11
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/input-number",
|
|
3
3
|
"description": "Semrush InputNumber Component",
|
|
4
|
-
"version": "16.0.0-prerelease.
|
|
4
|
+
"version": "16.0.0-prerelease.9",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/input": "16.0.0-prerelease.
|
|
18
|
-
"@semcore/flex-box": "16.0.0-prerelease.
|
|
17
|
+
"@semcore/input": "16.0.0-prerelease.9",
|
|
18
|
+
"@semcore/flex-box": "16.0.0-prerelease.9"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@semcore/base-components": "^16.0.0-prerelease.
|
|
21
|
+
"@semcore/base-components": "^16.0.0-prerelease.9"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|