@jetbrains/ring-ui 6.0.41 → 6.0.42
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.
|
@@ -43,6 +43,6 @@ export default class DateInput extends React.PureComponent<DateInputProps> {
|
|
|
43
43
|
inputRef: (el: HTMLInputElement | null) => void;
|
|
44
44
|
updateInput({ text, active }: UpdateInputConfig): void;
|
|
45
45
|
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
46
|
-
handleKeyDown: (e: React.KeyboardEvent) =>
|
|
46
|
+
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
47
47
|
render(): React.JSX.Element;
|
|
48
48
|
}
|
|
@@ -56,7 +56,16 @@ export default class DateInput extends React.PureComponent {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
handleChange = (e) => this.props.onInput(e.currentTarget.value, e.currentTarget.dataset.name);
|
|
59
|
-
handleKeyDown = (e) =>
|
|
59
|
+
handleKeyDown = (e) => {
|
|
60
|
+
if (e.key === 'Enter') {
|
|
61
|
+
// We have to prevent the default behavior, because restoring focus by TabTrap caused by
|
|
62
|
+
// pressing Enter will trigger the onClick event on the DatePicker Dropdown anchor,
|
|
63
|
+
// so DatePicker will be open again.
|
|
64
|
+
// https://youtrack.jetbrains.com/issue/RG-2450/Anchor-should-be-focused-after-closing-datepicker#focus=Comments-27-10044234.0-0.
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
this.props.onConfirm();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
60
69
|
render() {
|
|
61
70
|
const { active, divider, text, time, name, hoverDate, date, displayFormat, translations, onActivate, onClear, fromPlaceholder, toPlaceholder, timePlaceholder, locale } = this.props;
|
|
62
71
|
const { translate } = this.context;
|
|
@@ -55,16 +55,11 @@ const TabTrap = forwardRef(function TabTrap({ children, trapDisabled = false, au
|
|
|
55
55
|
if (previousFocusedNode instanceof HTMLElement &&
|
|
56
56
|
previousFocusedNode.focus &&
|
|
57
57
|
isNodeInVisiblePartOfPage(previousFocusedNode)) {
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// componentWillUnmount is called in StrictMode.
|
|
64
|
-
if (!mountedRef.current) {
|
|
65
|
-
previousFocusedNode.focus({ preventScroll: true });
|
|
66
|
-
}
|
|
67
|
-
});
|
|
58
|
+
// This is to prevent the focus from being restored the first time
|
|
59
|
+
// componentWillUnmount is called in StrictMode.
|
|
60
|
+
if (!mountedRef.current) {
|
|
61
|
+
previousFocusedNode.focus({ preventScroll: true });
|
|
62
|
+
}
|
|
68
63
|
}
|
|
69
64
|
}
|
|
70
65
|
function focusElement(first = true) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.42",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": "JetBrains",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -88,16 +88,16 @@
|
|
|
88
88
|
"@rollup/plugin-json": "^6.1.0",
|
|
89
89
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
90
90
|
"@rollup/plugin-replace": "^5.0.7",
|
|
91
|
-
"@storybook/addon-a11y": "8.1.
|
|
92
|
-
"@storybook/addon-docs": "8.1.
|
|
93
|
-
"@storybook/addon-essentials": "8.1.
|
|
94
|
-
"@storybook/components": "8.1.
|
|
95
|
-
"@storybook/manager-api": "8.1.
|
|
96
|
-
"@storybook/preview-api": "8.1.
|
|
97
|
-
"@storybook/react": "8.1.
|
|
98
|
-
"@storybook/react-webpack5": "8.1.
|
|
99
|
-
"@storybook/test-runner": "^0.
|
|
100
|
-
"@storybook/theming": "8.1.
|
|
91
|
+
"@storybook/addon-a11y": "8.1.11",
|
|
92
|
+
"@storybook/addon-docs": "8.1.11",
|
|
93
|
+
"@storybook/addon-essentials": "8.1.11",
|
|
94
|
+
"@storybook/components": "8.1.11",
|
|
95
|
+
"@storybook/manager-api": "8.1.11",
|
|
96
|
+
"@storybook/preview-api": "8.1.11",
|
|
97
|
+
"@storybook/react": "8.1.11",
|
|
98
|
+
"@storybook/react-webpack5": "8.1.11",
|
|
99
|
+
"@storybook/test-runner": "^0.19.0",
|
|
100
|
+
"@storybook/theming": "8.1.11",
|
|
101
101
|
"@testing-library/dom": "^10.3.1",
|
|
102
102
|
"@testing-library/react": "^16.0.0",
|
|
103
103
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
138
138
|
"eslint-plugin-storybook": "^0.8.0",
|
|
139
139
|
"events": "^3.3.0",
|
|
140
|
-
"glob": "^10.4.
|
|
140
|
+
"glob": "^10.4.3",
|
|
141
141
|
"html-webpack-plugin": "^5.6.0",
|
|
142
142
|
"http-server": "^14.1.1",
|
|
143
143
|
"husky": "^9.0.11",
|
|
@@ -155,14 +155,14 @@
|
|
|
155
155
|
"react-dom": "^18.3.1",
|
|
156
156
|
"react-test-renderer": "^18.3.1",
|
|
157
157
|
"regenerator-runtime": "^0.14.1",
|
|
158
|
-
"rimraf": "^5.0.
|
|
158
|
+
"rimraf": "^5.0.8",
|
|
159
159
|
"rollup": "^4.18.0",
|
|
160
160
|
"rollup-plugin-clear": "^2.0.7",
|
|
161
161
|
"rollup-plugin-styles": "^4.0.0",
|
|
162
162
|
"sinon": "^18.0.0",
|
|
163
163
|
"sinon-chai": "^3.7.0",
|
|
164
164
|
"storage-mock": "^2.1.0",
|
|
165
|
-
"storybook": "8.1.
|
|
165
|
+
"storybook": "8.1.11",
|
|
166
166
|
"storybook-addon-themes": "^6.1.0",
|
|
167
167
|
"stylelint": "^16.6.1",
|
|
168
168
|
"svg-inline-loader": "^0.8.2",
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
"postcss-font-family-system-ui": "^5.0.0",
|
|
233
233
|
"postcss-loader": "^8.1.1",
|
|
234
234
|
"postcss-modules-values-replace": "^4.2.0",
|
|
235
|
-
"postcss-preset-env": "^9.
|
|
235
|
+
"postcss-preset-env": "^9.6.0",
|
|
236
236
|
"prop-types": "^15.8.1",
|
|
237
237
|
"react-movable": "^3.2.0",
|
|
238
238
|
"react-virtualized": "^9.22.5",
|