@os-design/core 1.0.266 → 1.0.268
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/InputNumber/index.tsx"],"names":[],"mappings":"AASA,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAsB,EACpB,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IACvD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5C;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AAOD;;GAEG;AACH,QAAA,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/InputNumber/index.tsx"],"names":[],"mappings":"AASA,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAsB,EACpB,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IACvD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5C;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AAOD;;GAEG;AACH,QAAA,MAAM,WAAW,+GAuHhB,CAAC;AAIF,eAAe,WAAW,CAAC"}
|
|
@@ -19,7 +19,6 @@ const InputNumber = /*#__PURE__*/forwardRef(({
|
|
|
19
19
|
value = null,
|
|
20
20
|
onChange = () => {},
|
|
21
21
|
onSelect = () => {},
|
|
22
|
-
onFocus = () => {},
|
|
23
22
|
...rest
|
|
24
23
|
}, ref) => {
|
|
25
24
|
useValidate({
|
|
@@ -73,14 +72,6 @@ const InputNumber = /*#__PURE__*/forwardRef(({
|
|
|
73
72
|
});
|
|
74
73
|
onSelect(e);
|
|
75
74
|
},
|
|
76
|
-
onFocus: e => {
|
|
77
|
-
// Move the caret to the end of the input value and before the suffix
|
|
78
|
-
setSelection({
|
|
79
|
-
start: getCaretWithinValue(valueString.length, valueString),
|
|
80
|
-
end: getCaretWithinValue(valueString.length, valueString)
|
|
81
|
-
});
|
|
82
|
-
onFocus(e);
|
|
83
|
-
},
|
|
84
75
|
value: valueString,
|
|
85
76
|
onChange: (v, e) => {
|
|
86
77
|
// Get a new value as a string and number
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimePicker/index.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC;IACxE;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;CAClC;AAOD;;GAEG;AACH,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimePicker/index.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC;IACxE;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;CAClC;AAOD;;GAEG;AACH,QAAA,MAAM,UAAU,8GAqGf,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
package/dist/TimePicker/index.js
CHANGED
|
@@ -36,7 +36,12 @@ const TimePicker = /*#__PURE__*/forwardRef(({
|
|
|
36
36
|
} = useTime({
|
|
37
37
|
notation,
|
|
38
38
|
selection,
|
|
39
|
-
setSelection
|
|
39
|
+
setSelection: nextSelection => {
|
|
40
|
+
if (inputRef.current) {
|
|
41
|
+
inputRef.current.setSelectionRange(nextSelection.start, nextSelection.end);
|
|
42
|
+
}
|
|
43
|
+
setSelection(nextSelection);
|
|
44
|
+
},
|
|
40
45
|
forwardedValue,
|
|
41
46
|
setForwardedValue
|
|
42
47
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.268",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design.git",
|
|
6
6
|
"type": "module",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": "18",
|
|
59
59
|
"react-dom": "18"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "f0fa83bbb9597b879a8e1b421cc3d776dc370cc2"
|
|
62
62
|
}
|
|
@@ -89,7 +89,6 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(
|
|
|
89
89
|
value = null,
|
|
90
90
|
onChange = () => {},
|
|
91
91
|
onSelect = () => {},
|
|
92
|
-
onFocus = () => {},
|
|
93
92
|
...rest
|
|
94
93
|
},
|
|
95
94
|
ref
|
|
@@ -153,14 +152,6 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(
|
|
|
153
152
|
setSelection({ start: selectionStart || 0, end: selectionEnd || 0 });
|
|
154
153
|
onSelect(e);
|
|
155
154
|
}}
|
|
156
|
-
onFocus={(e) => {
|
|
157
|
-
// Move the caret to the end of the input value and before the suffix
|
|
158
|
-
setSelection({
|
|
159
|
-
start: getCaretWithinValue(valueString.length, valueString),
|
|
160
|
-
end: getCaretWithinValue(valueString.length, valueString),
|
|
161
|
-
});
|
|
162
|
-
onFocus(e);
|
|
163
|
-
}}
|
|
164
155
|
value={valueString}
|
|
165
156
|
onChange={(v, e) => {
|
|
166
157
|
// Get a new value as a string and number
|
package/src/TimePicker/index.tsx
CHANGED
|
@@ -62,7 +62,15 @@ const TimePicker = forwardRef<HTMLInputElement, TimePickerProps>(
|
|
|
62
62
|
const { time, isPm, changePeriod, keyHandler } = useTime({
|
|
63
63
|
notation,
|
|
64
64
|
selection,
|
|
65
|
-
setSelection
|
|
65
|
+
setSelection: (nextSelection) => {
|
|
66
|
+
if (inputRef.current) {
|
|
67
|
+
inputRef.current.setSelectionRange(
|
|
68
|
+
nextSelection.start,
|
|
69
|
+
nextSelection.end
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
setSelection(nextSelection);
|
|
73
|
+
},
|
|
66
74
|
forwardedValue,
|
|
67
75
|
setForwardedValue,
|
|
68
76
|
});
|